+
-
{{'GENERAL.VALIDATION.REQUIRED' | translate}}
- -
+
+
-
+ delete
@@ -29,7 +29,7 @@
{{'GENERAL.VALIDATION.PATTERN-_' | translate}}
-->
-
+
-
+
{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.RDA-COMMON-STANDARDS' | translate}}
--
@@ -196,13 +196,33 @@
-
+
+
+
+
+ {{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.RULES-TITLE' | translate}}
+
+
+
+
+
-
-
-
-
-
- {{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.RULES-TITLE' | translate}}
-
-
-
-
-
-
-
-
+
diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.scss b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.scss
index 1c94581a8..5f5900f93 100644
--- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.scss
+++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.scss
@@ -29,10 +29,38 @@ li.list-inline-item{
.mat-slide-toggle.mat-checked .mat-slide-toggle-thumb {
background-color:#129D99 ;
}
+ .mat-slide-toggle.mat-checked .mat-slide-toggle-bar {
+ background-color:rgba(0,178,159,0.34);
+ }
+ .mat-slide-toggle-bar{
+ height: 11.93px;
+ width: 26.42px;
+ }
+ .mat-slide-toggle-thumb-container{
+ top: -3px;
+ }
+ .mat-slide-toggle-thumb{
+ width: 16px;
+ height: 16px;
+ }
}
.input_icon{
width: 14px;
margin-right: 0.5em;
+}
+.visibility-icon{
+ width: 20px;
+ margin-right: 0.5em;
+}
+.add-visibility-button{
+ // display: flex;
+ // align-items: center;
+ width: auto;
+ cursor: pointer;
+ span{
+ font-weight: 400;
+ font-size: 0.8em;
+ }
}
\ No newline at end of file
diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section-fieldset/dataset-profile-editor-section-fieldset.component.html b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section-fieldset/dataset-profile-editor-section-fieldset.component.html
index ee9cacacd..6815d282e 100644
--- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section-fieldset/dataset-profile-editor-section-fieldset.component.html
+++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section-fieldset/dataset-profile-editor-section-fieldset.component.html
@@ -3,17 +3,25 @@
-
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
{{'DATASET-PROFILE-EDITOR.STEPS.TOOLKIT.NEW-INPUT-SET' | translate}}
+
+
+
@@ -38,8 +46,8 @@
-
-
-
-
-
-
- drag_indicator
-
-
-
-
-
+
+
+
+
+
+
+
+ drag_indicator
+
+
+
+
+
+
-
+
+
+
+
+
+
{{'DATASET-PROFILE-EDITOR.STEPS.TOOLKIT.NEW-INPUT-SET' | translate}}
+
+
+
diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section-fieldset/dataset-profile-editor-section-fieldset.component.scss b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section-fieldset/dataset-profile-editor-section-fieldset.component.scss
index bb5162e77..c10761262 100644
--- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section-fieldset/dataset-profile-editor-section-fieldset.component.scss
+++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section-fieldset/dataset-profile-editor-section-fieldset.component.scss
@@ -9,9 +9,28 @@ $blue-color-light: #5cf7f2;
.fieldset-actions-list li{
cursor: pointer;
}
-
-
-
+.fieldset{
+ .add-question{
+ cursor: pointer;
+ visibility: hidden;
+ transition-property: visibility;
+ transition-delay: 20ms;
+ transition-timing-function: ease;
+ transition-duration: 200ms;
+ }
+}
+.fieldset:hover{
+ .add-question{
+ visibility: visible;
+ }
+}
+.question-icon{
+ width: 20px;
+}
+.stick-list{
+ position: sticky;
+ top: 7em;
+}
.actions-list{
// border: 1px solid $blue-color;
// box-shadow: 0px 3px 12px #129D9999;
@@ -20,6 +39,7 @@ $blue-color-light: #5cf7f2;
padding: 1em 0.9em;
padding-bottom: 3em;
min-width: 166px;
+ box-shadow: 0px 2px 1px -1px rgb(0 0 0 / 20%), 0px 1px 1px 0px rgb(0 0 0 / 14%), 0px 1px 3px 0px rgb(0 0 0 / 12%);
.mat-list-item-content{
padding: 0px;
diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section-fieldset/dataset-profile-editor-section-fieldset.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section-fieldset/dataset-profile-editor-section-fieldset.component.ts
index 7387c2677..ccc0a0380 100644
--- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section-fieldset/dataset-profile-editor-section-fieldset.component.ts
+++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section-fieldset/dataset-profile-editor-section-fieldset.component.ts
@@ -1,8 +1,11 @@
import { OnDestroy } from '@angular/core';
import { Component, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
import { FormArray, FormGroup } from '@angular/forms';
+import { Guid } from '@common/types/guid';
import { DragulaService } from 'ng2-dragula';
import { Subscription } from 'rxjs';
+import { FieldEditorModel } from '../../../admin/field-editor-model';
+import { FieldSetEditorModel } from '../../../admin/field-set-editor-model';
import { ToCEntry, ToCEntryType } from '../../../table-of-contents/table-of-contents-entry';
@Component({
@@ -30,6 +33,7 @@ export class DatasetProfileEditorSectionFieldSetComponent implements OnInit, OnC
// @Output() fieldsetAdded = new EventEmitter
(); //returns the id of the fieldset added
idprefix = "id";
+ readonly dragula_prefix = "dragulaid";
private subs = new Subscription();
private FIELDSETS = 'FIELDSETS';
constructor(
@@ -45,7 +49,7 @@ export class DatasetProfileEditorSectionFieldSetComponent implements OnInit, OnC
this.dragulaService.createGroup(this.FIELDSETS,{
moves:(el, container, handle)=>{
// if(this.viewOnly) return false; //uncomment if want to unable drag n drop in viewonly mode
- if(el.id != (this.idprefix+this.tocentry.id)) return false;
+ if(el.id != (this.dragula_prefix+this.tocentry.id)) return false;
if(handle.className && handle.classList.contains('handle')) return true;
return false;
}
@@ -145,7 +149,7 @@ export class DatasetProfileEditorSectionFieldSetComponent implements OnInit, OnC
setTimeout(() => {
const el = this.myElement.nativeElement.querySelector("#"+this.idprefix+id);
if(el){
- el.scrollIntoView({behavior: "smooth", block:'end'});
+ el.scrollIntoView({behavior: "smooth", block:'start'});
}
}, 700);
}
@@ -155,10 +159,9 @@ export class DatasetProfileEditorSectionFieldSetComponent implements OnInit, OnC
setTimeout(() => {
const el = this.myElement.nativeElement.querySelector('#topofcontainer');
if(el){
- el.scrollIntoView({behavior:'smooth'})
+ el.scrollIntoView({behavior:'smooth', block:'end'})
}
},200);
-
}
ngOnInit() {
@@ -175,6 +178,38 @@ export class DatasetProfileEditorSectionFieldSetComponent implements OnInit, OnC
this.addNewFieldSet.emit(this.form);
}
+ addFieldSetAfter(afterOrdinal: number, afterIndex: number):void{
+ const field: FieldEditorModel = new FieldEditorModel();
+ field.id = Guid.create().toString();
+ field.ordinal = 0;//first filed in the fields list
+ const fieldForm = field.buildForm();
+
+ //give fieldset id and ordinal
+ const fieldSet: FieldSetEditorModel = new FieldSetEditorModel();
+ const fieldSetId = Guid.create().toString();
+ fieldSet.id = fieldSetId;
+ fieldSet.ordinal = afterOrdinal < 0? 0 :afterOrdinal;
+
+ const parentArray = this.form.get('fieldSets') as FormArray;
+
+ parentArray.controls.forEach(fieldset=>{
+ const ordinalControl = fieldset.get('ordinal');
+ const ordinalValue = ordinalControl.value;
+ if(ordinalValue > afterOrdinal){
+ ordinalControl.setValue(ordinalValue +1);
+ }
+ });
+ const fieldsetForm = fieldSet.buildForm();
+ (fieldsetForm.get('fields') as FormArray).push(fieldForm);
+
+ const index = afterOrdinal < 0 ? 0: afterIndex +1;
+ parentArray.insert(index, fieldsetForm);
+ this.dataNeedsRefresh.emit();
+ setTimeout(() => {
+ this.selectedFieldSetId = fieldSetId;
+ }, 200);
+ }
+
private _findTocEntryById(id: string, tocentries: ToCEntry[]): ToCEntry{
if(!tocentries){
return null;
diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents-internal-section/table-of-contents-internal-section.html b/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents-internal-section/table-of-contents-internal-section.html
index 72a3d7179..f31a10a89 100644
--- a/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents-internal-section/table-of-contents-internal-section.html
+++ b/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents-internal-section/table-of-contents-internal-section.html
@@ -135,7 +135,7 @@
-
+
@@ -178,6 +179,12 @@
+
+
+
-
-
+
diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents-internal-section/table-of-contents-internal-section.scss b/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents-internal-section/table-of-contents-internal-section.scss
index 03cd37891..66b54ece1 100644
--- a/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents-internal-section/table-of-contents-internal-section.scss
+++ b/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents-internal-section/table-of-contents-internal-section.scss
@@ -111,3 +111,6 @@ $yellow: #f7dd72;
font-weight: bold;
// color: red;
}
+.add-input-icon{
+ width: 20px;
+}
\ No newline at end of file
diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.html b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.html
index 7c979743a..177145027 100644
--- a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.html
+++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.html
@@ -79,7 +79,7 @@