diff --git a/packages/frontend/editor-ui/eslint.config.mjs b/packages/frontend/editor-ui/eslint.config.mjs index 619bb0f5f4..a46cc4f9ab 100644 --- a/packages/frontend/editor-ui/eslint.config.mjs +++ b/packages/frontend/editor-ui/eslint.config.mjs @@ -24,7 +24,7 @@ export default defineConfig(frontendConfig, { '@typescript-eslint/dot-notation': 'warn', '@stylistic/lines-between-class-members': 'warn', '@stylistic/member-delimiter-style': 'warn', - '@typescript-eslint/naming-convention': 'warn', + '@typescript-eslint/naming-convention': 'off', '@typescript-eslint/no-empty-interface': 'warn', '@typescript-eslint/no-for-in-array': 'warn', '@typescript-eslint/no-loop-func': 'warn', diff --git a/packages/frontend/editor-ui/src/Interface.ts b/packages/frontend/editor-ui/src/Interface.ts index 4e61cfa88f..4cb8e280a0 100644 --- a/packages/frontend/editor-ui/src/Interface.ts +++ b/packages/frontend/editor-ui/src/Interface.ts @@ -132,7 +132,6 @@ declare global { disallowReturnToOpener?: boolean; }) => Promise; }; - // eslint-disable-next-line @typescript-eslint/naming-convention Cypress: unknown; } } diff --git a/packages/frontend/editor-ui/src/components/Node/NodeCreator/useActionsGeneration.test.ts b/packages/frontend/editor-ui/src/components/Node/NodeCreator/useActionsGeneration.test.ts index 73be5a3d04..bfbd849ce8 100644 --- a/packages/frontend/editor-ui/src/components/Node/NodeCreator/useActionsGeneration.test.ts +++ b/packages/frontend/editor-ui/src/components/Node/NodeCreator/useActionsGeneration.test.ts @@ -303,7 +303,6 @@ describe('useActionsGenerator', () => { noDataExpression: true, displayOptions: { show: { - // eslint-disable-next-line @typescript-eslint/naming-convention '@version': [1], resource: ['user'], }, @@ -324,7 +323,6 @@ describe('useActionsGenerator', () => { noDataExpression: true, displayOptions: { show: { - // eslint-disable-next-line @typescript-eslint/naming-convention '@version': [2], resource: ['user'], }, @@ -369,7 +367,6 @@ describe('useActionsGenerator', () => { noDataExpression: true, displayOptions: { show: { - // eslint-disable-next-line @typescript-eslint/naming-convention '@version': [1, 2], resource: ['user'], }, diff --git a/packages/frontend/editor-ui/src/components/ParameterInput.vue b/packages/frontend/editor-ui/src/components/ParameterInput.vue index 013259e8ff..fb6fd57449 100644 --- a/packages/frontend/editor-ui/src/components/ParameterInput.vue +++ b/packages/frontend/editor-ui/src/components/ParameterInput.vue @@ -42,6 +42,7 @@ import { isResourceLocatorParameterType, isValidParameterOption, parseFromExpression, + shouldSkipParamValidation, } from '@/utils/nodeSettingsUtils'; import { hasExpressionMapping, isValueExpression } from '@/utils/nodeTypesUtils'; @@ -426,7 +427,7 @@ const getIssues = computed(() => { let checkValues: string[] = []; - if (!nodeSettingsParameters.shouldSkipParamValidation(displayValue.value)) { + if (!shouldSkipParamValidation(displayValue.value)) { if (Array.isArray(displayValue.value)) { checkValues = checkValues.concat(displayValue.value); } else { diff --git a/packages/frontend/editor-ui/src/components/ParameterOptions.vue b/packages/frontend/editor-ui/src/components/ParameterOptions.vue index 1579511539..69ba7cca50 100644 --- a/packages/frontend/editor-ui/src/components/ParameterOptions.vue +++ b/packages/frontend/editor-ui/src/components/ParameterOptions.vue @@ -10,6 +10,7 @@ import { computed } from 'vue'; import { useNDVStore } from '@/stores/ndv.store'; import { usePostHog } from '@/stores/posthog.store'; import { AI_TRANSFORM_NODE_TYPE, FOCUS_PANEL_EXPERIMENT } from '@/constants'; +import { getParameterTypeOption } from '@/utils/nodeSettingsUtils'; interface Props { parameter: INodeProperties; @@ -41,12 +42,28 @@ const i18n = useI18n(); const ndvStore = useNDVStore(); const posthogStore = usePostHog(); +const activeNode = computed(() => ndvStore.activeNode); const isDefault = computed(() => props.parameter.default === props.value); const isValueAnExpression = computed(() => isValueExpression(props.parameter, props.value)); -const isHtmlEditor = computed(() => getArgument('editor') === 'htmlEditor'); +const isHtmlEditor = computed( + () => getParameterTypeOption(props.parameter, 'editor') === 'htmlEditor', +); const shouldShowExpressionSelector = computed( () => !props.parameter.noDataExpression && props.showExpressionSelector && !props.isReadOnly, ); + +const isFocusPanelFeatureEnabled = computed(() => { + return posthogStore.getVariant(FOCUS_PANEL_EXPERIMENT.name) === FOCUS_PANEL_EXPERIMENT.variant; +}); +const hasFocusAction = computed( + () => + isFocusPanelFeatureEnabled.value && + !props.parameter.isNodeSetting && + !props.isReadOnly && + activeNode.value && // checking that it's inside ndv + (props.parameter.type === 'string' || props.parameter.type === 'json'), +); + const shouldShowOptions = computed(() => { if (props.isReadOnly) { return false; @@ -71,7 +88,6 @@ const shouldShowOptions = computed(() => { return false; }); const selectedView = computed(() => (isValueAnExpression.value ? 'expression' : 'fixed')); -const activeNode = computed(() => ndvStore.activeNode); const hasRemoteMethod = computed( () => !!props.parameter.typeOptions?.loadOptionsMethod || !!props.parameter.typeOptions?.loadOptions, @@ -84,18 +100,6 @@ const resetValueLabel = computed(() => { return i18n.baseText('parameterInput.resetValue'); }); -const isFocusPanelFeatureEnabled = computed(() => { - return posthogStore.getVariant(FOCUS_PANEL_EXPERIMENT.name) === FOCUS_PANEL_EXPERIMENT.variant; -}); -const hasFocusAction = computed( - () => - isFocusPanelFeatureEnabled.value && - !props.parameter.isNodeSetting && - !props.isReadOnly && - activeNode.value && // checking that it's inside ndv - (props.parameter.type === 'string' || props.parameter.type === 'json'), -); - const actions = computed(() => { if (Array.isArray(props.customActions) && props.customActions.length > 0) { return props.customActions; @@ -161,17 +165,6 @@ const onViewSelected = (selected: string) => { emit('update:modelValue', 'removeExpression'); } }; -const getArgument = (argumentName: string) => { - if (props.parameter.typeOptions === undefined) { - return undefined; - } - - if (props.parameter.typeOptions[argumentName] === undefined) { - return undefined; - } - - return props.parameter.typeOptions[argumentName]; -};