mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat: Add share button to workflows list (#4681)
* feat: Add share button to workflows list * fix: take empty workflow into account when sharing
This commit is contained in:
@@ -4,7 +4,7 @@ import {
|
||||
PLACEHOLDER_EMPTY_WORKFLOW_ID,
|
||||
START_NODE_TYPE,
|
||||
WEBHOOK_NODE_TYPE,
|
||||
VIEWS,
|
||||
VIEWS, EnterpriseEditionFeature,
|
||||
} from '@/constants';
|
||||
|
||||
import {
|
||||
@@ -65,6 +65,8 @@ import { IWorkflowSettings } from 'n8n-workflow';
|
||||
import { useNDVStore } from '@/stores/ndv';
|
||||
import { useTemplatesStore } from '@/stores/templates';
|
||||
import { useNodeTypesStore } from '@/stores/nodeTypes';
|
||||
import useWorkflowsEEStore from "@/stores/workflows.ee";
|
||||
import {useUsersStore} from "@/stores/users";
|
||||
|
||||
let cachedWorkflowKey: string | null = '';
|
||||
let cachedWorkflow: Workflow | null = null;
|
||||
@@ -83,6 +85,8 @@ export const workflowHelpers = mixins(
|
||||
useRootStore,
|
||||
useTemplatesStore,
|
||||
useWorkflowsStore,
|
||||
useWorkflowsEEStore,
|
||||
useUsersStore,
|
||||
useUIStore,
|
||||
),
|
||||
},
|
||||
@@ -796,6 +800,10 @@ export const workflowHelpers = mixins(
|
||||
this.workflowsStore.addWorkflow(workflowData);
|
||||
this.workflowsStore.setWorkflowHash(workflowData.hash);
|
||||
|
||||
if (this.settingsStore.isEnterpriseFeatureEnabled(EnterpriseEditionFeature.WorkflowSharing) && this.usersStore.currentUser) {
|
||||
this.workflowsEEStore.setWorkflowOwnedBy({ workflowId: workflowData.id, ownedBy: this.usersStore.currentUser });
|
||||
}
|
||||
|
||||
if (openInNewWindow) {
|
||||
const routeData = this.$router.resolve({name: VIEWS.WORKFLOW, params: {name: workflowData.id}});
|
||||
window.open(routeData.href, '_blank');
|
||||
|
||||
Reference in New Issue
Block a user