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

Skip to content
Snippets Groups Projects
Commit eac8859f authored by Sebastian-Ion TINCU's avatar Sebastian-Ion TINCU
Browse files

EDELIVERY-11674 - Alerts UI Improvements

Improve alert details dialog.
parent 8fae59c4
No related branches found
No related tags found
No related merge requests found
Pipeline #209321 failed
...@@ -28,6 +28,7 @@ import {CredentialDialogComponent} from "./common/dialogs/credential-dialog/cred ...@@ -28,6 +28,7 @@ import {CredentialDialogComponent} from "./common/dialogs/credential-dialog/cred
import {DataPanelComponent} from "./common/panels/data-panel/data-panel.component"; import {DataPanelComponent} from "./common/panels/data-panel/data-panel.component";
import {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE, MatNativeDateModule} from "@angular/material/core"; import {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE, MatNativeDateModule} from "@angular/material/core";
import {DatePipe} from './custom-date/date.pipe'; import {DatePipe} from './custom-date/date.pipe';
import {DatePipe as AngularDatePipe} from '@angular/common';
import {DefaultPasswordDialogComponent} from './security/default-password-dialog/default-password-dialog.component'; import {DefaultPasswordDialogComponent} from './security/default-password-dialog/default-password-dialog.component';
import {DialogComponent} from './common/dialogs/dialog/dialog.component'; import {DialogComponent} from './common/dialogs/dialog/dialog.component';
import {DomainPanelComponent} from "./system-settings/admin-domain/domain-panel/domain-panel.component"; import {DomainPanelComponent} from "./system-settings/admin-domain/domain-panel/domain-panel.component";
...@@ -350,6 +351,7 @@ import {MatButtonToggleModule} from "@angular/material/button-toggle"; ...@@ -350,6 +351,7 @@ import {MatButtonToggleModule} from "@angular/material/button-toggle";
AuthorizedGuard, AuthorizedGuard,
CertificateService, CertificateService,
DatePipe, DatePipe,
AngularDatePipe,
DnsToolsService, DnsToolsService,
DomainService, DomainService,
DownloadService, DownloadService,
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<!-- Name Column --> <!-- Name Column -->
<ng-container matColumnDef="key"> <ng-container matColumnDef="key">
<th mat-header-cell *matHeaderCellDef>{{ "object.properties.dialog.header.key" | translate }}</th> <th mat-header-cell *matHeaderCellDef>{{ "object.properties.dialog.header.key" | translate }}</th>
<td mat-cell *matCellDef="let element">{{element[0] | titlecase }}</td> <td mat-cell *matCellDef="let element">{{element[0] | translate | titlecase }}</td>
</ng-container> </ng-container>
<!-- Weight Column --> <!-- Weight Column -->
......
...@@ -13,7 +13,7 @@ export class ObjectPropertiesDialogComponent { ...@@ -13,7 +13,7 @@ export class ObjectPropertiesDialogComponent {
title: string = "Object properties"; title: string = "Object properties";
displayedColumns: string[] = ['key', 'value']; displayedColumns: string[] = ['key', 'value'];
dataSource : object[]; dataSource: object[];
constructor(public dialogRef: MatDialogRef<ObjectPropertiesDialogComponent>, constructor(public dialogRef: MatDialogRef<ObjectPropertiesDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: any, @Inject(MAT_DIALOG_DATA) public data: any,
...@@ -21,13 +21,14 @@ export class ObjectPropertiesDialogComponent { ...@@ -21,13 +21,14 @@ export class ObjectPropertiesDialogComponent {
private datePipe: DatePipe, private datePipe: DatePipe,
private lookups: GlobalLookups) { private lookups: GlobalLookups) {
this.translateService.get(data.i18n).subscribe(title => this.title = title); this.translateService.get(data.i18n).subscribe(title => this.title = title);
this.dataSource = Array.of(data.object) this.dataSource = data.object.map(row => [row.i18n, this.parseValue(row)]);
.map(async row => await this.translateService.get(row.i18n).subscribe(key => { }
if (row.type === "dateTime") {
let dateTimeFormat = this.lookups.getDateTimeFormat(); private parseValue(row) {
return this.datePipe.transform(row.value, dateTimeFormat); if (row.type === "dateTime") {
} let dateTimeFormat = this.lookups.getDateTimeFormat();
return row.value; return this.datePipe.transform(row.value, dateTimeFormat);
})); }
return row.value;
} }
} }
...@@ -36,26 +36,26 @@ export class AlertController implements SearchTableController { ...@@ -36,26 +36,26 @@ export class AlertController implements SearchTableController {
i18n: "alert.panel.dialog.title.alert.details", i18n: "alert.panel.dialog.title.alert.details",
object: [{ object: [{
i18n: "alert.panel.label.column.alert.date", i18n: "alert.panel.label.column.alert.date",
value: row?.reportingTime, value: row.row?.reportingTime,
type: "dateTime" type: "dateTime"
}, { }, {
i18n: "alert.panel.label.column.alert.level", i18n: "alert.panel.label.column.alert.level",
value: row?.alertLevel value: row.row?.alertLevel
}, { }, {
i18n: "alert.panel.label.column.for.user", i18n: "alert.panel.label.column.for.user",
value: row?.username value: row.row?.username
}, { }, {
i18n: "alert.panel.label.column.credential.type", i18n: "alert.panel.label.column.credential.type",
value: row?.alertDetails['CREDENTIAL_TYPE'] value: row.row?.alertDetails['CREDENTIAL_TYPE']
}, { }, {
i18n: "alert.panel.label.column.alert.type", i18n: "alert.panel.label.column.alert.type",
value: row?.alertType, value: row.row?.alertType,
}, { }, {
i18n: "alert.panel.label.column.alert.status", i18n: "alert.panel.label.column.alert.status",
value: row?.alertStatus, value: row.row?.alertStatus,
}, { }, {
i18n: "alert.panel.label.column.status.description", i18n: "alert.panel.label.column.status.description",
value: row?.alertStatusDesc, value: row.row?.alertStatusDesc,
}] }]
} }
}); });
......
...@@ -34,10 +34,32 @@ export class ReviewTasksController implements SearchTableController { ...@@ -34,10 +34,32 @@ export class ReviewTasksController implements SearchTableController {
} }
public showDetails(row: any): MatDialogRef<any> { public showDetails(row: any): MatDialogRef<any> {
return this.dialog.open(AlertDetailsDialogComponent, { return this.dialog.open(ObjectPropertiesDialogComponent, {
data: { data: {
i18n: "review.edit.dialog.title", i18n: "review.edit.dialog.title",
object: row, object: [{
i18n: "review.edit.panel.label.column.review.date",
value: row.row?.lastUpdatedOn,
type: "dateTime"
}, {
i18n: "review.edit.panel.label.column.target",
value: row.row?.target,
}, {
i18n: "review.edit.panel.label.column.version",
value: row.row?.version,
}, {
i18n: "review.edit.panel.label.column.resource.scheme",
value: row.row?.resourceIdentifierScheme,
}, {
i18n: "review.edit.panel.label.column.resource.value",
value: row.row?.resourceIdentifierValue,
}, {
i18n: "review.edit.panel.label.column.subresource.scheme",
value: row.row?.subresourceIdentifierScheme,
}, {
i18n: "review.edit.panel.label.column.subresource.value",
value: row.row?.subresourceIdentifierValue,
}]
} }
}); });
} }
......
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