mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
chore: Lintfix frontend packages (#16896)
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import type { StoryObj } from '@storybook/vue3';
|
||||
import { onMounted } from 'vue';
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@ import type { InjectionKey } from 'vue';
|
||||
|
||||
import type { Chat, ChatOptions } from '@n8n/chat/types';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
export const ChatSymbol = 'Chat' as unknown as InjectionKey<Chat>;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
export const ChatOptionsSymbol = 'ChatOptions' as unknown as InjectionKey<ChatOptions>;
|
||||
|
||||
@@ -7,7 +7,6 @@ import { ChatOptionsSymbol, ChatSymbol, localStorageSessionIdKey } from '@n8n/ch
|
||||
import { chatEventBus } from '@n8n/chat/event-buses';
|
||||
import type { ChatMessage, ChatOptions } from '@n8n/chat/types';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
export const ChatPlugin: Plugin<ChatOptions> = {
|
||||
install(app, options) {
|
||||
app.provide(ChatOptionsSymbol, options);
|
||||
|
||||
@@ -378,7 +378,7 @@ const loadedLanguages = ['en'];
|
||||
|
||||
async function setLanguage(language: string) {
|
||||
i18nInstance.global.locale = language as 'en';
|
||||
document!.querySelector('html')!.setAttribute('lang', language);
|
||||
document.querySelector('html')!.setAttribute('lang', language);
|
||||
|
||||
return language;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ export const useAgentRequestStore = defineStore('agentRequest', () => {
|
||||
if (typeof query === 'string') {
|
||||
return undefined;
|
||||
}
|
||||
return query?.[paramName] as NodeParameterValueType;
|
||||
return query?.[paramName];
|
||||
};
|
||||
|
||||
const setAgentRequestForNode = (
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup>
|
||||
import { ref, computed, watch } from 'vue';
|
||||
// eslint-disable-next-line import-x/no-extraneous-dependencies
|
||||
|
||||
import { ElSelect, ElOption, ElOptionGroup } from 'element-plus';
|
||||
import { capitalCase } from 'change-case';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
||||
import { generateCodeForAiTransform, reducePayloadSizeOrThrow } from './utils';
|
||||
import { createPinia, setActivePinia } from 'pinia';
|
||||
|
||||
@@ -230,8 +230,8 @@ onMounted(async () => {
|
||||
<span v-text="getModalContent.description"></span>
|
||||
</n8n-info-tip>
|
||||
<n8n-notice
|
||||
data-test-id="communityPackageManageConfirmModal-warning"
|
||||
v-if="!isLatestPackageVerified"
|
||||
data-test-id="communityPackageManageConfirmModal-warning"
|
||||
:content="getModalContent.warning"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -160,8 +160,8 @@ const confirm = async () => {
|
||||
:class="$style.skip"
|
||||
type="secondary"
|
||||
text
|
||||
@click="closeModal"
|
||||
:disabled="isLoading"
|
||||
@click="closeModal"
|
||||
>{{ i18n.baseText('communityPlusModal.button.skip') }}</N8nButton
|
||||
>
|
||||
<N8nButton :disabled="!valid || isLoading" type="primary" @click="confirm">
|
||||
|
||||
@@ -11,7 +11,7 @@ import type {
|
||||
import type { IUpdateInformation } from '@/Interface';
|
||||
import AuthTypeSelector from '@/components/CredentialEdit/AuthTypeSelector.vue';
|
||||
import EnterpriseEdition from '@/components/EnterpriseEdition.ee.vue';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
import { useI18n, addCredentialTranslation } from '@n8n/i18n';
|
||||
import { useTelemetry } from '@/composables/useTelemetry';
|
||||
import {
|
||||
BUILTIN_CREDENTIALS_DOCS_URL,
|
||||
@@ -20,7 +20,6 @@ import {
|
||||
NEW_ASSISTANT_SESSION_MODAL,
|
||||
} from '@/constants';
|
||||
import type { PermissionsRecord } from '@n8n/permissions';
|
||||
import { addCredentialTranslation } from '@n8n/i18n';
|
||||
import { useCredentialsStore } from '@/stores/credentials.store';
|
||||
import { useNDVStore } from '@/stores/ndv.store';
|
||||
import { useRootStore } from '@n8n/stores/useRootStore';
|
||||
|
||||
@@ -241,9 +241,7 @@ const credentialProperties = computed(() => {
|
||||
if (!displayCredentialParameter(propertyData)) {
|
||||
return false;
|
||||
}
|
||||
return (
|
||||
!type.__overwrittenProperties || !type.__overwrittenProperties.includes(propertyData.name)
|
||||
);
|
||||
return !type.__overwrittenProperties?.includes(propertyData.name);
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import type { AllRolesMap } from '@n8n/permissions';
|
||||
import type { AllRolesMap, PermissionsRecord } from '@n8n/permissions';
|
||||
import ProjectSharing from '@/components/Projects/ProjectSharing.vue';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
import { usePageRedirectionHelper } from '@/composables/usePageRedirectionHelper';
|
||||
import { EnterpriseEditionFeature } from '@/constants';
|
||||
import type { ICredentialsDecryptedResponse, ICredentialsResponse } from '@/Interface';
|
||||
import type { PermissionsRecord } from '@n8n/permissions';
|
||||
import { useProjectsStore } from '@/stores/projects.store';
|
||||
import { useRolesStore } from '@/stores/roles.store';
|
||||
import { useSettingsStore } from '@/stores/settings.store';
|
||||
|
||||
@@ -46,7 +46,7 @@ const iconType = computed(() => {
|
||||
|
||||
const iconName = computed(() => {
|
||||
const icon = getThemedValue(credentialWithIcon.value?.icon, uiStore.appliedTheme);
|
||||
if (!icon || !icon?.startsWith('fa:')) return undefined;
|
||||
if (!icon?.startsWith('fa:')) return undefined;
|
||||
return icon.replace('fa:', '');
|
||||
});
|
||||
|
||||
|
||||
@@ -70,8 +70,7 @@ function isSupported(name: string): boolean {
|
||||
}
|
||||
|
||||
if (
|
||||
checkedCredType.extends &&
|
||||
checkedCredType.extends.some((parentType: string) => supported.extends.includes(parentType))
|
||||
checkedCredType.extends?.some((parentType: string) => supported.extends.includes(parentType))
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ const save = async (): Promise<void> => {
|
||||
parentFolderId,
|
||||
});
|
||||
|
||||
if (!!workflowId) {
|
||||
if (workflowId) {
|
||||
closeDialog();
|
||||
telemetry.track('User duplicated workflow', {
|
||||
old_workflow_id: currentWorkflowId,
|
||||
|
||||
@@ -75,7 +75,7 @@ const handleRowClick = (row: TestRunRecord) => {
|
||||
|
||||
<template>
|
||||
<div :class="$style.runs">
|
||||
<MetricsChart v-model:selectedMetric="selectedMetric" :runs="runs" />
|
||||
<MetricsChart v-model:selected-metric="selectedMetric" :runs="runs" />
|
||||
|
||||
<TestRunsTable
|
||||
:class="$style.runsTable"
|
||||
|
||||
@@ -133,7 +133,7 @@ async function onActionDropdownClick(id: string) {
|
||||
</span>
|
||||
</n8n-text>
|
||||
</div>
|
||||
<div :class="$style.deprecationWarning" v-if="provider.name === 'infisical'">
|
||||
<div v-if="provider.name === 'infisical'" :class="$style.deprecationWarning">
|
||||
<n8n-icon :class="$style['warningTriangle']" icon="triangle-alert" />
|
||||
<N8nBadge class="mr-xs" theme="tertiary" bold data-test-id="card-badge">
|
||||
{{ i18n.baseText('settings.externalSecrets.card.deprecated') }}
|
||||
|
||||
@@ -130,7 +130,7 @@ const onBreadcrumbItemClick = async (item: PathItem) => {
|
||||
:class="$style['folder-icon']"
|
||||
icon="folder"
|
||||
size="xlarge"
|
||||
:strokeWidth="1"
|
||||
:stroke-width="1"
|
||||
/>
|
||||
</template>
|
||||
<template #header>
|
||||
|
||||
@@ -337,8 +337,8 @@ onMounted(() => {
|
||||
/>
|
||||
</div>
|
||||
<CommunityNodeFooter
|
||||
:class="$style.communityNodeFooter"
|
||||
v-if="communityNodeDetails"
|
||||
:class="$style.communityNodeFooter"
|
||||
:package-name="communityNodeDetails.packageName"
|
||||
:show-manage="communityNodeDetails.installed && isInstanceOwner"
|
||||
/>
|
||||
|
||||
@@ -329,8 +329,8 @@ registerKeyHook('MainViewArrowLeft', {
|
||||
v-if="globalSearchItemsDiff.length > 0"
|
||||
:elements="globalSearchItemsDiff"
|
||||
:category="i18n.baseText('nodeCreator.categoryNames.otherCategories')"
|
||||
@selected="onSelected"
|
||||
:expanded="true"
|
||||
@selected="onSelected"
|
||||
>
|
||||
</CategorizedItemsRenderer>
|
||||
|
||||
@@ -339,8 +339,8 @@ registerKeyHook('MainViewArrowLeft', {
|
||||
v-if="moreFromCommunity.length > 0"
|
||||
:elements="moreFromCommunity"
|
||||
:category="i18n.baseText('nodeCreator.categoryNames.moreFromCommunity')"
|
||||
@selected="onSelected"
|
||||
:expanded="true"
|
||||
@selected="onSelected"
|
||||
>
|
||||
</CategorizedItemsRenderer>
|
||||
</span>
|
||||
|
||||
@@ -18,9 +18,9 @@ const openCommunityNodeDocsPage = () => {
|
||||
<template>
|
||||
<N8nLink
|
||||
theme="text"
|
||||
@click="openCommunityNodeDocsPage"
|
||||
:class="$style.container"
|
||||
:title="i18n.baseText('communityNodesDocsLink.link.title')"
|
||||
@click="openCommunityNodeDocsPage"
|
||||
>
|
||||
<N8nText size="small" bold style="margin-right: 5px">
|
||||
{{ i18n.baseText('communityNodesDocsLink.title') }}
|
||||
|
||||
@@ -85,7 +85,7 @@ async function fetchPackageInfo(packageName: string) {
|
||||
}
|
||||
|
||||
const downloadsData: DownloadData = await downloadsResponse.json();
|
||||
if (!downloadsData.downloads || !downloadsData.downloads.length) return;
|
||||
if (!downloadsData.downloads?.length) return;
|
||||
|
||||
const total = downloadsData.downloads.reduce((sum, day) => sum + day.downloads, 0);
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ function getNodeTypeBase(nodeTypeDescription: INodeTypeDescription, label?: stri
|
||||
}
|
||||
|
||||
function operationsCategory(nodeTypeDescription: INodeTypeDescription): ActionTypeDescription[] {
|
||||
if (!!nodeTypeDescription.properties.find((property) => property.name === 'resource')) return [];
|
||||
if (nodeTypeDescription.properties.find((property) => property.name === 'resource')) return [];
|
||||
|
||||
const matchedProperty = nodeTypeDescription.properties.find(
|
||||
(property) => property.name?.toLowerCase() === 'operation',
|
||||
|
||||
@@ -276,7 +276,7 @@ const maxInputRun = computed(() => {
|
||||
node = activeNode.value;
|
||||
}
|
||||
|
||||
if (!node || !runData || !runData.hasOwnProperty(node.name)) {
|
||||
if (!node || !runData?.hasOwnProperty(node.name)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ const documentationUrl = computed(() => {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (nodeType.documentationUrl && nodeType.documentationUrl.startsWith('http')) {
|
||||
if (nodeType.documentationUrl?.startsWith('http')) {
|
||||
return nodeType.documentationUrl;
|
||||
}
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ const runTaskData = computed(() => {
|
||||
|
||||
const runData = workflowRunData.value;
|
||||
|
||||
if (runData === null || !runData.hasOwnProperty(node.value.name)) {
|
||||
if (!runData?.hasOwnProperty(node.value.name)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ const uiStore = useUIStore();
|
||||
const focusPanelStore = useFocusPanelStore();
|
||||
|
||||
// ESLint: false positive
|
||||
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents, @typescript-eslint/no-duplicate-type-constituents
|
||||
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
|
||||
const inputField = ref<InstanceType<typeof N8nInput | typeof N8nSelect> | HTMLElement>();
|
||||
const wrapper = ref<HTMLDivElement>();
|
||||
|
||||
@@ -931,7 +931,7 @@ function valueChanged(value: NodeParameterValueType | {} | Date) {
|
||||
telemetry.track('User set node operation or mode', {
|
||||
workflow_id: workflowsStore.workflowId,
|
||||
node_type: node.value?.type,
|
||||
resource: node.value && node.value.parameters.resource,
|
||||
resource: node.value?.parameters.resource,
|
||||
is_custom: value === CUSTOM_API_CALL_KEY,
|
||||
push_ref: ndvStore.pushRef,
|
||||
parameter: props.parameter.name,
|
||||
|
||||
@@ -627,8 +627,8 @@ const onCalloutDismiss = async (parameter: INodeProperties) => {
|
||||
>
|
||||
<N8nText size="small">
|
||||
<N8nText
|
||||
size="small"
|
||||
v-n8n-html="i18n.nodeText(activeNode?.type).inputLabelDisplayName(parameter, path)"
|
||||
size="small"
|
||||
/>
|
||||
<template v-if="parameter.typeOptions?.calloutAction">
|
||||
{{ ' ' }}
|
||||
|
||||
@@ -359,7 +359,7 @@ const allowNewResources = computed(() => {
|
||||
return {
|
||||
label: i18n.baseText(addNewResourceOptions.label as BaseTextKey, {
|
||||
interpolate: {
|
||||
resourceName: !!searchFilter.value ? searchFilter.value : addNewResourceOptions.defaultName,
|
||||
resourceName: searchFilter.value ? searchFilter.value : addNewResourceOptions.defaultName,
|
||||
},
|
||||
}),
|
||||
method: addNewResourceOptions.method,
|
||||
@@ -600,12 +600,7 @@ function onModeSelected(value: string): void {
|
||||
mode: value,
|
||||
value: props.modelValue.cachedResultUrl,
|
||||
});
|
||||
} else if (
|
||||
value === 'id' &&
|
||||
selectedMode.value === 'list' &&
|
||||
props.modelValue &&
|
||||
props.modelValue.value
|
||||
) {
|
||||
} else if (value === 'id' && selectedMode.value === 'list' && props.modelValue?.value) {
|
||||
emit('update:modelValue', { __rl: true, mode: value, value: props.modelValue.value });
|
||||
} else {
|
||||
emit('update:modelValue', { __rl: true, mode: value, value: '' });
|
||||
|
||||
@@ -13,7 +13,7 @@ import ParameterInputFull from '@/components/ParameterInputFull.vue';
|
||||
import ParameterIssues from '@/components//ParameterIssues.vue';
|
||||
import ParameterOptions from '@/components//ParameterOptions.vue';
|
||||
import { computed } from 'vue';
|
||||
import { i18n as locale } from '@n8n/i18n';
|
||||
import { i18n as locale, useI18n } from '@n8n/i18n';
|
||||
import { useNDVStore } from '@/stores/ndv.store';
|
||||
import {
|
||||
fieldCannotBeDeleted,
|
||||
@@ -29,7 +29,6 @@ import {
|
||||
N8nSelect,
|
||||
N8nTooltip,
|
||||
} from '@n8n/design-system';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
|
||||
interface Props {
|
||||
parameter: INodeProperties;
|
||||
|
||||
@@ -366,7 +366,7 @@ const maxOutputIndex = computed(() => {
|
||||
|
||||
const runData: IRunData | null = workflowRunData.value;
|
||||
|
||||
if (runData === null || !runData.hasOwnProperty(node.value.name)) {
|
||||
if (!runData?.hasOwnProperty(node.value.name)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -391,7 +391,7 @@ const maxRunIndex = computed(() => {
|
||||
|
||||
const runData: IRunData | null = workflowRunData.value;
|
||||
|
||||
if (runData === null || !runData.hasOwnProperty(node.value.name)) {
|
||||
if (!runData?.hasOwnProperty(node.value.name)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -464,7 +464,7 @@ const allVisibleItemsSelected = computed(() => {
|
||||
}
|
||||
const notSelectedVisibleItems = workflowsSet.difference(toRaw(activeSelection.value));
|
||||
|
||||
return !Boolean(notSelectedVisibleItems.size);
|
||||
return !notSelectedVisibleItems.size;
|
||||
}
|
||||
|
||||
if (activeTab.value === SOURCE_CONTROL_FILE_TYPE.credential) {
|
||||
@@ -474,7 +474,7 @@ const allVisibleItemsSelected = computed(() => {
|
||||
}
|
||||
const notSelectedVisibleItems = credentialsSet.difference(toRaw(activeSelection.value));
|
||||
|
||||
return !Boolean(notSelectedVisibleItems.size);
|
||||
return !notSelectedVisibleItems.size;
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -654,7 +654,7 @@ function castProject(project: ProjectListItem) {
|
||||
usersStore.currentUser.role !== ROLE.Owner && usersStore.currentUser.role !== ROLE.Admin
|
||||
"
|
||||
>
|
||||
<N8nCallout theme="secondary" class="mt-s" v-if="!projectAdminCalloutDismissed">
|
||||
<N8nCallout v-if="!projectAdminCalloutDismissed" theme="secondary" class="mt-s">
|
||||
{{ i18n.baseText('settings.sourceControl.modals.push.projectAdmin.callout') }}
|
||||
<template #trailingContent>
|
||||
<N8nIcon
|
||||
|
||||
@@ -118,7 +118,7 @@ const focusOnCreate = (): void => {
|
||||
watch(
|
||||
() => props.rows,
|
||||
(newValue: ITagRow[] | undefined) => {
|
||||
if (newValue?.[0] && newValue[0].create) {
|
||||
if (newValue?.[0]?.create) {
|
||||
focusOnCreate();
|
||||
}
|
||||
},
|
||||
|
||||
@@ -345,7 +345,7 @@ const items = computed(() => {
|
||||
});
|
||||
|
||||
const noSearchResults = computed(() => {
|
||||
return Boolean(props.search.trim()) && !Boolean(items.value.length);
|
||||
return Boolean(props.search.trim()) && !items.value.length;
|
||||
});
|
||||
|
||||
watch(
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
/* eslint-disable vue/no-multiple-template-root */
|
||||
/**
|
||||
* @see https://github.com/bcakmakoglu/vue-flow/blob/master/packages/background/src/Background.vue
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<script lang="ts" setup>
|
||||
/* eslint-disable vue/no-multiple-template-root */
|
||||
import { computed, h, provide, toRef, useCssModule } from 'vue';
|
||||
import type { CanvasConnectionPort, CanvasElementPortWithRenderData } from '@/types';
|
||||
import { CanvasConnectionMode } from '@/types';
|
||||
|
||||
@@ -62,7 +62,7 @@ function onDropdownVisibleChange(visible: boolean) {
|
||||
data-test-id="execution-preview-ellipsis-button"
|
||||
@blur="onEllipsisButtonBlur"
|
||||
>
|
||||
<n8n-badge :class="$style.badge" theme="primary" v-if="customDataLength > 0">
|
||||
<n8n-badge v-if="customDataLength > 0" :class="$style.badge" theme="primary">
|
||||
{{ customDataLength.toString() }}
|
||||
</n8n-badge>
|
||||
</N8nButton>
|
||||
|
||||
@@ -103,9 +103,9 @@ const onTagsEditEsc = () => {
|
||||
size="mini"
|
||||
:outline="false"
|
||||
:text="true"
|
||||
@click="onTagsEditEnable"
|
||||
data-test-id="new-tag-link"
|
||||
icon="plus"
|
||||
@click="onTagsEditEnable"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -130,9 +130,9 @@ const onTagsEditEsc = () => {
|
||||
size="mini"
|
||||
:outline="false"
|
||||
:text="true"
|
||||
@click="onTagsEditEnable"
|
||||
data-test-id="new-tag-link"
|
||||
icon="plus"
|
||||
@click="onTagsEditEnable"
|
||||
/>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
@@ -229,7 +229,7 @@ const onVoteClick = async (voteValue: AnnotationVote) => {
|
||||
| ID#{{ execution.id }}
|
||||
</N8nText>
|
||||
</div>
|
||||
<div :class="$style.executionDetailsRetry" v-if="execution.mode === 'retry'">
|
||||
<div v-if="execution.mode === 'retry'" :class="$style.executionDetailsRetry">
|
||||
<N8nText color="text-base" size="small">
|
||||
{{ locale.baseText('executionDetails.retry') }}
|
||||
<RouterLink
|
||||
@@ -306,8 +306,8 @@ const onVoteClick = async (voteValue: AnnotationVote) => {
|
||||
</ElDropdown>
|
||||
|
||||
<WorkflowExecutionAnnotationPanel
|
||||
:execution="activeExecution"
|
||||
v-if="isAnnotationEnabled && activeExecution"
|
||||
:execution="activeExecution"
|
||||
/>
|
||||
|
||||
<N8nIconButton
|
||||
|
||||
@@ -1172,7 +1172,7 @@ export function useCanvasOperations() {
|
||||
|
||||
let pushOffset = PUSH_NODES_OFFSET;
|
||||
if (
|
||||
!!lastInteractedWithNodeInputTypes.find((input) => input !== NodeConnectionTypes.Main)
|
||||
lastInteractedWithNodeInputTypes.find((input) => input !== NodeConnectionTypes.Main)
|
||||
) {
|
||||
// If the node has scoped inputs, push it down a bit more
|
||||
pushOffset += 140;
|
||||
@@ -1363,7 +1363,7 @@ export function useCanvasOperations() {
|
||||
target: connectionDataNode.id,
|
||||
targetHandle: createCanvasConnectionHandleString({
|
||||
mode: CanvasConnectionMode.Input,
|
||||
type: connectionData.type as NodeConnectionType,
|
||||
type: connectionData.type,
|
||||
index: connectionData.index,
|
||||
}),
|
||||
},
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable n8n-local-rules/no-unneeded-backticks */
|
||||
import { createTestNode, createTestWorkflow, defaultNodeDescriptions } from '@/__tests__/mocks';
|
||||
import { createComponentRenderer } from '@/__tests__/render';
|
||||
import { useCanvasOperations } from '@/composables/useCanvasOperations';
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { setActivePinia } from 'pinia';
|
||||
import {
|
||||
NodeConnectionTypes,
|
||||
NodeHelpers,
|
||||
type INode,
|
||||
type INodeTypeDescription,
|
||||
type Workflow,
|
||||
import type {
|
||||
ExecutionStatus,
|
||||
IRunData,
|
||||
INode,
|
||||
INodeTypeDescription,
|
||||
Workflow,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeConnectionTypes, NodeHelpers } from 'n8n-workflow';
|
||||
import { createTestingPinia } from '@pinia/testing';
|
||||
import { useNodeHelpers } from '@/composables/useNodeHelpers';
|
||||
import { createTestNode, createMockEnterpriseSettings } from '@/__tests__/mocks';
|
||||
@@ -14,7 +15,6 @@ import { useSettingsStore } from '@/stores/settings.store';
|
||||
import { CUSTOM_API_CALL_KEY, EnterpriseEditionFeature } from '@/constants';
|
||||
import { mockedStore } from '@/__tests__/utils';
|
||||
import { mock } from 'vitest-mock-extended';
|
||||
import type { ExecutionStatus, IRunData } from 'n8n-workflow';
|
||||
import { faker } from '@faker-js/faker';
|
||||
import type { INodeUi, IUsedCredential } from '@/Interface';
|
||||
import { useNodeTypesStore } from '@/stores/nodeTypes.store';
|
||||
|
||||
@@ -252,7 +252,7 @@ export function useNodeHelpers() {
|
||||
function hasNodeExecutionIssues(node: INodeUi): boolean {
|
||||
const workflowResultData = workflowsStore.getWorkflowRunData;
|
||||
|
||||
if (workflowResultData === null || !workflowResultData.hasOwnProperty(node.name)) {
|
||||
if (!workflowResultData?.hasOwnProperty(node.name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -388,7 +388,6 @@ export function executeData(
|
||||
workflowRunData[parentNodeName].length <= parentRunIndex ||
|
||||
!workflowRunData[parentNodeName][parentRunIndex] ||
|
||||
!workflowRunData[parentNodeName][parentRunIndex].hasOwnProperty('data') ||
|
||||
workflowRunData[parentNodeName][parentRunIndex].data === undefined ||
|
||||
!workflowRunData[parentNodeName][parentRunIndex].data?.hasOwnProperty(inputName)
|
||||
) {
|
||||
executeData.data = {};
|
||||
@@ -926,10 +925,7 @@ export function useWorkflowHelpers() {
|
||||
return trigger.parameters.path as string;
|
||||
}
|
||||
if (trigger.type === FORM_TRIGGER_NODE_TYPE) {
|
||||
return (
|
||||
(((trigger.parameters.options as { path: string }) || {}).path as string) ??
|
||||
trigger.webhookId
|
||||
);
|
||||
return ((trigger.parameters.options as { path: string }) || {}).path ?? trigger.webhookId;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -15,9 +15,8 @@ import LogsViewNodeName from '@/features/logs/components/LogsViewNodeName.vue';
|
||||
import { N8nButton, N8nResizeWrapper, N8nText } from '@n8n/design-system';
|
||||
import { computed, useTemplateRef } from 'vue';
|
||||
import KeyboardShortcutTooltip from '@/components/KeyboardShortcutTooltip.vue';
|
||||
import { getSubtreeTotalConsumedTokens } from '@/features/logs/logs.utils';
|
||||
import { getSubtreeTotalConsumedTokens, isPlaceholderLog } from '@/features/logs/logs.utils';
|
||||
import { LOG_DETAILS_PANEL_STATE } from '@/features/logs/logs.constants';
|
||||
import { isPlaceholderLog } from '@/features/logs/logs.utils';
|
||||
|
||||
const MIN_IO_PANEL_WIDTH = 200;
|
||||
|
||||
|
||||
@@ -312,7 +312,6 @@ export function findSelectedLogEntry(
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export function deepToRaw<T>(sourceObj: T): T {
|
||||
const seen = new WeakMap();
|
||||
|
||||
|
||||
@@ -1234,7 +1234,7 @@ const createLuxonAutocompleteOption = ({
|
||||
const label = isFunction ? name + '()' : name;
|
||||
|
||||
let doc: DocMetadata | undefined;
|
||||
if (docs.properties && docs.properties.hasOwnProperty(name)) {
|
||||
if (docs.properties?.hasOwnProperty(name)) {
|
||||
doc = docs.properties[name].doc;
|
||||
} else if (docs.functions.hasOwnProperty(name)) {
|
||||
doc = docs.functions[name].doc;
|
||||
|
||||
@@ -13,8 +13,11 @@ import type {
|
||||
} from '@/Interface';
|
||||
import { useRootStore } from '@n8n/stores/useRootStore';
|
||||
import { makeRestApiRequest } from '@n8n/rest-api-client';
|
||||
import { unflattenExecutionData } from '@/utils/executionUtils';
|
||||
import { executionFilterToQueryFilter, getDefaultExecutionFilters } from '@/utils/executionUtils';
|
||||
import {
|
||||
unflattenExecutionData,
|
||||
executionFilterToQueryFilter,
|
||||
getDefaultExecutionFilters,
|
||||
} from '@/utils/executionUtils';
|
||||
import { useProjectsStore } from '@/stores/projects.store';
|
||||
import { useSettingsStore } from '@/stores/settings.store';
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ export const useSchemaPreviewStore = defineStore('schemaPreview', () => {
|
||||
getSchemaPreviewKey({ nodeType: type, version: typeVersion, resource, operation }),
|
||||
);
|
||||
|
||||
if (!result || !result.ok) return;
|
||||
if (!result?.ok) return;
|
||||
|
||||
telemetry.track('User executed node with schema preview', {
|
||||
node_id: id,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import type { OidcConfigDto } from '@n8n/api-types';
|
||||
import { type SamlPreferences } from '@n8n/api-types';
|
||||
import type { OidcConfigDto, SamlPreferences } from '@n8n/api-types';
|
||||
import { computed, ref } from 'vue';
|
||||
import { defineStore } from 'pinia';
|
||||
import { useRootStore } from '@n8n/stores/useRootStore';
|
||||
|
||||
@@ -146,7 +146,7 @@ export const useTemplatesStore = defineStore(STORES.TEMPLATES, () => {
|
||||
const searchKey = getSearchKey(query);
|
||||
const search = workflowSearches.value[searchKey];
|
||||
|
||||
return Boolean(search && search.loadingMore);
|
||||
return Boolean(search?.loadingMore);
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
@@ -78,7 +78,12 @@ import { isObject } from '@/utils/objectUtils';
|
||||
import { getPairedItemsMapping } from '@/utils/pairedItemUtils';
|
||||
import { isJsonKeyObject, isEmpty, stringSizeInBytes, isPresent } from '@/utils/typesUtils';
|
||||
import { makeRestApiRequest, ResponseError } from '@n8n/rest-api-client';
|
||||
import { unflattenExecutionData } from '@/utils/executionUtils';
|
||||
import {
|
||||
unflattenExecutionData,
|
||||
clearPopupWindowState,
|
||||
findTriggerNodeToAutoSelect,
|
||||
openFormPopupWindow,
|
||||
} from '@/utils/executionUtils';
|
||||
import { useNDVStore } from '@/stores/ndv.store';
|
||||
import { useNodeTypesStore } from '@/stores/nodeTypes.store';
|
||||
import { getCredentialOnlyNodeTypeName } from '@/utils/credentialOnlyNodes';
|
||||
@@ -91,11 +96,6 @@ import type { PushPayload } from '@n8n/api-types';
|
||||
import { useTelemetry } from '@/composables/useTelemetry';
|
||||
import { useWorkflowHelpers } from '@/composables/useWorkflowHelpers';
|
||||
import { useSettingsStore } from './settings.store';
|
||||
import {
|
||||
clearPopupWindowState,
|
||||
findTriggerNodeToAutoSelect,
|
||||
openFormPopupWindow,
|
||||
} from '@/utils/executionUtils';
|
||||
import { useNodeHelpers } from '@/composables/useNodeHelpers';
|
||||
import { useUsersStore } from '@/stores/users.store';
|
||||
import { updateCurrentUserSettings } from '@/api/users';
|
||||
@@ -1373,7 +1373,7 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, () => {
|
||||
const { [node.name]: removedNodeMetadata, ...remainingNodeMetadata } = nodeMetadata.value;
|
||||
nodeMetadata.value = remainingNodeMetadata;
|
||||
|
||||
if (workflow.value.pinData && workflow.value.pinData.hasOwnProperty(node.name)) {
|
||||
if (workflow.value.pinData?.hasOwnProperty(node.name)) {
|
||||
const { [node.name]: removedPinData, ...remainingPinData } = workflow.value.pinData;
|
||||
workflow.value = {
|
||||
...workflow.value,
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/no-redundant-type-constituents */
|
||||
import type { ExecutionStatus, INodeConnections, NodeConnectionType } from 'n8n-workflow';
|
||||
import type {
|
||||
DefaultEdge,
|
||||
|
||||
@@ -33,7 +33,7 @@ export function mapLegacyConnectionsToCanvasConnections(
|
||||
toPorts?.forEach((toPort) => {
|
||||
const toNodeName = toPort.node;
|
||||
const toId = nodes.find((node) => node.name === toNodeName)?.id ?? '';
|
||||
const toConnectionType = toPort.type as NodeConnectionType;
|
||||
const toConnectionType = toPort.type;
|
||||
const toIndex = toPort.index;
|
||||
|
||||
const sourceHandle = createCanvasConnectionHandleString({
|
||||
|
||||
@@ -75,11 +75,11 @@ export const executionFilterToQueryFilter = (
|
||||
queryFilter.metadata = filter.metadata;
|
||||
}
|
||||
|
||||
if (!!filter.startDate) {
|
||||
if (filter.startDate) {
|
||||
queryFilter.startedAfter = filter.startDate;
|
||||
}
|
||||
|
||||
if (!!filter.endDate) {
|
||||
if (filter.endDate) {
|
||||
queryFilter.startedBefore = filter.endDate;
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ export async function displayForm({
|
||||
for (const node of nodes) {
|
||||
if (triggerNode !== undefined && triggerNode !== node.name) continue;
|
||||
|
||||
const hasNodeRun = runData && runData?.hasOwnProperty(node.name);
|
||||
const hasNodeRun = runData?.hasOwnProperty(node.name);
|
||||
|
||||
if (hasNodeRun || pinData[node.name]) continue;
|
||||
|
||||
|
||||
@@ -281,9 +281,8 @@ export const getNodeCredentialForSelectedAuthType = (
|
||||
const authField = getMainAuthField(nodeType);
|
||||
const authFieldName = authField ? authField.name : '';
|
||||
return (
|
||||
nodeType.credentials?.find(
|
||||
(cred) =>
|
||||
cred.displayOptions?.show && cred.displayOptions.show[authFieldName]?.includes(authType),
|
||||
nodeType.credentials?.find((cred) =>
|
||||
cred.displayOptions?.show?.[authFieldName]?.includes(authType),
|
||||
) || null
|
||||
);
|
||||
};
|
||||
@@ -297,10 +296,8 @@ export const getAuthTypeForNodeCredential = (
|
||||
const authFieldName = authField ? authField.name : '';
|
||||
const nodeAuthOptions = getNodeAuthOptions(nodeType);
|
||||
return (
|
||||
nodeAuthOptions.find(
|
||||
(option) =>
|
||||
credentialType.displayOptions?.show &&
|
||||
credentialType.displayOptions?.show[authFieldName]?.includes(option.value),
|
||||
nodeAuthOptions.find((option) =>
|
||||
credentialType.displayOptions?.show?.[authFieldName]?.includes(option.value),
|
||||
) || null
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import CredentialCard from '@/components/CredentialCard.vue';
|
||||
import ResourcesListLayout from '@/components/layouts/ResourcesListLayout.vue';
|
||||
import type { BaseFilters, Resource } from '@/Interface';
|
||||
import type { BaseFilters, Resource, ICredentialTypeMap } from '@/Interface';
|
||||
import ProjectHeader from '@/components/Projects/ProjectHeader.vue';
|
||||
import { useDocumentTitle } from '@/composables/useDocumentTitle';
|
||||
import { useProjectPages } from '@/composables/useProjectPages';
|
||||
@@ -14,7 +14,6 @@ import {
|
||||
} from '@/constants';
|
||||
import InsightsSummary from '@/features/insights/components/InsightsSummary.vue';
|
||||
import { useInsightsStore } from '@/features/insights/insights.store';
|
||||
import type { ICredentialTypeMap } from '@/Interface';
|
||||
import { getResourcePermissions } from '@n8n/permissions';
|
||||
import { useCredentialsStore } from '@/stores/credentials.store';
|
||||
import useEnvironmentsStore from '@/stores/environments.ee.store';
|
||||
|
||||
@@ -71,7 +71,7 @@ const isRunTestEnabled = computed(() => !isRunning.value);
|
||||
<div :class="$style.wrapper">
|
||||
<div :class="$style.content">
|
||||
<RunsSection
|
||||
v-model:selectedMetric="selectedMetric"
|
||||
v-model:selected-metric="selectedMetric"
|
||||
:class="$style.runs"
|
||||
:runs="runs"
|
||||
:workflow-id="props.name"
|
||||
|
||||
@@ -15,11 +15,16 @@ import { computed, onMounted, ref, useTemplateRef } from 'vue';
|
||||
import { useRoute, useRouter, type LocationQueryRaw } from 'vue-router';
|
||||
|
||||
import ResourcesListLayout from '@/components/layouts/ResourcesListLayout.vue';
|
||||
import type { BaseFilters, Resource, VariableResource } from '@/Interface';
|
||||
import type {
|
||||
BaseFilters,
|
||||
Resource,
|
||||
VariableResource,
|
||||
DatatableColumn,
|
||||
EnvironmentVariable,
|
||||
} from '@/Interface';
|
||||
|
||||
import { usePageRedirectionHelper } from '@/composables/usePageRedirectionHelper';
|
||||
import { EnterpriseEditionFeature, MODAL_CONFIRM } from '@/constants';
|
||||
import type { DatatableColumn, EnvironmentVariable } from '@/Interface';
|
||||
import { getResourcePermissions } from '@n8n/permissions';
|
||||
import {
|
||||
N8nActionBox,
|
||||
|
||||
@@ -7,6 +7,10 @@ import type {
|
||||
Resource,
|
||||
SortingAndPaginationUpdates,
|
||||
WorkflowResource,
|
||||
FolderListItem,
|
||||
UserAction,
|
||||
WorkflowListItem,
|
||||
WorkflowListResource,
|
||||
} from '@/Interface';
|
||||
import ResourcesListLayout from '@/components/layouts/ResourcesListLayout.vue';
|
||||
import ProjectHeader from '@/components/Projects/ProjectHeader.vue';
|
||||
@@ -30,12 +34,6 @@ import {
|
||||
} from '@/constants';
|
||||
import InsightsSummary from '@/features/insights/components/InsightsSummary.vue';
|
||||
import { useInsightsStore } from '@/features/insights/insights.store';
|
||||
import type {
|
||||
FolderListItem,
|
||||
UserAction,
|
||||
WorkflowListItem,
|
||||
WorkflowListResource,
|
||||
} from '@/Interface';
|
||||
import { getResourcePermissions } from '@n8n/permissions';
|
||||
import { useFoldersStore } from '@/stores/folders.store';
|
||||
import { useProjectsStore } from '@/stores/projects.store';
|
||||
@@ -1776,7 +1774,7 @@ const onNameSubmit = async (name: string) => {
|
||||
:class="$style.emptyStateCardIcon"
|
||||
icon="file"
|
||||
color="foreground-dark"
|
||||
:strokeWidth="1"
|
||||
:stroke-width="1"
|
||||
/>
|
||||
<N8nText size="large" class="mt-xs">
|
||||
{{ i18n.baseText('workflows.empty.startFromScratch') }}
|
||||
|
||||
Reference in New Issue
Block a user