fix(editor): Keep publish actions menu enabled for published workflows (#29396)

This commit is contained in:
Rob Hough
2026-04-28 13:56:35 +00:00
committed by GitHub
parent 39154b9037
commit c65fa28e1c
2 changed files with 27 additions and 0 deletions
@@ -508,6 +508,29 @@ describe('WorkflowHeaderDraftPublishActions', () => {
expect(getByTestId('version-menu-button')).not.toBeDisabled();
});
it('should keep the version menu enabled when workflow is published with no changes and unpublish is unavailable', () => {
workflowsStore.workflowTriggerNodes = [triggerNode];
workflowsStore.workflow.versionId = 'version-1';
workflowDocumentStore.setActiveState({
activeVersionId: 'version-1',
activeVersion: createMockActiveVersion('version-1'),
});
uiStore.markStateClean();
const { getByTestId } = renderComponent({
props: {
...defaultWorkflowProps,
workflowPermissions: {
...defaultWorkflowProps.workflowPermissions,
unpublish: false,
},
},
});
expect(getByTestId('workflow-open-publish-modal-button')).toBeDisabled();
expect(getByTestId('version-menu-button')).not.toBeDisabled();
});
it('should show publish button enabled when workflow has never been published (no active version)', () => {
workflowsStore.workflowTriggerNodes = [triggerNode];
workflowsStore.workflow.versionId = 'version-1';
@@ -359,6 +359,10 @@ const versionMenuActions = computed<Array<ActionDropdownItem<VERSION_ACTIONS>>>(
});
const shouldDisableActionDropdown = computed(() => {
if (activeVersion.value) {
return false;
}
return versionMenuActions.value.every((action) => action.disabled);
});