From 8d717aeb60142adcde8b4dcdfc56cfcddf370b5e Mon Sep 17 00:00:00 2001 From: Phil Renaud Date: Fri, 29 Sep 2023 15:30:51 -0400 Subject: [PATCH] [ui, backport] Access Control CRUD: Make name fields for Policies and Roles required (#18605) (#18626) * Access Control CRUD: Make name fields for Policies and Roles required (#18605) * Removed file since merged with access-control.scss --- 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 ++++++++++++ ui/app/styles/components/policies.scss | 79 ------------------- .../access-control/policies/policy.hbs | 2 +- 8 files changed, 82 insertions(+), 103 deletions(-) delete mode 100644 ui/app/styles/components/policies.scss 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 +