Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 1a5ff13e authored by Joze RIHTARSIC's avatar Joze RIHTARSIC
Browse files

UI enhancement: resource and subresource document fields more compact

parent 93f6e688
No related branches found
No related tags found
No related merge requests found
Showing
with 137 additions and 127 deletions
......@@ -143,6 +143,7 @@ import {SubresourceDocumentWizardComponent} from "./edit/edit-resources/subresou
import {SmpWarningPanelComponent} from "./common/components/smp-warning-panel/smp-warning-panel.component";
import {ManageMembersDialogComponent} from "./common/dialogs/manage-members-dialog/manage-members-dialog.component";
import {HttpErrorHandlerService} from "./common/error/http-error-handler.service";
import {SmpTitledLabelComponent} from "./common/components/smp-titled-label/smp-titled-label.component";
@NgModule({
......@@ -217,6 +218,7 @@ import {HttpErrorHandlerService} from "./common/error/http-error-handler.service
SidenavComponent,
SmpFieldErrorComponent,
SmpLabelComponent,
SmpTitledLabelComponent,
SmpWarningPanelComponent,
SpacerComponent,
SpinnerComponent,
......
.smp-titled-label {
display:flex;
flex-direction: row;
margin: 0.2em 0.5em;
align-items: center;
}
.smp-tl-title {
display:flex;
flex-direction: row;
font-size: 0.75em;
gap:0.5em;
align-items: center;
min-width: 160px;
}
.smp-tl-value {
border-bottom: gray solid 1px;
padding: 0.1em 0.5em;
margin: 0 0.3em;
color:darkgray;
flex-grow: 1;
min-height: 1.5em;
}
import { Component, Input } from '@angular/core';
@Component({
selector: 'smp-titled-label',
styleUrls: ['./smp-titled-label.component.css'],
template: '<div class="smp-titled-label">' +
' <div class="smp-tl-title " >' +
' <mat-icon *ngIf="icon">{{icon}}</mat-icon>' +
' <span>{{title}}</span>' +
' </div>' +
' <div class="smp-tl-value">{{value}}</div>' +
'</div>'
})
export class SmpTitledLabelComponent {
@Input() title:string;
@Input() icon:string;
@Input() value:string;
}
......@@ -191,7 +191,7 @@
</div>
<mat-toolbar class ="mat-elevation-z2">
<mat-toolbar-row class="smp-toolbar-row">
<button mat-flat-button color="primary" id="changePassword_id"
<button mat-flat-button color="primary" id="changePassword_id" [disabled]="isNewUser"
(click)="changeCurrentUserPassword()">
<span>Set/change password</span>
</button>
......
......@@ -146,13 +146,13 @@ export class UserProfilePanelComponent {
if (!value) {
this.userCredentialForm.controls['passwordUpdatedOn'].setValue(null);
this.userCredentialForm.controls['passwordExpireOn'].setValue(null);
this.userCredentialForm.controls['sequentialLoginFailureCount'].setValue(null);
this.userCredentialForm.controls['sequentialLoginFailureCount'].setValue(0);
this.userCredentialForm.controls['lastFailedLoginAttempt'].setValue(null);
this.userCredentialForm.controls['suspendedUtil'].setValue(null);
} else {
this.userCredentialForm.controls['passwordUpdatedOn'].setValue(value.passwordUpdatedOn);
this.userCredentialForm.controls['passwordExpireOn'].setValue(value.passwordExpireOn);
this.userCredentialForm.controls['sequentialLoginFailureCount'].setValue(value.sequentialLoginFailureCount);
this.userCredentialForm.controls['sequentialLoginFailureCount'].setValue(!(value.sequentialLoginFailureCount)?"---":value.sequentialLoginFailureCount);
this.userCredentialForm.controls['lastFailedLoginAttempt'].setValue(value.lastFailedLoginAttempt);
this.userCredentialForm.controls['suspendedUtil'].setValue(value.suspendedUtil);
}
......@@ -166,9 +166,9 @@ export class UserProfilePanelComponent {
}
onResetButtonClicked() {
if (this.isNewUser) {
/*if (this.isNewUser) {
this.onDiscardNew.emit();
}
}*/
this.userForm.reset(this._managedUserData);
if (this.isUserDataLoggedInUserData) {
this.themeService.persistTheme(this._managedUserData.smpTheme);
......
......@@ -65,7 +65,6 @@
{{visibility.key}}
</mat-option>
</mat-select>
<mat-hint>Choose resource visibility</mat-hint>
</mat-form-field>
</form>
</mat-dialog-content>
......
<div id="resource-document-panel">
<mat-toolbar class="mat-elevation-z2" style="flex-grow: 0">
<mat-toolbar-row class="smp-toolbar-row">
<mat-toolbar class="mat-elevation-z2" style="min-height: 50px !important;">
<mat-toolbar-row class="smp-toolbar-row" style="justify-content: space-between;min-height: 50px !important;">
<button id="validateResource_id" mat-raised-button
color="primary"
matTooltip="Validate resource"
......@@ -29,50 +30,18 @@
<mat-icon>code_block</mat-icon>
<span>Document wizard</span>
</button>
</mat-toolbar-row>
</mat-toolbar>
<div [formGroup]="resourceForm" style="width: 100%; display: flex; flex-direction: row; ">
<mat-form-field style="width: 100%">
<mat-label>Resource scheme</mat-label>
<input id="identifierScheme_id" type="text" matInput
formControlName="identifierScheme"
>
</mat-form-field>
<mat-form-field style="width: 100%">
<mat-label>Resource identifier</mat-label>
<input id="identifierValue_id" type="text" matInput #identifierValue
formControlName="identifierValue"
required auto-focus-directive>
</mat-form-field>
</div>
<div [formGroup]="documentForm" style="width: 100%; display: flex; flex-direction: column; flex:1; gap:0.5em ">
<div style="width: 100%; display: flex; flex-direction: row; flex:0; gap:0.5em">
<mat-form-field style="flex:2">
<mat-label>Document name</mat-label>
<input id="documentName_id" type="text" matInput
formControlName="name"
>
</mat-form-field>
<mat-form-field style="flex:1">
<mat-label>Document mimeType</mat-label>
<input id="documentMimeType_id" type="text" matInput
formControlName="mimeType"
>
</mat-form-field>
<mat-form-field style="width:200px">
<mat-label>Current document version</mat-label>
<input id="current_version_id" type="text" matInput
formControlName="currentResourceVersion"
required auto-focus-directive>
</mat-form-field>
<mat-form-field style="width:200px">
<mat-label>Document versions</mat-label>
<mat-select placeholder="All document version"
<span style="flex: 1 1 auto;"></span>
<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>
<mat-select style="width: 100px; border-bottom: gray solid 1px"
placeholder="All document version"
matTooltip="Select version to display."
formControlName="payloadVersion"
id="document version_id"
(selectionChange)="onSelectionDocumentVersionChanged()"
>
>
<mat-option *ngFor="let version of getDocumentVersions"
[value]="version"
>
......@@ -80,9 +49,29 @@
</mat-option>
</mat-select>
</mat-form-field>
</div>
</mat-toolbar-row>
</mat-toolbar>
<div class="panel">
<div style="display: flex;flex-direction: row;width: 100%">
<smp-titled-label style="flex-grow: 1" title="Resource identifier:"
value="{{resource?.identifierValue}}"></smp-titled-label>
<smp-titled-label style="flex-grow: 1" title="Resource scheme:"
value="{{resource?.identifierScheme}}"></smp-titled-label>
</div>
<div style="display:block; overflow: auto;flex: 2;align-self: stretch; flex-direction: column;background-color: #FCFCFCBB; border: ridge 3px #b0bec5"
<div style="display: flex;flex-direction: row;width: 100%">
<smp-titled-label style="flex-grow: 1" title="Document name:" value="{{_document?.name}}"></smp-titled-label>
<smp-titled-label style="flex-grow: 1" title="Document mimeType:"
value="{{_document?.mimeType}}"></smp-titled-label>
<smp-titled-label style="flex-grow: 1" title="Current document version:"
value="{{_document?.currentResourceVersion}}"></smp-titled-label>
</div>
</div>
<div [formGroup]="documentForm" style="width: 100%; display: flex; flex-direction: column; flex:1; gap:0.5em ">
<div
style="display:block; overflow: auto;flex: 2;align-self: stretch; flex-direction: column;background-color: #FCFCFCBB; border: ridge 3px #b0bec5"
(click)="onEditPanelClick()"
>
<ngx-codemirror #codemirror
......
......@@ -2,7 +2,7 @@
display: flex;
height: 100%;
flex-direction: column;
gap:0.5em;
}
.CodeMirror {
......
......@@ -24,7 +24,7 @@ export class ResourceDocumentPanelComponent implements AfterViewInit, BeforeLeav
title: string = "Resources";
private _resource: ResourceRo;
private _document: DocumentRo;
_document: DocumentRo;
@Input() private group: GroupRo;
@Input() domain: DomainRo;
@Input() domainResourceDefs: ResourceDefinitionRo[];
......
<div id="resource-document-panel">
<mat-toolbar class="mat-elevation-z2" style="flex-grow: 0">
<mat-toolbar-row class="smp-toolbar-row">
<mat-toolbar class="mat-elevation-z2" style="min-height: 50px !important;">
<mat-toolbar-row class="smp-toolbar-row" style="justify-content: space-between;min-height: 50px !important;">
<button id="validateResource_id" mat-raised-button
color="primary"
[disabled]="emptyDocument"
......@@ -28,64 +28,18 @@
<mat-icon>code_block</mat-icon>
<span>Document wizard</span>
</button>
</mat-toolbar-row>
</mat-toolbar>
<div [formGroup]="resourceForm" style="width: 100%; display: flex; flex-direction: row; ">
<mat-form-field style="width: 100%">
<mat-label>Resource scheme</mat-label>
<input id="identifierScheme_id" type="text" matInput
formControlName="identifierScheme"
>
</mat-form-field>
<mat-form-field style="width: 100%">
<mat-label>Resource identifier</mat-label>
<input id="identifierValue_id" type="text" matInput
formControlName="identifierValue"
required auto-focus-directive>
</mat-form-field>
</div>
<div [formGroup]="subresourceForm" style="width: 100%; display: flex; flex-direction: row; ">
<mat-form-field style="width: 100%">
<mat-label>Subresource scheme</mat-label>
<input id="subresourceidentifierScheme_id" type="text" matInput
formControlName="identifierScheme"
>
</mat-form-field>
<mat-form-field style="width: 100%">
<mat-label>Subresource identifier</mat-label>
<input id="SubresourcedentifierValue_id" type="text" matInput
formControlName="identifierValue"
required auto-focus-directive>
</mat-form-field>
</div>
<div [formGroup]="documentForm" style="width: 100%; display: flex; flex-direction: column; flex:1; gap:0.5em ">
<div style="width: 100%; display: flex; flex-direction: row; flex:0; gap:0.5em">
<mat-form-field style="flex:2">
<mat-label>Document name</mat-label>
<input id="documentName_id" type="text" matInput
formControlName="name"
>
</mat-form-field>
<mat-form-field style="flex:1">
<mat-label>Document mimeType</mat-label>
<input id="documentMimeType_id" type="text" matInput
formControlName="mimeType"
>
</mat-form-field>
<mat-form-field style="width:200px">
<mat-label>Current document version</mat-label>
<input id="current_version_id" type="text" matInput
formControlName="currentResourceVersion"
required auto-focus-directive>
</mat-form-field>
<mat-form-field style="width:200px">
<mat-label>Document versions</mat-label>
<mat-select placeholder="All document version"
<span style="flex: 1 1 auto;"></span>
<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>
<mat-select style="width: 100px; border-bottom: gray solid 1px"
placeholder="All document version"
matTooltip="Select version to display."
formControlName="payloadVersion"
id="document version_id"
(selectionChange)="onSelectionDocumentVersionChanged()"
>
>
<mat-option *ngFor="let version of getDocumentVersions"
[value]="version"
>
......@@ -93,9 +47,35 @@
</mat-option>
</mat-select>
</mat-form-field>
</div>
</mat-toolbar-row>
</mat-toolbar>
<div class="panel">
<div style="display: flex;flex-direction: row;width: 100%">
<smp-titled-label style="flex-grow: 1" title="Resource identifier:"
value="{{resource?.identifierValue}}"></smp-titled-label>
<smp-titled-label style="flex-grow: 1" title="Resource scheme:"
value="{{resource?.identifierScheme}}"></smp-titled-label>
</div>
<div style="display: flex;flex-direction: row;width: 100%">
<smp-titled-label style="flex-grow: 1" title="Subresource identifier:"
value="{{subresource?.identifierValue}}"></smp-titled-label>
<smp-titled-label style="flex-grow: 1" title="Subresource scheme:"
value="{{subresource?.identifierScheme}}"></smp-titled-label>
</div>
<div style="display:block; overflow: auto;flex: 2;align-self: stretch; flex-direction: column;background-color: #FCFCFCBB; border: ridge 3px #b0bec5"
<div style="display: flex;flex-direction: row;width: 100%">
<smp-titled-label style="flex-grow: 1" title="Document name:" value="{{_document?.name}}"></smp-titled-label>
<smp-titled-label style="flex-grow: 1" title="Document mimeType:"
value="{{_document?.mimeType}}"></smp-titled-label>
<smp-titled-label style="flex-grow: 1" title="Current document version:"
value="{{_document?.currentResourceVersion}}"></smp-titled-label>
</div>
</div>
<div [formGroup]="documentForm" style="width: 100%; display: flex; flex-direction: column; flex:1; gap:0.5em ">
<div
style="display:block; overflow: auto;flex: 2;align-self: stretch; flex-direction: column;background-color: #FCFCFCBB; border: ridge 3px #b0bec5"
(click)="onEditPanelClick()"
>
<ngx-codemirror #codemirror
......
......@@ -32,7 +32,7 @@ export class SubresourceDocumentPanelComponent implements AfterViewInit, BeforeL
private _resource: ResourceRo;
private _subresource: SubresourceRo;
private _document: DocumentRo;
_document: DocumentRo;
@Input() private group: GroupRo;
@Input() domain: DomainRo;
@Input() domainResourceDefs: ResourceDefinitionRo[];
......
......@@ -116,7 +116,7 @@ export class SubresourcePanelComponent implements AfterViewInit, OnInit, BeforeL
subresourceDefs: subResDef,
subresource: this.createSubresource(subResDef),
formTitle: "Create Subresourcedialog"
formTitle: "Create Subresource Dialog"
}
}).afterClosed().subscribe(value => {
this.refresh();
......@@ -204,6 +204,7 @@ export class SubresourcePanelComponent implements AfterViewInit, OnInit, BeforeL
.subscribe((result: SubresourceRo) => {
if (result) {
this.alertService.success("Subresource [" + this.selected.identifierScheme + "] and identifier: [" + this.selected.identifierValue + "] deleted.");
this.selected = null;
}
}, (error) => {
this.alertService.error(error.error?.errorDescription);
......
......@@ -117,9 +117,6 @@ export class SecurityService {
return this.isCurrentUserInRole([Authority.SYSTEM_ADMIN]);
}
isCurrentUserSMPAdmin(): boolean {
return this.isCurrentUserInRole([Authority.SMP_ADMIN]);
}
......
......@@ -45,7 +45,6 @@ export class AdminUserComponent implements AfterViewInit, BeforeLeaveGuard {
private alertService: AlertMessageService,
private dialog: MatDialog) {
}
ngAfterViewInit() {
......@@ -65,7 +64,7 @@ export class AdminUserComponent implements AfterViewInit, BeforeLeaveGuard {
this.loadTableData();
}
loadTableData() {
loadTableData(selectUsername: string = null) {
this.isLoadingResults = true;
......@@ -78,6 +77,10 @@ export class AdminUserComponent implements AfterViewInit, BeforeLeaveGuard {
this.userData = [...result.serviceEntities];
this.resultsLength = result.count;
this.isLoadingResults = false;
if (!!selectUsername) {
this.userSelected(this.userData.find(user => user.username === selectUsername));
}
}
);
}
......@@ -150,8 +153,9 @@ export class AdminUserComponent implements AfterViewInit, BeforeLeaveGuard {
if (user) {
this.selected = null;
this.managedUserData = null;
this.loadTableData();
this.loadTableData(user.username);
this.alertService.success("User [" + user.username + "] updated!");
}
}, (error) => {
if (this.httpErrorHandlerService.logoutOnInvalidSessionError(error)) {
......@@ -167,8 +171,8 @@ export class AdminUserComponent implements AfterViewInit, BeforeLeaveGuard {
if (user) {
this.selected = null;
this.managedUserData = null;
this.loadTableData();
this.alertService.success("User [" + user.username + "] created!");
this.loadTableData(user.username);
this.alertService.success("User [" + user.username + "] has been created!");
}
}, (error) => {
if (this.httpErrorHandlerService.logoutOnInvalidSessionError(error)) {
......@@ -200,7 +204,7 @@ export class AdminUserComponent implements AfterViewInit, BeforeLeaveGuard {
this.selected = null;
this.managedUserData = null;
this.loadTableData();
this.alertService.success("User [" + user.username + "] deleted!");
this.alertService.success("User [" + user.username + "] has been deleted!");
}
}, (error) => {
if (this.httpErrorHandlerService.logoutOnInvalidSessionError(error)) {
......
......@@ -15,7 +15,7 @@
list-style-type: none;
margin: 0 !important;
padding: 0 !important;
padding-left: 1.0em !important;
padding-left: 0.5em !important;
}
/* Draw the bottom menu line */
......@@ -26,7 +26,7 @@
.nav-tree li button {
min-height: 2.5em !important;
height: 2.5em;
padding-left: 1.0em !important;
padding-left: 0.5em !important;
padding-right: 0 !important;
margin: 0 !important;
}
......
......@@ -95,10 +95,6 @@ export class NavigationService extends MatTreeNestedDataSource<NavigationNode> {
this.refreshNavigationTree();
}
);
securityEventService.onLoginErrorEvent().subscribe(value => {
this.refreshNavigationTree();
}
);
securityEventService.onLogoutSuccessEvent().subscribe(value => {
this.refreshNavigationTree();
}
......
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