From f6e1ed657125e0f394e80da5dfeb51617304d091 Mon Sep 17 00:00:00 2001 From: Nizamudeen Date: Tue, 14 Apr 2020 12:23:09 +0530 Subject: [PATCH] mgr/dashboard: Custom Directive for verifying if user is read_only This commit introduces two new Custom Directives: `FormInputDisableDirective` and `FormScopeDirective`. By using the `cdFormScope` attribute of the directive we can customize the behaviour of the modal components. Signed-off-by: Nizamudeen --- .../osd-flags-modal.component.html | 3 +- .../osd-pg-scrub-modal.component.html | 3 +- .../osd-recv-speed-modal.component.html | 3 +- .../shared/directives/directives.module.ts | 10 ++- .../form-input-disable.directive.spec.ts | 75 +++++++++++++++++++ .../form-input-disable.directive.ts | 27 +++++++ .../directives/form-scope.directive.spec.ts | 8 ++ .../shared/directives/form-scope.directive.ts | 8 ++ 8 files changed, 132 insertions(+), 5 deletions(-) create mode 100644 src/pybind/mgr/dashboard/frontend/src/app/shared/directives/form-input-disable.directive.spec.ts create mode 100644 src/pybind/mgr/dashboard/frontend/src/app/shared/directives/form-input-disable.directive.ts create mode 100644 src/pybind/mgr/dashboard/frontend/src/app/shared/directives/form-scope.directive.spec.ts create mode 100644 src/pybind/mgr/dashboard/frontend/src/app/shared/directives/form-scope.directive.ts diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-modal/osd-flags-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-modal/osd-flags-modal.component.html index f3094d44501f..f98bc7011de4 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-modal/osd-flags-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-modal/osd-flags-modal.component.html @@ -6,7 +6,8 @@
+ novalidate + cdFormScope="osd">