From e80a4d27fbb364a9d752153e3ce73a7290b8336a Mon Sep 17 00:00:00 2001 From: mdelez <60604010+mdelez@users.noreply.github.com> Date: Thu, 9 Sep 2021 14:44:35 +0200 Subject: [PATCH] feat: textarea is now provided is the gui-element is a textarea (#529) --- package-lock.json | 9 ++++++--- .../operations/display-edit/display-edit.component.html | 2 +- .../operations/display-edit/display-edit.component.ts | 6 ++++++ .../switch-properties/switch-properties.component.html | 2 +- .../switch-properties/switch-properties.component.ts | 4 ++++ .../text-value-as-string.component.html | 3 ++- .../text-value-as-string.component.ts | 1 + 7 files changed, 21 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 52ad05b3f4..404ef484b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4860,6 +4860,7 @@ "version": "9.0.0", "dev": true, "license": "MIT", + "peer": true, "peerDependencies": { "tslib": "^1.10.0" } @@ -4868,6 +4869,7 @@ "version": "9.0.0", "dev": true, "license": "MIT", + "peer": true, "peerDependencies": { "rxjs": "^6.5.3", "tslib": "^1.10.0", @@ -12237,6 +12239,7 @@ "node_modules/pdfjs-dist": { "version": "2.7.570", "license": "Apache-2.0", + "peer": true, "peerDependencies": { "worker-loader": "^3.0.7" } @@ -21771,8 +21774,6 @@ "version": "6.0.2", "dev": true, "requires": { - "@angular/compiler": "9.0.0", - "@angular/core": "9.0.0", "app-root-path": "^3.0.0", "aria-query": "^3.0.0", "axobject-query": "2.0.2", @@ -21790,11 +21791,13 @@ "@angular/compiler": { "version": "9.0.0", "dev": true, + "peer": true, "requires": {} }, "@angular/core": { "version": "9.0.0", "dev": true, + "peer": true, "requires": {} }, "source-map": { @@ -26046,7 +26049,6 @@ "ng2-pdf-viewer": { "version": "7.0.1", "requires": { - "pdfjs-dist": "~2.7.570", "tslib": "^2.0.0" } }, @@ -26850,6 +26852,7 @@ }, "pdfjs-dist": { "version": "2.7.570", + "peer": true, "requires": {} }, "performance-now": { diff --git a/src/app/workspace/resource/operations/display-edit/display-edit.component.html b/src/app/workspace/resource/operations/display-edit/display-edit.component.html index 4b27beb1b0..df453a66a8 100644 --- a/src/app/workspace/resource/operations/display-edit/display-edit.component.html +++ b/src/app/workspace/resource/operations/display-edit/display-edit.component.html @@ -5,7 +5,7 @@ [ngClass]='backgroundColor'> - + diff --git a/src/app/workspace/resource/operations/display-edit/display-edit.component.ts b/src/app/workspace/resource/operations/display-edit/display-edit.component.ts index ac1b13a15c..0ed7c768ed 100644 --- a/src/app/workspace/resource/operations/display-edit/display-edit.component.ts +++ b/src/app/workspace/resource/operations/display-edit/display-edit.component.ts @@ -108,6 +108,8 @@ export class DisplayEditComponent implements OnInit { showDateLabels = false; + textArea = false; + dateFormat: string; user: ReadUser; @@ -142,6 +144,10 @@ export class DisplayEditComponent implements OnInit { (propDef: ResourcePropertyDefinition) => propDef.id === this.displayValue.property ); + if(resPropDef[0].guiElement === Constants.SalsahGui + Constants.HashDelimiter + 'Textarea') { + this.textArea = true; + } + if (resPropDef.length !== 1) { // this should never happen because we always have the property info for the given value throw new Error('Resource Property Definition could not be found: ' + this.displayValue.property); diff --git a/src/app/workspace/resource/resource-instance-form/select-properties/switch-properties/switch-properties.component.html b/src/app/workspace/resource/resource-instance-form/select-properties/switch-properties/switch-properties.component.html index 96d8e53fb4..2ca0203ba6 100644 --- a/src/app/workspace/resource/resource-instance-form/select-properties/switch-properties/switch-properties.component.html +++ b/src/app/workspace/resource/resource-instance-form/select-properties/switch-properties/switch-properties.component.html @@ -1,5 +1,5 @@ - + diff --git a/src/app/workspace/resource/resource-instance-form/select-properties/switch-properties/switch-properties.component.ts b/src/app/workspace/resource/resource-instance-form/select-properties/switch-properties/switch-properties.component.ts index eb99f75d34..cf961107f6 100644 --- a/src/app/workspace/resource/resource-instance-form/select-properties/switch-properties/switch-properties.component.ts +++ b/src/app/workspace/resource/resource-instance-form/select-properties/switch-properties/switch-properties.component.ts @@ -23,6 +23,7 @@ export class SwitchPropertiesComponent implements OnInit { @Input() isRequiredProp: boolean; mode = 'create'; + textArea = false; constants = Constants; constructor() { } @@ -32,6 +33,9 @@ export class SwitchPropertiesComponent implements OnInit { // the input isRequiredProp provided by KeyValuePair is stored as a number // a conversion from a number to a boolean is required by the input valueRequiredValidator this.isRequiredProp = !!+this.isRequiredProp; + if(this.property.guiElement === Constants.SalsahGui + Constants.HashDelimiter + 'Textarea') { + this.textArea = true; + } } saveNewValue() { diff --git a/src/app/workspace/resource/values/text-value/text-value-as-string/text-value-as-string.component.html b/src/app/workspace/resource/values/text-value/text-value-as-string/text-value-as-string.component.html index ba7cd75e2a..9d357663bd 100644 --- a/src/app/workspace/resource/values/text-value/text-value-as-string/text-value-as-string.component.html +++ b/src/app/workspace/resource/values/text-value/text-value-as-string/text-value-as-string.component.html @@ -5,7 +5,8 @@ - + + New value must be different than the current value. diff --git a/src/app/workspace/resource/values/text-value/text-value-as-string/text-value-as-string.component.ts b/src/app/workspace/resource/values/text-value/text-value-as-string/text-value-as-string.component.ts index 8653b73fe0..c2e3fa7ca6 100644 --- a/src/app/workspace/resource/values/text-value/text-value-as-string/text-value-as-string.component.ts +++ b/src/app/workspace/resource/values/text-value/text-value-as-string/text-value-as-string.component.ts @@ -16,6 +16,7 @@ const resolvedPromise = Promise.resolve(null); export class TextValueAsStringComponent extends BaseValueDirective implements OnInit, OnChanges, OnDestroy { @Input() displayValue?: ReadTextValueAsString; + @Input() textArea?: false; valueFormControl: FormControl; commentFormControl: FormControl;