Skip to content

Commit 3d6ca12

Browse files
committed
#449972 - Finished redesign
1 parent c56def0 commit 3d6ca12

30 files changed

+355
-135
lines changed

package-lock.json

Lines changed: 14 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/pages/assets/asset-create/asset-create.component.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
<mat-card class="creation-card">
1+
<div class="creation-card">
22
<mat-card-header>
33
<mat-card-title>Create an asset</mat-card-title>
44
</mat-card-header>
55

6-
<mat-tab-group>
6+
<mat-tab-group animationDuration="0ms" mat-stretch-tabs="false" mat-align-tabs="start" class="main-tab-group">
77
<mat-tab label="Asset information">
88
<div class="asset-creation-tab">
99
<div>
1010
<mat-form-field class="form-field" color="accent">
11-
<mat-label>Id</mat-label>
11+
<mat-label>ID</mat-label>
1212
<input required [(ngModel)]="id" matInput>
1313
</mat-form-field>
1414
<mat-form-field class="form-field" color="accent">
@@ -35,7 +35,7 @@
3535
</mat-form-field>
3636
</div>
3737
<div>
38-
<ckeditor [(ngModel)]="description" [config]="config" [editor]="editor"></ckeditor>
38+
<ckeditor [(ngModel)]="description" #descriptionModel="ngModel" [config]="config" [editor]="editor" [ngClass]="{'ckeditor-error': descriptionModel.invalid && descriptionModel.touched}" required></ckeditor>
3939
</div>
4040
<div>
4141
<mat-form-field class="form-field" color="accent">
@@ -65,9 +65,9 @@
6565
</mat-tab>
6666

6767
<mat-tab label="Detailed information" *ngIf="vocabularies?.length > 0">
68-
<mat-tab-group>
68+
<mat-tab-group animationDuration="0ms" mat-stretch-tabs="false" mat-align-tabs="start">
6969
<mat-tab label="Default information" *ngIf="defaultVocabularies?.length>0 && defaultForms?.length>0">
70-
<div class="asset-creation-tab">
70+
<div class="asset-creation-vocabularies">
7171
<div *ngFor="let defaultForm of defaultForms">
7272
<mat-expansion-panel class="custom-expansion">
7373
<mat-expansion-panel-header>
@@ -82,7 +82,7 @@
8282
</div>
8383
</mat-tab>
8484
<mat-tab [label]="getAssetTypeText()+' information'" *ngIf="selectedVocabularies?.length>0">
85-
<div>
85+
<div class="asset-creation-tab">
8686
<mat-form-field class="form-field-full" color="accent">
8787
<mat-label>Vocabularies</mat-label>
8888
<mat-select [(ngModel)]="selectedAssetTypeVocabularies" multiple
@@ -93,7 +93,7 @@
9393
</mat-select>
9494
</mat-form-field>
9595
</div>
96-
<div class="asset-creation-tab">
96+
<div class="asset-creation-vocabularies">
9797
<div *ngFor="let selectedForm of selectedForms">
9898
<mat-expansion-panel class="custom-expansion">
9999
<mat-expansion-panel-header>
@@ -118,7 +118,7 @@
118118
<div>
119119
<mat-form-field class="form-field" color="accent">
120120
<mat-label>Destination</mat-label>
121-
<mat-select [(ngModel)]="storageTypeId">
121+
<mat-select [(ngModel)]="storageTypeId" required>
122122
<mat-option *ngFor="let storageType of storageTypes " [value]="storageType.id">
123123
{{storageType.name}}
124124
</mat-option>
@@ -237,13 +237,13 @@
237237
</mat-tab>
238238
</mat-tab-group>
239239

240-
<div fxLayout="row" fxLayoutGap="15px" fxLayoutAlign="end">
241-
<button (click)="navigateToAsset()" color="accent" mat-stroked-button>
240+
<div fxLayout="row" fxLayoutGap="15px" fxLayoutAlign="end" class="form-actions">
241+
<button (click)="navigateToAsset()" color="warn" mat-stroked-button>
242242
<mat-icon>cancel</mat-icon> Cancel
243243
</button>
244244

245245
<button (click)="onSave()" color="accent" mat-stroked-button>
246246
<mat-icon>add_circle_outline</mat-icon> Create
247247
</button>
248248
</div>
249-
</mat-card>
249+
</div>

src/app/pages/assets/asset-create/asset-create.component.scss

Lines changed: 68 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
box-sizing: border-box;
2121
width: 100%;
2222
margin-bottom: 1.5em;
23+
border-bottom-left-radius: 4px;
24+
border-bottom-right-radius: 4px;
2325
}
2426

2527
.short-description {
@@ -39,10 +41,6 @@
3941
background-color: white;
4042
}
4143

42-
.mat-mdc-tab-group .mat-mdc-tab-group {
43-
background-color: var(--grey-400);
44-
}
45-
4644
:host ::ng-deep .mat-mdc-tab-group .mat-mdc-tab-group mat-form-field .mat-mdc-text-field-wrapper{
4745
background-color: white;
4846
}
@@ -52,6 +50,10 @@ mat-panel-title,
5250
color: var(--secondary-600);
5351
}
5452

53+
mat-panel-title mat-icon {
54+
margin-right: 10px;
55+
}
56+
5557
:host ::ng-deep .mat-column-action {
5658
text-align: center;
5759
}
@@ -62,5 +64,67 @@ mat-panel-title,
6264

6365
:host ::ng-deep .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content {
6466
border-color: var(--secondary-500);
67+
border-top-left-radius: 4px;
68+
border-top-right-radius: 4px;
69+
}
70+
71+
.toggle {
72+
margin-bottom: 22px;
73+
--mat-mdc-form-field-floating-label-scale: 0.75;
74+
display: inline-flex;
75+
flex-direction: column;
76+
min-width: 0;
77+
text-align: left;
78+
}
79+
80+
mat-slide-toggle {
81+
margin-left: 15px;
82+
}
83+
84+
:host ::ng-deep mat-slide-toggle .mdc-form-field>label {
85+
padding-left: 10px;
86+
color: var(--secondary-600);
87+
}
88+
89+
:host ::ng-deep .ckeditor-error .ck-editor__editable_inline,
90+
:host ::ng-deep .ckeditor-error .ck-placeholder:before {
91+
border-color: var(--secondary-red-500) !important;
92+
color: var(--secondary-red-500) !important;
93+
}
94+
95+
:host ::ng-deep .ck-placeholder {
96+
font-style: italic;
97+
}
98+
99+
:host ::ng-deep .mat-mdc-table .mdc-data-table__row {
100+
height: 100px;
101+
}
102+
:host ::ng-deep .mat-mdc-table {
103+
table-layout: fixed;
104+
}
105+
106+
.asset-creation-tab {
107+
padding: 0 20px;
108+
}
109+
110+
mat-expansion-panel {
111+
box-shadow: 0px 0px 10px 0px #0000001F;
112+
}
113+
114+
.form-actions {
115+
margin-top: 30px;
116+
}
117+
118+
mat-tab-group:not(.main-tab-group) .mat-mdc-tab-header {
119+
border-bottom: 1px solid var(--grey-400);
120+
padding-left: 15px;
121+
}
122+
123+
.asset-creation-vocabularies {
124+
margin: 0 20px;
125+
min-height: 150px;
65126
}
66127

128+
.asset-creation-vocabularies mat-expansion-panel{
129+
margin: 20px 0;
130+
}

src/app/pages/assets/asset-create/asset-create.component.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, Inject, OnInit } from '@angular/core';
1+
import { Component, Inject, OnInit, QueryList, ViewChildren } from '@angular/core';
22
import { HttpDataAddress, DataAddress } from '@think-it-labs/edc-connector-client';
33
import { JsonDoc } from "../../../shared/models/json-doc";
44
import { StorageType } from "../../../shared/models/storage-type";
@@ -19,6 +19,7 @@ import { AssetService } from 'src/app/shared/services/asset.service';
1919
import { BehaviorSubject } from 'rxjs';
2020
import { Router } from '@angular/router';
2121
import { MatSlideToggleChange } from '@angular/material/slide-toggle';
22+
import { NgModel } from '@angular/forms';
2223

2324

2425
@Component({
@@ -91,8 +92,9 @@ export class AssetCreateComponent implements OnInit {
9192

9293
assetType: any;
9394
assetTypes = Object.entries(ASSET_TYPES);
94-
defaultForms: JsonFormData[]
95-
selectedForms: JsonFormData[]
95+
defaultForms: JsonFormData[];
96+
selectedForms: JsonFormData[];
97+
@ViewChildren(NgModel) formControls: QueryList<NgModel>;
9698

9799
inesDataStoreFiles: File[]
98100

@@ -156,6 +158,9 @@ export class AssetCreateComponent implements OnInit {
156158

157159
async onSave() {
158160
this.loadingService.showLoading();
161+
this.formControls.toArray().forEach(control => {
162+
control.control.markAsTouched();
163+
});
159164
// Check whether the asset is valid
160165
if (!this.checkVocabularyData() || !this.checkRequiredFields()) {
161166
this.notificationService.showError("Review the form fields");

src/app/pages/catalog/contract-offers-viewer/contract-offers-viewer.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
<mat-icon>arrow_back</mat-icon> Go back
44
</button>
55

6-
<mat-tab-group>
6+
<mat-tab-group animationDuration="0ms" mat-stretch-tabs="false" mat-align-tabs="start" class="main-tab-group">
77
<mat-tab label="Asset information">
8-
<mat-tab-group>
8+
<mat-tab-group animationDuration="0ms" mat-stretch-tabs="false" mat-align-tabs="start">
99
<mat-tab label="General information">
1010
<mat-card class="dialog-card">
1111
<div fxLayout="row" fxLayoutGap="15px">
1212
<mat-list-item class="property" fxFlex="50">
13-
<div class="property-title" matListItemTitle>Id</div>
13+
<div class="property-title" matListItemTitle>ID</div>
1414
<div class="property-value" matListItemLine><p>{{data.properties.id}}</p></div>
1515
</mat-list-item>
1616
<mat-list-item class="property" fxFlex="50">

src/app/pages/catalog/contract-offers-viewer/contract-offers-viewer.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ mat-expansion-panel-header {
116116
}
117117

118118
.contract-offer {
119-
margin-bottom: 20px;
119+
margin: 20px;
120120
background-color: white;
121121
}
122122

src/app/pages/contract-definitions/contract-definition-new/contract-definition-new.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</mat-card-header>
99

1010
<mat-form-field class="form-field" color="accent" id="form-field-id">
11-
<mat-label>Id</mat-label>
11+
<mat-label>ID</mat-label>
1212
<input [(ngModel)]="contractDefinition['@id']" [disabled]="editMode" matInput required>
1313
</mat-form-field>
1414

@@ -42,7 +42,7 @@
4242
</div>
4343

4444
<div fxLayout="row" fxLayoutGap="15px" fxLayoutAlign="end">
45-
<button (click)="navigateToContractDefinitions()" color="accent" mat-stroked-button>
45+
<button (click)="navigateToContractDefinitions()" color="warn" mat-stroked-button>
4646
<mat-icon>cancel</mat-icon> Cancel
4747
</button>
4848

src/app/pages/contract-definitions/contract-definition-new/contract-definition-new.component.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import { Component, OnInit } from '@angular/core';
1+
import { Component, OnInit, QueryList, ViewChildren } from '@angular/core';
22
import { AssetService } from "../../../shared/services/asset.service";
33
import { PolicyService } from "../../../shared/services/policy.service";
44
import { Asset, PolicyDefinition, ContractDefinitionInput } from "../../../shared/models/edc-connector-entities";
55
import { NotificationService } from 'src/app/shared/services/notification.service';
66
import { ContractDefinitionService } from 'src/app/shared/services/contractDefinition.service';
77
import { BehaviorSubject } from 'rxjs';
88
import { Router } from '@angular/router';
9+
import { NgModel } from '@angular/forms';
910

1011

1112
@Component({
@@ -29,6 +30,7 @@ export class ContractDefinitionNewComponent implements OnInit {
2930
contractPolicyId: undefined!
3031
};
3132
private fetch$ = new BehaviorSubject(null);
33+
@ViewChildren(NgModel) formControls: QueryList<NgModel>;
3234

3335
constructor(private policyService: PolicyService,
3436
private assetService: AssetService,
@@ -54,6 +56,10 @@ export class ContractDefinitionNewComponent implements OnInit {
5456
}
5557

5658
onSave() {
59+
this.formControls.toArray().forEach(control => {
60+
control.control.markAsTouched();
61+
});
62+
5763
if (!this.checkRequiredFields()) {
5864
this.notificationService.showError("Review required fields");
5965
return;

src/app/pages/contracts/contract-transfer-dialog/contract-transfer-dialog.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<mat-form-field class="form-field" color="accent" id="form-field-destination">
1717
<mat-label>Destination</mat-label>
18-
<mat-select [(ngModel)]="storageTypeId">
18+
<mat-select [(ngModel)]="storageTypeId" required>
1919
<mat-option *ngFor="let trasnferType of transferTypes" [value]="trasnferType.id">
2020
{{trasnferType.name}}
2121
</mat-option>

src/app/pages/contracts/contract-transfer-dialog/contract-transfer-dialog.component.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Component, Inject } from '@angular/core';
1+
import { Component, Inject, QueryList, ViewChildren } from '@angular/core';
2+
import { NgModel } from '@angular/forms';
23
import { MatDialogRef } from '@angular/material/dialog';
34
import { DataAddress, HttpDataAddress } from '@think-it-labs/edc-connector-client';
45
import { AmazonS3DataAddress } from 'src/app/shared/models/amazon-s3-data-address';
@@ -32,6 +33,8 @@ export class ContractTransferDialog {
3233
type: 'HttpData'
3334
};
3435

36+
@ViewChildren(NgModel) formControls: QueryList<NgModel>;
37+
3538
constructor(@Inject('TRANSFER_TYPES') public transferTypes: StorageType[],
3639
private dialogRef: MatDialogRef<ContractTransferDialog>,
3740
private notificationService: NotificationService) {
@@ -40,6 +43,10 @@ export class ContractTransferDialog {
4043
}
4144

4245
onTransfer() {
46+
this.formControls.toArray().forEach(control => {
47+
control.control.markAsTouched();
48+
});
49+
4350
let dataAddress: DataAddress;
4451

4552
if (this.storageTypeId === DATA_ADDRESS_TYPES.amazonS3) {

0 commit comments

Comments
 (0)