Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(editor): Remove @n8n/permissions from n8n-workflow (no-changelog) #10399

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/editor-ui/src/Interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,11 @@ export interface IExecutionResponse extends IExecutionBase {
executedNode?: string;
}

export type ExecutionSummaryWithScopes = ExecutionSummary & { scopes: Scope[] };

export interface IExecutionsListResponse {
count: number;
results: ExecutionSummary[];
results: ExecutionSummaryWithScopes[];
estimated: boolean;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useToast } from '@/composables/useToast';
import { useMessage } from '@/composables/useMessage';
import { useI18n } from '@/composables/useI18n';
import { useTelemetry } from '@/composables/useTelemetry';
import type { ExecutionFilterType, IWorkflowDb } from '@/Interface';
import type { ExecutionFilterType, ExecutionSummaryWithScopes, IWorkflowDb } from '@/Interface';
import type { ExecutionSummary } from 'n8n-workflow';
import { useWorkflowsStore } from '@/stores/workflows.store';
import { useExecutionsStore } from '@/stores/executions.store';
Expand All @@ -16,7 +16,7 @@ import { getResourcePermissions } from '@/permissions';

const props = withDefaults(
defineProps<{
executions: ExecutionSummary[];
executions: ExecutionSummaryWithScopes[];
filters: ExecutionFilterType;
total: number;
estimated: boolean;
Expand Down Expand Up @@ -165,7 +165,7 @@ function getExecutionWorkflowName(execution: ExecutionSummary): string {
}

function getExecutionWorkflowPermissions(
execution: ExecutionSummary,
execution: ExecutionSummaryWithScopes,
): PermissionsRecord['workflow'] {
return getResourcePermissions(execution.scopes).workflow;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { i18nInstance, I18nPlugin } from '@/plugins/i18n';
import { FontAwesomePlugin } from '@/plugins/icons';
import { GlobalComponentsPlugin } from '@/plugins/components';
import { useWorkflowsStore } from '@/stores/workflows.store';
import type { IWorkflowDb } from '@/Interface';
import type { ExecutionSummaryWithScopes, IWorkflowDb } from '@/Interface';

let pinia: ReturnType<typeof createPinia>;

Expand Down Expand Up @@ -49,7 +49,7 @@ const generateUndefinedNullOrString = () => {
}
};

const executionDataFactory = (): ExecutionSummary => ({
const executionDataFactory = (): ExecutionSummaryWithScopes => ({
id: faker.string.uuid(),
finished: faker.datatype.boolean(),
mode: faker.helpers.arrayElement(['manual', 'trigger']),
Expand Down
9 changes: 5 additions & 4 deletions packages/editor-ui/src/stores/executions.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { IDataObject, ExecutionSummary } from 'n8n-workflow';
import type {
ExecutionFilterType,
ExecutionsQueryFilter,
ExecutionSummaryWithScopes,
IExecutionDeleteFilter,
IExecutionFlattedResponse,
IExecutionResponse,
Expand Down Expand Up @@ -34,7 +35,7 @@ export const useExecutionsStore = defineStore('executions', () => {
const autoRefreshTimeout = ref<NodeJS.Timeout | null>(null);
const autoRefreshDelay = ref(4 * 1000); // Refresh data every 4 secs

const executionsById = ref<Record<string, ExecutionSummary>>({});
const executionsById = ref<Record<string, ExecutionSummaryWithScopes>>({});
const executionsCount = ref(0);
const executionsCountEstimated = ref(false);
const executions = computed(() => {
Expand All @@ -57,7 +58,7 @@ export const useExecutionsStore = defineStore('executions', () => {
}, {}),
);

const currentExecutionsById = ref<Record<string, ExecutionSummary>>({});
const currentExecutionsById = ref<Record<string, ExecutionSummaryWithScopes>>({});
const currentExecutions = computed(() => {
const data = Object.values(currentExecutionsById.value);

Expand All @@ -80,14 +81,14 @@ export const useExecutionsStore = defineStore('executions', () => {

const allExecutions = computed(() => [...currentExecutions.value, ...executions.value]);

function addExecution(execution: ExecutionSummary) {
function addExecution(execution: ExecutionSummaryWithScopes) {
executionsById.value[execution.id] = {
...execution,
mode: execution.mode,
};
}

function addCurrentExecution(execution: ExecutionSummary) {
function addCurrentExecution(execution: ExecutionSummaryWithScopes) {
currentExecutionsById.value[execution.id] = {
...execution,
mode: execution.mode,
Expand Down
1 change: 0 additions & 1 deletion packages/workflow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"@types/xml2js": "catalog:"
},
"dependencies": {
"@n8n/permissions": "workspace:*",
"@n8n/tournament": "1.0.5",
"@n8n_io/riot-tmpl": "4.0.0",
"ast-types": "0.15.2",
Expand Down
2 changes: 0 additions & 2 deletions packages/workflow/src/Interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import type { URLSearchParams } from 'url';
import type { RequestBodyMatcher } from 'nock';
import type { Client as SSHClient } from 'ssh2';

import type { Scope } from '@n8n/permissions';
import type { AuthenticationMethod } from './Authentication';
import type { CODE_EXECUTION_MODES, CODE_LANGUAGES, LOG_LEVELS } from './Constants';
import type { IDeferredPromise } from './DeferredPromise';
Expand Down Expand Up @@ -2464,7 +2463,6 @@ export interface ExecutionSummary {
nodeExecutionStatus?: {
[key: string]: IExecutionSummaryNodeExecutionResult;
};
scopes?: Scope[];
}

export interface IExecutionSummaryNodeExecutionResult {
Expand Down
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading