diff --git a/packages/@n8n_io/eslint-config/base.js b/packages/@n8n_io/eslint-config/base.js index bdf78918c3..8438a54e1b 100644 --- a/packages/@n8n_io/eslint-config/base.js +++ b/packages/@n8n_io/eslint-config/base.js @@ -231,7 +231,7 @@ const config = (module.exports = { }, { selector: 'variable', - format: ['camelCase', 'snake_case', 'UPPER_CASE'], + format: ['camelCase', 'snake_case', 'UPPER_CASE', 'PascalCase'], leadingUnderscore: 'allowSingleOrDouble', trailingUnderscore: 'allowSingleOrDouble', }, diff --git a/packages/cli/src/ErrorReporting.ts b/packages/cli/src/ErrorReporting.ts index e850b6e4fa..b214408b66 100644 --- a/packages/cli/src/ErrorReporting.ts +++ b/packages/cli/src/ErrorReporting.ts @@ -23,7 +23,7 @@ export const initErrorHandling = async () => { const { N8N_VERSION: release, ENVIRONMENT: environment } = process.env; const { init, captureException, addGlobalEventProcessor } = await import('@sentry/node'); - // eslint-disable-next-line @typescript-eslint/naming-convention + const { RewriteFrames } = await import('@sentry/integrations'); init({ diff --git a/packages/cli/src/LoadNodesAndCredentials.ts b/packages/cli/src/LoadNodesAndCredentials.ts index 64cab58c05..13931eab44 100644 --- a/packages/cli/src/LoadNodesAndCredentials.ts +++ b/packages/cli/src/LoadNodesAndCredentials.ts @@ -316,7 +316,7 @@ export class LoadNodesAndCredentials { const { default: debounce } = await import('lodash/debounce'); // eslint-disable-next-line import/no-extraneous-dependencies const { watch } = await import('chokidar'); - // eslint-disable-next-line @typescript-eslint/naming-convention + const { Push } = await import('@/push'); const push = Container.get(Push); diff --git a/packages/cli/src/Queue.ts b/packages/cli/src/Queue.ts index e9f7d85c3f..e4c3ffaeea 100644 --- a/packages/cli/src/Queue.ts +++ b/packages/cli/src/Queue.ts @@ -43,9 +43,9 @@ export class Queue { const prefix = getRedisPrefix(bullPrefix); const clusterNodes = getRedisClusterNodes(); const usesRedisCluster = clusterNodes.length > 0; - // eslint-disable-next-line @typescript-eslint/naming-convention + const { default: Bull } = await import('bull'); - // eslint-disable-next-line @typescript-eslint/naming-convention + const { default: Redis } = await import('ioredis'); // Disabling ready check is necessary as it allows worker to // quickly reconnect to Redis if Redis crashes or is unreachable diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index 55bf84cc0b..b43620f868 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-unsafe-argument */ -/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */ + /* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ /* eslint-disable prefer-const */ /* eslint-disable @typescript-eslint/no-shadow */ @@ -335,7 +335,6 @@ export class Server extends AbstractServer { } if (config.getEnv('nodes.communityPackages.enabled')) { - // eslint-disable-next-line @typescript-eslint/naming-convention const { CommunityPackagesController } = await import( '@/controllers/communityPackages.controller' ); @@ -343,7 +342,6 @@ export class Server extends AbstractServer { } if (inE2ETests) { - // eslint-disable-next-line @typescript-eslint/naming-convention const { E2EController } = await import('./controllers/e2e.controller'); controllers.push(Container.get(E2EController)); } @@ -357,7 +355,6 @@ export class Server extends AbstractServer { async configure(): Promise { if (config.getEnv('endpoints.metrics.enable')) { - // eslint-disable-next-line @typescript-eslint/naming-convention const { MetricsService } = await import('@/services/metrics.service'); await Container.get(MetricsService).configureMetrics(this.app); } diff --git a/packages/cli/src/WorkflowExecuteAdditionalData.ts b/packages/cli/src/WorkflowExecuteAdditionalData.ts index 442c749bf8..3fbee0c1dd 100644 --- a/packages/cli/src/WorkflowExecuteAdditionalData.ts +++ b/packages/cli/src/WorkflowExecuteAdditionalData.ts @@ -964,7 +964,7 @@ async function executeWorkflow( activeExecutions.remove(executionId, data); // Workflow did fail const { error } = data.data.resultData; - // eslint-disable-next-line @typescript-eslint/no-throw-literal + throw objectToError( { ...error, diff --git a/packages/cli/src/WorkflowRunner.ts b/packages/cli/src/WorkflowRunner.ts index e65c6c8fa7..b004aec93c 100644 --- a/packages/cli/src/WorkflowRunner.ts +++ b/packages/cli/src/WorkflowRunner.ts @@ -37,7 +37,7 @@ import type { } from '@/Interfaces'; import { NodeTypes } from '@/NodeTypes'; import type { Job, JobData, JobResponse } from '@/Queue'; -// eslint-disable-next-line import/no-cycle + import { Queue } from '@/Queue'; import { decodeWebhookResponse } from '@/helpers/decodeWebhookResponse'; // eslint-disable-next-line import/no-cycle diff --git a/packages/cli/src/WorkflowRunnerProcess.ts b/packages/cli/src/WorkflowRunnerProcess.ts index 8a828398b0..54e3ed3ace 100644 --- a/packages/cli/src/WorkflowRunnerProcess.ts +++ b/packages/cli/src/WorkflowRunnerProcess.ts @@ -178,7 +178,7 @@ class WorkflowRunnerProcess { additionalData.setExecutionStatus = WorkflowExecuteAdditionalData.setExecutionStatus.bind({ executionId: inputData.executionId, }); - // eslint-disable-next-line @typescript-eslint/no-explicit-any + additionalData.sendDataToUI = async (type: string, data: IDataObject | IDataObject[]) => { if (workflowRunner.data!.executionMode !== 'manual') { return; diff --git a/packages/cli/src/audit/risks/nodes.risk.ts b/packages/cli/src/audit/risks/nodes.risk.ts index b1ef484b51..dca1dcee15 100644 --- a/packages/cli/src/audit/risks/nodes.risk.ts +++ b/packages/cli/src/audit/risks/nodes.risk.ts @@ -17,7 +17,6 @@ import type { Risk } from '@/audit/types'; async function getCommunityNodeDetails() { if (!config.getEnv('nodes.communityPackages.enabled')) return []; - // eslint-disable-next-line @typescript-eslint/naming-convention const { CommunityPackagesService } = await import('@/services/communityPackages.service'); const installedPackages = await Container.get(CommunityPackagesService).getAllInstalledPackages(); diff --git a/packages/cli/src/commands/ldap/reset.ts b/packages/cli/src/commands/ldap/reset.ts index db276c40c1..c024bcf0ba 100644 --- a/packages/cli/src/commands/ldap/reset.ts +++ b/packages/cli/src/commands/ldap/reset.ts @@ -7,7 +7,6 @@ export class Reset extends BaseCommand { static description = '\nResets the database to the default ldap state'; async run(): Promise { - // eslint-disable-next-line @typescript-eslint/naming-convention const { AuthIdentity, AuthProviderSyncHistory, Settings, User } = Db.collections; const ldapIdentities = await AuthIdentity.find({ where: { providerType: 'ldap' }, diff --git a/packages/cli/src/commands/start.ts b/packages/cli/src/commands/start.ts index 0546e6687c..bc0c813306 100644 --- a/packages/cli/src/commands/start.ts +++ b/packages/cli/src/commands/start.ts @@ -248,7 +248,6 @@ export class Start extends BaseCommand { const areCommunityPackagesEnabled = config.getEnv('nodes.communityPackages.enabled'); if (areCommunityPackagesEnabled) { - // eslint-disable-next-line @typescript-eslint/naming-convention const { CommunityPackagesService } = await import('@/services/communityPackages.service'); await Container.get(CommunityPackagesService).setMissingPackages({ reinstallMissingPackages: flags.reinstallMissingPackages, diff --git a/packages/cli/src/credentials/credentials.controller.ee.ts b/packages/cli/src/credentials/credentials.controller.ee.ts index a5841a6831..b19000aee1 100644 --- a/packages/cli/src/credentials/credentials.controller.ee.ts +++ b/packages/cli/src/credentials/credentials.controller.ee.ts @@ -12,7 +12,6 @@ import { Container } from 'typedi'; import { InternalHooks } from '@/InternalHooks'; import type { CredentialsEntity } from '@/databases/entities/CredentialsEntity'; -// eslint-disable-next-line @typescript-eslint/naming-convention export const EECredentialsController = express.Router(); EECredentialsController.use((req, res, next) => { diff --git a/packages/cli/src/databases/entities/AbstractEntity.ts b/packages/cli/src/databases/entities/AbstractEntity.ts index ca1881c2be..8200ae33a2 100644 --- a/packages/cli/src/databases/entities/AbstractEntity.ts +++ b/packages/cli/src/databases/entities/AbstractEntity.ts @@ -61,7 +61,7 @@ function mixinTimestamps>(base: T) { } class BaseEntity {} -/* eslint-disable @typescript-eslint/naming-convention */ + export const WithStringId = mixinStringId(BaseEntity); export const WithTimestamps = mixinTimestamps(BaseEntity); export const WithTimestampsAndStringId = mixinStringId(WithTimestamps); diff --git a/packages/cli/src/decorators/Middleware.ts b/packages/cli/src/decorators/Middleware.ts index 6d5e957f6e..ed26fe5bf4 100644 --- a/packages/cli/src/decorators/Middleware.ts +++ b/packages/cli/src/decorators/Middleware.ts @@ -1,7 +1,6 @@ import { CONTROLLER_MIDDLEWARES } from './constants'; import type { MiddlewareMetadata } from './types'; -// eslint-disable-next-line @typescript-eslint/naming-convention export const Middleware = (): MethodDecorator => (target, handlerName) => { const controllerClass = target.constructor; const middlewares = (Reflect.getMetadata(CONTROLLER_MIDDLEWARES, controllerClass) ?? diff --git a/packages/cli/src/decorators/RestController.ts b/packages/cli/src/decorators/RestController.ts index 11c2d55665..7113e7774d 100644 --- a/packages/cli/src/decorators/RestController.ts +++ b/packages/cli/src/decorators/RestController.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ import { CONTROLLER_BASE_PATH } from './constants'; export const RestController = diff --git a/packages/cli/src/decorators/Route.ts b/packages/cli/src/decorators/Route.ts index e51369a64c..38f0c8ab51 100644 --- a/packages/cli/src/decorators/Route.ts +++ b/packages/cli/src/decorators/Route.ts @@ -6,7 +6,6 @@ interface RouteOptions { middlewares?: RequestHandler[]; } -/* eslint-disable @typescript-eslint/naming-convention */ const RouteFactory = (method: Method) => (path: `/${string}`, options: RouteOptions = {}): MethodDecorator => diff --git a/packages/cli/src/environments/variables/variables.controller.ee.ts b/packages/cli/src/environments/variables/variables.controller.ee.ts index b97009552a..61e3d3a0db 100644 --- a/packages/cli/src/environments/variables/variables.controller.ee.ts +++ b/packages/cli/src/environments/variables/variables.controller.ee.ts @@ -11,7 +11,6 @@ import { import { isVariablesEnabled } from './enviromentHelpers'; import { Logger } from '@/Logger'; -// eslint-disable-next-line @typescript-eslint/naming-convention export const EEVariablesController = express.Router(); EEVariablesController.use((req, res, next) => { diff --git a/packages/cli/src/eventbus/eventBus.controller.ts b/packages/cli/src/eventbus/eventBus.controller.ts index 50d2f84525..d17fdf884a 100644 --- a/packages/cli/src/eventbus/eventBus.controller.ts +++ b/packages/cli/src/eventbus/eventBus.controller.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ import express from 'express'; import { isEventMessageOptions } from './EventMessageClasses/AbstractEventMessage'; import { EventMessageGeneric } from './EventMessageClasses/EventMessageGeneric'; diff --git a/packages/cli/src/executions/executions.controller.ee.ts b/packages/cli/src/executions/executions.controller.ee.ts index 0a7a1c329d..673d74d15c 100644 --- a/packages/cli/src/executions/executions.controller.ee.ts +++ b/packages/cli/src/executions/executions.controller.ee.ts @@ -9,7 +9,6 @@ import * as ResponseHelper from '@/ResponseHelper'; import { isSharingEnabled } from '@/UserManagement/UserManagementHelper'; import { EEExecutionsService } from './executions.service.ee'; -// eslint-disable-next-line @typescript-eslint/naming-convention export const EEExecutionsController = express.Router(); EEExecutionsController.use((req, res, next) => { diff --git a/packages/cli/src/middlewares/listQuery/filter.ts b/packages/cli/src/middlewares/listQuery/filter.ts index bfdb35d76d..9db1d85cd8 100644 --- a/packages/cli/src/middlewares/listQuery/filter.ts +++ b/packages/cli/src/middlewares/listQuery/filter.ts @@ -1,5 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ - import * as ResponseHelper from '@/ResponseHelper'; import { WorkflowFilter } from './dtos/workflow.filter.dto'; import { CredentialsFilter } from './dtos/credentials.filter.dto'; diff --git a/packages/cli/src/middlewares/listQuery/select.ts b/packages/cli/src/middlewares/listQuery/select.ts index a96a3cd31c..6511410a8c 100644 --- a/packages/cli/src/middlewares/listQuery/select.ts +++ b/packages/cli/src/middlewares/listQuery/select.ts @@ -1,5 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ - import { WorkflowSelect } from './dtos/workflow.select.dto'; import { UserSelect } from './dtos/user.select.dto'; import { CredentialsSelect } from './dtos/credentials.select.dto'; diff --git a/packages/cli/src/posthog/index.ts b/packages/cli/src/posthog/index.ts index 202a8cea97..b62a6eba8d 100644 --- a/packages/cli/src/posthog/index.ts +++ b/packages/cli/src/posthog/index.ts @@ -17,7 +17,6 @@ export class PostHogClient { return; } - // eslint-disable-next-line @typescript-eslint/naming-convention const { PostHog } = await import('posthog-node'); this.postHog = new PostHog(config.getEnv('diagnostics.config.posthog.apiKey'), { host: config.getEnv('diagnostics.config.posthog.apiHost'), diff --git a/packages/cli/src/services/redis/RedisServiceHelper.ts b/packages/cli/src/services/redis/RedisServiceHelper.ts index 4066689fe5..257a826b76 100644 --- a/packages/cli/src/services/redis/RedisServiceHelper.ts +++ b/packages/cli/src/services/redis/RedisServiceHelper.ts @@ -143,7 +143,6 @@ export async function getDefaultRedisClient( additionalRedisOptions?: RedisOptions, redisType?: RedisClientType, ): Promise { - // eslint-disable-next-line @typescript-eslint/naming-convention const { default: Redis } = await import('ioredis'); const clusterNodes = getRedisClusterNodes(); const usesRedisCluster = clusterNodes.length > 0; diff --git a/packages/cli/src/telemetry/index.ts b/packages/cli/src/telemetry/index.ts index 5bf92b8d07..bbd8cfcbeb 100644 --- a/packages/cli/src/telemetry/index.ts +++ b/packages/cli/src/telemetry/index.ts @@ -56,7 +56,6 @@ export class Telemetry { const logLevel = config.getEnv('logs.level'); - // eslint-disable-next-line @typescript-eslint/naming-convention const { default: RudderStack } = await import('@rudderstack/rudder-sdk-node'); this.rudderStack = new RudderStack(key, url, { logLevel }); diff --git a/packages/cli/src/workflows/workflows.controller.ee.ts b/packages/cli/src/workflows/workflows.controller.ee.ts index ceedb9aa90..a5c60ac043 100644 --- a/packages/cli/src/workflows/workflows.controller.ee.ts +++ b/packages/cli/src/workflows/workflows.controller.ee.ts @@ -24,7 +24,6 @@ import { TagService } from '@/services/tag.service'; import { Logger } from '@/Logger'; import { WorkflowHistoryService } from './workflowHistory/workflowHistory.service.ee'; -// eslint-disable-next-line @typescript-eslint/naming-convention export const EEWorkflowController = express.Router(); EEWorkflowController.use((req, res, next) => { diff --git a/packages/cli/src/workflows/workflows.services.ts b/packages/cli/src/workflows/workflows.services.ts index 840e718915..3b039c09cc 100644 --- a/packages/cli/src/workflows/workflows.services.ts +++ b/packages/cli/src/workflows/workflows.services.ts @@ -506,7 +506,6 @@ export class WorkflowsService { if (isWorkflowIdValid(workflow.id)) { // Workflow is saved so update in database try { - // eslint-disable-next-line @typescript-eslint/no-use-before-define await WorkflowsService.saveStaticDataById(workflow.id, workflow.staticData); workflow.staticData.__dataChanged = false; } catch (error) { diff --git a/packages/cli/test/integration/shared/types.ts b/packages/cli/test/integration/shared/types.ts index 10b39e52f7..d6ff1a77b3 100644 --- a/packages/cli/test/integration/shared/types.ts +++ b/packages/cli/test/integration/shared/types.ts @@ -8,7 +8,6 @@ import type { User } from '@db/entities/User'; import type { BooleanLicenseFeature, ICredentialsDb, IDatabaseCollections } from '@/Interfaces'; import type { DataSource, Repository } from 'typeorm'; -// eslint-disable-next-line @typescript-eslint/no-explicit-any export type CollectionName = | keyof IDatabaseCollections | { new (dataSource: DataSource): Repository }; diff --git a/packages/core/src/BinaryData/BinaryData.service.ts b/packages/core/src/BinaryData/BinaryData.service.ts index b96e87d915..4aec461ff3 100644 --- a/packages/core/src/BinaryData/BinaryData.service.ts +++ b/packages/core/src/BinaryData/BinaryData.service.ts @@ -1,5 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ - import { readFile, stat } from 'node:fs/promises'; import prettyBytes from 'pretty-bytes'; import Container, { Service } from 'typedi'; diff --git a/packages/core/src/WorkflowExecute.ts b/packages/core/src/WorkflowExecute.ts index fc31f0387e..afbe1af790 100644 --- a/packages/core/src/WorkflowExecute.ts +++ b/packages/core/src/WorkflowExecute.ts @@ -274,7 +274,6 @@ export class WorkflowExecute { } // Only run the parent nodes and no others - // eslint-disable-next-line prefer-const runNodeFilter = workflow .getParentNodes(destinationNode) .filter((parentNodeName) => !workflow.getNode(parentNodeName)?.disabled); diff --git a/packages/core/src/decorators/LogCatch.decorator.ts b/packages/core/src/decorators/LogCatch.decorator.ts index f43bc71d61..a5999c50ad 100644 --- a/packages/core/src/decorators/LogCatch.decorator.ts +++ b/packages/core/src/decorators/LogCatch.decorator.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ /* eslint-disable @typescript-eslint/no-unsafe-call */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ diff --git a/packages/design-system/src/components/N8nDatatable/__tests__/data.ts b/packages/design-system/src/components/N8nDatatable/__tests__/data.ts index a9b2c5aa7e..508e225b0d 100644 --- a/packages/design-system/src/components/N8nDatatable/__tests__/data.ts +++ b/packages/design-system/src/components/N8nDatatable/__tests__/data.ts @@ -3,7 +3,6 @@ import { defineComponent, h } from 'vue'; import type { DatatableRow } from '../../../types'; import N8nButton from '../../N8nButton'; -// eslint-disable-next-line @typescript-eslint/naming-convention export const ActionComponent = defineComponent({ props: { row: { diff --git a/packages/design-system/src/plugin.ts b/packages/design-system/src/plugin.ts index 2f0bea9017..b7a153469d 100644 --- a/packages/design-system/src/plugin.ts +++ b/packages/design-system/src/plugin.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ import type { Plugin } from 'vue'; import { N8nActionBox, diff --git a/packages/editor-ui/src/__tests__/server/endpoints/sso.ts b/packages/editor-ui/src/__tests__/server/endpoints/sso.ts index 61896ca1f7..0293bab063 100644 --- a/packages/editor-ui/src/__tests__/server/endpoints/sso.ts +++ b/packages/editor-ui/src/__tests__/server/endpoints/sso.ts @@ -18,9 +18,7 @@ export function routesForSSO(server: Server) { }); server.post('/rest/sso/saml/config', (schema: AppSchema, request: Request) => { - const requestBody = jsonParse(request.requestBody) as Partial< - SamlPreferences & SamlPreferencesExtractedData - >; + const requestBody = jsonParse(request.requestBody); samlConfig = { ...samlConfig, diff --git a/packages/editor-ui/src/components/CodeNodeEditor/completions/jsonField.completions.ts b/packages/editor-ui/src/components/CodeNodeEditor/completions/jsonField.completions.ts index 3d7b3cf531..bf0207da23 100644 --- a/packages/editor-ui/src/components/CodeNodeEditor/completions/jsonField.completions.ts +++ b/packages/editor-ui/src/components/CodeNodeEditor/completions/jsonField.completions.ts @@ -288,7 +288,7 @@ export const jsonFieldCompletions = defineComponent({ const pinData: IPinData | undefined = this.workflowsStore.getPinData; - const nodePinData = pinData && pinData[nodeName]; + const nodePinData = pinData?.[nodeName]; if (nodePinData) { try { diff --git a/packages/editor-ui/src/components/CollectionParameter.vue b/packages/editor-ui/src/components/CollectionParameter.vue index f3e55bb0c8..9ac581fb26 100644 --- a/packages/editor-ui/src/components/CollectionParameter.vue +++ b/packages/editor-ui/src/components/CollectionParameter.vue @@ -112,11 +112,9 @@ export default defineComponent({ }, // Returns all the options which did not get added already parameterOptions(): Array { - return (this.filteredOptions as Array).filter( - (option) => { - return !this.propertyNames.includes(option.name); - }, - ); + return this.filteredOptions.filter((option) => { + return !this.propertyNames.includes(option.name); + }); }, propertyNames(): string[] { if (this.values) { diff --git a/packages/editor-ui/src/components/CredentialEdit/AuthTypeSelector.vue b/packages/editor-ui/src/components/CredentialEdit/AuthTypeSelector.vue index 7c34a3a322..f78ac5ac28 100644 --- a/packages/editor-ui/src/components/CredentialEdit/AuthTypeSelector.vue +++ b/packages/editor-ui/src/components/CredentialEdit/AuthTypeSelector.vue @@ -13,7 +13,7 @@ import type { INodeProperties, INodeTypeDescription, NodeParameterValue } from ' import { computed, onMounted, ref } from 'vue'; export interface Props { - credentialType: Object; + credentialType: object; } const emit = defineEmits<{ @@ -87,7 +87,7 @@ function shouldShowAuthOption(option: NodeAuthenticationOption): boolean { let shouldDisplay = false; Object.keys(authRelatedFieldsValues.value).forEach((fieldName) => { - if (option.displayOptions && option.displayOptions.show) { + if (option.displayOptions?.show) { if ( option.displayOptions.show[fieldName]?.includes(authRelatedFieldsValues.value[fieldName]) ) { diff --git a/packages/editor-ui/src/components/CredentialEdit/CredentialConfig.vue b/packages/editor-ui/src/components/CredentialEdit/CredentialConfig.vue index 37b8e7f4c7..345bc40e3e 100644 --- a/packages/editor-ui/src/components/CredentialEdit/CredentialConfig.vue +++ b/packages/editor-ui/src/components/CredentialEdit/CredentialConfig.vue @@ -288,7 +288,7 @@ export default defineComponent({ const activeNode = this.ndvStore.activeNode; const isCommunityNode = activeNode ? isCommunityPackageName(activeNode.type) : false; - const documentationUrl = type && type.documentationUrl; + const documentationUrl = type?.documentationUrl; if (!documentationUrl) { return ''; diff --git a/packages/editor-ui/src/components/CredentialEdit/CredentialEdit.vue b/packages/editor-ui/src/components/CredentialEdit/CredentialEdit.vue index 22a5e8f3ef..e05494f4ce 100644 --- a/packages/editor-ui/src/components/CredentialEdit/CredentialEdit.vue +++ b/packages/editor-ui/src/components/CredentialEdit/CredentialEdit.vue @@ -125,6 +125,7 @@ import type { INodeProperties, INodeTypeDescription, ITelemetryTrackProperties, + IDataObject, } from 'n8n-workflow'; import { NodeHelpers } from 'n8n-workflow'; import CredentialIcon from '@/components/CredentialIcon.vue'; @@ -139,7 +140,6 @@ import SaveButton from '@/components/SaveButton.vue'; import Modal from '@/components/Modal.vue'; import InlineNameEdit from '@/components/InlineNameEdit.vue'; import { CREDENTIAL_EDIT_MODAL_KEY, EnterpriseEditionFeature, MODAL_CONFIRM } from '@/constants'; -import type { IDataObject } from 'n8n-workflow'; import FeatureComingSoon from '@/components/FeatureComingSoon.vue'; import type { IPermissions } from '@/permissions'; import { getCredentialPermissions } from '@/permissions'; @@ -270,7 +270,7 @@ export default defineComponent({ setTimeout(async () => { if (this.credentialId) { - if (!this.requiredPropertiesFilled && this.credentialPermissions.isOwner === true) { + if (!this.requiredPropertiesFilled && this.credentialPermissions.isOwner) { // sharees can't see properties, so this check would always fail for them // if the credential contains required fields. this.showValidationWarning = true; @@ -364,7 +364,7 @@ export default defineComponent({ }, isCredentialTestable(): boolean { // Sharees can always test since they can't see the data. - if (this.credentialPermissions.isOwner === false) { + if (!this.credentialPermissions.isOwner) { return true; } if (this.isOAuthType || !this.requiredPropertiesFilled) { @@ -495,7 +495,7 @@ export default defineComponent({ defaultCredentialTypeName(): string { let credentialTypeName = this.credentialTypeName; if (!credentialTypeName || credentialTypeName === 'null') { - if (this.activeNodeType && this.activeNodeType.credentials) { + if (this.activeNodeType?.credentials) { credentialTypeName = this.activeNodeType.credentials[0].name; } } @@ -701,7 +701,7 @@ export default defineComponent({ getParentTypes(name: string): string[] { const credentialType = this.credentialsStore.getCredentialTypeByName(name); - if (credentialType === undefined || credentialType.extends === undefined) { + if (credentialType?.extends === undefined) { return []; } @@ -828,7 +828,7 @@ export default defineComponent({ this.isSaving = false; if (credential) { - this.credentialId = credential.id as string; + this.credentialId = credential.id; if (this.isCredentialTestable) { this.isTesting = true; diff --git a/packages/editor-ui/src/components/DuplicateWorkflowDialog.vue b/packages/editor-ui/src/components/DuplicateWorkflowDialog.vue index 62e78ed347..ef21f5f6be 100644 --- a/packages/editor-ui/src/components/DuplicateWorkflowDialog.vue +++ b/packages/editor-ui/src/components/DuplicateWorkflowDialog.vue @@ -122,7 +122,7 @@ export default defineComponent({ }, focusOnNameInput() { const inputRef = this.$refs.nameInput as HTMLElement | undefined; - if (inputRef && inputRef.focus) { + if (inputRef?.focus) { inputRef.focus(); } }, diff --git a/packages/editor-ui/src/components/Error/NodeErrorView.vue b/packages/editor-ui/src/components/Error/NodeErrorView.vue index 03c6268e0e..965efcc39f 100644 --- a/packages/editor-ui/src/components/Error/NodeErrorView.vue +++ b/packages/editor-ui/src/components/Error/NodeErrorView.vue @@ -170,7 +170,7 @@ export default defineComponent({ .replace(/%%PARAMETER_FULL%%/g, parameterFullName); }, getErrorDescription(): string { - if (!this.error.context || !this.error.context.descriptionTemplate) { + if (!this.error.context?.descriptionTemplate) { return sanitizeHtml(this.error.description); } @@ -182,7 +182,7 @@ export default defineComponent({ getErrorMessage(): string { const baseErrorMessage = this.$locale.baseText('nodeErrorView.error') + ': '; - if (!this.error.context || !this.error.context.messageTemplate) { + if (!this.error.context?.messageTemplate) { return baseErrorMessage + this.error.message; } @@ -200,7 +200,7 @@ export default defineComponent({ throw new Error(); } - if (fullPath === false) { + if (!fullPath) { return parameters.pop()!.displayName; } return parameters.map((parameter) => parameter.displayName).join(' > '); diff --git a/packages/editor-ui/src/components/ExecutionsView/ExecutionsInfoAccordion.vue b/packages/editor-ui/src/components/ExecutionsView/ExecutionsInfoAccordion.vue index ade83195c3..950b825798 100644 --- a/packages/editor-ui/src/components/ExecutionsView/ExecutionsInfoAccordion.vue +++ b/packages/editor-ui/src/components/ExecutionsView/ExecutionsInfoAccordion.vue @@ -89,7 +89,7 @@ export default defineComponent({ }, computed: { ...mapStores(useRootStore, useSettingsStore, useUIStore, useWorkflowsStore), - accordionItems(): Object[] { + accordionItems(): object[] { return [ { id: 'productionExecutions', @@ -114,7 +114,7 @@ export default defineComponent({ ]; }, shouldExpandAccordion(): boolean { - if (this.initiallyExpanded === false) { + if (!this.initiallyExpanded) { return false; } return ( diff --git a/packages/editor-ui/src/components/ExecutionsView/ExecutionsList.vue b/packages/editor-ui/src/components/ExecutionsView/ExecutionsList.vue index dc90e94ec4..aeffa1e80f 100644 --- a/packages/editor-ui/src/components/ExecutionsView/ExecutionsList.vue +++ b/packages/editor-ui/src/components/ExecutionsView/ExecutionsList.vue @@ -98,8 +98,7 @@ export default defineComponent({ ...mapStores(useTagsStore, useNodeTypesStore, useSettingsStore, useUIStore, useWorkflowsStore), hidePreview(): boolean { const activeNotPresent = - this.filterApplied && - !(this.executions as IExecutionsSummary[]).find((ex) => ex.id === this.activeExecution?.id); + this.filterApplied && !this.executions.find((ex) => ex.id === this.activeExecution?.id); return this.loading || !this.executions.length || activeNotPresent; }, filterApplied(): boolean { @@ -193,7 +192,7 @@ export default defineComponent({ } } - this.autoRefresh = this.uiStore.executionSidebarAutoRefresh === true; + this.autoRefresh = this.uiStore.executionSidebarAutoRefresh; void this.startAutoRefreshInterval(); document.addEventListener('visibilitychange', this.onDocumentVisibilityChange); @@ -581,7 +580,7 @@ export default defineComponent({ this.uiStore.stateIsDirty = false; }, async addNodes(nodes: INodeUi[], connections?: IConnections) { - if (!nodes || !nodes.length) { + if (!nodes?.length) { return; } @@ -723,7 +722,7 @@ export default defineComponent({ loadWorkflow, ); - if (retrySuccessful === true) { + if (retrySuccessful) { this.showMessage({ title: this.$locale.baseText('executionsList.showMessage.retrySuccessfulTrue.title'), type: 'success', diff --git a/packages/editor-ui/src/components/ExecutionsView/ExecutionsSidebar.vue b/packages/editor-ui/src/components/ExecutionsView/ExecutionsSidebar.vue index 7469a77a18..d8c26cd5dc 100644 --- a/packages/editor-ui/src/components/ExecutionsView/ExecutionsSidebar.vue +++ b/packages/editor-ui/src/components/ExecutionsView/ExecutionsSidebar.vue @@ -145,7 +145,7 @@ export default defineComponent({ } } }, - onRetryExecution(payload: Object) { + onRetryExecution(payload: object) { this.$emit('retryExecution', payload); }, onRefresh(): void { diff --git a/packages/editor-ui/src/components/ExpressionEdit.vue b/packages/editor-ui/src/components/ExpressionEdit.vue index 2b1bfd2264..246a4d1af1 100644 --- a/packages/editor-ui/src/components/ExpressionEdit.vue +++ b/packages/editor-ui/src/components/ExpressionEdit.vue @@ -124,7 +124,7 @@ export default defineComponent({ this.latestValue = value; this.segments = segments; - if (forceUpdate === true) { + if (forceUpdate) { this.updateDisplayValue(); this.$emit('update:modelValue', this.latestValue); } else { diff --git a/packages/editor-ui/src/components/ExternalSecretsProviderCard.ee.vue b/packages/editor-ui/src/components/ExternalSecretsProviderCard.ee.vue index ed4934733c..437613d3e4 100644 --- a/packages/editor-ui/src/components/ExternalSecretsProviderCard.ee.vue +++ b/packages/editor-ui/src/components/ExternalSecretsProviderCard.ee.vue @@ -51,7 +51,7 @@ const canConnect = computed(() => { }); const formattedDate = computed((provider: ExternalSecretsProvider) => { - return DateTime.fromISO(props.provider.connectedAt!).toFormat('dd LLL yyyy'); + return DateTime.fromISO(props.provider.connectedAt).toFormat('dd LLL yyyy'); }); onMounted(() => { diff --git a/packages/editor-ui/src/components/ExternalSecretsProviderModal.ee.vue b/packages/editor-ui/src/components/ExternalSecretsProviderModal.ee.vue index 64c2d54d7b..fd292a3ad8 100644 --- a/packages/editor-ui/src/components/ExternalSecretsProviderModal.ee.vue +++ b/packages/editor-ui/src/components/ExternalSecretsProviderModal.ee.vue @@ -9,12 +9,15 @@ import { useExternalSecretsStore } from '@/stores/externalSecrets.ee.store'; import { useUIStore } from '@/stores'; import { useRoute } from 'vue-router'; import ParameterInputExpanded from '@/components/ParameterInputExpanded.vue'; -import type { IUpdateInformation, ExternalSecretsProviderData } from '@/Interface'; +import type { + IUpdateInformation, + ExternalSecretsProviderData, + ExternalSecretsProvider, +} from '@/Interface'; import type { IParameterLabel } from 'n8n-workflow'; import ExternalSecretsProviderImage from '@/components/ExternalSecretsProviderImage.ee.vue'; import ExternalSecretsProviderConnectionSwitch from '@/components/ExternalSecretsProviderConnectionSwitch.ee.vue'; import { createEventBus } from 'n8n-design-system/utils'; -import type { ExternalSecretsProvider } from '@/Interface'; const props = defineProps({ data: { diff --git a/packages/editor-ui/src/components/HoverableNodeIcon.vue b/packages/editor-ui/src/components/HoverableNodeIcon.vue index 5e79a51cd9..22b665f626 100644 --- a/packages/editor-ui/src/components/HoverableNodeIcon.vue +++ b/packages/editor-ui/src/components/HoverableNodeIcon.vue @@ -84,7 +84,7 @@ export default defineComponent({ }, iconStyleData(): object { const nodeType = this.nodeType as ITemplatesNode | null; - const color = nodeType ? nodeType.defaults && nodeType!.defaults.color : ''; + const color = nodeType ? nodeType.defaults && nodeType.defaults.color : ''; if (!this.size) { return { color }; } diff --git a/packages/editor-ui/src/components/Node/NodeCreation.vue b/packages/editor-ui/src/components/Node/NodeCreation.vue index 106a95b148..dd8c7c5fc1 100644 --- a/packages/editor-ui/src/components/Node/NodeCreation.vue +++ b/packages/editor-ui/src/components/Node/NodeCreation.vue @@ -16,7 +16,7 @@ type Props = { createNodeActive?: boolean; }; -// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unsafe-assignment +// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const NodeCreator = defineAsyncComponent( async () => import('@/components/Node/NodeCreator/NodeCreator.vue'), ); diff --git a/packages/editor-ui/src/components/Node/NodeCreator/Modes/ActionsMode.vue b/packages/editor-ui/src/components/Node/NodeCreator/Modes/ActionsMode.vue index 10de4d1375..f6fc5adb4e 100644 --- a/packages/editor-ui/src/components/Node/NodeCreator/Modes/ActionsMode.vue +++ b/packages/editor-ui/src/components/Node/NodeCreator/Modes/ActionsMode.vue @@ -104,7 +104,7 @@ const containsAPIAction = computed(() => { return ((p as ActionCreateElement).properties.actionKey ?? '') === CUSTOM_API_CALL_KEY; }); - return result === true; + return result; }); const isTriggerRootView = computed(() => rootView.value === TRIGGER_NODE_CREATOR_VIEW); diff --git a/packages/editor-ui/src/components/Node/NodeCreator/NodeCreator.vue b/packages/editor-ui/src/components/Node/NodeCreator/NodeCreator.vue index 6b72ef4ecc..68bf1ad64c 100644 --- a/packages/editor-ui/src/components/Node/NodeCreator/NodeCreator.vue +++ b/packages/editor-ui/src/components/Node/NodeCreator/NodeCreator.vue @@ -110,7 +110,7 @@ function onDrop(event: DragEvent) { watch( () => props.active, (isActive) => { - if (isActive === false) { + if (!isActive) { setShowScrim(false); resetViewStacks(); } diff --git a/packages/editor-ui/src/components/Node/NodeCreator/__tests__/ItemsRenderer.test.ts b/packages/editor-ui/src/components/Node/NodeCreator/__tests__/ItemsRenderer.test.ts index 27c9516588..62474acd43 100644 --- a/packages/editor-ui/src/components/Node/NodeCreator/__tests__/ItemsRenderer.test.ts +++ b/packages/editor-ui/src/components/Node/NodeCreator/__tests__/ItemsRenderer.test.ts @@ -5,10 +5,10 @@ import { mockSubcategoryCreateElement, mockLabelCreateElement, mockNodeCreateElement, + mockActionCreateElement, + mockViewCreateElement, } from './utils'; import ItemsRenderer from '../Renderers/ItemsRenderer.vue'; -import { mockActionCreateElement } from './utils'; -import { mockViewCreateElement } from './utils'; import { createComponentRenderer } from '@/__tests__/render'; const renderComponent = createComponentRenderer(ItemsRenderer); diff --git a/packages/editor-ui/src/components/Node/NodeCreator/composables/useActions.ts b/packages/editor-ui/src/components/Node/NodeCreator/composables/useActions.ts index 41a91f34ad..4c4303bf66 100644 --- a/packages/editor-ui/src/components/Node/NodeCreator/composables/useActions.ts +++ b/packages/editor-ui/src/components/Node/NodeCreator/composables/useActions.ts @@ -145,7 +145,7 @@ export const useActions = () => { return { name: actionItem.displayName, - key: actionItem.name as string, + key: actionItem.name, value: { ...actionItem.values, ...displayConditions } as INodeParameters, }; } diff --git a/packages/editor-ui/src/components/Node/NodeCreator/composables/useActionsGeneration.ts b/packages/editor-ui/src/components/Node/NodeCreator/composables/useActionsGeneration.ts index 20562e9526..41cd7657e1 100644 --- a/packages/editor-ui/src/components/Node/NodeCreator/composables/useActionsGeneration.ts +++ b/packages/editor-ui/src/components/Node/NodeCreator/composables/useActionsGeneration.ts @@ -70,7 +70,7 @@ function operationsCategory(nodeTypeDescription: INodeTypeDescription): ActionTy (property) => property.name?.toLowerCase() === 'operation', ); - if (!matchedProperty || !matchedProperty.options) return []; + if (!matchedProperty?.options) return []; const filteredOutItems = (matchedProperty.options as INodePropertyOptions[]).filter( (categoryItem: INodePropertyOptions) => !['*', '', ' '].includes(categoryItem.name), @@ -104,7 +104,7 @@ function triggersCategory(nodeTypeDescription: INodeTypeDescription): ActionType // Inject placeholder action if no events are available // so user is able to add node to the canvas from the actions panel - if (!matchedProperty || !matchedProperty.options) { + if (!matchedProperty?.options) { return [ { ...getNodeTypeBase(nodeTypeDescription), @@ -191,7 +191,7 @@ function resourceCategories(nodeTypeDescription: INodeTypeDescription): ActionTy // We need to manually populate displayOptions as they are not present in the node description // if the resource has only one option const displayOptions = isSingleResource - ? { show: { resource: [(options as INodePropertyOptions[])[0]?.value] } } + ? { show: { resource: [options[0]?.value] } } : operations?.displayOptions; return { diff --git a/packages/editor-ui/src/components/NodeSettings.vue b/packages/editor-ui/src/components/NodeSettings.vue index b9b5b66487..7e6186ab71 100644 --- a/packages/editor-ui/src/components/NodeSettings.vue +++ b/packages/editor-ui/src/components/NodeSettings.vue @@ -236,7 +236,7 @@ export default defineComponent({ if (this.nodeType && this.node) { const workflow = this.workflowsStore.getCurrentWorkflow(); const workflowNode = workflow.getNode(this.node.name); - const inputs = NodeHelpers.getNodeInputs(workflow, workflowNode!, this.nodeType!); + const inputs = NodeHelpers.getNodeInputs(workflow, workflowNode!, this.nodeType); const inputNames = NodeHelpers.getConnectionTypes(inputs); if (!inputNames.includes(NodeConnectionType.Main) && !this.isTriggerNode) { diff --git a/packages/editor-ui/src/components/ParameterInput.vue b/packages/editor-ui/src/components/ParameterInput.vue index 68a0aab704..a96688ed95 100644 --- a/packages/editor-ui/src/components/ParameterInput.vue +++ b/packages/editor-ui/src/components/ParameterInput.vue @@ -632,7 +632,7 @@ export default defineComponent({ return this.i18n.baseText('parameterInput.parameter', interpolation); }, displayValue(): string | number | boolean | null { - if (this.remoteParameterOptionsLoading === true) { + if (this.remoteParameterOptionsLoading) { // If it is loading options from server display // to user that the data is loading. If not it would // display the user the key instead of the value it @@ -646,7 +646,7 @@ export default defineComponent({ } let returnValue; - if (this.isValueExpression === false) { + if (!this.isValueExpression) { returnValue = this.isResourceLocatorParameter ? isResourceLocatorValue(this.modelValue) ? this.modelValue.value @@ -706,7 +706,7 @@ export default defineComponent({ return 'text'; }, getIssues(): string[] { - if (this.hideIssues === true || this.node === null) { + if (this.hideIssues || this.node === null) { return []; } @@ -728,7 +728,7 @@ export default defineComponent({ issues.parameters[this.parameter.name] = [issue]; } else if ( ['options', 'multiOptions'].includes(this.parameter.type) && - this.remoteParameterOptionsLoading === false && + !this.remoteParameterOptionsLoading && this.remoteParameterOptionsLoadingIssues === null && this.parameterOptions ) { @@ -772,11 +772,7 @@ export default defineComponent({ ]; } - if ( - issues !== undefined && - issues.parameters !== undefined && - issues.parameters[this.parameter.name] !== undefined - ) { + if (issues?.parameters?.[this.parameter.name] !== undefined) { return issues.parameters[this.parameter.name]; } @@ -792,7 +788,7 @@ export default defineComponent({ parameterOptions(): | Array | undefined { - if (this.hasRemoteMethod === false) { + if (!this.hasRemoteMethod) { // Options are already given return this.parameter.options; } @@ -909,7 +905,7 @@ export default defineComponent({ async loadRemoteParameterOptions() { if ( this.node === null || - this.hasRemoteMethod === false || + !this.hasRemoteMethod || this.remoteParameterOptionsLoading || !this.parameter ) { @@ -965,7 +961,7 @@ export default defineComponent({ return; } - if ((this.node.type as string).startsWith('n8n-nodes-base')) { + if (this.node.type.startsWith('n8n-nodes-base')) { this.$telemetry.track('User opened Expression Editor', { node_type: this.node.type, parameter_name: this.parameter.displayName, @@ -1062,9 +1058,7 @@ export default defineComponent({ }, rgbaToHex(value: string): string | null { // Convert rgba to hex from: https://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb - const valueMatch = (value as string).match( - /^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d+(\.\d+)?)\)$/, - ); + const valueMatch = value.match(/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d+(\.\d+)?)\)$/); if (valueMatch === null) { // TODO: Display something if value is not valid return null; @@ -1245,7 +1239,7 @@ export default defineComponent({ } } - if (this.hasRemoteMethod === true && this.node !== null) { + if (this.hasRemoteMethod && this.node !== null) { // Make sure to load the parameter options // directly and whenever the credentials change this.$watch( @@ -1259,7 +1253,7 @@ export default defineComponent({ void this.$externalHooks().run('parameterInput.mount', { parameter: this.parameter, - inputFieldRef: this.$refs['inputField'], + inputFieldRef: this.$refs.inputField, }); }, beforeUnmount() { diff --git a/packages/editor-ui/src/components/ParameterInputWrapper.vue b/packages/editor-ui/src/components/ParameterInputWrapper.vue index 4318932e8f..e8a4299b26 100644 --- a/packages/editor-ui/src/components/ParameterInputWrapper.vue +++ b/packages/editor-ui/src/components/ParameterInputWrapper.vue @@ -162,7 +162,7 @@ export default defineComponent({ if (this.isValueExpression) { return undefined; } - if (this.selectedRLMode && this.selectedRLMode.hint) { + if (this.selectedRLMode?.hint) { return this.selectedRLMode.hint; } diff --git a/packages/editor-ui/src/components/ParameterOptions.vue b/packages/editor-ui/src/components/ParameterOptions.vue index 934457803e..6027c472ce 100644 --- a/packages/editor-ui/src/components/ParameterOptions.vue +++ b/packages/editor-ui/src/components/ParameterOptions.vue @@ -100,7 +100,7 @@ export default defineComponent({ return this.parameter.noDataExpression !== true && this.showExpressionSelector; }, shouldShowOptions(): boolean { - if (this.isReadOnly === true) { + if (this.isReadOnly) { return false; } @@ -112,7 +112,7 @@ export default defineComponent({ return false; } - if (this.showOptions === true) { + if (this.showOptions) { return true; } diff --git a/packages/editor-ui/src/components/ResourceLocator/ResourceLocator.vue b/packages/editor-ui/src/components/ResourceLocator/ResourceLocator.vue index 4cb9f98b3e..e343fc5d67 100644 --- a/packages/editor-ui/src/components/ResourceLocator/ResourceLocator.vue +++ b/packages/editor-ui/src/components/ResourceLocator/ResourceLocator.vue @@ -303,7 +303,7 @@ export default defineComponent({ if (!node) { return false; } - return !!(node && node.credentials && Object.keys(node.credentials).length === 1); + return !!(node?.credentials && Object.keys(node.credentials).length === 1); }, credentialsNotSet(): boolean { const nodeType = this.nodeTypesStore.getNodeType(this.node?.type); @@ -350,7 +350,7 @@ export default defineComponent({ }, urlValue(): string | null { if (this.isListMode && typeof this.modelValue === 'object') { - return (this.modelValue && this.modelValue.cachedResultUrl) || null; + return this.modelValue?.cachedResultUrl || null; } if (this.selectedMode === 'url') { @@ -394,7 +394,7 @@ export default defineComponent({ const cacheKeys = { ...this.currentRequestParams }; cacheKeys.parameters = Object.keys(this.node ? this.node.parameters : {}).reduce( (accu: INodeParameters, param) => { - if (param !== this.parameter.name && this.node && this.node.parameters) { + if (param !== this.parameter.name && this.node?.parameters) { accu[param] = this.node.parameters[param]; } @@ -418,7 +418,7 @@ export default defineComponent({ ); }, currentQueryHasMore(): boolean { - return !!(this.currentResponse && this.currentResponse.nextPageToken); + return !!this.currentResponse?.nextPageToken; }, currentQueryLoading(): boolean { if (this.requiresSearchFilter && this.searchFilter === '') { @@ -449,14 +449,13 @@ export default defineComponent({ } }, isValueExpression(newValue: boolean) { - if (newValue === true) { + if (newValue) { this.switchFromListMode(); } }, currentMode(mode: INodePropertyMode) { if ( - mode.extractValue && - mode.extractValue.regex && + mode.extractValue?.regex && isResourceLocatorValue(this.modelValue) && this.modelValue.__regex !== mode.extractValue.regex ) { @@ -546,7 +545,7 @@ export default defineComponent({ }, openCredential(): void { const node = this.ndvStore.activeNode; - if (!node || !node.credentials) { + if (!node?.credentials) { return; } const credentialKey = Object.keys(node.credentials)[0]; @@ -585,11 +584,11 @@ export default defineComponent({ const params: INodeParameterResourceLocator = { __rl: true, value, mode: this.selectedMode }; if (this.isListMode) { const resource = this.currentQueryResults.find((resource) => resource.value === value); - if (resource && resource.name) { + if (resource?.name) { params.cachedResultName = resource.name; } - if (resource && resource.url) { + if (resource?.url) { params.cachedResultUrl = resource.url; } } @@ -598,7 +597,7 @@ export default defineComponent({ onModeSelected(value: string): void { if (typeof this.modelValue !== 'object') { this.$emit('update:modelValue', { __rl: true, value: this.modelValue, mode: value }); - } else if (value === 'url' && this.modelValue && this.modelValue.cachedResultUrl) { + } else if (value === 'url' && this.modelValue?.cachedResultUrl) { this.$emit('update:modelValue', { __rl: true, mode: value, @@ -621,9 +620,9 @@ export default defineComponent({ this.$telemetry.track(event, { instance_id: this.rootStore.instanceId, workflow_id: this.workflowsStore.workflowId, - node_type: this.node && this.node.type, - resource: this.node && this.node.parameters && this.node.parameters.resource, - operation: this.node && this.node.parameters && this.node.parameters.operation, + node_type: this.node?.type, + resource: this.node?.parameters && this.node.parameters.resource, + operation: this.node?.parameters && this.node.parameters.operation, field_name: this.parameter.name, ...params, }); diff --git a/packages/editor-ui/src/components/ResourceMapper/MappingFields.vue b/packages/editor-ui/src/components/ResourceMapper/MappingFields.vue index 1ba56e0bcd..9bc63f0797 100644 --- a/packages/editor-ui/src/components/ResourceMapper/MappingFields.vue +++ b/packages/editor-ui/src/components/ResourceMapper/MappingFields.vue @@ -65,7 +65,7 @@ function markAsReadOnly(field: ResourceMapperField): boolean { const fieldsUi = computed & { readOnly?: boolean }>>(() => { return props.fieldsToMap - .filter((field) => field.display !== false && field.removed !== true) + .filter((field) => field.display && field.removed !== true) .map((field) => { return { displayName: getFieldLabel(field), @@ -98,7 +98,7 @@ const orderedFields = computed & { readOnly?: boo }); const removedFields = computed(() => { - return props.fieldsToMap.filter((field) => field.removed === true && field.display !== false); + return props.fieldsToMap.filter((field) => field.removed === true && field.display); }); const addFieldOptions = computed>(() => { @@ -132,7 +132,7 @@ const parameterActions = computed(() => { return props.fieldsToMap.filter((field) => { - return (field.canBeUsedToMatch || field.defaultMatch) && field.display !== false; + return (field.canBeUsedToMatch || field.defaultMatch) && field.display; }); }); diff --git a/packages/editor-ui/src/components/ResourceMapper/ResourceMapper.vue b/packages/editor-ui/src/components/ResourceMapper/ResourceMapper.vue index a794048fff..638993dc7b 100644 --- a/packages/editor-ui/src/components/ResourceMapper/ResourceMapper.vue +++ b/packages/editor-ui/src/components/ResourceMapper/ResourceMapper.vue @@ -173,9 +173,7 @@ const hasAvailableMatchingColumns = computed(() => { return ( state.paramValue.schema.filter( (field) => - (field.canBeUsedToMatch || field.defaultMatch) && - field.display !== false && - field.removed !== true, + (field.canBeUsedToMatch || field.defaultMatch) && field.display && field.removed !== true, ).length > 0 ); } diff --git a/packages/editor-ui/src/components/RunDataSchema.vue b/packages/editor-ui/src/components/RunDataSchema.vue index 4611dd5881..0c7eefb887 100644 --- a/packages/editor-ui/src/components/RunDataSchema.vue +++ b/packages/editor-ui/src/components/RunDataSchema.vue @@ -35,7 +35,7 @@ const schema = computed(() => getSchemaForExecutionData(props.data)); const isDataEmpty = computed(() => isEmpty(props.data)); const onDragStart = (el: HTMLElement) => { - if (el && el.dataset?.path) { + if (el?.dataset?.path) { draggingPath.value = el.dataset.path; } diff --git a/packages/editor-ui/src/components/RunDataTable.vue b/packages/editor-ui/src/components/RunDataTable.vue index 82954ab4e4..4d7cff06a7 100644 --- a/packages/editor-ui/src/components/RunDataTable.vue +++ b/packages/editor-ui/src/components/RunDataTable.vue @@ -160,10 +160,9 @@ import { defineComponent } from 'vue'; import type { PropType } from 'vue'; import { mapStores } from 'pinia'; import type { INodeUi, ITableData, NDVState } from '@/Interface'; -import { getPairedItemId } from '@/utils'; +import { getPairedItemId, shorten } from '@/utils'; import type { GenericValue, IDataObject, INodeExecutionData } from 'n8n-workflow'; import Draggable from './Draggable.vue'; -import { shorten } from '@/utils'; import { externalHooks } from '@/mixins/externalHooks'; import { useWorkflowsStore } from '@/stores/workflows.store'; import { useNDVStore } from '@/stores/ndv.store'; @@ -384,7 +383,7 @@ export default defineComponent({ this.ndvStore.resetMappingTelemetry(); }, onCellDragStart(el: HTMLElement) { - if (el && el.dataset.value) { + if (el?.dataset.value) { this.draggingPath = el.dataset.value; } diff --git a/packages/editor-ui/src/components/SettingsLogStreaming/EventDestinationSettingsModal.ee.vue b/packages/editor-ui/src/components/SettingsLogStreaming/EventDestinationSettingsModal.ee.vue index a597211d65..83d6fa9a9a 100644 --- a/packages/editor-ui/src/components/SettingsLogStreaming/EventDestinationSettingsModal.ee.vue +++ b/packages/editor-ui/src/components/SettingsLogStreaming/EventDestinationSettingsModal.ee.vue @@ -244,9 +244,7 @@ export default defineComponent({ showRemoveConfirm: false, typeSelectValue: '', typeSelectPlaceholder: 'Destination Type', - nodeParameters: deepCopy( - defaultMessageEventBusDestinationOptions, - ) as MessageEventBusDestinationOptions, + nodeParameters: deepCopy(defaultMessageEventBusDestinationOptions), webhookDescription: webhookModalDescription, sentryDescription: sentryModalDescription, syslogDescription: syslogModalDescription, @@ -466,7 +464,7 @@ export default defineComponent({ return; } const saveResult = await this.logStreamingStore.saveDestination(this.nodeParameters); - if (saveResult === true) { + if (saveResult) { this.hasOnceBeenSaved = true; this.testMessageSent = false; this.unchanged = true; diff --git a/packages/editor-ui/src/components/SqlEditor/SqlEditor.vue b/packages/editor-ui/src/components/SqlEditor/SqlEditor.vue index 386b7dd681..f9c9224bb7 100644 --- a/packages/editor-ui/src/components/SqlEditor/SqlEditor.vue +++ b/packages/editor-ui/src/components/SqlEditor/SqlEditor.vue @@ -16,8 +16,7 @@ import { acceptCompletion, autocompletion, ifNotIn } from '@codemirror/autocompl import { indentWithTab, history, redo, toggleComment } from '@codemirror/commands'; import { bracketMatching, foldGutter, indentOnInput, LanguageSupport } from '@codemirror/language'; import { EditorState } from '@codemirror/state'; -import type { Line } from '@codemirror/state'; -import type { Extension } from '@codemirror/state'; +import type { Line, Extension } from '@codemirror/state'; import { dropCursor, EditorView, diff --git a/packages/editor-ui/src/components/Sticky.vue b/packages/editor-ui/src/components/Sticky.vue index 50d0b5e7e4..41b97a23b3 100644 --- a/packages/editor-ui/src/components/Sticky.vue +++ b/packages/editor-ui/src/components/Sticky.vue @@ -243,7 +243,7 @@ export default defineComponent({ this.workflowsStore.updateNodeProperties(updateInformation); }, touchStart() { - if (this.isTouchDevice === true && this.isMacOs === false && this.isTouchActive === false) { + if (this.isTouchDevice === true && !this.isMacOs && !this.isTouchActive) { this.isTouchActive = true; setTimeout(() => { this.isTouchActive = false; diff --git a/packages/editor-ui/src/components/TagsDropdown.vue b/packages/editor-ui/src/components/TagsDropdown.vue index 70002cd55b..1f6b395542 100644 --- a/packages/editor-ui/src/components/TagsDropdown.vue +++ b/packages/editor-ui/src/components/TagsDropdown.vue @@ -68,9 +68,8 @@ import { MAX_TAG_NAME_LENGTH, TAGS_MANAGER_MODAL_KEY } from '@/constants'; import { useI18n, useToast } from '@/composables'; import { useUIStore } from '@/stores/ui.store'; import { useTagsStore } from '@/stores/tags.store'; -import type { EventBus } from 'n8n-design-system'; +import type { EventBus, N8nOption, N8nSelect } from 'n8n-design-system'; import type { PropType } from 'vue'; -import type { N8nOption, N8nSelect } from 'n8n-design-system'; import { storeToRefs } from 'pinia'; type SelectRef = InstanceType; diff --git a/packages/editor-ui/src/components/TagsManager/TagsView/TagsTable.vue b/packages/editor-ui/src/components/TagsManager/TagsView/TagsTable.vue index 65bedf13bc..4f55ccdf64 100644 --- a/packages/editor-ui/src/components/TagsManager/TagsView/TagsTable.vue +++ b/packages/editor-ui/src/components/TagsManager/TagsView/TagsTable.vue @@ -180,7 +180,7 @@ export default defineComponent({ focusOnInput(): void { setTimeout(() => { const inputRef = this.$refs.nameInput as N8nInputRef | undefined; - if (inputRef && inputRef.focus) { + if (inputRef?.focus) { inputRef.focus(); } }, INPUT_TRANSITION_TIMEOUT); @@ -189,7 +189,7 @@ export default defineComponent({ focusOnDelete(): void { setTimeout(() => { const inputRef = this.$refs.deleteHiddenInput as N8nInputRef | undefined; - if (inputRef && inputRef.focus) { + if (inputRef?.focus) { inputRef.focus(); } }, DELETE_TRANSITION_TIMEOUT); @@ -206,7 +206,7 @@ export default defineComponent({ }, watch: { rows(newValue: ITagRow[] | undefined) { - if (newValue && newValue[0] && newValue[0].create) { + if (newValue?.[0] && newValue[0].create) { this.focusOnCreate(); } }, diff --git a/packages/editor-ui/src/components/Telemetry.vue b/packages/editor-ui/src/components/Telemetry.vue index 41ab6fa069..71caebd069 100644 --- a/packages/editor-ui/src/components/Telemetry.vue +++ b/packages/editor-ui/src/components/Telemetry.vue @@ -25,9 +25,7 @@ export default defineComponent({ return this.usersStore.currentUserId || ''; }, isTelemetryEnabledOnRoute(): boolean { - return this.$route.meta && this.$route.meta.telemetry - ? !this.$route.meta.telemetry.disabled - : true; + return this.$route.meta?.telemetry ? !this.$route.meta.telemetry.disabled : true; }, telemetry(): ITelemetrySettings { return this.settingsStore.telemetry; diff --git a/packages/editor-ui/src/components/VariableSelector.vue b/packages/editor-ui/src/components/VariableSelector.vue index 61a22af671..62074917da 100644 --- a/packages/editor-ui/src/components/VariableSelector.vue +++ b/packages/editor-ui/src/components/VariableSelector.vue @@ -135,7 +135,7 @@ export default defineComponent({ return newItems; } - if (inputData && inputData.options) { + if (inputData?.options) { const newOptions = this.removeEmptyEntries(inputData.options); if (Array.isArray(newOptions) && newOptions.length) { // Has still options left so return @@ -391,7 +391,7 @@ export default defineComponent({ // Get json data if (outputData.hasOwnProperty('json')) { - const jsonPropertyPrefix = useShort === true ? '$json' : `$('${nodeName}').item.json`; + const jsonPropertyPrefix = useShort ? '$json' : `$('${nodeName}').item.json`; const jsonDataOptions: IVariableSelectorOption[] = []; for (const propertyName of Object.keys(outputData.json)) { @@ -416,7 +416,7 @@ export default defineComponent({ // Get binary data if (outputData.hasOwnProperty('binary')) { - const binaryPropertyPrefix = useShort === true ? '$binary' : `$('${nodeName}').item.binary`; + const binaryPropertyPrefix = useShort ? '$binary' : `$('${nodeName}').item.binary`; const binaryData = []; let binaryPropertyData = []; @@ -610,7 +610,7 @@ export default defineComponent({ let tempOptions: IVariableSelectorOption[]; - if (executionData !== null && executionData.data !== undefined) { + if (executionData?.data !== undefined) { const runExecutionData: IRunExecutionData = executionData.data; tempOptions = this.getNodeContext( @@ -791,7 +791,7 @@ export default defineComponent({ } as IVariableSelectorOption, ]; - if (executionData !== null && executionData.data !== undefined) { + if (executionData?.data !== undefined) { const runExecutionData: IRunExecutionData = executionData.data; parentNode = this.workflow.getParentNodes(nodeName, inputName, 1); diff --git a/packages/editor-ui/src/components/VersionCard.vue b/packages/editor-ui/src/components/VersionCard.vue index 3539d14c7c..d5035b3ba5 100644 --- a/packages/editor-ui/src/components/VersionCard.vue +++ b/packages/editor-ui/src/components/VersionCard.vue @@ -52,8 +52,7 @@ import NodeIcon from './NodeIcon.vue'; import TimeAgo from './TimeAgo.vue'; import Badge from './Badge.vue'; import WarningTooltip from './WarningTooltip.vue'; -import type { IVersionNode } from '@/Interface'; -import type { IVersion } from '@/Interface'; +import type { IVersionNode, IVersion } from '@/Interface'; export default defineComponent({ name: 'VersionCard', diff --git a/packages/editor-ui/src/components/WorkflowActivator.vue b/packages/editor-ui/src/components/WorkflowActivator.vue index c6bd5274ff..3c40b9cad5 100644 --- a/packages/editor-ui/src/components/WorkflowActivator.vue +++ b/packages/editor-ui/src/components/WorkflowActivator.vue @@ -82,7 +82,7 @@ export default defineComponent({ return this.workflowActive === true && this.isWorkflowActive !== this.workflowActive; }, getActiveColor(): string { - if (this.couldNotBeStarted === true) { + if (this.couldNotBeStarted) { return '#ff4949'; } return '#13ce66'; diff --git a/packages/editor-ui/src/components/WorkflowShareModal.ee.vue b/packages/editor-ui/src/components/WorkflowShareModal.ee.vue index 77051da9c3..dfb2b4d844 100644 --- a/packages/editor-ui/src/components/WorkflowShareModal.ee.vue +++ b/packages/editor-ui/src/components/WorkflowShareModal.ee.vue @@ -221,9 +221,7 @@ export default defineComponent({ return ( [ { - ...(this.workflow && this.workflow.ownedBy - ? this.workflow.ownedBy - : this.usersStore.currentUser), + ...(this.workflow?.ownedBy ? this.workflow.ownedBy : this.usersStore.currentUser), isOwner: true, }, ] as Array> @@ -357,8 +355,8 @@ export default defineComponent({ (workflowSharee) => workflowSharee.id === sharee.id, ); }) && - !this.workflow.sharedWith!.find( - (workflowSharee) => workflowSharee.id === credential.ownedBy!.id, + !this.workflow.sharedWith.find( + (workflowSharee) => workflowSharee.id === credential.ownedBy.id, ); } diff --git a/packages/editor-ui/src/components/forms/ResourceFiltersDropdown.vue b/packages/editor-ui/src/components/forms/ResourceFiltersDropdown.vue index 1cbe786fff..74da3622b0 100644 --- a/packages/editor-ui/src/components/forms/ResourceFiltersDropdown.vue +++ b/packages/editor-ui/src/components/forms/ResourceFiltersDropdown.vue @@ -109,7 +109,7 @@ export default defineComponent({ filtersLength(): number { let length = 0; - (this.keys as string[]).forEach((key) => { + this.keys.forEach((key) => { if (key === 'search') { return; } @@ -144,7 +144,7 @@ export default defineComponent({ } else { const filters = { ...this.modelValue }; - (this.keys as string[]).forEach((key) => { + this.keys.forEach((key) => { filters[key] = Array.isArray(this.modelValue[key]) ? [] : ''; }); diff --git a/packages/editor-ui/src/components/layouts/ResourcesListLayout.vue b/packages/editor-ui/src/components/layouts/ResourcesListLayout.vue index bbf43af7c4..cbd5dd199d 100644 --- a/packages/editor-ui/src/components/layouts/ResourcesListLayout.vue +++ b/packages/editor-ui/src/components/layouts/ResourcesListLayout.vue @@ -193,8 +193,7 @@ import ResourceOwnershipSelect from '@/components/forms/ResourceOwnershipSelect. import ResourceFiltersDropdown from '@/components/forms/ResourceFiltersDropdown.vue'; import { useSettingsStore } from '@/stores/settings.store'; import { useUsersStore } from '@/stores/users.store'; -import type { N8nInput } from 'n8n-design-system'; -import type { DatatableColumn } from 'n8n-design-system'; +import type { N8nInput, DatatableColumn } from 'n8n-design-system'; import { useI18n } from '@/composables'; export interface IResource { @@ -338,10 +337,7 @@ export default defineComponent({ if (this.filtersModel.sharedWith) { matches = matches && - !!( - resource.sharedWith && - resource.sharedWith.find((sharee) => sharee.id === this.filtersModel.sharedWith) - ); + !!resource.sharedWith?.find((sharee) => sharee.id === this.filtersModel.sharedWith); } if (this.filtersModel.search) { @@ -360,20 +356,20 @@ export default defineComponent({ return filtered.sort((a, b) => { switch (this.sortBy) { case 'lastUpdated': - return this.sortFns['lastUpdated'] - ? this.sortFns['lastUpdated'](a, b) + return this.sortFns.lastUpdated + ? this.sortFns.lastUpdated(a, b) : new Date(b.updatedAt).valueOf() - new Date(a.updatedAt).valueOf(); case 'lastCreated': - return this.sortFns['lastCreated'] - ? this.sortFns['lastCreated'](a, b) + return this.sortFns.lastCreated + ? this.sortFns.lastCreated(a, b) : new Date(b.createdAt).valueOf() - new Date(a.createdAt).valueOf(); case 'nameAsc': - return this.sortFns['nameAsc'] - ? this.sortFns['nameAsc'](a, b) + return this.sortFns.nameAsc + ? this.sortFns.nameAsc(a, b) : this.displayName(a).trim().localeCompare(this.displayName(b).trim()); case 'nameDesc': - return this.sortFns['nameDesc'] - ? this.sortFns['nameDesc'](a, b) + return this.sortFns.nameDesc + ? this.sortFns.nameDesc(a, b) : this.displayName(b).trim().localeCompare(this.displayName(a).trim()); default: return this.sortFns[this.sortBy] ? this.sortFns[this.sortBy](a, b) : 0; diff --git a/packages/editor-ui/src/composables/__tests__/useDataSchema.test.ts b/packages/editor-ui/src/composables/__tests__/useDataSchema.test.ts index fb5a089d7c..62b3e7e229 100644 --- a/packages/editor-ui/src/composables/__tests__/useDataSchema.test.ts +++ b/packages/editor-ui/src/composables/__tests__/useDataSchema.test.ts @@ -284,7 +284,7 @@ describe('useDataSchema', () => { it('should return the correct data when using the generated json path on an object', () => { const input = { people: ['Joe', 'John'] }; - const schema = getSchema(input) as Schema; + const schema = getSchema(input); const pathData = jp.query( input, `$${((schema.value as Schema[])[0].value as Schema[])[0].path}`, @@ -297,7 +297,7 @@ describe('useDataSchema', () => { { name: 'John', age: 22, hobbies: ['surfing', 'traveling'] }, { name: 'Joe', age: 33, hobbies: ['skateboarding', 'gaming'] }, ]; - const schema = getSchema(input) as Schema; + const schema = getSchema(input); const pathData = jp.query( input, `$${(((schema.value as Schema[])[0].value as Schema[])[2].value as Schema[])[1].path}`, @@ -307,7 +307,7 @@ describe('useDataSchema', () => { it('should return the correct data when using the generated json path on a list of list', () => { const input = [[1, 2]]; - const schema = getSchema(input) as Schema; + const schema = getSchema(input); const pathData = jp.query( input, `$${((schema.value as Schema[])[0].value as Schema[])[1].path}`, @@ -322,7 +322,7 @@ describe('useDataSchema', () => { { name: 'Joe', age: 33 }, ], ]; - const schema = getSchema(input) as Schema; + const schema = getSchema(input); const pathData = jp.query( input, `$${(((schema.value as Schema[])[0].value as Schema[])[1].value as Schema[])[1].path}`, @@ -339,7 +339,7 @@ describe('useDataSchema', () => { ], }, ]; - const schema = getSchema(input) as Schema; + const schema = getSchema(input); const pathData = jp.query( input, `$${ diff --git a/packages/editor-ui/src/composables/useCanvasMouseSelect.ts b/packages/editor-ui/src/composables/useCanvasMouseSelect.ts index 843cab09a9..fdcfb21c9b 100644 --- a/packages/editor-ui/src/composables/useCanvasMouseSelect.ts +++ b/packages/editor-ui/src/composables/useCanvasMouseSelect.ts @@ -127,8 +127,8 @@ export default function useCanvasMouseSelect() { } function mouseUpMouseSelect(e: MouseEvent) { - if (selectActive.value === false) { - if (isTouchDevice === true && e.target instanceof HTMLElement) { + if (!selectActive.value) { + if (isTouchDevice && e.target instanceof HTMLElement) { if (e.target && e.target.id.includes('node-view')) { // Deselect all nodes deselectAllNodes(); @@ -156,7 +156,7 @@ export default function useCanvasMouseSelect() { _hideSelectBox(); } function mouseDownMouseSelect(e: MouseEvent, moveButtonPressed: boolean) { - if (isCtrlKeyPressed(e) === true || moveButtonPressed) { + if (isCtrlKeyPressed(e) || moveButtonPressed) { // We only care about it when the ctrl key is not pressed at the same time. // So we exit when it is pressed. return; diff --git a/packages/editor-ui/src/composables/useDeviceSupport.ts b/packages/editor-ui/src/composables/useDeviceSupport.ts index 1c7e5083ee..7bb9e52d03 100644 --- a/packages/editor-ui/src/composables/useDeviceSupport.ts +++ b/packages/editor-ui/src/composables/useDeviceSupport.ts @@ -19,7 +19,7 @@ export default function useDeviceSupportHelpers(): DeviceSupportHelpers { const controlKeyCode = ref(isMacOs.value ? 'Meta' : 'Control'); function isCtrlKeyPressed(e: MouseEvent | KeyboardEvent): boolean { - if (isTouchDevice.value === true && e instanceof MouseEvent) { + if (isTouchDevice.value && e instanceof MouseEvent) { return true; } if (isMacOs.value) { diff --git a/packages/editor-ui/src/composables/useHistoryHelper.ts b/packages/editor-ui/src/composables/useHistoryHelper.ts index b7de489c9d..e680ca91ad 100644 --- a/packages/editor-ui/src/composables/useHistoryHelper.ts +++ b/packages/editor-ui/src/composables/useHistoryHelper.ts @@ -1,12 +1,11 @@ import { MAIN_HEADER_TABS } from '@/constants'; import { useNDVStore } from '@/stores/ndv.store'; import type { Undoable } from '@/models/history'; -import { BulkCommand } from '@/models/history'; +import { BulkCommand, Command } from '@/models/history'; import { useHistoryStore } from '@/stores/history.store'; import { useUIStore } from '@/stores/ui.store'; import { ref, onMounted, onUnmounted, nextTick, getCurrentInstance } from 'vue'; -import { Command } from '@/models/history'; import { useDebounceHelper } from './useDebounce'; import useDeviceSupportHelpers from './useDeviceSupport'; import { getNodeViewTab } from '@/utils'; diff --git a/packages/editor-ui/src/constants.ts b/packages/editor-ui/src/constants.ts index 0dab6b84f8..b7f9227354 100644 --- a/packages/editor-ui/src/constants.ts +++ b/packages/editor-ui/src/constants.ts @@ -219,9 +219,8 @@ export const REQUEST_NODE_FORM_URL = 'https://n8n-community.typeform.com/to/K1fB // Node Connection Types export const NODE_CONNECTION_TYPE_ALLOW_MULTIPLE: NodeConnectionType[] = [ - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access NodeConnectionType.AiTool, - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + NodeConnectionType.Main, ]; diff --git a/packages/editor-ui/src/mixins/copyPaste.ts b/packages/editor-ui/src/mixins/copyPaste.ts index c2fdb22328..1eaac44ea9 100644 --- a/packages/editor-ui/src/mixins/copyPaste.ts +++ b/packages/editor-ui/src/mixins/copyPaste.ts @@ -15,7 +15,7 @@ export const copyPaste = defineComponent({ }; }, mounted() { - if (this.copyPasteElementsGotCreated === true) { + if (this.copyPasteElementsGotCreated) { return; } @@ -111,7 +111,7 @@ export const copyPaste = defineComponent({ // Check if the event got emitted from a message box or from something // else which should ignore the copy/paste // @ts-ignore - const path = e.path || (e.composedPath && e.composedPath()); + const path = e.path || e.composedPath?.(); for (let index = 0; index < path.length; index++) { if ( path[index].className && diff --git a/packages/editor-ui/src/mixins/moveNodeWorkflow.ts b/packages/editor-ui/src/mixins/moveNodeWorkflow.ts index 2b2edb2d78..1ae6d2743a 100644 --- a/packages/editor-ui/src/mixins/moveNodeWorkflow.ts +++ b/packages/editor-ui/src/mixins/moveNodeWorkflow.ts @@ -30,7 +30,7 @@ export const moveNodeWorkflow = defineComponent({ this.moveLastPosition[1] = y; }, mouseDownMoveWorkflow(e: MouseEvent, moveButtonPressed: boolean) { - if (this.isCtrlKeyPressed(e) === false && !moveButtonPressed) { + if (!this.isCtrlKeyPressed(e) && !moveButtonPressed) { // We only care about it when the ctrl key is pressed at the same time. // So we exit when it is not pressed. return; @@ -55,7 +55,7 @@ export const moveNodeWorkflow = defineComponent({ this.$el.addEventListener('mousemove', this.mouseMoveNodeWorkflow); }, mouseUpMoveWorkflow(e: MouseEvent) { - if (this.uiStore.nodeViewMoveInProgress === false) { + if (!this.uiStore.nodeViewMoveInProgress) { // If it is not active return directly. // Else normal node dragging will not work. return; diff --git a/packages/editor-ui/src/mixins/pushConnection.ts b/packages/editor-ui/src/mixins/pushConnection.ts index 44f2b5f2a5..dd12ca0139 100644 --- a/packages/editor-ui/src/mixins/pushConnection.ts +++ b/packages/editor-ui/src/mixins/pushConnection.ts @@ -284,7 +284,7 @@ export const pushConnection = defineComponent({ // The workflow finished executing let pushData: IPushDataExecutionFinished; if (receivedData.type === 'executionRecovered' && recoveredPushData !== undefined) { - pushData = recoveredPushData as IPushDataExecutionFinished; + pushData = recoveredPushData; } else { pushData = receivedData.data as IPushDataExecutionFinished; } @@ -329,12 +329,7 @@ export const pushConnection = defineComponent({ ); } - const lineNumber = - runDataExecuted && - runDataExecuted.data && - runDataExecuted.data.resultData && - runDataExecuted.data.resultData.error && - runDataExecuted.data.resultData.error.lineNumber; + const lineNumber = runDataExecuted?.data?.resultData?.error?.lineNumber; codeNodeEditorEventBus.emit('error-line-number', lineNumber || 'final'); @@ -449,16 +444,13 @@ export const pushConnection = defineComponent({ this.titleSet(workflow.name as string, 'IDLE'); const execution = this.workflowsStore.getWorkflowExecution; - if (execution && execution.executedNode) { + if (execution?.executedNode) { const node = this.workflowsStore.getNodeByName(execution.executedNode); const nodeType = node && this.nodeTypesStore.getNodeType(node.type, node.typeVersion); const nodeOutput = execution && execution.executedNode && - execution.data && - execution.data.resultData && - execution.data.resultData.runData && - execution.data.resultData.runData[execution.executedNode]; + execution.data?.resultData?.runData?.[execution.executedNode]; if (nodeType && nodeType.polling && !nodeOutput) { this.showMessage({ title: this.$locale.baseText('pushConnection.pollingNode.dataNotFound', { @@ -507,12 +499,11 @@ export const pushConnection = defineComponent({ let itemsCount = 0; if ( lastNodeExecuted && - runDataExecuted.data.resultData.runData[lastNodeExecuted as string] && + runDataExecuted.data.resultData.runData[lastNodeExecuted] && !runDataExecutedErrorMessage ) { itemsCount = - runDataExecuted.data.resultData.runData[lastNodeExecuted as string][0].data!.main[0]! - .length; + runDataExecuted.data.resultData.runData[lastNodeExecuted][0].data!.main[0]!.length; } void this.$externalHooks().run('pushConnection.executionFinished', { @@ -596,7 +587,7 @@ export const pushConnection = defineComponent({ interpolate: { error: '!' }, }); - if (error && error.message) { + if (error?.message) { let nodeName: string | undefined; if ('node' in error) { nodeName = typeof error.node === 'string' ? error.node : error.node!.name; diff --git a/packages/editor-ui/src/mixins/userHelpers.ts b/packages/editor-ui/src/mixins/userHelpers.ts index 01d2e02551..b07248974a 100644 --- a/packages/editor-ui/src/mixins/userHelpers.ts +++ b/packages/editor-ui/src/mixins/userHelpers.ts @@ -17,7 +17,7 @@ export const userHelpers = defineComponent({ }, canUserAccessRoute(route: RouteLocation): boolean { - const permissions: IPermissions = route.meta && route.meta.permissions; + const permissions: IPermissions = route.meta?.permissions; const usersStore = useUsersStore(); const currentUser = usersStore.currentUser; diff --git a/packages/editor-ui/src/mixins/workflowActivate.ts b/packages/editor-ui/src/mixins/workflowActivate.ts index 9dd68c88eb..d62d2eb035 100644 --- a/packages/editor-ui/src/mixins/workflowActivate.ts +++ b/packages/editor-ui/src/mixins/workflowActivate.ts @@ -40,7 +40,7 @@ export const workflowActivate = defineComponent({ telemetrySource?: string, ) { this.updatingWorkflowActivation = true; - const nodesIssuesExist = this.workflowsStore.nodesIssuesExist as boolean; + const nodesIssuesExist = this.workflowsStore.nodesIssuesExist; let currWorkflowId: string | undefined = workflowId; if (!currWorkflowId || currWorkflowId === PLACEHOLDER_EMPTY_WORKFLOW_ID) { @@ -49,7 +49,7 @@ export const workflowActivate = defineComponent({ this.updatingWorkflowActivation = false; return; } - currWorkflowId = this.workflowsStore.workflowId as string; + currWorkflowId = this.workflowsStore.workflowId; } const isCurrentWorkflow = currWorkflowId === this.workflowsStore.workflowId; @@ -76,7 +76,7 @@ export const workflowActivate = defineComponent({ return; } - if (isCurrentWorkflow && nodesIssuesExist && newActiveState === true) { + if (isCurrentWorkflow && nodesIssuesExist && newActiveState) { this.showMessage({ title: this.$locale.baseText( 'workflowActivator.showMessage.activeChangedNodesIssuesExistTrue.title', @@ -96,7 +96,7 @@ export const workflowActivate = defineComponent({ !this.uiStore.stateIsDirty, ); } catch (error) { - const newStateName = newActiveState === true ? 'activated' : 'deactivated'; + const newStateName = newActiveState ? 'activated' : 'deactivated'; this.showError( error, this.$locale.baseText('workflowActivator.showError.title', { diff --git a/packages/editor-ui/src/models/history.ts b/packages/editor-ui/src/models/history.ts index 2c94cc0741..4a17048131 100644 --- a/packages/editor-ui/src/models/history.ts +++ b/packages/editor-ui/src/models/history.ts @@ -1,6 +1,5 @@ -import type { INodeUi } from '@/Interface'; +import type { INodeUi, XYPosition } from '@/Interface'; import type { IConnection } from 'n8n-workflow'; -import type { XYPosition } from '../Interface'; import { createEventBus } from 'n8n-design-system/utils'; // Command names don't serve any particular purpose in the app @@ -48,7 +47,9 @@ export class BulkCommand extends Undoable { export class MoveNodeCommand extends Command { nodeName: string; + oldPosition: XYPosition; + newPosition: XYPosition; constructor(nodeName: string, oldPosition: XYPosition, newPosition: XYPosition) { @@ -196,7 +197,9 @@ export class RemoveConnectionCommand extends Command { export class EnableNodeToggleCommand extends Command { nodeName: string; + oldState: boolean; + newState: boolean; constructor(nodeName: string, oldState: boolean, newState: boolean) { @@ -229,6 +232,7 @@ export class EnableNodeToggleCommand extends Command { export class RenameNodeCommand extends Command { currentName: string; + newName: string; constructor(currentName: string, newName: string) { diff --git a/packages/editor-ui/src/permissions.ts b/packages/editor-ui/src/permissions.ts index 04c4bb6c7f..790b999ecc 100644 --- a/packages/editor-ui/src/permissions.ts +++ b/packages/editor-ui/src/permissions.ts @@ -61,17 +61,11 @@ export const getCredentialPermissions = (user: IUser | null, credential: ICreden { name: UserRole.ResourceOwner, test: () => - !!(credential && credential.ownedBy && credential.ownedBy.id === user?.id) || - !isSharingEnabled, + !!(credential?.ownedBy && credential.ownedBy.id === user?.id) || !isSharingEnabled, }, { name: UserRole.ResourceSharee, - test: () => - !!( - credential && - credential.sharedWith && - credential.sharedWith.find((sharee) => sharee.id === user?.id) - ), + test: () => !!credential?.sharedWith?.find((sharee) => sharee.id === user?.id), }, { name: 'read', @@ -100,17 +94,12 @@ export const getWorkflowPermissions = (user: IUser | null, workflow: IWorkflowDb { name: UserRole.ResourceOwner, test: () => - !!(isNewWorkflow || (workflow && workflow.ownedBy && workflow.ownedBy.id === user?.id)) || + !!(isNewWorkflow || (workflow?.ownedBy && workflow.ownedBy.id === user?.id)) || !isSharingEnabled, }, { name: UserRole.ResourceSharee, - test: () => - !!( - workflow && - workflow.sharedWith && - workflow.sharedWith.find((sharee) => sharee.id === user?.id) - ), + test: () => !!workflow?.sharedWith?.find((sharee) => sharee.id === user?.id), }, { name: 'read', diff --git a/packages/editor-ui/src/plugins/codemirror/completions/__tests__/mock.ts b/packages/editor-ui/src/plugins/codemirror/completions/__tests__/mock.ts index 9616deb087..318a75fb16 100644 --- a/packages/editor-ui/src/plugins/codemirror/completions/__tests__/mock.ts +++ b/packages/editor-ui/src/plugins/codemirror/completions/__tests__/mock.ts @@ -291,7 +291,7 @@ const executeData: IExecuteData = { data: runExecutionData.resultData.runData[lastNodeName][0].data!, node: nodes.find((node) => node.name === lastNodeName) as INode, source: { - main: runExecutionData.resultData.runData[lastNodeName][0].source!, + main: runExecutionData.resultData.runData[lastNodeName][0].source, }, }; diff --git a/packages/editor-ui/src/plugins/codemirror/completions/datatype.completions.ts b/packages/editor-ui/src/plugins/codemirror/completions/datatype.completions.ts index 6d650c9ac9..eb57bea7e7 100644 --- a/packages/editor-ui/src/plugins/codemirror/completions/datatype.completions.ts +++ b/packages/editor-ui/src/plugins/codemirror/completions/datatype.completions.ts @@ -1,6 +1,5 @@ import type { IDataObject, DocMetadata, NativeDoc } from 'n8n-workflow'; -import { Expression } from 'n8n-workflow'; -import { ExpressionExtensions, NativeMethods } from 'n8n-workflow'; +import { Expression, ExpressionExtensions, NativeMethods } from 'n8n-workflow'; import { DateTime } from 'luxon'; import { i18n } from '@/plugins/i18n'; import { resolveParameter } from '@/mixins/workflowHelpers'; @@ -196,7 +195,7 @@ const createCompletionOption = ( const descriptionLink = document.createElement('a'); descriptionLink.setAttribute('target', '_blank'); descriptionLink.setAttribute('href', docInfo.doc.docURL); - descriptionLink.innerText = i18n.autocompleteUIValues['docLinkLabel'] || 'Learn more'; + descriptionLink.innerText = i18n.autocompleteUIValues.docLinkLabel || 'Learn more'; descriptionLink.addEventListener('mousedown', (event: MouseEvent) => { // This will prevent documentation popup closing before click // event gets to links diff --git a/packages/editor-ui/src/plugins/components.ts b/packages/editor-ui/src/plugins/components.ts index e5d8d6cde5..d349c90d75 100644 --- a/packages/editor-ui/src/plugins/components.ts +++ b/packages/editor-ui/src/plugins/components.ts @@ -2,8 +2,7 @@ import type { Plugin } from 'vue'; import 'regenerator-runtime/runtime'; -import ElementPlus from 'element-plus'; -import { ElLoading, ElMessageBox } from 'element-plus'; +import ElementPlus, { ElLoading, ElMessageBox } from 'element-plus'; import { N8nPlugin } from 'n8n-design-system'; import { useMessage } from '@/composables/useMessage'; import EnterpriseEdition from '@/components/EnterpriseEdition.ee.vue'; diff --git a/packages/editor-ui/src/plugins/connectors/N8nCustomConnector.ts b/packages/editor-ui/src/plugins/connectors/N8nCustomConnector.ts index 07f44e50bb..65400ad4f7 100644 --- a/packages/editor-ui/src/plugins/connectors/N8nCustomConnector.ts +++ b/packages/editor-ui/src/plugins/connectors/N8nCustomConnector.ts @@ -14,7 +14,7 @@ import { BezierSegment } from '@jsplumb/connector-bezier'; import { isArray } from 'lodash-es'; import { deepCopy } from 'n8n-workflow'; -export interface N8nConnectorOptions extends ConnectorOptions {} +export type N8nConnectorOptions = ConnectorOptions; interface N8nConnectorPaintGeometry extends PaintGeometry { sourceEndpoint: Endpoint; targetEndpoint: Endpoint; @@ -140,22 +140,37 @@ const stubCalculators = { export class N8nConnector extends AbstractConnector { static type = 'N8nConnector'; + type = N8nConnector.type; majorAnchor: number; + minorAnchor: number; + midpoint: number; + alwaysRespectStubs: boolean; + loopbackVerticalLength: number; + lastx: number | null; + lasty: number | null; + cornerRadius: number; + loopbackMinimum: number; + curvinessCoefficient: number; + zBezierOffset: number; + targetGap: number; + overrideTargetEndpoint: Endpoint | null; + getEndpointOffset: Function | null; + private internalSegments: FlowchartSegment[] = []; constructor( @@ -340,7 +355,7 @@ export class N8nConnector extends AbstractConnector { } calculateStubSegment(paintInfo: PaintGeometry): StubPositions { - return stubCalculators['opposite'](paintInfo, { + return stubCalculators.opposite(paintInfo, { axis: paintInfo.sourceAxis, alwaysRespectStubs: this.alwaysRespectStubs, }); @@ -366,7 +381,7 @@ export class N8nConnector extends AbstractConnector { // original flowchart behavior midy = paintInfo.startStubY + (paintInfo.endStubY - paintInfo.startStubY) * this.midpoint; } - return lineCalculators['opposite'](paintInfo, { axis, startStub, endStub, idx, midx, midy }); + return lineCalculators.opposite(paintInfo, { axis, startStub, endStub, idx, midx, midy }); } _getPaintInfo(params: ConnectorComputeParams): N8nConnectorPaintGeometry { @@ -494,6 +509,7 @@ export class N8nConnector extends AbstractConnector { } } catch (error) {} } + /** * Set target endpoint * (to override default behavior tracking mouse when dragging mouse) @@ -502,9 +518,11 @@ export class N8nConnector extends AbstractConnector { setTargetEndpoint(endpoint: Endpoint) { this.overrideTargetEndpoint = endpoint; } + resetTargetEndpoint() { this.overrideTargetEndpoint = null; } + _computeBezier(paintInfo: N8nConnectorPaintGeometry) { const sp = paintInfo.sourcePos; const tp = paintInfo.targetPos; diff --git a/packages/editor-ui/src/plugins/i18n/index.ts b/packages/editor-ui/src/plugins/i18n/index.ts index 834ed9b594..05581014ee 100644 --- a/packages/editor-ui/src/plugins/i18n/index.ts +++ b/packages/editor-ui/src/plugins/i18n/index.ts @@ -51,10 +51,10 @@ export class I18nClass { options?: { adjustToNumber?: number; interpolate?: { [key: string]: string } }, ): string { if (options?.adjustToNumber !== undefined) { - return this.i18n.tc(key, options.adjustToNumber, options && options.interpolate).toString(); + return this.i18n.tc(key, options.adjustToNumber, options?.interpolate).toString(); } - return this.i18n.t(key, options && options.interpolate).toString(); + return this.i18n.t(key, options?.interpolate).toString(); } /** @@ -164,7 +164,7 @@ export class I18nClass { nodeText() { const ndvStore = useNDVStore(); const activeNode = ndvStore.activeNode; - const nodeType = activeNode ? this.shortNodeType(activeNode.type as string) : ''; // unused in eventTriggerDescription + const nodeType = activeNode ? this.shortNodeType(activeNode.type) : ''; // unused in eventTriggerDescription const initialKey = `n8n-nodes-base.nodes.${nodeType}.nodeView`; const context = this; diff --git a/packages/editor-ui/src/plugins/jsplumb/N8nAddInputEndpointType.ts b/packages/editor-ui/src/plugins/jsplumb/N8nAddInputEndpointType.ts index afd3e5a4ab..42a6a9a40b 100644 --- a/packages/editor-ui/src/plugins/jsplumb/N8nAddInputEndpointType.ts +++ b/packages/editor-ui/src/plugins/jsplumb/N8nAddInputEndpointType.ts @@ -30,18 +30,22 @@ export class N8nAddInputEndpoint extends EndpointRepresentation { if (endpoint === this.endpoint) { this.instance.fire(EVENT_ADD_INPUT_ENDPOINT_CLICK, this.endpoint); diff --git a/packages/editor-ui/src/stores/canvas.store.ts b/packages/editor-ui/src/stores/canvas.store.ts index 137baeac9e..16cc7eb050 100644 --- a/packages/editor-ui/src/stores/canvas.store.ts +++ b/packages/editor-ui/src/stores/canvas.store.ts @@ -250,8 +250,8 @@ export const useCanvasStore = defineStore('canvas', () => { } newNodePosition = [ - parseInt(element.style.left!.slice(0, -2), 10), - parseInt(element.style.top!.slice(0, -2), 10), + parseInt(element.style.left.slice(0, -2), 10), + parseInt(element.style.top.slice(0, -2), 10), ]; const updateInformation = { diff --git a/packages/editor-ui/src/stores/segment.store.ts b/packages/editor-ui/src/stores/segment.store.ts index dbeb291562..3d96179ac8 100644 --- a/packages/editor-ui/src/stores/segment.store.ts +++ b/packages/editor-ui/src/stores/segment.store.ts @@ -58,8 +58,7 @@ export const useSegment = defineStore('segment', () => { const node = workflowsStore.getNodeByName(nodeName); const nodeTypeName = node ? node.type : 'unknown'; if ( - nodeRunData[0].data && - nodeRunData[0].data.main && + nodeRunData[0].data?.main && nodeRunData[0].data.main.some((out) => out && out?.length > 1) ) { multipleOutputNodes.add(nodeTypeName); diff --git a/packages/editor-ui/src/stores/sso.store.ts b/packages/editor-ui/src/stores/sso.store.ts index be8b90c2f9..005a816506 100644 --- a/packages/editor-ui/src/stores/sso.store.ts +++ b/packages/editor-ui/src/stores/sso.store.ts @@ -4,9 +4,8 @@ import { EnterpriseEditionFeature } from '@/constants'; import { useRootStore } from '@/stores/n8nRoot.store'; import { useSettingsStore } from '@/stores/settings.store'; import * as ssoApi from '@/api/sso'; -import type { SamlPreferences } from '@/Interface'; +import type { SamlPreferences, SamlPreferencesExtractedData } from '@/Interface'; import { updateCurrentUser } from '@/api/users'; -import type { SamlPreferencesExtractedData } from '@/Interface'; import { useUsersStore } from '@/stores/users.store'; export const useSSOStore = defineStore('sso', () => { diff --git a/packages/editor-ui/src/stores/users.store.ts b/packages/editor-ui/src/stores/users.store.ts index dad8670fad..9d9edffa1d 100644 --- a/packages/editor-ui/src/stores/users.store.ts +++ b/packages/editor-ui/src/stores/users.store.ts @@ -102,7 +102,7 @@ export const useUsersStore = defineStore(STORES.USERS, { return false; }, personalizedNodeTypes(): string[] { - const user = this.currentUser as IUser | null; + const user = this.currentUser; if (!user) { return []; } diff --git a/packages/editor-ui/src/stores/workflows.ee.store.ts b/packages/editor-ui/src/stores/workflows.ee.store.ts index d7cb59c20e..c4db192b8a 100644 --- a/packages/editor-ui/src/stores/workflows.ee.store.ts +++ b/packages/editor-ui/src/stores/workflows.ee.store.ts @@ -18,7 +18,7 @@ export const useWorkflowsEEStore = defineStore(STORES.WORKFLOWS_EE, { fallback = i18n.baseText('workflows.shareModal.info.sharee.fallback'), ): string => { const workflow = useWorkflowsStore().getWorkflowById(workflowId); - return workflow && workflow.ownedBy && workflow.ownedBy.firstName + return workflow?.ownedBy?.firstName ? `${workflow.ownedBy.firstName} ${workflow.ownedBy.lastName} (${workflow.ownedBy.email})` : fallback; }; diff --git a/packages/editor-ui/src/utils/apiUtils.ts b/packages/editor-ui/src/utils/apiUtils.ts index 2ed65f4569..caa3005242 100644 --- a/packages/editor-ui/src/utils/apiUtils.ts +++ b/packages/editor-ui/src/utils/apiUtils.ts @@ -1,12 +1,7 @@ import type { AxiosRequestConfig, Method } from 'axios'; import axios from 'axios'; import type { IDataObject } from 'n8n-workflow'; -import type { - IExecutionFlattedResponse, - IExecutionResponse, - IRestApiContext, - IWorkflowDb, -} from '@/Interface'; +import type { IExecutionFlattedResponse, IExecutionResponse, IRestApiContext } from '@/Interface'; import { parse } from 'flatted'; export const NO_NETWORK_ERROR_CODE = 999; @@ -150,7 +145,7 @@ export function unflattenExecutionData( // Unflatten the data const returnData: IExecutionResponse = { ...fullExecutionData, - workflowData: fullExecutionData.workflowData as IWorkflowDb, + workflowData: fullExecutionData.workflowData, data: parse(fullExecutionData.data), }; diff --git a/packages/editor-ui/src/utils/pairedItemUtils.ts b/packages/editor-ui/src/utils/pairedItemUtils.ts index 0f5c0fc95a..611b523a9c 100644 --- a/packages/editor-ui/src/utils/pairedItemUtils.ts +++ b/packages/editor-ui/src/utils/pairedItemUtils.ts @@ -23,7 +23,7 @@ export function getSourceItems(data: IExecutionResponse, target: TargetItem): Ta } const item = taskData?.data?.main?.[target.outputIndex]?.[target.itemIndex]; - if (!item || item.pairedItem === undefined) { + if (item?.pairedItem === undefined) { return []; } diff --git a/packages/editor-ui/src/utils/userUtils.ts b/packages/editor-ui/src/utils/userUtils.ts index a67d290353..8bba6fda51 100644 --- a/packages/editor-ui/src/utils/userUtils.ts +++ b/packages/editor-ui/src/utils/userUtils.ts @@ -228,7 +228,7 @@ function getPersonalizationSurveyV2OrLater( let codingSkill = null; if (CODING_SKILL_KEY in answers && answers[CODING_SKILL_KEY]) { - codingSkill = parseInt(answers[CODING_SKILL_KEY] as string, 10); + codingSkill = parseInt(answers[CODING_SKILL_KEY], 10); codingSkill = isNaN(codingSkill) ? 0 : codingSkill; } @@ -369,7 +369,7 @@ function getPersonalizationSurveyV1(answers: IPersonalizationSurveyAnswersV1) { let codingSkill = null; if (answers[CODING_SKILL_KEY]) { - codingSkill = parseInt(answers[CODING_SKILL_KEY] as string, 10); + codingSkill = parseInt(answers[CODING_SKILL_KEY], 10); codingSkill = isNaN(codingSkill) ? 0 : codingSkill; } diff --git a/packages/editor-ui/src/views/NodeView.vue b/packages/editor-ui/src/views/NodeView.vue index 0d9459f3ab..20cc2a9243 100644 --- a/packages/editor-ui/src/views/NodeView.vue +++ b/packages/editor-ui/src/views/NodeView.vue @@ -1986,7 +1986,7 @@ export default defineComponent({ ]; const sourceNodeOutputs = NodeHelpers.getNodeOutputs( workflow, - lastSelectedNode!, + lastSelectedNode, sourceNodeType, ); const sourceNodeOutputTypes = NodeHelpers.getConnectionTypes(sourceNodeOutputs); @@ -2010,7 +2010,7 @@ export default defineComponent({ // outputs here is to calculate the position it is fine to assume // that they have no outputs and are so treated as a regular node // with only "main" outputs. - outputs = NodeHelpers.getNodeOutputs(workflow, newNodeData!, nodeTypeData); + outputs = NodeHelpers.getNodeOutputs(workflow, newNodeData, nodeTypeData); } catch (e) {} const outputTypes = NodeHelpers.getConnectionTypes(outputs); const lastSelectedNodeType = this.nodeTypesStore.getNodeType( diff --git a/packages/editor-ui/src/views/SettingsLdapView.vue b/packages/editor-ui/src/views/SettingsLdapView.vue index 814ad93a13..6f2ea006e7 100644 --- a/packages/editor-ui/src/views/SettingsLdapView.vue +++ b/packages/editor-ui/src/views/SettingsLdapView.vue @@ -142,7 +142,7 @@