fix(editor): Avoid duplicate empty-state prompt copy (no-changelog) (#31182)

This commit is contained in:
Rob Hough 2026-06-04 09:53:48 +01:00 committed by GitHub
parent 11dfca24d9
commit f484b6331b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 1 deletions

View File

@ -156,6 +156,16 @@ describe('WorkflowsView', () => {
expect(getByText('There are currently no workflows to view')).toBeInTheDocument();
});
it('does not repeat generic prompt in fallback empty state', async () => {
const projectsStore = mockedStore(useProjectsStore);
projectsStore.currentProject = { scopes: ['workflow:create'] } as Project;
const { getAllByText } = renderComponent({ pinia });
await waitAllPromises();
expect(getAllByText('What do you want to build?')).toHaveLength(1);
});
it('for user with create scope', async () => {
const projectsStore = mockedStore(useProjectsStore);
projectsStore.currentProject = { scopes: ['workflow:create'] } as Project;

View File

@ -96,9 +96,11 @@ export function useWorkflowsEmptyState() {
return i18n.baseText('workflows.empty.description.readOnlyEnv');
} else if (!projectPermissions.value.workflow.create) {
return i18n.baseText('workflows.empty.description.noPermission');
} else {
} else if (showRecommendedTemplatesInline.value) {
return i18n.baseText('workflows.empty.description');
}
return '';
});
return {