diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.html b/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.html index 6a99ac575..2aeccc569 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.html +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.html @@ -27,245 +27,247 @@ -
-
-
{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.DESCRIPTION' | translate}}
- - - {{form.get('description').getError('backendError').message}} -
-
-
{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.EXTENDED-DESCRIPTION' | translate}}
- - - {{form.get('extendedDescription').getError('backendError').message}} -
-
- - - {{form.get('additionalInformation').getError('backendError').message}} - -
+ +
+
+
{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.DESCRIPTION' | translate}}
+ + + {{form.get('description').getError('backendError').message}} +
+
+
{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.EXTENDED-DESCRIPTION' | translate}}
+ + + {{form.get('extendedDescription').getError('backendError').message}} +
+
+ + + {{form.get('additionalInformation').getError('backendError').message}} + +
-
- - - {{form.get('multiplicity').get('min').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - - - - {{form.get('multiplicity').get('max').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - -
-
- - - {{form.get('placeholder').get('multiplicity').getError('backendError').message}} - -
-
- - {{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.MULTIPLICITY-TABLEVIEW' | translate}} - {{form.get('multiplicity').get('tableView').getError('backendError').message}} - -
-
- - - -
- - -
-
- -
-
    -
  • - keyboard_arrow_up -
  • -
  • - keyboard_arrow_down -
  • -
-
-
-
+
+ + + {{form.get('multiplicity').get('min').getError('backendError').message}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + + + + {{form.get('multiplicity').get('max').getError('backendError').message}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
+
+ + + {{form.get('placeholder').get('multiplicity').getError('backendError').message}} + +
+
+ + {{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.MULTIPLICITY-TABLEVIEW' | translate}} + {{form.get('multiplicity').get('tableView').getError('backendError').message}} +
- -
-
-
-
-
-
- {{'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.FIELD.PREVIEW' | translate}} -
-
- - - {{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD.STATUS.PREVIEW-UPDATED' | translate}} - - - {{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD.STATUS.CALCULATING-PREVIEW' | translate}} - - -
+ +
+ + +
+
+ +
+
    +
  • + keyboard_arrow_up +
  • +
  • + keyboard_arrow_down +
  • +
-
-
- + +
+
+
+ + + +
+
+
+
+
+
+ {{'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.FIELD.PREVIEW' | translate}} +
+
+ + + {{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD.STATUS.PREVIEW-UPDATED' | translate}} + + + {{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD.STATUS.CALCULATING-PREVIEW' | translate}} + + +
+
+
+
+ +
+ + +
+ + {{'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.FIELD.NOT-INITIALIZED' | translate}} + +
+
- - -
- - {{'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.FIELD.NOT-INITIALIZED' | translate}} - +
+
-
-
-
-
-
- -
-
-
    -
  • + +
    +
    +
      +
    • - - 'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.FIELDSET.ADD-INPUT' | translate - {{'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.FIELDSET.ADD-INPUT' | translate}} - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - -
    • + + -
    • - {{'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.FIELDSET.COMMENT-FIELD' | translate}} - {{form.get('hasCommentField').getError('backendError').message}} -
    • -
    • - - {{'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.FIELDSET.MULTIPLICITY' | translate}} - -
    • -
    • - more_vert - - - {{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.DESCRIPTION' | translate}} - {{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.EXTENDED-DESCRIPTION' | translate}} - {{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.ADDITIONAL-INFORMATION' | translate}} - -
    • -
    +
  • + {{'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.FIELDSET.COMMENT-FIELD' | translate}} + {{form.get('hasCommentField').getError('backendError').message}} +
  • +
  • + + {{'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.FIELDSET.MULTIPLICITY' | translate}} + +
  • +
  • + more_vert + + + {{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.DESCRIPTION' | translate}} + {{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.EXTENDED-DESCRIPTION' | translate}} + {{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.ADDITIONAL-INFORMATION' | translate}} + +
  • +
+
-
+
diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.ts b/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.ts index 73c0bc6d0..f4f777d95 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.ts @@ -50,6 +50,7 @@ export class DescriptionTemplateEditorCompositeFieldComponent extends BaseCompon @Input() numbering: string; @Input() hasFocus: boolean = false; + @Input() reorderingMode: boolean = false; @ViewChild("inputs") inputs: TransitionGroupComponent; @Input() validationErrorModel: ValidationErrorModel; @Input() validationRootPath: string; @@ -483,9 +484,6 @@ export class DescriptionTemplateEditorCompositeFieldComponent extends BaseCompon } - - - addNewInput(type: DescriptionTemplateFieldType) { const fieldsArray = this.form.get('fields') as UntypedFormArray; diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/components/section-fieldset/description-template-editor-section-fieldset.component.html b/dmp-frontend/src/app/ui/admin/description-template/editor/components/section-fieldset/description-template-editor-section-fieldset.component.html index 84d5723b6..c3053d3de 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/components/section-fieldset/description-template-editor-section-fieldset.component.html +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/components/section-fieldset/description-template-editor-section-fieldset.component.html @@ -49,18 +49,18 @@
-
+
- + drag_indicator -
+
  • +
    + unfold_more + {{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.TOOLKIT.REORDER-QUESTION' | + translate}} +
    +
  • +
  • +
    + unfold_more + {{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.TOOLKIT.EXIT-REORDERING-MODE' | + translate}} +
    +
  • diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/components/section-fieldset/description-template-editor-section-fieldset.component.ts b/dmp-frontend/src/app/ui/admin/description-template/editor/components/section-fieldset/description-template-editor-section-fieldset.component.ts index f00c1c8e6..87f828289 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/components/section-fieldset/description-template-editor-section-fieldset.component.ts +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/components/section-fieldset/description-template-editor-section-fieldset.component.ts @@ -33,6 +33,7 @@ export class DescriptionTemplateEditorSectionFieldSetComponent implements OnInit idprefix = "id"; + reorderingMode = false; readonly dragula_prefix = "dragulaid"; private subs = new Subscription(); private FIELDSETS = 'FIELDSETS'; @@ -228,6 +229,16 @@ export class DescriptionTemplateEditorSectionFieldSetComponent implements OnInit }, 200); } + enableReordering(): void { + this.reorderingMode = true; + this.scroller.next(this.selectedFieldSetId); + } + + exitReordering(): void { + this.reorderingMode = false; + this.scroller.next(this.selectedFieldSetId); + } + private _findTocEntryById(id: string, tocentries: ToCEntry[]): ToCEntry { if (!tocentries) { return null; diff --git a/dmp-frontend/src/app/ui/description/listing/description-listing.component.ts b/dmp-frontend/src/app/ui/description/listing/description-listing.component.ts index 66ac171a7..edbc8ff2c 100644 --- a/dmp-frontend/src/app/ui/description/listing/description-listing.component.ts +++ b/dmp-frontend/src/app/ui/description/listing/description-listing.component.ts @@ -332,7 +332,6 @@ export class DescriptionListingComponent extends BaseComponent implements OnInit public restartTour(): void { this.setDashboardTourDmpText(); - console.log('lalala'); this.setDashboardTourDescriptionText(); console.log(this.dashboardTour); this.guidedTourService.startTour(this.dashboardTour); diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index 1ef318a07..3637858f8 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -557,7 +557,9 @@ "GENERAL-TOOLS": "Questions tools", "NEW-INPUT-SET": "Add Question", "CLONE": "Clone", - "DELETE": "Delete" + "DELETE": "Delete", + "REORDER-QUESTION": "Reorder", + "EXIT-REORDERING-MODE": "I am done reordering" } }, "ACTIONS": {