mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
refactor(editor): Do not make rest api calls for disabled features (no-changelog) (#9046)
This commit is contained in:
committed by
GitHub
parent
217b07d735
commit
637b6c4d3e
@@ -24,6 +24,7 @@ export async function initializeCore() {
|
|||||||
const versionsStore = useVersionsStore();
|
const versionsStore = useVersionsStore();
|
||||||
|
|
||||||
await settingsStore.initialize();
|
await settingsStore.initialize();
|
||||||
|
if (!settingsStore.isPreviewMode) {
|
||||||
await usersStore.initialize();
|
await usersStore.initialize();
|
||||||
|
|
||||||
void versionsStore.checkForNewVersions();
|
void versionsStore.checkForNewVersions();
|
||||||
@@ -35,6 +36,7 @@ export async function initializeCore() {
|
|||||||
console.error('Failed to initialize cloud hooks:', e);
|
console.error('Failed to initialize cloud hooks:', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
coreInitialized = true;
|
coreInitialized = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -809,16 +809,22 @@ export default defineComponent({
|
|||||||
this.clipboard.onPaste.value = this.onClipboardPasteEvent;
|
this.clipboard.onPaste.value = this.onClipboardPasteEvent;
|
||||||
|
|
||||||
this.canvasStore.startLoading();
|
this.canvasStore.startLoading();
|
||||||
const loadPromises =
|
|
||||||
this.settingsStore.isPreviewMode && this.isDemo
|
const loadPromises = (() => {
|
||||||
? []
|
if (this.settingsStore.isPreviewMode && this.isDemo) return [];
|
||||||
: [
|
const promises = [
|
||||||
this.loadActiveWorkflows(),
|
this.loadActiveWorkflows(),
|
||||||
this.loadCredentials(),
|
this.loadCredentials(),
|
||||||
this.loadCredentialTypes(),
|
this.loadCredentialTypes(),
|
||||||
this.loadVariables(),
|
|
||||||
this.loadSecrets(),
|
|
||||||
];
|
];
|
||||||
|
if (this.settingsStore.isEnterpriseFeatureEnabled(EnterpriseEditionFeature.Variables)) {
|
||||||
|
promises.push(this.loadVariables());
|
||||||
|
}
|
||||||
|
if (this.settingsStore.isEnterpriseFeatureEnabled(EnterpriseEditionFeature.ExternalSecrets)) {
|
||||||
|
promises.push(this.loadSecrets());
|
||||||
|
}
|
||||||
|
return promises;
|
||||||
|
})();
|
||||||
|
|
||||||
if (this.nodeTypesStore.allNodeTypes.length === 0) {
|
if (this.nodeTypesStore.allNodeTypes.length === 0) {
|
||||||
loadPromises.push(this.loadNodeTypes());
|
loadPromises.push(this.loadNodeTypes());
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ const sortedProviders = computed(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
if (!externalSecretsStore.isEnterpriseExternalSecretsEnabled) return;
|
||||||
try {
|
try {
|
||||||
void externalSecretsStore.fetchAllSecrets();
|
void externalSecretsStore.fetchAllSecrets();
|
||||||
void externalSecretsStore.getProviders();
|
void externalSecretsStore.getProviders();
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ const initialize = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
if (!sourceControlStore.isEnterpriseSourceControlEnabled) return;
|
||||||
await initialize();
|
await initialize();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ function resetNewVariablesList() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function initialize() {
|
async function initialize() {
|
||||||
|
if (!isFeatureEnabled.value) return;
|
||||||
await environmentsStore.fetchAllVariables();
|
await environmentsStore.fetchAllVariables();
|
||||||
|
|
||||||
allVariables.value = [...environmentsStore.variables];
|
allVariables.value = [...environmentsStore.variables];
|
||||||
|
|||||||
Reference in New Issue
Block a user