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

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

Small UI fixes

parent a1fee4de
No related branches found
No related tags found
No related merge requests found
Showing
with 43 additions and 33 deletions
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</button> </button>
</mat-toolbar-row> </mat-toolbar-row>
</mat-toolbar> </mat-toolbar>
<h3>{{title}}</h3> <h3 style="word-wrap: break-word; max-width: 750px">{{title}}</h3>
<div class="domain-member-container mat-elevation-z2"> <div class="domain-member-container mat-elevation-z2">
<div class="domain-member-loading-shade" <div class="domain-member-loading-shade"
*ngIf="isLoadingResults"> *ngIf="isLoadingResults">
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
</button> </button>
</mat-toolbar-row> </mat-toolbar-row>
</mat-toolbar> </mat-toolbar>
<h3>{{title}}</h3> <h3 style="word-wrap: break-word; max-width: 750px">{{title}}</h3>
<div class="group-container mat-elevation-z2"> <div class="group-container mat-elevation-z2">
<div class="group-loading-shade" <div class="group-loading-shade"
*ngIf="isLoadingResults"> *ngIf="isLoadingResults">
......
...@@ -37,14 +37,12 @@ ...@@ -37,14 +37,12 @@
</div> </div>
<ng-template #searchDomainPanel> <ng-template #searchDomainPanel>
<div *ngIf="!!domainList && domainList.length>0">
<mat-form-field id="domain-filter"> <mat-form-field id="domain-filter">
<mat-label>Filter Domain by domain code</mat-label> <mat-label>Filter Domain by domain code</mat-label>
<input matInput (keyup)="applyDomainFilter($event)" placeholder="Domain code" #inputDomainFilter> <input matInput (keyup)="applyDomainFilter($event)" placeholder="Domain code" #inputDomainFilter>
</mat-form-field> </mat-form-field>
<table class="mat-elevation-z2" id="admin-domain-table" <table class="mat-elevation-z2" id="edit-domain-table" mat-table [dataSource]="dataSource" matSort>
mat-table [dataSource]="dataSource">
<ng-container matColumnDef="domainCode"> <ng-container matColumnDef="domainCode">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Domain code</th> <th mat-header-cell *matHeaderCellDef mat-sort-header>Domain code</th>
<td mat-cell *matCellDef="let row" [matTooltip]="row.domainCode">{{row.domainCode}}</td> <td mat-cell *matCellDef="let row" [matTooltip]="row.domainCode">{{row.domainCode}}</td>
...@@ -59,14 +57,15 @@ ...@@ -59,14 +57,15 @@
"{{inputDomainFilter.value}}" "{{inputDomainFilter.value}}"
</td> </td>
<ng-template #noDataFound> <ng-template #noDataFound>
<td class="mat-cell" colspan="2">No data</td> <td class="mat-cell" colspan="2">User is not administrator of any of the domains</td>
</ng-template> </ng-template>
</tr> </tr>
</table> </table>
<mat-paginator class="mat-elevation-z2" id="domain-paginator"
[hidePageSize]="true" <mat-paginator class="mat-elevation-z2" id="edit-domain-paginator" #editDomainPaginator
[showFirstLastButtons]="true" [hidePageSize]="true"
[pageSize]="5" aria-label="Select page"></mat-paginator> [showFirstLastButtons]="true"
</div> [pageSize]="5"
aria-label="Select page"></mat-paginator>
</ng-template> </ng-template>
...@@ -48,8 +48,7 @@ export class EditDomainComponent implements OnInit, AfterViewInit, BeforeLeaveGu ...@@ -48,8 +48,7 @@ export class EditDomainComponent implements OnInit, AfterViewInit, BeforeLeaveGu
}; };
} }
ngAfterViewInit() { ngAfterViewInit():void {
this.dataSource.paginator = this.paginator; this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort; this.dataSource.sort = this.sort;
// MatTab has only onTabChanged which is a bit to late. Register new listener to internal // MatTab has only onTabChanged which is a bit to late. Register new listener to internal
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</button> </button>
</mat-toolbar-row> </mat-toolbar-row>
</mat-toolbar> </mat-toolbar>
<h3>{{title}}</h3> <h3 style="word-wrap: break-word; max-width: 750px">{{title}}</h3>
<div class="edit-resource-container mat-elevation-z2"> <div class="edit-resource-container mat-elevation-z2">
<div class="edit-resource-loading-shade" <div class="edit-resource-loading-shade"
*ngIf="isLoadingResults"> *ngIf="isLoadingResults">
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
(page)="onPageChanged($event)" (page)="onPageChanged($event)"
[hidePageSize]="true" [hidePageSize]="true"
[showFirstLastButtons]="true" [showFirstLastButtons]="true"
[pageSize]="10" [pageSize]="5"
[disabled]="disabledForm" [disabled]="disabledForm"
aria-label="Select pages"></mat-paginator> aria-label="Select pages"></mat-paginator>
</div> </div>
......
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
(page)="onPageChanged($event)" (page)="onPageChanged($event)"
[hidePageSize]="true" [hidePageSize]="true"
[showFirstLastButtons]="true" [showFirstLastButtons]="true"
[pageSize]="10" [pageSize]="5"
aria-label="Select pages"></mat-paginator> aria-label="Select pages"></mat-paginator>
</div> </div>
</div> </div>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</button> </button>
</mat-toolbar-row> </mat-toolbar-row>
</mat-toolbar> </mat-toolbar>
<h3>{{title}}</h3> <h3 style="word-wrap: break-word; max-width: 750px">{{title}}</h3>
<form [formGroup]="resourceForm"> <form [formGroup]="resourceForm">
<mat-form-field style="width:100%"> <mat-form-field style="width:100%">
<mat-label>Resource type</mat-label> <mat-label>Resource type</mat-label>
......
...@@ -88,11 +88,12 @@ ...@@ -88,11 +88,12 @@
<input matInput name="technicalContactUrl" id="technicalContactUrl_id" matTooltip="Technical contact for the service" <input matInput name="technicalContactUrl" id="technicalContactUrl_id" matTooltip="Technical contact for the service"
[formControl]="dialogForm.controls['technicalContactUrl']" maxlength="255" type="url" > [formControl]="dialogForm.controls['technicalContactUrl']" maxlength="255" type="url" >
</mat-form-field> </mat-form-field>
<div class="required-fields">* required fields</div>
</div> </div>
</form> </form>
</mat-dialog-content> </mat-dialog-content>
<div class="required-fields">* required fields</div>
<mat-dialog-actions> <mat-dialog-actions>
<button id="generateSubresourceButton" mat-raised-button color="primary" [mat-dialog-close]="true" <button id="generateSubresourceButton" mat-raised-button color="primary" [mat-dialog-close]="true"
[disabled]="!dialogForm.valid"> [disabled]="!dialogForm.valid">
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
<mat-paginator class="mat-elevation-z2" <mat-paginator class="mat-elevation-z2"
[hidePageSize]="true" [hidePageSize]="true"
[showFirstLastButtons]="true" [showFirstLastButtons]="true"
[pageSize]="3" [pageSize]="5"
[disabled]="disabledForm" [disabled]="disabledForm"
aria-label="Select pages"></mat-paginator> aria-label="Select pages"></mat-paginator>
</div> </div>
......
...@@ -162,9 +162,10 @@ ...@@ -162,9 +162,10 @@
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>
<div class="required-fields">* required fields</div>
</mat-dialog-content> </mat-dialog-content>
<div class="required-fields">* required fields</div>
<mat-dialog-actions> <mat-dialog-actions>
<button mat-raised-button color="primary" (click)="submitForm()" <button mat-raised-button color="primary" (click)="submitForm()"
[disabled]="!dialogForm.valid"> [disabled]="!dialogForm.valid">
......
...@@ -100,10 +100,8 @@ ...@@ -100,10 +100,8 @@
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>
</div> </div>
<div class="required-fields">* required fields</div>
</mat-dialog-content> </mat-dialog-content>
<div class="required-fields">* required fields</div>
<mat-dialog-actions> <mat-dialog-actions>
<button mat-raised-button color="primary" (click)="submitForm()" <button mat-raised-button color="primary" (click)="submitForm()"
[disabled]="!dialogForm.valid"> [disabled]="!dialogForm.valid">
......
...@@ -108,9 +108,10 @@ ...@@ -108,9 +108,10 @@
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>
</form> </form>
<div class="required-fields">* required fields</div>
</mat-dialog-content> </mat-dialog-content>
<div class="required-fields">* required fields</div>
<mat-dialog-actions> <mat-dialog-actions>
<button mat-raised-button color="primary" [mat-dialog-close]="true" <button mat-raised-button color="primary" [mat-dialog-close]="true"
[disabled]="!dialogForm.valid"> [disabled]="!dialogForm.valid">
......
...@@ -103,6 +103,7 @@ ...@@ -103,6 +103,7 @@
<mat-paginator class="mat-elevation-z2" id="domain-paginator" <mat-paginator class="mat-elevation-z2" id="domain-paginator"
[hidePageSize]="true" [hidePageSize]="true"
[showFirstLastButtons]="true" [showFirstLastButtons]="true"
[pageSize]="10" aria-label="Select page"></mat-paginator> [pageSize]="5"
aria-label="Select page"></mat-paginator>
</ng-template> </ng-template>
...@@ -174,6 +174,10 @@ export class AdminDomainComponent implements OnInit, OnDestroy, AfterViewInit, B ...@@ -174,6 +174,10 @@ export class AdminDomainComponent implements OnInit, OnDestroy, AfterViewInit, B
this.alertService.error("ERROR: " + domain.actionMessage); this.alertService.error("ERROR: " + domain.actionMessage);
} }
this.dataSource.data = this.domainList; this.dataSource.data = this.domainList;
if (domain.status == EntityStatus.NEW) {
this.paginator.lastPage();
}
} }
applyDomainFilter(event: Event) { applyDomainFilter(event: Event) {
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<mat-paginator class="mat-elevation-z2" id="extension-paginator" <mat-paginator class="mat-elevation-z2" id="extension-paginator"
[hidePageSize]="true" [hidePageSize]="true"
[showFirstLastButtons]="true" [showFirstLastButtons]="true"
[pageSize]="10" aria-label="Select page"></mat-paginator> [pageSize]="5" aria-label="Select page"></mat-paginator>
</ng-template> </ng-template>
<h2 mat-dialog-title>{{formTitle}}</h2> <h2 mat-dialog-title>{{formTitle}}</h2>
<mat-dialog-content style="height:300px;width:800px"> <mat-dialog-content style="height:380px;width:800px">
<form [formGroup]="dialogForm"> <form [formGroup]="dialogForm">
<mat-card> <mat-card>
<mat-card-title>Import keystore</mat-card-title>
<mat-card-content> <mat-card-content>
<fieldset style="border: none;"> <fieldset style="border: none;">
<label style="width:100%"> <label style="width:100%">
...@@ -59,9 +58,10 @@ ...@@ -59,9 +58,10 @@
</mat-card> </mat-card>
</form> </form>
<div class="required-fields">* required fields</div>
</mat-dialog-content> </mat-dialog-content>
<div class="required-fields">* required fields</div>
<mat-dialog-actions> <mat-dialog-actions>
<button mat-raised-button color="primary" (click)="importKeystore()" [disabled]="!dialogForm.valid"> <button mat-raised-button color="primary" (click)="importKeystore()" [disabled]="!dialogForm.valid">
<mat-icon>vpn_key</mat-icon> <mat-icon>vpn_key</mat-icon>
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
[length]="resultsLength" [length]="resultsLength"
(page)="onPageChanged($event)" (page)="onPageChanged($event)"
[hidePageSize]="true" [hidePageSize]="true"
[pageSize]="10" [pageSize]="5"
[showFirstLastButtons]="true" [showFirstLastButtons]="true"
aria-label="Select page"></mat-paginator> aria-label="Select page"></mat-paginator>
</ng-template> </ng-template>
...@@ -139,10 +139,10 @@ ...@@ -139,10 +139,10 @@
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>
</form> </form>
<div class="required-fields">* required fields</div>
</mat-dialog-content> </mat-dialog-content>
<div class="required-fields">* required fields</div>
<mat-dialog-actions> <mat-dialog-actions>
<button mat-raised-button color="primary" (click)="submitForm()" [disabled]="!domainForm.valid"> <button mat-raised-button color="primary" (click)="submitForm()" [disabled]="!domainForm.valid">
<mat-icon>check_circle</mat-icon> <mat-icon>check_circle</mat-icon>
......
...@@ -25,7 +25,7 @@ public enum ErrorCode { ...@@ -25,7 +25,7 @@ public enum ErrorCode {
ILLEGAL_STATE_DOMAIN_MULTIPLE_ENTRY(500,"SMP:113",ErrorBusinessCode.TECHNICAL,"More than one domain entry (domain: '%s') is defined in database!"), ILLEGAL_STATE_DOMAIN_MULTIPLE_ENTRY(500,"SMP:113",ErrorBusinessCode.TECHNICAL,"More than one domain entry (domain: '%s') is defined in database!"),
MISSING_DOMAIN(400,"SMP:114",ErrorBusinessCode.MISSING_FIELD,"More than one domain registered on SMP. The domain must be defined!"), MISSING_DOMAIN(400,"SMP:114",ErrorBusinessCode.MISSING_FIELD,"More than one domain registered on SMP. The domain must be defined!"),
ILLEGAL_STATE_DOMAIN_GROUP_MULTIPLE_ENTRY(500,"SMP:115",ErrorBusinessCode.TECHNICAL,"More than one group for domain entry (group: '%s', domain: '%s') is defined in database!"), ILLEGAL_STATE_DOMAIN_GROUP_MULTIPLE_ENTRY(500,"SMP:115",ErrorBusinessCode.TECHNICAL,"More than one group for domain entry (group: '%s', domain: '%s') is defined in database!"),
INVALID_DOMAIN_DATA (400,"SMP:116",ErrorBusinessCode.INVALID_INPUT_DATA,"Invalid domain data! %s"),
// user error messages // user error messages
INVALID_USER_NO_IDENTIFIERS (400,"SMP:120",ErrorBusinessCode.MISSING_FIELD,"Invalid user - no identifiers!"), INVALID_USER_NO_IDENTIFIERS (400,"SMP:120",ErrorBusinessCode.MISSING_FIELD,"Invalid user - no identifiers!"),
......
...@@ -13,6 +13,8 @@ import eu.europa.ec.edelivery.smp.data.ui.ServiceResult; ...@@ -13,6 +13,8 @@ import eu.europa.ec.edelivery.smp.data.ui.ServiceResult;
import eu.europa.ec.edelivery.smp.data.ui.enums.EntityROStatus; import eu.europa.ec.edelivery.smp.data.ui.enums.EntityROStatus;
import eu.europa.ec.edelivery.smp.exceptions.BadRequestException; import eu.europa.ec.edelivery.smp.exceptions.BadRequestException;
import eu.europa.ec.edelivery.smp.exceptions.ErrorBusinessCode; import eu.europa.ec.edelivery.smp.exceptions.ErrorBusinessCode;
import eu.europa.ec.edelivery.smp.exceptions.ErrorCode;
import eu.europa.ec.edelivery.smp.exceptions.SMPRuntimeException;
import eu.europa.ec.edelivery.smp.logging.SMPLogger; import eu.europa.ec.edelivery.smp.logging.SMPLogger;
import eu.europa.ec.edelivery.smp.logging.SMPLoggerFactory; import eu.europa.ec.edelivery.smp.logging.SMPLoggerFactory;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -96,6 +98,10 @@ public class UIDomainService extends UIServiceBase<DBDomain, DomainRO> { ...@@ -96,6 +98,10 @@ public class UIDomainService extends UIServiceBase<DBDomain, DomainRO> {
@Transactional @Transactional
public void createDomainData(DomainRO data) { public void createDomainData(DomainRO data) {
if (domainDao.getDomainByCode(data.getDomainCode()).isPresent()){
throw new SMPRuntimeException(ErrorCode.INVALID_DOMAIN_DATA, "Domain with code ["+data.getDomainCode()+"] already exists!");
};
DBDomain domain = new DBDomain(); DBDomain domain = new DBDomain();
domain.setDomainCode(data.getDomainCode()); domain.setDomainCode(data.getDomainCode());
domain.setDefaultResourceTypeIdentifier(data.getDefaultResourceTypeIdentifier()); domain.setDefaultResourceTypeIdentifier(data.getDefaultResourceTypeIdentifier());
......
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