diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/dataset-profile.module.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/dataset-profile.module.ts index 7494dc6b2..f5685d3f9 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/dataset-profile.module.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/dataset-profile.module.ts @@ -45,6 +45,7 @@ import { NgxDropzoneModule } from 'ngx-dropzone'; import { ParseStatus } from './listing/pipe/parse-status.pipe'; import { DatasetProfileTableOfContents } from './table-of-contents/table-of-contents'; import { DatasetProfileTableOfContentsInternalSection } from './table-of-contents/table-of-contents-internal-section/table-of-contents-internal-section'; +import { VisibilityRulesService } from '@app/ui/misc/dataset-description-form/visibility-rules/visibility-rules.service'; @NgModule({ imports: [ @@ -98,7 +99,8 @@ import { DatasetProfileTableOfContentsInternalSection } from './table-of-content ], entryComponents: [ DialogConfirmationUploadDatasetProfiles - ] + ], + providers:[VisibilityRulesService] }) export class DatasetProfileModule { } 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 6de806122..0f46f7d20 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 @@ -1,11 +1,17 @@ -
+ + + + + + + + + + +
+ {{this.form.get('id').value}} +
-
- - - -
-
- - - -
-
- - - -
-
- -
-
-

{{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.SUB-FIELDS-TITLE' | translate}} -

-
- - - {{i + 1}}. {{getFieldTile(field, i)}} -
- + + + + + +
+
+ +
+
+
+ {{numbering}}
- -
-
- + + + +
+ +
+ + + +
+
+ + + +
+
+ + + +
+ +
+ + + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + + + + + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + + +
+ + +
-
- + + + +
+ + +
+ +
+ +
+
+ {{form.get('fields').get(''+i).get('id').value}} + +
+ + + + + +
+
+ + +
+
+ +
+
+ + +

Input tools

+ + + folder + Add Input + + + + visibility_off + + + + + +

Input settings

+ + + + + + {{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.MULTIPLICITY-CHECKBOX' | translate}} + + + + + + + {{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.COMMENT-CHECKBOX' | translate}} + + + + + + Make it required + + + + + +

Other actions

+ + + + + delete + Delete + +
+
+
+
+
+ + +Current FORM: {{this.form.value |json}} +
+Target: {{this.targetField?.value |json}} + + diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.scss b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.scss index 046126ff9..694ac521d 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.scss +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.scss @@ -8,4 +8,55 @@ .titleStile{ font-weight: bold; +} + +//REFACTOR SECTION + + +//Palete + +$blue-color : #129D99; +$blue-color-light: #5cf7f2; + +.actions-list{ + border-radius: 7px; + box-shadow: 0 1px 0.8em $blue-color; + padding: 1em 0em; + font-size: small; +} + +.field-container{ + box-shadow: 0px 1px 2px rgb(173, 173, 173) ; + padding: 3em; + border-radius: .3em; + border-left: 0.3em solid yellow; + padding-bottom: 2em; + margin-bottom: 2em; + +} +.field-container-active{ + box-shadow: 0px 1px 2px rgb(173, 173, 173) ; + padding: 3em; + border-radius: .3em; + border-left: 0.3em solid $blue-color; + padding-bottom: 2em; + margin-bottom: 2em; + +} +.field-id-container{ + background-color: $blue-color-light; + position: absolute; + right: 0; + top: 0; + padding: .6em 1.2em; + overflow: visible; + .field-id-container-icon{ + position: absolute; + top: -50%; + + } +} + +.main-content-page{ + padding: 1.5em; } \ 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.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts index e4fd16dfa..70c9fe6b9 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts @@ -1,24 +1,37 @@ -import { Component, Input, OnInit } from '@angular/core'; +import { Component, Input, OnChanges, OnInit } from '@angular/core'; import { FormArray, FormControl, FormGroup } from '@angular/forms'; import { FieldEditorModel } from '../../../admin/field-editor-model'; import { Guid } from '@common/types/guid'; +import { RuleEditorModel } from '../../../admin/rule-editor-model'; +import { ValidationType } from '@app/core/common/enum/validation-type'; +import { MatCheckboxChange } from '@angular/material/checkbox'; +import { DatasetDescriptionCompositeFieldEditorModel, DatasetDescriptionFieldEditorModel } from '@app/ui/misc/dataset-description-form/dataset-description-form.model'; +import { DatasetProfileFieldViewStyle } from '@app/core/common/enum/dataset-profile-field-view-style'; @Component({ selector: 'app-dataset-profile-editor-composite-field-component', templateUrl: './dataset-profile-editor-composite-field.component.html', styleUrls: ['./dataset-profile-editor-composite-field.component.scss'] }) -export class DatasetProfileEditorCompositeFieldComponent implements OnInit { +export class DatasetProfileEditorCompositeFieldComponent implements OnInit, OnChanges { @Input() form: FormGroup; @Input() indexPath: string; @Input() viewOnly: boolean; - isComposite = false; + @Input() numbering: string; + + + previewForm: FormGroup; + // isComposite = false; isMultiplicityEnabled = false; + viewStyleEnum = DatasetProfileFieldViewStyle; constructor() { } + ngOnChanges(){ + this.setTargetField(null); + } ngOnInit() { //this.addNewField(); if (this.form.get('multiplicity')) { @@ -26,11 +39,55 @@ export class DatasetProfileEditorCompositeFieldComponent implements OnInit { this.isMultiplicityEnabled = true; } } - this.isComposite = (this.form.get('fields') as FormArray).length > 1; + // this.isComposite = (this.form.get('fields') as FormArray).length > 1; if (this.viewOnly) { this.form.get('hasCommentField').disable(); } + + //SET UP TARGET FIELD + if((this.form.get('fields') as FormArray).length>0){ + //get the first field in list + this.targetField = (this.form.get('fields') as FormArray).at(0) as FormGroup; + } + + } + + + generatePreview(){ + const editorModel = new DatasetDescriptionCompositeFieldEditorModel(); + editorModel.title = this.form.get('title').value; + editorModel.description = this.form.get('description').value; + editorModel.extendedDescription = this.form.get('extendedDescription').value; + editorModel.additionalInformation = this.form.get('additionalInformation').value; + editorModel.hasCommentField = this.form.get('hasCommentField').value; + editorModel.fields = []; + + (this.form.get('fields') as FormArray).controls.forEach(field=>{ + const fieldEditorModel = new DatasetDescriptionFieldEditorModel(); + + fieldEditorModel.viewStyle= { + renderStyle: field.get('viewStyle').get('renderStyle').value, + cssClass: null + }; + fieldEditorModel.defaultValue = field.get('defaultValue').value; + switch (field.get('viewStyle').get('renderStyle').value) { + case DatasetProfileFieldViewStyle.TextArea: + fieldEditorModel.data = { + label: field.get('data').get('label').value + }; + break; + + default: + break; + } + + + editorModel.fields.push(fieldEditorModel); + }); + + + this.previewForm = editorModel.buildForm(); } onIsCompositeChange(isComposite: boolean) { @@ -67,4 +124,70 @@ export class DatasetProfileEditorCompositeFieldComponent implements OnInit { if (formGroup.get('title') && formGroup.get('title').value && formGroup.get('title').value.length > 0) { return formGroup.get('title').value; } return "Field " + (index + 1); } + + + targetField:FormGroup; + validationTypeEnum = ValidationType; + + + addVisibilityRule(targetField: FormGroup){ + const rule: RuleEditorModel = new RuleEditorModel(); + (targetField.get('visible').get('rules')).push(rule.buildForm()); + } + toggleRequired(targetField: FormGroup, event:MatCheckboxChange){ + + let validationsControl = targetField.get('validations') as FormControl; + let validations: Array = validationsControl.value; + + if(event.checked){ + if(!validations.includes(ValidationType.Required)){//IS ALREADY REQUIRED + // validationsControl.setValue(validations.filter(validator=> validator != ValidationType.Required)); + // validationsControl.updateValueAndValidity(); + validations.push(ValidationType.Required); + // validationsControl.setValue(validations); + validationsControl.updateValueAndValidity(); + } + }else{ + validationsControl.setValue(validations.filter(validator=> validator != ValidationType.Required)); + validationsControl.updateValueAndValidity(); + } + + + // if(validations.includes(ValidationType.Required)){//IS ALREADY REQUIRED + // validationsControl.setValue(validations.filter(validator=> validator != ValidationType.Required)); + // validationsControl.updateValueAndValidity(); + // }else{ + // //SET REQUIRED VALIDATOR + // console.log('setting required validator'); + // validations.push(ValidationType.Required); + // validationsControl.setValue(validations); + // validationsControl.updateValueAndValidity(); + // } + } + setTargetField(field:FormGroup){ + this.targetField = field; + } + + + deleteTargetField(){ + if(!this.targetField) return; + + let index = -1; + + const fields = this.form.get('fields') as FormArray; + + for(let i=0;i< fields.length; i++){ + let field = fields.at(i); + if(field.get('id').value === this.targetField.get('id').value){//index found + index = i; + break; + } + } + + if(index>=0){//target found in fields + this.DeleteField(index); + this.targetField = null; + } + + } } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-profile-editor-default-value/component-profile-editor-default-value.component.html b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-profile-editor-default-value/component-profile-editor-default-value.component.html index b9c42bc35..ca386a1f2 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-profile-editor-default-value/component-profile-editor-default-value.component.html +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-profile-editor-default-value/component-profile-editor-default-value.component.html @@ -1,6 +1,7 @@
+ {{placeHolder}} {{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.DEFAULT-VALUES.NONE' | translate}} @@ -16,6 +17,7 @@ + {{placeHolder}} {{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.DEFAULT-VALUES.CHECK-BOX.CHECKED' | translate}} {{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.DEFAULT-VALUES.CHECK-BOX.UNCHECKED' | translate}} @@ -25,9 +27,11 @@ + {{placeHolder}} + {{placeHolder}} {{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.DEFAULT-VALUES.NONE' | translate }} {{opt.get('label').value}} @@ -37,23 +41,28 @@ + {{placeHolder}} + {{placeHolder}} + {{placeHolder}} + {{placeHolder}} {{'GENERAL.VALIDATION.REQUIRED' | translate}} + {{placeHolder}} {{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.DEFAULT-VALUES.NONE' | translate}} {{opt.get('label').value}} @@ -63,6 +72,7 @@ + {{placeHolder}} {{'GENERAL.VALIDATION.REQUIRED' | translate}} @@ -70,6 +80,7 @@ + {{placeHolder}} diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.html b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.html index 5dda9d7bc..3b08069f0 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.html +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.html @@ -1,10 +1,13 @@ + + +
- + - + {{'DATASET-PROFILE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.RDA-COMMON-STANDARDS' | translate}} @@ -62,7 +65,7 @@
-
+
@@ -85,13 +88,50 @@
-
-

{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.RULES-TITLE' | translate}} -

- -
- -
+
+ + + + +

{{'DATASET-PROFILE-EDITOR.STEPS.FORM.FIELD.FIELDS.RULES-TITLE' | translate}} +

+ + +
+ + +
+ + + + +
+
+ Preview +
+ +
+ + + +
+
+ + Not initialized yet + +
+
+
\ No newline at end of file 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 3db0dee74..9a774bbed 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 @@ -1,3 +1,14 @@ .full-width { width: 100%; } + + +.preview-box{ + padding: 1em; + border: 1px solid #e8dcdc; + border-radius: 0.3em; +} + +mat-radio-button{ + padding-right: 1em; +} \ No newline at end of file diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts index d96993846..53031ca86 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component.ts @@ -1,5 +1,5 @@  -import { Component, Input, OnInit } from '@angular/core'; +import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'; import { FormArray, FormControl, FormGroup } from '@angular/forms'; import { DatasetProfileFieldViewStyle } from '@app/core/common/enum/dataset-profile-field-view-style'; import { ValidationType } from '@app/core/common/enum/validation-type'; @@ -27,13 +27,15 @@ import { DatasetIdentifierDataEditorModel } from '../../../admin/field-data/data import { ExternalDatasetsDataEditorModel } from '../../../admin/field-data/external-datasets-data-editor-models'; import { CurrencyDataEditorModel } from '../../../admin/field-data/currency-data-editor-models'; import { ValidationDataEditorModel } from '../../../admin/field-data/validation-data-editor-models'; +import { DatasetDescriptionFieldEditorModel } from '@app/ui/misc/dataset-description-form/dataset-description-form.model'; +import { Subscription } from 'rxjs'; @Component({ selector: 'app-dataset-profile-editor-field-component', templateUrl: './dataset-profile-editor-field.component.html', styleUrls: ['./dataset-profile-editor-field.component.scss'] }) -export class DatasetProfileEditorFieldComponent extends BaseComponent implements OnInit { +export class DatasetProfileEditorFieldComponent extends BaseComponent implements OnInit,OnChanges { @Input() viewOnly: boolean; @Input() form: FormGroup; @Input() showOrdinal = true; @@ -42,13 +44,18 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements viewStyleEnum = DatasetProfileFieldViewStyle; isFieldMultiplicityEnabled = false; + @Input() expandView: boolean = true; constructor( public enumUtils: EnumUtils, public datasetProfileService: DatasetProfileService ) { super(); } + ngOnChanges(changes: SimpleChanges): void { + this.generatePreviewForm(); + } ngOnInit() { + this.showPreview = true; if (this.form.get('multiplicity')) { if (this.form.get('multiplicity').value.min > 1 && this.form.get('multiplicity').value.max > 1) { this.isFieldMultiplicityEnabled = true; @@ -59,6 +66,12 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements this.form.get('viewStyle').get('renderStyle').valueChanges .pipe(takeUntil(this._destroyed)) .subscribe(x => { + + + // const previewStatus = this.showPreview; + //!! Important to be before the if statement + this.showPreview = false; + if (this.form.get('data')) { this.form.removeControl('data'); @@ -119,6 +132,11 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements break; } } + + + //reset the preview status + // this.showPreview = previewStatus; + this.showPreview = true; }); } @@ -162,4 +180,84 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements const rule: RuleEditorModel = new RuleEditorModel(); (this.form.get('visible').get('rules')).push(rule.buildForm()); } + + + private _formChangesSubscription:Subscription; + private _showPreview: boolean = false;; + + get showPreview(): boolean{ + + return this._showPreview; + } + + set showPreview(value:boolean){ + if(value == false){//hide preview + //close subsciption + if(this._formChangesSubscription){ + this._formChangesSubscription.unsubscribe(); + this._formChangesSubscription = null; + } + } + + if(value == true){ + this._formChangesSubscription = this.form.valueChanges.subscribe(()=>{ + this.generatePreviewForm(); + }); + //initialize + if(this.form.get('viewStyle').get('renderStyle').value){ + this.generatePreviewForm(); + } + } + + this._showPreview = value; + } + + previewForm: FormGroup; + + generatePreviewForm(){ + this.previewForm = null; + // this._showPreview = false; + const fieldEditorModel = new DatasetDescriptionFieldEditorModel(); + + fieldEditorModel.viewStyle= { + renderStyle: this.form.get('viewStyle').get('renderStyle').value, + cssClass: null + }; + + fieldEditorModel.data = this.form.get('data').value; + fieldEditorModel.value = this.form.get('defaultValue').get('value').value; + fieldEditorModel.validationRequired = (this.form.get('validations').value as Array).includes(ValidationType.Required); + + if(this.form.get('viewStyle').get('renderStyle').value == DatasetProfileFieldViewStyle.CheckBox){ + fieldEditorModel.value = this.form.get('defaultValue').get('value').value === 'true'; + } + + this.previewForm = fieldEditorModel.buildForm(); + + // this._showPreview = true; + }; + + // generatePreview(){ + // const fieldEditorModel = new DatasetDescriptionFieldEditorModel(); + + // fieldEditorModel.viewStyle= { + // renderStyle: this.form.get('viewStyle').get('renderStyle').value, + // cssClass: null + // }; + // fieldEditorModel.defaultValue = this.form.get('defaultValue').value; + // switch (this.form.get('viewStyle').get('renderStyle').value) { + // case DatasetProfileFieldViewStyle.TextArea: + // fieldEditorModel.data = { + // label: this.form.get('data').get('label').value + // }; + // break; + + // default: + // break; + // } + + // // this.previewForm = fieldEditorModel.buildForm(); + + + // } } diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/rule/dataset-profile-editor-rule.component.html b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/rule/dataset-profile-editor-rule.component.html index b92190104..5386fce2b 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/rule/dataset-profile-editor-rule.component.html +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/rule/dataset-profile-editor-rule.component.html @@ -10,15 +10,79 @@ {{'DATASET-PROFILE-EDITOR.STEPS.FORM.RULE.FIELDS.RULE-THEN'| translate}} - + + + + + Pick one + + + + + + + {{option.label? option.label:'<'+ ('DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.UNTITLED' | translate) + '>'}} +
+ + {{option.id}} + + +
+
+ + + + + {{option.label? option.label:'<'+ ('DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.UNTITLED' | translate) + '>'}} +
+ + {{option.id}} + +
+
+ + + + + {{option.label? option.label:'<'+ ('DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.UNTITLED' | translate) + '>'}} +
+ + {{option.id}} + +
+
+
+ {{'GENERAL.VALIDATION.REQUIRED' | translate}} +
+
+ + + + + \ No newline at end of file diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/rule/dataset-profile-editor-rule.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/rule/dataset-profile-editor-rule.component.ts index 37e753353..e0004a828 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/rule/dataset-profile-editor-rule.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/rule/dataset-profile-editor-rule.component.ts @@ -1,7 +1,8 @@ -import { Component, Input } from '@angular/core'; -import { FormArray, FormControl } from '@angular/forms'; +import { Component, Input, OnInit } from '@angular/core'; +import { FormArray, FormControl, FormGroup } from '@angular/forms'; import { DatasetProfileFieldViewStyle } from '../../../../../../core/common/enum/dataset-profile-field-view-style'; import { DatasetProfileComboBoxType } from '../../../../../../core/common/enum/dataset-profile-combo-box-type'; +import { ToCEntryType } from '../../../table-of-contents/table-of-contents-entry'; @Component({ selector: 'app-dataset-profile-editor-rule-component', @@ -9,21 +10,132 @@ import { DatasetProfileComboBoxType } from '../../../../../../core/common/enum/d styleUrls: ['./dataset-profile-editor-rule.component.scss'] }) -export class DatasetProfileEditorRuleComponent { - +export class DatasetProfileEditorRuleComponent implements OnInit{ + @Input() form: FormArray; - + @Input() viewStyleForCheck: DatasetProfileFieldViewStyle; @Input() formControlForCheck: FormControl; @Input() formArrayOptionsForCheck: FormArray; @Input() comboBoxTypeForCheck: DatasetProfileComboBoxType; @Input() viewOnly: boolean; - + targetValidation() { //TODO } - + deleteRule(index) { this.form.removeAt(index); } + + ngOnInit(): void { + this.options = this.getOptions(); + + + this.sectionOptions = []; + this.fieldOptions = []; + this.fieldSetOptions = []; + this.options.forEach(option=>{ + switch (option.type) { + case ToCEntryType.Field: + this.fieldOptions.push(option); + break; + case ToCEntryType.FieldSet: + this.fieldSetOptions.push(option); + break; + case ToCEntryType.Section: + this.sectionOptions.push(option); + break; + default: + break; + } + }); + + } + options: OptionItem[]; + sectionOptions: OptionItem[]; + fieldSetOptions: OptionItem[]; + fieldOptions: OptionItem[]; + + + getOptions():OptionItem[]{ + const rootForm = this.form.root; + if(rootForm){ + // const parentSections = rootForm.get('sections') as FormArray; + + const result:OptionItem[] =[]; + + const sections = rootForm.get('sections') as FormArray; + + if(sections){ + sections.controls.forEach(section=>{ + const subResult = this.buildOptions(section as FormGroup, ToCEntryType.Section,[]); + result.push(...subResult); + }); + } + + //return options + return result; + + } + //nothing found + return []; + } + + private buildOptions(form: FormGroup, type: ToCEntryType, parentIds:string[]):OptionItem[]{ + + const sections = form.get('sections') as FormArray; + const fieldSets = form.get('fieldSets') as FormArray; + const fields = form.get('fields') as FormArray; + + const result:OptionItem[] = []; + + parentIds.push(form.get('id').value); + result.push({ + id: form.get('id').value, + type: type, + label: type ===ToCEntryType.Field? form.get('data').get('label').value :form.get('title').value, + // parentsIds: [form.get('id').value] + parentsIds: [...parentIds] + }); + + if(sections){ + sections.controls.forEach(section=>{ + result.push( ...this.buildOptions(section as FormGroup, ToCEntryType.Section,parentIds) ); + }); + } + if(fieldSets){ + fieldSets.controls.forEach(fieldset=>{ + result.push( ...this.buildOptions(fieldset as FormGroup, ToCEntryType.FieldSet, parentIds) ); + }); + } + if(fields){ + fields.controls.forEach(field=>{ + result.push( ...this.buildOptions(field as FormGroup, ToCEntryType.Field, parentIds) ); //TODO NA TO DOUME + }); + } + + return result; + } + + get parentIds(): string[]{ + + if(!this.formControlForCheck.get('id')) return []; + + const current = this.options.find(opt=> opt.id === this.formControlForCheck.get('id').value); + + if(current){ + return current.parentsIds; + } + return []; + } + } + + +interface OptionItem{ + id: string, + label: string, + type: ToCEntryType, + parentsIds: string[] +} \ No newline at end of file diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section/dataset-profile-editor-section.component.html b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section/dataset-profile-editor-section.component.html index 00f667062..b18ee3cbc 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section/dataset-profile-editor-section.component.html +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section/dataset-profile-editor-section.component.html @@ -1,31 +1,40 @@ 
-

{{'DATASET-PROFILE-EDITOR.STEPS.FORM.SECTION.TITLE' | translate}}

+ + - + + +
{{'DATASET-PROFILE-EDITOR.STEPS.SECTION-INFO.SECTION-NAME' | translate}} *
+
{{'DATASET-PROFILE-EDITOR.STEPS.SECTION-INFO.SECTION-NAME-HINT' | translate}}
+ - + + +
{{'DATASET-PROFILE-EDITOR.STEPS.SECTION-INFO.SECTION-DESCRIPTION' | translate}} *
+
{{'DATASET-PROFILE-EDITOR.STEPS.SECTION-INFO.SECTION-DESCRIPTION-HINT' | translate}}
+ + + + -

{{'DATASET-PROFILE-EDITOR.STEPS.FORM.SECTION.FIELDS.SUB-SECTIONS-TITLE' | + + + + + + + -

diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section/dataset-profile-editor-section.component.scss b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section/dataset-profile-editor-section.component.scss index 02d304fc1..d98754c6e 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section/dataset-profile-editor-section.component.scss +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section/dataset-profile-editor-section.component.scss @@ -6,3 +6,24 @@ .deleteBtn{ margin-right:2em; } + +.heading { + text-align: left; + font-weight: 700; + font-size: 18px; + letter-spacing: 0px; + color: #212121; + opacity: 0.81; + margin-top: 1.625rem; + margin-bottom: 0.625rem; +} + +.hint { + text-align: left; + font-weight: 400; + font-size: 16px; + letter-spacing: 0px; + color: #212121; + opacity: 0.81; + margin-bottom: 0.125rem; +} diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.html b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.html index ea4c54a35..5ea009c1b 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.html +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.html @@ -1,4 +1,4 @@ -
+

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

@@ -16,45 +16,99 @@

- + + + + + + +
+ +
+
+
+
+ + {{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.TITLE' | translate}} + +
+
+ + {{'DATASET-PROFILE-EDITOR.STEPS.FORM.TITLE' | translate}} + +
+
+ + Preview and Finalize + +
+
+
+ +
+ + +
+
+ + + {{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.TITLE' | translate}}
- - - {{'GENERAL.VALIDATION.REQUIRED' | - translate}} - - - - - - {{'GENERAL.VALIDATION.REQUIRED' - | translate}} - - - - - - - - {{ lang.name }} - - - {{'GENERAL.VALIDATION.REQUIRED' | - translate}} - -
+
1.1 {{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-NAME'| translate}} *
+
{{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-NAME-HINT'| translate}}
+ + + {{'GENERAL.VALIDATION.REQUIRED' | + translate}} + + +
+
+
1.2 {{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-DESCRIPTION'| translate}} *
+ +
{{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-DESCRIPTION-HINT'| translate}}
+ + + {{'GENERAL.VALIDATION.REQUIRED' + | translate}} + + +
+ +
+ +
1.3 {{'DATASET-PROFILE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-LANGUAGE'| translate}}
+ + + + + {{ lang.name }} + + + {{'GENERAL.VALIDATION.REQUIRED' | + translate}} + + +
+ +
- + {{'DATASET-PROFILE-EDITOR.STEPS.FORM.TITLE' | translate}}
-
- -
-
-
-
+ +
+ + +
+ + + +
+
+ + +
+
+
+ +
+
{{'DATASET-PROFILE-EDITOR.STEPS.PAGE-INFO.PAGE-NAME' | translate}} *
+
{{'DATASET-PROFILE-EDITOR.STEPS.PAGE-INFO.PAGE-NAME-HINT' | translate}}
+ + + +
+ + + +
+ +
- + + [form]="selectedTocEntry.form" [indexPath]="'tbd'" [viewOnly]="viewOnly" + > +
-

+ + @@ -96,32 +194,33 @@ (click)="deleteFieldSet(selectedTocEntry.form, i);" [disabled]="viewOnly"> delete --> - + [viewOnly]="viewOnly" + [numbering]="selectedTocEntry.numbering"> - -

- + +
+
- +
+
+ {{'DATASET-PROFILE-EDITOR.STEPS.PAGE-INFO.ACTIONS.NOTHING-HERE-HINT'| translate}} +
+ {{'DATASET-PROFILE-EDITOR.STEPS.PAGE-INFO.ACTIONS.START-CREATING-PAGE-START'| translate}} - + + + {{'DATASET-PROFILE-EDITOR.STEPS.PAGE-INFO.ACTIONS.START-CREATING-PAGE-END'| translate}} + + add + +
@@ -145,48 +244,62 @@ -->
-
+ +
-
- -
-
- - - + + + + + +
+ +
+
+ + + +
+
+ +
+
+ + +
+
+ +
+
+ +
- -
-
- - -
-
- -
-
- -
-
-
+ + + +
\ No newline at end of file diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.scss b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.scss index 5121e378f..4dd2f079b 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.scss +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.scss @@ -9,3 +9,86 @@ .deleteBtn{ margin-right:2em; } + + + +// REFACTORED CSS + +.stepper{ + background-color: transparent; +} +.content-displayer{ + background-color: #fff; + border-radius: 7px; + box-shadow: 0px 1px 2px #bfbfbf; + padding: 0em; + // padding-top: 0em; + overflow: visible; + min-height: 30em; +} + +.heading { + text-align: left; + font-weight: 700; + font-size: 18px; + letter-spacing: 0px; + color: #212121; + opacity: 0.81; + margin-top: 1.625rem; + margin-bottom: 0.625rem; +} + +.hint { + text-align: left; + font-weight: 400; + font-size: 16px; + letter-spacing: 0px; + color: #212121; + opacity: 0.81; + margin-bottom: 0.125rem; +} + +//TO CHECK +:host ::ng-deep .mat-horizontal-content-container { + overflow: visible; +} +:host ::ng-deep .mat-form-field-outline{ + background-color: #ffffff4f; +} + +:host ::ng-deep .mat-horizontal-stepper-header-container { + display: none !important; +} + +#progress{ + position: absolute; + height: 100%; + width: 110%; + transform: translateX(-110%); + transition-property: transform; + transition-duration: 600ms; + transition-timing-function: ease-out; + transition-delay: 50ms; + box-shadow: 0px 1px 2px #bfbfbf; + background-color: #f7dd72; +} +#progress-container{ + box-shadow: 0px 1px 2px #bfbfbf; + border-radius: .3em; +} +// .import-btn { +// background: #ffffff 0% 0% no-repeat padding-box; +// border-radius: 30px; +// // color: #129d99; +// // border: 1px solid #129d99; +// padding-left: 2em; +// padding-right: 2em; +// color: #000; +// border: 1px solid #000; +// } + .navigate-btn { + border-radius: 30px; + background-color: #f7dd72; + padding-left: 2em; + padding-right: 2em; + } \ No newline at end of file diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts index eab68df12..4e3f295a8 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts @@ -1,7 +1,7 @@ import { of as observableOf, Observable } from 'rxjs'; import { HttpClient, HttpErrorResponse } from '@angular/common/http'; -import { Component, OnInit, ViewChild } from '@angular/core'; +import { AfterViewInit, Component, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core'; import { Form, FormArray, FormControl, FormGroup } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { MatHorizontalStepper } from '@angular/material/stepper'; @@ -29,8 +29,13 @@ import { MatomoService } from '@app/core/services/matomo/matomo-service'; import { Link, LinkToScroll } from '@app/ui/misc/dataset-description-form/tableOfContentsMaterial/table-of-contents'; import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service'; import { DatasetWizardEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model'; -import { ToCEntry, ToCEntryType } from '../table-of-contents/table-of-contents-entry'; +import { Foo, ToCEntry, ToCEntryType } from '../table-of-contents/table-of-contents-entry'; import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; +import { FieldSetEditorModel } from '../admin/field-set-editor-model'; +import { Guid } from '@common/types/guid'; +import { FieldEditorModel } from '../admin/field-editor-model'; +import { VisibilityRulesService } from '@app/ui/misc/dataset-description-form/visibility-rules/visibility-rules.service'; +import { StepperSelectionEvent } from '@angular/cdk/stepper'; const skipDisable: any[] = require('../../../../../assets/resources/skipDisable.json'); @@ -39,7 +44,7 @@ const skipDisable: any[] = require('../../../../../assets/resources/skipDisable. templateUrl: './dataset-profile-editor.component.html', styleUrls: ['./dataset-profile-editor.component.scss'] }) -export class DatasetProfileEditorComponent extends BaseComponent implements OnInit { +export class DatasetProfileEditorComponent extends BaseComponent implements OnInit, AfterViewInit { isNew = true; isNewVersion = false; @@ -59,22 +64,6 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn errorMessages: string[] = []; tocEntryEnumValues = ToCEntryType; - - - profileEditorConfig: { - form: FormGroup, - index: string, - id: string, - sectionEditorModel?: SectionEditorModel - }; - profileEditorCompositeConfig: { - form: FormGroup, - index: string, - id: string - }; - - isSectionControl: boolean = false; - // sectionIdPreviewed:string = null; // currentSubForm:FormGroup = null; // currentSectionIndex: number = null; @@ -92,12 +81,19 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn private httpClient: HttpClient, private matomoService: MatomoService, private enumUtils: EnumUtils, - private datasetWizardService: DatasetWizardService + private datasetWizardService: DatasetWizardService, + private visibilityRulesService: VisibilityRulesService ) { super(); // this.profileID = route.snapshot.params['id']; // this.cloneId = route.snapshot.params['cloneid']; } + ngAfterViewInit(): void { + // setTimeout(() => { + // this.barPercentage = (1 / (this.stepper.steps.length+1)) * 110 - 110; + // }, 0); + } + ngOnInit() { this.matomoService.trackPageView('Admin: Dataset Profile Edit'); @@ -183,13 +179,15 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn this.form.disable(); this.viewOnly = true; } - this.addSection(); - this.addPage(); + // this.addSection(); + // this.addPage(); + this.visibilityRulesService.buildVisibilityRules([],this.form); } }); } prepareForm() { + this.visibilityRulesService.buildVisibilityRules([],this.form); this.form.valueChanges .pipe(takeUntil(this._destroyed)) .subscribe(change => { @@ -519,17 +517,21 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn getTocEntries(): ToCEntry[] { if (this.form == null) { return []; } - const result: ToCEntry[] = []; + + //build parent pages (this.form.get('pages') as FormArray).controls.forEach((pageElement, i) => { result.push({ id: pageElement.get('id').value, label: pageElement.get('title').value, type: ToCEntryType.Page, - form: pageElement + form: pageElement, + numbering: (i + 1).toString(), + subEntriesType: ToCEntryType.Section } as ToCEntry) }); + // build first level sections (this.form.get('sections') as FormArray).controls.forEach((sectionElement, i) => { const currentSectionPageId = sectionElement.get('page').value; const pageToAdd = result.filter(x => x.id == currentSectionPageId)[0]; @@ -540,12 +542,13 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn label: sectionElement.get('title').value, type: ToCEntryType.Section, form: sectionElement, - numbering: pageToAdd.numbering + '.' + i + numbering: pageToAdd.numbering + '.' + (pageToAdd.subEntries.length +1) } as ToCEntry; const sectionItems = this.populateSections(sectionElement.get('sections') as FormArray, item.numbering); const fieldSetItems = this.populateFieldSets(sectionElement.get('fieldSets') as FormArray, item.numbering); if (sectionItems != null) { item.subEntries = sectionItems; + item.subEntriesType = ToCEntryType.Section; } if (fieldSetItems != null) { if (item.subEntries == null) { @@ -553,11 +556,12 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn } else { item.subEntries.push(...fieldSetItems); } + item.subEntriesType = ToCEntryType.FieldSet; + } pageToAdd.subEntries.push(item); }); - return result; } @@ -572,12 +576,13 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn label: sectionElement.get('title').value, type: ToCEntryType.Section, form: sectionElement, - numbering: existingNumbering + '.' + i + numbering: existingNumbering + '.' + (i + 1) } as ToCEntry; const sectionItems = this.populateSections(sectionElement.get('sections') as FormArray, item.numbering); const fieldSetItems = this.populateFieldSets(sectionElement.get('fieldSets') as FormArray, item.numbering); if (sectionItems != null) { item.subEntries = sectionItems; + item.subEntriesType = ToCEntryType.Section; } if (fieldSetItems != null) { if (item.subEntries == null) { @@ -585,6 +590,7 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn } else { item.subEntries.push(...fieldSetItems); } + item.subEntriesType = ToCEntryType.FieldSet; } result.push(item); }); @@ -602,9 +608,9 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn id: fieldSetElement.get('id').value, label: fieldSetElement.get('title').value, type: ToCEntryType.FieldSet, - subEntries: this.populateSections((fieldSetElement.get('fieldSets') as FormArray), existingNumbering + '.' + i), + //subEntries: this.populateSections((fieldSetElement.get('fieldSets') as FormArray), existingNumbering + '.' + i), form: fieldSetElement, - numbering: existingNumbering + '.' + i + numbering: existingNumbering + '.' + (i + 1) } as ToCEntry) }); @@ -612,89 +618,293 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn return result; } + addNewEntry(tce: Foo) { + + const parent = tce.parent; + + //define entry type + switch (tce.childType) { + case ToCEntryType.Page: //CALLED FROM PAGE + //create section + // this.addPage(); + // this.displayItem(child); + + + //ceate page editor model and give ordinal + const page: PageEditorModel = new PageEditorModel(this.dataModel.pages.length); + this.dataModel.pages.push(page); + (this.form.get('pages')).push(page.buildForm()); + + + //make new entry selected + const pagesArray = (this.form.get('pages') as FormArray); + const addedEntry = pagesArray.at(pagesArray.length-1) as FormGroup; + this.selectedTocEntry = { + form: addedEntry, + label: addedEntry.get('title').value, + type: ToCEntryType.Page, + id: addedEntry.get('id').value, + numbering:pagesArray.value.length, + subEntries:null, + subEntriesType: ToCEntryType.Section + } + + break; + case ToCEntryType.Section: //adding a section + const section: SectionEditorModel = new SectionEditorModel(); + //give id + section.id = Guid.create().toString(); + let sectionsArray:FormArray; + + if (parent.type === ToCEntryType.Page) { + //FIRST LEVEL SECTION + + //give ordinal and link to parent + section.page = parent.id; + section.ordinal = (this.form.get('sections') as FormArray).length; + (this.form.get('sections')).push(section.buildForm()); + + sectionsArray = this.form.get('sections') as FormArray; + } else if( parent.type == ToCEntryType.Section) { //subsection + + //adding page parent MAYBE NOT NEEDED + section.page = parent.form.get('page').value; + //MAYBE NOT NEEDED + section.ordinal = (parent.form.get('sections') as FormArray).length; + (parent.form.get('sections')).push(section.buildForm()); + // (child.form.parent as FormArray).push(section.buildForm()); + + sectionsArray = parent.form.get('sections') as FormArray; + }else{ + console.error('BUg found'); + } + + + const sectionAdded = sectionsArray.at(sectionsArray.length -1) as FormGroup; + + this.selectedTocEntry = { + id: sectionAdded.get('id').value, + label: sectionAdded.get('title').value, + form: sectionAdded, + numbering:'', + subEntries: null, + subEntriesType: undefined, //ADDNEW VALUE TO TOCENTRY TYPE FOR UNDFINED + type: ToCEntryType.Section + } + + break; + case ToCEntryType.FieldSet: + const fieldSet: FieldSetEditorModel = new FieldSetEditorModel(); + + //create one field form fieldset + const field: FieldEditorModel = new FieldEditorModel(); //to ask + field.id = Guid.create().toString(); + field.ordinal = fieldSet.fields.length; + fieldSet.fields.push(field); + + //give fieldset id and ordinal + fieldSet.id = Guid.create().toString(); + fieldSet.ordinal = (parent.form.get('fieldSets') as FormArray).length; + + (parent.form.get('fieldSets')).push(fieldSet.buildForm()); + + const parentArray = parent.form.get('fieldSets') as FormArray; + const addedFieldSet = parentArray.at(parentArray.length - 1); + + this.selectedTocEntry = { + id: addedFieldSet.get('id').value, + label: addedFieldSet.get('title').value, + form: addedFieldSet, + numbering: '', + subEntries: null, //TODO IT SHOULD HAVE CHILDS + subEntriesType: ToCEntryType.Field, + type: ToCEntryType.FieldSet + } + + + break; + + default: + break; + } + + } + + + + + + onRemoveEntry(tce: ToCEntry) { + //define entry type + switch (tce.type) { + case ToCEntryType.Page: + const pages = this.form.get('pages') as FormArray; + + let pageIndex = -1; + //get the index + for (let i = 0; i < pages.length; i++) { + let page = pages.at(i) as FormGroup; + + if (page.controls.id.value === tce.id) { + pageIndex = i; + break; + } + } + + if (pageIndex >= 0) { + //remove page + pages.removeAt(pageIndex); + //clean up sections of removed page + + const sections = (this.form.get('sections') as FormArray).controls; + + const updatedSections = new FormArray([]); + + for (let i = 0; i < sections.length; i++) { + let section = sections[i]; + + if (section.get('page').value != tce.id) { + updatedSections.push(section); + } + } + //replace sections value + this.form.controls.sections = updatedSections; + + //update page orders + for(let i=0; i= 0) { //section found + + const sections = (this.form.get('sections') as FormArray); + + //remove section + sections.removeAt(index); + + //update ordinal + for(let i=0; i< sections.length; i++){ + sections.at(i).get('ordinal').patchValue(i); + } + } else {//NOT FOUND IN FIRST LEVEL CASE + + //LOOK FOR SUBSECTION CASE + let parentFormArray = tce.form.parent as FormArray; + + for (let i = 0; i < parentFormArray.length; i++) { + let section = parentFormArray.at(i); + + if (section.get('id').value == tce.id) { + index = i; + break; + } + } + if (index >= 0) { + parentFormArray.removeAt(index); + + //update odrinal + + for(let i=0; i=0){//fieldset found + parentFormArray.removeAt(idx); + + //patching order + for(let i=0; i{ + if(this.tocEntryIsChildOf(testingChild, subEntry)){ + childFound = true; + return true; + } + }) + + return childFound; + } + return false; + } + selectedTocEntry: ToCEntry displayItem(entry: ToCEntry): void { this.selectedTocEntry = entry; + } - - // console.log(this.form); - // console.log(this.dataModel); - - // this.profileEditorConfig = null; - - // let entry = entries[0]; - // console.log(entries); - - - // if (entry.subEntries && (entry.subEntries.length > 0)) {// its a page - // // this.sectionIdPreviewed = entry.id; - // const valuesArray = this.form.get('sections').value; - - - // let currentVal = entry.id; - - // let indexArray: string[] = valuesArray.map(element => element.page); - - // let index = indexArray.indexOf(currentVal); - // let subForm = (this.form.get('sections') as FormArray).controls[index] as FormGroup; - // let currentEditor = this.dataModel.sections.filter(section => section.page == entry.id)[0]; - - - // this.profileEditorConfig = { - // id: entry.id, - // form: subForm, - // index: index.toString(), - // sectionEditorModel: currentEditor - // }; - - // this.isSectionControl = false; - // // this.currentSubForm = subForm; - // // this.currentSectionIndex = index; - // // this.currentSectionEditorModel = currentEditor; - - // // this.isCompoSiteFieldEditor = true; - - // } else if (entries.length == 2) {//its section - - // this.isSectionControl = true; - - // const valuesArray = this.form.get('sections').value; - - - // let currentVal = entries[1].id // Parent node entry.id; - - // let indexArray: string[] = valuesArray.map(element => element.page); - - // let index = indexArray.indexOf(currentVal); - - - // //Section Form - // const sectionForm = (this.form.get('sections') as FormArray).controls[index] as FormGroup; - - // const sectionFormControls = sectionForm.get('fieldSets')['controls']; - - // const fieldSetsIds = sectionForm.get('fieldSets').value;//.map(fieldset => fieldset.id); - // // const fieldsetIndex = fieldSetsIds.indexOf(entries[0].id); - - // console.log(fieldSetsIds); - - - // const sectionFormControl = sectionFormControls[0]; - - // this.profileEditorCompositeConfig = { - // id: entries[0].id, - // form: sectionFormControl, - // index: 's' + index + 'cf' + 0 - // } - - - // } - - - - - - + get numOfPages(){ + return (this.form.get('pages')).length; } // getSectionIndex(): number{ @@ -734,4 +944,27 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn } + + printForm(){ + console.log(this.form.value); + } + + + + barPercentage = -100; + onStepperSelectionChange(selectionChange: StepperSelectionEvent){ + + this.barPercentage = ((selectionChange.selectedIndex+1) / (this.stepper.steps.length+1)) * 110- 110; + } + + get barPercentageA(){ + if(!this.stepper){ + return -110; + } + + const selectedIndex = this.stepper.selectedIndex + 1; + return (selectedIndex / (this.stepper.steps.length+1)) * 110- 110; + } + + } \ No newline at end of file diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents-entry.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents-entry.ts index 3cc284659..cb8afe41b 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents-entry.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents-entry.ts @@ -3,6 +3,7 @@ import { AbstractControl } from "@angular/forms"; export interface ToCEntry { id: string; label: string; + subEntriesType: ToCEntryType; subEntries: ToCEntry[]; type: ToCEntryType; form: AbstractControl; @@ -13,5 +14,11 @@ export interface ToCEntry { export enum ToCEntryType { Page = 0, Section = 1, - FieldSet = 2 + FieldSet = 2, + Field = 3 +} + +export interface Foo { + childType: ToCEntryType, + parent: ToCEntry } \ No newline at end of file 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 5c2e2ccac..0ac817cd6 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 @@ -1,5 +1,81 @@ - \ No newline at end of file diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents.scss b/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents.scss index b346518fa..777fb64e1 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents.scss +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents.scss @@ -1,7 +1,7 @@ .docs-toc-container { width: 100%; padding: 5px 0 10px 0px; - cursor: pointer; + // cursor: pointer; // border-left: solid 4px #0c7489; .scroll-container { diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents.ts index 858ba8447..72a0c21f8 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/table-of-contents/table-of-contents.ts @@ -5,7 +5,7 @@ import { interval, Subject, Subscription } from 'rxjs'; import { distinctUntilChanged } from 'rxjs/operators'; import { type } from 'os'; import { SimpleChanges } from '@angular/core'; -import { ToCEntry } from './table-of-contents-entry'; +import { Foo, ToCEntry, ToCEntryType } from './table-of-contents-entry'; export interface Link { /* id of the section*/ @@ -38,14 +38,24 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn @Output() currentLinks = new EventEmitter(); @Output() itemClick = new EventEmitter(); + @Output() newEntry = new EventEmitter(); + @Output() removeEntry = new EventEmitter(); + @Output() createEntry = new EventEmitter(); + + + @Input() itemSelected: ToCEntry; + subscription: Subscription; linksSubject: Subject = new Subject(); @Input() isActive: boolean; show: boolean = false; + tocEntryType = ToCEntryType; + + constructor( @Inject(DOCUMENT) private _document: Document) { super(); @@ -175,6 +185,19 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn // } + addNewEntry(tce: ToCEntry){ + this.newEntry.emit(tce); + } + deleteEntry(currentLink: ToCEntry){ + this.removeEntry.emit(currentLink); + } + + + + createNewEntry(foo: Foo){ + this.createEntry.emit(foo); + } + } export interface LinkToScroll { diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.module.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.module.ts index 6dbc01fa1..4280fda84 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.module.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.module.ts @@ -32,7 +32,9 @@ import { FormProgressIndicationModule } from './components/form-progress-indicat ], exports: [ DatasetDescriptionFormComponent, - DatasetDescriptionComponent + DatasetDescriptionComponent, + FormCompositeFieldComponent, + FormFieldComponent ], providers: [ VisibilityRulesService, diff --git a/dmp-frontend/src/assets/i18n/de.json b/dmp-frontend/src/assets/i18n/de.json index c10317679..3821af770 100644 --- a/dmp-frontend/src/assets/i18n/de.json +++ b/dmp-frontend/src/assets/i18n/de.json @@ -280,6 +280,33 @@ "ROLES": "Roles" }, "STEPS": { + "GENERAL-INFO":{ + "TITLE": "General Info", + "DATASET-TEMPLATE-NAME": "Dataset template name", + "DATASET-TEMPLATE-NAME-HINT": "A title that determines the Dataset template.", + "DATASET-TEMPLATE-DESCRIPTION": "Description", + "DATASET-TEMPLATE-DESCRIPTION-HINT": "A brief description of what the Dataset is about, it's scope and objectives.", + "DATASET-TEMPLATE-LANGUAGE": "Dataset template language", + "UNTITLED": "Untitled" + }, + "PAGE-INFO":{ + "PAGE-NAME": "Page Name", + "PAGE-NAME-HINT": "Set a name for the dataset page.", + "PAGE-DESCRIPTION": "Description", + "PAGE-DESCRIPTION-HINT": "Write a brief desciption of what the page is about.", + "ACTIONS":{ + "CREATE-FIRST-PAGE": "Create the first page", + "NOTHING-HERE-HINT": "Nothing here yet.", + "START-CREATING-PAGE-START": "Start by ", + "START-CREATING-PAGE-END": "creating the first page." + } + }, + "SECTION-INFO":{ + "SECTION-NAME": "Section Name", + "SECTION-NAME-HINT": "Set a name for the section.", + "SECTION-DESCRIPTION": "Description", + "SECTION-DESCRIPTION-HINT": "Write a brief desciption of what the section is about." + }, "PAGES": { "TITLE": "Page Description", "PAGE-PREFIX": "Page", @@ -429,9 +456,9 @@ } }, "DMP-LISTING": { - "TITLE": "Datenmanagementpläne", + "DMP": "DMP", "GRANT": "Grant", - "TITLE": "Data Management Plans", + "TITLE": "Datenmanagementpläne", "OWNER": "Besitzer", "MEMBER": "Mitglied", "CREATOR": "Ersteller", @@ -1152,7 +1179,8 @@ "RESEARCHERS": "Researchers", "ORGANIZATIONS": "Organizations", "DATASET-IDENTIFIER": "Dataset Identifier", - "CURRENCY": "Currency" + "CURRENCY": "Currency", + "VALIDATION": "Validator" }, "DATASET-PROFILE-COMBO-BOX-TYPE": { "WORD-LIST": "Word List", @@ -1169,6 +1197,9 @@ "DATASETS": "Datensatzbeschreibungen", "EXTERNAL-SOURCE-HINT": "Liste jener Werte, die von externer(n) Quelle(n) stammen" }, + "DATASET-PROFILE-VALIDATOR": { + "ACTION": "Validate" + }, "RECENT-ACTIVITY-ORDER": { "CREATED": "Created", "LABEL": "Label", @@ -1590,4 +1621,4 @@ "FINALIZED": "Finalized", "DELETED": "Deleted" } -} +} \ No newline at end of file diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index 3908440c5..2b254ac8f 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -280,6 +280,33 @@ "ROLES": "Roles" }, "STEPS": { + "GENERAL-INFO":{ + "TITLE": "General Info", + "DATASET-TEMPLATE-NAME": "Dataset template name", + "DATASET-TEMPLATE-NAME-HINT": "A title that determines the Dataset template.", + "DATASET-TEMPLATE-DESCRIPTION": "Description", + "DATASET-TEMPLATE-DESCRIPTION-HINT": "A brief description of what the Dataset is about, it's scope and objectives.", + "DATASET-TEMPLATE-LANGUAGE": "Dataset template language", + "UNTITLED": "Untitled" + }, + "PAGE-INFO":{ + "PAGE-NAME": "Page Name", + "PAGE-NAME-HINT": "Set a name for the dataset page.", + "PAGE-DESCRIPTION": "Description", + "PAGE-DESCRIPTION-HINT": "Write a brief desciption of what the page is about.", + "ACTIONS":{ + "CREATE-FIRST-PAGE": "Create the first page", + "NOTHING-HERE-HINT": "Nothing here yet.", + "START-CREATING-PAGE-START": "Start by ", + "START-CREATING-PAGE-END": "creating the first page." + } + }, + "SECTION-INFO":{ + "SECTION-NAME": "Section Name", + "SECTION-NAME-HINT": "Set a name for the section.", + "SECTION-DESCRIPTION": "Description", + "SECTION-DESCRIPTION-HINT": "Write a brief desciption of what the section is about." + }, "PAGES": { "TITLE": "Page Description", "PAGE-PREFIX": "Page", diff --git a/dmp-frontend/src/assets/i18n/es.json b/dmp-frontend/src/assets/i18n/es.json index cf1c9f364..020561464 100644 --- a/dmp-frontend/src/assets/i18n/es.json +++ b/dmp-frontend/src/assets/i18n/es.json @@ -280,6 +280,33 @@ "ROLES": "Funciones" }, "STEPS": { + "GENERAL-INFO":{ + "TITLE": "General Info", + "DATASET-TEMPLATE-NAME": "Dataset template name", + "DATASET-TEMPLATE-NAME-HINT": "A title that determines the Dataset template.", + "DATASET-TEMPLATE-DESCRIPTION": "Description", + "DATASET-TEMPLATE-DESCRIPTION-HINT": "A brief description of what the Dataset is about, it's scope and objectives.", + "DATASET-TEMPLATE-LANGUAGE": "Dataset template language", + "UNTITLED": "Untitled" + }, + "PAGE-INFO":{ + "PAGE-NAME": "Page Name", + "PAGE-NAME-HINT": "Set a name for the dataset page.", + "PAGE-DESCRIPTION": "Description", + "PAGE-DESCRIPTION-HINT": "Write a brief desciption of what the page is about.", + "ACTIONS":{ + "CREATE-FIRST-PAGE": "Create the first page", + "NOTHING-HERE-HINT": "Nothing here yet.", + "START-CREATING-PAGE-START": "Start by ", + "START-CREATING-PAGE-END": "creating the first page." + } + }, + "SECTION-INFO":{ + "SECTION-NAME": "Section Name", + "SECTION-NAME-HINT": "Set a name for the section.", + "SECTION-DESCRIPTION": "Description", + "SECTION-DESCRIPTION-HINT": "Write a brief desciption of what the section is about." + }, "PAGES": { "TITLE": "Descripición de la página", "PAGE-PREFIX": "Página", @@ -1152,7 +1179,8 @@ "RESEARCHERS": "Investigadores", "ORGANIZATIONS": "Organizaciones", "DATASET-IDENTIFIER": "Identificador del dataset", - "CURRENCY": "Moneda" + "CURRENCY": "Moneda", + "VALIDATION": "Validator" }, "DATASET-PROFILE-COMBO-BOX-TYPE": { "WORD-LIST": "Lista de palabras", @@ -1169,6 +1197,9 @@ "DATASETS": "Descripciones del dataset", "EXTERNAL-SOURCE-HINT": "Lista de valores para seleccionar la(s) fuente(s) externa(s)" }, + "DATASET-PROFILE-VALIDATOR": { + "ACTION": "Validate" + }, "RECENT-ACTIVITY-ORDER": { "CREATED": "Creado", "LABEL": "Etiqueta", @@ -1590,4 +1621,4 @@ "FINALIZED": "Finalizado", "DELETED": "Deleted" } -} +} \ No newline at end of file diff --git a/dmp-frontend/src/assets/i18n/gr.json b/dmp-frontend/src/assets/i18n/gr.json index 1332ffd15..3a5c1239d 100644 --- a/dmp-frontend/src/assets/i18n/gr.json +++ b/dmp-frontend/src/assets/i18n/gr.json @@ -280,6 +280,33 @@ "ROLES": "Ρόλοι" }, "STEPS": { + "GENERAL-INFO":{ + "TITLE": "General Info", + "DATASET-TEMPLATE-NAME": "Dataset template name", + "DATASET-TEMPLATE-NAME-HINT": "A title that determines the Dataset template.", + "DATASET-TEMPLATE-DESCRIPTION": "Description", + "DATASET-TEMPLATE-DESCRIPTION-HINT": "A brief description of what the Dataset is about, it's scope and objectives.", + "DATASET-TEMPLATE-LANGUAGE": "Dataset template language", + "UNTITLED": "Untitled" + }, + "PAGE-INFO":{ + "PAGE-NAME": "Page Name", + "PAGE-NAME-HINT": "Set a name for the dataset page.", + "PAGE-DESCRIPTION": "Description", + "PAGE-DESCRIPTION-HINT": "Write a brief desciption of what the page is about.", + "ACTIONS":{ + "CREATE-FIRST-PAGE": "Create the first page", + "NOTHING-HERE-HINT": "Nothing here yet.", + "START-CREATING-PAGE-START": "Start by ", + "START-CREATING-PAGE-END": "creating the first page." + } + }, + "SECTION-INFO":{ + "SECTION-NAME": "Section Name", + "SECTION-NAME-HINT": "Set a name for the section.", + "SECTION-DESCRIPTION": "Description", + "SECTION-DESCRIPTION-HINT": "Write a brief desciption of what the section is about." + }, "PAGES": { "TITLE": "Περιγραφή Σελίδας", "PAGE-PREFIX": "Σελίδα", @@ -1152,7 +1179,8 @@ "RESEARCHERS": "Ερευνητές", "ORGANIZATIONS": "Οργανισμοί", "DATASET-IDENTIFIER": "Αναγνωριστικό Συνόλου Δεδομένων", - "CURRENCY": "Επικαιρότητα" + "CURRENCY": "Επικαιρότητα", + "VALIDATION": "Validator" }, "DATASET-PROFILE-COMBO-BOX-TYPE": { "WORD-LIST": "Λίστα Λέξεων", @@ -1169,6 +1197,9 @@ "DATASETS": "Περιγραφές Συνόλων Δεδομένων", "EXTERNAL-SOURCE-HINT": "Κατάλογος τιμών που παρέχονται από εξωτερικές πηγές" }, + "DATASET-PROFILE-VALIDATOR": { + "ACTION": "Validate" + }, "RECENT-ACTIVITY-ORDER": { "CREATED": "Δημιουργημένο", "LABEL": "Ετικέτα", @@ -1590,4 +1621,4 @@ "FINALIZED": "Οριστικοποιημένα", "DELETED": "Deleted" } -} +} \ No newline at end of file diff --git a/dmp-frontend/src/assets/i18n/pt.json b/dmp-frontend/src/assets/i18n/pt.json index 7636e7cbd..301795862 100644 --- a/dmp-frontend/src/assets/i18n/pt.json +++ b/dmp-frontend/src/assets/i18n/pt.json @@ -280,6 +280,33 @@ "ROLES": "Funções" }, "STEPS": { + "GENERAL-INFO":{ + "TITLE": "General Info", + "DATASET-TEMPLATE-NAME": "Dataset template name", + "DATASET-TEMPLATE-NAME-HINT": "A title that determines the Dataset template.", + "DATASET-TEMPLATE-DESCRIPTION": "Description", + "DATASET-TEMPLATE-DESCRIPTION-HINT": "A brief description of what the Dataset is about, it's scope and objectives.", + "DATASET-TEMPLATE-LANGUAGE": "Dataset template language", + "UNTITLED": "Untitled" + }, + "PAGE-INFO":{ + "PAGE-NAME": "Page Name", + "PAGE-NAME-HINT": "Set a name for the dataset page.", + "PAGE-DESCRIPTION": "Description", + "PAGE-DESCRIPTION-HINT": "Write a brief desciption of what the page is about.", + "ACTIONS":{ + "CREATE-FIRST-PAGE": "Create the first page", + "NOTHING-HERE-HINT": "Nothing here yet.", + "START-CREATING-PAGE-START": "Start by ", + "START-CREATING-PAGE-END": "creating the first page." + } + }, + "SECTION-INFO":{ + "SECTION-NAME": "Section Name", + "SECTION-NAME-HINT": "Set a name for the section.", + "SECTION-DESCRIPTION": "Description", + "SECTION-DESCRIPTION-HINT": "Write a brief desciption of what the section is about." + }, "PAGES": { "TITLE": "Descrição da Página", "PAGE-PREFIX": "Página", @@ -1591,6 +1618,7 @@ "DATASET-PROFILE-STATUS": { "NONE": "Nenhum", "DRAFT": "Rascunho", - "FINALIZED": "Concluído" + "FINALIZED": "Concluído", + "DELETED": "Deleted" } } \ No newline at end of file diff --git a/dmp-frontend/src/assets/i18n/sk.json b/dmp-frontend/src/assets/i18n/sk.json index ed035162a..cb310b86c 100644 --- a/dmp-frontend/src/assets/i18n/sk.json +++ b/dmp-frontend/src/assets/i18n/sk.json @@ -280,6 +280,33 @@ "ROLES": "Role" }, "STEPS": { + "GENERAL-INFO":{ + "TITLE": "General Info", + "DATASET-TEMPLATE-NAME": "Dataset template name", + "DATASET-TEMPLATE-NAME-HINT": "A title that determines the Dataset template.", + "DATASET-TEMPLATE-DESCRIPTION": "Description", + "DATASET-TEMPLATE-DESCRIPTION-HINT": "A brief description of what the Dataset is about, it's scope and objectives.", + "DATASET-TEMPLATE-LANGUAGE": "Dataset template language", + "UNTITLED": "Untitled" + }, + "PAGE-INFO":{ + "PAGE-NAME": "Page Name", + "PAGE-NAME-HINT": "Set a name for the dataset page.", + "PAGE-DESCRIPTION": "Description", + "PAGE-DESCRIPTION-HINT": "Write a brief desciption of what the page is about.", + "ACTIONS":{ + "CREATE-FIRST-PAGE": "Create the first page", + "NOTHING-HERE-HINT": "Nothing here yet.", + "START-CREATING-PAGE-START": "Start by ", + "START-CREATING-PAGE-END": "creating the first page." + } + }, + "SECTION-INFO":{ + "SECTION-NAME": "Section Name", + "SECTION-NAME-HINT": "Set a name for the section.", + "SECTION-DESCRIPTION": "Description", + "SECTION-DESCRIPTION-HINT": "Write a brief desciption of what the section is about." + }, "PAGES": { "TITLE": "Opis stránky", "PAGE-PREFIX": "Stránka", @@ -1152,7 +1179,8 @@ "RESEARCHERS": "Výskumníci (Researchers)", "ORGANIZATIONS": "Organizácie (Organizations)", "DATASET-IDENTIFIER": "Identifikátor súborov dát (Dataset Identifier)", - "CURRENCY": "Mena (Currency)" + "CURRENCY": "Mena (Currency)", + "VALIDATION": "Validator" }, "DATASET-PROFILE-COMBO-BOX-TYPE": { "WORD-LIST": "Zoznam slov", @@ -1169,6 +1197,9 @@ "DATASETS": "Súbory dát", "EXTERNAL-SOURCE-HINT": "Zoznam hodnôt dodaných z externých zdrojov." }, + "DATASET-PROFILE-VALIDATOR": { + "ACTION": "Validate" + }, "RECENT-ACTIVITY-ORDER": { "CREATED": "Vytvorené", "LABEL": "Označenie", @@ -1590,4 +1621,4 @@ "FINALIZED": "Dokončené", "DELETED": "Deleted" } -} +} \ No newline at end of file diff --git a/dmp-frontend/src/assets/i18n/sr.json b/dmp-frontend/src/assets/i18n/sr.json index 6f2fd7dc1..04d0e41e6 100644 --- a/dmp-frontend/src/assets/i18n/sr.json +++ b/dmp-frontend/src/assets/i18n/sr.json @@ -17,6 +17,7 @@ "SUCCESSFUL-LOGIN": "Uspešno ste se prijavili", "SUCCESSFUL-LOGOUT": "Uspešno ste se odjavili", "SUCCESSFUL-EMAIL-SEND": "Email uspešno poslat", + "SUCCESSFUL-COPY-TO-CLIPBOARD": "Copied to Clipboard", "UNSUCCESSFUL-LOGOUT": "Neuspešno odjavljivanje", "UNSUCCESSFUL-LOGIN": "Neuspešno prijavljivanje", "SUCCESSFUL-DATASET-PROFILE-DELETE": "Uspešno brisanje", @@ -84,7 +85,8 @@ "PRODUCED": "izrađen", "RDA-SPECIFICATIONS": "prema RDA specifikacijama", "MACHINE-ACTIONABLE": "za mašinski čitljive Planove", - "UPLOAD-FILE": "Uvezite datoteku" + "UPLOAD-FILE": "Uvezite datoteku", + "REPLACE-FILE": "Replace File" }, "INVITATION-DIALOG": { "HINT": "Za razdvajanje autora koristite tastere zapeta \",\" ili \"Enter\"", @@ -277,7 +279,34 @@ "DATASET-DESCRIPTION": "Opis", "ROLES": "Uloge" }, - "STEPS": { + "STEPS": + {"GENERAL-INFO":{ + "TITLE": "General Info", + "DATASET-TEMPLATE-NAME": "Dataset template name", + "DATASET-TEMPLATE-NAME-HINT": "A title that determines the Dataset template.", + "DATASET-TEMPLATE-DESCRIPTION": "Description", + "DATASET-TEMPLATE-DESCRIPTION-HINT": "A brief description of what the Dataset is about, it's scope and objectives.", + "DATASET-TEMPLATE-LANGUAGE": "Dataset template language", + "UNTITLED": "Untitled" + }, + "PAGE-INFO":{ + "PAGE-NAME": "Page Name", + "PAGE-NAME-HINT": "Set a name for the dataset page.", + "PAGE-DESCRIPTION": "Description", + "PAGE-DESCRIPTION-HINT": "Write a brief desciption of what the page is about.", + "ACTIONS":{ + "CREATE-FIRST-PAGE": "Create the first page", + "NOTHING-HERE-HINT": "Nothing here yet.", + "START-CREATING-PAGE-START": "Start by ", + "START-CREATING-PAGE-END": "creating the first page." + } + }, + "SECTION-INFO":{ + "SECTION-NAME": "Section Name", + "SECTION-NAME-HINT": "Set a name for the section.", + "SECTION-DESCRIPTION": "Description", + "SECTION-DESCRIPTION-HINT": "Write a brief desciption of what the section is about." + }, "PAGES": { "TITLE": "Opis stranice", "PAGE-PREFIX": "Stranica", @@ -471,6 +500,7 @@ "START-NEW-VERSION": "Započnite novu verziju", "VIEW-VERSION": "Sve verzije Plana", "CLONE": "Napravite kopiju", + "COPY": "Copy", "DELETE": "Obrišite", "DEPOSIT": "Deponujte", "EXPORT": "Izvezite", @@ -657,7 +687,8 @@ "NEW": "Novi skup podataka", "CREATE-NEW": "Kreirajte novi skup podataka", "EXPORT": "Izvezite", - "INVITE-COLLABORATORS": "Pozovite saradnike" + "INVITE-COLLABORATORS": "Pozovite saradnike", + "INVITE-SHORT": "Invite" }, "STATES": { "EDITED": "Izmenjeno", @@ -990,7 +1021,8 @@ }, "USERS": { "LABEL": "Pretražite", - "ROLE": "Uloga" + "ROLE": "Uloga", + "SHOW": "Show" }, "SELECT": "Odaberite opciju", "LIKE": "Pretražite" @@ -999,7 +1031,8 @@ "TITLE": { "NEW": "Novi plan upravljanja podacima", "EDIT": "Uredite", - "INTRO": "Plan upravljanja podacima (eng. Data Management Plan, skraćeno DMP) se sastoji od Vaših planova za upravljanje podacima i sadrži informacije kako su nastali, kako su analizirani i na koji način su sačuvani podaci. Argos je otvoren kolaboracioni alat sa mogućnošću nadogradnje koji podržava otvorene i FAIR principe za upravljanje podacima." + "INTRO": "Plan upravljanja podacima (eng. Data Management Plan, skraćeno DMP) se sastoji od Vaših planova za upravljanje podacima i sadrži informacije kako su nastali, kako su analizirani i na koji način su sačuvani podaci. Argos je otvoren kolaboracioni alat sa mogućnošću nadogradnje koji podržava otvorene i FAIR principe za upravljanje podacima.", + "INTRO-TIP": "Tip: Add new datasets to describe different types of data or disciplinary data to avoid mixing information." }, "FIELDS": { "NAME": "Naziv skupa podataka", @@ -1032,6 +1065,7 @@ "EXTERNAL-LINK": "Dodajte spoljni URL link" }, "HINT": { + "DESCRIPTION": "Briefly describe the context and purpose of the Dataset", "TITLE": "Kratko uputstvo o", "TITLE-REST": "radi se o njegovoj nameni i ciljevima." }, @@ -1069,7 +1103,12 @@ "LABEL": "Oznaka", "ROLES": "Uloge", "NAME": "Ime", - "PERMISSIONS": "Dozvole" + "PERMISSIONS": "Dozvole", + "EXPORT": "Export users" + }, + "ACTIONS": { + "EDIT": "Edit", + "SAVE": "Save" } }, "TYPES": { @@ -1140,7 +1179,8 @@ "RESEARCHERS": "Istraživači", "ORGANIZATIONS": "Institucije", "DATASET-IDENTIFIER": "Identifikatori skupa podataka", - "CURRENCY": "Valuta" + "CURRENCY": "Valuta", + "VALIDATION": "Validator" }, "DATASET-PROFILE-COMBO-BOX-TYPE": { "WORD-LIST": "Lista reči", @@ -1156,7 +1196,10 @@ "DMPS": "Planovi upravljanja podacima", "DATASETS": "Skupovi podataka", "EXTERNAL-SOURCE-HINT": "Lista vrednosti obezbeđenih od spoljnih izvora" - }, + }, + "DATASET-PROFILE-VALIDATOR": { + "ACTION": "Validate" + }, "RECENT-ACTIVITY-ORDER": { "CREATED": "Kreirano", "LABEL": "Oznaka", @@ -1277,7 +1320,8 @@ "GUIDE": { "TITLE": "Korisničko uputstvo", "TITLE-DASHED": "-Korisničko uputstvo-", - "CLOSE": "Zatvorite" + "CLOSE": "Zatvorite", + "SAVE": "Save" }, "PRIVACY-POLICY": { "TITLE": "-Politika privatnosti-", @@ -1348,6 +1392,14 @@ "ADD-DATASET-DESCRIPTION": "Dodajte skup podataka", "ADD-DATASET": "Dodajte skup podataka", "ADD-DMP-DESCRIPTION": "Dodajte opis Plana" + }, + "TOUR-GUIDE": { + "DMP": "This is your dashboard. You can view and edit all DMPs that you have either contributed to or created yourself.", + "START-NEW": "Create your DMP with Start new DMP.", + "IMPORT-DMP": "You can import a DMP", + "START-WIZARD": "or create new in Argos.", + "DATASET": "This is your dashboard. You can view and edit all Datasets that you have either contributed to or created yourself.", + "NEW-DATASET": "With Add Dataset you can describe new datasets anytime in the research process." } }, "USER-DIALOG": { @@ -1361,7 +1413,15 @@ "TITLE": "Podešavanja", "TIMEZONE": "Vremenska zona", "CULTURE": "Kultura", - "LANGUAGE": "Jezik" + "LANGUAGE": "Jezik", + "CONNECTED-WITH": "Connected with", + "NAME": "Name", + "ORGANIZATION": "Organization", + "ROLE": "Role", + "SELECT-ROLE": "Select Role", + "ACCOUNTS": "Accounts", + "EMAILS": "Emails", + "YOUR-EMAIL": "Your Email" }, "ASSOCIATED-DMPS": "Povezani Planovi", "DMPS": { @@ -1372,8 +1432,32 @@ "ZENODO": { "LOGIN": "Prijavite se na Zenodo", "LOGOUT": "Uklonite Zenodo", + "AUTHORIZE": "Authorize Zenodo", "TITLE": "Zenodo nalog", "DESCRIPTION": "Povezani Zenodo nalog:" + }, + "ROLE-ORGANIZATION": { + "FACULTY": "Faculty", + "LIBRARIAN": "Librarian", + "RESEARCHER": "Researcher", + "STUDENT": "Student (BA/BSc, MSc)", + "EARLY-CAREER-RESEARCHER": "Early Career Researcher (PhD candidate, post-graduate)", + "RESEARCH-ADMINISTRATOR": "Research Administrator", + "REPOSITORY-MANAGER": "Repository Manager", + "RESEARCH-INFRASTRUCTURE": "Research Infrastructure", + "SERVICE-PROVIDER": "Service Provider", + "PUBLISHER": "Publisher", + "RESEARCH-FUNDER": "Research Funder", + "POLICY-MAKER": "Policymaker", + "SME-INDUSTRY": "SME/ Industry", + "OTHER": "Other" + }, + "ACTIONS": { + "SAVE": "Save", + "LINK-NEW": "Link new", + "LINK-NEW-ACCOUNT": "Link new account", + "ADD": "Add", + "CANCEL": "Cancel" } }, "DATASET-REFERENCED-MODELS": { diff --git a/dmp-frontend/src/assets/i18n/tr.json b/dmp-frontend/src/assets/i18n/tr.json index 6f6303d11..4a109178e 100644 --- a/dmp-frontend/src/assets/i18n/tr.json +++ b/dmp-frontend/src/assets/i18n/tr.json @@ -280,6 +280,33 @@ "ROLES": "Görev" }, "STEPS": { + "GENERAL-INFO":{ + "TITLE": "General Info", + "DATASET-TEMPLATE-NAME": "Dataset template name", + "DATASET-TEMPLATE-NAME-HINT": "A title that determines the Dataset template.", + "DATASET-TEMPLATE-DESCRIPTION": "Description", + "DATASET-TEMPLATE-DESCRIPTION-HINT": "A brief description of what the Dataset is about, it's scope and objectives.", + "DATASET-TEMPLATE-LANGUAGE": "Dataset template language", + "UNTITLED": "Untitled" + }, + "PAGE-INFO":{ + "PAGE-NAME": "Page Name", + "PAGE-NAME-HINT": "Set a name for the dataset page.", + "PAGE-DESCRIPTION": "Description", + "PAGE-DESCRIPTION-HINT": "Write a brief desciption of what the page is about.", + "ACTIONS":{ + "CREATE-FIRST-PAGE": "Create the first page", + "NOTHING-HERE-HINT": "Nothing here yet.", + "START-CREATING-PAGE-START": "Start by ", + "START-CREATING-PAGE-END": "creating the first page." + } + }, + "SECTION-INFO":{ + "SECTION-NAME": "Section Name", + "SECTION-NAME-HINT": "Set a name for the section.", + "SECTION-DESCRIPTION": "Description", + "SECTION-DESCRIPTION-HINT": "Write a brief desciption of what the section is about." + }, "PAGES": { "TITLE": "Sayfa Tanımı", "PAGE-PREFIX": "Sayfa", @@ -1152,7 +1179,8 @@ "RESEARCHERS": "Araştırmacılar", "ORGANIZATIONS": "Kurumlar", "DATASET-IDENTIFIER": "Veri Seti Tanımlayıcısı", - "CURRENCY": "Değer" + "CURRENCY": "Değer", + "VALIDATION": "Validator" }, "DATASET-PROFILE-COMBO-BOX-TYPE": { "WORD-LIST": "Kelime Listesi", @@ -1169,6 +1197,9 @@ "DATASETS": "Veri Seti Tanımları", "EXTERNAL-SOURCE-HINT": "Dış kaynak(lar) tarafından sağlanan değerlerin listesi" }, + "DATASET-PROFILE-VALIDATOR": { + "ACTION": "Validate" + }, "RECENT-ACTIVITY-ORDER": { "CREATED": "Oluşturulmuş", "LABEL": "Etiket", @@ -1590,4 +1621,4 @@ "FINALIZED": "Tamamlandı", "DELETED": "Deleted" } -} +} \ No newline at end of file