From 51228df7d5bbd2dc845624ab5523f8936754d609 Mon Sep 17 00:00:00 2001 From: Kristan Ntavidi Date: Mon, 8 Mar 2021 11:24:30 +0200 Subject: [PATCH] Dataset Profile Editor. UI fixes. Stepper buttons animations. Alignments. RadioBox, Other, Select have emptyList Vaditator(custom). Numbering fix in table of contents when drag and drop. --- dmp-frontend/src/app/app.component.ts | 4 +- .../editor/animations/animations.ts | 47 +++++ ...file-editor-composite-field.component.html | 5 +- ...-editor-auto-complete-field.component.html | 23 ++- ...file-editor-radio-box-field.component.html | 11 +- ...file-editor-radio-box-field.component.scss | 1 + ...file-editor-word-list-field.component.html | 11 +- ...ataset-profile-editor-field.component.scss | 5 +- .../dataset-profile-editor-field.component.ts | 26 +-- .../editor-custom-validators.ts | 19 ++ .../dataset-profile-editor.component.html | 188 ++++++++++-------- .../dataset-profile-editor.component.scss | 2 + .../dataset-profile-editor.component.ts | 148 ++++++++------ .../criteria/dataset-profile.component.html | 4 +- .../criteria/dataset-profile.component.scss | 22 +- .../table-of-contents/table-of-contents.ts | 1 + dmp-frontend/src/assets/i18n/de.json | 5 + dmp-frontend/src/assets/i18n/en.json | 5 + dmp-frontend/src/assets/i18n/es.json | 5 + dmp-frontend/src/assets/i18n/gr.json | 5 + dmp-frontend/src/assets/i18n/pt.json | 5 + dmp-frontend/src/assets/i18n/sk.json | 5 + dmp-frontend/src/assets/i18n/sr.json | 5 + dmp-frontend/src/assets/i18n/tr.json | 5 + dmp-frontend/src/styles.scss | 5 + 25 files changed, 371 insertions(+), 191 deletions(-) create mode 100644 dmp-frontend/src/app/ui/admin/dataset-profile/editor/animations/animations.ts create mode 100644 dmp-frontend/src/app/ui/admin/dataset-profile/editor/custom-validators/editor-custom-validators.ts diff --git a/dmp-frontend/src/app/app.component.ts b/dmp-frontend/src/app/app.component.ts index 567acb990..d6c0fb7d7 100644 --- a/dmp-frontend/src/app/app.component.ts +++ b/dmp-frontend/src/app/app.component.ts @@ -174,7 +174,9 @@ export class AppComponent implements OnInit, AfterViewInit { ngOnDestroy() { this.statusChangeSubscription.unsubscribe(); - this.sideNavSubscription.unsubscribe(); + if(this.sideNavSubscription){ + this.sideNavSubscription.unsubscribe(); + } } login() { diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/animations/animations.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/animations/animations.ts new file mode 100644 index 000000000..3c3648e3d --- /dev/null +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/animations/animations.ts @@ -0,0 +1,47 @@ +import { animate, keyframes, state, style, transition, trigger } from "@angular/animations"; + +export const STEPPER_ANIMATIONS = [ + trigger('previous_btn',[ + transition(':enter',[ + style({'transform': 'translateX(100%)', 'z-index':'9999', 'opacity':0.4}), + animate('600ms ease-out', style({ + 'transform': 'translateX(0)', + 'opacity':1 + })) + ]), + transition(':leave',[ + style({ + 'transform': 'translateX(0)', + 'opacity':'1', + 'z-index':'9999' + }), + animate('800ms ease-out', keyframes([ + style({'transform': 'translateX(120%)', offset:0.8}), + style({'opacity': '0.2', offset:0.96}) + ])) + ]) + ]), + trigger('next_btn', [ + transition(':leave',[ + style({opacity:1, position:'absolute', 'z-index':'9999'}), + animate('700ms ease-out', keyframes( [ + style({ transform:'translateX(-100%)', offset:0.6}), + style({ opacity:'0.2', offset:0.87}) + ])) + ]), + transition(':enter',[ + style({opacity:0.3, 'z-index':'9999', transform:'translateX(-100%)'}), + animate('600ms ease-out', style({ opacity:'1', transform:'translateX(0)' })) + ]) + ]), + trigger('finalize_btn',[ + transition(':enter',[ + style({opacity:0.3}), + animate('400ms ease-in', style({opacity:1})) + ]), + transition(':leave',[ + style({opacity:1, position:'absolute'}), + animate('600ms ease-in', style({opacity:0.3})) + ]) + ]) +]; \ No newline at end of file diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.html b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.html index 0bfc28c59..8cdbfaac0 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.html +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.html @@ -69,8 +69,9 @@ - - + + diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/auto-complete/dataset-profile-editor-auto-complete-field.component.html b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/auto-complete/dataset-profile-editor-auto-complete-field.component.html index 4ca660d04..02bd5705b 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/auto-complete/dataset-profile-editor-auto-complete-field.component.html +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/auto-complete/dataset-profile-editor-auto-complete-field.component.html @@ -11,18 +11,29 @@ [formControl]="form.get('data').get('label')"> -
{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-AUTOCOMPLETE-SOURCE-TITLE' | translate}}
+ +
{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-AUTOCOMPLETE-SOURCE-TITLE' | translate}}
+
+ {{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.ERROR-MESSAGES.FIELD-OTHER-SOURCES-REQUIRED'| translate}} +
+ +
diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/radio-box/dataset-profile-editor-radio-box-field.component.html b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/radio-box/dataset-profile-editor-radio-box-field.component.html index 3e8b7d00e..944b3e3a9 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/radio-box/dataset-profile-editor-radio-box-field.component.html +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field-type/radio-box/dataset-profile-editor-radio-box-field.component.html @@ -1,7 +1,12 @@
- -
{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-RADIO-BOX-TITLE' - | translate}}
+
+
{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-RADIO-BOX-TITLE' + | translate}}
+ + warning_amber + {{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.ERROR-MESSAGES.FIELD-RADIO-AT-LEAST-ONE-REQUIRED'| translate}} + +
- -
+ +
-
-
-
-
- - - done - - - {{idx+1}} - - {{step.label}} - -
+
+

{{'DATASET-PROFILE-EDITOR.TITLE.NEW-PROFILE' | translate}}

+

+ {{'DATASET-PROFILE-EDITOR.TITLE.NEW-PROFILE-CLONE' | translate}} + {{form.get('label').value}} +

+

+ {{'DATASET-PROFILE-EDITOR.TITLE.NEW-PROFILE-VERSION' | translate}} + {{form.get('label').value}} +

+ +

{{form.get('label').value}}

+ +
+
-
- - - - - - - - - - - - - - - - - - - - - - - - + +
+
+
+
+
+ + + done + + + {{idx+1}} + + {{step.label}} + +
+
+
+ +
+ + + + + + + - --> + + + + + + + + + + + + + + + + + + + - - + + +
- + + + + +