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:
@@ -120,14 +120,23 @@ export default mixins(
|
||||
components: {
|
||||
Modal,
|
||||
},
|
||||
props: {
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
data() {
|
||||
const workflowsStore = useWorkflowsStore();
|
||||
const workflow = this.data.id === PLACEHOLDER_EMPTY_WORKFLOW_ID
|
||||
? workflowsStore.workflow
|
||||
: workflowsStore.workflowsById[this.data.id];
|
||||
|
||||
return {
|
||||
WORKFLOW_SHARE_MODAL_KEY,
|
||||
loading: false,
|
||||
modalBus: new Vue(),
|
||||
sharedWith: [...(workflowsStore.workflow.sharedWith || [])] as Array<Partial<IUser>>,
|
||||
sharedWith: [...(workflow.sharedWith || [])] as Array<Partial<IUser>>,
|
||||
EnterpriseEditionFeature,
|
||||
};
|
||||
},
|
||||
@@ -150,7 +159,9 @@ export default mixins(
|
||||
] as Array<Partial<IUser>>).concat(this.sharedWith || []);
|
||||
},
|
||||
workflow(): IWorkflowDb {
|
||||
return this.workflowsStore.workflow;
|
||||
return this.data.id === PLACEHOLDER_EMPTY_WORKFLOW_ID
|
||||
? this.workflowsStore.workflow
|
||||
: this.workflowsStore.workflowsById[this.data.id];
|
||||
},
|
||||
currentUser(): IUser | null {
|
||||
return this.usersStore.currentUser;
|
||||
@@ -221,7 +232,7 @@ export default mixins(
|
||||
}
|
||||
|
||||
if (confirm) {
|
||||
this.sharedWith = this.sharedWith.filter((sharee: IUser) => {
|
||||
this.sharedWith = this.sharedWith.filter((sharee: Partial<IUser>) => {
|
||||
return sharee.id !== user.id;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user