From 30682dc638e7d7c8d9b9366f93979d0cebd7b6b4 Mon Sep 17 00:00:00 2001 From: Cody Jackson Date: Tue, 17 Sep 2024 08:55:21 -0700 Subject: [PATCH] We no longer need to load the plugin separately when nevigating to a harvester cluster Because it's all one extension/plugin we don't need to do this separately anymore. This was causing conflicts with dev load. --- .../harvesterhci.io.management.cluster.js | 48 +------------------ 1 file changed, 1 insertion(+), 47 deletions(-) diff --git a/pkg/harvester/models/harvesterhci.io.management.cluster.js b/pkg/harvester/models/harvesterhci.io.management.cluster.js index 7ebe46e3..85c44e94 100644 --- a/pkg/harvester/models/harvesterhci.io.management.cluster.js +++ b/pkg/harvester/models/harvesterhci.io.management.cluster.js @@ -168,42 +168,8 @@ export default class HciCluster extends ProvCluster { return uiInfo ? this._supportedClusterPkgDetails(uiInfo, clusterId) : this._legacyClusterPkgDetails(); } - async loadClusterPlugin() { - // Skip loading if it's built in - const plugins = this.$rootState.$plugin.getPlugins(); - const loadedPkgs = Object.keys(plugins); - - if (loadedPkgs.find((pkg) => pkg === HARVESTER_NAME)) { - console.info('Harvester plugin built is built in, skipping load from external sources'); // eslint-disable-line no-console - - return; - } - - // Determine the plugin name and the url it can be fetched from - const { pkgUrl, pkgName } = await this._pkgDetails(); - - console.info('Harvester plugin details: ', pkgName, pkgUrl); // eslint-disable-line no-console - - // Skip loading if we've previously loaded the correct one - if (!!plugins[pkgName]) { - console.info('Harvester plugin already loaded, no need to load', pkgName); // eslint-disable-line no-console - - return; - } - - console.info('Attempting to load Harvester plugin', pkgName); // eslint-disable-line no-console - - const res = await this.$rootState.$plugin.loadAsync(pkgName, pkgUrl); - - console.info('Loaded Harvester plugin', pkgName); // eslint-disable-line no-console - - return res; - } - async goToCluster() { - await this.loadClusterPlugin() - .then(() => { - this.currentRouter().push({ + this.currentRouter().push({ name: `${ VIRTUAL }-c-cluster-resource`, params: { cluster: this.status.clusterName, @@ -211,17 +177,5 @@ export default class HciCluster extends ProvCluster { resource: HCI.DASHBOARD // Go directly to dashboard to avoid blip of components on screen } }); - }) - .catch((err) => { - const message = typeof error === 'object' ? JSON.stringify(err) : err; - - console.error('Failed to load harvester package: ', message); // eslint-disable-line no-console - - this.$dispatch('growl/error', { - title: this.t('harvesterManager.plugins.loadError'), - message, - timeout: 5000 - }, { root: true }); - }); } }