Skip to content

Commit

Permalink
Fix workflow start disabled check (#2176)
Browse files Browse the repository at this point in the history
* Fix boolean check

* Add if statement to workflow-actions
  • Loading branch information
Alex-Tideman authored Jul 1, 2024
1 parent 7a28811 commit c20600f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
32 changes: 17 additions & 15 deletions src/lib/components/workflow-actions.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -141,21 +141,23 @@
</MenuItem>
</Tooltip>
{/each}
<MenuDivider />
<MenuItem
on:click={() =>
goto(
routeForWorkflowStart({
namespace,
workflowId: workflow.id,
taskQueue: workflow.taskQueue,
workflowType: workflow.name,
}),
)}
data-testid="start-workflow-button"
>
{translate('workflows.start-workflow-like-this-one')}
</MenuItem>
{#if !workflowCreateDisabled($page)}
<MenuDivider />
<MenuItem
on:click={() =>
goto(
routeForWorkflowStart({
namespace,
workflowId: workflow.id,
taskQueue: workflow.taskQueue,
workflowType: workflow.name,
}),
)}
data-testid="start-workflow-button"
>
{translate('workflows.start-workflow-like-this-one')}
</MenuItem>
{/if}
</SplitButton>
{:else if !workflowCreateDisabled($page)}
<SplitButton
Expand Down
4 changes: 3 additions & 1 deletion src/lib/utilities/workflow-create-disabled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ export const workflowCreateDisabled = (
const namespaceWriteDisabled = get(coreUser).namespaceWriteDisabled(
namespace ?? page.params.namespace,
);
return page.data.settings.startWorkflowDisabled || namespaceWriteDisabled;
if (page.data.settings.startWorkflowDisabled) return true;

return namespaceWriteDisabled;
};

0 comments on commit c20600f

Please sign in to comment.