refactor: Fix Enteprise type errors (#9442)
This commit is contained in:
@@ -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<{
|
||||
|
||||
@@ -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<ICredentialType>,
|
||||
required: true,
|
||||
},
|
||||
credentialProperties: {
|
||||
type: Array,
|
||||
type: Array as PropType<INodeProperties[]>,
|
||||
required: true,
|
||||
},
|
||||
parentTypes: {
|
||||
type: Array,
|
||||
type: Array as PropType<string[]>,
|
||||
},
|
||||
credentialData: {},
|
||||
credentialId: {
|
||||
|
||||
@@ -60,7 +60,11 @@
|
||||
@select="onTabSelect"
|
||||
></n8n-menu>
|
||||
</div>
|
||||
<div v-if="activeTab === 'connection'" ref="content" :class="$style.mainContent">
|
||||
<div
|
||||
v-if="activeTab === 'connection' && credentialType"
|
||||
ref="content"
|
||||
:class="$style.mainContent"
|
||||
>
|
||||
<CredentialConfig
|
||||
:credential-type="credentialType"
|
||||
:credential-properties="credentialProperties"
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import type { EnterpriseEditionFeature } from '@/constants';
|
||||
import { type PropType, defineComponent } from 'vue';
|
||||
import type { EnterpriseEditionFeatureValue } from '@/Interface';
|
||||
import { mapStores } from 'pinia';
|
||||
import { useSettingsStore } from '@/stores/settings.store';
|
||||
|
||||
@@ -15,18 +15,15 @@ export default defineComponent({
|
||||
name: 'EnterpriseEdition',
|
||||
props: {
|
||||
features: {
|
||||
type: Array,
|
||||
default: () => [] as EnterpriseEditionFeature[],
|
||||
type: Array as PropType<EnterpriseEditionFeatureValue[]>,
|
||||
default: () => [],
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
...mapStores(useSettingsStore),
|
||||
canAccess(): boolean {
|
||||
return this.features.reduce((acc: boolean, feature) => {
|
||||
return (
|
||||
acc &&
|
||||
!!this.settingsStore.isEnterpriseFeatureEnabled(feature as EnterpriseEditionFeature)
|
||||
);
|
||||
return acc && !!this.settingsStore.isEnterpriseFeatureEnabled(feature);
|
||||
}, true);
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user