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 @@
</button>
</mat-toolbar-row>
</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-loading-shade"
*ngIf="isLoadingResults">
......
......@@ -28,7 +28,7 @@
</button>
</mat-toolbar-row>
</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-loading-shade"
*ngIf="isLoadingResults">
......
......@@ -37,14 +37,12 @@
</div>
<ng-template #searchDomainPanel>
<div *ngIf="!!domainList && domainList.length>0">
<mat-form-field id="domain-filter">
<mat-label>Filter Domain by domain code</mat-label>
<input matInput (keyup)="applyDomainFilter($event)" placeholder="Domain code" #inputDomainFilter>
</mat-form-field>
<table class="mat-elevation-z2" id="admin-domain-table"
mat-table [dataSource]="dataSource">
<table class="mat-elevation-z2" id="edit-domain-table" mat-table [dataSource]="dataSource" matSort>
<ng-container matColumnDef="domainCode">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Domain code</th>
<td mat-cell *matCellDef="let row" [matTooltip]="row.domainCode">{{row.domainCode}}</td>
......@@ -59,14 +57,15 @@
"{{inputDomainFilter.value}}"
</td>
<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>
</tr>
</table>
<mat-paginator class="mat-elevation-z2" id="domain-paginator"
[hidePageSize]="true"
[showFirstLastButtons]="true"
[pageSize]="5" aria-label="Select page"></mat-paginator>
</div>
<mat-paginator class="mat-elevation-z2" id="edit-domain-paginator" #editDomainPaginator
[hidePageSize]="true"
[showFirstLastButtons]="true"
[pageSize]="5"
aria-label="Select page"></mat-paginator>
</ng-template>
......@@ -48,8 +48,7 @@ export class EditDomainComponent implements OnInit, AfterViewInit, BeforeLeaveGu
};
}
ngAfterViewInit() {
ngAfterViewInit():void {
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
// MatTab has only onTabChanged which is a bit to late. Register new listener to internal
......
......@@ -29,7 +29,7 @@
</button>
</mat-toolbar-row>
</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-loading-shade"
*ngIf="isLoadingResults">
......@@ -83,7 +83,7 @@
(page)="onPageChanged($event)"
[hidePageSize]="true"
[showFirstLastButtons]="true"
[pageSize]="10"
[pageSize]="5"
[disabled]="disabledForm"
aria-label="Select pages"></mat-paginator>
</div>
......
......@@ -136,7 +136,7 @@
(page)="onPageChanged($event)"
[hidePageSize]="true"
[showFirstLastButtons]="true"
[pageSize]="10"
[pageSize]="5"
aria-label="Select pages"></mat-paginator>
</div>
</div>
......
......@@ -12,7 +12,7 @@
</button>
</mat-toolbar-row>
</mat-toolbar>
<h3>{{title}}</h3>
<h3 style="word-wrap: break-word; max-width: 750px">{{title}}</h3>
<form [formGroup]="resourceForm">
<mat-form-field style="width:100%">
<mat-label>Resource type</mat-label>
......
......@@ -88,11 +88,12 @@
<input matInput name="technicalContactUrl" id="technicalContactUrl_id" matTooltip="Technical contact for the service"
[formControl]="dialogForm.controls['technicalContactUrl']" maxlength="255" type="url" >
</mat-form-field>
<div class="required-fields">* required fields</div>
</div>
</form>
</mat-dialog-content>
<div class="required-fields">* required fields</div>
<mat-dialog-actions>
<button id="generateSubresourceButton" mat-raised-button color="primary" [mat-dialog-close]="true"
[disabled]="!dialogForm.valid">
......
......@@ -74,7 +74,7 @@
<mat-paginator class="mat-elevation-z2"
[hidePageSize]="true"
[showFirstLastButtons]="true"
[pageSize]="3"
[pageSize]="5"
[disabled]="disabledForm"
aria-label="Select pages"></mat-paginator>
</div>
......
......@@ -162,9 +162,10 @@
</mat-card-content>
</mat-card>
<div class="required-fields">* required fields</div>
</mat-dialog-content>
<div class="required-fields">* required fields</div>
<mat-dialog-actions>
<button mat-raised-button color="primary" (click)="submitForm()"
[disabled]="!dialogForm.valid">
......
......@@ -100,10 +100,8 @@
</mat-card-content>
</mat-card>
</div>
<div class="required-fields">* required fields</div>
</mat-dialog-content>
<div class="required-fields">* required fields</div>
<mat-dialog-actions>
<button mat-raised-button color="primary" (click)="submitForm()"
[disabled]="!dialogForm.valid">
......
......@@ -108,9 +108,10 @@
</mat-card-content>
</mat-card>
</form>
<div class="required-fields">* required fields</div>
</mat-dialog-content>
<div class="required-fields">* required fields</div>
<mat-dialog-actions>
<button mat-raised-button color="primary" [mat-dialog-close]="true"
[disabled]="!dialogForm.valid">
......
......@@ -103,6 +103,7 @@
<mat-paginator class="mat-elevation-z2" id="domain-paginator"
[hidePageSize]="true"
[showFirstLastButtons]="true"
[pageSize]="10" aria-label="Select page"></mat-paginator>
[pageSize]="5"
aria-label="Select page"></mat-paginator>
</ng-template>
......@@ -174,6 +174,10 @@ export class AdminDomainComponent implements OnInit, OnDestroy, AfterViewInit, B
this.alertService.error("ERROR: " + domain.actionMessage);
}
this.dataSource.data = this.domainList;
if (domain.status == EntityStatus.NEW) {
this.paginator.lastPage();
}
}
applyDomainFilter(event: Event) {
......
......@@ -62,7 +62,7 @@
<mat-paginator class="mat-elevation-z2" id="extension-paginator"
[hidePageSize]="true"
[showFirstLastButtons]="true"
[pageSize]="10" aria-label="Select page"></mat-paginator>
[pageSize]="5" aria-label="Select page"></mat-paginator>
</ng-template>
<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">
<mat-card>
<mat-card-title>Import keystore</mat-card-title>
<mat-card-content>
<fieldset style="border: none;">
<label style="width:100%">
......@@ -59,9 +58,10 @@
</mat-card>
</form>
<div class="required-fields">* required fields</div>
</mat-dialog-content>
<div class="required-fields">* required fields</div>
<mat-dialog-actions>
<button mat-raised-button color="primary" (click)="importKeystore()" [disabled]="!dialogForm.valid">
<mat-icon>vpn_key</mat-icon>
......
......@@ -71,7 +71,7 @@
[length]="resultsLength"
(page)="onPageChanged($event)"
[hidePageSize]="true"
[pageSize]="10"
[pageSize]="5"
[showFirstLastButtons]="true"
aria-label="Select page"></mat-paginator>
</ng-template>
......@@ -139,10 +139,10 @@
</mat-card-content>
</mat-card>
</form>
<div class="required-fields">* required fields</div>
</mat-dialog-content>
<div class="required-fields">* required fields</div>
<mat-dialog-actions>
<button mat-raised-button color="primary" (click)="submitForm()" [disabled]="!domainForm.valid">
<mat-icon>check_circle</mat-icon>
......
......@@ -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!"),
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!"),
INVALID_DOMAIN_DATA (400,"SMP:116",ErrorBusinessCode.INVALID_INPUT_DATA,"Invalid domain data! %s"),
// user error messages
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;
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.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.SMPLoggerFactory;
import org.apache.commons.lang3.StringUtils;
......@@ -96,6 +98,10 @@ public class UIDomainService extends UIServiceBase<DBDomain, DomainRO> {
@Transactional
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();
domain.setDomainCode(data.getDomainCode());
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