From 7a39ecc4180003b4b5a987bff1685597f5c6d1dc Mon Sep 17 00:00:00 2001 From: OZGCloud <ozgcloud@mgm-tp.com> Date: Tue, 10 Sep 2024 15:35:04 +0200 Subject: [PATCH] OZG-6497 add isResizable as attribute to textarea-editor --- alfa-client/apps/admin/src/styles.scss | 2 -- .../postfach-signatur/postfach-signatur.component.html | 1 + .../postfach-signatur/postfach-signatur.component.theme.scss | 5 ----- .../lib/form/textarea-editor/textarea-editor.component.html | 1 + .../lib/form/textarea-editor/textarea-editor.component.ts | 1 + .../src/lib/form/textarea/textarea.component.ts | 3 ++- 6 files changed, 5 insertions(+), 8 deletions(-) delete mode 100644 alfa-client/libs/admin/settings/src/lib/postfach/postfach-container/postfach-form/postfach-signatur/postfach-signatur.component.theme.scss diff --git a/alfa-client/apps/admin/src/styles.scss b/alfa-client/apps/admin/src/styles.scss index 7b1b58c914..9a4448d0f9 100644 --- a/alfa-client/apps/admin/src/styles.scss +++ b/alfa-client/apps/admin/src/styles.scss @@ -7,8 +7,6 @@ @import 'libs/design-system/src/lib/tailwind-preset/root.css'; @import 'libs/ui/src/lib/font/font_material'; -@import 'libs/admin/settings/src/lib/postfach/postfach-container/postfach-form/postfach-signatur/postfach-signatur.component.theme.scss'; - @include mat.all-component-typographies(); @include mat.core(); diff --git a/alfa-client/libs/admin/settings/src/lib/postfach/postfach-container/postfach-form/postfach-signatur/postfach-signatur.component.html b/alfa-client/libs/admin/settings/src/lib/postfach/postfach-container/postfach-form/postfach-signatur/postfach-signatur.component.html index a69ca6d989..a0d251c9e3 100644 --- a/alfa-client/libs/admin/settings/src/lib/postfach/postfach-container/postfach-form/postfach-signatur/postfach-signatur.component.html +++ b/alfa-client/libs/admin/settings/src/lib/postfach/postfach-container/postfach-form/postfach-signatur/postfach-signatur.component.html @@ -5,6 +5,7 @@ </p> <ods-textarea-editor [formControlName]="formServiceClass.SIGNATUR_FIELD" + [isResizable]="false" data-test-id="signatur-text" label="" rows="6" diff --git a/alfa-client/libs/admin/settings/src/lib/postfach/postfach-container/postfach-form/postfach-signatur/postfach-signatur.component.theme.scss b/alfa-client/libs/admin/settings/src/lib/postfach/postfach-container/postfach-form/postfach-signatur/postfach-signatur.component.theme.scss deleted file mode 100644 index 638f52eb9b..0000000000 --- a/alfa-client/libs/admin/settings/src/lib/postfach/postfach-container/postfach-form/postfach-signatur/postfach-signatur.component.theme.scss +++ /dev/null @@ -1,5 +0,0 @@ -postfach-signatur { - textarea { - resize: none !important; - } -} diff --git a/alfa-client/libs/design-component/src/lib/form/textarea-editor/textarea-editor.component.html b/alfa-client/libs/design-component/src/lib/form/textarea-editor/textarea-editor.component.html index c27f425a3f..baa1596222 100644 --- a/alfa-client/libs/design-component/src/lib/form/textarea-editor/textarea-editor.component.html +++ b/alfa-client/libs/design-component/src/lib/form/textarea-editor/textarea-editor.component.html @@ -7,6 +7,7 @@ [attr.data-test-id]="(label | convertForDataTest) + '-textarea-editor'" [required]="isRequired" [focus]="focus" + [isResizable]="isResizable" > <ods-validation-error error diff --git a/alfa-client/libs/design-component/src/lib/form/textarea-editor/textarea-editor.component.ts b/alfa-client/libs/design-component/src/lib/form/textarea-editor/textarea-editor.component.ts index a47b955192..5dea452149 100644 --- a/alfa-client/libs/design-component/src/lib/form/textarea-editor/textarea-editor.component.ts +++ b/alfa-client/libs/design-component/src/lib/form/textarea-editor/textarea-editor.component.ts @@ -24,6 +24,7 @@ export class TextareaEditorComponent extends FormControlEditorAbstractComponent @Input() rows: number = 10; @Input() isRequired: boolean = false; @Input() focus: boolean = false; + @Input() isResizable: boolean = true; get variant(): string { return this.invalidParams.length > 0 ? 'error' : 'default'; diff --git a/alfa-client/libs/design-system/src/lib/form/textarea/textarea.component.ts b/alfa-client/libs/design-system/src/lib/form/textarea/textarea.component.ts index 2c4340b9f3..5c41855606 100644 --- a/alfa-client/libs/design-system/src/lib/form/textarea/textarea.component.ts +++ b/alfa-client/libs/design-system/src/lib/form/textarea/textarea.component.ts @@ -38,7 +38,7 @@ type TextareaVariants = VariantProps<typeof textareaVariants>; [id]="id" [formControl]="fieldControl" [rows]="rows" - [ngClass]="textareaVariants({ variant })" + [ngClass]="[textareaVariants({ variant }), isResizable ? 'resize' : 'resize-none']" [placeholder]="placeholder" [autocomplete]="autocomplete" [attr.aria-required]="required" @@ -64,6 +64,7 @@ export class TextareaComponent { @Input() variant: TextareaVariants['variant']; @Input() fieldControl: FormControl = new FormControl(EMPTY_STRING); @Input() required: boolean = false; + @Input() isResizable: boolean = true; @Input() set focus(value: boolean) { if (value && this.textAreaElement) { -- GitLab