fix moving of sub flows (#25462)
fixes: #25263 Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
This commit is contained in:
parent
e01827693a
commit
e6b230e31b
1 changed files with 40 additions and 16 deletions
|
@ -98,7 +98,7 @@ export default function FlowDetails() {
|
|||
);
|
||||
|
||||
const executeChange = async (
|
||||
ex: AuthenticationFlowRepresentation,
|
||||
ex: AuthenticationFlowRepresentation | ExpandableExecution,
|
||||
change: LevelChange | IndexChange,
|
||||
) => {
|
||||
try {
|
||||
|
@ -111,7 +111,30 @@ export default function FlowDetails() {
|
|||
});
|
||||
}
|
||||
|
||||
try {
|
||||
await adminClient.authenticationManagement.delExecution({ id });
|
||||
} catch {
|
||||
// skipping already deleted execution
|
||||
}
|
||||
if ("authenticationFlow" in ex) {
|
||||
const executionFlow = ex as ExpandableExecution;
|
||||
const result =
|
||||
await adminClient.authenticationManagement.addFlowToFlow({
|
||||
flow: change.parent?.displayName! || flow?.alias!,
|
||||
alias: executionFlow.displayName!,
|
||||
description: executionFlow.description!,
|
||||
provider: ex.providerId!,
|
||||
type: "basic-flow",
|
||||
});
|
||||
id = result.id!;
|
||||
ex.executionList?.forEach((e, i) =>
|
||||
executeChange(e, {
|
||||
parent: { ...ex, id: result.id },
|
||||
newIndex: i,
|
||||
oldIndex: i,
|
||||
}),
|
||||
);
|
||||
} else {
|
||||
const result =
|
||||
await adminClient.authenticationManagement.addExecutionToFlow({
|
||||
flow: change.parent?.displayName! || flow?.alias!,
|
||||
|
@ -129,6 +152,7 @@ export default function FlowDetails() {
|
|||
|
||||
id = result.id!;
|
||||
}
|
||||
}
|
||||
const times = change.newIndex - change.oldIndex;
|
||||
for (let index = 0; index < Math.abs(times); index++) {
|
||||
if (times > 0) {
|
||||
|
|
Loading…
Reference in a new issue