diff --git a/dmp-frontend/src/app/library/rich-text-editor/rich-text-editor.component.scss b/dmp-frontend/src/app/library/rich-text-editor/rich-text-editor.component.scss index f33c65603..382affcdc 100644 --- a/dmp-frontend/src/app/library/rich-text-editor/rich-text-editor.component.scss +++ b/dmp-frontend/src/app/library/rich-text-editor/rich-text-editor.component.scss @@ -29,12 +29,22 @@ background-color: #fff; } -.editor-wrapper:hover, ::ng-deep .angular-editor:hover { - border: 1px solid #000 !important; +.editor-wrapper :not(.disabled) { + .editor-wrapper:hover, ::ng-deep .angular-editor:hover { + border: 1px solid #000 !important; + } + + .editor-wrapper:focus-within, ::ng-deep .angular-editor:focus-within { + border: 1px solid #034459 !important; + } } -.editor-wrapper:focus-within, ::ng-deep .angular-editor:focus-within { - border: 1px solid #034459 !important; +.editor-wrapper .disabled { + color: rgba(0, 0, 0, 0.38); +} + +.editor-wrapper .disabled ::ng-deep button { + pointer-events: none; } .required.editor-wrapper, .required .editor ::ng-deep .angular-editor { diff --git a/dmp-frontend/src/app/library/rich-text-editor/rich-text-editor.component.ts b/dmp-frontend/src/app/library/rich-text-editor/rich-text-editor.component.ts index 18a325348..ed45c1967 100644 --- a/dmp-frontend/src/app/library/rich-text-editor/rich-text-editor.component.ts +++ b/dmp-frontend/src/app/library/rich-text-editor/rich-text-editor.component.ts @@ -6,7 +6,8 @@ import {FormControl} from "@angular/forms"; selector: 'rich-text-editor-component', template: `
- close
@@ -20,9 +21,10 @@ export class RichTextEditorComponent { @Input() placeholder: string = "Enter text"; @Input() required: boolean = false; @Input() wrapperClasses: string = ""; + @Input() editable: boolean = true; editorConfig: AngularEditorConfig = { - editable: true, + editable: this.editable, spellcheck: true, height: 'auto', minHeight: '0', @@ -58,4 +60,8 @@ export class RichTextEditorComponent { get formInput(): FormControl { return this.parentFormGroup.get(this.controlName); } + + ngAfterContentInit() { + this.editorConfig.editable = this.editable; + } } 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 5bd1bce28..b2c78681a 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 @@ -159,9 +159,10 @@
+ [wrapperClasses]="(form.get('description').touched && form.get('description').hasError('required')) ? 'required' : ''" + [editable]="form.controls['description'].status !== 'DISABLED'"> -
+
{{'GENERAL.VALIDATION.REQUIRED'| translate}} 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 0fc6b11de..04f2482ca 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 @@ -195,9 +195,9 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent // this.isDeleted = this.masterItem.isActive === IsActive.Inactive; this.form = this.dataModel.buildForm(); this.form.get('version').setValue(this.form.get('version').value + 1); - this.form.controls['label'].disable(); - this.form.controls['description'].disable(); - this.form.controls['language'].disable(); + // this.form.controls['label'].disable(); + // this.form.controls['description'].disable(); + // this.form.controls['language'].disable(); this.prepareForm(); } catch (error){ this.logger.error('Could not parse MasterItem: ' + data); diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/listing/dataset-profile-listing.component.html b/dmp-frontend/src/app/ui/admin/dataset-profile/listing/dataset-profile-listing.component.html index d24280f2b..ca7500119 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/listing/dataset-profile-listing.component.html +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/listing/dataset-profile-listing.component.html @@ -41,7 +41,7 @@ {{'DATASET-PROFILE-LISTING.COLUMNS.CREATED' | translate}} - {{row.created | date:'shortDate'}} + {{row.created | date:'short'}} diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.html b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.html index 99b1c968e..a7be0544d 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.html +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component.html @@ -32,9 +32,9 @@ + ((formGroup.get('description').touched && (formGroup.get('description').hasError('required') || formGroup.get('description').hasError('backendError'))) ? 'required' : '')"> -
+
{{formGroup.get('description').getError('backendError').message}} {{'GENERAL.VALIDATION.REQUIRED' | translate}}
diff --git a/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.component.html b/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.component.html index bb17bf957..29e850e27 100644 --- a/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.component.html +++ b/dmp-frontend/src/app/ui/dmp/clone/clone-dialog/clone-dialog.component.html @@ -21,13 +21,14 @@
-
+
{{'DMP-EDITOR.FIELDS.DESCRIPTION' | translate}}
{{'DMP-EDITOR.MAIN-INFO.HINT' | translate}}
-
- - - +
+ +
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; }