Skip to content

Commit

Permalink
Merge pull request #97 from ls1intum/develop
Browse files Browse the repository at this point in the history
Update Jhipster and Springboot
  • Loading branch information
valentin-boehm authored Jan 8, 2024
2 parents 47f42a8 + 909f47d commit e43dda0
Show file tree
Hide file tree
Showing 24 changed files with 80 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .yo-rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"enableTranslation": false,
"entities": [],
"gradleEnterpriseHost": null,
"jhipsterVersion": "8.0.0",
"jhipsterVersion": "8.1.0",
"jwtSecretKey": "YjQzZmE3YzMxODc2NDE1NDY1M2JlYjQxMjhjZWNiOGU1OWM1ZGFhYmY1OWU5ODI0MWMwMDYwY2ZlZDUwZWUzOWY2OGRmY2EwMDJlODY4NGFiNWNmZjhjMWUyZDRjY2IxZTIxOTBlZGI0NzRlMDJjNGNlMTcwZjE2ODRmMjUxNjc=",
"messageBroker": false,
"microfrontend": null,
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Artemis-Benchmarking

This application was generated using JHipster 8.0.0, you can find documentation and help at [https://www.jhipster.tech/documentation-archive/v8.0.0](https://www.jhipster.tech/documentation-archive/v8.0.0).
This application was generated using JHipster 8.1.0, you can find documentation and help at [https://www.jhipster.tech/documentation-archive/v8.1.0](https://www.jhipster.tech/documentation-archive/v8.1.0).

## Project Structure

Expand Down Expand Up @@ -74,7 +74,7 @@ The `npm run` command will list all of the scripts available to run for this pro

JHipster ships with PWA (Progressive Web App) support, and it's turned off by default. One of the main components of a PWA is a service worker.

The service worker initialization code is disabled by default. To enable it, uncomment the following code in `src/main/webapp/app/app.module.ts`:
The service worker initialization code is disabled by default. To enable it, uncomment the following code in `src/main/webapp/app/app.config.ts`:

```typescript
ServiceWorkerModule.register('ngsw-worker.js', { enabled: false }),
Expand All @@ -95,7 +95,7 @@ npm install --save-dev --save-exact @types/leaflet
```

Then you would import the JS and CSS files specified in library's installation instructions so that [Webpack][] knows about them:
Edit [src/main/webapp/app/app.module.ts](src/main/webapp/app/app.module.ts) file:
Edit [src/main/webapp/app/app.config.ts](src/main/webapp/app/app.config.ts) file:

```
import 'leaflet/dist/leaflet.js';
Expand Down Expand Up @@ -126,7 +126,7 @@ will generate few files:
```
create src/main/webapp/app/my-component/my-component.component.html
create src/main/webapp/app/my-component/my-component.component.ts
update src/main/webapp/app/app.module.ts
update src/main/webapp/app/app.config.ts
```

## Building for production
Expand Down Expand Up @@ -257,18 +257,18 @@ For more information refer to [Using Docker and Docker-Compose][], this page als
To configure CI for your project, run the ci-cd sub-generator (`jhipster ci-cd`), this will let you generate configuration files for a number of Continuous Integration systems. Consult the [Setting up Continuous Integration][] page for more information.

[JHipster Homepage and latest documentation]: https://www.jhipster.tech
[JHipster 8.0.0 archive]: https://www.jhipster.tech/documentation-archive/v8.0.0
[Using JHipster in development]: https://www.jhipster.tech/documentation-archive/v8.0.0/development/
[Using Docker and Docker-Compose]: https://www.jhipster.tech/documentation-archive/v8.0.0/docker-compose
[Using JHipster in production]: https://www.jhipster.tech/documentation-archive/v8.0.0/production/
[Running tests page]: https://www.jhipster.tech/documentation-archive/v8.0.0/running-tests/
[Code quality page]: https://www.jhipster.tech/documentation-archive/v8.0.0/code-quality/
[Setting up Continuous Integration]: https://www.jhipster.tech/documentation-archive/v8.0.0/setting-up-ci/
[JHipster 8.1.0 archive]: https://www.jhipster.tech/documentation-archive/v8.1.0
[Using JHipster in development]: https://www.jhipster.tech/documentation-archive/v8.1.0/development/
[Using Docker and Docker-Compose]: https://www.jhipster.tech/documentation-archive/v8.1.0/docker-compose
[Using JHipster in production]: https://www.jhipster.tech/documentation-archive/v8.1.0/production/
[Running tests page]: https://www.jhipster.tech/documentation-archive/v8.1.0/running-tests/
[Code quality page]: https://www.jhipster.tech/documentation-archive/v8.1.0/code-quality/
[Setting up Continuous Integration]: https://www.jhipster.tech/documentation-archive/v8.1.0/setting-up-ci/
[Node.js]: https://nodejs.org/
[NPM]: https://www.npmjs.com/
[OpenAPI-Generator]: https://openapi-generator.tech
[Swagger-Editor]: https://editor.swagger.io
[Doing API-First development]: https://www.jhipster.tech/documentation-archive/v8.0.0/doing-api-first-development/
[Doing API-First development]: https://www.jhipster.tech/documentation-archive/v8.1.0/doing-api-first-development/
[Webpack]: https://webpack.github.io/
[BrowserSync]: https://www.browsersync.io/
[Jest]: https://facebook.github.io/jest/
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ task cleanResources(type: Delete) {
}

wrapper {
gradleVersion = "8.4"
gradleVersion = "8.5"
}

task webapp_test(type: NpmTask) {
Expand Down Expand Up @@ -273,7 +273,7 @@ task webapp_test(type: NpmTask) {
if (project.hasProperty("nodeInstall")) {
node {
version = "18.18.2"
npmVersion = "10.2.2"
npmVersion = "10.2.4"
download = true
}

Expand Down
22 changes: 11 additions & 11 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ rootProject.name=artemis-benchmarking
profile=dev

# Dependency versions
jhipsterDependenciesVersion=8.0.0
jhipsterDependenciesVersion=8.1.0
# The spring-boot version should match the one managed by
# https://mvnrepository.com/artifact/tech.jhipster/jhipster-dependencies/8.0.0
springBootVersion=3.1.5
# https://mvnrepository.com/artifact/tech.jhipster/jhipster-dependencies/8.1.0
springBootVersion=3.2.0
# The hibernate version should match the one managed by
# https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/3.1.5 -->
hibernateVersion=6.2.13.Final
# https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/3.2.0 -->
hibernateVersion=6.3.1.Final
mapstructVersion=1.5.5.Final
archunitJunit5Version=1.1.0
archunitJunit5Version=1.2.1
jacksonDatabindNullableVersion=0.2.6
hazelcastSpringVersion=5.3.5
hazelcastSpringVersion=5.3.6



Expand All @@ -23,14 +23,14 @@ jibPluginVersion=3.4.0
gitPropertiesPluginVersion=2.4.1
gradleNodePluginVersion=7.0.1
sonarqubePluginVersion=4.4.1.3373
spotlessPluginVersion=6.22.0
openapiPluginVersion=7.0.1
spotlessPluginVersion=6.23.3
openapiPluginVersion=7.1.0
noHttpCheckstyleVersion=0.0.11
checkstyleVersion=10.12.4
checkstyleVersion=10.12.5
modernizerPluginVersion=1.9.0

liquibaseTaskPrefix=liquibase
liquibasePluginVersion=2.2.0
liquibasePluginVersion=2.2.1
liquibaseVersion=4.24.0
liquibaseHibernate6Version=4.24.0
# jhipster-needle-gradle-property - JHipster will add additional properties here
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
sonar.projectKey = artemis-benchmarking
sonar.projectName = artemis-benchmarking generated by jhipster

# Typescript tests files must be inside sources and tests, othewise `INFO: Test execution data ignored for 80 unknown files, including:` is
# shown.
# Typescript tests files must be inside sources and tests, otherwise `INFO: Test execution data ignored for 80 unknown files, including:`
# is shown.
sonar.sources = src
sonar.tests = src
sonar.host.url = http://localhost:9001
Expand Down
4 changes: 2 additions & 2 deletions src/main/docker/monitoring.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: artemis-benchmarking
services:
prometheus:
image: prom/prometheus:v2.47.2
image: prom/prometheus:v2.48.0
volumes:
- ./prometheus/:/etc/prometheus/
command:
Expand All @@ -15,7 +15,7 @@ services:
# grafana/provisioning/datasources/datasource.yml
network_mode: 'host' # to test locally running service
grafana:
image: grafana/grafana:10.2.0
image: grafana/grafana:10.2.2
volumes:
- ./grafana/provisioning/:/etc/grafana/provisioning/
environment:
Expand Down
2 changes: 1 addition & 1 deletion src/main/docker/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: artemis-benchmarking
services:
sonar:
container_name: sonarqube
image: sonarqube:10.2.1-community
image: sonarqube:10.3.0-community
# Forced authentication redirect for UI is turned off for out of the box experience while trying out SonarQube
# For real use cases delete SONAR_FORCEAUTHENTICATION variable or set SONAR_FORCEAUTHENTICATION=true
environment:
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/tum/cit/ase/GeneratedByJHipster.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Generated(value = "JHipster", comments = "Generated by JHipster 8.0.0")
@Generated(value = "JHipster", comments = "Generated by JHipster 8.1.0")
@Retention(RetentionPolicy.SOURCE)
@Target({ ElementType.TYPE })
public @interface GeneratedByJHipster {
Expand Down
18 changes: 13 additions & 5 deletions src/main/java/de/tum/cit/ase/service/MailService.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import tech.jhipster.config.JHipsterProperties;

/**
* Service for sending emails.
* Service for sending emails asynchronously.
* <p>
* We use the {@link Async} annotation to send emails asynchronously.
*/
Expand Down Expand Up @@ -63,6 +63,10 @@ public MailService(

@Async
public void sendEmail(String to, String subject, String content, boolean isMultipart, boolean isHtml) {
this.sendEmailSync(to, subject, content, isMultipart, isHtml);
}

private void sendEmailSync(String to, String subject, String content, boolean isMultipart, boolean isHtml) {
log.debug(
"Send email[multipart '{}' and html '{}'] to '{}' with subject '{}' and content={}",
isMultipart,
Expand All @@ -89,6 +93,10 @@ public void sendEmail(String to, String subject, String content, boolean isMulti

@Async
public void sendEmailFromTemplate(User user, String templateName, String titleKey) {
this.sendEmailFromTemplateSync(user, templateName, titleKey);
}

private void sendEmailFromTemplateSync(User user, String templateName, String titleKey) {
if (user.getEmail() == null) {
log.debug("Email doesn't exist for user '{}'", user.getLogin());
return;
Expand All @@ -99,25 +107,25 @@ public void sendEmailFromTemplate(User user, String templateName, String titleKe
context.setVariable(BASE_URL, jHipsterProperties.getMail().getBaseUrl());
String content = templateEngine.process(templateName, context);
String subject = messageSource.getMessage(titleKey, null, locale);
self.sendEmail(user.getEmail(), subject, content, false, true);
this.sendEmailSync(user.getEmail(), subject, content, false, true);
}

@Async
public void sendActivationEmail(User user) {
log.debug("Sending activation email to '{}'", user.getEmail());
self.sendEmailFromTemplate(user, "mail/activationEmail", "email.activation.title");
this.sendEmailFromTemplateSync(user, "mail/activationEmail", "email.activation.title");
}

@Async
public void sendCreationEmail(User user) {
log.debug("Sending creation email to '{}'", user.getEmail());
self.sendEmailFromTemplate(user, "mail/creationEmail", "email.activation.title");
this.sendEmailFromTemplateSync(user, "mail/creationEmail", "email.activation.title");
}

@Async
public void sendPasswordResetMail(User user) {
log.debug("Sending password reset email to '{}'", user.getEmail());
self.sendEmailFromTemplate(user, "mail/passwordResetEmail", "email.reset.title");
this.sendEmailFromTemplateSync(user, "mail/passwordResetEmail", "email.reset.title");
}

@Async
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/de/tum/cit/ase/web/rest/UserResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ private boolean onlyContainsAllowedProperties(Pageable pageable) {
*/
@GetMapping("/users/{login}")
@PreAuthorize("hasAuthority(\"" + AuthoritiesConstants.ADMIN + "\")")
public ResponseEntity<AdminUserDTO> getUser(@PathVariable @Pattern(regexp = Constants.LOGIN_REGEX) String login) {
public ResponseEntity<AdminUserDTO> getUser(@PathVariable("login") @Pattern(regexp = Constants.LOGIN_REGEX) String login) {
log.debug("REST request to get User : {}", login);
return ResponseUtil.wrapOrNotFound(userService.getUserWithAuthoritiesByLogin(login).map(AdminUserDTO::new));
}
Expand All @@ -201,7 +201,7 @@ public ResponseEntity<AdminUserDTO> getUser(@PathVariable @Pattern(regexp = Cons
*/
@DeleteMapping("/users/{login}")
@PreAuthorize("hasAuthority(\"" + AuthoritiesConstants.ADMIN + "\")")
public ResponseEntity<Void> deleteUser(@PathVariable @Pattern(regexp = Constants.LOGIN_REGEX) String login) {
public ResponseEntity<Void> deleteUser(@PathVariable("login") @Pattern(regexp = Constants.LOGIN_REGEX) String login) {
log.debug("REST request to delete User: {}", login);
userService.deleteUser(login);
return ResponseEntity
Expand Down
15 changes: 8 additions & 7 deletions src/main/resources/config/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ management:
export:
enabled: true
step: 60
observations:
key-values:
application: ${spring.application.name}
metrics:
enable:
http: true
jvm: true
Expand All @@ -79,13 +83,10 @@ management:
all: true
percentiles:
all: 0, 0.5, 0.75, 0.95, 0.99, 1.0
tags:
application: ${spring.application.name}
web:
server:
request:
autotime:
enabled: true
data:
repository:
autotime:
enabled: true

spring:
application:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Component, ElementRef, Input, Renderer2 } from '@angular/core';
standalone: true,
imports: [SharedModule],
templateUrl: './password-strength-bar.component.html',
styleUrls: ['./password-strength-bar.component.scss'],
styleUrl: './password-strength-bar.component.scss',
})
export default class PasswordStrengthBarComponent {
colors = ['#F00', '#F90', '#FF0', '#9F0', '#0F0'];
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/app/admin/docs/docs.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import { Component } from '@angular/core';
standalone: true,
selector: 'jhi-docs',
templateUrl: './docs.component.html',
styleUrls: ['./docs.component.scss'],
styleUrl: './docs.component.scss',
})
export default class DocsComponent {}
2 changes: 1 addition & 1 deletion src/main/webapp/app/core/util/data-util.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class DataUtils {
* @param editForm the form group where the input field is located
* @param field the field name to set the file's 'base 64 data' on
* @param isImage boolean representing if the file represented by the event is an image
* @returns an observable that loads file to form field and completes if sussessful
* @returns an observable that loads file to form field and completes if successful
* or returns error as FileLoadError on failure
*/
loadFileToForm(event: Event, editForm: FormGroup, field: string, isImage: boolean): Observable<void> {
Expand Down
Loading

0 comments on commit e43dda0

Please sign in to comment.