From b2c17034c2118788e346cd8da299bb9d9d3147d7 Mon Sep 17 00:00:00 2001 From: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com> Date: Fri, 17 May 2024 13:58:26 +0200 Subject: [PATCH] refactor: Fix Enteprise type errors (#9442) --- packages/editor-ui/src/Interface.ts | 17 ++++++++ packages/editor-ui/src/__tests__/defaults.ts | 5 +++ .../CredentialEdit/AuthTypeSelector.vue | 9 ++++- .../CredentialEdit/CredentialConfig.vue | 10 +++-- .../CredentialEdit/CredentialEdit.vue | 6 ++- .../src/components/EnterpriseEdition.ee.vue | 13 +++--- packages/editor-ui/src/constants.ts | 40 +++++++++++-------- .../editor-ui/src/stores/settings.store.ts | 5 ++- packages/editor-ui/src/types/rbac.ts | 5 +-- .../editor-ui/src/utils/nodeTypesUtils.ts | 4 +- 10 files changed, 75 insertions(+), 39 deletions(-) diff --git a/packages/editor-ui/src/Interface.ts b/packages/editor-ui/src/Interface.ts index 650b5fcf4927d..110c2df88b3b4 100644 --- a/packages/editor-ui/src/Interface.ts +++ b/packages/editor-ui/src/Interface.ts @@ -1925,3 +1925,20 @@ export type NewConnectionInfo = { export type AIAssistantConnectionInfo = NewConnectionInfo & { stepName: string; }; + +export type EnterpriseEditionFeatureKey = + | 'AdvancedExecutionFilters' + | 'Sharing' + | 'Ldap' + | 'LogStreaming' + | 'Variables' + | 'Saml' + | 'SourceControl' + | 'ExternalSecrets' + | 'AuditLogs' + | 'DebugInEditor' + | 'WorkflowHistory' + | 'WorkerView' + | 'AdvancedPermissions'; + +export type EnterpriseEditionFeatureValue = keyof Omit; diff --git a/packages/editor-ui/src/__tests__/defaults.ts b/packages/editor-ui/src/__tests__/defaults.ts index d448637c33c65..98ce362c7ee1a 100644 --- a/packages/editor-ui/src/__tests__/defaults.ts +++ b/packages/editor-ui/src/__tests__/defaults.ts @@ -68,6 +68,11 @@ export const defaultSettings: IN8nUISettings = { externalSecrets: false, workerView: false, advancedPermissions: false, + projects: { + team: { + limit: 1, + }, + }, }, expressions: { evaluator: 'tournament', diff --git a/packages/editor-ui/src/components/CredentialEdit/AuthTypeSelector.vue b/packages/editor-ui/src/components/CredentialEdit/AuthTypeSelector.vue index 9044f8f355313..7c8654def00aa 100644 --- a/packages/editor-ui/src/components/CredentialEdit/AuthTypeSelector.vue +++ b/packages/editor-ui/src/components/CredentialEdit/AuthTypeSelector.vue @@ -9,11 +9,16 @@ import { getNodeAuthOptions, isAuthRelatedParameter, } from '@/utils/nodeTypesUtils'; -import type { INodeProperties, INodeTypeDescription, NodeParameterValue } from 'n8n-workflow'; +import type { + ICredentialType, + INodeProperties, + INodeTypeDescription, + NodeParameterValue, +} from 'n8n-workflow'; import { computed, onMounted, ref } from 'vue'; export interface Props { - credentialType: object; + credentialType: ICredentialType; } const emit = defineEmits<{ diff --git a/packages/editor-ui/src/components/CredentialEdit/CredentialConfig.vue b/packages/editor-ui/src/components/CredentialEdit/CredentialConfig.vue index 6affd777c7d7b..226e0f7fab875 100644 --- a/packages/editor-ui/src/components/CredentialEdit/CredentialConfig.vue +++ b/packages/editor-ui/src/components/CredentialEdit/CredentialConfig.vue @@ -142,7 +142,7 @@ import { defineComponent } from 'vue'; import type { PropType } from 'vue'; import { mapStores } from 'pinia'; -import type { ICredentialType, INodeTypeDescription } from 'n8n-workflow'; +import type { ICredentialType, INodeProperties, INodeTypeDescription } from 'n8n-workflow'; import { getAppNameFromCredType, isCommunityPackageName } from '@/utils/nodeTypesUtils'; import Banner from '../Banner.vue'; @@ -177,13 +177,15 @@ export default defineComponent({ }, props: { credentialType: { - type: Object, + type: Object as PropType, + required: true, }, credentialProperties: { - type: Array, + type: Array as PropType, + required: true, }, parentTypes: { - type: Array, + type: Array as PropType, }, credentialData: {}, credentialId: { diff --git a/packages/editor-ui/src/components/CredentialEdit/CredentialEdit.vue b/packages/editor-ui/src/components/CredentialEdit/CredentialEdit.vue index 695ef8accb60f..5f3ddb9eba544 100644 --- a/packages/editor-ui/src/components/CredentialEdit/CredentialEdit.vue +++ b/packages/editor-ui/src/components/CredentialEdit/CredentialEdit.vue @@ -60,7 +60,11 @@ @select="onTabSelect" > -
+