feat: Add sharing permissions info for workflow sharees (#4892)

* feat: Add sharing permissions info for workflow sharees

* fix: Remove infotip for owner
This commit is contained in:
Alex Grozav
2022-12-12 14:46:34 +02:00
committed by GitHub
parent 1cce8eaf16
commit c013245db7
5 changed files with 23 additions and 1 deletions

View File

@@ -8,9 +8,20 @@ import {useRootStore} from "@/stores/n8nRootStore";
import {useSettingsStore} from "@/stores/settings";
import {defineStore} from "pinia";
import {useWorkflowsStore} from "@/stores/workflows";
import {i18n} from "@/plugins/i18n";
export const useWorkflowsEEStore = defineStore(STORES.WORKFLOWS_EE, {
state() { return {}; },
getters: {
getWorkflowOwnerName() {
return (workflowId: string): string => {
const workflow = useWorkflowsStore().getWorkflowById(workflowId);
return workflow && workflow.ownedBy && workflow.ownedBy.firstName
? `${workflow.ownedBy.firstName} ${workflow.ownedBy.lastName} (${workflow.ownedBy.email})`
: i18n.baseText('workflows.shareModal.info.sharee.fallback');
};
},
},
actions: {
setWorkflowOwnedBy(payload: { workflowId: string, ownedBy: Partial<IUser> }): void {
const workflowsStore = useWorkflowsStore();

View File

@@ -149,6 +149,9 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
return workflowRunData[nodeName];
};
},
getWorkflowById() {
return (id: string): IWorkflowDb => this.workflowsById[id];
},
// Node getters
allConnections() : IConnections {