feat(editor): Enable NodeView version switcher by default on internal (no-changelog) (#10356)

This commit is contained in:
Alex Grozav 2024-08-12 16:14:40 +03:00 committed by GitHub
parent 021d9981b6
commit 2580a5e19e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -96,9 +96,17 @@ const importFileRef = ref<HTMLInputElement | undefined>();
const tagsEventBus = createEventBus();
const sourceControlModalEventBus = createEventBus();
const nodeViewSwitcher = useLocalStorage('NodeView.switcher', import.meta.env.DEV ? 'true' : '');
const nodeViewSwitcher = useLocalStorage('NodeView.switcher', '');
const nodeViewVersion = useLocalStorage('NodeView.version', '1');
const isNodeViewSwitcherEnabled = computed(() => {
return (
import.meta.env.DEV ||
nodeViewSwitcher.value === 'true' ||
settingsStore.deploymentType === 'n8n-internal'
);
});
const hasChanged = (prev: string[], curr: string[]) => {
if (prev.length !== curr.length) {
return true;
@ -184,7 +192,7 @@ const workflowMenuItems = computed<ActionDropdownItem[]>(() => {
disabled: !onWorkflowPage.value || isNewWorkflow.value,
});
if (nodeViewSwitcher.value === 'true') {
if (isNodeViewSwitcherEnabled.value) {
actions.push({
id: WORKFLOW_MENU_ACTIONS.SWITCH_NODE_VIEW_VERSION,
label: