mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +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:
@@ -59,7 +59,7 @@
|
||||
<script lang="ts">
|
||||
import mixins from 'vue-typed-mixins';
|
||||
import {IWorkflowDb, IUser, ITag} from "@/Interface";
|
||||
import {DUPLICATE_MODAL_KEY, EnterpriseEditionFeature, VIEWS} from '@/constants';
|
||||
import {DUPLICATE_MODAL_KEY, EnterpriseEditionFeature, VIEWS, WORKFLOW_SHARE_MODAL_KEY} from '@/constants';
|
||||
import {showMessage} from "@/components/mixins/showMessage";
|
||||
import {getWorkflowPermissions, IPermissions} from "@/permissions";
|
||||
import dateformat from "dateformat";
|
||||
@@ -74,6 +74,7 @@ import { useWorkflowsStore } from '@/stores/workflows';
|
||||
|
||||
export const WORKFLOW_LIST_ITEM_ACTIONS = {
|
||||
OPEN: 'open',
|
||||
SHARE: 'share',
|
||||
DUPLICATE: 'duplicate',
|
||||
DELETE: 'delete',
|
||||
};
|
||||
@@ -131,6 +132,10 @@ export default mixins(
|
||||
label: this.$locale.baseText('workflows.item.open'),
|
||||
value: WORKFLOW_LIST_ITEM_ACTIONS.OPEN,
|
||||
},
|
||||
{
|
||||
label: this.$locale.baseText('workflows.item.share'),
|
||||
value: WORKFLOW_LIST_ITEM_ACTIONS.SHARE,
|
||||
},
|
||||
{
|
||||
label: this.$locale.baseText('workflows.item.duplicate'),
|
||||
value: WORKFLOW_LIST_ITEM_ACTIONS.DUPLICATE,
|
||||
@@ -183,6 +188,8 @@ export default mixins(
|
||||
tags: (this.data.tags || []).map((tag: ITag) => tag.id),
|
||||
},
|
||||
});
|
||||
} else if (action === WORKFLOW_LIST_ITEM_ACTIONS.SHARE) {
|
||||
this.uiStore.openModalWithData({ name: WORKFLOW_SHARE_MODAL_KEY, data: { id: this.data.id } });
|
||||
} else if (action === WORKFLOW_LIST_ITEM_ACTIONS.DELETE) {
|
||||
const deleteConfirmed = await this.confirmMessage(
|
||||
this.$locale.baseText(
|
||||
|
||||
Reference in New Issue
Block a user