Skip to content

Commit

Permalink
Merge branch 'dev' into 717-test-production-mode-in-integration-test
Browse files Browse the repository at this point in the history
  • Loading branch information
Bdegraaf1234 committed Nov 7, 2023
2 parents 5c6f52b + 556da3b commit 25e5f9c
Show file tree
Hide file tree
Showing 19 changed files with 975 additions and 854 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,17 @@ jobs:
distribution: temurin
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Cache
uses: actions/cache@v3
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-java-${{ hashFiles('**/build.gradle', '**/gradle.properties', '**/yarn.lock', '.yarnrc.yml') }}
key: ${{ runner.os }}-node-${{ hashFiles('**/build.gradle', '**/gradle.properties', '**/yarn.lock', '.yarnrc.yml') }}
restore-keys: |
${{ runner.os }}-java-
${{ runner.os }}-node-
- name: Install Yarn dependencies
run: yarn install
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,18 @@ jobs:
distribution: temurin
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Cache
uses: actions/cache@v3
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-java-${{ hashFiles('**/build.gradle', '**/gradle.properties', '**/yarn.lock') }}
key: ${{ runner.os }}-rc-node-${{ hashFiles('**/build.gradle', '**/gradle.properties', '**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-java-
${{ runner.os }}-rc-node-
${{ runner.os }}-node-
# Compile the code
- name: Install dependencies
Expand Down
18 changes: 4 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,22 @@ jobs:
with:
node-version: 16

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=.yarn/cache" >> $GITHUB_OUTPUT

- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17

- name: Cache
uses: actions/cache@v3
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-java-${{ hashFiles('**/build.gradle', '**/gradle.properties', '**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-java-
cache-disabled: true

- name: Compile code
run: ./gradlew assemble

# Upload it to GitHub
- name: Upload to GitHub
uses: AButler/[email protected]
uses: AButler/[email protected].2
with:
files: '*/build/libs/*'
repo-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
768 changes: 0 additions & 768 deletions .yarn/releases/yarn-3.1.0.cjs

This file was deleted.

874 changes: 874 additions & 0 deletions .yarn/releases/yarn-3.6.4.cjs

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
cacheFolder: "./.yarn/cache"
cacheFolder: ./.yarn/cache

enableImmutableInstalls: false

nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-3.1.0.cjs
enableImmutableInstalls: true

yarnPath: .yarn/releases/yarn-3.6.4.cjs
29 changes: 16 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import org.gradle.internal.os.OperatingSystem
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
Expand Down Expand Up @@ -33,7 +32,7 @@ apply plugin: 'io.spring.dependency-management'

allprojects {
group 'org.radarbase'
version '2.0.1-SNAPSHOT' // project version
version '2.1.1-SNAPSHOT' // project version

// The comment on the previous line is only there to identify the project version line easily
// with a sed command, to auto-update the version number with the prepare-release-branch.sh
Expand Down Expand Up @@ -68,9 +67,6 @@ allprojects {
}
}

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

description = 'MangementPortal application to manage studies and participants'

defaultTasks 'bootRun'
Expand Down Expand Up @@ -105,6 +101,11 @@ bootRun {
sourceResources sourceSets.main
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

tasks.withType(KotlinCompile).configureEach {
compilerOptions {
jvmTarget = JvmTarget.JVM_17
Expand Down Expand Up @@ -156,7 +157,7 @@ dependencies {
implementation "com.fasterxml.jackson.core:jackson-databind"
implementation "com.hazelcast:hazelcast:${hazelcast_version}"
implementation "com.hazelcast:hazelcast-spring:${hazelcast_version}"
runtimeOnly "com.hazelcast:hazelcast-hibernate53"
runtimeOnly "com.hazelcast:hazelcast-hibernate53:${hazelcast_hibernate_version}"
runtimeOnly("com.zaxxer:HikariCP:${hikaricp_version}")
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: findbugAnnotationVersion
implementation("org.liquibase:liquibase-core:${liquibase_version}")
Expand All @@ -181,13 +182,15 @@ dependencies {
implementation("org.springframework.boot:spring-boot-starter-web") {
exclude module: 'spring-boot-starter-tomcat'
}
implementation ("org.springframework.boot:spring-boot-starter-undertow") {
// Fix vulnerabilities
implementation("io.undertow:undertow-websockets-jsr:2.2.24.Final")
implementation("io.undertow:undertow-servlet:2.2.24.Final")
implementation("io.undertow:undertow-core:2.2.24.Final")
}
implementation ("org.springframework.boot:spring-boot-starter-undertow")
// Fix vulnerabilities
runtimeOnly("io.undertow:undertow-websockets-jsr:2.2.25.Final")
runtimeOnly("io.undertow:undertow-servlet:2.2.25.Final")
runtimeOnly("io.undertow:undertow-core:2.2.25.Final")

implementation "org.springframework.boot:spring-boot-starter-thymeleaf"
runtimeOnly("org.thymeleaf:thymeleaf-spring5:${thymeleaf_version}")
runtimeOnly("org.thymeleaf:thymeleaf:${thymeleaf_version}")
implementation("org.springframework:spring-context-support")
implementation("org.springframework.session:spring-session-hazelcast")

Expand Down Expand Up @@ -255,7 +258,7 @@ tasks.register('ghPagesJavadoc', Copy) {
}

tasks.register('ghPagesOpenApiSpec', Copy) {
from file("$buildDir/swagger-spec")
from file(layout.buildDirectory.dir("swagger-spec"))
into file("$rootDir/public/apidoc")
}

Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ rootProject.name=management-portal
profile=dev
assertj_version=3.23.1
jhipster_server_version=7.9.3
hazelcast_version=5.2.0
hazelcast_version=5.2.4
hazelcast_hibernate_version=5.1.0
hikaricp_version=5.0.1
liquibase_slf4j_version=4.1.0
liquibase_version=4.22.0
Expand All @@ -11,6 +12,7 @@ springdoc_version=1.6.15
spring_boot_version=2.7.15
spring_framework_version=5.3.27
spring_data_version=2021.2.5
thymeleaf_version=3.1.2.RELEASE
spring_session_version=2021.2.0
gatling_version=3.8.4
mapstruct_version=1.5.5.Final
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "management-portal",
"version": "2.0",
"version": "2.1.1",
"description": "Description for ManagementPortal",
"private": true,
"cacheDirectories": [
Expand Down Expand Up @@ -71,5 +71,5 @@
"e2e-prod": "yarn run wait-for-managementportal && ng e2e --configuration production",
"wait-for-managementportal": "wait-port -t 240000 http://localhost:8080/managementportal/management/health"
},
"packageManager": "yarn@3.1.0"
"packageManager": "yarn@3.6.4"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
package org.radarbase.management.repository;

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.List;

import ch.qos.logback.classic.pattern.TargetLengthBasedClassNameAbbreviator;
import org.radarbase.management.config.audit.AuditEventConverter;
import org.radarbase.management.domain.PersistentAuditEvent;
Expand All @@ -13,11 +18,6 @@
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.List;

/**
* An implementation of Spring Boot's AuditEventRepository.
*/
Expand Down Expand Up @@ -61,12 +61,9 @@ public void add(AuditEvent event) {
}
if (eventType != null && eventType.endsWith("_FAILURE")) {
Object typeObj = event.getData().get("type");
String errorType;
if (typeObj instanceof String) {
errorType = TYPE_ABBREVIATOR.abbreviate((String) typeObj);
} else {
errorType = null;
}
String errorType = typeObj instanceof String
? TYPE_ABBREVIATOR.abbreviate((String) typeObj)
: null;
logger.warn("{}: principal={}, error={}, message=\"{}\", details={}",
eventType,
event.getPrincipal(),
Expand Down
9 changes: 0 additions & 9 deletions src/main/webapp/app/app.constants.ts
Original file line number Diff line number Diff line change
@@ -1,9 +0,0 @@
// DO NOT EDIT THIS FILE, EDIT THE WEBPACK COMMON CONFIG INSTEAD, WHICH WILL MODIFY THIS FILE
/* tslint:disable */
let _VERSION = '0.0.0'; // This value will be overwritten by webpack
let _DEBUG_INFO_ENABLED = true; // This value will be overwritten by webpack
/* @toreplace VERSION */
/* @toreplace DEBUG_INFO_ENABLED */
/* tslint:enable */
export const VERSION = _VERSION;
export const DEBUG_INFO_ENABLED = _DEBUG_INFO_ENABLED;
6 changes: 4 additions & 2 deletions src/main/webapp/app/layouts/main/main.component.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<div class="print">
<router-outlet name="popup"></router-outlet>
</div>
<div [ngClass]="(this.isPrintLocked$ | async) ? 'not-print' : ''">
<jhi-page-ribbon></jhi-page-ribbon>
<jhi-page-ribbon></jhi-page-ribbon>
<div>
<router-outlet name="navbar"></router-outlet>
</div>
<div class="container-fluid">
<div class="card jh-card">
<router-outlet></router-outlet>
<router-outlet name="popup"></router-outlet>
</div>
<jhi-footer></jhi-footer>
</div>
Expand Down
1 change: 0 additions & 1 deletion src/main/webapp/app/layouts/navbar/navbar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<a class="navbar-brand" routerLink="/" (click)="collapseNavbar()">
<span class="logo-img"></span>
<span [translate]="'global.title'" class="navbar-title"></span>
<span class="navbar-version">{{version}}</span>
</a>
<button class="navbar-toggler" type="button" (click)="toggleNavbar()">
<span class="navbar-toggler-icon"></span>
Expand Down
3 changes: 0 additions & 3 deletions src/main/webapp/app/layouts/navbar/navbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Router } from '@angular/router';
import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
import { TranslateService } from '@ngx-translate/core';

import { DEBUG_INFO_ENABLED, VERSION } from '../../app.constants';
import {
JhiLanguageHelper,
LoginModalService,
Expand All @@ -29,7 +28,6 @@ import { ProfileService } from '../profiles/profile.service';
export class NavbarComponent {
isNavbarCollapsed: boolean;
modalRef: NgbModalRef;
version: string;

projects: Project[];
organizations: Organization[];
Expand All @@ -46,7 +44,6 @@ export class NavbarComponent {
public projectService: ProjectService,
public organizationService: OrganizationService,
) {
this.version = DEBUG_INFO_ENABLED ? 'v' + VERSION : '';
this.isNavbarCollapsed = true;
}

Expand Down
5 changes: 0 additions & 5 deletions src/main/webapp/app/layouts/navbar/navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
/* ==========================================================================
Navbar
========================================================================== */
.navbar-version {
font-size: 10px;
color: #ccc
}

.navbar {
background-color: #353d47;
padding: .2em 1em;
Expand Down
21 changes: 18 additions & 3 deletions src/main/webapp/app/layouts/profiles/page-ribbon.component.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,33 @@
import { Component, OnInit } from '@angular/core';
import { ProfileInfo } from './profile-info.model';
import { ProfileService } from './profile.service';
import { Observable, of } from 'rxjs';
import { TranslateService } from '@ngx-translate/core';
import { catchError, filter, switchMap } from 'rxjs/operators';

@Component({
selector: 'jhi-page-ribbon',
template: `
<div class="ribbon" *ngIf="profileService.profileInfo$ | async as profileInfo">
<a href="" [translate]="'global.ribbon.' + profileInfo.ribbonEnv"></a>
<div class="ribbon" *ngIf="ribbon$ | async as ribbon">
<a href="">{{ ribbon }}</a>
</div>`,
styleUrls: [
'page-ribbon.scss',
],
})
export class PageRibbonComponent {
constructor(public profileService: ProfileService) {
ribbon$: Observable<string | null>
constructor(
public profileService: ProfileService,
translateService: TranslateService,
) {
this.ribbon$ = profileService.profileInfo$.pipe(
switchMap(profileInfo => {
const key = 'global.ribbon.' + profileInfo.ribbonEnv
return translateService.stream(key).pipe(
filter(t => t !== key),
)
}),
)
}
}
9 changes: 9 additions & 0 deletions src/main/webapp/content/scss/_print.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,16 @@
display: none !important;
}

.print {
position: static;
height: 100%;
}

.modal-backdrop {
display: none !important;
}

html, body {
height:100%
}
}
2 changes: 1 addition & 1 deletion src/main/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8">
<title>ManagementPortal</title>
<meta name="description" content="">
<meta name="google" value="notranslate">
<meta name="google" content="notranslate">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="icon" type="image/x-icon" href="favicon.ico" />
</head>
Expand Down
Loading

0 comments on commit 25e5f9c

Please sign in to comment.