From b68ede8cd7df3f4595386d2989431cc6f6eb2ccb Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Mon, 28 Feb 2022 18:08:38 +0200 Subject: [PATCH] #7518 & #7519: [Bug fix] in Required indication in Rich Text Area fields & editable general info on dataset template new version & date with time shown in dataset templates. 1. rich-text-editor.component.scss: Css for .editor-wrapper .disabled added. 2. rich-text-editor.component.ts: New "editable" Input() field added, to allow rich text area to be disabled and not editable. 3. dataset-profile-editor.component.html: a. In set [editable]="form.controls['description'].status !== 'DISABLED'" b. #7518 Show required message and css in rich text area when there is error "required" and description is touched (not dirty) 4. dataset-profile-editor.component.ts: #7519 comment disable of form controls label (title), description and language. 5. dataset-profile-listing.component.html: #7519 Time added in created column of dataset templates. 6. dataset-editor.component.html & form-field.component.html: #7518 Show required message and css in rich text area when there is error "required" and description is touched (not dirty). 7. clone-dialog.component.html: Replaced - +
+ +
diff --git a/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.component.ts b/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.component.ts index 9386b4d9e..8acb8f9eb 100644 --- a/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.component.ts +++ b/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.component.ts @@ -45,7 +45,7 @@ export class CloneDialogComponent extends BaseComponent { }; if (this.data.isNewVersion) { - this.data.formGroup.get('label').disable(); + // this.data.formGroup.get('label').disable(); } } diff --git a/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.module.ts b/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.module.ts index f841d8434..e2945082b 100644 --- a/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.module.ts +++ b/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.module.ts @@ -3,9 +3,10 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { CommonUiModule } from '@common/ui/common-ui.module'; import { CloneDialogComponent } from './clone-dialog.component'; import { AutoCompleteModule } from '@app/library/auto-complete/auto-complete.module'; +import {RichTextEditorModule} from "@app/library/rich-text-editor/rich-text-editor.module"; @NgModule({ - imports: [CommonUiModule, FormsModule, ReactiveFormsModule, AutoCompleteModule], + imports: [CommonUiModule, FormsModule, ReactiveFormsModule, AutoCompleteModule, RichTextEditorModule], declarations: [CloneDialogComponent], exports: [CloneDialogComponent], entryComponents: [CloneDialogComponent] diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.html b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.html index 6ef4d7f81..7eeb85810 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.html +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.html @@ -114,10 +114,12 @@ [placeholder]="form.get('data').value.label" [required]="form.get('validationRequired').value" [wrapperClasses]="'full-width editor ' + - ((form.get('validationRequired').value) ? 'required' : '')"> + ((form.get('validationRequired').value && form.get('value').touched && form.get('value').hasError('required')) ? 'required' : '')">
-
- {{'GENERAL.VALIDATION.REQUIRED' | translate}} +
+
+ {{'GENERAL.VALIDATION.REQUIRED' | translate}} +
diff --git a/dmp-frontend/src/styles.scss b/dmp-frontend/src/styles.scss index 4d24d173e..2c1749736 100644 --- a/dmp-frontend/src/styles.scss +++ b/dmp-frontend/src/styles.scss @@ -255,8 +255,9 @@ // CSS for (@kolkov/angular-editor) .form-field-subscript-wrapper { - font-size: 75%; - padding-left: 12px; + font-size: 75% !important; + //padding-left: 12px; + padding: 0 1em; margin-top: 8px; }