diff --git a/packages/frontend/editor-ui/src/app/components/MainHeader/WorkflowHeaderDraftPublishActions.test.ts b/packages/frontend/editor-ui/src/app/components/MainHeader/WorkflowHeaderDraftPublishActions.test.ts
index 010907059cd..495396c134b 100644
--- a/packages/frontend/editor-ui/src/app/components/MainHeader/WorkflowHeaderDraftPublishActions.test.ts
+++ b/packages/frontend/editor-ui/src/app/components/MainHeader/WorkflowHeaderDraftPublishActions.test.ts
@@ -140,6 +140,7 @@ describe('WorkflowHeaderDraftPublishActions', () => {
const { queryByTestId } = renderComponent();
+ expect(queryByTestId('workflow-active-version-info')).not.toBeInTheDocument();
expect(queryByTestId('workflow-active-version-indicator')).not.toBeInTheDocument();
});
@@ -148,6 +149,7 @@ describe('WorkflowHeaderDraftPublishActions', () => {
const { getByTestId } = renderComponent();
+ expect(getByTestId('workflow-active-version-info')).toBeInTheDocument();
expect(getByTestId('workflow-active-version-indicator')).toBeInTheDocument();
});
@@ -199,9 +201,27 @@ describe('WorkflowHeaderDraftPublishActions', () => {
},
});
- expect(getByTestId('workflow-active-version-indicator')).toBeInTheDocument();
+ expect(getByTestId('workflow-active-version-info')).toBeInTheDocument();
expect(getByTestId('time-ago-stub')).toHaveTextContent(latestActivationDate);
});
+
+ it('should show active version indicator when user does not have workflow:publish permission but workflow is currently published', () => {
+ workflowsStore.workflow.activeVersion = createMockActiveVersion('active-version-1');
+ const { getByTestId } = renderComponent({
+ props: {
+ ...defaultWorkflowProps,
+ readOnly: false,
+ workflowPermissions: {
+ ...defaultWorkflowProps.workflowPermissions,
+ update: true,
+ publish: false,
+ },
+ },
+ });
+
+ expect(getByTestId('workflow-active-version-indicator')).toBeInTheDocument();
+ expect(getByTestId('workflow-active-version-info')).toBeInTheDocument();
+ });
});
describe('Publish button visibility', () => {
diff --git a/packages/frontend/editor-ui/src/app/components/MainHeader/WorkflowHeaderDraftPublishActions.vue b/packages/frontend/editor-ui/src/app/components/MainHeader/WorkflowHeaderDraftPublishActions.vue
index 478f4e8524a..2b1b7f31af1 100644
--- a/packages/frontend/editor-ui/src/app/components/MainHeader/WorkflowHeaderDraftPublishActions.vue
+++ b/packages/frontend/editor-ui/src/app/components/MainHeader/WorkflowHeaderDraftPublishActions.vue
@@ -150,7 +150,7 @@ const onPublishButtonClick = async () => {
const publishButtonConfig = computed(() => {
// Handle permission-denied state first
if (!props.workflowPermissions.publish) {
- return {
+ const defaultConfigForNoPermission = {
text: i18n.baseText('workflows.publish'),
enabled: false,
showIndicator: false,
@@ -158,6 +158,17 @@ const publishButtonConfig = computed(() => {
tooltip: i18n.baseText('workflows.publish.permissionDenied'),
showVersionInfo: false,
};
+ const isWorkflowPublished = !!workflowsStore.workflow.activeVersion;
+ if (isWorkflowPublished) {
+ return {
+ ...defaultConfigForNoPermission,
+ showIndicator: true,
+ showVersionInfo: true,
+ indicatorClass: 'published',
+ };
+ } else {
+ return defaultConfigForNoPermission;
+ }
}
// Handle new workflow state
@@ -288,7 +299,7 @@ defineExpose({
{{ publishButtonConfig.tooltip }}
- {{ activeVersionName }}{{ activeVersionName }}
{{ i18n.baseText('workflowHistory.item.active') }}