mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix(editor): Only show push to git menu item to owners (#7766)
Removes the menu entry of "Push to Git" from the workflow menu for non-owners, since they would not be able to push in the first place.
This commit is contained in:
committed by
GitHub
parent
ff0b6511f7
commit
0d3d33dd1f
@@ -4,6 +4,8 @@ import {
|
||||
META_KEY,
|
||||
SCHEDULE_TRIGGER_NODE_NAME,
|
||||
EDIT_FIELDS_SET_NODE_NAME,
|
||||
INSTANCE_MEMBERS,
|
||||
INSTANCE_OWNER,
|
||||
} from '../constants';
|
||||
import { WorkflowPage as WorkflowPageClass } from '../pages/workflow';
|
||||
import { WorkflowsPage as WorkflowsPageClass } from '../pages/workflows';
|
||||
@@ -276,3 +278,19 @@ describe('Workflow Actions', () => {
|
||||
WorkflowPage.getters.nodeCreatorSearchBar().should('be.visible');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Menu entry Push To Git', () => {
|
||||
it('should not show up in the menu for members', () => {
|
||||
cy.signin(INSTANCE_MEMBERS[0]);
|
||||
cy.visit(WorkflowPages.url);
|
||||
WorkflowPage.actions.visit();
|
||||
WorkflowPage.getters.workflowMenuItemGitPush().should('not.exist');
|
||||
});
|
||||
|
||||
it('should show up for owners', () => {
|
||||
cy.signin(INSTANCE_OWNER);
|
||||
cy.visit(WorkflowPages.url);
|
||||
WorkflowPage.actions.visit();
|
||||
WorkflowPage.getters.workflowMenuItemGitPush().should('exist');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -71,6 +71,7 @@ export class WorkflowPage extends BasePage {
|
||||
workflowMenuItemImportFromFile: () => cy.getByTestId('workflow-menu-item-import-from-file'),
|
||||
workflowMenuItemSettings: () => cy.getByTestId('workflow-menu-item-settings'),
|
||||
workflowMenuItemDelete: () => cy.getByTestId('workflow-menu-item-delete'),
|
||||
workflowMenuItemGitPush: () => cy.getByTestId('workflow-menu-item-push'),
|
||||
// Workflow settings dialog elements
|
||||
workflowSettingsModal: () => cy.getByTestId('workflow-settings-dialog'),
|
||||
workflowSettingsErrorWorkflowSelect: () => cy.getByTestId('workflow-settings-error-workflow'),
|
||||
|
||||
Reference in New Issue
Block a user