From 7979a444bf2d6d0053f84e73e1280ea6595c6a99 Mon Sep 17 00:00:00 2001 From: Phil Renaud Date: Fri, 29 Sep 2023 12:33:03 -0400 Subject: [PATCH] Access Control CRUD: Make name fields for Policies and Roles required (#18605) --- ui/app/components/policy-editor.hbs | 23 ++++---- ui/app/components/policy-editor.js | 4 ++ ui/app/components/role-editor.hbs | 15 +++--- ui/app/components/role-editor.js | 9 ++++ ui/app/styles/components.scss | 1 - ui/app/styles/components/access-control.scss | 52 +++++++++++++++++++ .../access-control/policies/policy.hbs | 2 +- 7 files changed, 82 insertions(+), 24 deletions(-) diff --git a/ui/app/components/policy-editor.hbs b/ui/app/components/policy-editor.hbs index 6d0b52804b2..606a148edf0 100644 --- a/ui/app/components/policy-editor.hbs +++ b/ui/app/components/policy-editor.hbs @@ -3,20 +3,17 @@ SPDX-License-Identifier: MPL-2.0 ~}} -
+ {{#if @policy.isNew }} - + + Policy Name + {{/if}}
diff --git a/ui/app/components/policy-editor.js b/ui/app/components/policy-editor.js index 0fcbb09092c..9029efbfbfd 100644 --- a/ui/app/components/policy-editor.js +++ b/ui/app/components/policy-editor.js @@ -19,6 +19,10 @@ export default class PolicyEditorComponent extends Component { this.policy.set('rules', value); } + @action updatePolicyName({ target: { value } }) { + this.policy.set('name', value); + } + @action async save(e) { if (e instanceof Event) { e.preventDefault(); // code-mirror "command+enter" submits the form, but doesnt have a preventDefault() diff --git a/ui/app/components/role-editor.hbs b/ui/app/components/role-editor.hbs index e34eb5ecaed..4eb18c126b3 100644 --- a/ui/app/components/role-editor.hbs +++ b/ui/app/components/role-editor.hbs @@ -4,18 +4,15 @@ ~}} - + as |F|> + Role Name +