Skip to content

Commit

Permalink
Merge pull request #603 from NUM-Forschungsdatenplattform/release/1.19.0
Browse files Browse the repository at this point in the history
Merge release '1.19.0'
  • Loading branch information
mafasva committed Jul 18, 2024
2 parents 42ec169 + 6c4fade commit 8bd5669
Show file tree
Hide file tree
Showing 26 changed files with 196 additions and 62 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/build-for-development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
with:
sarif_file: 'trivy-results.sarif'

docker:
registry:
needs: test_and_scan
if: github.event.pull_request.merged == true

Expand All @@ -60,17 +60,14 @@ jobs:
with:
node-version: '20'
cache: 'npm'
- name: Login to Docker Hub
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
push: true
tags: numforschungsdatenplattform/num-portal-webapp:develop




tags: ghcr.io/num-forschungsdatenplattform/num-portal-webapp:develop
2 changes: 1 addition & 1 deletion .github/workflows/release-new-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push docker image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
push: true
tags: numforschungsdatenplattform/num-portal-webapp:${{ github.ref_name }}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "num-portal-webapp",
"version": "1.18.0",
"version": "1.19.0",
"scripts": {
"postinstall": "ngcc",
"ng": "ng",
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export class AuthService {
.toPromise()
.finally(() => {
if (!this.idle.isIdling()) {
this.initIdle()
this.resetIdle()
}
})
}
Expand Down
6 changes: 3 additions & 3 deletions src/app/core/interceptors/error.interceptor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('ErrorInterceptor', () => {
let errorInterceptor: ErrorInterceptor

const authService = {
logout: () => {},
login: () => {},
} as AuthService

const profileService = {
Expand Down Expand Up @@ -47,12 +47,12 @@ describe('ErrorInterceptor', () => {
const mockErrorResponse = { status: 401, statusText: 'Unauthorized' }
const data = 'Unauthorized'

jest.spyOn(injectedAuthService, 'logout')
jest.spyOn(injectedAuthService, 'login')

http.get('/data').subscribe()

httpMock.expectOne('/data').flush(data, mockErrorResponse)
expect(injectedAuthService.logout).toHaveBeenCalled()
expect(injectedAuthService.login).toHaveBeenCalled()
}
))
})
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/interceptors/error.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class ErrorInterceptor implements HttpInterceptor {
return next.handle(request).pipe(
catchError((err) => {
if (err.status === 401) {
this.authService.logout()
this.authService.login(window.location.href)
}
if (err.status === 403) {
this.profileService.setUnapproveUser(true)
Expand Down
10 changes: 5 additions & 5 deletions src/app/core/interceptors/oauth.interceptor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('OAuthInterceptor', () => {
} as OAuthStorage

const authService = {
logOut: () => {},
initCodeFlow: () => {},
} as OAuthService

beforeEach(() => {
Expand Down Expand Up @@ -75,12 +75,12 @@ describe('OAuthInterceptor', () => {
const mockErrorResponse = { status: 401, statusText: 'Unauthorized' }
const data = 'Unauthorized'

jest.spyOn(injectedAuthService, 'logOut')
jest.spyOn(injectedAuthService, 'initCodeFlow')

http.get('/data').subscribe()

httpMock.expectOne('/data').flush(data, mockErrorResponse)
expect(injectedAuthService.logOut).toHaveBeenCalled()
expect(injectedAuthService.initCodeFlow).toHaveBeenCalled()
}
))
})
Expand All @@ -92,12 +92,12 @@ describe('OAuthInterceptor', () => {
const mockErrorResponse = { status: 500, statusText: 'Internal Server Error' }
const data = 'Internal Server Error'

jest.spyOn(injectedAuthService, 'logOut')
jest.spyOn(injectedAuthService, 'initCodeFlow')

http.get('/data').subscribe()

httpMock.expectOne('/data').flush(data, mockErrorResponse)
expect(injectedAuthService.logOut).not.toHaveBeenCalled()
expect(injectedAuthService.initCodeFlow).not.toHaveBeenCalled()
}
))
})
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/interceptors/oauth.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class OAuthInterceptor implements HttpInterceptor {

private handleError(error: HttpErrorResponse): Observable<never> {
if (error.status === 401) {
this.oauthService.logOut()
this.oauthService.initCodeFlow(window.location.href)
} else if (error.status === 409 && error.url.includes('/admin/user/')) {
return of()
}
Expand Down
8 changes: 6 additions & 2 deletions src/app/core/services/aql-editor/aql-editor.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { IArchetypeQueryBuilderResponse } from 'src/app/shared/models/archetype-
import { IContainmentNode } from 'src/app/shared/models/archetype-query-builder/template/containment-node.interface'
import { IEhrbaseTemplate } from 'src/app/shared/models/archetype-query-builder/template/ehrbase-template.interface'
import { IDictionary } from 'src/app/shared/models/dictionary.interface'
import { compareLocaleStringValues } from '../../utils/sort.utils'

@Injectable({
providedIn: 'root',
Expand All @@ -34,8 +35,11 @@ export class AqlEditorService {
getTemplates(): Observable<IEhrbaseTemplate[]> {
return this.httpClient.get<IEhrbaseTemplate[]>(`${this.baseUrl}/template`).pipe(
tap((templates) => {
this.templates = templates
this.templatesSubject$.next(templates)
const tempSorted = templates.sort((a, b) =>
compareLocaleStringValues(a.description, b.description, a.templateId, b.templateId, true)
)
this.templates = tempSorted
this.templatesSubject$.next(tempSorted)
}),
catchError(this.handleError)
)
Expand Down
12 changes: 9 additions & 3 deletions src/app/core/utils/value-converter.utils.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { AqlParameterValueType } from 'src/app/shared/models/aql/aql-parameter-value-type.enum'
import { DateHelperService } from '../helper/date-helper.service'
import { Moment } from 'moment'
import { Duration, Moment } from 'moment'

export const convertParameterInputToType = (
type: AqlParameterValueType,
inputValue: string | number | boolean | Date | Moment,
inputValue: string | number | boolean | Date | Moment | Duration,
defaultToUndefined = false
): number | string | boolean => {
let outputValue: number | string | boolean
Expand All @@ -29,7 +29,13 @@ export const convertParameterInputToType = (
case AqlParameterValueType.Boolean:
outputValue = inputValue && inputValue !== 'false'
break

case AqlParameterValueType.Duration:
outputValue = inputValue
? (inputValue as Duration).toISOString()
: defaultToUndefined
? undefined
: ' '
break
default:
outputValue = inputValue ? inputValue.toString() : defaultToUndefined ? undefined : ' '
break
Expand Down
3 changes: 3 additions & 0 deletions src/app/layout/components/side-menu/side-menu.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ fa-icon {
display: flex;
justify-content: center;
align-items: center;
img {
padding: 10px 10px 10px 0;
}
}
.num-mat-list-item.highlighted {
color: #eb586a;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export class AqlConnectorItemComponent implements OnInit, OnDestroy {

this.prefillParameter(parameter, optionKeys)
this.setPossibleOperators(parameter, response.type)
parameter.unit = response.unit

this.checkParameterStatus()
parameter.isMetaFetched = true
Expand Down Expand Up @@ -159,6 +160,8 @@ export class AqlConnectorItemComponent implements OnInit, OnDestroy {
return AqlParameterValueType.DateTime
case ReferenceModelType.Dv_time:
return AqlParameterValueType.Time
case ReferenceModelType.Dv_duration:
return AqlParameterValueType.Duration

default:
return AqlParameterValueType.String
Expand Down
10 changes: 9 additions & 1 deletion src/app/modules/legal/components/imprint/imprint.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ <h2>{{ 'IMPRINT.TEXTS.LINKS_TITLE' | translate }}</h2>
<h2>{{ 'IMPRINT.TEXTS.PUBLIC_KEYS_TITLE' | translate }}</h2>

<p>{{ 'IMPRINT.PUBLIC_KEY_LINKS.INTRO' | translate }}</p>
<p>
<a
[href]="'IMPRINT.PUBLIC_KEY_LINKS.LINK_TEST_HREF' | translate"
target="_blank"
rel="noopener"
>{{ 'IMPRINT.PUBLIC_KEY_LINKS.LINK_TEST_DESCRIPTION' | translate }}</a
>
</p>
<p>
<a
[href]="'IMPRINT.PUBLIC_KEY_LINKS.LINK_PRE_PROD_HREF' | translate"
Expand All @@ -77,5 +85,5 @@ <h2>{{ 'IMPRINT.TEXTS.PUBLIC_KEYS_TITLE' | translate }}</h2>
>{{ 'IMPRINT.PUBLIC_KEY_LINKS.LINK_PROD_DESCRIPTION' | translate }}</a
>
</p>
<p>Stand: 2023-04-26</p>
<p>Stand: 2025-07-04</p>
<div class="num-margin-b-40"></div>
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,15 @@ <h3 class="accordion" fxLayoutGap="8px">
</mat-form-field>
</section>

<!-- <section role="presentation" class="num-margin-b-10">
<num-attachments-table
[attachments]="attachments"
[isInPreview]="isInPreview"
[project]="project"
[showSelectColumn]="showAttachmentsSelect"
></num-attachments-table>
</section> -->

<section role="presentation" class="num-margin-b-10">
<num-attachments-table
[attachments]="attachments"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
type="text"
data-test="aql-parameter-inputs__value-input"
/>
<span *ngIf="item.unit" matSuffix>{{ item.unit }}</span>
</mat-form-field>

<mat-form-field
Expand Down Expand Up @@ -110,5 +111,34 @@
"
data-test="aql-parameter-inputs__time-value-input"
></num-time-input>

<mat-form-field
floatLabel="always"
appearance="outline"
class="input num-tiny-input value-input"
*ngIf="item.valueType === AqlParameterValueType.Duration"
>
<mat-label *ngIf="mode === 'cohortBuilder'" id="duration-label">{{ item.name }}</mat-label>
<mat-label *ngIf="mode === 'aqb' || !item.name" id="duration-label">{{
'FORM.VALUE' | translate
}}</mat-label>
<input
aria-labelledby="duration-label"
formControlName="value"
inputmode="numeric"
matInput
type="text"
data-test="aql-parameter-inputs__value-input"
(beforeinput)="numericValuesOnly($event)"
/>
<mat-select formControlName="unit" matSuffix>
<mat-option value="y">{{ 'UNITS.YEARS' | translate }}</mat-option>
<mat-option value="M">{{ 'UNITS.MONTHS' | translate }}</mat-option>
<mat-option value="d">{{ 'UNITS.DAYS' | translate }}</mat-option>
<mat-option value="h">{{ 'UNITS.HOURS' | translate }}</mat-option>
<mat-option value="m">{{ 'UNITS.MINUTES' | translate }}</mat-option>
<mat-option value="s">{{ 'UNITS.SECONDS' | translate }}</mat-option>
</mat-select>
</mat-form-field>
</ng-container>
</section>
Loading

0 comments on commit 8bd5669

Please sign in to comment.