From f1c682920b64525bcb2a9af65adfa7c38f5f9527 Mon Sep 17 00:00:00 2001 From: Angelika Kinas Date: Mon, 28 Oct 2024 16:34:08 +0100 Subject: [PATCH] chore: Refactor, add TODO --- .../form-field-constraints-shortcuts.component.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/feature/editor/src/lib/components/record-form/form-field/form-field-constraints-shortcuts/form-field-constraints-shortcuts.component.ts b/libs/feature/editor/src/lib/components/record-form/form-field/form-field-constraints-shortcuts/form-field-constraints-shortcuts.component.ts index 40d3f5b1e..7669a6d03 100644 --- a/libs/feature/editor/src/lib/components/record-form/form-field/form-field-constraints-shortcuts/form-field-constraints-shortcuts.component.ts +++ b/libs/feature/editor/src/lib/components/record-form/form-field/form-field-constraints-shortcuts/form-field-constraints-shortcuts.component.ts @@ -84,6 +84,10 @@ export class FormFieldConstraintsShortcutsComponent implements OnInit { }) // if constraint of one type is already present in the record, make the button for that type disabled + this.handleConstraintSectionsToDisplay() + } + + handleConstraintSectionsToDisplay() { this.constraintSectionsToDisplay$ = combineLatest([ this.legalConstraints$, this.securityConstraints$, @@ -153,6 +157,7 @@ export class FormFieldConstraintsShortcutsComponent implements OnInit { } else { // if only toggle is turned off, remove the constraint this.editorFacade.updateRecordField('legalConstraints', []) //remove all legal constraints + // TODO: show the constraint sections that are already present in the record } } else if (toggleName === 'toggleKnownConstraint') { this.toggleKnownConstraint = !this.toggleKnownConstraint @@ -167,6 +172,7 @@ export class FormFieldConstraintsShortcutsComponent implements OnInit { } else { // if only toggle is turned off, remove the constraint this.editorFacade.updateRecordField('legalConstraints', []) //remove all legal constraints + // TODO: show the constraint sections that are already present in the record } } }