remove bind flow if the flow is already bound (#2874)

fixes: #2764
This commit is contained in:
Erik Jan de Wit 2022-06-27 09:13:43 +02:00 committed by GitHub
parent 2d39e2cc4f
commit f6a4b8ab27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -228,8 +228,7 @@ export default function AuthenticationSection() {
</Button> </Button>
</ToolbarItem> </ToolbarItem>
} }
actionResolver={({ data }) => { actionResolver={({ data }) => [
const defaultActions = [
{ {
title: t("duplicate"), title: t("duplicate"),
onClick: () => { onClick: () => {
@ -237,7 +236,8 @@ export default function AuthenticationSection() {
setSelectedFlow(data); setSelectedFlow(data);
}, },
}, },
...(data.providerId !== "client-flow" ...(data.usedBy.type !== "default" &&
data.providerId !== "client-flow"
? [ ? [
{ {
title: t("bindFlow"), title: t("bindFlow"),
@ -248,12 +248,8 @@ export default function AuthenticationSection() {
}, },
] ]
: []), : []),
]; ...(!data.builtIn && data.usedBy.values.length === 0
// remove delete when it's in use or default flow ? [
if (data.builtIn || data.usedBy.values.length > 0) {
return defaultActions;
} else {
return [
{ {
title: t("common:delete"), title: t("common:delete"),
onClick: () => { onClick: () => {
@ -261,10 +257,9 @@ export default function AuthenticationSection() {
toggleDeleteDialog(); toggleDeleteDialog();
}, },
}, },
...defaultActions, ]
]; : []),
} ]}
}}
columns={[ columns={[
{ {
name: "alias", name: "alias",