mirror of
https://github.com/n8n-io/n8n.git
synced 2026-09-24 23:22:38 +08:00
fix(editor): Keep publish actions menu enabled for published workflows (#29396)
This commit is contained in:
+23
@@ -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';
|
||||
|
||||
+4
@@ -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);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user