From 9a524dd67168057c9f931bd03b71a752855b4557 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 11 Mar 2021 10:12:22 +0100 Subject: [PATCH] web: show related edit button for bound stages and policies --- .../elements/policies/BoundPoliciesList.ts | 32 +++++++++++++++++-- web/src/pages/flows/BoundStagesList.ts | 16 +++++----- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/web/src/elements/policies/BoundPoliciesList.ts b/web/src/elements/policies/BoundPoliciesList.ts index c608b5149..0f9f344de 100644 --- a/web/src/elements/policies/BoundPoliciesList.ts +++ b/web/src/elements/policies/BoundPoliciesList.ts @@ -49,6 +49,33 @@ export class BoundPoliciesList extends Table { } } + getObjectEditButton(item: PolicyBinding): TemplateResult { + if (item.policy) { + return html` + + ${gettext("Edit Policy")} + +
+
`; + } else if (item.group) { + return html` + + ${gettext("Edit Group")} + +
+
`; + } else if (item.user) { + return html` + + ${gettext("Edit User")} + +
+
`; + } else { + return html``; + } + } + row(item: PolicyBinding): TemplateResult[] { return [ html`${this.getPolicyUserGroupRow(item)}`, @@ -56,15 +83,16 @@ export class BoundPoliciesList extends Table { html`${item.order}`, html`${item.timeout}`, html` + ${this.getObjectEditButton(item)} - ${gettext("Edit")} + ${gettext("Edit Binding")}
- ${gettext("Delete")} + ${gettext("Delete Binding")}
diff --git a/web/src/pages/flows/BoundStagesList.ts b/web/src/pages/flows/BoundStagesList.ts index 43ad54d52..8aed13881 100644 --- a/web/src/pages/flows/BoundStagesList.ts +++ b/web/src/pages/flows/BoundStagesList.ts @@ -45,21 +45,21 @@ export class BoundStagesList extends Table { html`${item.stageObj?.name}`, html`${item.stageObj?.verboseName}`, html` - - - ${gettext("Edit Binding")} - -
-
${gettext("Edit Stage")}
- + + + ${gettext("Edit Binding")} + +
+
+ - ${gettext("Delete")} + ${gettext("Delete Binding")}