diff --git a/pkg/harvester/index.ts b/pkg/harvester/index.ts index d51dd116..04859a29 100644 --- a/pkg/harvester/index.ts +++ b/pkg/harvester/index.ts @@ -1,3 +1,4 @@ +//@ts-nocheck import { importTypes } from '@rancher/auto-import'; import { IPlugin } from '@shell/core/types'; import extensionRoutes from './routing/harvester-routing'; diff --git a/pkg/harvester/product.ts b/pkg/harvester/product.ts index 1c3abf06..06a6d2b3 100644 --- a/pkg/harvester/product.ts +++ b/pkg/harvester/product.ts @@ -1,3 +1,4 @@ +//@ts-nocheck import { NODE, CONFIG_MAP, diff --git a/pkg/harvester/store/harvester-store/actions.ts b/pkg/harvester/store/harvester-store/actions.ts index 6b31ef4d..ec89ae3f 100644 --- a/pkg/harvester/store/harvester-store/actions.ts +++ b/pkg/harvester/store/harvester-store/actions.ts @@ -1,3 +1,4 @@ +//@ts-nocheck import { ClusterNotFoundError } from '@shell/utils/error'; import { SETTING } from '@shell/config/settings'; import { COUNT, NAMESPACE, MANAGEMENT } from '@shell/config/types'; @@ -17,16 +18,16 @@ export default { const cluster = await dispatch('management/find', { type: MANAGEMENT.CLUSTER, id, - opt: { url: `${ MANAGEMENT.CLUSTER }s/${ escape(id) }` } + opt: { url: `${MANAGEMENT.CLUSTER}s/${escape(id)}` } }, { root: true }); - let virtualBase = `/k8s/clusters/${ escape(id) }/v1/harvester`; + let virtualBase = `/k8s/clusters/${escape(id)}/v1/harvester`; if (id === 'local') { virtualBase = `/v1/harvester`; } - if ( !cluster ) { + if (!cluster) { commit('clusterId', null, { root: true }); commit('applyConfig', { baseUrl: null }); throw new ClusterNotFoundError(id); @@ -43,22 +44,22 @@ export default { const projectArgs = { type: MANAGEMENT.PROJECT, - opt: { - url: `${ MANAGEMENT.PROJECT }/${ escape(id) }`, + opt: { + url: `${MANAGEMENT.PROJECT}/${escape(id)}`, watchNamespace: id } }; - const fetchProjects = async() => { + const fetchProjects = async () => { let limit = 30000; const sleep = 100; - while ( limit > 0 && !rootState.managementReady ) { - await setTimeout(() => {}, sleep); + while (limit > 0 && !rootState.managementReady) { + await setTimeout(() => { }, sleep); limit -= sleep; } - if ( rootGetters['management/schemaFor'](MANAGEMENT.PROJECT) ) { + if (rootGetters['management/schemaFor'](MANAGEMENT.PROJECT)) { return dispatch('management/findAll', projectArgs, { root: true }); } }; @@ -66,8 +67,8 @@ export default { if (id !== 'local' && getters['schemaFor'](MANAGEMENT.SETTING)) { // multi-cluster const settings = await dispatch('findAll', { type: MANAGEMENT.SETTING, - id: SETTING.SYSTEM_NAMESPACES, - opt: { url: `${ virtualBase }/${ MANAGEMENT.SETTING }s/`, force: true } + id: SETTING.SYSTEM_NAMESPACES, + opt: { url: `${virtualBase}/${MANAGEMENT.SETTING}s/`, force: true } }); const systemNamespaces = settings?.find((x: any) => x.id === SETTING.SYSTEM_NAMESPACES); @@ -79,14 +80,14 @@ export default { } } - const hash: { [key: string]: Promise} = { - projects: fetchProjects(), - virtualCount: dispatch('findAll', { type: COUNT }), + const hash: { [key: string]: Promise } = { + projects: fetchProjects(), + virtualCount: dispatch('findAll', { type: COUNT }), virtualNamespaces: dispatch('findAll', { type: NAMESPACE }), - settings: dispatch('findAll', { type: HCI.SETTING }), - clusters: dispatch('management/findAll', { + settings: dispatch('findAll', { type: HCI.SETTING }), + clusters: dispatch('management/findAll', { type: MANAGEMENT.CLUSTER, - opt: { force: true } + opt: { force: true } }, { root: true }), }; @@ -100,15 +101,15 @@ export default { commit('updateNamespaces', { filters: [], - all: getters.filterNamespace(), + all: getters.filterNamespace(), getters }, { root: true }); // Solve compatibility with Rancher v2.6.x, fell remove these codes after not support v2.6.x const definition = { - def: false, - parseJSON: true, - inheritFrom: DEV, + def: false, + parseJSON: true, + inheritFrom: DEV, asUserPreference: true, }; @@ -133,9 +134,9 @@ export default { if (isMultiCluster) { commit('managementChanged', { - ready: true, + ready: true, isMultiCluster: true, - isRancher: true, + isRancher: true, }, { root: true }); } }, diff --git a/pkg/harvester/store/harvester-store/getters.ts b/pkg/harvester/store/harvester-store/getters.ts index 0b78a6ad..c9e7a1d2 100644 --- a/pkg/harvester/store/harvester-store/getters.ts +++ b/pkg/harvester/store/harvester-store/getters.ts @@ -1,3 +1,4 @@ +//@ts-nocheck import { NAMESPACE_FILTER_KINDS, NAMESPACE_FILTER_ALL as ALL, @@ -14,8 +15,8 @@ export default { notFilterNamespaces }: any) => { const out: { id: string, kind: string, label: string }[] = [{ - id: ALL, - kind: NAMESPACE_FILTER_KINDS.SPECIAL, + id: ALL, + kind: NAMESPACE_FILTER_KINDS.SPECIAL, label: rootGetters['i18n/t']('nav.ns.all'), }]; @@ -71,8 +72,8 @@ export default { } out.push({ - id: `project://${ id }`, - kind: 'project', + id: `project://${id}`, + kind: 'project', label: project.nameDisplay, }); @@ -89,8 +90,8 @@ export default { } out.push({ - id: ALL_ORPHANS, - kind: 'project', + id: ALL_ORPHANS, + kind: 'project', label: rootGetters['i18n/t']('nav.ns.orphan'), }); diff --git a/pkg/harvester/store/harvester-store/index.ts b/pkg/harvester/store/harvester-store/index.ts index 6313a547..c1ef33ef 100644 --- a/pkg/harvester/store/harvester-store/index.ts +++ b/pkg/harvester/store/harvester-store/index.ts @@ -1,3 +1,4 @@ +//@ts-nocheck import { CoreStoreSpecifics, CoreStoreConfig } from '@shell/core/types'; import { SteveFactory, steveStoreInit } from '@shell/plugins/steve/index'; @@ -27,12 +28,12 @@ const harvesterFactory = (): CoreStoreSpecifics => { return steveFactory; }; const config: CoreStoreConfig = { - namespace: PRODUCT_NAME, + namespace: PRODUCT_NAME, isClusterStore: true }; export default { specifics: harvesterFactory(), config, - init: steveStoreInit + init: steveStoreInit }; diff --git a/pkg/harvester/store/harvester-store/subscribe-shims.ts b/pkg/harvester/store/harvester-store/subscribe-shims.ts index 23ea5ea2..11273ad4 100644 --- a/pkg/harvester/store/harvester-store/subscribe-shims.ts +++ b/pkg/harvester/store/harvester-store/subscribe-shims.ts @@ -1,3 +1,4 @@ +//@ts-nocheck import { _MERGE } from '@shell/plugins/dashboard-store/actions'; import PollerSequential from '@shell/utils/poller-sequential'; @@ -22,7 +23,7 @@ export const actions = { console.warn('Epinio: Polling started for: ', type);// eslint-disable-line no-console polling[type] = new PollerSequential( - async() => { + async () => { console.debug('Epinio: Polling: ', type); // eslint-disable-line no-console // NOTE - In order for lists to automatically update resources opt to MERGE data in place instead of replace // (in rancher land these are all handled individually, here we have bulk changes) diff --git a/pkg/harvester/tsconfig.json b/pkg/harvester/tsconfig.json index de72d78f..d1d68b84 100644 --- a/pkg/harvester/tsconfig.json +++ b/pkg/harvester/tsconfig.json @@ -34,7 +34,7 @@ ], "paths": { "@shell/*": [ - "../../node_modules/@rancher/shell/*" + "@rancher/shell/*" ], "@components/*": [ "@rancher/components/*" @@ -45,9 +45,11 @@ "**/*.ts", "**/*.d.ts", "**/*.tsx", - "**/*.vue" + "**/*.vue", + "./index.d.ts" ], "exclude": [ - "../../node_modules" + "../../node_modules", + "**/*.test.ts" ] } \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 2e63ed97..aaa45f11 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -37,6 +37,7 @@ ] }, "exclude": [ - "node_modules" + "node_modules", + "**/*.test.ts" ] } \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index a3ec6c51..336acbad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13323,9 +13323,9 @@ type-fest@^0.8.0, type-fest@^0.8.1: integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== type-fest@^4.4.0: - version "4.26.0" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.26.0.tgz#703f263af10c093cd6277d079e26b9e17d517c4b" - integrity sha512-OduNjVJsFbifKb57UqZ2EMP1i4u64Xwow3NYXUtBbD4vIwJdQd4+xl8YDou1dlm4DVrtwT/7Ky8z8WyCULVfxw== + version "4.26.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.26.1.tgz#a4a17fa314f976dd3e6d6675ef6c775c16d7955e" + integrity sha512-yOGpmOAL7CkKe/91I5O3gPICmJNLJ1G4zFYVAsRHg7M64biSnPtRj0WNQt++bRkjYOqjWXrhnUw1utzmVErAdg== type-is@~1.6.17, type-is@~1.6.18: version "1.6.18"