Repository: n8n-io/n8n
File: packages/frontend/editor-ui/src/app/components/WorkflowSettings.vue (Vue)

Code before:
import { useCredentialResolvers } from '@/features/resolvers/composables/useCredentialResolvers';
import { useDynamicCredentials } from '@/features/resolvers/composables/useDynamicCredentials';

import { ElCol, ElRow, ElSwitch } from 'element-plus';

const route = useRoute();
const i18n = useI18n();
const externalHooks = useExternalHooks();
const toast = useToast();
const modalBus = createEventBus();
const telemetry = useTelemetry();
const { isEligibleForMcpAccess, trackMcpAccessEnabledForWorkflow, mcpTriggerMap } = useMcp();
const { registerCustomAction, unregisterCustomAction } = useGlobalLinkActions();
const { isEnabled: isCredentialResolverEnabled } = useDynamicCredentials();

const rootStore = useRootStore();
const settingsStore = useSettingsStore();
const sourceControlStore = useSourceControlStore();
const collaborationStore = useCollaborationStore();
const workflowsStore = useWorkflowsStore();
const workflowsListStore = useWorkflowsListStore();
const workflowState = injectWorkflowState();
const workflowDocumentStore = injectWorkflowDocumentStore();
const workflowsEEStore = useWorkflowsEEStore();
const nodeCreatorStore = useNodeCreatorStore();
const posthogStore = usePostHog();

const isLoading = ref(true);
const workflowCallerPolicyOptions = ref<Array<{ key: string; value: string }>>([]);
const redactionPolicyOptions = ref<Array<{ key: string; value: string }>>([
	{
		key: 'none',
		value: i18n.baseText('workflowSettings.redactionPolicy.options.none'),
	},
	{
		key: 'all',
		value: i18n.baseText('workflowSettings.redactionPolicy.options.all'),
	},
	{
		key: 'non-manual',
		value: i18n.baseText('workflowSettings.redactionPolicy.options.nonManual'),
	},
]);
const saveDataErrorExecutionOptions = ref<Array<{ key: string; value: string }>>([]);
const saveDataSuccessExecutionOptions = ref<Array<{ key: string; value: string }>>([]);
const saveExecutionProgressOptions = ref<Array<{ key: string | boolean; value: string }>>([]);
const saveManualOptions = ref<Array<{ key: string | boolean; value: string }>>([]);
const executionLogicAllOptions = ref<Array<{ key: string; value: string; description: string }>>([
	{
		key: 'v0',
		value: i18n.baseText('workflowSettings.executionLogic.v0.title'),

Review comment (suggestion):
as i understand it, it nos longer posible to have a workflow without an id.

we should throw here, at least until we get this typed properly

Code after:
import { useGlobalLinkActions } from '@/app/composables/useGlobalLinkActions';
import { useNodeCreatorStore } from '@/features/shared/nodeCreator/nodeCreator.store';
import { useCredentialResolvers } from '@/features/resolvers/composables/useCredentialResolvers';
import { useDynamicCredentials } from '@/features/resolvers/composables/useDynamicCredentials';

import { ElCol, ElRow, ElSwitch } from 'element-plus';

const route = useRoute();
const i18n = useI18n();
const externalHooks = useExternalHooks();
const toast = useToast();
const modalBus = createEventBus();
const telemetry = useTelemetry();
const { isEligibleForMcpAccess, trackMcpAccessEnabledForWorkflow, mcpTriggerMap } = useMcp();
const { registerCustomAction, unregisterCustomAction } = useGlobalLinkActions();
const { isEnabled: isCredentialResolverEnabled } = useDynamicCredentials();

const rootStore = useRootStore();
const settingsStore = useSettingsStore();
const sourceControlStore = useSourceControlStore();
const collaborationStore = useCollaborationStore();
const workflowsStore = useWorkflowsStore();
const workflowsListStore = useWorkflowsListStore();
const workflowDocumentStore = computed(() => {
	const wfId = workflowsStore.workflowId;
	if (!wfId) return null;
	return useWorkflowDocumentStore(createWorkflowDocumentId(wfId));
});
const workflowsEEStore = useWorkflowsEEStore();
const nodeCreatorStore = useNodeCreatorStore();
const posthogStore = usePostHog();

const isLoading = ref(true);
const workflowCallerPolicyOptions = ref<Array<{ key: string; value: string }>>([]);
const redactionPolicyOptions = ref<Array<{ key: string; value: string }>>([
	{
		key: 'none',
		value: i18n.baseText('workflowSettings.redactionPolicy.options.none'),
	},
	{
		key: 'all',
		value: i18n.baseText('workflowSettings.redactionPolicy.options.all'),
	},
	{
		key: 'non-manual',
		value: i18n.baseText('workflowSettings.redactionPolicy.options.nonManual'),
	},
]);
const saveDataErrorExecutionOptions = ref<Array<{ key: string; value: string }>>([]);
const saveDataSuccessExecutionOptions = ref<Array<{ key: string; value: string }>>([]);
const saveExecutionProgressOptions = ref<Array<{ key: string | boolean; value: string }>>([]);