Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 7e387688 authored by Mihai BOZ's avatar Mihai BOZ
Browse files

Merge branch 'development' into EDELIVERY-12323-Automate_new_SMP_UI_testcases-part_7

parents 7eb0fce7 56ff6cd2
No related branches found
No related tags found
No related merge requests found
Showing
with 105 additions and 135 deletions
cp smp-webapp/target/smp.war $DEPLOY_FOLDER
sleep 3m
\ No newline at end of file
......@@ -18,8 +18,8 @@
<maven.deploy.skip>false</maven.deploy.skip>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Currently last version not supported by the build server :(
node.version>v18.13.0</node.version>
<npm.version>8.19.3</npm.version -->
node.version>v18.18.2</node.version>
<npm.version>9.8.1</npm.version -->
<node.version>v16.20.0</node.version>
<npm.version>8.19.4</npm.version>
......@@ -30,7 +30,7 @@
mvn clean install -DusePreInstalledNpm -Dnpm.path=/opt/programs/node-v14.17.0-linux-x64/bin
-->
<!--suppress UnresolvedMavenProperty -->
<npm.path>${env.bamboo_CITNET_NODEJS_16_LINUX_PATH}</npm.path>
<npm.path>${env.bamboo_CITNET_NODEJS_18_LINUX_PATH}</npm.path>
</properties>
......
.dialog {
width: 500px;
align-content: center;
text-align: center;
}
......@@ -14,11 +15,7 @@ label:hover, label:active, input:hover + label, input:active + label {
.divTableRow {
display: table-row;
}
.divTableHeading {
background-color: #EEE;
display: table-header-group;
width: 100%;
}
.divTableCell, .divTableHead {
......@@ -26,12 +23,14 @@ label:hover, label:active, input:hover + label, input:active + label {
display: table-cell;
padding: 3px 3px;
text-align: center;
width: 100%;
}
.divTableHeading {
background-color: #EEE;
display: table-header-group;
font-weight: bold;
width: 100%;
}
.divTableFoot {
......
<h1 mat-dialog-title>{{title}}</h1>
<mat-dialog-content>{{text}}</mat-dialog-content>
<div class="dialog">
<h1 mat-dialog-title>{{title}}</h1>
<mat-dialog-content>{{text}}</mat-dialog-content>
<mat-dialog-actions>
<div *ngIf="isConfirmationDialog()" class="divTableCell">
<button mat-raised-button color="primary" (click)="dialogRef.close(true)" id="yesbuttondialog_id" tabindex="0">
<mat-icon>check_circle</mat-icon>
<span>Yes</span>
</button>
</div>
<mat-dialog-actions>
<div *ngIf="isConfirmationDialog()" class="divTableCell">
<button mat-raised-button color="primary" (click)="dialogRef.close(true)" id="yesbuttondialog_id" tabindex="0">
<mat-icon>check_circle</mat-icon>
<span>Yes</span>
</button>
</div>
<div *ngIf="isConfirmationDialog()" class="divTableCell">
<button mat-raised-button color="primary" (click)="dialogRef.close(false)" id="nobuttondialog_id" tabindex="1">
<mat-icon>cancel</mat-icon>
<span>No</span>
</button>
</div>
<div *ngIf="isConfirmationDialog()" class="divTableCell">
<button mat-raised-button color="primary" (click)="dialogRef.close(false)" id="nobuttondialog_id" tabindex="1">
<mat-icon>cancel</mat-icon>
<span>No</span>
</button>
</div>
<div *ngIf="isInformationDialog()" class="divTableCell">
<button mat-raised-button color="primary" (click)="dialogRef.close(true)" id="okbuttondialog_id" tabindex="3">
<mat-icon>warning</mat-icon>
<span>OK</span>
</button>
</div>
</mat-dialog-actions>
<div *ngIf="isInformationDialog()" class="divTableCell">
<button mat-raised-button color="primary" (click)="dialogRef.close(true)" id="okbuttondialog_id" tabindex="3">
<mat-icon>warning</mat-icon>
<span>OK</span>
</button>
</div>
<div *ngIf="isWarningDialog()" class="divTableCell">
<button mat-raised-button color="primary" (click)="dialogRef.close(false)" id="closebuttondialog_id" tabindex="3">
<mat-icon>close</mat-icon>
<span>Close</span>
</button>
</div>
</mat-dialog-actions>
</div>
......@@ -15,12 +15,16 @@ export class DialogComponent {
@Input() dialogRef: MatDialogRef<any>;
public isConfirmationDialog() {
public isConfirmationDialog(): boolean {
return this.type === 'confirmation';
}
public isInformationDialog() {
public isInformationDialog(): boolean {
return this.type === 'information';
}
public isWarningDialog(): boolean {
return this.type === 'warning';
}
}
<smp-dialog style="width: 400px"
[title]="'Password about to expire'"
<smp-dialog [title]="'Password about to expire'"
[text]="'Your password is more than three months old. Please change it as soon as possible!'"
[type]="'information'"
[dialogRef]="dialogRef">
......
label:hover, label:active, input:hover + label, input:active + label {
color: #3f51b5;
}
.divTable {
display: table;
width: 100%;
}
.divTableRow {
display: table-row;
}
.divTableHeading {
background-color: #EEE;
display: table-header-group;
}
.divTableCell, .divTableHead {
/*border: 1px solid #999999;*/
display: table-cell;
padding: 3px 3px;
text-align: center;
}
.divTableHeading {
background-color: #EEE;
display: table-header-group;
font-weight: bold;
}
.divTableFoot {
background-color: #EEE;
display: table-footer-group;
font-weight: bold;
}
.divTableBody {
display: table-row-group;
}
<div style="width: 500px;text-align: center">
<h1 mat-dialog-title>{{title}}</h1>
<div class="panel">{{description}}</div>
<div class="divTable">
<div class="divTableBody">
<div class="divTableRow">
<div class="divTableCell">
<button mat-raised-button color="primary" (click)="dialogRef.close(false)" id="closebuttondialog_id">
<mat-icon>close</mat-icon>
<span>Close</span>
</button>
</div>
</div>
</div>
</div>
</div>
<smp-dialog [title]="title"
[text]="description"
[type]="'warning'"
[dialogRef]="dialogRef">
</smp-dialog>
......@@ -2,10 +2,7 @@ import {Component, Inject} from '@angular/core';
import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';
@Component({
selector: 'app-information-dialog',
templateUrl: './information-dialog.component.html',
styleUrls: ['./information-dialog.component.css']
})
templateUrl: './information-dialog.component.html'})
export class InformationDialogComponent {
title: string;
......@@ -13,7 +10,7 @@ export class InformationDialogComponent {
constructor(public dialogRef: MatDialogRef<InformationDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: any) {
this.title=data.title;
this.description=data.description;
this.title = data.title;
this.description = data.description;
}
}
import {SearchTableEntity} from '../search-table/search-table-entity.model';
import {VisibilityEnum} from "../enums/visibility.enum";
export interface DocumentRo {
mimeType?: string;
name?: string;
......@@ -8,6 +5,7 @@ export interface DocumentRo {
currentResourceVersion?:number;
allVersions?: number[];
payloadVersion?:number;
payloadCreatedOn?: Date;
payload?:string;
}
......@@ -39,7 +39,7 @@
<ng-template #searchDomainPanel>
<mat-form-field id="domain-filter">
<mat-label>Filter Domain by domain code</mat-label>
<mat-label>Filter by domain code</mat-label>
<input matInput (keyup)="applyDomainFilter($event)" placeholder="Domain code" #inputDomainFilter>
</mat-form-field>
<table class="mat-elevation-z2" id="edit-domain-table" mat-table [dataSource]="dataSource" matSort>
......
......@@ -35,20 +35,29 @@
<div [formGroup]="documentForm"
style="float: right; vertical-align:middle;display: flex;align-items: center;justify-content: center; gap:0.4em;padding-right: 10px">
<span style="font-size: 0.8em">Show version:</span>
<select matNativeControl style="width: 100px; border-bottom: gray solid 1px"
placeholder="All document version"
matTooltip="Select version to display."
formControlName="payloadVersion"
id="document version_id"
(change)="onSelectionDocumentVersionChanged()"
<select matNativeControl style="width: 100px; border-bottom: grey solid 1px"
placeholder="All document version"
matTooltip="Select version to display."
formControlName="payloadVersion"
id="document version_id"
(change)="onSelectionDocumentVersionChanged()"
>
<option *ngFor="let version of getDocumentVersions"
[value]="version"
[value]="version"
>
{{version}}
</option>
</select>
<span style="font-size: 0.8em">Created on:</span>
<input id="payloadCreatedOn_id"
matInput [ngxMatDatetimePicker]="payloadCreatedOnPicker"
formControlName="payloadCreatedOn"
readonly>
<mat-datepicker-toggle matSuffix [for]="payloadCreatedOnPicker" style="visibility: hidden"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #payloadCreatedOnPicker [showSpinners]="true" [showSeconds]="false"
[hideTime]="false"></ngx-mat-datetime-picker>
</div>
</mat-toolbar-row>
</mat-toolbar>
......@@ -82,7 +91,7 @@
</div>
<mat-toolbar class="mat-elevation-z2" style="flex-grow: 0">
<mat-toolbar-row class="smp-toolbar-row">
<button d="cancel_id" mat-raised-button color="primary"
<button id="cancel_id" mat-raised-button color="primary"
[disabled]="cancelButtonDisabled"
(click)="onDocumentResetButtonClicked()">
<mat-icon>cancel</mat-icon>
......
......@@ -56,6 +56,7 @@ export class ResourceDocumentPanelComponent implements AfterViewInit, BeforeLeav
'mimeType': new FormControl({value: null}),
'name': new FormControl({value: null}),
'currentResourceVersion': new FormControl({value: null}),
'payloadCreatedOn': new FormControl({value: null}),
'payloadVersion': new FormControl({value: null}),
'payload': new FormControl({value: null}),
});
......@@ -109,6 +110,7 @@ export class ResourceDocumentPanelComponent implements AfterViewInit, BeforeLeav
this.documentForm.controls['name'].setValue(value.name);
this.documentForm.controls['currentResourceVersion'].setValue(value.currentResourceVersion);
this.documentForm.controls['payloadVersion'].setValue(value.payloadVersion);
this.documentForm.controls['payloadCreatedOn'].setValue(value.payloadCreatedOn);
this.documentForm.controls['payload'].setValue(!value.payload?"":value.payload);
this.documentForm.controls['payload'].enable();
// the method documentVersionsExists already uses the current value to check if versions exists
......@@ -122,6 +124,7 @@ export class ResourceDocumentPanelComponent implements AfterViewInit, BeforeLeav
this.documentForm.controls['payload'].setValue("");
this.documentForm.controls['currentResourceVersion'].setValue("");
this.documentForm.controls['payloadVersion'].setValue("");
this.documentForm.controls['payloadCreatedOn'].setValue("");
this.documentForm.controls['payload'].setValue("");
}
this.documentForm.markAsPristine();
......
......@@ -33,7 +33,7 @@
<div [formGroup]="documentForm"
style="float: right; vertical-align:middle;display: flex;align-items: center;justify-content: center; gap:0.4em;padding-right: 10px">
<span style="font-size: 0.8em">Show version:</span>
<select matNativeControl style="width: 100px; border-bottom: gray solid 1px"
<select matNativeControl style="width: 100px; border-bottom: grey solid 1px"
placeholder="All document version"
matTooltip="Select version to display."
formControlName="payloadVersion"
......@@ -45,8 +45,15 @@
>
{{version}}
</option>
</select>
<span style="font-size: 0.8em">Created on:</span>
<input id="payloadCreatedOn_id"
matInput [ngxMatDatetimePicker]="payloadCreatedOnPicker"
formControlName="payloadCreatedOn"
readonly>
<mat-datepicker-toggle matSuffix [for]="payloadCreatedOnPicker" style="visibility: hidden"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #payloadCreatedOnPicker [showSpinners]="true" [showSeconds]="false"
[hideTime]="false"></ngx-mat-datetime-picker>
</div>
</mat-toolbar-row>
</mat-toolbar>
......
......@@ -72,6 +72,7 @@ export class SubresourceDocumentPanelComponent implements AfterViewInit, BeforeL
'name': new FormControl({value: null}),
'currentResourceVersion': new FormControl({value: null}),
'payloadVersion': new FormControl({value: null}),
'payloadCreatedOn': new FormControl({value: null}),
'payload': new FormControl({value: null}),
});
this.documentForm.controls['payload'].setValue("")
......@@ -145,6 +146,7 @@ export class SubresourceDocumentPanelComponent implements AfterViewInit, BeforeL
this.documentForm.controls['name'].setValue(value.name);
this.documentForm.controls['currentResourceVersion'].setValue(value.currentResourceVersion);
this.documentForm.controls['payloadVersion'].setValue(value.payloadVersion);
this.documentForm.controls['payloadCreatedOn'].setValue(value.payloadCreatedOn);
this.documentForm.controls['payload'].setValue(!value.payload?"":value.payload);
this.documentForm.controls['payload'].enable();
......@@ -159,6 +161,7 @@ export class SubresourceDocumentPanelComponent implements AfterViewInit, BeforeL
this.documentForm.controls['payload'].setValue("");
this.documentForm.controls['currentResourceVersion'].setValue("");
this.documentForm.controls['payloadVersion'].setValue("");
this.documentForm.controls['payloadCreatedOn'].setValue("");
this.documentForm.controls['payload'].setValue("");
}
this.documentForm.markAsPristine();
......
import {Component, OnDestroy, OnInit} from '@angular/core';
import {Router, ActivatedRoute} from '@angular/router';
import {SecurityService} from '../security/security.service';
import {HttpEventService} from '../http/http-event.service';
import {AlertMessageService} from '../common/alert-message/alert-message.service';
import {SecurityEventService} from '../security/security-event.service';
import {User} from '../security/user.model';
import {MatDialogRef, MatDialog} from '@angular/material/dialog';
import {MatDialog} from '@angular/material/dialog';
import {DefaultPasswordDialogComponent} from 'app/security/default-password-dialog/default-password-dialog.component';
import {Subscription} from 'rxjs';
import {ExpiredPasswordDialogComponent} from '../common/dialogs/expired-password-dialog/expired-password-dialog.component';
import {GlobalLookups} from "../common/global-lookups";
import {PasswordChangeDialogComponent} from "../common/dialogs/password-change-dialog/password-change-dialog.component";
import {InformationDialogComponent} from "../common/dialogs/information-dialog/information-dialog.component";
import {DatePipe, formatDate} from "@angular/common";
import {formatDate} from "@angular/common";
import {EntityStatus} from "../common/enums/entity-status.enum";
@Component({
......@@ -32,7 +31,6 @@ export class LoginComponent implements OnInit, OnDestroy {
private router: Router,
public lookups: GlobalLookups,
private securityService: SecurityService,
private httpEventService: HttpEventService,
private alertService: AlertMessageService,
private securityEventService: SecurityEventService,
private dialog: MatDialog) {
......
......@@ -56,7 +56,7 @@
<ng-template #searchDomainPanel>
<mat-form-field id="domain-filter">
<mat-label>Filter Domain by domain code</mat-label>
<mat-label>Filter by domain code</mat-label>
<input matInput (keyup)="applyDomainFilter($event)" #inputDomainFilter>
</mat-form-field>
......
......@@ -17,17 +17,17 @@
</div>
<ng-template #searchUserPanel>
<mat-form-field id="domain-filter">
<mat-label>Filter Users</mat-label>
<mat-form-field id="user-filter">
<mat-label>Filter by username</mat-label>
<input matInput (keyup)="applyUserFilter($event)" placeholder="User name or full name" #inputUserFilter>
</mat-form-field>
<mat-toolbar class ="mat-elevation-z2">
<mat-toolbar-row class="smp-toolbar-row">
<mat-toolbar class="mat-elevation-z2">
<mat-toolbar-row class="smp-toolbar-row">
<button mat-raised-button
mat-flat-button color="primary"
(click)="onCreateUserClicked()"
>Create User
>Create user
</button>
<button mat-raised-button
......@@ -39,7 +39,7 @@
</button>
</mat-toolbar-row>
</mat-toolbar>
<table class="mat-elevation-z2" id="admin-domain-table" mat-table [dataSource]="userData" >
<table class="mat-elevation-z2" id="admin-user-table" mat-table [dataSource]="userData" >
<ng-container matColumnDef="username">
<th mat-header-cell *matHeaderCellDef >Username</th>
<td mat-cell *matCellDef="let row" [matTooltip]="row.username">{{row.username}}</td>
......
......@@ -30,7 +30,7 @@ public class DocumentDao extends BaseDao<DBDocument> {
* Method returns the document for the resource
*
* @param dbResource resource
* @return
* @return document for the resource or empty if not found
*/
public Optional<DBDocument> getDocumentForResource(DBResource dbResource) {
try {
......@@ -67,7 +67,10 @@ public class DocumentDao extends BaseDao<DBDocument> {
query.setParameter(PARAM_SUBRESOURCE_ID, subresource.getId());
return Optional.of(query.getSingleResult());
} catch (NonUniqueResultException e) {
throw new SMPRuntimeException(ErrorCode.RESOURCE_DOCUMENT_ERROR, subresource.getIdentifierValue(), subresource.getIdentifierScheme(),
DBResource resource = subresource.getResource();
throw new SMPRuntimeException(ErrorCode.SUBRESOURCE_DOCUMENT_ERROR,
subresource.getIdentifierValue(), subresource.getIdentifierScheme(),
resource.getIdentifierValue(), resource.getIdentifierScheme(),
"Multiple documents for subresource");
} catch (NoResultException e) {
return Optional.empty();
......
......@@ -103,10 +103,9 @@ public class DBDocument extends BaseEntity {
protected int getNextVersionIndex(){
List<DBDocumentVersion> list = getDocumentVersions();
return list.stream()
return list.stream()
.map(DBDocumentVersion::getVersion)
.reduce(-1, (a, b) -> Integer.max(a, b))
.intValue() + 1;
.reduce(0, (a, b) -> Integer.max(a, b)) + 1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment