From a6c6f22221013fa42c85826ff9352a83720820f6 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 11 May 2021 13:52:47 +0200 Subject: [PATCH] web/admin: add button to copy saml metadata download link closes #857 Signed-off-by: Jens Langhammer --- web/src/elements/buttons/ActionButton.ts | 5 ----- web/src/pages/providers/saml/SAMLProviderViewPage.ts | 10 ++++++++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/web/src/elements/buttons/ActionButton.ts b/web/src/elements/buttons/ActionButton.ts index ded130b77..80d440ffd 100644 --- a/web/src/elements/buttons/ActionButton.ts +++ b/web/src/elements/buttons/ActionButton.ts @@ -5,11 +5,6 @@ import { MessageLevel } from "../messages/Message"; @customElement("ak-action-button") export class ActionButton extends SpinnerButton { - @property() - url = ""; - - @property() - method = "POST"; @property({attribute: false}) // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/web/src/pages/providers/saml/SAMLProviderViewPage.ts b/web/src/pages/providers/saml/SAMLProviderViewPage.ts index 62f5ed8bc..4195999eb 100644 --- a/web/src/pages/providers/saml/SAMLProviderViewPage.ts +++ b/web/src/pages/providers/saml/SAMLProviderViewPage.ts @@ -14,6 +14,7 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import PFButton from "@patternfly/patternfly/components/Button/button.css"; import "../../../elements/buttons/ModalButton"; +import "../../../elements/buttons/ActionButton"; import "../../../elements/buttons/SpinnerButton"; import "../../../elements/CodeMirror"; import "../../../elements/Tabs"; @@ -159,6 +160,15 @@ export class SAMLProviderViewPage extends LitElement { href="/api/v2beta/providers/saml/${this.provider.pk}/metadata/?download"> ${t`Download`} + { + const path = `/api/v2beta/providers/saml/${this.provider?.pk}/metadata/?download`; + const fullUrl = window.location.origin + path; + return navigator.clipboard.writeText(fullUrl); + }}> + ${t`Copy download URL`} +