diff --git a/.deps/dev.md b/.deps/dev.md index 991f1994db..0e933914e1 100644 --- a/.deps/dev.md +++ b/.deps/dev.md @@ -165,6 +165,7 @@ | [`@types/jest@29.5.3`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | [`@types/jsdom@20.0.1`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | [`@types/json-schema@7.0.12`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | +| [`@types/json5@0.0.29`](https://www.github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | [`@types/jsonfile@6.1.1`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | [`@types/less@3.0.3`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | [`@types/lodash@4.14.197`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | #4131 | @@ -241,6 +242,7 @@ | [`array-ify@1.0.0`](https://github.com/stevemao/array-ify.git) | MIT | clearlydefined | | [`array-includes@3.1.6`](git://github.com/es-shims/array-includes.git) | MIT | #4577 | | [`array-union@2.1.0`](https://github.com/sindresorhus/array-union.git) | MIT | clearlydefined | +| [`array.prototype.findlastindex@1.2.3`](git+https://github.com/es-shims/Array.prototype.findLastIndex.git) | MIT | #9900 | | [`array.prototype.flat@1.3.1`](git://github.com/es-shims/Array.prototype.flat.git) | MIT | #4574 | | [`array.prototype.flatmap@1.3.1`](git://github.com/es-shims/Array.prototype.flatMap.git) | MIT | #4651 | | [`array.prototype.tosorted@1.1.1`](git+https://github.com/es-shims/Array.prototype.toSorted.git) | MIT | #5051 | @@ -352,6 +354,7 @@ | [`default-browser-id@3.0.0`](https://github.com/sindresorhus/default-browser-id.git) | MIT | clearlydefined | | [`default-browser@4.0.0`](https://github.com/sindresorhus/default-browser.git) | MIT | clearlydefined | | [`defaults@1.0.4`](git://github.com/sindresorhus/node-defaults.git) | MIT | clearlydefined | +| [`define-data-property@1.1.0`](git+https://github.com/ljharb/define-data-property.git) | MIT | #10591 | | [`define-lazy-prop@2.0.0`](https://github.com/sindresorhus/define-lazy-prop.git) | MIT | clearlydefined | | [`define-properties@1.2.0`](git://github.com/ljharb/define-properties.git) | MIT | #7116 | | [`del@6.1.1`](https://github.com/sindresorhus/del.git) | MIT | clearlydefined | @@ -395,10 +398,15 @@ | [`escalade@3.1.1`](https://github.com/lukeed/escalade.git) | MIT | clearlydefined | | [`escodegen@2.1.0`](http://github.com/estools/escodegen.git) | BSD-2-Clause | #9306 | | [`eslint-config-prettier@9.0.0`](https://github.com/prettier/eslint-config-prettier.git) | MIT | (clearlydefined)[https://clearlydefined.io/definitions/npm/npmjs/-/eslint-config-prettier/9.0.0] | +| [`eslint-import-resolver-node@0.3.9`](https://github.com/import-js/eslint-plugin-import) | MIT | #9923 | +| [`eslint-module-utils@2.8.0`](git+https://github.com/import-js/eslint-plugin-import.git) | MIT | #8209 | +| [`eslint-plugin-import@2.28.1`](https://github.com/import-js/eslint-plugin-import) | MIT | #9927 | +| [`eslint-plugin-no-relative-import-paths@1.5.2`](https://github.com/MelvinVermeer/eslint-plugin-no-relative-import-paths) | ISC | clearlydefined | | [`eslint-plugin-notice@0.9.10`](https://github.com/nickdeis/eslint-plugin-notice) | MIT | clearlydefined | | [`eslint-plugin-prettier@5.0.0`](git+https://github.com/prettier/eslint-plugin-prettier.git) | MIT | clearlydefined | | [`eslint-plugin-react-hooks@4.6.0`](https://github.com/facebook/react.git) | MIT | clearlydefined | | [`eslint-plugin-react@7.33.2`](https://github.com/jsx-eslint/eslint-plugin-react) | MIT | #9877 | +| [`eslint-plugin-simple-import-sort@10.0.0`](https://github.com/lydell/eslint-plugin-simple-import-sort.git) | MIT | clearlydefined | | [`eslint-scope@5.1.1`](https://github.com/eslint/eslint-scope.git) | BSD-2-Clause | clearlydefined | | [`eslint-visitor-keys@3.4.3`](https://github.com/eslint/eslint-visitor-keys.git) | Apache-2.0 | #7729 | | [`eslint-webpack-plugin@4.0.1`](https://github.com/webpack-contrib/eslint-webpack-plugin.git) | MIT | clearlydefined | @@ -678,6 +686,7 @@ | [`object.assign@4.1.4`](git://github.com/ljharb/object.assign.git) | MIT | #3232 | | [`object.entries@1.1.6`](git://github.com/es-shims/Object.entries.git) | MIT | #4671 | | [`object.fromentries@2.0.6`](git://github.com/es-shims/Object.fromEntries.git) | MIT | #4600 | +| [`object.groupby@1.0.1`](git+https://github.com/es-shims/Object.groupBy.git) | MIT | #10360 | | [`object.hasown@1.1.2`](https://github.com/es-shims/Object.hasOwn.git) | MIT | #4667 | | [`object.values@1.1.6`](git://github.com/es-shims/Object.values.git) | MIT | #4665 | | [`onetime@5.1.2`](https://github.com/sindresorhus/onetime.git) | MIT | clearlydefined | @@ -805,6 +814,7 @@ | [`schema-utils@4.2.0`](https://github.com/webpack/schema-utils.git) | MIT | #8986 | | [`serialize-javascript@6.0.1`](git+https://github.com/yahoo/serialize-javascript.git) | BSD-3-Clause | clearlydefined | | [`set-blocking@2.0.0`](git+https://github.com/yargs/set-blocking.git) | ISC | #5899 | +| [`set-function-name@2.0.1`](git+https://github.com/ljharb/set-function-name.git) | MIT | #10590 | | [`shallow-clone@3.0.1`](https://github.com/jonschlinkert/shallow-clone.git) | MIT | clearlydefined | | [`shebang-command@2.0.0`](https://github.com/kevva/shebang-command.git) | MIT | clearlydefined | | [`shebang-regex@3.0.0`](https://github.com/sindresorhus/shebang-regex.git) | MIT | clearlydefined | @@ -884,7 +894,7 @@ | [`ts-api-utils@1.0.1`](https://github.com/JoshuaKGoldberg/ts-api-utils) | MIT | clearlydefined | | [`ts-jest@29.1.1`](git+https://github.com/kulshekhar/ts-jest.git) | MIT | clearlydefined | | [`ts-loader@9.4.4`](https://github.com/TypeStrong/ts-loader.git) | MIT | #5028 | -| [`tsconfig-paths@4.2.0`](https://github.com/dividab/tsconfig-paths) | MIT | #7709 | +| [`tsconfig-paths@3.14.2`](https://github.com/dividab/tsconfig-paths) | MIT | clearlydefined | | [`tuf-js@1.1.7`](git+https://github.com/theupdateframework/tuf-js.git) | MIT | #7585 | | [`type-check@0.4.0`](git://github.com/gkz/type-check.git) | MIT | clearlydefined | | [`type-detect@4.0.8`](git+ssh://git@github.com/chaijs/type-detect.git) | MIT | clearlydefined | diff --git a/packages/dashboard-backend/.eslintrc.js b/packages/dashboard-backend/.eslintrc.js index ab3ab04894..e0afdbc455 100644 --- a/packages/dashboard-backend/.eslintrc.js +++ b/packages/dashboard-backend/.eslintrc.js @@ -17,6 +17,11 @@ module.exports = { extends: [ '../../.eslintrc.js', ], + plugins: [ + 'import', + 'no-relative-import-paths', + 'simple-import-sort', + ], rules: { 'notice/notice': [ 'error', @@ -28,5 +33,16 @@ module.exports = { }, }, ], + + 'simple-import-sort/imports': 'error', + 'simple-import-sort/exports': 'error', + "import/first": "error", + "import/newline-after-import": "error", + "import/no-duplicates": "error", + + "no-relative-import-paths/no-relative-import-paths": [ + "error", + { "allowSameFolder": false, 'prefix': '@', 'rootDir': 'src' } + ] }, }; diff --git a/packages/dashboard-backend/.vscode/settings.json b/packages/dashboard-backend/.vscode/settings.json new file mode 100644 index 0000000000..87049e72b7 --- /dev/null +++ b/packages/dashboard-backend/.vscode/settings.json @@ -0,0 +1,9 @@ +{ + "editor.tabSize": 2, + "search.exclude": { + "**/lib": true, + "**/coverage": true + }, + "typescript.preferences.importModuleSpecifier": "non-relative", + "javascript.preferences.importModuleSpecifier": "non-relative" +} \ No newline at end of file diff --git a/packages/dashboard-backend/jest.config.js b/packages/dashboard-backend/jest.config.js index 81f19a1f7a..53ab240671 100644 --- a/packages/dashboard-backend/jest.config.js +++ b/packages/dashboard-backend/jest.config.js @@ -18,6 +18,10 @@ module.exports = { moduleDirectories: [ 'node_modules', ], + moduleNameMapper: { + // mapping for absolute imports (see tsconfig.json) + '^@/(.*)$': '/src/$1', + }, collectCoverageFrom: [ ...base.collectCoverageFrom, diff --git a/packages/dashboard-backend/package.json b/packages/dashboard-backend/package.json index 09f6bc84aa..379032b4e0 100644 --- a/packages/dashboard-backend/package.json +++ b/packages/dashboard-backend/package.json @@ -61,8 +61,11 @@ "copy-webpack-plugin": "^11.0.0", "eslint": "^8.46.0", "eslint-config-prettier": "^9.0.0", + "eslint-plugin-import": "^2.28.1", + "eslint-plugin-no-relative-import-paths": "^1.5.2", "eslint-plugin-notice": "^0.9.10", "eslint-plugin-prettier": "^5.0.0", + "eslint-plugin-simple-import-sort": "^10.0.0", "eslint-webpack-plugin": "^4.0.1", "file-loader": "^6.2.0", "jest": "^29.6.2", diff --git a/packages/dashboard-backend/src/__tests__/app.spec.ts b/packages/dashboard-backend/src/__tests__/app.spec.ts index e4217fa87f..384f6d3acc 100644 --- a/packages/dashboard-backend/src/__tests__/app.spec.ts +++ b/packages/dashboard-backend/src/__tests__/app.spec.ts @@ -11,7 +11,8 @@ */ import process from 'process'; -import { setup, teardown } from '../helpers/tests/appBuilder'; + +import { setup, teardown } from '@/helpers/tests/appBuilder'; const mockProcessExit = jest.fn(); (process as any).exit = mockProcessExit.mockImplementation(code => { diff --git a/packages/dashboard-backend/src/app.ts b/packages/dashboard-backend/src/app.ts index ad4233a703..8db570001d 100644 --- a/packages/dashboard-backend/src/app.ts +++ b/packages/dashboard-backend/src/app.ts @@ -10,35 +10,37 @@ * Red Hat, Inc. - initial API and implementation */ +import 'reflect-metadata'; + import { helpers } from '@eclipse-che/common'; import { FastifyInstance } from 'fastify'; -import 'reflect-metadata'; -import parseArgs from './helpers/parseArgs'; -import { isLocalRun, registerLocalRun } from './localRun'; -import { registerCors } from './plugins/cors'; -import { registerStaticServer } from './plugins/staticServer'; -import { registerSwagger } from './plugins/swagger'; -import { registerWebSocket } from './plugins/webSocket'; -import { registerClusterConfigRoute } from './routes/api/clusterConfig'; -import { registerClusterInfoRoute } from './routes/api/clusterInfo'; -import { registerDevfileSchemaRoute } from './routes/api/devfileSchema'; -import { registerDevworkspaceResourcesRoute } from './routes/api/devworkspaceResources'; -import { registerDevworkspacesRoutes } from './routes/api/devworkspaces'; -import { registerDevWorkspaceTemplates } from './routes/api/devworkspaceTemplates'; -import { registerDockerConfigRoutes } from './routes/api/dockerConfig'; -import { registerEventsRoutes } from './routes/api/events'; -import { registerKubeConfigRoute } from './routes/api/kubeConfig'; -import { registerPodmanLoginRoute } from './routes/api/podmanLogin'; -import { registerPersonalAccessTokenRoutes } from './routes/api/personalAccessToken'; -import { registerPodsRoutes } from './routes/api/pods'; -import { registerServerConfigRoute } from './routes/api/serverConfig'; -import { registerUserProfileRoute } from './routes/api/userProfile'; -import { registerWebsocket } from './routes/api/websocket'; -import { registerYamlResolverRoute } from './routes/api/yamlResolver'; -import { registerFactoryAcceptanceRedirect } from './routes/factoryAcceptanceRedirect'; -import { registerWorkspaceRedirect } from './routes/workspaceRedirect'; -import { registerGitConfigRoutes } from './routes/api/gitConfig'; -import { registerGettingStartedSamplesRoutes } from './routes/api/gettingStartedSample'; + +import parseArgs from '@/helpers/parseArgs'; +import { isLocalRun, registerLocalRun } from '@/localRun'; +import { registerCors } from '@/plugins/cors'; +import { registerStaticServer } from '@/plugins/staticServer'; +import { registerSwagger } from '@/plugins/swagger'; +import { registerWebSocket } from '@/plugins/webSocket'; +import { registerClusterConfigRoute } from '@/routes/api/clusterConfig'; +import { registerClusterInfoRoute } from '@/routes/api/clusterInfo'; +import { registerDevfileSchemaRoute } from '@/routes/api/devfileSchema'; +import { registerDevworkspaceResourcesRoute } from '@/routes/api/devworkspaceResources'; +import { registerDevworkspacesRoutes } from '@/routes/api/devworkspaces'; +import { registerDevWorkspaceTemplates } from '@/routes/api/devworkspaceTemplates'; +import { registerDockerConfigRoutes } from '@/routes/api/dockerConfig'; +import { registerEventsRoutes } from '@/routes/api/events'; +import { registerGettingStartedSamplesRoutes } from '@/routes/api/gettingStartedSample'; +import { registerGitConfigRoutes } from '@/routes/api/gitConfig'; +import { registerKubeConfigRoute } from '@/routes/api/kubeConfig'; +import { registerPersonalAccessTokenRoutes } from '@/routes/api/personalAccessToken'; +import { registerPodmanLoginRoute } from '@/routes/api/podmanLogin'; +import { registerPodsRoutes } from '@/routes/api/pods'; +import { registerServerConfigRoute } from '@/routes/api/serverConfig'; +import { registerUserProfileRoute } from '@/routes/api/userProfile'; +import { registerWebsocket } from '@/routes/api/websocket'; +import { registerYamlResolverRoute } from '@/routes/api/yamlResolver'; +import { registerFactoryAcceptanceRedirect } from '@/routes/factoryAcceptanceRedirect'; +import { registerWorkspaceRedirect } from '@/routes/workspaceRedirect'; export default async function buildApp(server: FastifyInstance): Promise { const cheHost = process.env.CHE_HOST as string; diff --git a/packages/dashboard-backend/src/constants/schemas.ts b/packages/dashboard-backend/src/constants/schemas.ts index 0cfe6d41d0..d2e6116106 100644 --- a/packages/dashboard-backend/src/constants/schemas.ts +++ b/packages/dashboard-backend/src/constants/schemas.ts @@ -10,9 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ -import { dockerConfigExample, devWorkspaceResourcesExample } from './examples'; import { JSONSchema7 } from 'json-schema'; +import { devWorkspaceResourcesExample, dockerConfigExample } from '@/constants/examples'; + export const authenticationHeaderSchema: JSONSchema7 = { type: 'object', properties: { diff --git a/packages/dashboard-backend/src/devworkspaceClient/__mocks__/index.ts b/packages/dashboard-backend/src/devworkspaceClient/__mocks__/index.ts index 4f4c979def..0e9d7d9452 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/__mocks__/index.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/__mocks__/index.ts @@ -10,7 +10,6 @@ * Red Hat, Inc. - initial API and implementation */ -import { IDevWorkspaceClient } from '..'; import { IDevWorkspaceApi, IDevWorkspaceTemplateApi, @@ -22,7 +21,9 @@ import { IPodApi, IServerConfigApi, IUserProfileApi, -} from '../types'; +} from '@/devworkspaceClient/types'; + +import { IDevWorkspaceClient } from '..'; export class DevWorkspaceClient implements IDevWorkspaceClient { get eventApi(): IEventApi { diff --git a/packages/dashboard-backend/src/devworkspaceClient/__tests__/index.spec.ts b/packages/dashboard-backend/src/devworkspaceClient/__tests__/index.spec.ts index 1800e4d05f..ab9c3eaf78 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/__tests__/index.spec.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/__tests__/index.spec.ts @@ -12,18 +12,20 @@ import * as mockClientNode from '@kubernetes/client-node'; import { KubeConfig } from '@kubernetes/client-node'; + +import { DevWorkspaceApiService } from '@/devworkspaceClient/services/devWorkspaceApi'; +import { DevWorkspaceTemplateApiService } from '@/devworkspaceClient/services/devWorkspaceTemplateApi'; +import { DockerConfigApiService } from '@/devworkspaceClient/services/dockerConfigApi'; +import { EventApiService } from '@/devworkspaceClient/services/eventApi'; +import { GettingStartedSamplesApiService } from '@/devworkspaceClient/services/gettingStartedSamplesApi'; +import { GitConfigApiService } from '@/devworkspaceClient/services/gitConfigApi'; +import { KubeConfigApiService } from '@/devworkspaceClient/services/kubeConfigApi'; +import { LogsApiService } from '@/devworkspaceClient/services/logsApi'; +import { PodApiService } from '@/devworkspaceClient/services/podApi'; +import { ServerConfigApiService } from '@/devworkspaceClient/services/serverConfigApi'; +import { UserProfileApiService } from '@/devworkspaceClient/services/userProfileApi'; + import { DevWorkspaceClient } from '..'; -import { DevWorkspaceApiService } from '../services/devWorkspaceApi'; -import { DevWorkspaceTemplateApiService } from '../services/devWorkspaceTemplateApi'; -import { DockerConfigApiService } from '../services/dockerConfigApi'; -import { EventApiService } from '../services/eventApi'; -import { GitConfigApiService } from '../services/gitConfigApi'; -import { KubeConfigApiService } from '../services/kubeConfigApi'; -import { LogsApiService } from '../services/logsApi'; -import { PodApiService } from '../services/podApi'; -import { ServerConfigApiService } from '../services/serverConfigApi'; -import { UserProfileApiService } from '../services/userProfileApi'; -import { GettingStartedSamplesApiService } from '../services/gettingStartedSamplesApi'; jest.mock('../services/devWorkspaceApi.ts'); diff --git a/packages/dashboard-backend/src/devworkspaceClient/index.ts b/packages/dashboard-backend/src/devworkspaceClient/index.ts index 58b370e70d..7d5ab13c52 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/index.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/index.ts @@ -11,19 +11,20 @@ */ import * as k8s from '@kubernetes/client-node'; -import { DevWorkspaceApiService } from './services/devWorkspaceApi'; -import { DevWorkspaceTemplateApiService } from './services/devWorkspaceTemplateApi'; -import { DockerConfigApiService } from './services/dockerConfigApi'; -import { EventApiService } from './services/eventApi'; -import { GettingStartedSamplesApiService } from './services/gettingStartedSamplesApi'; -import { GitConfigApiService } from './services/gitConfigApi'; -import { KubeConfigApiService } from './services/kubeConfigApi'; -import { LogsApiService } from './services/logsApi'; -import { PersonalAccessTokenService } from './services/personalAccessTokenApi'; -import { PodApiService } from './services/podApi'; -import { PodmanApiService } from './services/podmanApi'; -import { ServerConfigApiService } from './services/serverConfigApi'; -import { UserProfileApiService } from './services/userProfileApi'; + +import { DevWorkspaceApiService } from '@/devworkspaceClient/services/devWorkspaceApi'; +import { DevWorkspaceTemplateApiService } from '@/devworkspaceClient/services/devWorkspaceTemplateApi'; +import { DockerConfigApiService } from '@/devworkspaceClient/services/dockerConfigApi'; +import { EventApiService } from '@/devworkspaceClient/services/eventApi'; +import { GettingStartedSamplesApiService } from '@/devworkspaceClient/services/gettingStartedSamplesApi'; +import { GitConfigApiService } from '@/devworkspaceClient/services/gitConfigApi'; +import { KubeConfigApiService } from '@/devworkspaceClient/services/kubeConfigApi'; +import { LogsApiService } from '@/devworkspaceClient/services/logsApi'; +import { PersonalAccessTokenService } from '@/devworkspaceClient/services/personalAccessTokenApi'; +import { PodApiService } from '@/devworkspaceClient/services/podApi'; +import { PodmanApiService } from '@/devworkspaceClient/services/podmanApi'; +import { ServerConfigApiService } from '@/devworkspaceClient/services/serverConfigApi'; +import { UserProfileApiService } from '@/devworkspaceClient/services/userProfileApi'; import { IDevWorkspaceApi, IDevWorkspaceClient, @@ -39,7 +40,7 @@ import { IPodmanApi, IServerConfigApi, IUserProfileApi, -} from './types'; +} from '@/devworkspaceClient/types'; export * from './types'; diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/devWorkspaceApi.spec.ts b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/devWorkspaceApi.spec.ts index e2ab684da7..a1b9ec83d0 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/devWorkspaceApi.spec.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/devWorkspaceApi.spec.ts @@ -19,11 +19,11 @@ import { V1alpha2DevWorkspace, } from '@devfile/api'; import { api } from '@eclipse-che/common'; -import { IPatch } from '@eclipse-che/common/src/dto/api'; import * as mockClient from '@kubernetes/client-node'; import { CustomObjectsApi } from '@kubernetes/client-node'; import { IncomingMessage } from 'http'; -import { DevWorkspaceApiService } from '../devWorkspaceApi'; + +import { DevWorkspaceApiService } from '@/devworkspaceClient/services/devWorkspaceApi'; const namespace = 'user-che'; const name = 'wksp-name'; @@ -138,7 +138,7 @@ describe('DevWorkspace API Service', () => { }); test('patching', async () => { - const patches: IPatch[] = [ + const patches: api.IPatch[] = [ { op: 'replace', path: '/metadata/annotations', diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/devWorkspaceTemplateApi.spec.ts b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/devWorkspaceTemplateApi.spec.ts index 15d82d0c96..1f38d4063c 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/devWorkspaceTemplateApi.spec.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/devWorkspaceTemplateApi.spec.ts @@ -18,13 +18,14 @@ import { devworkspacetemplatePlural, V1alpha2DevWorkspaceTemplate, } from '@devfile/api'; -import { IPatch } from '@eclipse-che/common/src/dto/api'; +import { api } from '@eclipse-che/common'; import * as mockClient from '@kubernetes/client-node'; import { CustomObjectsApi } from '@kubernetes/client-node'; + import { DevWorkspaceTemplateApiService, DevWorkspaceTemplateList, -} from '../devWorkspaceTemplateApi'; +} from '@/devworkspaceClient/services/devWorkspaceTemplateApi'; const namespace = 'user-che'; const name = 'tmpl-name'; @@ -128,7 +129,7 @@ describe('DevWorkspaceTemplate API Service', () => { }); test('patching', async () => { - const patches: IPatch[] = [ + const patches: api.IPatch[] = [ { op: 'replace', path: '/metadata/annotations', diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/dockerConfigApi.spec.ts b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/dockerConfigApi.spec.ts index a1886af78e..bc7faa1848 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/dockerConfigApi.spec.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/dockerConfigApi.spec.ts @@ -14,7 +14,12 @@ import * as mockClient from '@kubernetes/client-node'; import { CoreV1Api, V1Secret } from '@kubernetes/client-node'; -import { DockerConfigApiService, SECRET_KEY, SECRET_NAME } from '../dockerConfigApi'; + +import { + DockerConfigApiService, + SECRET_KEY, + SECRET_NAME, +} from '@/devworkspaceClient/services/dockerConfigApi'; describe('Docker Config API Service', () => { let dockerConfigService: DockerConfigApiService; diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/eventApi.spec.ts b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/eventApi.spec.ts index e2bac9b0cb..3dcd5dcc76 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/eventApi.spec.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/eventApi.spec.ts @@ -15,7 +15,8 @@ import { api } from '@eclipse-che/common'; import * as mockClient from '@kubernetes/client-node'; import { CoreV1Api, CoreV1Event, V1Status } from '@kubernetes/client-node'; -import { EventApiService } from '../eventApi'; + +import { EventApiService } from '@/devworkspaceClient/services/eventApi'; jest.mock('../helpers/prepareCustomObjectWatch'); diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/gettingStartedSamplesApi.spec.ts b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/gettingStartedSamplesApi.spec.ts index 81529d6b82..12f707c677 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/gettingStartedSamplesApi.spec.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/gettingStartedSamplesApi.spec.ts @@ -10,9 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ -import * as mockClient from '@kubernetes/client-node'; -import { GettingStartedSamplesApiService } from '../gettingStartedSamplesApi'; import { api } from '@eclipse-che/common'; +import * as mockClient from '@kubernetes/client-node'; + +import { GettingStartedSamplesApiService } from '@/devworkspaceClient/services/gettingStartedSamplesApi'; describe('Getting Started Samples API Service', () => { const env = process.env; diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/kubeConfigApi.spec.ts b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/kubeConfigApi.spec.ts index 514bfd3075..85cf644d9f 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/kubeConfigApi.spec.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/kubeConfigApi.spec.ts @@ -14,8 +14,9 @@ import * as mockClient from '@kubernetes/client-node'; import { CoreV1Api, V1PodList } from '@kubernetes/client-node'; -import { KubeConfigApiService } from '../kubeConfigApi'; -import * as helper from '../helpers/exec'; + +import * as helper from '@/devworkspaceClient/services/helpers/exec'; +import { KubeConfigApiService } from '@/devworkspaceClient/services/kubeConfigApi'; const homeUserDir = '/home/user'; const kubeConfigDir = `${homeUserDir}/.kube`; diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/podApi.spec.ts b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/podApi.spec.ts index f4e2fe8e32..923049b89e 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/podApi.spec.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/podApi.spec.ts @@ -15,7 +15,8 @@ import { api } from '@eclipse-che/common'; import * as mockClient from '@kubernetes/client-node'; import { CoreV1Api, V1Pod, V1Status } from '@kubernetes/client-node'; -import { PodApiService } from '../podApi'; + +import { PodApiService } from '@/devworkspaceClient/services/podApi'; jest.mock('../helpers/prepareCustomObjectWatch'); diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/serverConfigApi.spec.ts b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/serverConfigApi.spec.ts index e6c077b48a..2683729f95 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/serverConfigApi.spec.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/serverConfigApi.spec.ts @@ -14,8 +14,9 @@ import * as mockClient from '@kubernetes/client-node'; import { CustomObjectsApi } from '@kubernetes/client-node'; -import { CustomResourceDefinition, CustomResourceDefinitionList } from '../..'; -import { ServerConfigApiService } from '../serverConfigApi'; + +import { CustomResourceDefinition, CustomResourceDefinitionList } from '@/devworkspaceClient'; +import { ServerConfigApiService } from '@/devworkspaceClient/services/serverConfigApi'; jest.mock('../../../helpers/getUserName.ts'); diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/userProfileApi.spec.ts b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/userProfileApi.spec.ts index 8ce64e2b95..a1c00adb46 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/userProfileApi.spec.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/__tests__/userProfileApi.spec.ts @@ -14,7 +14,8 @@ import * as mockClient from '@kubernetes/client-node'; import { CoreV1Api, V1Secret } from '@kubernetes/client-node'; -import { UserProfileApiService } from '../userProfileApi'; + +import { UserProfileApiService } from '@/devworkspaceClient/services/userProfileApi'; jest.mock('../../../helpers/getUserName.ts'); diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/devWorkspaceApi.ts b/packages/dashboard-backend/src/devworkspaceClient/services/devWorkspaceApi.ts index d05eb6d2aa..c9b8776738 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/devWorkspaceApi.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/devWorkspaceApi.ts @@ -20,11 +20,15 @@ import { api } from '@eclipse-che/common'; import * as k8s from '@kubernetes/client-node'; import { V1Status } from '@kubernetes/client-node'; import http, { IncomingHttpHeaders } from 'http'; -import { MessageListener } from '../../services/types/Observer'; -import { IDevWorkspaceApi } from '../types'; -import { createError } from './helpers/createError'; -import { CustomObjectAPI, prepareCustomObjectAPI } from './helpers/prepareCustomObjectAPI'; -import { prepareCustomObjectWatch } from './helpers/prepareCustomObjectWatch'; + +import { createError } from '@/devworkspaceClient/services/helpers/createError'; +import { + CustomObjectAPI, + prepareCustomObjectAPI, +} from '@/devworkspaceClient/services/helpers/prepareCustomObjectAPI'; +import { prepareCustomObjectWatch } from '@/devworkspaceClient/services/helpers/prepareCustomObjectWatch'; +import { IDevWorkspaceApi } from '@/devworkspaceClient/types'; +import { MessageListener } from '@/services/types/Observer'; const DEV_WORKSPACE_API_ERROR_LABEL = 'CUSTOM_OBJECTS_API_ERROR'; diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/devWorkspaceTemplateApi.ts b/packages/dashboard-backend/src/devworkspaceClient/services/devWorkspaceTemplateApi.ts index e1dacd43c1..56c673cb06 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/devWorkspaceTemplateApi.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/devWorkspaceTemplateApi.ts @@ -10,17 +10,21 @@ * Red Hat, Inc. - initial API and implementation */ -import * as k8s from '@kubernetes/client-node'; import { devworkspacetemplateGroup, devworkspacetemplateLatestVersion, devworkspacetemplatePlural, V1alpha2DevWorkspaceTemplate, } from '@devfile/api'; -import { IDevWorkspaceTemplateApi } from '../types'; -import { createError } from './helpers/createError'; import { api } from '@eclipse-che/common'; -import { CustomObjectAPI, prepareCustomObjectAPI } from './helpers/prepareCustomObjectAPI'; +import * as k8s from '@kubernetes/client-node'; + +import { createError } from '@/devworkspaceClient/services/helpers/createError'; +import { + CustomObjectAPI, + prepareCustomObjectAPI, +} from '@/devworkspaceClient/services/helpers/prepareCustomObjectAPI'; +import { IDevWorkspaceTemplateApi } from '@/devworkspaceClient/types'; export type DevWorkspaceTemplateList = { items?: V1alpha2DevWorkspaceTemplate[]; diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/dockerConfigApi.ts b/packages/dashboard-backend/src/devworkspaceClient/services/dockerConfigApi.ts index 6098dea1f4..d729d35852 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/dockerConfigApi.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/dockerConfigApi.ts @@ -13,9 +13,13 @@ import { api, helpers } from '@eclipse-che/common'; import * as k8s from '@kubernetes/client-node'; import { V1Secret } from '@kubernetes/client-node/dist/gen/model/v1Secret'; -import { IDockerConfigApi } from '../types'; -import { createError } from './helpers/createError'; -import { CoreV1API, prepareCoreV1API } from './helpers/prepareCoreV1API'; + +import { createError } from '@/devworkspaceClient/services/helpers/createError'; +import { + CoreV1API, + prepareCoreV1API, +} from '@/devworkspaceClient/services/helpers/prepareCoreV1API'; +import { IDockerConfigApi } from '@/devworkspaceClient/types'; export const SECRET_KEY = '.dockerconfigjson'; export const SECRET_NAME = 'devworkspace-container-registry-dockercfg'; diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/eventApi.ts b/packages/dashboard-backend/src/devworkspaceClient/services/eventApi.ts index 969d7455cc..68c7072aa3 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/eventApi.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/eventApi.ts @@ -14,11 +14,15 @@ import { api } from '@eclipse-che/common'; import * as k8s from '@kubernetes/client-node'; import { CoreV1Event, V1Status } from '@kubernetes/client-node'; import { Request } from 'request'; -import { MessageListener } from '../../services/types/Observer'; -import { IEventApi } from '../types'; -import { createError } from './helpers/createError'; -import { CoreV1API, prepareCoreV1API } from './helpers/prepareCoreV1API'; -import { prepareCustomObjectWatch } from './helpers/prepareCustomObjectWatch'; + +import { createError } from '@/devworkspaceClient/services/helpers/createError'; +import { + CoreV1API, + prepareCoreV1API, +} from '@/devworkspaceClient/services/helpers/prepareCoreV1API'; +import { prepareCustomObjectWatch } from '@/devworkspaceClient/services/helpers/prepareCustomObjectWatch'; +import { IEventApi } from '@/devworkspaceClient/types'; +import { MessageListener } from '@/services/types/Observer'; const EVENT_API_ERROR_LABEL = 'CUSTOM_OBJECTS_API_ERROR'; diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/gettingStartedSamplesApi.ts b/packages/dashboard-backend/src/devworkspaceClient/services/gettingStartedSamplesApi.ts index 4808f70a95..07fad5bce2 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/gettingStartedSamplesApi.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/gettingStartedSamplesApi.ts @@ -10,14 +10,18 @@ * Red Hat, Inc. - initial API and implementation */ -import { IGettingStartedSampleApi } from '../types'; -import * as k8s from '@kubernetes/client-node'; import { api } from '@eclipse-che/common'; -import { CoreV1API, prepareCoreV1API } from './helpers/prepareCoreV1API'; -import { createError } from './helpers/createError'; -import { getIcon } from './helpers/getSampleIcon'; -import http from 'http'; +import * as k8s from '@kubernetes/client-node'; import { V1ConfigMapList } from '@kubernetes/client-node/dist/gen/model/v1ConfigMapList'; +import http from 'http'; + +import { createError } from '@/devworkspaceClient/services/helpers/createError'; +import { getIcon } from '@/devworkspaceClient/services/helpers/getSampleIcon'; +import { + CoreV1API, + prepareCoreV1API, +} from '@/devworkspaceClient/services/helpers/prepareCoreV1API'; +import { IGettingStartedSampleApi } from '@/devworkspaceClient/types'; const API_ERROR_LABEL = 'CORE_V1_API_ERROR'; const DEVFILE_METADATA_LABEL_SELECTOR = diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/gitConfigApi/__tests__/index.spec.ts b/packages/dashboard-backend/src/devworkspaceClient/services/gitConfigApi/__tests__/index.spec.ts index b53f4eb760..0441fe6479 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/gitConfigApi/__tests__/index.spec.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/gitConfigApi/__tests__/index.spec.ts @@ -10,11 +10,12 @@ * Red Hat, Inc. - initial API and implementation */ +import { api } from '@eclipse-che/common'; import * as mockClient from '@kubernetes/client-node'; import { CoreV1Api, V1ConfigMap } from '@kubernetes/client-node'; import { IncomingMessage } from 'http'; + import { GitConfigApiService } from '..'; -import { api } from '@eclipse-che/common'; jest.mock('../../helpers/retryableExec'); diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/gitConfigApi/index.ts b/packages/dashboard-backend/src/devworkspaceClient/services/gitConfigApi/index.ts index 9dfc16ce70..751d335311 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/gitConfigApi/index.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/gitConfigApi/index.ts @@ -13,9 +13,13 @@ import { api } from '@eclipse-che/common'; import * as k8s from '@kubernetes/client-node'; import * as ini from 'multi-ini'; -import { IGitConfigApi } from '../../types'; -import { createError } from '../helpers/createError'; -import { CoreV1API, prepareCoreV1API } from '../helpers/prepareCoreV1API'; + +import { createError } from '@/devworkspaceClient/services/helpers/createError'; +import { + CoreV1API, + prepareCoreV1API, +} from '@/devworkspaceClient/services/helpers/prepareCoreV1API'; +import { IGitConfigApi } from '@/devworkspaceClient/types'; const GITCONFIG_CONFIGMAP = 'workspace-userdata-gitconfig-configmap'; const GITCONFIG_API_ERROR_LABEL = 'CORE_V1_API_ERROR'; diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/helpers/__tests__/retryableExec.spec.ts b/packages/dashboard-backend/src/devworkspaceClient/services/helpers/__tests__/retryableExec.spec.ts index 8bae5d7ac2..32f82b9e4d 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/helpers/__tests__/retryableExec.spec.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/helpers/__tests__/retryableExec.spec.ts @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ // eslint-disable-next-line notice/notice -import { retryableExec } from '../retryableExec'; +import { retryableExec } from '@/devworkspaceClient/services/helpers/retryableExec'; describe('Retryable Exec', () => { let attempt: number; diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/helpers/prepareCoreV1API.ts b/packages/dashboard-backend/src/devworkspaceClient/services/helpers/prepareCoreV1API.ts index 2c9211e914..f41c66b9b8 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/helpers/prepareCoreV1API.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/helpers/prepareCoreV1API.ts @@ -11,7 +11,8 @@ */ import * as k8s from '@kubernetes/client-node'; -import { retryableExec } from './retryableExec'; + +import { retryableExec } from '@/devworkspaceClient/services/helpers/retryableExec'; export type CoreV1API = Pick< k8s.CoreV1Api, diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/helpers/prepareCustomObjectAPI.ts b/packages/dashboard-backend/src/devworkspaceClient/services/helpers/prepareCustomObjectAPI.ts index 2867e162af..58b2a62486 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/helpers/prepareCustomObjectAPI.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/helpers/prepareCustomObjectAPI.ts @@ -11,7 +11,8 @@ */ import * as k8s from '@kubernetes/client-node'; -import { retryableExec } from './retryableExec'; + +import { retryableExec } from '@/devworkspaceClient/services/helpers/retryableExec'; export type CustomObjectAPI = Pick< k8s.CustomObjectsApi, diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/helpers/prepareCustomObjectWatch.ts b/packages/dashboard-backend/src/devworkspaceClient/services/helpers/prepareCustomObjectWatch.ts index 6903678df1..6d56315762 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/helpers/prepareCustomObjectWatch.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/helpers/prepareCustomObjectWatch.ts @@ -11,7 +11,8 @@ */ import * as k8s from '@kubernetes/client-node'; -import { retryableExec } from './retryableExec'; + +import { retryableExec } from '@/devworkspaceClient/services/helpers/retryableExec'; export function prepareCustomObjectWatch(kc: k8s.KubeConfig): k8s.Watch { const customObjectWatch = new k8s.Watch(kc); diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/helpers/retryableExec.ts b/packages/dashboard-backend/src/devworkspaceClient/services/helpers/retryableExec.ts index 5d66287e0f..f61552e166 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/helpers/retryableExec.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/helpers/retryableExec.ts @@ -10,9 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ -import { delay } from '../../../services/helpers'; import { helpers } from '@eclipse-che/common'; +import { delay } from '@/services/helpers'; + export async function retryableExec(callback: () => Promise, maxAttempt = 5): Promise { let error: unknown; for (let attempt = 0; attempt < maxAttempt; attempt++) { diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/kubeConfigApi.ts b/packages/dashboard-backend/src/devworkspaceClient/services/kubeConfigApi.ts index b7deaf6146..b8266c7e29 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/kubeConfigApi.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/kubeConfigApi.ts @@ -10,11 +10,15 @@ * Red Hat, Inc. - initial API and implementation */ -import * as k8s from '@kubernetes/client-node'; -import { IKubeConfigApi } from '../types'; import { helpers } from '@eclipse-che/common'; -import { exec, ServerConfig } from './helpers/exec'; -import { CoreV1API, prepareCoreV1API } from './helpers/prepareCoreV1API'; +import * as k8s from '@kubernetes/client-node'; + +import { exec, ServerConfig } from '@/devworkspaceClient/services/helpers/exec'; +import { + CoreV1API, + prepareCoreV1API, +} from '@/devworkspaceClient/services/helpers/prepareCoreV1API'; +import { IKubeConfigApi } from '@/devworkspaceClient/types'; const EXCLUDED_CONTAINERS = ['che-gateway', 'che-machine-exec']; diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/logsApi/__tests__/logsApi.retry1.spec.ts b/packages/dashboard-backend/src/devworkspaceClient/services/logsApi/__tests__/logsApi.retry1.spec.ts index 541f26b1fc..428e55f054 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/logsApi/__tests__/logsApi.retry1.spec.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/logsApi/__tests__/logsApi.retry1.spec.ts @@ -15,9 +15,11 @@ import { api } from '@eclipse-che/common'; import * as mockClient from '@kubernetes/client-node'; import { CoreV1Api, V1Pod } from '@kubernetes/client-node'; + +import { RETRY_DELAY_SECONDS, RETRY_NUMBER } from '@/devworkspaceClient/services/logsApi/const'; +import * as helpers from '@/services/helpers'; + import { LogsApiService } from '..'; -import * as helpers from '../../../../services/helpers'; -import { RETRY_DELAY_SECONDS, RETRY_NUMBER } from '../const'; jest.mock('../const', () => ({ RETRY_DELAY_SECONDS: 0.1, diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/logsApi/__tests__/logsApi.retry2.spec.ts b/packages/dashboard-backend/src/devworkspaceClient/services/logsApi/__tests__/logsApi.retry2.spec.ts index 1409f8c169..ef92bfaba8 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/logsApi/__tests__/logsApi.retry2.spec.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/logsApi/__tests__/logsApi.retry2.spec.ts @@ -15,9 +15,11 @@ import { api } from '@eclipse-che/common'; import * as mockClient from '@kubernetes/client-node'; import { CoreV1Api, V1Pod } from '@kubernetes/client-node'; + +import { RETRY_DELAY_SECONDS, RETRY_NUMBER } from '@/devworkspaceClient/services/logsApi/const'; +import { delay } from '@/services/helpers'; + import { LogsApiService } from '..'; -import { delay } from '../../../../services/helpers'; -import { RETRY_DELAY_SECONDS, RETRY_NUMBER } from '../const'; jest.mock('../const', () => ({ RETRY_DELAY_SECONDS: 0.1, diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/logsApi/__tests__/logsApi.spec.ts b/packages/dashboard-backend/src/devworkspaceClient/services/logsApi/__tests__/logsApi.spec.ts index b282252793..189acdfafb 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/logsApi/__tests__/logsApi.spec.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/logsApi/__tests__/logsApi.spec.ts @@ -17,7 +17,8 @@ import * as mockClient from '@kubernetes/client-node'; import { CoreV1Api, HttpError, V1Pod, V1Status } from '@kubernetes/client-node'; import * as request from 'request'; import { Writable } from 'stream'; -import { LogsApiService } from '../'; + +import { LogsApiService } from '@/devworkspaceClient/services/logsApi'; jest.mock('../const', () => ({ RETRY_DELAY_SECONDS: 0.1, diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/logsApi/index.ts b/packages/dashboard-backend/src/devworkspaceClient/services/logsApi/index.ts index 0edf10bcc5..aa378781d2 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/logsApi/index.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/logsApi/index.ts @@ -14,12 +14,16 @@ import { api, helpers } from '@eclipse-che/common'; import * as k8s from '@kubernetes/client-node'; import { Log, V1Container, V1Pod, V1Status } from '@kubernetes/client-node'; import { Writable } from 'stream'; -import { isHttpError, isResponse, isV1Status } from '../../../helpers/typeguards'; -import { delay } from '../../../services/helpers'; -import { MessageListener } from '../../../services/types/Observer'; -import { ILogsApi } from '../../types'; -import { CoreV1API, prepareCoreV1API } from '../helpers/prepareCoreV1API'; -import { RETRY_DELAY_SECONDS, RETRY_NUMBER } from './const'; + +import { + CoreV1API, + prepareCoreV1API, +} from '@/devworkspaceClient/services/helpers/prepareCoreV1API'; +import { RETRY_DELAY_SECONDS, RETRY_NUMBER } from '@/devworkspaceClient/services/logsApi/const'; +import { ILogsApi } from '@/devworkspaceClient/types'; +import { isHttpError, isResponse, isV1Status } from '@/helpers/typeguards'; +import { delay } from '@/services/helpers'; +import { MessageListener } from '@/services/types/Observer'; type StopWatchCallback = () => void; type ContainerName = string; diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/personalAccessTokenApi/__tests__/helpers.spec.ts b/packages/dashboard-backend/src/devworkspaceClient/services/personalAccessTokenApi/__tests__/helpers.spec.ts index a9fae005c8..a171c4e13e 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/personalAccessTokenApi/__tests__/helpers.spec.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/personalAccessTokenApi/__tests__/helpers.spec.ts @@ -12,6 +12,7 @@ import { api } from '@eclipse-che/common'; import k8s from '@kubernetes/client-node'; + import { buildLabelSelector, DUMMY_TOKEN_DATA, @@ -20,7 +21,7 @@ import { toSecret, toSecretName, toToken, -} from '../helpers'; +} from '@/devworkspaceClient/services/personalAccessTokenApi/helpers'; describe('Helpers for Personal Access Token API', () => { test('buildLabelSelector', () => { diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/personalAccessTokenApi/__tests__/index.spec.ts b/packages/dashboard-backend/src/devworkspaceClient/services/personalAccessTokenApi/__tests__/index.spec.ts index b7c30961fa..ad975c4425 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/personalAccessTokenApi/__tests__/index.spec.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/personalAccessTokenApi/__tests__/index.spec.ts @@ -16,8 +16,13 @@ import { api } from '@eclipse-che/common'; import * as mockClient from '@kubernetes/client-node'; import { CoreV1Api, V1Secret, V1SecretList } from '@kubernetes/client-node'; import { IncomingMessage } from 'http'; + +import { + DUMMY_TOKEN_DATA, + PersonalAccessTokenSecret, +} from '@/devworkspaceClient/services/personalAccessTokenApi/helpers'; + import { PersonalAccessTokenService } from '..'; -import { DUMMY_TOKEN_DATA, PersonalAccessTokenSecret } from '../helpers'; const mockIsPatSecret = jest.fn(); const mockToToken = jest.fn(); diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/personalAccessTokenApi/index.ts b/packages/dashboard-backend/src/devworkspaceClient/services/personalAccessTokenApi/index.ts index 5722d8319e..452232f9bb 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/personalAccessTokenApi/index.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/personalAccessTokenApi/index.ts @@ -12,9 +12,12 @@ import { api } from '@eclipse-che/common'; import * as k8s from '@kubernetes/client-node'; -import { IPersonalAccessTokenApi } from '../../types'; -import { createError } from '../helpers/createError'; -import { CoreV1API, prepareCoreV1API } from '../helpers/prepareCoreV1API'; + +import { createError } from '@/devworkspaceClient/services/helpers/createError'; +import { + CoreV1API, + prepareCoreV1API, +} from '@/devworkspaceClient/services/helpers/prepareCoreV1API'; import { buildLabelSelector, DUMMY_TOKEN_DATA, @@ -23,7 +26,8 @@ import { toSecret, toSecretName, toToken, -} from './helpers'; +} from '@/devworkspaceClient/services/personalAccessTokenApi/helpers'; +import { IPersonalAccessTokenApi } from '@/devworkspaceClient/types'; const API_ERROR_LABEL = 'CORE_V1_API_ERROR'; diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/podApi.ts b/packages/dashboard-backend/src/devworkspaceClient/services/podApi.ts index 1384c65902..69425e7466 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/podApi.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/podApi.ts @@ -14,11 +14,15 @@ import { api } from '@eclipse-che/common'; import * as k8s from '@kubernetes/client-node'; import { V1Pod, V1Status } from '@kubernetes/client-node'; import { Request } from 'request'; -import { MessageListener } from '../../services/types/Observer'; -import { IPodApi } from '../types'; -import { createError } from './helpers/createError'; -import { CoreV1API, prepareCoreV1API } from './helpers/prepareCoreV1API'; -import { prepareCustomObjectWatch } from './helpers/prepareCustomObjectWatch'; + +import { createError } from '@/devworkspaceClient/services/helpers/createError'; +import { + CoreV1API, + prepareCoreV1API, +} from '@/devworkspaceClient/services/helpers/prepareCoreV1API'; +import { prepareCustomObjectWatch } from '@/devworkspaceClient/services/helpers/prepareCustomObjectWatch'; +import { IPodApi } from '@/devworkspaceClient/types'; +import { MessageListener } from '@/services/types/Observer'; const EVENT_API_ERROR_LABEL = 'CUSTOM_OBJECTS_API_ERROR'; diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/podmanApi.ts b/packages/dashboard-backend/src/devworkspaceClient/services/podmanApi.ts index 5f9735104a..40d55169f5 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/podmanApi.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/podmanApi.ts @@ -10,11 +10,15 @@ * Red Hat, Inc. - initial API and implementation */ -import * as k8s from '@kubernetes/client-node'; -import { IPodmanApi } from '../types'; import { helpers } from '@eclipse-che/common'; -import { exec, ServerConfig } from './helpers/exec'; -import { CoreV1API, prepareCoreV1API } from './helpers/prepareCoreV1API'; +import * as k8s from '@kubernetes/client-node'; + +import { exec, ServerConfig } from '@/devworkspaceClient/services/helpers/exec'; +import { + CoreV1API, + prepareCoreV1API, +} from '@/devworkspaceClient/services/helpers/prepareCoreV1API'; +import { IPodmanApi } from '@/devworkspaceClient/types'; const EXCLUDED_CONTAINERS = ['che-gateway', 'che-machine-exec']; diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/serverConfigApi.ts b/packages/dashboard-backend/src/devworkspaceClient/services/serverConfigApi.ts index 079526461e..bbbc63b4d4 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/serverConfigApi.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/serverConfigApi.ts @@ -13,18 +13,22 @@ import { V221DevfileComponents } from '@devfile/api'; import { api } from '@eclipse-che/common'; import * as k8s from '@kubernetes/client-node'; +import { readFileSync } from 'fs'; +import path from 'path'; + +import { startTimeoutSeconds } from '@/constants/server-config'; +import { createError } from '@/devworkspaceClient/services/helpers/createError'; +import { + CustomObjectAPI, + prepareCustomObjectAPI, +} from '@/devworkspaceClient/services/helpers/prepareCustomObjectAPI'; import { CustomResourceDefinition, CustomResourceDefinitionList, CustomResourceDefinitionSpecDevEnvironments, IServerConfigApi, -} from '../types'; -import { createError } from './helpers/createError'; -import { CustomObjectAPI, prepareCustomObjectAPI } from './helpers/prepareCustomObjectAPI'; -import { startTimeoutSeconds } from '../../constants/server-config'; -import { isLocalRun } from '../../localRun'; -import { readFileSync } from 'fs'; -import path from 'path'; +} from '@/devworkspaceClient/types'; +import { isLocalRun } from '@/localRun'; const CUSTOM_RESOURCE_DEFINITIONS_API_ERROR_LABEL = 'CUSTOM_RESOURCE_DEFINITIONS_API_ERROR'; diff --git a/packages/dashboard-backend/src/devworkspaceClient/services/userProfileApi.ts b/packages/dashboard-backend/src/devworkspaceClient/services/userProfileApi.ts index fee1f7de04..20b737b2cc 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/services/userProfileApi.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/services/userProfileApi.ts @@ -12,9 +12,13 @@ import { api } from '@eclipse-che/common'; import * as k8s from '@kubernetes/client-node'; -import { IUserProfileApi } from '../types'; -import { createError } from './helpers/createError'; -import { CoreV1API, prepareCoreV1API } from './helpers/prepareCoreV1API'; + +import { createError } from '@/devworkspaceClient/services/helpers/createError'; +import { + CoreV1API, + prepareCoreV1API, +} from '@/devworkspaceClient/services/helpers/prepareCoreV1API'; +import { IUserProfileApi } from '@/devworkspaceClient/types'; const ERROR_LABEL = 'CORE_V1_API_ERROR'; const USER_PROFILE_SECRET_NAME = 'user-profile'; diff --git a/packages/dashboard-backend/src/devworkspaceClient/types/index.ts b/packages/dashboard-backend/src/devworkspaceClient/types/index.ts index 231c2b4a02..f0819c0df9 100644 --- a/packages/dashboard-backend/src/devworkspaceClient/types/index.ts +++ b/packages/dashboard-backend/src/devworkspaceClient/types/index.ts @@ -17,9 +17,10 @@ import { } from '@devfile/api'; import { api } from '@eclipse-che/common'; import * as k8s from '@kubernetes/client-node'; -import { MessageListener } from '../../services/types/Observer'; import { IncomingHttpHeaders } from 'http'; +import { MessageListener } from '@/services/types/Observer'; + /** * Holds the methods for working with dockerconfig for devworkspace * which is stored in Kubernetes Secret and is annotated in DevWorkspace operator specific way. diff --git a/packages/dashboard-backend/src/helpers/__tests__/getUserName.spec.ts b/packages/dashboard-backend/src/helpers/__tests__/getUserName.spec.ts index d0688d5ec2..09bf3fb6f0 100644 --- a/packages/dashboard-backend/src/helpers/__tests__/getUserName.spec.ts +++ b/packages/dashboard-backend/src/helpers/__tests__/getUserName.spec.ts @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { getUserName } from '../getUserName'; +import { getUserName } from '@/helpers/getUserName'; describe('helpers', () => { afterEach(() => { diff --git a/packages/dashboard-backend/src/helpers/tests/appBuilder.ts b/packages/dashboard-backend/src/helpers/tests/appBuilder.ts index 7d88f30289..a99a88f4b1 100644 --- a/packages/dashboard-backend/src/helpers/tests/appBuilder.ts +++ b/packages/dashboard-backend/src/helpers/tests/appBuilder.ts @@ -11,7 +11,8 @@ */ import fastify, { FastifyInstance } from 'fastify'; -import buildApp from '../../app'; + +import buildApp from '@/app'; jest.mock('args'); diff --git a/packages/dashboard-backend/src/helpers/typeguards.ts b/packages/dashboard-backend/src/helpers/typeguards.ts index cac9baa979..e2c08a7f5d 100644 --- a/packages/dashboard-backend/src/helpers/typeguards.ts +++ b/packages/dashboard-backend/src/helpers/typeguards.ts @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { V1Status, HttpError } from '@kubernetes/client-node'; +import { HttpError, V1Status } from '@kubernetes/client-node'; import { Response } from 'request'; /** diff --git a/packages/dashboard-backend/src/localRun/index.ts b/packages/dashboard-backend/src/localRun/index.ts index bddb4d11c8..801d7f637b 100644 --- a/packages/dashboard-backend/src/localRun/index.ts +++ b/packages/dashboard-backend/src/localRun/index.ts @@ -11,13 +11,14 @@ */ import { FastifyInstance } from 'fastify'; -import { authenticateApiRequestsHook } from './hooks/authenticateApiRequests'; -import { addAuthorizationHooks } from './hooks/authorizationHooks'; -import { registerOauth2Plugin } from './plugins/oauth2'; -import { registerCheApiProxy } from './proxies/cheServerApi'; -import { registerDexProxies } from './proxies/dexProxies'; -import { registerDexCallback } from './routes/dexCallback'; -import { registerSignOut } from './routes/signOut'; + +import { authenticateApiRequestsHook } from '@/localRun/hooks/authenticateApiRequests'; +import { addAuthorizationHooks } from '@/localRun/hooks/authorizationHooks'; +import { registerOauth2Plugin } from '@/localRun/plugins/oauth2'; +import { registerCheApiProxy } from '@/localRun/proxies/cheServerApi'; +import { registerDexProxies } from '@/localRun/proxies/dexProxies'; +import { registerDexCallback } from '@/localRun/routes/dexCallback'; +import { registerSignOut } from '@/localRun/routes/signOut'; export function isLocalRun(): boolean { const isLocalRun = process.env['LOCAL_RUN'] === 'true'; diff --git a/packages/dashboard-backend/src/localRun/plugins/oauth2.ts b/packages/dashboard-backend/src/localRun/plugins/oauth2.ts index 2c3c91a4fc..3e831957f6 100644 --- a/packages/dashboard-backend/src/localRun/plugins/oauth2.ts +++ b/packages/dashboard-backend/src/localRun/plugins/oauth2.ts @@ -10,8 +10,8 @@ * Red Hat, Inc. - initial API and implementation */ -import { FastifyInstance } from 'fastify'; import oauth2Plugin, { OAuth2Namespace } from '@fastify/oauth2'; +import { FastifyInstance } from 'fastify'; declare module 'fastify' { interface FastifyInstance { diff --git a/packages/dashboard-backend/src/localRun/proxies/cheServerApi.ts b/packages/dashboard-backend/src/localRun/proxies/cheServerApi.ts index 4662269030..d9e16663a3 100644 --- a/packages/dashboard-backend/src/localRun/proxies/cheServerApi.ts +++ b/packages/dashboard-backend/src/localRun/proxies/cheServerApi.ts @@ -10,13 +10,14 @@ * Red Hat, Inc. - initial API and implementation */ +import fastifyHttpProxy from '@fastify/http-proxy'; import { FastifyInstance } from 'fastify'; -import { stubCheServerOptionsRequests } from '../hooks/stubCheServerOptionsRequests'; - // to workaround the issue with TextEncoder import { TextEncoder } from 'util'; + +import { stubCheServerOptionsRequests } from '@/localRun/hooks/stubCheServerOptionsRequests'; + (global as any).TextEncoder = TextEncoder; -import fastifyHttpProxy from '@fastify/http-proxy'; export function registerCheApiProxy(server: FastifyInstance, upstream: string, origin: string) { console.log(`Dashboard proxies requests to Che Server API on ${upstream}/api.`); diff --git a/packages/dashboard-backend/src/localRun/proxies/dexProxies.ts b/packages/dashboard-backend/src/localRun/proxies/dexProxies.ts index d401a240b3..c2ebaedea9 100644 --- a/packages/dashboard-backend/src/localRun/proxies/dexProxies.ts +++ b/packages/dashboard-backend/src/localRun/proxies/dexProxies.ts @@ -10,8 +10,8 @@ * Red Hat, Inc. - initial API and implementation */ -import { FastifyInstance } from 'fastify'; import fastifyHttpProxy from '@fastify/http-proxy'; +import { FastifyInstance } from 'fastify'; export function registerDexProxies(server: FastifyInstance, dexIngress: string) { server.register(fastifyHttpProxy, { diff --git a/packages/dashboard-backend/src/plugins/staticServer.ts b/packages/dashboard-backend/src/plugins/staticServer.ts index 5924513070..01b517fb08 100644 --- a/packages/dashboard-backend/src/plugins/staticServer.ts +++ b/packages/dashboard-backend/src/plugins/staticServer.ts @@ -10,8 +10,8 @@ * Red Hat, Inc. - initial API and implementation */ -import { DoneFuncWithErrOrRes, FastifyInstance, FastifyReply, FastifyRequest } from 'fastify'; import fastifyStatic from '@fastify/static'; +import { DoneFuncWithErrOrRes, FastifyInstance, FastifyReply, FastifyRequest } from 'fastify'; import path from 'path'; export function registerStaticServer(publicFolder: string, server: FastifyInstance) { diff --git a/packages/dashboard-backend/src/plugins/swagger.ts b/packages/dashboard-backend/src/plugins/swagger.ts index 3e727f0265..f9df9d7714 100644 --- a/packages/dashboard-backend/src/plugins/swagger.ts +++ b/packages/dashboard-backend/src/plugins/swagger.ts @@ -10,9 +10,9 @@ * Red Hat, Inc. - initial API and implementation */ -import { FastifyInstance } from 'fastify'; import fastifySwagger from '@fastify/swagger'; import fastifySwaggerUi from '@fastify/swagger-ui'; +import { FastifyInstance } from 'fastify'; const ROUTE_PREFIX = '/dashboard/api/swagger'; diff --git a/packages/dashboard-backend/src/routes/__tests__/factoryAcceptanceRedirect.spec.ts b/packages/dashboard-backend/src/routes/__tests__/factoryAcceptanceRedirect.spec.ts index de2ddb226f..0de6700cd3 100644 --- a/packages/dashboard-backend/src/routes/__tests__/factoryAcceptanceRedirect.spec.ts +++ b/packages/dashboard-backend/src/routes/__tests__/factoryAcceptanceRedirect.spec.ts @@ -11,7 +11,8 @@ */ import { FastifyInstance } from 'fastify'; -import { setup, teardown } from '../../helpers/tests/appBuilder'; + +import { setup, teardown } from '@/helpers/tests/appBuilder'; describe('Factory Acceptance Redirect', () => { let app: FastifyInstance; diff --git a/packages/dashboard-backend/src/routes/api/__tests__/clusterConfig.spec.ts b/packages/dashboard-backend/src/routes/api/__tests__/clusterConfig.spec.ts index bd7aa8d11e..d0fa0db82c 100644 --- a/packages/dashboard-backend/src/routes/api/__tests__/clusterConfig.spec.ts +++ b/packages/dashboard-backend/src/routes/api/__tests__/clusterConfig.spec.ts @@ -11,13 +11,14 @@ */ import { FastifyInstance } from 'fastify'; -import { baseApiPath } from '../../../constants/config'; -import { setup, teardown } from '../../../helpers/tests/appBuilder'; + +import { baseApiPath } from '@/constants/config'; +import { setup, teardown } from '@/helpers/tests/appBuilder'; import { stubAllWorkspacesLimit, stubDashboardWarning, stubRunningWorkspacesLimit, -} from '../helpers/__mocks__/getDevWorkspaceClient'; +} from '@/routes/api/helpers/__mocks__/getDevWorkspaceClient'; jest.mock('../helpers/getServiceAccountToken.ts'); jest.mock('../helpers/getDevWorkspaceClient.ts'); diff --git a/packages/dashboard-backend/src/routes/api/__tests__/clusterInfo.spec.ts b/packages/dashboard-backend/src/routes/api/__tests__/clusterInfo.spec.ts index 683aeb5cbf..87db8ad3c4 100644 --- a/packages/dashboard-backend/src/routes/api/__tests__/clusterInfo.spec.ts +++ b/packages/dashboard-backend/src/routes/api/__tests__/clusterInfo.spec.ts @@ -12,8 +12,9 @@ import { ApplicationId } from '@eclipse-che/common'; import { FastifyInstance } from 'fastify'; -import { baseApiPath } from '../../../constants/config'; -import { setup, teardown } from '../../../helpers/tests/appBuilder'; + +import { baseApiPath } from '@/constants/config'; +import { setup, teardown } from '@/helpers/tests/appBuilder'; describe('Cluster Info Route', () => { let app: FastifyInstance; diff --git a/packages/dashboard-backend/src/routes/api/__tests__/devworkspaceTemplates.spec.ts b/packages/dashboard-backend/src/routes/api/__tests__/devworkspaceTemplates.spec.ts index 1f50b79c9b..ed612a1ebe 100644 --- a/packages/dashboard-backend/src/routes/api/__tests__/devworkspaceTemplates.spec.ts +++ b/packages/dashboard-backend/src/routes/api/__tests__/devworkspaceTemplates.spec.ts @@ -10,14 +10,15 @@ * Red Hat, Inc. - initial API and implementation */ -import { IPatch } from '@eclipse-che/common/src/dto/api'; +import { api } from '@eclipse-che/common'; import { FastifyInstance } from 'fastify'; -import { baseApiPath } from '../../../constants/config'; -import { setup, teardown } from '../../../helpers/tests/appBuilder'; + +import { baseApiPath } from '@/constants/config'; +import { setup, teardown } from '@/helpers/tests/appBuilder'; import { stubDevWorkspaceTemplate, stubDevWorkspaceTemplatesList, -} from '../helpers/__mocks__/getDevWorkspaceClient'; +} from '@/routes/api/helpers/__mocks__/getDevWorkspaceClient'; jest.mock('../helpers/getDevWorkspaceClient.ts'); jest.mock('../helpers/getToken.ts'); @@ -64,7 +65,7 @@ describe('DevWorkspaceTemplates Routes', () => { test('PATCH ${baseApiPath}/namespace/:namespace/devworkspacetemplates/:templateName', async () => { const templateName = 'tmpl'; - const patches: IPatch[] = [ + const patches: api.IPatch[] = [ { op: 'replace', path: '/metadata/annotations', diff --git a/packages/dashboard-backend/src/routes/api/__tests__/devworkspaces.spec.ts b/packages/dashboard-backend/src/routes/api/__tests__/devworkspaces.spec.ts index 4fc59176d5..4a2271046b 100644 --- a/packages/dashboard-backend/src/routes/api/__tests__/devworkspaces.spec.ts +++ b/packages/dashboard-backend/src/routes/api/__tests__/devworkspaces.spec.ts @@ -10,14 +10,15 @@ * Red Hat, Inc. - initial API and implementation */ -import { IPatch } from '@eclipse-che/common/src/dto/api'; +import { api } from '@eclipse-che/common'; import { FastifyInstance } from 'fastify'; -import { baseApiPath } from '../../../constants/config'; -import { setup, teardown } from '../../../helpers/tests/appBuilder'; + +import { baseApiPath } from '@/constants/config'; +import { setup, teardown } from '@/helpers/tests/appBuilder'; import { stubDevWorkspace, stubDevWorkspacesList, -} from '../helpers/__mocks__/getDevWorkspaceClient'; +} from '@/routes/api/helpers/__mocks__/getDevWorkspaceClient'; jest.mock('../helpers/getDevWorkspaceClient.ts'); jest.mock('../helpers/getToken.ts'); @@ -68,7 +69,7 @@ describe('DevWorkspaces Routes', () => { }); test('PATCH ${baseApiPath}/namespace/:namespace/devworkspaces/:workspaceName', async () => { - const patches: IPatch[] = [ + const patches: api.IPatch[] = [ { op: 'replace', path: '/metadata/annotations', diff --git a/packages/dashboard-backend/src/routes/api/__tests__/dockerConfig.spec.ts b/packages/dashboard-backend/src/routes/api/__tests__/dockerConfig.spec.ts index 8bedba520a..c169c10211 100644 --- a/packages/dashboard-backend/src/routes/api/__tests__/dockerConfig.spec.ts +++ b/packages/dashboard-backend/src/routes/api/__tests__/dockerConfig.spec.ts @@ -11,9 +11,10 @@ */ import { FastifyInstance } from 'fastify'; -import { baseApiPath } from '../../../constants/config'; -import { setup, teardown } from '../../../helpers/tests/appBuilder'; -import { stubDockerConfig } from '../helpers/__mocks__/getDevWorkspaceClient'; + +import { baseApiPath } from '@/constants/config'; +import { setup, teardown } from '@/helpers/tests/appBuilder'; +import { stubDockerConfig } from '@/routes/api/helpers/__mocks__/getDevWorkspaceClient'; jest.mock('../helpers/getDevWorkspaceClient.ts'); jest.mock('../helpers/getToken.ts'); diff --git a/packages/dashboard-backend/src/routes/api/__tests__/events.spec.ts b/packages/dashboard-backend/src/routes/api/__tests__/events.spec.ts index a1eb80caed..0f1625063a 100644 --- a/packages/dashboard-backend/src/routes/api/__tests__/events.spec.ts +++ b/packages/dashboard-backend/src/routes/api/__tests__/events.spec.ts @@ -11,9 +11,10 @@ */ import { FastifyInstance } from 'fastify'; -import { baseApiPath } from '../../../constants/config'; -import { setup, teardown } from '../../../helpers/tests/appBuilder'; -import { stubEventsList } from '../helpers/__mocks__/getDevWorkspaceClient'; + +import { baseApiPath } from '@/constants/config'; +import { setup, teardown } from '@/helpers/tests/appBuilder'; +import { stubEventsList } from '@/routes/api/helpers/__mocks__/getDevWorkspaceClient'; jest.mock('../helpers/getToken.ts'); jest.mock('../helpers/getDevWorkspaceClient.ts'); diff --git a/packages/dashboard-backend/src/routes/api/__tests__/gitConfig.spec.ts b/packages/dashboard-backend/src/routes/api/__tests__/gitConfig.spec.ts index 402896ab38..aa63703d07 100644 --- a/packages/dashboard-backend/src/routes/api/__tests__/gitConfig.spec.ts +++ b/packages/dashboard-backend/src/routes/api/__tests__/gitConfig.spec.ts @@ -10,10 +10,11 @@ * Red Hat, Inc. - initial API and implementation */ -import { FastifyInstance } from 'fastify'; -import { baseApiPath } from '../../../constants/config'; -import { setup, teardown } from '../../../helpers/tests/appBuilder'; import { api } from '@eclipse-che/common'; +import { FastifyInstance } from 'fastify'; + +import { baseApiPath } from '@/constants/config'; +import { setup, teardown } from '@/helpers/tests/appBuilder'; const mockRead = jest.fn().mockResolvedValue({}); const mockPatch = jest.fn().mockResolvedValue({}); diff --git a/packages/dashboard-backend/src/routes/api/__tests__/kubeConfig.spec.ts b/packages/dashboard-backend/src/routes/api/__tests__/kubeConfig.spec.ts index 7bf9af41fc..c44219d347 100644 --- a/packages/dashboard-backend/src/routes/api/__tests__/kubeConfig.spec.ts +++ b/packages/dashboard-backend/src/routes/api/__tests__/kubeConfig.spec.ts @@ -11,8 +11,9 @@ */ import { FastifyInstance } from 'fastify'; -import { baseApiPath } from '../../../constants/config'; -import { setup, teardown } from '../../../helpers/tests/appBuilder'; + +import { baseApiPath } from '@/constants/config'; +import { setup, teardown } from '@/helpers/tests/appBuilder'; jest.mock('../helpers/getDevWorkspaceClient.ts'); jest.mock('../helpers/getToken.ts'); diff --git a/packages/dashboard-backend/src/routes/api/__tests__/personalAccessToken.spec.ts b/packages/dashboard-backend/src/routes/api/__tests__/personalAccessToken.spec.ts index d95f958585..ee04c70b44 100644 --- a/packages/dashboard-backend/src/routes/api/__tests__/personalAccessToken.spec.ts +++ b/packages/dashboard-backend/src/routes/api/__tests__/personalAccessToken.spec.ts @@ -12,9 +12,10 @@ import { api } from '@eclipse-che/common'; import { FastifyInstance } from 'fastify'; -import { baseApiPath } from '../../../constants/config'; -import { setup, teardown } from '../../../helpers/tests/appBuilder'; -import { stubPersonalAccessTokenList } from '../helpers/__mocks__/getDevWorkspaceClient'; + +import { baseApiPath } from '@/constants/config'; +import { setup, teardown } from '@/helpers/tests/appBuilder'; +import { stubPersonalAccessTokenList } from '@/routes/api/helpers/__mocks__/getDevWorkspaceClient'; jest.mock('../helpers/getToken.ts'); jest.mock('../helpers/getDevWorkspaceClient.ts'); diff --git a/packages/dashboard-backend/src/routes/api/__tests__/pods.spec.ts b/packages/dashboard-backend/src/routes/api/__tests__/pods.spec.ts index 6040be01e1..acbf5f20f2 100644 --- a/packages/dashboard-backend/src/routes/api/__tests__/pods.spec.ts +++ b/packages/dashboard-backend/src/routes/api/__tests__/pods.spec.ts @@ -11,9 +11,10 @@ */ import { FastifyInstance } from 'fastify'; -import { baseApiPath } from '../../../constants/config'; -import { setup, teardown } from '../../../helpers/tests/appBuilder'; -import { stubPodsList } from '../helpers/__mocks__/getDevWorkspaceClient'; + +import { baseApiPath } from '@/constants/config'; +import { setup, teardown } from '@/helpers/tests/appBuilder'; +import { stubPodsList } from '@/routes/api/helpers/__mocks__/getDevWorkspaceClient'; jest.mock('../helpers/getToken.ts'); jest.mock('../helpers/getDevWorkspaceClient.ts'); diff --git a/packages/dashboard-backend/src/routes/api/__tests__/serverConfig.spec.ts b/packages/dashboard-backend/src/routes/api/__tests__/serverConfig.spec.ts index e98337a01c..6fe1c566f7 100644 --- a/packages/dashboard-backend/src/routes/api/__tests__/serverConfig.spec.ts +++ b/packages/dashboard-backend/src/routes/api/__tests__/serverConfig.spec.ts @@ -11,8 +11,9 @@ */ import { FastifyInstance } from 'fastify'; -import { baseApiPath } from '../../../constants/config'; -import { setup, teardown } from '../../../helpers/tests/appBuilder'; + +import { baseApiPath } from '@/constants/config'; +import { setup, teardown } from '@/helpers/tests/appBuilder'; jest.mock('../helpers/getDevWorkspaceClient.ts'); jest.mock('../helpers/getToken.ts'); diff --git a/packages/dashboard-backend/src/routes/api/__tests__/userProfile.spec.ts b/packages/dashboard-backend/src/routes/api/__tests__/userProfile.spec.ts index 1133b8035f..4dfdc7e963 100644 --- a/packages/dashboard-backend/src/routes/api/__tests__/userProfile.spec.ts +++ b/packages/dashboard-backend/src/routes/api/__tests__/userProfile.spec.ts @@ -11,9 +11,10 @@ */ import { FastifyInstance } from 'fastify'; -import { baseApiPath } from '../../../constants/config'; -import { setup, teardown } from '../../../helpers/tests/appBuilder'; -import { stubUserProfile } from '../helpers/__mocks__/getDevWorkspaceClient'; + +import { baseApiPath } from '@/constants/config'; +import { setup, teardown } from '@/helpers/tests/appBuilder'; +import { stubUserProfile } from '@/routes/api/helpers/__mocks__/getDevWorkspaceClient'; jest.mock('../helpers/getDevWorkspaceClient.ts'); jest.mock('../helpers/getToken.ts'); diff --git a/packages/dashboard-backend/src/routes/api/__tests__/yamlResolver.spec.ts b/packages/dashboard-backend/src/routes/api/__tests__/yamlResolver.spec.ts index a7ccd4b602..98042d1c9d 100644 --- a/packages/dashboard-backend/src/routes/api/__tests__/yamlResolver.spec.ts +++ b/packages/dashboard-backend/src/routes/api/__tests__/yamlResolver.spec.ts @@ -12,8 +12,9 @@ import { FastifyInstance } from 'fastify'; import * as mockNodeFetch from 'node-fetch'; -import { baseApiPath } from '../../../constants/config'; -import { setup, teardown } from '../../../helpers/tests/appBuilder'; + +import { baseApiPath } from '@/constants/config'; +import { setup, teardown } from '@/helpers/tests/appBuilder'; const { Response } = jest.requireActual('node-fetch'); diff --git a/packages/dashboard-backend/src/routes/api/clusterConfig.ts b/packages/dashboard-backend/src/routes/api/clusterConfig.ts index eeef8e3ead..fc24b16e37 100644 --- a/packages/dashboard-backend/src/routes/api/clusterConfig.ts +++ b/packages/dashboard-backend/src/routes/api/clusterConfig.ts @@ -10,12 +10,13 @@ * Red Hat, Inc. - initial API and implementation */ -import { FastifyInstance } from 'fastify'; import { ClusterConfig } from '@eclipse-che/common'; -import { baseApiPath } from '../../constants/config'; -import { getSchema } from '../../services/helpers'; -import { getDevWorkspaceClient } from './helpers/getDevWorkspaceClient'; -import { getServiceAccountToken } from './helpers/getServiceAccountToken'; +import { FastifyInstance } from 'fastify'; + +import { baseApiPath } from '@/constants/config'; +import { getDevWorkspaceClient } from '@/routes/api/helpers/getDevWorkspaceClient'; +import { getServiceAccountToken } from '@/routes/api/helpers/getServiceAccountToken'; +import { getSchema } from '@/services/helpers'; const tags = ['Cluster Config']; diff --git a/packages/dashboard-backend/src/routes/api/clusterInfo.ts b/packages/dashboard-backend/src/routes/api/clusterInfo.ts index 1c05c8d0fd..1d3ce35bfa 100644 --- a/packages/dashboard-backend/src/routes/api/clusterInfo.ts +++ b/packages/dashboard-backend/src/routes/api/clusterInfo.ts @@ -10,10 +10,11 @@ * Red Hat, Inc. - initial API and implementation */ -import { FastifyInstance } from 'fastify'; import { ApplicationId, ApplicationInfo, ClusterInfo } from '@eclipse-che/common'; -import { baseApiPath } from '../../constants/config'; -import { getSchema } from '../../services/helpers'; +import { FastifyInstance } from 'fastify'; + +import { baseApiPath } from '@/constants/config'; +import { getSchema } from '@/services/helpers'; const tags = ['Cluster Info']; diff --git a/packages/dashboard-backend/src/routes/api/devfileSchema.ts b/packages/dashboard-backend/src/routes/api/devfileSchema.ts index 42826bdbf4..277914c741 100644 --- a/packages/dashboard-backend/src/routes/api/devfileSchema.ts +++ b/packages/dashboard-backend/src/routes/api/devfileSchema.ts @@ -11,16 +11,17 @@ */ import { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify'; -import { baseApiPath } from '../../constants/config'; -import { getSchema } from '../../services/helpers'; -import { devfileVersionSchema } from '../../constants/schemas'; -import { restParams } from '../../models'; -import * as devfileSchemaV200 from '../../devfileSchemas/2.0.0/devfile.json'; -import * as devfileSchemaV210 from '../../devfileSchemas/2.1.0/devfile.json'; -import * as devfileSchemaV220 from '../../devfileSchemas/2.2.0/devfile.json'; -import * as devfileSchemaV221Alpha from '../../devfileSchemas/2.2.1-alpha/devfile.json'; import { JSONSchema7 } from 'json-schema'; +import { baseApiPath } from '@/constants/config'; +import { devfileVersionSchema } from '@/constants/schemas'; +import * as devfileSchemaV200 from '@/devfileSchemas/2.0.0/devfile.json'; +import * as devfileSchemaV210 from '@/devfileSchemas/2.1.0/devfile.json'; +import * as devfileSchemaV220 from '@/devfileSchemas/2.2.0/devfile.json'; +import * as devfileSchemaV221Alpha from '@/devfileSchemas/2.2.1-alpha/devfile.json'; +import { restParams } from '@/models'; +import { getSchema } from '@/services/helpers'; + const tags = ['Devfile']; type DevfileSchemaV100 = { [key: string]: unknown }; diff --git a/packages/dashboard-backend/src/routes/api/devworkspaceResources.ts b/packages/dashboard-backend/src/routes/api/devworkspaceResources.ts index 0cb92f08a7..6c17bd6cf2 100644 --- a/packages/dashboard-backend/src/routes/api/devworkspaceResources.ts +++ b/packages/dashboard-backend/src/routes/api/devworkspaceResources.ts @@ -10,15 +10,16 @@ * Red Hat, Inc. - initial API and implementation */ -import { FastifyInstance, FastifyRequest } from 'fastify'; -import { baseApiPath } from '../../constants/config'; -import { getSchema } from '../../services/helpers'; -import { devWorkspaceResourcesSchema } from '../../constants/schemas'; -import { dump } from 'js-yaml'; -import { Main as DevworkspaceGenerator } from '@eclipse-che/che-devworkspace-generator/lib/main'; import { V1alpha2DevWorkspaceTemplate } from '@devfile/api'; -import { axiosInstance } from './helpers/getCertificateAuthority'; +import { Main as DevworkspaceGenerator } from '@eclipse-che/che-devworkspace-generator/lib/main'; import { api } from '@eclipse-che/common'; +import { FastifyInstance, FastifyRequest } from 'fastify'; +import { dump } from 'js-yaml'; + +import { baseApiPath } from '@/constants/config'; +import { devWorkspaceResourcesSchema } from '@/constants/schemas'; +import { axiosInstance } from '@/routes/api/helpers/getCertificateAuthority'; +import { getSchema } from '@/services/helpers'; const tags = ['DevWorkspace Resources']; diff --git a/packages/dashboard-backend/src/routes/api/devworkspaceTemplates.ts b/packages/dashboard-backend/src/routes/api/devworkspaceTemplates.ts index 9d6663b292..2114039727 100644 --- a/packages/dashboard-backend/src/routes/api/devworkspaceTemplates.ts +++ b/packages/dashboard-backend/src/routes/api/devworkspaceTemplates.ts @@ -11,18 +11,19 @@ */ import { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify'; -import { baseApiPath } from '../../constants/config'; + +import { baseApiPath } from '@/constants/config'; import { + dwTemplatePatchSchema, namespacedSchema, namespacedTemplateSchema, - dwTemplatePatchSchema, templateStartedSchema, -} from '../../constants/schemas'; -import { getDevWorkspaceClient } from './helpers/getDevWorkspaceClient'; -import { getToken } from './helpers/getToken'; -import { getSchema } from '../../services/helpers'; -import { restParams } from '../../models'; -import { isLocalRun } from '../../localRun'; +} from '@/constants/schemas'; +import { isLocalRun } from '@/localRun'; +import { restParams } from '@/models'; +import { getDevWorkspaceClient } from '@/routes/api/helpers/getDevWorkspaceClient'; +import { getToken } from '@/routes/api/helpers/getToken'; +import { getSchema } from '@/services/helpers'; const tags = ['Devworkspace Template']; diff --git a/packages/dashboard-backend/src/routes/api/devworkspaces.ts b/packages/dashboard-backend/src/routes/api/devworkspaces.ts index 15139290b1..0b765e9f87 100644 --- a/packages/dashboard-backend/src/routes/api/devworkspaces.ts +++ b/packages/dashboard-backend/src/routes/api/devworkspaces.ts @@ -10,19 +10,20 @@ * Red Hat, Inc. - initial API and implementation */ +import { api } from '@eclipse-che/common'; import { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify'; -import { baseApiPath } from '../../constants/config'; + +import { baseApiPath } from '@/constants/config'; import { devworkspacePatchSchema, + devworkspaceSchema, namespacedSchema, namespacedWorkspaceSchema, - devworkspaceSchema, -} from '../../constants/schemas'; -import { getDevWorkspaceClient } from './helpers/getDevWorkspaceClient'; -import { getToken } from './helpers/getToken'; -import { restParams } from '../../models'; -import { getSchema } from '../../services/helpers'; -import { api } from '@eclipse-che/common'; +} from '@/constants/schemas'; +import { restParams } from '@/models'; +import { getDevWorkspaceClient } from '@/routes/api/helpers/getDevWorkspaceClient'; +import { getToken } from '@/routes/api/helpers/getToken'; +import { getSchema } from '@/services/helpers'; const tags = ['Devworkspace']; diff --git a/packages/dashboard-backend/src/routes/api/dockerConfig.ts b/packages/dashboard-backend/src/routes/api/dockerConfig.ts index 19b4c02458..b17e10427a 100644 --- a/packages/dashboard-backend/src/routes/api/dockerConfig.ts +++ b/packages/dashboard-backend/src/routes/api/dockerConfig.ts @@ -11,12 +11,13 @@ */ import { FastifyInstance, FastifyRequest } from 'fastify'; -import { baseApiPath } from '../../constants/config'; -import { dockerConfigSchema, namespacedSchema } from '../../constants/schemas'; -import { getDevWorkspaceClient } from './helpers/getDevWorkspaceClient'; -import { getToken } from './helpers/getToken'; -import { restParams } from '../../models'; -import { getSchema } from '../../services/helpers'; + +import { baseApiPath } from '@/constants/config'; +import { dockerConfigSchema, namespacedSchema } from '@/constants/schemas'; +import { restParams } from '@/models'; +import { getDevWorkspaceClient } from '@/routes/api/helpers/getDevWorkspaceClient'; +import { getToken } from '@/routes/api/helpers/getToken'; +import { getSchema } from '@/services/helpers'; const tags = ['Docker Config']; diff --git a/packages/dashboard-backend/src/routes/api/events.ts b/packages/dashboard-backend/src/routes/api/events.ts index 66be06ccda..da8a470dd9 100644 --- a/packages/dashboard-backend/src/routes/api/events.ts +++ b/packages/dashboard-backend/src/routes/api/events.ts @@ -11,12 +11,13 @@ */ import { FastifyInstance, FastifyRequest } from 'fastify'; -import { baseApiPath } from '../../constants/config'; -import { namespacedSchema } from '../../constants/schemas'; -import { getSchema } from '../../services/helpers'; -import { restParams } from '../../models'; -import { getDevWorkspaceClient } from './helpers/getDevWorkspaceClient'; -import { getToken } from './helpers/getToken'; + +import { baseApiPath } from '@/constants/config'; +import { namespacedSchema } from '@/constants/schemas'; +import { restParams } from '@/models'; +import { getDevWorkspaceClient } from '@/routes/api/helpers/getDevWorkspaceClient'; +import { getToken } from '@/routes/api/helpers/getToken'; +import { getSchema } from '@/services/helpers'; const tags = ['Event']; diff --git a/packages/dashboard-backend/src/routes/api/gettingStartedSample.ts b/packages/dashboard-backend/src/routes/api/gettingStartedSample.ts index f23d39844c..58e114b7a5 100644 --- a/packages/dashboard-backend/src/routes/api/gettingStartedSample.ts +++ b/packages/dashboard-backend/src/routes/api/gettingStartedSample.ts @@ -11,10 +11,11 @@ */ import { FastifyInstance } from 'fastify'; -import { baseApiPath } from '../../constants/config'; -import { getSchema } from '../../services/helpers'; -import { getDevWorkspaceClient } from './helpers/getDevWorkspaceClient'; -import { getServiceAccountToken } from './helpers/getServiceAccountToken'; + +import { baseApiPath } from '@/constants/config'; +import { getDevWorkspaceClient } from '@/routes/api/helpers/getDevWorkspaceClient'; +import { getServiceAccountToken } from '@/routes/api/helpers/getServiceAccountToken'; +import { getSchema } from '@/services/helpers'; const tags = ['Getting Started Samples']; diff --git a/packages/dashboard-backend/src/routes/api/gitConfig.ts b/packages/dashboard-backend/src/routes/api/gitConfig.ts index 331e8b2266..1b1c50b3d0 100644 --- a/packages/dashboard-backend/src/routes/api/gitConfig.ts +++ b/packages/dashboard-backend/src/routes/api/gitConfig.ts @@ -12,12 +12,13 @@ import { api } from '@eclipse-che/common'; import { FastifyInstance, FastifyRequest } from 'fastify'; -import { baseApiPath } from '../../constants/config'; -import { gitConfigSchema, namespacedSchema } from '../../constants/schemas'; -import { restParams } from '../../models'; -import { getSchema } from '../../services/helpers'; -import { getDevWorkspaceClient } from './helpers/getDevWorkspaceClient'; -import { getToken } from './helpers/getToken'; + +import { baseApiPath } from '@/constants/config'; +import { gitConfigSchema, namespacedSchema } from '@/constants/schemas'; +import { restParams } from '@/models'; +import { getDevWorkspaceClient } from '@/routes/api/helpers/getDevWorkspaceClient'; +import { getToken } from '@/routes/api/helpers/getToken'; +import { getSchema } from '@/services/helpers'; const tags = ['Gitconfig']; diff --git a/packages/dashboard-backend/src/routes/api/helpers/__mocks__/getDevWorkspaceClient.ts b/packages/dashboard-backend/src/routes/api/helpers/__mocks__/getDevWorkspaceClient.ts index 3db691b79b..c7ab9dc5de 100644 --- a/packages/dashboard-backend/src/routes/api/helpers/__mocks__/getDevWorkspaceClient.ts +++ b/packages/dashboard-backend/src/routes/api/helpers/__mocks__/getDevWorkspaceClient.ts @@ -19,6 +19,7 @@ import { } from '@devfile/api'; import { api } from '@eclipse-che/common'; import { IncomingHttpHeaders } from 'http'; + import { DevWorkspaceClient, IDevWorkspaceApi, @@ -32,8 +33,8 @@ import { IPodApi, IServerConfigApi, IUserProfileApi, -} from '../../../../devworkspaceClient'; -import { getDevWorkspaceClient as helper } from '../getDevWorkspaceClient'; +} from '@/devworkspaceClient'; +import { getDevWorkspaceClient as helper } from '@/routes/api/helpers/getDevWorkspaceClient'; export const stubContainerBuild = { disableContainerBuildCapabilities: true, diff --git a/packages/dashboard-backend/src/routes/api/helpers/__mocks__/getServiceAccountToken.ts b/packages/dashboard-backend/src/routes/api/helpers/__mocks__/getServiceAccountToken.ts index ba7c6a9813..9b294b0119 100644 --- a/packages/dashboard-backend/src/routes/api/helpers/__mocks__/getServiceAccountToken.ts +++ b/packages/dashboard-backend/src/routes/api/helpers/__mocks__/getServiceAccountToken.ts @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { getServiceAccountToken as helper } from '../getServiceAccountToken'; +import { getServiceAccountToken as helper } from '@/routes/api/helpers/getServiceAccountToken'; export const stubToken = 'SA token'; export function getServiceAccountToken(): ReturnType { diff --git a/packages/dashboard-backend/src/routes/api/helpers/getCertificateAuthority.ts b/packages/dashboard-backend/src/routes/api/helpers/getCertificateAuthority.ts index 30f7d8dc41..f39e82a539 100644 --- a/packages/dashboard-backend/src/routes/api/helpers/getCertificateAuthority.ts +++ b/packages/dashboard-backend/src/routes/api/helpers/getCertificateAuthority.ts @@ -10,10 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ -import * as fs from 'fs-extra'; -import path from 'path'; import * as axios from 'axios'; +import * as fs from 'fs-extra'; import https from 'https'; +import path from 'path'; const DEFAULT_CHE_SELF_SIGNED_MOUNT_PATH = '/public-certs'; const CHE_SELF_SIGNED_MOUNT_PATH = process.env.CHE_SELF_SIGNED_MOUNT_PATH; diff --git a/packages/dashboard-backend/src/routes/api/helpers/getDevWorkspaceClient.ts b/packages/dashboard-backend/src/routes/api/helpers/getDevWorkspaceClient.ts index ebc68c44e5..0cccffb1c0 100644 --- a/packages/dashboard-backend/src/routes/api/helpers/getDevWorkspaceClient.ts +++ b/packages/dashboard-backend/src/routes/api/helpers/getDevWorkspaceClient.ts @@ -10,8 +10,8 @@ * Red Hat, Inc. - initial API and implementation */ -import { DwClientProvider } from '../../../services/kubeclient/dwClientProvider'; -import { DevWorkspaceClient } from '../../../devworkspaceClient'; +import { DevWorkspaceClient } from '@/devworkspaceClient'; +import { DwClientProvider } from '@/services/kubeclient/dwClientProvider'; /** * Creates DevWorkspace Client depending on the context for the specified request. diff --git a/packages/dashboard-backend/src/routes/api/helpers/getServiceAccountToken.ts b/packages/dashboard-backend/src/routes/api/helpers/getServiceAccountToken.ts index 6471fb7180..1788c91c39 100644 --- a/packages/dashboard-backend/src/routes/api/helpers/getServiceAccountToken.ts +++ b/packages/dashboard-backend/src/routes/api/helpers/getServiceAccountToken.ts @@ -11,7 +11,8 @@ */ import { existsSync, readFileSync } from 'fs'; -import { isLocalRun } from '../../../localRun'; + +import { isLocalRun } from '@/localRun'; export const SERVICE_ACCOUNT_TOKEN_PATH = '/run/secrets/kubernetes.io/serviceaccount/token'; diff --git a/packages/dashboard-backend/src/routes/api/helpers/getToken.ts b/packages/dashboard-backend/src/routes/api/helpers/getToken.ts index d8c7fac644..59e8d76f47 100644 --- a/packages/dashboard-backend/src/routes/api/helpers/getToken.ts +++ b/packages/dashboard-backend/src/routes/api/helpers/getToken.ts @@ -11,7 +11,8 @@ */ import { FastifyRequest } from 'fastify'; -import { createFastifyError } from '../../../services/helpers'; + +import { createFastifyError } from '@/services/helpers'; const authorizationBearerPrefix = /^Bearer /; diff --git a/packages/dashboard-backend/src/routes/api/kubeConfig.ts b/packages/dashboard-backend/src/routes/api/kubeConfig.ts index e25940d2b1..0b846f7f6f 100644 --- a/packages/dashboard-backend/src/routes/api/kubeConfig.ts +++ b/packages/dashboard-backend/src/routes/api/kubeConfig.ts @@ -11,12 +11,13 @@ */ import { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify'; -import { baseApiPath } from '../../constants/config'; -import { getDevWorkspaceClient } from './helpers/getDevWorkspaceClient'; -import { getToken } from './helpers/getToken'; -import { getSchema } from '../../services/helpers'; -import { restParams } from '../../models'; -import { namespacedKubeConfigSchema } from '../../constants/schemas'; + +import { baseApiPath } from '@/constants/config'; +import { namespacedKubeConfigSchema } from '@/constants/schemas'; +import { restParams } from '@/models'; +import { getDevWorkspaceClient } from '@/routes/api/helpers/getDevWorkspaceClient'; +import { getToken } from '@/routes/api/helpers/getToken'; +import { getSchema } from '@/services/helpers'; const tags = ['Kube Config']; diff --git a/packages/dashboard-backend/src/routes/api/personalAccessToken.ts b/packages/dashboard-backend/src/routes/api/personalAccessToken.ts index a55edc0015..b2d0aac81b 100644 --- a/packages/dashboard-backend/src/routes/api/personalAccessToken.ts +++ b/packages/dashboard-backend/src/routes/api/personalAccessToken.ts @@ -12,16 +12,17 @@ import { api } from '@eclipse-che/common'; import { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify'; -import { baseApiPath } from '../../constants/config'; + +import { baseApiPath } from '@/constants/config'; import { namespacedSchema, personalAccessTokenBodySchema, personalAccessTokenParamsSchema, -} from '../../constants/schemas'; -import { restParams } from '../../models'; -import { getSchema } from '../../services/helpers'; -import { getDevWorkspaceClient } from './helpers/getDevWorkspaceClient'; -import { getToken } from './helpers/getToken'; +} from '@/constants/schemas'; +import { restParams } from '@/models'; +import { getDevWorkspaceClient } from '@/routes/api/helpers/getDevWorkspaceClient'; +import { getToken } from '@/routes/api/helpers/getToken'; +import { getSchema } from '@/services/helpers'; const tags = ['Personal Access Token']; diff --git a/packages/dashboard-backend/src/routes/api/podmanLogin.ts b/packages/dashboard-backend/src/routes/api/podmanLogin.ts index c8a468ddb0..6f044bf1ee 100644 --- a/packages/dashboard-backend/src/routes/api/podmanLogin.ts +++ b/packages/dashboard-backend/src/routes/api/podmanLogin.ts @@ -11,12 +11,13 @@ */ import { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify'; -import { baseApiPath } from '../../constants/config'; -import { getDevWorkspaceClient } from './helpers/getDevWorkspaceClient'; -import { getToken } from './helpers/getToken'; -import { getSchema } from '../../services/helpers'; -import { restParams } from '../../models'; -import { namespacedKubeConfigSchema } from '../../constants/schemas'; + +import { baseApiPath } from '@/constants/config'; +import { namespacedKubeConfigSchema } from '@/constants/schemas'; +import { restParams } from '@/models'; +import { getDevWorkspaceClient } from '@/routes/api/helpers/getDevWorkspaceClient'; +import { getToken } from '@/routes/api/helpers/getToken'; +import { getSchema } from '@/services/helpers'; const tags = ['Podman Login']; diff --git a/packages/dashboard-backend/src/routes/api/pods.ts b/packages/dashboard-backend/src/routes/api/pods.ts index 2fa1635bd3..fb35382d3d 100644 --- a/packages/dashboard-backend/src/routes/api/pods.ts +++ b/packages/dashboard-backend/src/routes/api/pods.ts @@ -11,12 +11,13 @@ */ import { FastifyInstance, FastifyRequest } from 'fastify'; -import { baseApiPath } from '../../constants/config'; -import { namespacedSchema } from '../../constants/schemas'; -import { restParams } from '../../models'; -import { getSchema } from '../../services/helpers'; -import { getDevWorkspaceClient } from './helpers/getDevWorkspaceClient'; -import { getToken } from './helpers/getToken'; + +import { baseApiPath } from '@/constants/config'; +import { namespacedSchema } from '@/constants/schemas'; +import { restParams } from '@/models'; +import { getDevWorkspaceClient } from '@/routes/api/helpers/getDevWorkspaceClient'; +import { getToken } from '@/routes/api/helpers/getToken'; +import { getSchema } from '@/services/helpers'; const tags = ['Pod']; diff --git a/packages/dashboard-backend/src/routes/api/serverConfig.ts b/packages/dashboard-backend/src/routes/api/serverConfig.ts index 86ebf4dc45..05d76c835c 100644 --- a/packages/dashboard-backend/src/routes/api/serverConfig.ts +++ b/packages/dashboard-backend/src/routes/api/serverConfig.ts @@ -10,12 +10,13 @@ * Red Hat, Inc. - initial API and implementation */ -import { FastifyInstance } from 'fastify'; -import { baseApiPath } from '../../constants/config'; -import { getDevWorkspaceClient } from './helpers/getDevWorkspaceClient'; -import { getServiceAccountToken } from './helpers/getServiceAccountToken'; -import { getSchema } from '../../services/helpers'; import { api } from '@eclipse-che/common'; +import { FastifyInstance } from 'fastify'; + +import { baseApiPath } from '@/constants/config'; +import { getDevWorkspaceClient } from '@/routes/api/helpers/getDevWorkspaceClient'; +import { getServiceAccountToken } from '@/routes/api/helpers/getServiceAccountToken'; +import { getSchema } from '@/services/helpers'; const tags = ['Server Config']; diff --git a/packages/dashboard-backend/src/routes/api/userProfile.ts b/packages/dashboard-backend/src/routes/api/userProfile.ts index 1fff987be2..713c463fe9 100644 --- a/packages/dashboard-backend/src/routes/api/userProfile.ts +++ b/packages/dashboard-backend/src/routes/api/userProfile.ts @@ -11,12 +11,13 @@ */ import { FastifyInstance, FastifyRequest } from 'fastify'; -import { baseApiPath } from '../../constants/config'; -import { namespacedSchema } from '../../constants/schemas'; -import { getSchema } from '../../services/helpers'; -import { restParams } from '../../models'; -import { getDevWorkspaceClient } from './helpers/getDevWorkspaceClient'; -import { getToken } from './helpers/getToken'; + +import { baseApiPath } from '@/constants/config'; +import { namespacedSchema } from '@/constants/schemas'; +import { restParams } from '@/models'; +import { getDevWorkspaceClient } from '@/routes/api/helpers/getDevWorkspaceClient'; +import { getToken } from '@/routes/api/helpers/getToken'; +import { getSchema } from '@/services/helpers'; const tags = ['UserProfile']; diff --git a/packages/dashboard-backend/src/routes/api/websocket.ts b/packages/dashboard-backend/src/routes/api/websocket.ts index ca9d656b8c..cf987e87a0 100644 --- a/packages/dashboard-backend/src/routes/api/websocket.ts +++ b/packages/dashboard-backend/src/routes/api/websocket.ts @@ -14,11 +14,12 @@ import { api } from '@eclipse-che/common'; import { SocketStream } from '@fastify/websocket'; import { FastifyInstance, FastifyRequest } from 'fastify'; import WebSocket from 'ws'; -import { baseApiPath } from '../../constants/config'; -import { ObjectsWatcher } from '../../services/ObjectsWatcher'; -import { SubscriptionManager } from '../../services/SubscriptionManager'; -import { getDevWorkspaceClient } from './helpers/getDevWorkspaceClient'; -import { getToken } from './helpers/getToken'; + +import { baseApiPath } from '@/constants/config'; +import { getDevWorkspaceClient } from '@/routes/api/helpers/getDevWorkspaceClient'; +import { getToken } from '@/routes/api/helpers/getToken'; +import { ObjectsWatcher } from '@/services/ObjectsWatcher'; +import { SubscriptionManager } from '@/services/SubscriptionManager'; export function registerWebsocket(instance: FastifyInstance) { instance.register(async server => { diff --git a/packages/dashboard-backend/src/routes/api/yamlResolver.ts b/packages/dashboard-backend/src/routes/api/yamlResolver.ts index d0587aa4bb..5f24683d88 100644 --- a/packages/dashboard-backend/src/routes/api/yamlResolver.ts +++ b/packages/dashboard-backend/src/routes/api/yamlResolver.ts @@ -10,15 +10,16 @@ * Red Hat, Inc. - initial API and implementation */ +import { helpers } from '@eclipse-che/common'; import { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify'; import fetch from 'node-fetch'; -import { baseApiPath } from '../../constants/config'; -import { yamlResolverSchema, namespacedSchema } from '../../constants/schemas'; -import { getDevWorkspaceClient } from './helpers/getDevWorkspaceClient'; -import { getToken } from './helpers/getToken'; -import { restParams } from '../../models'; -import { getSchema } from '../../services/helpers'; -import { helpers } from '@eclipse-che/common'; + +import { baseApiPath } from '@/constants/config'; +import { namespacedSchema, yamlResolverSchema } from '@/constants/schemas'; +import { restParams } from '@/models'; +import { getDevWorkspaceClient } from '@/routes/api/helpers/getDevWorkspaceClient'; +import { getToken } from '@/routes/api/helpers/getToken'; +import { getSchema } from '@/services/helpers'; const tags = ['Yaml Resolver']; diff --git a/packages/dashboard-backend/src/routes/factoryAcceptanceRedirect.ts b/packages/dashboard-backend/src/routes/factoryAcceptanceRedirect.ts index bcfc255d7a..226739ee04 100644 --- a/packages/dashboard-backend/src/routes/factoryAcceptanceRedirect.ts +++ b/packages/dashboard-backend/src/routes/factoryAcceptanceRedirect.ts @@ -10,8 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { ERROR_CODE_ATTR, FACTORY_LINK_ATTR } from '@eclipse-che/common'; -import { sanitizeSearchParams } from '@eclipse-che/common/src/helpers/sanitize'; +import { ERROR_CODE_ATTR, FACTORY_LINK_ATTR, helpers } from '@eclipse-che/common'; import { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify'; import querystring from 'querystring'; @@ -33,7 +32,7 @@ export function registerFactoryAcceptanceRedirect(instance: FastifyInstance): vo params.append(ERROR_CODE_ATTR, querystring.unescape(query[ERROR_CODE_ATTR] as string)); } - const sanitizedQueryParams = sanitizeSearchParams(params); + const sanitizedQueryParams = helpers.sanitizeSearchParams(params); return reply.redirect('/dashboard/#/load-factory?' + sanitizedQueryParams.toString()); }); diff --git a/packages/dashboard-backend/src/server.ts b/packages/dashboard-backend/src/server.ts index b819fcd151..ea6e42ab1d 100644 --- a/packages/dashboard-backend/src/server.ts +++ b/packages/dashboard-backend/src/server.ts @@ -10,10 +10,12 @@ * Red Hat, Inc. - initial API and implementation */ -import fastify from 'fastify'; import 'reflect-metadata'; -import buildApp from './app'; -import { isLocalRun } from './localRun'; + +import fastify from 'fastify'; + +import buildApp from '@/app'; +import { isLocalRun } from '@/localRun'; const server = fastify({ logger: false, diff --git a/packages/dashboard-backend/src/services/ObjectsWatcher.ts b/packages/dashboard-backend/src/services/ObjectsWatcher.ts index 9b6a439cca..499cc7ae0e 100644 --- a/packages/dashboard-backend/src/services/ObjectsWatcher.ts +++ b/packages/dashboard-backend/src/services/ObjectsWatcher.ts @@ -11,8 +11,9 @@ */ import { api } from '@eclipse-che/common'; -import { IWatcherService } from '../devworkspaceClient'; -import { NotificationMessage, Observer, SubjectWatcher } from './types/Observer'; + +import { IWatcherService } from '@/devworkspaceClient'; +import { NotificationMessage, Observer, SubjectWatcher } from '@/services/types/Observer'; /** * This class implements the Observer pattern. It allows to manage subscribers and notify them. diff --git a/packages/dashboard-backend/src/services/SubscriptionManager.ts b/packages/dashboard-backend/src/services/SubscriptionManager.ts index 194bb8cefc..f548bf37c6 100644 --- a/packages/dashboard-backend/src/services/SubscriptionManager.ts +++ b/packages/dashboard-backend/src/services/SubscriptionManager.ts @@ -12,7 +12,8 @@ import { api } from '@eclipse-che/common'; import WebSocket from 'ws'; -import { NotificationMessage, Observer } from './types/Observer'; + +import { NotificationMessage, Observer } from '@/services/types/Observer'; /** * This class implements the Observer pattern. It reacts to the changes in the subject and sends messages to subscribers over WebSocket. diff --git a/packages/dashboard-backend/src/services/helpers.ts b/packages/dashboard-backend/src/services/helpers.ts index 482072c93b..f3d10e034a 100644 --- a/packages/dashboard-backend/src/services/helpers.ts +++ b/packages/dashboard-backend/src/services/helpers.ts @@ -10,11 +10,12 @@ * Red Hat, Inc. - initial API and implementation */ -import { authenticationHeaderSchema } from '../constants/schemas'; -import { restParams } from '../models'; import createError from '@fastify/error'; import { FastifyError } from 'fastify'; +import { authenticationHeaderSchema } from '@/constants/schemas'; +import { restParams } from '@/models'; + export async function delay(ms = 500): Promise { await new Promise(resolve => { setTimeout(resolve, ms); diff --git a/packages/dashboard-backend/src/services/kubeclient/__tests__/dwClientProvider.spec.ts b/packages/dashboard-backend/src/services/kubeclient/__tests__/dwClientProvider.spec.ts index 1de1018fa9..14c63193bf 100644 --- a/packages/dashboard-backend/src/services/kubeclient/__tests__/dwClientProvider.spec.ts +++ b/packages/dashboard-backend/src/services/kubeclient/__tests__/dwClientProvider.spec.ts @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { DwClientProvider } from '../dwClientProvider'; +import { DwClientProvider } from '@/services/kubeclient/dwClientProvider'; jest.mock('../../../devworkspaceClient'); jest.mock('../kubeConfigProvider.ts'); diff --git a/packages/dashboard-backend/src/services/kubeclient/__tests__/kubeConfigProvider.spec.ts b/packages/dashboard-backend/src/services/kubeclient/__tests__/kubeConfigProvider.spec.ts index a6dc84bc65..3a2343c0b3 100644 --- a/packages/dashboard-backend/src/services/kubeclient/__tests__/kubeConfigProvider.spec.ts +++ b/packages/dashboard-backend/src/services/kubeclient/__tests__/kubeConfigProvider.spec.ts @@ -10,9 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ -import { KubeConfigProvider } from '../kubeConfigProvider'; import * as mockClient from '@kubernetes/client-node'; +import { KubeConfigProvider } from '@/services/kubeclient/kubeConfigProvider'; + describe('K8s Configuration Provider', () => { const env = process.env; diff --git a/packages/dashboard-backend/src/services/kubeclient/dwClientProvider.ts b/packages/dashboard-backend/src/services/kubeclient/dwClientProvider.ts index 7ce027f747..c903b1c8b6 100644 --- a/packages/dashboard-backend/src/services/kubeclient/dwClientProvider.ts +++ b/packages/dashboard-backend/src/services/kubeclient/dwClientProvider.ts @@ -10,8 +10,8 @@ * Red Hat, Inc. - initial API and implementation */ -import { DevWorkspaceClient } from '../../devworkspaceClient'; -import { KubeConfigProvider } from './kubeConfigProvider'; +import { DevWorkspaceClient } from '@/devworkspaceClient'; +import { KubeConfigProvider } from '@/services/kubeclient/kubeConfigProvider'; export class DwClientProvider { private kubeconfigProvider: KubeConfigProvider; diff --git a/packages/dashboard-backend/src/services/kubeclient/helpers/index.ts b/packages/dashboard-backend/src/services/kubeclient/helpers/index.ts index 394cb71021..6102d04dd8 100644 --- a/packages/dashboard-backend/src/services/kubeclient/helpers/index.ts +++ b/packages/dashboard-backend/src/services/kubeclient/helpers/index.ts @@ -12,7 +12,8 @@ import { helpers } from '@eclipse-che/common'; import * as k8s from '@kubernetes/client-node'; -import { findApi } from '../../../helpers/findApi'; + +import { findApi } from '@/helpers/findApi'; const projectApiGroup = 'project.openshift.io'; diff --git a/packages/dashboard-backend/src/services/kubeclient/kubeConfigProvider.ts b/packages/dashboard-backend/src/services/kubeclient/kubeConfigProvider.ts index bb5b111679..384440d812 100644 --- a/packages/dashboard-backend/src/services/kubeclient/kubeConfigProvider.ts +++ b/packages/dashboard-backend/src/services/kubeclient/kubeConfigProvider.ts @@ -11,8 +11,9 @@ */ import { Context, KubeConfig, User } from '@kubernetes/client-node'; -import { getUserName } from '../../helpers/getUserName'; -import { isLocalRun } from '../../localRun'; + +import { getUserName } from '@/helpers/getUserName'; +import { isLocalRun } from '@/localRun'; export class KubeConfigProvider { private inClusterKubeConfig: KubeConfig | undefined; diff --git a/packages/dashboard-backend/tsconfig.json b/packages/dashboard-backend/tsconfig.json index 066f44f399..40be11ec45 100644 --- a/packages/dashboard-backend/tsconfig.json +++ b/packages/dashboard-backend/tsconfig.json @@ -2,10 +2,16 @@ "extends": "../../tsconfig.json", "compilerOptions": { "target": "ES2021", - "lib": ["ES2021"], - "module": "commonjs", + "lib": [ + "ES2021" + ], + "module": "esnext", + "baseUrl": "./", + "moduleResolution": "node", "paths": { - "@eclipse-che/common": ["../common/src"] + "@/*": [ + "./src/*", + ], }, "resolveJsonModule": true, "outDir": "lib", @@ -15,8 +21,8 @@ "node_modules", "lib", ], - "include": ["src", "src/devfileSchemas/**/*.json"], - "references": [ - { "path": "../common" }, - ] -} + "include": [ + "src", + "src/devfileSchemas/**/*.json" + ], +} \ No newline at end of file diff --git a/packages/dashboard-backend/webpack.config.common.js b/packages/dashboard-backend/webpack.config.common.js index 5d2f4872d6..991c7cd345 100644 --- a/packages/dashboard-backend/webpack.config.common.js +++ b/packages/dashboard-backend/webpack.config.common.js @@ -28,10 +28,7 @@ module.exports = () => { enforce: 'pre', test: /\.(ts|js)$/, use: ['source-map-loader'], - include: [ - path.resolve(__dirname, '../common'), - path.resolve(__dirname, 'src'), - ], + include: [path.resolve(__dirname, '../common'), path.resolve(__dirname, 'src')], }, { test: /\.ts$/, @@ -40,10 +37,14 @@ module.exports = () => { transpileOnly: true, }, }, - ] + ], }, resolve: { extensions: ['.ts', '.js'], + alias: { + // alias for absolute imports (see tsconfig.json) + '@': path.resolve(__dirname, 'src/'), + }, }, resolveLoader: {}, plugins: [ @@ -51,10 +52,17 @@ module.exports = () => { new CopyPlugin({ patterns: [ { - from: path.resolve('..', '..', 'node_modules', '@fastify/swagger-ui', 'static', 'logo.svg'), + from: path.resolve( + '..', + '..', + 'node_modules', + '@fastify/swagger-ui', + 'static', + 'logo.svg', + ), to: 'server/static', - } - ] + }, + ], }), new CopyPlugin({ patterns: [ @@ -68,18 +76,14 @@ module.exports = () => { } return content.toString(); }, - } - ] + }, + ], }), ], node: { __dirname: false, }, target: 'node', - externals: [ - 'long', - 'pino-pretty', - ], + externals: ['long', 'pino-pretty'], }; - }; diff --git a/packages/dashboard-frontend/.eslintrc.js b/packages/dashboard-frontend/.eslintrc.js index 43626d3128..7cda47a5b8 100644 --- a/packages/dashboard-frontend/.eslintrc.js +++ b/packages/dashboard-frontend/.eslintrc.js @@ -13,20 +13,23 @@ module.exports = { env: { browser: true, - es2020: true + es2020: true, }, - extends: [ - 'plugin:react-hooks/recommended', - 'plugin:react/recommended', - '../../.eslintrc.js', - ], + extends: ['plugin:react-hooks/recommended', 'plugin:react/recommended', '../../.eslintrc.js'], parserOptions: { ecmaFeatures: { - jsx: true + jsx: true, }, + sourceType: 'module', + }, + env: { + es6: true, }, plugins: [ + 'import', + 'no-relative-import-paths', 'react', + 'simple-import-sort', ], rules: { 'notice/notice': [ @@ -39,6 +42,16 @@ module.exports = { }, }, ], + 'simple-import-sort/imports': 'error', + 'simple-import-sort/exports': 'error', + "import/first": "error", + "import/newline-after-import": "error", + "import/no-duplicates": "error", + + "no-relative-import-paths/no-relative-import-paths": [ + "error", + { "allowSameFolder": false, 'prefix': '@', 'rootDir': 'src' } + ] }, settings: { react: { diff --git a/packages/dashboard-frontend/.vscode/settings.json b/packages/dashboard-frontend/.vscode/settings.json index b6f2703bc2..85ac96f7d8 100644 --- a/packages/dashboard-frontend/.vscode/settings.json +++ b/packages/dashboard-frontend/.vscode/settings.json @@ -5,4 +5,6 @@ "**/coverage": true }, "jest.jestCommandLine": "yarn test", + "javascript.preferences.importModuleSpecifier": "non-relative", + "typescript.preferences.importModuleSpecifier": "non-relative", } diff --git a/packages/dashboard-frontend/jest.config.js b/packages/dashboard-frontend/jest.config.js index 5df44f6c5d..5bc63d0651 100644 --- a/packages/dashboard-frontend/jest.config.js +++ b/packages/dashboard-frontend/jest.config.js @@ -23,6 +23,9 @@ module.exports = { 'vscode-languageserver-protocol/lib/utils/is': 'vscode-languageserver-protocol/lib/common/utils/is', 'vscode-languageserver-protocol/lib/main': 'vscode-languageserver-protocol/lib/node/main', + + // mapping for absolute imports (see tsconfig.json) + '^@/(.*)$': '/src/$1', }, modulePathIgnorePatterns: [ '__mocks__/index.tsx', diff --git a/packages/dashboard-frontend/package.json b/packages/dashboard-frontend/package.json index 1828556f68..728ac82fc5 100644 --- a/packages/dashboard-frontend/package.json +++ b/packages/dashboard-frontend/package.json @@ -104,10 +104,13 @@ "css-minimizer-webpack-plugin": "^5.0.1", "eslint": "^8.47.0", "eslint-config-prettier": "^9.0.0", + "eslint-plugin-import": "^2.28.1", + "eslint-plugin-no-relative-import-paths": "^1.5.2", "eslint-plugin-notice": "^0.9.10", "eslint-plugin-prettier": "^5.0.0", "eslint-plugin-react": "^7.33.1", "eslint-plugin-react-hooks": "^4.2.0", + "eslint-plugin-simple-import-sort": "^10.0.0", "eslint-webpack-plugin": "^4.0.1", "file-loader": "^6.2.0", "hard-source-webpack-plugin": "^0.13.1", diff --git a/packages/dashboard-frontend/src/App.tsx b/packages/dashboard-frontend/src/App.tsx index 2e5a3fccf1..cb16b00b30 100644 --- a/packages/dashboard-frontend/src/App.tsx +++ b/packages/dashboard-frontend/src/App.tsx @@ -10,16 +10,17 @@ * Red Hat, Inc. - initial API and implementation */ +import '@/app.css'; + import { ConnectedRouter } from 'connected-react-router'; import { History } from 'history'; import React, { Suspense } from 'react'; -import AppAlertGroup from './components/AppAlertGroup'; -import Fallback from './components/Fallback'; -import Head from './components/Head'; -import Layout from './Layout'; -import Routes from './Routes'; -import './app.css'; +import AppAlertGroup from '@/components/AppAlertGroup'; +import Fallback from '@/components/Fallback'; +import Head from '@/components/Head'; +import Layout from '@/Layout'; +import Routes from '@/Routes'; function AppComponent(props: { history: History }): React.ReactElement { return ( diff --git a/packages/dashboard-frontend/src/Layout/ErrorBoundary/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/Layout/ErrorBoundary/__tests__/index.spec.tsx index 3adad8e11d..5b51377ac8 100644 --- a/packages/dashboard-frontend/src/Layout/ErrorBoundary/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/Layout/ErrorBoundary/__tests__/index.spec.tsx @@ -10,11 +10,12 @@ * Red Hat, Inc. - initial API and implementation */ +import { render, screen } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; import React from 'react'; import renderer from 'react-test-renderer'; -import { render, screen } from '@testing-library/react'; + import { ErrorBoundary, STORAGE_KEY_RELOAD_NUMBER } from '..'; -import userEvent from '@testing-library/user-event'; class GoodComponent extends React.Component { render() { diff --git a/packages/dashboard-frontend/src/Layout/ErrorBoundary/index.tsx b/packages/dashboard-frontend/src/Layout/ErrorBoundary/index.tsx index c56c270da8..4e276ce921 100644 --- a/packages/dashboard-frontend/src/Layout/ErrorBoundary/index.tsx +++ b/packages/dashboard-frontend/src/Layout/ErrorBoundary/index.tsx @@ -10,7 +10,6 @@ * Red Hat, Inc. - initial API and implementation */ -import React, { ErrorInfo, PropsWithChildren } from 'react'; import { Alert, AlertActionLink, @@ -21,8 +20,10 @@ import { TextContent, TextVariants, } from '@patternfly/react-core'; +import React, { ErrorInfo, PropsWithChildren } from 'react'; import Pluralize from 'react-pluralize'; -import { DisposableCollection } from '../../services/helpers/disposable'; + +import { DisposableCollection } from '@/services/helpers/disposable'; export const STORAGE_KEY_RELOAD_NUMBER = 'UD:ErrorBoundary:reloaded'; const RELOAD_TIMEOUT_SEC = 30; diff --git a/packages/dashboard-frontend/src/Layout/ErrorReporter/Issue/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/Layout/ErrorReporter/Issue/__tests__/index.spec.tsx index ee08c03391..2305a52b86 100644 --- a/packages/dashboard-frontend/src/Layout/ErrorReporter/Issue/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/Layout/ErrorReporter/Issue/__tests__/index.spec.tsx @@ -12,9 +12,11 @@ import React from 'react'; import renderer from 'react-test-renderer'; + +import { BrandingData } from '@/services/bootstrap/branding.constant'; +import { Issue } from '@/services/bootstrap/issuesReporter'; + import { IssueComponent } from '..'; -import { BrandingData } from '../../../../services/bootstrap/branding.constant'; -import { Issue } from '../../../../services/bootstrap/issuesReporter'; const brandingData = { name: 'Product Name', diff --git a/packages/dashboard-frontend/src/Layout/ErrorReporter/Issue/index.tsx b/packages/dashboard-frontend/src/Layout/ErrorReporter/Issue/index.tsx index 944d52bf24..a2de2dcf5d 100644 --- a/packages/dashboard-frontend/src/Layout/ErrorReporter/Issue/index.tsx +++ b/packages/dashboard-frontend/src/Layout/ErrorReporter/Issue/index.tsx @@ -10,14 +10,14 @@ * Red Hat, Inc. - initial API and implementation */ -import { TextContent, Text, TextVariants, Button, ButtonVariant } from '@patternfly/react-core'; +import { Button, ButtonVariant, Text, TextContent, TextVariants } from '@patternfly/react-core'; import { InfoIcon, WarningTriangleIcon } from '@patternfly/react-icons'; import React from 'react'; -import { BrandingData } from '../../../services/bootstrap/branding.constant'; -import { Issue, WorkspaceData } from '../../../services/bootstrap/issuesReporter'; -import { signIn } from '../../../services/helpers/login'; -import styles from './index.module.css'; +import styles from '@/Layout/ErrorReporter/Issue/index.module.css'; +import { BrandingData } from '@/services/bootstrap/branding.constant'; +import { Issue, WorkspaceData } from '@/services/bootstrap/issuesReporter'; +import { signIn } from '@/services/helpers/login'; type Props = { branding: BrandingData; diff --git a/packages/dashboard-frontend/src/Layout/ErrorReporter/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/Layout/ErrorReporter/__tests__/index.spec.tsx index 3f88f4c133..71f3fee107 100644 --- a/packages/dashboard-frontend/src/Layout/ErrorReporter/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/Layout/ErrorReporter/__tests__/index.spec.tsx @@ -10,13 +10,15 @@ * Red Hat, Inc. - initial API and implementation */ +import { render, screen } from '@testing-library/react'; import React from 'react'; import renderer from 'react-test-renderer'; -import { render, screen } from '@testing-library/react'; + +import { IssueComponent } from '@/Layout/ErrorReporter/Issue'; +import { BrandingData } from '@/services/bootstrap/branding.constant'; +import { Issue } from '@/services/bootstrap/issuesReporter'; + import { ErrorReporter } from '..'; -import { BrandingData } from '../../../services/bootstrap/branding.constant'; -import { Issue } from '../../../services/bootstrap/issuesReporter'; -import { IssueComponent } from '../Issue'; const brandingData = { name: 'Product Name', diff --git a/packages/dashboard-frontend/src/Layout/ErrorReporter/index.tsx b/packages/dashboard-frontend/src/Layout/ErrorReporter/index.tsx index d9b4f12e8a..2f10e66a17 100644 --- a/packages/dashboard-frontend/src/Layout/ErrorReporter/index.tsx +++ b/packages/dashboard-frontend/src/Layout/ErrorReporter/index.tsx @@ -10,10 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { Bullseye, Page, PageSection, Stack, StackItem } from '@patternfly/react-core'; +import React from 'react'; -import styles from './index.module.css'; +import styles from '@/Layout/ErrorReporter/index.module.css'; type Props = { children?: React.ReactElement; diff --git a/packages/dashboard-frontend/src/Layout/Header/Tools/AboutMenu/Modal.tsx b/packages/dashboard-frontend/src/Layout/Header/Tools/AboutMenu/Modal.tsx index c8194e8a1b..d05d459e53 100644 --- a/packages/dashboard-frontend/src/Layout/Header/Tools/AboutMenu/Modal.tsx +++ b/packages/dashboard-frontend/src/Layout/Header/Tools/AboutMenu/Modal.tsx @@ -10,7 +10,6 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { AboutModal as PatternflyAboutModal, TextContent, @@ -18,6 +17,7 @@ import { TextListItem, } from '@patternfly/react-core'; import { detect } from 'detect-browser'; +import React from 'react'; type Props = { productName: string | undefined; diff --git a/packages/dashboard-frontend/src/Layout/Header/Tools/AboutMenu/__tests__/Modal.spec.tsx b/packages/dashboard-frontend/src/Layout/Header/Tools/AboutMenu/__tests__/Modal.spec.tsx index 62bfac09c4..7b2df61d18 100644 --- a/packages/dashboard-frontend/src/Layout/Header/Tools/AboutMenu/__tests__/Modal.spec.tsx +++ b/packages/dashboard-frontend/src/Layout/Header/Tools/AboutMenu/__tests__/Modal.spec.tsx @@ -10,9 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { render, screen } from '@testing-library/react'; -import { AboutModal } from '../Modal'; +import React from 'react'; + +import { AboutModal } from '@/Layout/Header/Tools/AboutMenu/Modal'; jest.mock('detect-browser/index.js', () => { return { diff --git a/packages/dashboard-frontend/src/Layout/Header/Tools/AboutMenu/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/Layout/Header/Tools/AboutMenu/__tests__/index.spec.tsx index ad1f3f6d42..b81a6ef9dc 100644 --- a/packages/dashboard-frontend/src/Layout/Header/Tools/AboutMenu/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/Layout/Header/Tools/AboutMenu/__tests__/index.spec.tsx @@ -15,15 +15,14 @@ import React from 'react'; import { Provider } from 'react-redux'; import renderer from 'react-test-renderer'; import { Action, Store } from 'redux'; + +import { BRANDING_DEFAULT, BrandingData } from '@/services/bootstrap/branding.constant'; +import { AppThunk } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { selectBranding } from '@/store/Branding/selectors'; +import * as InfrastructureNamespacesStore from '@/store/InfrastructureNamespaces'; + import { AboutMenu } from '..'; -import { - BrandingData, - BRANDING_DEFAULT, -} from '../../../../../services/bootstrap/branding.constant'; -import { AppThunk } from '../../../../../store'; -import { selectBranding } from '../../../../../store/Branding/selectors'; -import * as InfrastructureNamespacesStore from '../../../../../store/InfrastructureNamespaces'; -import { FakeStoreBuilder } from '../../../../../store/__mocks__/storeBuilder'; jest.mock('gravatar-url', () => { return function () { diff --git a/packages/dashboard-frontend/src/Layout/Header/Tools/AboutMenu/index.tsx b/packages/dashboard-frontend/src/Layout/Header/Tools/AboutMenu/index.tsx index e3872fb525..73a768cbac 100644 --- a/packages/dashboard-frontend/src/Layout/Header/Tools/AboutMenu/index.tsx +++ b/packages/dashboard-frontend/src/Layout/Header/Tools/AboutMenu/index.tsx @@ -10,15 +10,16 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { ApplicationLauncher, ApplicationLauncherGroup, ApplicationLauncherItem, } from '@patternfly/react-core'; import { QuestionCircleIcon } from '@patternfly/react-icons'; -import { AboutModal } from './Modal'; -import { BrandingData } from '../../../../services/bootstrap/branding.constant'; +import React from 'react'; + +import { AboutModal } from '@/Layout/Header/Tools/AboutMenu/Modal'; +import { BrandingData } from '@/services/bootstrap/branding.constant'; type Props = { branding: BrandingData; diff --git a/packages/dashboard-frontend/src/Layout/Header/Tools/ApplicationsMenu/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/Layout/Header/Tools/ApplicationsMenu/__tests__/index.spec.tsx index 0216547b83..5491a4c29f 100644 --- a/packages/dashboard-frontend/src/Layout/Header/Tools/ApplicationsMenu/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/Layout/Header/Tools/ApplicationsMenu/__tests__/index.spec.tsx @@ -10,14 +10,16 @@ * Red Hat, Inc. - initial API and implementation */ +import { fireEvent, render, screen } from '@testing-library/react'; import React from 'react'; import { Provider } from 'react-redux'; import renderer from 'react-test-renderer'; -import { fireEvent, render, screen } from '@testing-library/react'; import { Store } from 'redux'; + +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { selectApplications } from '@/store/ClusterInfo/selectors'; + import { ApplicationsMenu } from '..'; -import { FakeStoreBuilder } from '../../../../../store/__mocks__/storeBuilder'; -import { selectApplications } from '../../../../../store/ClusterInfo/selectors'; describe('About Menu', () => { global.open = jest.fn(); diff --git a/packages/dashboard-frontend/src/Layout/Header/Tools/ApplicationsMenu/index.tsx b/packages/dashboard-frontend/src/Layout/Header/Tools/ApplicationsMenu/index.tsx index 1d6f5e451a..ede891ef04 100644 --- a/packages/dashboard-frontend/src/Layout/Header/Tools/ApplicationsMenu/index.tsx +++ b/packages/dashboard-frontend/src/Layout/Header/Tools/ApplicationsMenu/index.tsx @@ -10,13 +10,13 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; +import { ApplicationInfo } from '@eclipse-che/common'; import { ApplicationLauncher, ApplicationLauncherGroup, ApplicationLauncherItem, } from '@patternfly/react-core'; -import { ApplicationInfo } from '@eclipse-che/common'; +import React from 'react'; type Props = { applications: ApplicationInfo[]; diff --git a/packages/dashboard-frontend/src/Layout/Header/Tools/UserMenu/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/Layout/Header/Tools/UserMenu/__tests__/index.spec.tsx index 7e9446907b..17e736ef8b 100644 --- a/packages/dashboard-frontend/src/Layout/Header/Tools/UserMenu/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/Layout/Header/Tools/UserMenu/__tests__/index.spec.tsx @@ -16,15 +16,14 @@ import React from 'react'; import { Provider } from 'react-redux'; import renderer from 'react-test-renderer'; import { Action, Store } from 'redux'; + +import { BRANDING_DEFAULT, BrandingData } from '@/services/bootstrap/branding.constant'; +import { AppThunk } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { selectBranding } from '@/store/Branding/selectors'; +import * as InfrastructureNamespacesStore from '@/store/InfrastructureNamespaces'; + import UserMenu from '..'; -import { - BrandingData, - BRANDING_DEFAULT, -} from '../../../../../services/bootstrap/branding.constant'; -import { AppThunk } from '../../../../../store'; -import { selectBranding } from '../../../../../store/Branding/selectors'; -import * as InfrastructureNamespacesStore from '../../../../../store/InfrastructureNamespaces'; -import { FakeStoreBuilder } from '../../../../../store/__mocks__/storeBuilder'; jest.mock('../../../../../store/InfrastructureNamespaces', () => { return { diff --git a/packages/dashboard-frontend/src/Layout/Header/Tools/UserMenu/index.tsx b/packages/dashboard-frontend/src/Layout/Header/Tools/UserMenu/index.tsx index b891cbe5a4..0193a728f8 100644 --- a/packages/dashboard-frontend/src/Layout/Header/Tools/UserMenu/index.tsx +++ b/packages/dashboard-frontend/src/Layout/Header/Tools/UserMenu/index.tsx @@ -10,15 +10,16 @@ * Red Hat, Inc. - initial API and implementation */ +import { Dropdown, DropdownItem, DropdownPosition, DropdownToggle } from '@patternfly/react-core'; import { History } from 'history'; import React from 'react'; -import { Dropdown, DropdownItem, DropdownPosition, DropdownToggle } from '@patternfly/react-core'; import { connect, ConnectedProps } from 'react-redux'; -import { ROUTE } from '../../../../Routes/routes'; -import { lazyInject } from '../../../../inversify.config'; -import { AppAlerts } from '../../../../services/alerts/appAlerts'; -import * as InfrastructureNamespacesStore from '../../../../store/InfrastructureNamespaces'; -import { BrandingData } from '../../../../services/bootstrap/branding.constant'; + +import { lazyInject } from '@/inversify.config'; +import { ROUTE } from '@/Routes/routes'; +import { AppAlerts } from '@/services/alerts/appAlerts'; +import { BrandingData } from '@/services/bootstrap/branding.constant'; +import * as InfrastructureNamespacesStore from '@/store/InfrastructureNamespaces'; type Props = MappedProps & { branding: BrandingData; diff --git a/packages/dashboard-frontend/src/Layout/Header/Tools/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/Layout/Header/Tools/__tests__/index.spec.tsx index 577e2a5284..dcc63d3bb8 100644 --- a/packages/dashboard-frontend/src/Layout/Header/Tools/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/Layout/Header/Tools/__tests__/index.spec.tsx @@ -15,11 +15,13 @@ import React from 'react'; import { Provider } from 'react-redux'; import renderer from 'react-test-renderer'; import { Action, Store } from 'redux'; + +import { BRANDING_DEFAULT, BrandingData } from '@/services/bootstrap/branding.constant'; +import { AppThunk } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import * as InfrastructureNamespacesStore from '@/store/InfrastructureNamespaces'; + import HeaderTools from '..'; -import { AppThunk } from '../../../../store'; -import { FakeStoreBuilder } from '../../../../store/__mocks__/storeBuilder'; -import { BrandingData, BRANDING_DEFAULT } from '../../../../services/bootstrap/branding.constant'; -import * as InfrastructureNamespacesStore from '../../../../store/InfrastructureNamespaces'; jest.mock('gravatar-url', () => { return function () { diff --git a/packages/dashboard-frontend/src/Layout/Header/Tools/index.tsx b/packages/dashboard-frontend/src/Layout/Header/Tools/index.tsx index 658f4b3790..d07509fc51 100644 --- a/packages/dashboard-frontend/src/Layout/Header/Tools/index.tsx +++ b/packages/dashboard-frontend/src/Layout/Header/Tools/index.tsx @@ -10,24 +10,25 @@ * Red Hat, Inc. - initial API and implementation */ -import { History } from 'history'; -import React from 'react'; -import gravatarUrl from 'gravatar-url'; import { Avatar, PageHeaderTools, PageHeaderToolsGroup, PageHeaderToolsItem, } from '@patternfly/react-core'; +import gravatarUrl from 'gravatar-url'; +import { History } from 'history'; +import React from 'react'; import { connect, ConnectedProps } from 'react-redux'; -import { AppState } from '../../../store'; -import { selectBranding } from '../../../store/Branding/selectors'; -import { selectUserProfile } from '../../../store/User/Profile/selectors'; -import { AboutMenu } from './AboutMenu'; -import UserMenu from './UserMenu'; -import { ApplicationsMenu } from './ApplicationsMenu'; -import { selectApplications } from '../../../store/ClusterInfo/selectors'; -import { selectDashboardLogo } from '../../../store/ServerConfig/selectors'; + +import { AboutMenu } from '@/Layout/Header/Tools/AboutMenu'; +import { ApplicationsMenu } from '@/Layout/Header/Tools/ApplicationsMenu'; +import UserMenu from '@/Layout/Header/Tools/UserMenu'; +import { AppState } from '@/store'; +import { selectBranding } from '@/store/Branding/selectors'; +import { selectApplications } from '@/store/ClusterInfo/selectors'; +import { selectDashboardLogo } from '@/store/ServerConfig/selectors'; +import { selectUserProfile } from '@/store/User/Profile/selectors'; type Props = MappedProps & { history: History; diff --git a/packages/dashboard-frontend/src/Layout/Header/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/Layout/Header/__tests__/index.spec.tsx index da6258b305..c4f490b8d1 100644 --- a/packages/dashboard-frontend/src/Layout/Header/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/Layout/Header/__tests__/index.spec.tsx @@ -10,12 +10,13 @@ * Red Hat, Inc. - initial API and implementation */ +import { Brand } from '@patternfly/react-core'; +import { fireEvent, render, screen } from '@testing-library/react'; import { createHashHistory } from 'history'; import React from 'react'; import renderer from 'react-test-renderer'; -import { fireEvent, render, screen } from '@testing-library/react'; + import Header from '..'; -import { Brand } from '@patternfly/react-core'; jest.mock('../Tools', () => { const FakeTools = (props: { logout: () => void; changeTheme: () => void }) => ( diff --git a/packages/dashboard-frontend/src/Layout/Header/index.tsx b/packages/dashboard-frontend/src/Layout/Header/index.tsx index 81de9bb636..9ddfef4572 100644 --- a/packages/dashboard-frontend/src/Layout/Header/index.tsx +++ b/packages/dashboard-frontend/src/Layout/Header/index.tsx @@ -13,7 +13,8 @@ import { PageHeader } from '@patternfly/react-core'; import { History } from 'history'; import React from 'react'; -import HeaderTools from './Tools'; + +import HeaderTools from '@/Layout/Header/Tools'; type Props = { history: History; diff --git a/packages/dashboard-frontend/src/Layout/Navigation/MainItem.tsx b/packages/dashboard-frontend/src/Layout/Navigation/MainItem.tsx index f6a55fe7f9..c7b45348c5 100644 --- a/packages/dashboard-frontend/src/Layout/Navigation/MainItem.tsx +++ b/packages/dashboard-frontend/src/Layout/Navigation/MainItem.tsx @@ -10,14 +10,14 @@ * Red Hat, Inc. - initial API and implementation */ +import { NavItem } from '@patternfly/react-core'; import React from 'react'; import { Link } from 'react-router-dom'; -import { NavItem } from '@patternfly/react-core'; -import { NavigationItemObject } from '.'; -import isActive from './isActive'; +import styles from '@/Layout/Navigation/index.module.css'; +import isActive from '@/Layout/Navigation/isActive'; -import styles from './index.module.css'; +import { NavigationItemObject } from '.'; function NavigationMainItem(props: { item: NavigationItemObject; diff --git a/packages/dashboard-frontend/src/Layout/Navigation/MainList.tsx b/packages/dashboard-frontend/src/Layout/Navigation/MainList.tsx index f59a559052..4d610f250e 100644 --- a/packages/dashboard-frontend/src/Layout/Navigation/MainList.tsx +++ b/packages/dashboard-frontend/src/Layout/Navigation/MainList.tsx @@ -10,14 +10,16 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { NavList } from '@patternfly/react-core'; -import NavigationMainItem from './MainItem'; -import { NavigationItemObject } from '.'; -import { ROUTE } from '../../Routes/routes'; -import { AppState } from '../../store'; +import React from 'react'; import { connect, ConnectedProps } from 'react-redux'; -import { selectAllWorkspaces } from '../../store/Workspaces/selectors'; + +import NavigationMainItem from '@/Layout/Navigation/MainItem'; +import { ROUTE } from '@/Routes/routes'; +import { AppState } from '@/store'; +import { selectAllWorkspaces } from '@/store/Workspaces/selectors'; + +import { NavigationItemObject } from '.'; type Props = MappedProps & { activePath: string; diff --git a/packages/dashboard-frontend/src/Layout/Navigation/RecentItem.tsx b/packages/dashboard-frontend/src/Layout/Navigation/RecentItem.tsx index 9c804e01b3..0808d4e7cf 100644 --- a/packages/dashboard-frontend/src/Layout/Navigation/RecentItem.tsx +++ b/packages/dashboard-frontend/src/Layout/Navigation/RecentItem.tsx @@ -10,14 +10,16 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { NavItem } from '@patternfly/react-core'; -import { NavigationRecentItemObject } from '.'; -import getActivity from './isActive'; -import WorkspaceIndicator from '../../components/Workspace/Indicator'; import { History } from 'history'; -import styles from './index.module.css'; -import NavigationItemWorkspaceActions from './RecentItemWorkspaceActions'; +import React from 'react'; + +import WorkspaceIndicator from '@/components/Workspace/Indicator'; +import styles from '@/Layout/Navigation/index.module.css'; +import getActivity from '@/Layout/Navigation/isActive'; +import NavigationItemWorkspaceActions from '@/Layout/Navigation/RecentItemWorkspaceActions'; + +import { NavigationRecentItemObject } from '.'; function NavigationRecentItem(props: { item: NavigationRecentItemObject; diff --git a/packages/dashboard-frontend/src/Layout/Navigation/RecentItemWorkspaceActions.tsx b/packages/dashboard-frontend/src/Layout/Navigation/RecentItemWorkspaceActions.tsx index 48ebcf8815..2c4ff44f8d 100644 --- a/packages/dashboard-frontend/src/Layout/Navigation/RecentItemWorkspaceActions.tsx +++ b/packages/dashboard-frontend/src/Layout/Navigation/RecentItemWorkspaceActions.tsx @@ -10,16 +10,18 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { AlertVariant, Dropdown, DropdownItem, KebabToggle } from '@patternfly/react-core'; -import { NavigationRecentItemObject } from '.'; -import WorkspaceActionsProvider from '../../contexts/WorkspaceActions/Provider'; -import { ActionContextType, WorkspaceActionsConsumer } from '../../contexts/WorkspaceActions'; -import { DevWorkspaceStatus, WorkspaceAction, WorkspaceStatus } from '../../services/helpers/types'; -import getRandomString from '../../services/helpers/random'; -import { lazyInject } from '../../inversify.config'; -import { AppAlerts } from '../../services/alerts/appAlerts'; import { History } from 'history'; +import React from 'react'; + +import { ActionContextType, WorkspaceActionsConsumer } from '@/contexts/WorkspaceActions'; +import WorkspaceActionsProvider from '@/contexts/WorkspaceActions/Provider'; +import { lazyInject } from '@/inversify.config'; +import { AppAlerts } from '@/services/alerts/appAlerts'; +import getRandomString from '@/services/helpers/random'; +import { DevWorkspaceStatus, WorkspaceAction, WorkspaceStatus } from '@/services/helpers/types'; + +import { NavigationRecentItemObject } from '.'; type Props = { item: NavigationRecentItemObject; diff --git a/packages/dashboard-frontend/src/Layout/Navigation/RecentList.tsx b/packages/dashboard-frontend/src/Layout/Navigation/RecentList.tsx index 91cf32f17b..a02b08e1b3 100644 --- a/packages/dashboard-frontend/src/Layout/Navigation/RecentList.tsx +++ b/packages/dashboard-frontend/src/Layout/Navigation/RecentList.tsx @@ -10,14 +10,15 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { NavGroup, NavList } from '@patternfly/react-core'; +import { History } from 'history'; +import React from 'react'; + +import NavigationRecentItem from '@/Layout/Navigation/RecentItem'; +import { ROUTE } from '@/Routes/routes'; +import { Workspace } from '@/services/workspace-adapter'; -import NavigationRecentItem from './RecentItem'; import { NavigationRecentItemObject } from '.'; -import { ROUTE } from '../../Routes/routes'; -import { Workspace } from '../../services/workspace-adapter'; -import { History } from 'history'; function buildRecentWorkspacesItems( workspaces: Array, diff --git a/packages/dashboard-frontend/src/Layout/Navigation/__tests__/MainItem.spec.tsx b/packages/dashboard-frontend/src/Layout/Navigation/__tests__/MainItem.spec.tsx index e1e414a4b8..f9e5ad0ec6 100644 --- a/packages/dashboard-frontend/src/Layout/Navigation/__tests__/MainItem.spec.tsx +++ b/packages/dashboard-frontend/src/Layout/Navigation/__tests__/MainItem.spec.tsx @@ -10,16 +10,17 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; -import { render, screen, RenderResult } from '@testing-library/react'; import { HomeIcon } from '@patternfly/react-icons'; +import { render, RenderResult, screen } from '@testing-library/react'; +import React from 'react'; +import { Provider } from 'react-redux'; import { MemoryRouter } from 'react-router'; -import NavigationMainItem from '../MainItem'; +import NavigationMainItem from '@/Layout/Navigation/MainItem'; +import devfileApi from '@/services/devfileApi'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; + import { NavigationItemObject } from '..'; -import { FakeStoreBuilder } from '../../../store/__mocks__/storeBuilder'; -import { Provider } from 'react-redux'; -import devfileApi from '../../../services/devfileApi'; describe('Navigation Item', () => { let activeItem = ''; diff --git a/packages/dashboard-frontend/src/Layout/Navigation/__tests__/MainList.spec.tsx b/packages/dashboard-frontend/src/Layout/Navigation/__tests__/MainList.spec.tsx index 9392714255..f21f0be311 100644 --- a/packages/dashboard-frontend/src/Layout/Navigation/__tests__/MainList.spec.tsx +++ b/packages/dashboard-frontend/src/Layout/Navigation/__tests__/MainList.spec.tsx @@ -10,16 +10,17 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; -import { render, RenderResult, screen } from '@testing-library/react'; -import { MemoryRouter } from 'react-router'; import { Nav } from '@patternfly/react-core'; -import NavigationMainList from '../MainList'; -import { FakeStoreBuilder } from '../../../store/__mocks__/storeBuilder'; +import { render, RenderResult, screen } from '@testing-library/react'; +import React from 'react'; import { Provider } from 'react-redux'; -import { DevWorkspaceBuilder } from '../../../store/__mocks__/devWorkspaceBuilder'; +import { MemoryRouter } from 'react-router'; import { Store } from 'redux'; +import NavigationMainList from '@/Layout/Navigation/MainList'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; + describe('Navigation Main List', () => { it('should have correct number of main navigation items', () => { const store = new FakeStoreBuilder().build(); diff --git a/packages/dashboard-frontend/src/Layout/Navigation/__tests__/RecentItem.spec.tsx b/packages/dashboard-frontend/src/Layout/Navigation/__tests__/RecentItem.spec.tsx index f58ea01c4b..d0b6825604 100644 --- a/packages/dashboard-frontend/src/Layout/Navigation/__tests__/RecentItem.spec.tsx +++ b/packages/dashboard-frontend/src/Layout/Navigation/__tests__/RecentItem.spec.tsx @@ -10,17 +10,18 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { render, screen } from '@testing-library/react'; -import { MemoryRouter } from 'react-router'; - -import NavigationRecentItem from '../RecentItem'; -import { NavigationRecentItemObject } from '..'; import { createHashHistory } from 'history'; +import React from 'react'; import { Provider } from 'react-redux'; +import { MemoryRouter } from 'react-router'; import renderer from 'react-test-renderer'; -import { WorkspaceStatus } from '../../../services/helpers/types'; -import { FakeStoreBuilder } from '../../../store/__mocks__/storeBuilder'; + +import NavigationRecentItem from '@/Layout/Navigation/RecentItem'; +import { WorkspaceStatus } from '@/services/helpers/types'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; + +import { NavigationRecentItemObject } from '..'; jest.mock('../../../components/Workspace/Indicator', () => { return function DummyWorkspaceIndicator(): React.ReactElement { diff --git a/packages/dashboard-frontend/src/Layout/Navigation/__tests__/RecentList.spec.tsx b/packages/dashboard-frontend/src/Layout/Navigation/__tests__/RecentList.spec.tsx index 0f52ad5ed0..bc2a9ce96b 100644 --- a/packages/dashboard-frontend/src/Layout/Navigation/__tests__/RecentList.spec.tsx +++ b/packages/dashboard-frontend/src/Layout/Navigation/__tests__/RecentList.spec.tsx @@ -10,18 +10,19 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; -import { MemoryRouter } from 'react-router'; import { Nav } from '@patternfly/react-core'; +import { render, RenderResult, screen } from '@testing-library/react'; +import { createHashHistory } from 'history'; +import React from 'react'; import { Provider } from 'react-redux'; -import { RenderResult, render, screen } from '@testing-library/react'; +import { MemoryRouter } from 'react-router'; import { Store } from 'redux'; -import devfileApi from '../../../services/devfileApi'; -import NavigationRecentList from '../RecentList'; -import { constructWorkspace, Workspace } from '../../../services/workspace-adapter'; -import { FakeStoreBuilder } from '../../../store/__mocks__/storeBuilder'; -import { createHashHistory } from 'history'; -import { DevWorkspaceBuilder } from '../../../store/__mocks__/devWorkspaceBuilder'; + +import NavigationRecentList from '@/Layout/Navigation/RecentList'; +import devfileApi from '@/services/devfileApi'; +import { constructWorkspace, Workspace } from '@/services/workspace-adapter'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; jest.mock('react-tooltip', () => { return function DummyTooltip(): React.ReactElement { diff --git a/packages/dashboard-frontend/src/Layout/Navigation/__tests__/isActive.spec.ts b/packages/dashboard-frontend/src/Layout/Navigation/__tests__/isActive.spec.ts index f84b8e1658..3dc375c518 100644 --- a/packages/dashboard-frontend/src/Layout/Navigation/__tests__/isActive.spec.ts +++ b/packages/dashboard-frontend/src/Layout/Navigation/__tests__/isActive.spec.ts @@ -10,8 +10,8 @@ * Red Hat, Inc. - initial API and implementation */ -import { ROUTE } from '../../../Routes/routes'; -import isActive from '../isActive'; +import isActive from '@/Layout/Navigation/isActive'; +import { ROUTE } from '@/Routes/routes'; describe('Active navigation item', () => { it('should match equal paths', () => { diff --git a/packages/dashboard-frontend/src/Layout/Navigation/index.tsx b/packages/dashboard-frontend/src/Layout/Navigation/index.tsx index 1e355732f6..900ce21a7a 100644 --- a/packages/dashboard-frontend/src/Layout/Navigation/index.tsx +++ b/packages/dashboard-frontend/src/Layout/Navigation/index.tsx @@ -10,26 +10,23 @@ * Red Hat, Inc. - initial API and implementation */ +import { Nav } from '@patternfly/react-core'; +import { History, Location, UnregisterCallback } from 'history'; import React from 'react'; import { connect, ConnectedProps } from 'react-redux'; -import { History, Location, UnregisterCallback } from 'history'; -import { Nav } from '@patternfly/react-core'; -import { AppState } from '../../store'; -import NavigationMainList from './MainList'; -import NavigationRecentList from './RecentList'; -import * as WorkspacesStore from '../../store/Workspaces'; -import { selectAllWorkspaces, selectRecentWorkspaces } from '../../store/Workspaces/selectors'; -import { ROUTE } from '../../Routes/routes'; -import { - buildGettingStartedLocation, - buildWorkspacesLocation, -} from '../../services/helpers/location'; +import NavigationMainList from '@/Layout/Navigation/MainList'; +import NavigationRecentList from '@/Layout/Navigation/RecentList'; +import { ROUTE } from '@/Routes/routes'; +import { buildGettingStartedLocation, buildWorkspacesLocation } from '@/services/helpers/location'; import { DeprecatedWorkspaceStatus, DevWorkspaceStatus, WorkspaceStatus, -} from '../../services/helpers/types'; +} from '@/services/helpers/types'; +import { AppState } from '@/store'; +import * as WorkspacesStore from '@/store/Workspaces'; +import { selectAllWorkspaces, selectRecentWorkspaces } from '@/store/Workspaces/selectors'; export interface NavigationItemObject { to: string; diff --git a/packages/dashboard-frontend/src/Layout/Navigation/isActive.ts b/packages/dashboard-frontend/src/Layout/Navigation/isActive.ts index e8b16c044a..44e4840dce 100644 --- a/packages/dashboard-frontend/src/Layout/Navigation/isActive.ts +++ b/packages/dashboard-frontend/src/Layout/Navigation/isActive.ts @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { ROUTE } from '../../Routes/routes'; +import { ROUTE } from '@/Routes/routes'; export default function isActive(itemPath: string, activePath: string | undefined): boolean { if (itemPath === activePath) { diff --git a/packages/dashboard-frontend/src/Layout/Sidebar.tsx b/packages/dashboard-frontend/src/Layout/Sidebar.tsx index 8121ad9b29..93db22e07c 100644 --- a/packages/dashboard-frontend/src/Layout/Sidebar.tsx +++ b/packages/dashboard-frontend/src/Layout/Sidebar.tsx @@ -10,11 +10,11 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { PageSidebar } from '@patternfly/react-core'; import { History } from 'history'; +import React from 'react'; -import Navigation from './Navigation'; +import Navigation from '@/Layout/Navigation'; type Props = { isManaged: boolean; diff --git a/packages/dashboard-frontend/src/Layout/StoreErrorsAlert/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/Layout/StoreErrorsAlert/__tests__/index.spec.tsx index 66362fb808..595daed114 100644 --- a/packages/dashboard-frontend/src/Layout/StoreErrorsAlert/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/Layout/StoreErrorsAlert/__tests__/index.spec.tsx @@ -10,14 +10,16 @@ * Red Hat, Inc. - initial API and implementation */ +import { render, RenderResult, screen } from '@testing-library/react'; import React from 'react'; -import { Store } from 'redux'; import { Provider } from 'react-redux'; -import { render, RenderResult, screen } from '@testing-library/react'; +import { Store } from 'redux'; + +import AppAlertGroup from '@/components/AppAlertGroup'; +import { container } from '@/inversify.config'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; + import StoreErrorsAlert from '..'; -import { FakeStoreBuilder } from '../../../store/__mocks__/storeBuilder'; -import AppAlertGroup from '../../../components/AppAlertGroup'; -import { container } from '../../../inversify.config'; describe('StoreErrorAlert component', () => { beforeEach(() => { diff --git a/packages/dashboard-frontend/src/Layout/StoreErrorsAlert/index.tsx b/packages/dashboard-frontend/src/Layout/StoreErrorsAlert/index.tsx index fc3b2fa343..ed812ad833 100644 --- a/packages/dashboard-frontend/src/Layout/StoreErrorsAlert/index.tsx +++ b/packages/dashboard-frontend/src/Layout/StoreErrorsAlert/index.tsx @@ -10,22 +10,23 @@ * Red Hat, Inc. - initial API and implementation */ +import { AlertVariant } from '@patternfly/react-core'; import React from 'react'; -import { ConnectedProps, connect } from 'react-redux'; -import { AppState } from '../../store'; +import { connect, ConnectedProps } from 'react-redux'; + +import { lazyInject } from '@/inversify.config'; +import { AppAlerts } from '@/services/alerts/appAlerts'; +import { AppState } from '@/store'; import { - selectRegistriesErrors, selectDevfileSchemaError, -} from '../../store/DevfileRegistries/selectors'; -import { selectPluginsError } from '../../store/Plugins/chePlugins/selectors'; -import { selectDwDefaultEditorError } from '../../store/Plugins/devWorkspacePlugins/selectors'; -import { selectInfrastructureNamespacesError } from '../../store/InfrastructureNamespaces/selectors'; -import { selectUserProfileError } from '../../store/User/Profile/selectors'; -import { selectWorkspacesError } from '../../store/Workspaces/selectors'; -import { selectSanityCheckError } from '../../store/SanityCheck/selectors'; -import { AlertVariant } from '@patternfly/react-core'; -import { lazyInject } from '../../inversify.config'; -import { AppAlerts } from '../../services/alerts/appAlerts'; + selectRegistriesErrors, +} from '@/store/DevfileRegistries/selectors'; +import { selectInfrastructureNamespacesError } from '@/store/InfrastructureNamespaces/selectors'; +import { selectPluginsError } from '@/store/Plugins/chePlugins/selectors'; +import { selectDwDefaultEditorError } from '@/store/Plugins/devWorkspacePlugins/selectors'; +import { selectSanityCheckError } from '@/store/SanityCheck/selectors'; +import { selectUserProfileError } from '@/store/User/Profile/selectors'; +import { selectWorkspacesError } from '@/store/Workspaces/selectors'; type Props = MappedProps; diff --git a/packages/dashboard-frontend/src/Layout/index.tsx b/packages/dashboard-frontend/src/Layout/index.tsx index ba31a3179e..a0649632de 100644 --- a/packages/dashboard-frontend/src/Layout/index.tsx +++ b/packages/dashboard-frontend/src/Layout/index.tsx @@ -10,26 +10,27 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; -import { connect, ConnectedProps } from 'react-redux'; import { Brand, Page } from '@patternfly/react-core'; import { History } from 'history'; +import React from 'react'; +import { connect, ConnectedProps } from 'react-redux'; import { matchPath } from 'react-router'; -import Header from './Header'; -import Sidebar from './Sidebar'; -import StoreErrorsAlert from './StoreErrorsAlert'; -import { AppState } from '../store'; -import { lazyInject } from '../inversify.config'; -import { IssuesReporterService } from '../services/bootstrap/issuesReporter'; -import { ErrorReporter } from './ErrorReporter'; -import { IssueComponent } from './ErrorReporter/Issue'; -import { BannerAlert } from '../components/BannerAlert'; -import { ErrorBoundary } from './ErrorBoundary'; -import { ROUTE } from '../Routes/routes'; -import { selectBranding } from '../store/Branding/selectors'; -import { ToggleBarsContext } from '../contexts/ToggleBars'; -import { signOut } from '../services/helpers/login'; -import { selectDashboardLogo } from '../store/ServerConfig/selectors'; + +import { BannerAlert } from '@/components/BannerAlert'; +import { ToggleBarsContext } from '@/contexts/ToggleBars'; +import { lazyInject } from '@/inversify.config'; +import { ErrorBoundary } from '@/Layout/ErrorBoundary'; +import { ErrorReporter } from '@/Layout/ErrorReporter'; +import { IssueComponent } from '@/Layout/ErrorReporter/Issue'; +import Header from '@/Layout/Header'; +import Sidebar from '@/Layout/Sidebar'; +import StoreErrorsAlert from '@/Layout/StoreErrorsAlert'; +import { ROUTE } from '@/Routes/routes'; +import { IssuesReporterService } from '@/services/bootstrap/issuesReporter'; +import { signOut } from '@/services/helpers/login'; +import { AppState } from '@/store'; +import { selectBranding } from '@/store/Branding/selectors'; +import { selectDashboardLogo } from '@/store/ServerConfig/selectors'; const IS_MANAGED_SIDEBAR = false; diff --git a/packages/dashboard-frontend/src/Routes/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/Routes/__tests__/index.spec.tsx index edaeb6e24b..c4fff6df04 100644 --- a/packages/dashboard-frontend/src/Routes/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/Routes/__tests__/index.spec.tsx @@ -10,24 +10,26 @@ * Red Hat, Inc. - initial API and implementation */ -import React, { Suspense } from 'react'; +import { render, screen, waitFor } from '@testing-library/react'; import { Location } from 'history'; +import React, { Suspense } from 'react'; import { Provider } from 'react-redux'; import { MemoryRouter } from 'react-router'; -import { render, screen, waitFor } from '@testing-library/react'; -import Routes from '..'; -import { FakeStoreBuilder } from '../../store/__mocks__/storeBuilder'; -import Fallback from '../../components/Fallback'; -import { ROUTE } from '../routes'; + +import Fallback from '@/components/Fallback'; +import { ROUTE } from '@/Routes/routes'; import { buildDetailsLocation, buildGettingStartedLocation, buildIdeLoaderLocation, buildWorkspacesLocation, -} from '../../services/helpers/location'; -import { LoaderTab, WorkspaceDetailsTab } from '../../services/helpers/types'; -import { constructWorkspace, Workspace } from '../../services/workspace-adapter'; -import { DevWorkspaceBuilder } from '../../store/__mocks__/devWorkspaceBuilder'; +} from '@/services/helpers/location'; +import { LoaderTab, WorkspaceDetailsTab } from '@/services/helpers/types'; +import { constructWorkspace, Workspace } from '@/services/workspace-adapter'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; + +import Routes from '..'; jest.mock('../../pages/GetStarted', () => { return function GetStarted() { diff --git a/packages/dashboard-frontend/src/Routes/index.tsx b/packages/dashboard-frontend/src/Routes/index.tsx index e91ec0e244..b1dcbf2bfc 100644 --- a/packages/dashboard-frontend/src/Routes/index.tsx +++ b/packages/dashboard-frontend/src/Routes/index.tsx @@ -12,8 +12,9 @@ import React from 'react'; import { Redirect, Route, RouteComponentProps, Switch } from 'react-router'; -import { buildFactoryLoaderPath } from '../preload/main'; -import { ROUTE } from './routes'; + +import { buildFactoryLoaderPath } from '@/preload/main'; +import { ROUTE } from '@/Routes/routes'; const CreateWorkspace = React.lazy(() => import('../pages/GetStarted')); const WorkspacesListContainer = React.lazy(() => import('../containers/WorkspacesList')); diff --git a/packages/dashboard-frontend/src/__tests__/const.ts b/packages/dashboard-frontend/src/__tests__/const.ts index 3f6082d089..21a5887b7c 100644 --- a/packages/dashboard-frontend/src/__tests__/const.ts +++ b/packages/dashboard-frontend/src/__tests__/const.ts @@ -10,11 +10,12 @@ * Red Hat, Inc. - initial API and implementation */ -import { FactoryResolver } from '../services/helpers/types'; -import devfileApi from '../services/devfileApi'; -import normalizeDevfileV2 from '../store/FactoryResolver/normalizeDevfileV2'; import { dump } from 'js-yaml'; +import devfileApi from '@/services/devfileApi'; +import { FactoryResolver } from '@/services/helpers/types'; +import normalizeDevfileV2 from '@/store/FactoryResolver/normalizeDevfileV2'; + export const FACTORY_RESOLVER_DELAY = 600; export const DEVWORKSPACE_RESOURSES_DELAY = 600; export const CREATE_DEVWORKSPACE_DELAY = 200; diff --git a/packages/dashboard-frontend/src/__tests__/workspaceCreationTimeCheck.check.tsx b/packages/dashboard-frontend/src/__tests__/workspaceCreationTimeCheck.check.tsx index cd3c2e0379..37ed3d6ab4 100644 --- a/packages/dashboard-frontend/src/__tests__/workspaceCreationTimeCheck.check.tsx +++ b/packages/dashboard-frontend/src/__tests__/workspaceCreationTimeCheck.check.tsx @@ -21,28 +21,29 @@ import { MemoryRouter } from 'react-router'; import { AnyAction } from 'redux'; import { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; -import Routes from '../Routes'; -import Fallback from '../components/Fallback'; -import devfileApi from '../services/devfileApi'; -import { AppState } from '../store'; -import { ConvertedState } from '../store/FactoryResolver'; -import { FakeStoreBuilder } from '../store/__mocks__/storeBuilder'; + import { - CREATE_DEVWORKSPACETEMPLATE_DELAY, CREATE_DEVWORKSPACE_DELAY, - DEVWORKSPACE_RESOURSES_DELAY, - FACTORY_RESOLVER_DELAY, - PATCH_DEVWORKSPACE_DELAY, - TIME_LIMIT, + CREATE_DEVWORKSPACETEMPLATE_DELAY, devfileV2, + DEVWORKSPACE_RESOURSES_DELAY, devworkspaceResources, + FACTORY_RESOLVER_DELAY, factoryResolver, namespace, + PATCH_DEVWORKSPACE_DELAY, plugins, targetDevWorkspace, targetDevWorkspaceTemplate, + TIME_LIMIT, url, -} from './const'; +} from '@/__tests__/const'; +import Fallback from '@/components/Fallback'; +import Routes from '@/Routes'; +import devfileApi from '@/services/devfileApi'; +import { AppState } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { ConvertedState } from '@/store/FactoryResolver'; // mute the outputs console.error = jest.fn(); diff --git a/packages/dashboard-frontend/src/components/AppAlertGroup/__tests__/AppAlertGroup.spec.tsx b/packages/dashboard-frontend/src/components/AppAlertGroup/__tests__/AppAlertGroup.spec.tsx index 7be54514ad..27f2997a99 100644 --- a/packages/dashboard-frontend/src/components/AppAlertGroup/__tests__/AppAlertGroup.spec.tsx +++ b/packages/dashboard-frontend/src/components/AppAlertGroup/__tests__/AppAlertGroup.spec.tsx @@ -11,11 +11,13 @@ */ import { AlertVariant } from '@patternfly/react-core'; -import React from 'react'; import { fireEvent, render, RenderResult, screen } from '@testing-library/react'; +import React from 'react'; + +import { container } from '@/inversify.config'; +import { AppAlerts } from '@/services/alerts/appAlerts'; + import AppAlertGroup from '..'; -import { container } from '../../../inversify.config'; -import { AppAlerts } from '../../../services/alerts/appAlerts'; const appAlerts = container.get(AppAlerts); diff --git a/packages/dashboard-frontend/src/components/AppAlertGroup/index.tsx b/packages/dashboard-frontend/src/components/AppAlertGroup/index.tsx index 054a84fe8f..cccbf983b6 100644 --- a/packages/dashboard-frontend/src/components/AppAlertGroup/index.tsx +++ b/packages/dashboard-frontend/src/components/AppAlertGroup/index.tsx @@ -12,9 +12,10 @@ import { Alert, AlertActionCloseButton, AlertGroup, AlertVariant } from '@patternfly/react-core'; import React from 'react'; -import { lazyInject } from '../../inversify.config'; -import { AppAlerts } from '../../services/alerts/appAlerts'; -import { AlertItem } from '../../services/helpers/types'; + +import { lazyInject } from '@/inversify.config'; +import { AppAlerts } from '@/services/alerts/appAlerts'; +import { AlertItem } from '@/services/helpers/types'; type Props = unknown; diff --git a/packages/dashboard-frontend/src/components/BannerAlert/Branding/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/BannerAlert/Branding/__tests__/index.spec.tsx index 8f52adac73..d5db20b7c4 100644 --- a/packages/dashboard-frontend/src/components/BannerAlert/Branding/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/BannerAlert/Branding/__tests__/index.spec.tsx @@ -10,14 +10,16 @@ * Red Hat, Inc. - initial API and implementation */ +import { render, RenderResult } from '@testing-library/react'; import React from 'react'; -import BannerAlertBranding from '..'; import { Provider } from 'react-redux'; -import { FakeStoreBuilder } from '../../../../store/__mocks__/storeBuilder'; -import { BrandingData } from '../../../../services/bootstrap/branding.constant'; -import { render, RenderResult } from '@testing-library/react'; import { Store } from 'redux'; +import { BrandingData } from '@/services/bootstrap/branding.constant'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; + +import BannerAlertBranding from '..'; + const scheduledMaintenance = 'Scheduled maintenance.'; describe('BannerAlertBranding component', () => { diff --git a/packages/dashboard-frontend/src/components/BannerAlert/Branding/index.tsx b/packages/dashboard-frontend/src/components/BannerAlert/Branding/index.tsx index 0216e0f045..e65e6aad71 100644 --- a/packages/dashboard-frontend/src/components/BannerAlert/Branding/index.tsx +++ b/packages/dashboard-frontend/src/components/BannerAlert/Branding/index.tsx @@ -14,8 +14,9 @@ import { Banner } from '@patternfly/react-core'; import React from 'react'; import { connect, ConnectedProps } from 'react-redux'; import sanitizeHtml from 'sanitize-html'; -import { AppState } from '../../../store'; -import { selectBranding } from '../../../store/Branding/selectors'; + +import { AppState } from '@/store'; +import { selectBranding } from '@/store/Branding/selectors'; type Props = MappedProps; diff --git a/packages/dashboard-frontend/src/components/BannerAlert/Custom/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/BannerAlert/Custom/__tests__/index.spec.tsx index 89ca97de35..55920d397d 100644 --- a/packages/dashboard-frontend/src/components/BannerAlert/Custom/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/BannerAlert/Custom/__tests__/index.spec.tsx @@ -10,13 +10,15 @@ * Red Hat, Inc. - initial API and implementation */ +import { render, RenderResult, screen } from '@testing-library/react'; import React from 'react'; -import BannerAlertCustomWarning from '..'; import { Provider } from 'react-redux'; -import { FakeStoreBuilder } from '../../../../store/__mocks__/storeBuilder'; -import { render, screen, RenderResult } from '@testing-library/react'; import { Store } from 'redux'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; + +import BannerAlertCustomWarning from '..'; + const issueWarning = 'Something happened.'; describe('BannerAlertCustomWarning component', () => { diff --git a/packages/dashboard-frontend/src/components/BannerAlert/Custom/index.tsx b/packages/dashboard-frontend/src/components/BannerAlert/Custom/index.tsx index d9401a975e..b8e2ba6f19 100644 --- a/packages/dashboard-frontend/src/components/BannerAlert/Custom/index.tsx +++ b/packages/dashboard-frontend/src/components/BannerAlert/Custom/index.tsx @@ -14,10 +14,10 @@ import { Banner } from '@patternfly/react-core'; import React from 'react'; import { connect, ConnectedProps } from 'react-redux'; import sanitizeHtml from 'sanitize-html'; -import { AppState } from '../../../store'; -import { selectBannerAlertMessages } from '../../../store/BannerAlert/selectors'; -import styles from './index.module.css'; +import styles from '@/components/BannerAlert/Custom/index.module.css'; +import { AppState } from '@/store'; +import { selectBannerAlertMessages } from '@/store/BannerAlert/selectors'; type Props = MappedProps; diff --git a/packages/dashboard-frontend/src/components/BannerAlert/NotSupportedBrowser/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/BannerAlert/NotSupportedBrowser/__tests__/index.spec.tsx index 618741cc97..a9c3e6b733 100644 --- a/packages/dashboard-frontend/src/components/BannerAlert/NotSupportedBrowser/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/BannerAlert/NotSupportedBrowser/__tests__/index.spec.tsx @@ -10,8 +10,9 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { render, screen } from '@testing-library/react'; +import React from 'react'; + import BannerAlertNotSupportedBrowser from '..'; const mockIsSupportedBrowser = jest.fn(); diff --git a/packages/dashboard-frontend/src/components/BannerAlert/NotSupportedBrowser/index.tsx b/packages/dashboard-frontend/src/components/BannerAlert/NotSupportedBrowser/index.tsx index 3aa8877148..adead48f53 100644 --- a/packages/dashboard-frontend/src/components/BannerAlert/NotSupportedBrowser/index.tsx +++ b/packages/dashboard-frontend/src/components/BannerAlert/NotSupportedBrowser/index.tsx @@ -12,7 +12,8 @@ import { Banner } from '@patternfly/react-core'; import React from 'react'; -import { isSupportedBrowser } from './isSupportedBrowser'; + +import { isSupportedBrowser } from '@/components/BannerAlert/NotSupportedBrowser/isSupportedBrowser'; type Props = unknown; diff --git a/packages/dashboard-frontend/src/components/BannerAlert/WebSocket/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/BannerAlert/WebSocket/__tests__/index.spec.tsx index c64b8e7840..da42caee25 100644 --- a/packages/dashboard-frontend/src/components/BannerAlert/WebSocket/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/BannerAlert/WebSocket/__tests__/index.spec.tsx @@ -13,14 +13,16 @@ import { render, RenderResult } from '@testing-library/react'; import React from 'react'; import { Provider } from 'react-redux'; -import BannerAlertWebSocket from '..'; -import { container } from '../../../../inversify.config'; -import { BrandingData } from '../../../../services/bootstrap/branding.constant'; + +import { container } from '@/inversify.config'; +import { BrandingData } from '@/services/bootstrap/branding.constant'; import { ConnectionEvent, WebsocketClient, -} from '../../../../services/dashboard-backend-client/websocketClient'; -import { FakeStoreBuilder } from '../../../../store/__mocks__/storeBuilder'; +} from '@/services/dashboard-backend-client/websocketClient'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; + +import BannerAlertWebSocket from '..'; const failingMessage = 'WebSocket connections are failing'; diff --git a/packages/dashboard-frontend/src/components/BannerAlert/WebSocket/index.tsx b/packages/dashboard-frontend/src/components/BannerAlert/WebSocket/index.tsx index dccfb4ae8a..0134804f81 100644 --- a/packages/dashboard-frontend/src/components/BannerAlert/WebSocket/index.tsx +++ b/packages/dashboard-frontend/src/components/BannerAlert/WebSocket/index.tsx @@ -13,14 +13,15 @@ import { Banner } from '@patternfly/react-core'; import React from 'react'; import { connect, ConnectedProps } from 'react-redux'; -import { container } from '../../../inversify.config'; -import { AppState } from '../../../store'; -import { selectBranding } from '../../../store/Branding/selectors'; + +import { container } from '@/inversify.config'; import { ConnectionEvent, ConnectionListener, WebsocketClient, -} from '../../../services/dashboard-backend-client/websocketClient'; +} from '@/services/dashboard-backend-client/websocketClient'; +import { AppState } from '@/store'; +import { selectBranding } from '@/store/Branding/selectors'; type Props = MappedProps; diff --git a/packages/dashboard-frontend/src/components/BannerAlert/index.tsx b/packages/dashboard-frontend/src/components/BannerAlert/index.tsx index 10f5162945..61e19d5e24 100644 --- a/packages/dashboard-frontend/src/components/BannerAlert/index.tsx +++ b/packages/dashboard-frontend/src/components/BannerAlert/index.tsx @@ -11,9 +11,10 @@ */ import React from 'react'; -import BannerAlertBranding from './Branding'; -import BannerAlertWebSocket from './WebSocket'; -import BannerAlertCustomWarning from './Custom'; + +import BannerAlertBranding from '@/components/BannerAlert/Branding'; +import BannerAlertCustomWarning from '@/components/BannerAlert/Custom'; +import BannerAlertWebSocket from '@/components/BannerAlert/WebSocket'; type Props = unknown; diff --git a/packages/dashboard-frontend/src/components/DevfileEditor/__mocks__/index.tsx b/packages/dashboard-frontend/src/components/DevfileEditor/__mocks__/index.tsx index d9414bd2a7..ad6b06baf8 100644 --- a/packages/dashboard-frontend/src/components/DevfileEditor/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/components/DevfileEditor/__mocks__/index.tsx @@ -10,10 +10,11 @@ * Red Hat, Inc. - initial API and implementation */ -import React, { ChangeEvent, ClipboardEvent } from 'react'; import { dump } from 'js-yaml'; -import devfileApi from '../../../services/devfileApi'; -import stringify from '../../../services/helpers/editor'; +import React, { ChangeEvent, ClipboardEvent } from 'react'; + +import devfileApi from '@/services/devfileApi'; +import stringify from '@/services/helpers/editor'; type Props = { devfile: che.WorkspaceDevfile | devfileApi.Devfile; diff --git a/packages/dashboard-frontend/src/components/DevfileEditor/__tests__/DevfileEditor.spec.tsx b/packages/dashboard-frontend/src/components/DevfileEditor/__tests__/DevfileEditor.spec.tsx index 1c49e37faa..703fca9bcb 100644 --- a/packages/dashboard-frontend/src/components/DevfileEditor/__tests__/DevfileEditor.spec.tsx +++ b/packages/dashboard-frontend/src/components/DevfileEditor/__tests__/DevfileEditor.spec.tsx @@ -11,13 +11,15 @@ */ import React from 'react'; -import renderer, { ReactTestRenderer } from 'react-test-renderer'; import { Provider } from 'react-redux'; +import renderer, { ReactTestRenderer } from 'react-test-renderer'; + +import { BrandingData } from '@/services/bootstrap/branding.constant'; +import { devWorkspaceToDevfile } from '@/services/workspace-client/devworkspace/converters'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; + import DevfileEditor from '..'; -import { BrandingData } from '../../../services/bootstrap/branding.constant'; -import { FakeStoreBuilder } from '../../../store/__mocks__/storeBuilder'; -import { DevWorkspaceBuilder } from '../../../store/__mocks__/devWorkspaceBuilder'; -import { devWorkspaceToDevfile } from '../../../services/workspace-client/devworkspace/converters'; jest.mock('monaco-editor-core', () => { return { diff --git a/packages/dashboard-frontend/src/components/DevfileEditor/index.tsx b/packages/dashboard-frontend/src/components/DevfileEditor/index.tsx index 154c4b3f61..9829c98123 100644 --- a/packages/dashboard-frontend/src/components/DevfileEditor/index.tsx +++ b/packages/dashboard-frontend/src/components/DevfileEditor/index.tsx @@ -10,29 +10,29 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; -import { connect, ConnectedProps } from 'react-redux'; -import { AppState } from '../../store'; -import { DisposableCollection } from '../../services/helpers/disposable'; +import { isMatch, merge } from 'lodash'; +import { editor, IRange, languages, Position, Range } from 'monaco-editor-core'; import { - ProtocolToMonacoConverter, MonacoToProtocolConverter, + ProtocolToMonacoConverter, } from 'monaco-languageclient/lib/monaco-converter'; -import { languages, editor, Range, Position, IRange } from 'monaco-editor-core'; +import React from 'react'; +import { connect, ConnectedProps } from 'react-redux'; import { - TextDocument, + CompletionItem, getLanguageService, LanguageService, - CompletionItem, + TextDocument, } from 'yaml-language-server'; -import { initDefaultEditorTheme } from '../../services/monacoThemeRegister'; -import stringify, { language, conf } from '../../services/helpers/editor'; -import { merge, isMatch } from 'lodash'; -import devfileApi from '../../services/devfileApi'; -import { selectDevfileSchema } from '../../store/DevfileRegistries/selectors'; -import { selectBranding } from '../../store/Branding/selectors'; -import styles from './index.module.css'; +import styles from '@/components/DevfileEditor/index.module.css'; +import devfileApi from '@/services/devfileApi'; +import { DisposableCollection } from '@/services/helpers/disposable'; +import stringify, { conf, language } from '@/services/helpers/editor'; +import { initDefaultEditorTheme } from '@/services/monacoThemeRegister'; +import { AppState } from '@/store'; +import { selectBranding } from '@/store/Branding/selectors'; +import { selectDevfileSchema } from '@/store/DevfileRegistries/selectors'; const LANGUAGE_ID = 'yaml'; const YAML_SERVICE = 'yamlService'; diff --git a/packages/dashboard-frontend/src/components/EditorTools/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/EditorTools/__tests__/index.spec.tsx index f1a66f51ee..d9e3e87d64 100644 --- a/packages/dashboard-frontend/src/components/EditorTools/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/EditorTools/__tests__/index.spec.tsx @@ -10,14 +10,16 @@ * Red Hat, Inc. - initial API and implementation */ +import { ApplicationId } from '@eclipse-che/common'; import React from 'react'; -import getComponentRenderer, { screen } from '../../../services/__mocks__/getComponentRenderer'; import { Provider } from 'react-redux'; -import EditorTools from '..'; import { Store } from 'redux'; -import { FakeStoreBuilder } from '../../../store/__mocks__/storeBuilder'; -import devfileApi from '../../../services/devfileApi'; -import { ApplicationId } from '@eclipse-che/common'; + +import getComponentRenderer, { screen } from '@/services/__mocks__/getComponentRenderer'; +import devfileApi from '@/services/devfileApi'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; + +import EditorTools from '..'; jest.mock('../../../contexts/ToggleBars'); diff --git a/packages/dashboard-frontend/src/components/EditorTools/index.tsx b/packages/dashboard-frontend/src/components/EditorTools/index.tsx index 488d3e26b1..500702a51b 100644 --- a/packages/dashboard-frontend/src/components/EditorTools/index.tsx +++ b/packages/dashboard-frontend/src/components/EditorTools/index.tsx @@ -21,18 +21,19 @@ import { } from '@patternfly/react-icons'; import React from 'react'; import CopyToClipboard from 'react-copy-to-clipboard'; -import { ConnectedProps, connect } from 'react-redux'; -import { ToggleBarsContext } from '../../contexts/ToggleBars'; -import { lazyInject } from '../../inversify.config'; -import { AppAlerts } from '../../services/alerts/appAlerts'; -import devfileApi, { isDevWorkspace, isDevfileV2 } from '../../services/devfileApi'; -import stringify from '../../services/helpers/editor'; -import { AlertItem } from '../../services/helpers/types'; -import { AppState } from '../../store'; -import { actionCreators } from '../../store/BannerAlert'; -import { selectApplications } from '../../store/ClusterInfo/selectors'; -import styles from './index.module.css'; -import { WorkspaceAdapter } from '../../services/workspace-adapter'; +import { connect, ConnectedProps } from 'react-redux'; + +import styles from '@/components/EditorTools/index.module.css'; +import { ToggleBarsContext } from '@/contexts/ToggleBars'; +import { lazyInject } from '@/inversify.config'; +import { AppAlerts } from '@/services/alerts/appAlerts'; +import devfileApi, { isDevfileV2, isDevWorkspace } from '@/services/devfileApi'; +import stringify from '@/services/helpers/editor'; +import { AlertItem } from '@/services/helpers/types'; +import { WorkspaceAdapter } from '@/services/workspace-adapter'; +import { AppState } from '@/store'; +import { actionCreators } from '@/store/BannerAlert'; +import { selectApplications } from '@/store/ClusterInfo/selectors'; type Props = MappedProps & { devfileOrDevWorkspace: devfileApi.DevWorkspace | devfileApi.Devfile; diff --git a/packages/dashboard-frontend/src/components/ExpandableWarning/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/ExpandableWarning/__tests__/index.spec.tsx index b648ce9428..e8800c1d4e 100644 --- a/packages/dashboard-frontend/src/components/ExpandableWarning/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/ExpandableWarning/__tests__/index.spec.tsx @@ -10,11 +10,11 @@ * Red Hat, Inc. - initial API and implementation */ +import { render, RenderResult, screen } from '@testing-library/react'; import React from 'react'; import renderer from 'react-test-renderer'; -import ExpandableWarningItems, { ERROR_MESSAGE_ID } from '../'; -import { render, RenderResult, screen } from '@testing-library/react'; +import ExpandableWarningItems, { ERROR_MESSAGE_ID } from '@/components/ExpandableWarning'; describe('Expandable warning items', () => { it('should correctly render the component', () => { diff --git a/packages/dashboard-frontend/src/components/ExpandableWarning/index.tsx b/packages/dashboard-frontend/src/components/ExpandableWarning/index.tsx index 0280bec0c1..e2e61821fd 100644 --- a/packages/dashboard-frontend/src/components/ExpandableWarning/index.tsx +++ b/packages/dashboard-frontend/src/components/ExpandableWarning/index.tsx @@ -10,20 +10,21 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { Button, CodeBlock, CodeBlockAction, CodeBlockCode, ExpandableSectionToggle, - TextContent, Text, + TextContent, TextVariants, } from '@patternfly/react-core'; -import CopyToClipboard from 'react-copy-to-clipboard'; import { CopyIcon } from '@patternfly/react-icons'; -import styles from './index.module.css'; +import React from 'react'; +import CopyToClipboard from 'react-copy-to-clipboard'; + +import styles from '@/components/ExpandableWarning/index.module.css'; export const ERROR_MESSAGE_ID = 'expandable-warning-error-message'; diff --git a/packages/dashboard-frontend/src/components/Fallback/__tests__/Fallback.spec.tsx b/packages/dashboard-frontend/src/components/Fallback/__tests__/Fallback.spec.tsx index dacdcf5772..2469a159fb 100644 --- a/packages/dashboard-frontend/src/components/Fallback/__tests__/Fallback.spec.tsx +++ b/packages/dashboard-frontend/src/components/Fallback/__tests__/Fallback.spec.tsx @@ -12,6 +12,7 @@ import React from 'react'; import renderer, { ReactTestRendererJSON } from 'react-test-renderer'; + import Fallback from '..'; describe('React element that is rendered while waiting for the component to load', () => { diff --git a/packages/dashboard-frontend/src/components/Head/__tests__/Head.spec.tsx b/packages/dashboard-frontend/src/components/Head/__tests__/Head.spec.tsx index 364d1a5281..38078cfc5b 100644 --- a/packages/dashboard-frontend/src/components/Head/__tests__/Head.spec.tsx +++ b/packages/dashboard-frontend/src/components/Head/__tests__/Head.spec.tsx @@ -13,9 +13,11 @@ import React from 'react'; import { Provider } from 'react-redux'; import renderer from 'react-test-renderer'; + +import { BrandingData } from '@/services/bootstrap/branding.constant'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; + import Head from '..'; -import { BrandingData } from '../../../services/bootstrap/branding.constant'; -import { FakeStoreBuilder } from '../../../store/__mocks__/storeBuilder'; jest.mock('react-helmet', () => { const Helmet = (props: { children: React.ReactElement[] }) => { diff --git a/packages/dashboard-frontend/src/components/Head/index.tsx b/packages/dashboard-frontend/src/components/Head/index.tsx index 65c0a1faa9..7d1b07c36e 100644 --- a/packages/dashboard-frontend/src/components/Head/index.tsx +++ b/packages/dashboard-frontend/src/components/Head/index.tsx @@ -13,8 +13,9 @@ import React from 'react'; import { Helmet } from 'react-helmet'; import { connect, ConnectedProps } from 'react-redux'; -import { AppState } from '../../store'; -import { selectBranding } from '../../store/Branding/selectors'; + +import { AppState } from '@/store'; +import { selectBranding } from '@/store/Branding/selectors'; type Props = MappedProps & { pageName?: string; diff --git a/packages/dashboard-frontend/src/components/Header/__tests__/Header.spec.tsx b/packages/dashboard-frontend/src/components/Header/__tests__/Header.spec.tsx index 2bbcb46baf..70dc135621 100644 --- a/packages/dashboard-frontend/src/components/Header/__tests__/Header.spec.tsx +++ b/packages/dashboard-frontend/src/components/Header/__tests__/Header.spec.tsx @@ -12,8 +12,10 @@ import React from 'react'; import renderer from 'react-test-renderer'; + +import { WorkspaceStatus } from '@/services/helpers/types'; + import Header from '..'; -import { WorkspaceStatus } from '../../../services/helpers/types'; jest.mock('react-tooltip', () => { return function DummyTooltip(): React.ReactElement { diff --git a/packages/dashboard-frontend/src/components/Header/index.tsx b/packages/dashboard-frontend/src/components/Header/index.tsx index 1dde767247..523893babe 100644 --- a/packages/dashboard-frontend/src/components/Header/index.tsx +++ b/packages/dashboard-frontend/src/components/Header/index.tsx @@ -10,7 +10,6 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { Breadcrumb, BreadcrumbItem, @@ -24,13 +23,15 @@ import { TextContent, TextVariants, } from '@patternfly/react-core'; -import WorkspaceStatusLabel from '../WorkspaceStatusLabel'; +import React from 'react'; + +import WorkspaceStatusLabel from '@/components/WorkspaceStatusLabel'; +import styles from '@/pages/WorkspaceDetails/Header/index.module.css'; import { DeprecatedWorkspaceStatus, DevWorkspaceStatus, WorkspaceStatus, -} from '../../services/helpers/types'; -import styles from '../../pages/WorkspaceDetails/Header/index.module.css'; +} from '@/services/helpers/types'; const SECTION_THEME = PageSectionVariants.light; diff --git a/packages/dashboard-frontend/src/components/InputGroupExtended/__mocks__/index.tsx b/packages/dashboard-frontend/src/components/InputGroupExtended/__mocks__/index.tsx index 58a18e1819..2601cf4eca 100644 --- a/packages/dashboard-frontend/src/components/InputGroupExtended/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/components/InputGroupExtended/__mocks__/index.tsx @@ -10,9 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ +import { Button } from '@patternfly/react-core'; import * as React from 'react'; + import { Props, State } from '..'; -import { Button } from '@patternfly/react-core'; export class InputGroupExtended extends React.PureComponent { render(): React.ReactElement { diff --git a/packages/dashboard-frontend/src/components/InputGroupExtended/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/InputGroupExtended/__tests__/index.spec.tsx index cecf6c2d89..e430367689 100644 --- a/packages/dashboard-frontend/src/components/InputGroupExtended/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/InputGroupExtended/__tests__/index.spec.tsx @@ -13,8 +13,10 @@ import { ValidatedOptions } from '@patternfly/react-core'; import { StateMock } from '@react-mock/state'; import * as React from 'react'; + +import getComponentRenderer, { screen } from '@/services/__mocks__/getComponentRenderer'; + import { InputGroupExtended, Props, State } from '..'; -import getComponentRenderer, { screen } from '../../../services/__mocks__/getComponentRenderer'; const { createSnapshot, renderComponent } = getComponentRenderer(getComponent); diff --git a/packages/dashboard-frontend/src/components/InputGroupExtended/index.tsx b/packages/dashboard-frontend/src/components/InputGroupExtended/index.tsx index a67a73e2fb..2b79520c73 100644 --- a/packages/dashboard-frontend/src/components/InputGroupExtended/index.tsx +++ b/packages/dashboard-frontend/src/components/InputGroupExtended/index.tsx @@ -14,7 +14,7 @@ import { Button, Form, InputGroup, ValidatedOptions } from '@patternfly/react-co import { CheckIcon, PencilAltIcon, TimesIcon } from '@patternfly/react-icons'; import * as React from 'react'; -import styles from './index.module.css'; +import styles from '@/components/InputGroupExtended/index.module.css'; export type Props = React.PropsWithChildren & { readonly: boolean; diff --git a/packages/dashboard-frontend/src/components/Progress/__tests__/Progress.spec.tsx b/packages/dashboard-frontend/src/components/Progress/__tests__/Progress.spec.tsx index ef174cef86..b9b5c0440f 100644 --- a/packages/dashboard-frontend/src/components/Progress/__tests__/Progress.spec.tsx +++ b/packages/dashboard-frontend/src/components/Progress/__tests__/Progress.spec.tsx @@ -12,6 +12,7 @@ import React from 'react'; import renderer, { ReactTestRendererJSON } from 'react-test-renderer'; + import CheProgress from '..'; describe('Progress component', () => { diff --git a/packages/dashboard-frontend/src/components/Progress/index.tsx b/packages/dashboard-frontend/src/components/Progress/index.tsx index a1ca91a638..83f9ef2d7f 100644 --- a/packages/dashboard-frontend/src/components/Progress/index.tsx +++ b/packages/dashboard-frontend/src/components/Progress/index.tsx @@ -10,10 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { Progress, ProgressMeasureLocation, ProgressSize } from '@patternfly/react-core'; +import React from 'react'; -import styles from './index.module.css'; +import styles from '@/components/Progress/index.module.css'; type Props = { isLoading: boolean; diff --git a/packages/dashboard-frontend/src/components/ResourceIcon/__mocks__/index.tsx b/packages/dashboard-frontend/src/components/ResourceIcon/__mocks__/index.tsx index 2b1dbf9cc8..7321685e31 100644 --- a/packages/dashboard-frontend/src/components/ResourceIcon/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/components/ResourceIcon/__mocks__/index.tsx @@ -11,6 +11,7 @@ */ import React from 'react'; + import { Props } from '..'; export class ResourceIcon extends React.PureComponent { diff --git a/packages/dashboard-frontend/src/components/ResourceIcon/index.tsx b/packages/dashboard-frontend/src/components/ResourceIcon/index.tsx index dea4e2507d..2f8b74dc03 100644 --- a/packages/dashboard-frontend/src/components/ResourceIcon/index.tsx +++ b/packages/dashboard-frontend/src/components/ResourceIcon/index.tsx @@ -12,7 +12,8 @@ import { Tooltip } from '@patternfly/react-core'; import React from 'react'; -import styles from './index.module.css'; + +import styles from '@/components/ResourceIcon/index.module.css'; export type Props = { kind: string; diff --git a/packages/dashboard-frontend/src/components/TagLabel/__tests__/TagLabel.spec.tsx b/packages/dashboard-frontend/src/components/TagLabel/__tests__/TagLabel.spec.tsx index 8d5713d354..76fd74498e 100644 --- a/packages/dashboard-frontend/src/components/TagLabel/__tests__/TagLabel.spec.tsx +++ b/packages/dashboard-frontend/src/components/TagLabel/__tests__/TagLabel.spec.tsx @@ -12,6 +12,7 @@ import React from 'react'; import renderer, { ReactTestRendererJSON } from 'react-test-renderer'; + import TagLabel from '..'; describe('TagLabel component', () => { diff --git a/packages/dashboard-frontend/src/components/TagLabel/index.tsx b/packages/dashboard-frontend/src/components/TagLabel/index.tsx index 81a508aa08..b0630678e9 100644 --- a/packages/dashboard-frontend/src/components/TagLabel/index.tsx +++ b/packages/dashboard-frontend/src/components/TagLabel/index.tsx @@ -10,10 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { Label } from '@patternfly/react-core'; +import React from 'react'; -import styles from './index.module.css'; +import styles from '@/components/TagLabel/index.module.css'; type Props = { version: string; diff --git a/packages/dashboard-frontend/src/components/UnsavedChangesModal/__tests__/UnsavedChangesModal.spec.tsx b/packages/dashboard-frontend/src/components/UnsavedChangesModal/__tests__/UnsavedChangesModal.spec.tsx index 8e1c462f85..6756deb771 100644 --- a/packages/dashboard-frontend/src/components/UnsavedChangesModal/__tests__/UnsavedChangesModal.spec.tsx +++ b/packages/dashboard-frontend/src/components/UnsavedChangesModal/__tests__/UnsavedChangesModal.spec.tsx @@ -10,10 +10,11 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { fireEvent, render, screen } from '@testing-library/react'; -import UnsavedChangesModal from '..'; import { createHashHistory } from 'history'; +import React from 'react'; + +import UnsavedChangesModal from '..'; describe('Unsaved Changes modal window', () => { const hasUnsavedChanges = jest.fn(); diff --git a/packages/dashboard-frontend/src/components/UnsavedChangesModal/index.tsx b/packages/dashboard-frontend/src/components/UnsavedChangesModal/index.tsx index 2739f2fd5e..78c61e54e2 100644 --- a/packages/dashboard-frontend/src/components/UnsavedChangesModal/index.tsx +++ b/packages/dashboard-frontend/src/components/UnsavedChangesModal/index.tsx @@ -10,9 +10,9 @@ * Red Hat, Inc. - initial API and implementation */ -import React, { useEffect, useState } from 'react'; -import { Button, Modal, ModalVariant, TextContent, Text } from '@patternfly/react-core'; +import { Button, Modal, ModalVariant, Text, TextContent } from '@patternfly/react-core'; import { History, UnregisterCallback } from 'history'; +import React, { useEffect, useState } from 'react'; type Props = { hasUnsavedChanges: () => boolean; diff --git a/packages/dashboard-frontend/src/components/Workspace/Indicator/__tests__/Indicator.spec.tsx b/packages/dashboard-frontend/src/components/Workspace/Indicator/__tests__/Indicator.spec.tsx index 1536d7fcaa..8e8891e89a 100644 --- a/packages/dashboard-frontend/src/components/Workspace/Indicator/__tests__/Indicator.spec.tsx +++ b/packages/dashboard-frontend/src/components/Workspace/Indicator/__tests__/Indicator.spec.tsx @@ -12,8 +12,10 @@ import React from 'react'; import renderer, { ReactTestRendererJSON } from 'react-test-renderer'; + +import { DevWorkspaceStatus, WorkspaceStatus } from '@/services/helpers/types'; + import WorkspaceIndicator from '..'; -import { DevWorkspaceStatus, WorkspaceStatus } from '../../../../services/helpers/types'; jest.mock('react-tooltip', () => { return function DummyTooltip(): React.ReactElement { diff --git a/packages/dashboard-frontend/src/components/Workspace/Indicator/index.tsx b/packages/dashboard-frontend/src/components/Workspace/Indicator/index.tsx index 0c3ad97417..ea2fbc8fb9 100644 --- a/packages/dashboard-frontend/src/components/Workspace/Indicator/index.tsx +++ b/packages/dashboard-frontend/src/components/Workspace/Indicator/index.tsx @@ -12,20 +12,20 @@ import { ExclamationCircleIcon, + ExclamationTriangleIcon, InProgressIcon, ResourcesFullIcon, - ExclamationTriangleIcon, } from '@patternfly/react-icons'; import React from 'react'; import ReactTooltip from 'react-tooltip'; + +import styles from '@/components/Workspace/Indicator/index.module.css'; +import { ColorType, StoppedIcon } from '@/components/WorkspaceStatusLabel'; import { + DeprecatedWorkspaceStatus, DevWorkspaceStatus, WorkspaceStatus, - DeprecatedWorkspaceStatus, -} from '../../../services/helpers/types'; -import { ColorType, StoppedIcon } from '../../WorkspaceStatusLabel'; - -import styles from './index.module.css'; +} from '@/services/helpers/types'; type Props = { status: WorkspaceStatus | DevWorkspaceStatus | DeprecatedWorkspaceStatus; diff --git a/packages/dashboard-frontend/src/components/WorkspaceEditor/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceEditor/index.tsx index 26f9fc43c8..634d427b83 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceEditor/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceEditor/index.tsx @@ -10,16 +10,16 @@ * Red Hat, Inc. - initial API and implementation */ +import { isMatch } from 'lodash'; +import { editor, languages } from 'monaco-editor-core'; import React from 'react'; -import { DisposableCollection } from '../../services/helpers/disposable'; -import { languages, editor } from 'monaco-editor-core'; import { getLanguageService, LanguageService } from 'yaml-language-server'; -import { initDefaultEditorTheme } from '../../services/monacoThemeRegister'; -import stringify, { language, conf } from '../../services/helpers/editor'; -import devfileApi from '../../services/devfileApi'; -import { isMatch } from 'lodash'; -import styles from './index.module.css'; +import styles from '@/components/WorkspaceEditor/index.module.css'; +import devfileApi from '@/services/devfileApi'; +import { DisposableCollection } from '@/services/helpers/disposable'; +import stringify, { conf, language } from '@/services/helpers/editor'; +import { initDefaultEditorTheme } from '@/services/monacoThemeRegister'; const LANGUAGE_ID = 'yaml'; const YAML_SERVICE = 'yamlService'; diff --git a/packages/dashboard-frontend/src/components/WorkspaceEvents/Item/__mocks__/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceEvents/Item/__mocks__/index.tsx index 78d5ab87af..9d2a2d0837 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceEvents/Item/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceEvents/Item/__mocks__/index.tsx @@ -11,6 +11,7 @@ */ import React from 'react'; + import { Props } from '..'; export class WorkspaceEventsItem extends React.PureComponent { diff --git a/packages/dashboard-frontend/src/components/WorkspaceEvents/Item/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/WorkspaceEvents/Item/__tests__/index.spec.tsx index 5a34434065..13fab8ea75 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceEvents/Item/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceEvents/Item/__tests__/index.spec.tsx @@ -15,8 +15,10 @@ import { CoreV1Event } from '@kubernetes/client-node'; import { screen } from '@testing-library/react'; import React from 'react'; + +import getComponentRenderer from '@/services/__mocks__/getComponentRenderer'; + import { WorkspaceEventsItem } from '..'; -import getComponentRenderer from '../../../../services/__mocks__/getComponentRenderer'; jest.mock('date-fns', () => ({ format: jest.fn(() => '14:00:00'), diff --git a/packages/dashboard-frontend/src/components/WorkspaceEvents/Item/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceEvents/Item/index.tsx index 090e803b2d..64a0b6c540 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceEvents/Item/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceEvents/Item/index.tsx @@ -23,8 +23,9 @@ import { } from '@patternfly/react-core'; import { format } from 'date-fns'; import React from 'react'; -import { ResourceIcon } from '../../ResourceIcon'; -import styles from './index.module.css'; + +import { ResourceIcon } from '@/components/ResourceIcon'; +import styles from '@/components/WorkspaceEvents/Item/index.module.css'; export type Props = { event: CoreV1Event; diff --git a/packages/dashboard-frontend/src/components/WorkspaceEvents/__mocks__/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceEvents/__mocks__/index.tsx index f3bf77254f..c02aef86ca 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceEvents/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceEvents/__mocks__/index.tsx @@ -11,6 +11,7 @@ */ import React from 'react'; + import { Props } from '..'; export default class WorkspaceEvents extends React.PureComponent { diff --git a/packages/dashboard-frontend/src/components/WorkspaceEvents/__tests__/compareEventTime.spec.ts b/packages/dashboard-frontend/src/components/WorkspaceEvents/__tests__/compareEventTime.spec.ts index 2a1b2b6f77..31e1624ca2 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceEvents/__tests__/compareEventTime.spec.ts +++ b/packages/dashboard-frontend/src/components/WorkspaceEvents/__tests__/compareEventTime.spec.ts @@ -11,7 +11,8 @@ */ import { CoreV1Event } from '@kubernetes/client-node'; -import sortEvents from '../compareEventTime'; + +import sortEvents from '@/components/WorkspaceEvents/compareEventTime'; describe('sortEvents', () => { let event1: CoreV1Event; diff --git a/packages/dashboard-frontend/src/components/WorkspaceEvents/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/WorkspaceEvents/__tests__/index.spec.tsx index 222d2a3dd0..919c2ec3a8 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceEvents/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceEvents/__tests__/index.spec.tsx @@ -15,16 +15,14 @@ import { screen, within } from '@testing-library/react'; import React from 'react'; import { Provider } from 'react-redux'; import { Store } from 'redux'; + +import getComponentRenderer from '@/services/__mocks__/getComponentRenderer'; +import devfileApi from '@/services/devfileApi'; +import { constructWorkspace, Workspace, WorkspaceAdapter } from '@/services/workspace-adapter'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; + import WorkspaceEvents from '..'; -import devfileApi from '../../../services/devfileApi'; -import { - constructWorkspace, - Workspace, - WorkspaceAdapter, -} from '../../../services/workspace-adapter'; -import getComponentRenderer from '../../../services/__mocks__/getComponentRenderer'; -import { DevWorkspaceBuilder } from '../../../store/__mocks__/devWorkspaceBuilder'; -import { FakeStoreBuilder } from '../../../store/__mocks__/storeBuilder'; jest.mock('../Item'); diff --git a/packages/dashboard-frontend/src/components/WorkspaceEvents/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceEvents/index.tsx index f881e504fb..0d1eb59cd6 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceEvents/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceEvents/index.tsx @@ -30,15 +30,16 @@ import { FileIcon } from '@patternfly/react-icons'; import React from 'react'; import Pluralize from 'react-pluralize'; import { connect, ConnectedProps } from 'react-redux'; -import { DevWorkspaceStatus } from '../../services/helpers/types'; -import { Workspace } from '../../services/workspace-adapter'; -import { AppState } from '../../store'; -import { selectAllEvents, selectEventsFromResourceVersion } from '../../store/Events/selectors'; -import { selectStartedWorkspaces } from '../../store/Workspaces/devWorkspaces/selectors'; -import { selectAllWorkspaces } from '../../store/Workspaces/selectors'; -import compareEventTime from './compareEventTime'; -import styles from './index.module.css'; -import { WorkspaceEventsItem } from './Item'; + +import compareEventTime from '@/components/WorkspaceEvents/compareEventTime'; +import styles from '@/components/WorkspaceEvents/index.module.css'; +import { WorkspaceEventsItem } from '@/components/WorkspaceEvents/Item'; +import { DevWorkspaceStatus } from '@/services/helpers/types'; +import { Workspace } from '@/services/workspace-adapter'; +import { AppState } from '@/store'; +import { selectAllEvents, selectEventsFromResourceVersion } from '@/store/Events/selectors'; +import { selectStartedWorkspaces } from '@/store/Workspaces/devWorkspaces/selectors'; +import { selectAllWorkspaces } from '@/store/Workspaces/selectors'; export type Props = { workspaceUID: string | undefined; diff --git a/packages/dashboard-frontend/src/components/WorkspaceLogs/ContainerSelector/__mocks__/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceLogs/ContainerSelector/__mocks__/index.tsx index 4bb1923711..a96eea157e 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceLogs/ContainerSelector/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceLogs/ContainerSelector/__mocks__/index.tsx @@ -11,7 +11,8 @@ */ import React from 'react'; -import { Props, State } from '../'; + +import { Props, State } from '@/components/WorkspaceLogs/ContainerSelector'; export class WorkspaceLogsContainerSelector extends React.PureComponent { constructor(props: Props) { diff --git a/packages/dashboard-frontend/src/components/WorkspaceLogs/ContainerSelector/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/WorkspaceLogs/ContainerSelector/__tests__/index.spec.tsx index 3f7e6811ef..ab1c59ec7f 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceLogs/ContainerSelector/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceLogs/ContainerSelector/__tests__/index.spec.tsx @@ -14,8 +14,10 @@ import { V1Pod } from '@kubernetes/client-node'; import React from 'react'; + +import getComponentRenderer, { screen } from '@/services/__mocks__/getComponentRenderer'; + import { NO_CONTAINERS, WorkspaceLogsContainerSelector } from '..'; -import getComponentRenderer, { screen } from '../../../../services/__mocks__/getComponentRenderer'; jest.mock('../../../../components/ResourceIcon'); diff --git a/packages/dashboard-frontend/src/components/WorkspaceLogs/ContainerSelector/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceLogs/ContainerSelector/index.tsx index c3cf49b2c4..2c3d957fdf 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceLogs/ContainerSelector/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceLogs/ContainerSelector/index.tsx @@ -13,7 +13,8 @@ import { V1Pod } from '@kubernetes/client-node'; import { Dropdown, DropdownItem, DropdownSeparator, DropdownToggle } from '@patternfly/react-core'; import React from 'react'; -import { ResourceIcon } from '../../ResourceIcon'; + +import { ResourceIcon } from '@/components/ResourceIcon'; export type Props = { pod: V1Pod | undefined; diff --git a/packages/dashboard-frontend/src/components/WorkspaceLogs/ToolsPanel/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/WorkspaceLogs/ToolsPanel/__tests__/index.spec.tsx index 45c59b8d89..1e4296661d 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceLogs/ToolsPanel/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceLogs/ToolsPanel/__tests__/index.spec.tsx @@ -11,8 +11,10 @@ */ import React from 'react'; + +import getComponentRenderer from '@/services/__mocks__/getComponentRenderer'; + import { WorkspaceLogsToolsPanel } from '..'; -import getComponentRenderer from '../../../../services/__mocks__/getComponentRenderer'; const { createSnapshot } = getComponentRenderer(getComponent); diff --git a/packages/dashboard-frontend/src/components/WorkspaceLogs/ToolsPanel/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceLogs/ToolsPanel/index.tsx index 1bc337848b..9e74a12b22 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceLogs/ToolsPanel/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceLogs/ToolsPanel/index.tsx @@ -13,7 +13,7 @@ import { Split, SplitItem } from '@patternfly/react-core'; import React from 'react'; -import styles from './index.module.css'; +import styles from '@/components/WorkspaceLogs/ToolsPanel/index.module.css'; type Props = { isExpanded: boolean; diff --git a/packages/dashboard-frontend/src/components/WorkspaceLogs/Viewer/__mocks__/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceLogs/Viewer/__mocks__/index.tsx index 548a694638..d3aa3533ea 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceLogs/Viewer/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceLogs/Viewer/__mocks__/index.tsx @@ -11,6 +11,7 @@ */ import * as React from 'react'; + import { Props } from '..'; export class WorkspaceLogsViewer extends React.PureComponent { diff --git a/packages/dashboard-frontend/src/components/WorkspaceLogs/Viewer/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/WorkspaceLogs/Viewer/__tests__/index.spec.tsx index 0eb5d28763..c38f8e2ca1 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceLogs/Viewer/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceLogs/Viewer/__tests__/index.spec.tsx @@ -11,9 +11,11 @@ */ import React from 'react'; + +import getComponentRenderer from '@/services/__mocks__/getComponentRenderer'; +import { ContainerLogs } from '@/store/Pods/Logs'; + import { WorkspaceLogsViewer } from '..'; -import getComponentRenderer from '../../../../services/__mocks__/getComponentRenderer'; -import { ContainerLogs } from '../../../../store/Pods/Logs'; const { createSnapshot } = getComponentRenderer(getComponent); diff --git a/packages/dashboard-frontend/src/components/WorkspaceLogs/Viewer/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceLogs/Viewer/index.tsx index abc493af34..ac1d3da7d0 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceLogs/Viewer/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceLogs/Viewer/index.tsx @@ -11,8 +11,9 @@ */ import React from 'react'; -import { ContainerLogs } from '../../../store/Pods/Logs'; -import styles from './index.module.css'; + +import styles from '@/components/WorkspaceLogs/Viewer/index.module.css'; +import { ContainerLogs } from '@/store/Pods/Logs'; const LOGS_CONTAINER_ID = 'output-logs'; diff --git a/packages/dashboard-frontend/src/components/WorkspaceLogs/ViewerTools/__mocks__/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceLogs/ViewerTools/__mocks__/index.tsx index d237025ddd..d1f4d9a696 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceLogs/ViewerTools/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceLogs/ViewerTools/__mocks__/index.tsx @@ -12,6 +12,7 @@ import { Button } from '@patternfly/react-core'; import React from 'react'; + import { Props, State } from '..'; export class WorkspaceLogsViewerTools extends React.PureComponent { diff --git a/packages/dashboard-frontend/src/components/WorkspaceLogs/ViewerTools/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/WorkspaceLogs/ViewerTools/__tests__/index.spec.tsx index eed6d07011..5beee189f2 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceLogs/ViewerTools/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceLogs/ViewerTools/__tests__/index.spec.tsx @@ -11,9 +11,11 @@ */ import React from 'react'; + +import { ToggleBarsContext } from '@/contexts/ToggleBars'; +import getComponentRenderer, { screen } from '@/services/__mocks__/getComponentRenderer'; + import { WorkspaceLogsViewerTools } from '..'; -import { ToggleBarsContext } from '../../../../contexts/ToggleBars'; -import getComponentRenderer, { screen } from '../../../../services/__mocks__/getComponentRenderer'; const { createSnapshot, renderComponent } = getComponentRenderer(getComponent); diff --git a/packages/dashboard-frontend/src/components/WorkspaceLogs/ViewerTools/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceLogs/ViewerTools/index.tsx index 742211df09..7234e0bc8c 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceLogs/ViewerTools/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceLogs/ViewerTools/index.tsx @@ -21,7 +21,8 @@ import { } from '@patternfly/react-core'; import { CompressIcon, DownloadIcon, ExpandIcon } from '@patternfly/react-icons'; import React from 'react'; -import { ToggleBarsContext } from '../../../contexts/ToggleBars'; + +import { ToggleBarsContext } from '@/contexts/ToggleBars'; export type Props = { onToggle: (isExpand: boolean) => void; diff --git a/packages/dashboard-frontend/src/components/WorkspaceLogs/__mocks__/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceLogs/__mocks__/index.tsx index 9f02837fd3..c9b23bd070 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceLogs/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceLogs/__mocks__/index.tsx @@ -11,6 +11,7 @@ */ import React from 'react'; + import { Props, State } from '..'; export default class WorkspaceLogs extends React.PureComponent { diff --git a/packages/dashboard-frontend/src/components/WorkspaceLogs/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/WorkspaceLogs/__tests__/index.spec.tsx index d10cae2173..a2769b0e6d 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceLogs/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceLogs/__tests__/index.spec.tsx @@ -18,14 +18,16 @@ import userEvent from '@testing-library/user-event'; import React from 'react'; import { Provider } from 'react-redux'; import { Action, Store } from 'redux'; + +import getComponentRenderer from '@/services/__mocks__/getComponentRenderer'; +import devfileApi from '@/services/devfileApi'; +import { constructWorkspace, Workspace } from '@/services/workspace-adapter'; +import { AppThunk } from '@/store'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { ActionCreators, State } from '@/store/Pods/Logs'; + import WorkspaceLogs from '..'; -import devfileApi from '../../../services/devfileApi'; -import { constructWorkspace, Workspace } from '../../../services/workspace-adapter'; -import getComponentRenderer from '../../../services/__mocks__/getComponentRenderer'; -import { AppThunk } from '../../../store'; -import { ActionCreators, State } from '../../../store/Pods/Logs'; -import { DevWorkspaceBuilder } from '../../../store/__mocks__/devWorkspaceBuilder'; -import { FakeStoreBuilder } from '../../../store/__mocks__/storeBuilder'; jest.mock('../ContainerSelector'); jest.mock('../ViewerTools'); diff --git a/packages/dashboard-frontend/src/components/WorkspaceLogs/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceLogs/index.tsx index d1d44713cc..9a3a132fc2 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceLogs/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceLogs/index.tsx @@ -21,17 +21,18 @@ import { import { FileIcon } from '@patternfly/react-icons'; import React from 'react'; import { connect, ConnectedProps } from 'react-redux'; -import { Workspace } from '../../services/workspace-adapter'; -import { AppState } from '../../store'; -import * as LogsStore from '../../store/Pods/Logs'; -import { selectPodLogs } from '../../store/Pods/Logs/selectors'; -import { selectAllPods } from '../../store/Pods/selectors'; -import { selectAllWorkspaces } from '../../store/Workspaces/selectors'; -import { WorkspaceLogsContainerSelector } from './ContainerSelector'; -import styles from './index.module.css'; -import { WorkspaceLogsToolsPanel } from './ToolsPanel'; -import { WorkspaceLogsViewer } from './Viewer'; -import { WorkspaceLogsViewerTools } from './ViewerTools'; + +import { WorkspaceLogsContainerSelector } from '@/components/WorkspaceLogs/ContainerSelector'; +import styles from '@/components/WorkspaceLogs/index.module.css'; +import { WorkspaceLogsToolsPanel } from '@/components/WorkspaceLogs/ToolsPanel'; +import { WorkspaceLogsViewer } from '@/components/WorkspaceLogs/Viewer'; +import { WorkspaceLogsViewerTools } from '@/components/WorkspaceLogs/ViewerTools'; +import { Workspace } from '@/services/workspace-adapter'; +import { AppState } from '@/store'; +import * as LogsStore from '@/store/Pods/Logs'; +import { selectPodLogs } from '@/store/Pods/Logs/selectors'; +import { selectAllPods } from '@/store/Pods/selectors'; +import { selectAllWorkspaces } from '@/store/Workspaces/selectors'; export type Props = { workspaceUID: string | undefined; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/Alert/__mocks__/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/Alert/__mocks__/index.tsx index 7bc00f18f6..aea012e881 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/Alert/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/Alert/__mocks__/index.tsx @@ -11,6 +11,7 @@ */ import React from 'react'; + import { Props } from '..'; export class LoaderAlert extends React.PureComponent { diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/Alert/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/Alert/__tests__/index.spec.tsx index 914e99bd93..9694f8f622 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/Alert/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/Alert/__tests__/index.spec.tsx @@ -13,9 +13,11 @@ import { AlertVariant } from '@patternfly/react-core'; import userEvent from '@testing-library/user-event'; import React from 'react'; + +import getComponentRenderer, { screen } from '@/services/__mocks__/getComponentRenderer'; +import { AlertItem } from '@/services/helpers/types'; + import { ProgressAlert } from '..'; -import { AlertItem } from '../../../../services/helpers/types'; -import getComponentRenderer, { screen } from '../../../../services/__mocks__/getComponentRenderer'; const { renderComponent, createSnapshot } = getComponentRenderer(getComponent); diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/Alert/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/Alert/index.tsx index 6e45a15479..af38363091 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/Alert/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/Alert/index.tsx @@ -12,9 +12,9 @@ import { Alert, AlertActionLink, AlertGroup } from '@patternfly/react-core'; import React from 'react'; -import { AlertItem } from '../../../services/helpers/types'; -import styles from './index.module.css'; +import styles from '@/components/WorkspaceProgress/Alert/index.module.css'; +import { AlertItem } from '@/services/helpers/types'; export type Props = { isToast: boolean; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CommonSteps/CheckRunningWorkspacesLimit/__mocks__/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/CommonSteps/CheckRunningWorkspacesLimit/__mocks__/index.tsx index 552ae87403..8ffbe03ed2 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CommonSteps/CheckRunningWorkspacesLimit/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CommonSteps/CheckRunningWorkspacesLimit/__mocks__/index.tsx @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { ProgressStep } from '../../../__mocks__/ProgressStep'; +import { ProgressStep } from '@/components/WorkspaceProgress/__mocks__/ProgressStep'; export default class CommonStepCheckRunningWorkspacesLimit extends ProgressStep { protected readonly name = 'Common step: Check running workspaces limit'; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CommonSteps/CheckRunningWorkspacesLimit/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/CommonSteps/CheckRunningWorkspacesLimit/__tests__/index.spec.tsx index 1456674cc1..0a8af089f6 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CommonSteps/CheckRunningWorkspacesLimit/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CommonSteps/CheckRunningWorkspacesLimit/__tests__/index.spec.tsx @@ -17,20 +17,20 @@ import { createMemoryHistory } from 'history'; import React from 'react'; import { Provider } from 'react-redux'; import { Action, Store } from 'redux'; + +import { MIN_STEP_DURATION_MS, TIMEOUT_TO_STOP_SEC } from '@/components/WorkspaceProgress/const'; +import { WorkspaceParams } from '@/Routes/routes'; +import getComponentRenderer, { screen } from '@/services/__mocks__/getComponentRenderer'; +import devfileApi from '@/services/devfileApi'; +import { getDefer } from '@/services/helpers/deferred'; +import { AlertItem } from '@/services/helpers/types'; +import { constructWorkspace } from '@/services/workspace-adapter'; +import { AppThunk } from '@/store'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { ActionCreators } from '@/store/Workspaces'; + import CommonStepCheckRunningWorkspacesLimit, { State } from '..'; -import { WorkspaceParams } from '../../../../../Routes/routes'; -import getComponentRenderer, { - screen, -} from '../../../../../services/__mocks__/getComponentRenderer'; -import devfileApi from '../../../../../services/devfileApi'; -import { getDefer } from '../../../../../services/helpers/deferred'; -import { AlertItem } from '../../../../../services/helpers/types'; -import { constructWorkspace } from '../../../../../services/workspace-adapter'; -import { AppThunk } from '../../../../../store'; -import { ActionCreators } from '../../../../../store/Workspaces'; -import { DevWorkspaceBuilder } from '../../../../../store/__mocks__/devWorkspaceBuilder'; -import { FakeStoreBuilder } from '../../../../../store/__mocks__/storeBuilder'; -import { MIN_STEP_DURATION_MS, TIMEOUT_TO_STOP_SEC } from '../../../const'; jest.mock('../../../TimeLimit'); diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CommonSteps/CheckRunningWorkspacesLimit/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/CommonSteps/CheckRunningWorkspacesLimit/index.tsx index b4dfd47afc..9117b71bbd 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CommonSteps/CheckRunningWorkspacesLimit/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CommonSteps/CheckRunningWorkspacesLimit/index.tsx @@ -15,27 +15,29 @@ import { AlertVariant } from '@patternfly/react-core'; import { isEqual } from 'lodash'; import React from 'react'; import { connect, ConnectedProps } from 'react-redux'; -import { ToggleBarsContext } from '../../../../contexts/ToggleBars'; -import { WorkspaceParams } from '../../../../Routes/routes'; -import { findTargetWorkspace } from '../../../../services/helpers/factoryFlow/findTargetWorkspace'; -import { buildHomeLocation, buildIdeLoaderLocation } from '../../../../services/helpers/location'; -import { AlertItem, DevWorkspaceStatus, LoaderTab } from '../../../../services/helpers/types'; -import { Workspace } from '../../../../services/workspace-adapter'; -import { AppState } from '../../../../store'; -import { selectRunningWorkspacesLimit } from '../../../../store/ClusterConfig/selectors'; -import * as WorkspaceStore from '../../../../store/Workspaces'; -import { RunningWorkspacesExceededError } from '../../../../store/Workspaces/devWorkspaces'; -import { throwRunningWorkspacesExceededError } from '../../../../store/Workspaces/devWorkspaces/checkRunningWorkspacesLimit'; -import { selectRunningDevWorkspacesLimitExceeded } from '../../../../store/Workspaces/devWorkspaces/selectors'; + +import { TIMEOUT_TO_STOP_SEC } from '@/components/WorkspaceProgress/const'; import { - selectAllWorkspaces, - selectRunningWorkspaces, -} from '../../../../store/Workspaces/selectors'; -import { TIMEOUT_TO_STOP_SEC } from '../../const'; -import { ProgressStep, ProgressStepProps, ProgressStepState } from '../../ProgressStep'; -import { ProgressStepTitle } from '../../StepTitle'; -import { TimeLimit } from '../../TimeLimit'; -import workspaceStatusIs from '../../workspaceStatusIs'; + ProgressStep, + ProgressStepProps, + ProgressStepState, +} from '@/components/WorkspaceProgress/ProgressStep'; +import { ProgressStepTitle } from '@/components/WorkspaceProgress/StepTitle'; +import { TimeLimit } from '@/components/WorkspaceProgress/TimeLimit'; +import workspaceStatusIs from '@/components/WorkspaceProgress/workspaceStatusIs'; +import { ToggleBarsContext } from '@/contexts/ToggleBars'; +import { WorkspaceParams } from '@/Routes/routes'; +import { findTargetWorkspace } from '@/services/helpers/factoryFlow/findTargetWorkspace'; +import { buildHomeLocation, buildIdeLoaderLocation } from '@/services/helpers/location'; +import { AlertItem, DevWorkspaceStatus, LoaderTab } from '@/services/helpers/types'; +import { Workspace } from '@/services/workspace-adapter'; +import { AppState } from '@/store'; +import { selectRunningWorkspacesLimit } from '@/store/ClusterConfig/selectors'; +import * as WorkspaceStore from '@/store/Workspaces'; +import { RunningWorkspacesExceededError } from '@/store/Workspaces/devWorkspaces'; +import { throwRunningWorkspacesExceededError } from '@/store/Workspaces/devWorkspaces/checkRunningWorkspacesLimit'; +import { selectRunningDevWorkspacesLimitExceeded } from '@/store/Workspaces/devWorkspaces/selectors'; +import { selectAllWorkspaces, selectRunningWorkspaces } from '@/store/Workspaces/selectors'; export type Props = MappedProps & ProgressStepProps & { diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/__mocks__/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/__mocks__/index.tsx index e8b9a00c49..acda83121a 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/__mocks__/index.tsx @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { ProgressStep } from '../../../../__mocks__/ProgressStep'; +import { ProgressStep } from '@/components/WorkspaceProgress/__mocks__/ProgressStep'; export default class CreatingStepApplyDevfile extends ProgressStep { protected readonly name = 'Creating step: Apply devfile'; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/__tests__/getGitRemotes.spec.ts b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/__tests__/getGitRemotes.spec.ts index 9b43010e1c..d65ef35fe8 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/__tests__/getGitRemotes.spec.ts +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/__tests__/getGitRemotes.spec.ts @@ -10,8 +10,13 @@ * Red Hat, Inc. - initial API and implementation */ -import devfileApi from '../../../../../../services/devfileApi'; -import { configureProjectRemotes, getGitRemotes, GitRemote, sanitizeValue } from '../getGitRemotes'; +import { + configureProjectRemotes, + getGitRemotes, + GitRemote, + sanitizeValue, +} from '@/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/getGitRemotes'; +import devfileApi from '@/services/devfileApi'; describe('getGitRemotes functions', () => { describe('getGitRemotes()', () => { diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/__tests__/getProjectFromLocation.spec.ts b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/__tests__/getProjectFromLocation.spec.ts index 06e196a6f3..9744d4bbf4 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/__tests__/getProjectFromLocation.spec.ts +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/__tests__/getProjectFromLocation.spec.ts @@ -10,9 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ -import { getProjectFromLocation } from '../getProjectFromLocation'; import common from '@eclipse-che/common'; +import { getProjectFromLocation } from '@/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/getProjectFromLocation'; + describe('FactoryLoaderContainer/getProjectFromLocation', () => { describe('unsupported location', () => { test('Get a project from the unsupported location', () => { diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/__tests__/index.spec.tsx index c19d065647..fc88d5ef5a 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/__tests__/index.spec.tsx @@ -19,24 +19,26 @@ import { dump } from 'js-yaml'; import React from 'react'; import { Provider } from 'react-redux'; import { Action, Store } from 'redux'; -import CreatingStepApplyDevfile, { State } from '..'; -import ExpandableWarning from '../../../../../ExpandableWarning'; -import { ROUTE } from '../../../../../../Routes/routes'; -import devfileApi from '../../../../../../services/devfileApi'; + +import ExpandableWarning from '@/components/ExpandableWarning'; +import { MIN_STEP_DURATION_MS } from '@/components/WorkspaceProgress/const'; +import { prepareDevfile } from '@/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/prepareDevfile'; +import { ROUTE } from '@/Routes/routes'; +import getComponentRenderer from '@/services/__mocks__/getComponentRenderer'; +import devfileApi from '@/services/devfileApi'; +import { getDefer } from '@/services/helpers/deferred'; import { buildFactoryParams, FACTORY_URL_ATTR, POLICIES_CREATE_ATTR, -} from '../../../../../../services/helpers/factoryFlow/buildFactoryParams'; -import { getDefer } from '../../../../../../services/helpers/deferred'; -import { AlertItem } from '../../../../../../services/helpers/types'; -import getComponentRenderer from '../../../../../../services/__mocks__/getComponentRenderer'; -import { AppThunk } from '../../../../../../store'; -import { ActionCreators } from '../../../../../../store/Workspaces'; -import { DevWorkspaceBuilder } from '../../../../../../store/__mocks__/devWorkspaceBuilder'; -import { FakeStoreBuilder } from '../../../../../../store/__mocks__/storeBuilder'; -import { MIN_STEP_DURATION_MS } from '../../../../const'; -import { prepareDevfile } from '../prepareDevfile'; +} from '@/services/helpers/factoryFlow/buildFactoryParams'; +import { AlertItem } from '@/services/helpers/types'; +import { AppThunk } from '@/store'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { ActionCreators } from '@/store/Workspaces'; + +import CreatingStepApplyDevfile, { State } from '..'; jest.mock('../../../../TimeLimit'); jest.mock('../prepareDevfile.ts'); diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/__tests__/prepareDevfile.spec.ts b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/__tests__/prepareDevfile.spec.ts index 0fa55c309a..870ca2a9fb 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/__tests__/prepareDevfile.spec.ts +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/__tests__/prepareDevfile.spec.ts @@ -11,14 +11,15 @@ */ import { dump } from 'js-yaml'; -import devfileApi from '../../../../../../services/devfileApi'; -import { DEVWORKSPACE_STORAGE_TYPE_ATTR } from '../../../../../../services/devfileApi/devWorkspace/spec/template'; -import { generateWorkspaceName } from '../../../../../../services/helpers/generateName'; + +import { prepareDevfile } from '@/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/prepareDevfile'; +import devfileApi from '@/services/devfileApi'; +import { DEVWORKSPACE_STORAGE_TYPE_ATTR } from '@/services/devfileApi/devWorkspace/spec/template'; +import { generateWorkspaceName } from '@/services/helpers/generateName'; import { DEVWORKSPACE_DEVFILE_SOURCE, DEVWORKSPACE_METADATA_ANNOTATION, -} from '../../../../../../services/workspace-client/devworkspace/devWorkspaceClient'; -import { prepareDevfile } from '../prepareDevfile'; +} from '@/services/workspace-client/devworkspace/devWorkspaceClient'; jest.mock('../../../../../../services/helpers/generateName'); (generateWorkspaceName as jest.Mock).mockImplementation(name => name + '1234'); diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/getGitRemotes.ts b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/getGitRemotes.ts index b4d3038b5d..b63d521c20 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/getGitRemotes.ts +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/getGitRemotes.ts @@ -10,11 +10,12 @@ * Red Hat, Inc. - initial API and implementation */ -import common from '@eclipse-che/common'; -import devfileApi from '../../../../../services/devfileApi'; import { V221DevfileProjects, V221DevfileProjectsItemsGit } from '@devfile/api'; -import { getProjectName } from '../../../../../services/helpers/getProjectName'; -import { getProjectFromLocation } from './getProjectFromLocation'; +import common from '@eclipse-che/common'; + +import { getProjectFromLocation } from '@/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/getProjectFromLocation'; +import devfileApi from '@/services/devfileApi'; +import { getProjectName } from '@/services/helpers/getProjectName'; export interface GitRemote { name: string; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/getProjectFromLocation.ts b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/getProjectFromLocation.ts index 620a003c44..c8a6f94e67 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/getProjectFromLocation.ts +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/getProjectFromLocation.ts @@ -11,8 +11,9 @@ */ import { V221DevfileProjects } from '@devfile/api'; -import { FactoryLocationAdapter } from '../../../../../services/factory-location-adapter'; -import { getProjectName } from '../../../../../services/helpers/getProjectName'; + +import { FactoryLocationAdapter } from '@/services/factory-location-adapter'; +import { getProjectName } from '@/services/helpers/getProjectName'; export function getProjectFromLocation( location: string, diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/index.tsx index ff9fd1cc15..a983c563b8 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/index.tsx @@ -16,35 +16,40 @@ import cloneDeep from 'lodash/cloneDeep'; import isEqual from 'lodash/isEqual'; import React from 'react'; import { connect, ConnectedProps } from 'react-redux'; -import devfileApi from '../../../../../services/devfileApi'; + +import ExpandableWarning from '@/components/ExpandableWarning'; +import { TIMEOUT_TO_CREATE_SEC } from '@/components/WorkspaceProgress/const'; +import { configureProjectRemotes } from '@/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/getGitRemotes'; +import { getProjectFromLocation } from '@/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/getProjectFromLocation'; +import { prepareDevfile } from '@/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/prepareDevfile'; +import { + ProgressStep, + ProgressStepProps, + ProgressStepState, +} from '@/components/WorkspaceProgress/ProgressStep'; +import { ProgressStepTitle } from '@/components/WorkspaceProgress/StepTitle'; +import { TimeLimit } from '@/components/WorkspaceProgress/TimeLimit'; +import devfileApi from '@/services/devfileApi'; +import { DEVWORKSPACE_STORAGE_TYPE_ATTR } from '@/services/devfileApi/devWorkspace/spec/template'; import { buildFactoryParams, FactoryParams, USE_DEFAULT_DEVFILE, -} from '../../../../../services/helpers/factoryFlow/buildFactoryParams'; -import { findTargetWorkspace } from '../../../../../services/helpers/factoryFlow/findTargetWorkspace'; -import { buildIdeLoaderLocation } from '../../../../../services/helpers/location'; -import { AlertItem } from '../../../../../services/helpers/types'; -import { Workspace } from '../../../../../services/workspace-adapter'; -import { AppState } from '../../../../../store'; -import { selectDefaultDevfile } from '../../../../../store/DevfileRegistries/selectors'; +} from '@/services/helpers/factoryFlow/buildFactoryParams'; +import { findTargetWorkspace } from '@/services/helpers/factoryFlow/findTargetWorkspace'; +import { buildIdeLoaderLocation } from '@/services/helpers/location'; +import { AlertItem } from '@/services/helpers/types'; +import { Workspace } from '@/services/workspace-adapter'; +import { AppState } from '@/store'; +import { selectDefaultDevfile } from '@/store/DevfileRegistries/selectors'; import { selectFactoryResolver, selectFactoryResolverConverted, -} from '../../../../../store/FactoryResolver/selectors'; -import { selectDefaultNamespace } from '../../../../../store/InfrastructureNamespaces/selectors'; -import * as WorkspacesStore from '../../../../../store/Workspaces'; -import { selectDevWorkspaceWarnings } from '../../../../../store/Workspaces/devWorkspaces/selectors'; -import { selectAllWorkspaces } from '../../../../../store/Workspaces/selectors'; -import ExpandableWarning from '../../../../ExpandableWarning'; -import { TIMEOUT_TO_CREATE_SEC } from '../../../const'; -import { ProgressStep, ProgressStepProps, ProgressStepState } from '../../../ProgressStep'; -import { ProgressStepTitle } from '../../../StepTitle'; -import { TimeLimit } from '../../../TimeLimit'; -import { configureProjectRemotes } from './getGitRemotes'; -import { getProjectFromLocation } from './getProjectFromLocation'; -import { prepareDevfile } from './prepareDevfile'; -import { DEVWORKSPACE_STORAGE_TYPE_ATTR } from '../../../../../services/devfileApi/devWorkspace/spec/template'; +} from '@/store/FactoryResolver/selectors'; +import { selectDefaultNamespace } from '@/store/InfrastructureNamespaces/selectors'; +import * as WorkspacesStore from '@/store/Workspaces'; +import { selectDevWorkspaceWarnings } from '@/store/Workspaces/devWorkspaces/selectors'; +import { selectAllWorkspaces } from '@/store/Workspaces/selectors'; export class CreateWorkspaceError extends Error { constructor(message: string) { diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/prepareDevfile.ts b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/prepareDevfile.ts index 00646a6f6f..e673c1a103 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/prepareDevfile.ts +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Devfile/prepareDevfile.ts @@ -12,15 +12,16 @@ import { dump, load } from 'js-yaml'; import { cloneDeep } from 'lodash'; -import { DevfileAdapter } from '../../../../../services/devfile/adapter'; -import devfileApi from '../../../../../services/devfileApi'; -import { DEVWORKSPACE_STORAGE_TYPE_ATTR } from '../../../../../services/devfileApi/devWorkspace/spec/template'; -import { generateWorkspaceName } from '../../../../../services/helpers/generateName'; -import sanitizeName from '../../../../../services/helpers/sanitizeName'; + +import { DevfileAdapter } from '@/services/devfile/adapter'; +import devfileApi from '@/services/devfileApi'; +import { DEVWORKSPACE_STORAGE_TYPE_ATTR } from '@/services/devfileApi/devWorkspace/spec/template'; +import { generateWorkspaceName } from '@/services/helpers/generateName'; +import sanitizeName from '@/services/helpers/sanitizeName'; import { DEVWORKSPACE_DEVFILE_SOURCE, DEVWORKSPACE_METADATA_ANNOTATION, -} from '../../../../../services/workspace-client/devworkspace/devWorkspaceClient'; +} from '@/services/workspace-client/devworkspace/devWorkspaceClient'; export type FactorySource = { factory?: { params: string } }; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Resources/__mocks__/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Resources/__mocks__/index.tsx index 05a26c7ba7..b661a17dce 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Resources/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Resources/__mocks__/index.tsx @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { ProgressStep } from '../../../../__mocks__/ProgressStep'; +import { ProgressStep } from '@/components/WorkspaceProgress/__mocks__/ProgressStep'; export default class CreatingStepApplyResources extends ProgressStep { protected readonly name = 'Creating step: Apply resources'; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Resources/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Resources/__tests__/index.spec.tsx index 8fe4f90053..3e40d2e731 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Resources/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Resources/__tests__/index.spec.tsx @@ -16,24 +16,26 @@ import { createMemoryHistory, MemoryHistory } from 'history'; import React from 'react'; import { Provider } from 'react-redux'; import { Action, Store } from 'redux'; -import CreatingStepApplyResources from '..'; -import { ROUTE } from '../../../../../../Routes/routes'; -import devfileApi from '../../../../../../services/devfileApi'; + +import { MIN_STEP_DURATION_MS, TIMEOUT_TO_CREATE_SEC } from '@/components/WorkspaceProgress/const'; +import prepareResources from '@/components/WorkspaceProgress/CreatingSteps/Apply/Resources/prepareResources'; +import { ROUTE } from '@/Routes/routes'; +import getComponentRenderer from '@/services/__mocks__/getComponentRenderer'; +import devfileApi from '@/services/devfileApi'; +import { getDefer } from '@/services/helpers/deferred'; import { DEV_WORKSPACE_ATTR, FACTORY_URL_ATTR, POLICIES_CREATE_ATTR, -} from '../../../../../../services/helpers/factoryFlow/buildFactoryParams'; -import { getDefer } from '../../../../../../services/helpers/deferred'; -import { AlertItem } from '../../../../../../services/helpers/types'; -import getComponentRenderer from '../../../../../../services/__mocks__/getComponentRenderer'; -import { AppThunk } from '../../../../../../store'; -import { DevWorkspaceResources } from '../../../../../../store/DevfileRegistries'; -import { ActionCreators } from '../../../../../../store/Workspaces/devWorkspaces'; -import { DevWorkspaceBuilder } from '../../../../../../store/__mocks__/devWorkspaceBuilder'; -import { FakeStoreBuilder } from '../../../../../../store/__mocks__/storeBuilder'; -import { MIN_STEP_DURATION_MS, TIMEOUT_TO_CREATE_SEC } from '../../../../const'; -import prepareResources from '../prepareResources'; +} from '@/services/helpers/factoryFlow/buildFactoryParams'; +import { AlertItem } from '@/services/helpers/types'; +import { AppThunk } from '@/store'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { DevWorkspaceResources } from '@/store/DevfileRegistries'; +import { ActionCreators } from '@/store/Workspaces/devWorkspaces'; + +import CreatingStepApplyResources from '..'; jest.mock('../../../../TimeLimit'); jest.mock('../prepareResources.ts'); diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Resources/__tests__/prepareResources.spec.ts b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Resources/__tests__/prepareResources.spec.ts index c2568320d2..ce039d78ec 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Resources/__tests__/prepareResources.spec.ts +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Resources/__tests__/prepareResources.spec.ts @@ -11,11 +11,12 @@ */ import { V1alpha2DevWorkspace } from '@devfile/api'; -import { DEVWORKSPACE_STORAGE_TYPE_ATTR } from '../../../../../../services/devfileApi/devWorkspace/spec/template'; -import { generateSuffix } from '../../../../../../services/helpers/generateName'; -import { DEVWORKSPACE_DEVFILE_SOURCE } from '../../../../../../services/workspace-client/devworkspace/devWorkspaceClient'; -import { DevWorkspaceResources } from '../../../../../../store/DevfileRegistries'; -import prepareResources from '../prepareResources'; + +import prepareResources from '@/components/WorkspaceProgress/CreatingSteps/Apply/Resources/prepareResources'; +import { DEVWORKSPACE_STORAGE_TYPE_ATTR } from '@/services/devfileApi/devWorkspace/spec/template'; +import { generateSuffix } from '@/services/helpers/generateName'; +import { DEVWORKSPACE_DEVFILE_SOURCE } from '@/services/workspace-client/devworkspace/devWorkspaceClient'; +import { DevWorkspaceResources } from '@/store/DevfileRegistries'; const suffix = '-1234'; jest.mock('../../../../../../services/helpers/generateName'); diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Resources/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Resources/index.tsx index 7b591272dd..5d72da739d 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Resources/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Resources/index.tsx @@ -15,33 +15,38 @@ import { AlertVariant } from '@patternfly/react-core'; import { isEqual } from 'lodash'; import React from 'react'; import { connect, ConnectedProps } from 'react-redux'; + +import { TIMEOUT_TO_CREATE_SEC } from '@/components/WorkspaceProgress/const'; +import prepareResources from '@/components/WorkspaceProgress/CreatingSteps/Apply/Resources/prepareResources'; +import { + ProgressStep, + ProgressStepProps, + ProgressStepState, +} from '@/components/WorkspaceProgress/ProgressStep'; +import { ProgressStepTitle } from '@/components/WorkspaceProgress/StepTitle'; +import { TimeLimit } from '@/components/WorkspaceProgress/TimeLimit'; import { buildFactoryParams, FactoryParams, -} from '../../../../../services/helpers/factoryFlow/buildFactoryParams'; -import { findTargetWorkspace } from '../../../../../services/helpers/factoryFlow/findTargetWorkspace'; -import { buildIdeLoaderLocation } from '../../../../../services/helpers/location'; -import { AlertItem } from '../../../../../services/helpers/types'; -import { Workspace } from '../../../../../services/workspace-adapter'; -import { AppState } from '../../../../../store'; -import * as DevfileRegistriesStore from '../../../../../store/DevfileRegistries'; -import { DevWorkspaceResources } from '../../../../../store/DevfileRegistries'; -import { selectDevWorkspaceResources } from '../../../../../store/DevfileRegistries/selectors'; -import * as FactoryResolverStore from '../../../../../store/FactoryResolver'; +} from '@/services/helpers/factoryFlow/buildFactoryParams'; +import { findTargetWorkspace } from '@/services/helpers/factoryFlow/findTargetWorkspace'; +import { buildIdeLoaderLocation } from '@/services/helpers/location'; +import { AlertItem } from '@/services/helpers/types'; +import { Workspace } from '@/services/workspace-adapter'; +import { AppState } from '@/store'; +import * as DevfileRegistriesStore from '@/store/DevfileRegistries'; +import { DevWorkspaceResources } from '@/store/DevfileRegistries'; +import { selectDevWorkspaceResources } from '@/store/DevfileRegistries/selectors'; +import * as FactoryResolverStore from '@/store/FactoryResolver'; import { selectFactoryResolver, selectFactoryResolverConverted, -} from '../../../../../store/FactoryResolver/selectors'; -import { selectDefaultNamespace } from '../../../../../store/InfrastructureNamespaces/selectors'; -import * as WorkspacesStore from '../../../../../store/Workspaces'; -import * as DevWorkspacesStore from '../../../../../store/Workspaces/devWorkspaces'; -import { selectDevWorkspaceWarnings } from '../../../../../store/Workspaces/devWorkspaces/selectors'; -import { selectAllWorkspaces } from '../../../../../store/Workspaces/selectors'; -import { TIMEOUT_TO_CREATE_SEC } from '../../../const'; -import { ProgressStep, ProgressStepProps, ProgressStepState } from '../../../ProgressStep'; -import { ProgressStepTitle } from '../../../StepTitle'; -import { TimeLimit } from '../../../TimeLimit'; -import prepareResources from './prepareResources'; +} from '@/store/FactoryResolver/selectors'; +import { selectDefaultNamespace } from '@/store/InfrastructureNamespaces/selectors'; +import * as WorkspacesStore from '@/store/Workspaces'; +import * as DevWorkspacesStore from '@/store/Workspaces/devWorkspaces'; +import { selectDevWorkspaceWarnings } from '@/store/Workspaces/devWorkspaces/selectors'; +import { selectAllWorkspaces } from '@/store/Workspaces/selectors'; export type Props = MappedProps & ProgressStepProps & { diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Resources/prepareResources.ts b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Resources/prepareResources.ts index cb0c3888ce..80f5df7f5f 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Resources/prepareResources.ts +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Apply/Resources/prepareResources.ts @@ -12,12 +12,13 @@ import { dump } from 'js-yaml'; import { cloneDeep } from 'lodash'; -import { DevWorkspaceTemplate } from '../../../../../services/devfileApi/devfileApi'; -import { DevWorkspace } from '../../../../../services/devfileApi/devWorkspace'; -import { DEVWORKSPACE_STORAGE_TYPE_ATTR } from '../../../../../services/devfileApi/devWorkspace/spec/template'; -import { generateSuffix } from '../../../../../services/helpers/generateName'; -import { DEVWORKSPACE_DEVFILE_SOURCE } from '../../../../../services/workspace-client/devworkspace/devWorkspaceClient'; -import { DevWorkspaceResources } from '../../../../../store/DevfileRegistries'; + +import { DevWorkspaceTemplate } from '@/services/devfileApi/devfileApi'; +import { DevWorkspace } from '@/services/devfileApi/devWorkspace'; +import { DEVWORKSPACE_STORAGE_TYPE_ATTR } from '@/services/devfileApi/devWorkspace/spec/template'; +import { generateSuffix } from '@/services/helpers/generateName'; +import { DEVWORKSPACE_DEVFILE_SOURCE } from '@/services/workspace-client/devworkspace/devWorkspaceClient'; +import { DevWorkspaceResources } from '@/store/DevfileRegistries'; export default function prepareResources( _resources: DevWorkspaceResources, diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/CheckExistingWorkspaces/__mocks__/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/CheckExistingWorkspaces/__mocks__/index.tsx index 0b60862287..fcde9f181d 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/CheckExistingWorkspaces/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/CheckExistingWorkspaces/__mocks__/index.tsx @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { ProgressStep } from '../../../__mocks__/ProgressStep'; +import { ProgressStep } from '@/components/WorkspaceProgress/__mocks__/ProgressStep'; export default class CreatingStepCheckExistingWorkspaces extends ProgressStep { protected readonly name = 'Creating step: Check existing workspaces'; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/CheckExistingWorkspaces/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/CheckExistingWorkspaces/__tests__/index.spec.tsx index 10b3daa6db..e71595823a 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/CheckExistingWorkspaces/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/CheckExistingWorkspaces/__tests__/index.spec.tsx @@ -15,21 +15,23 @@ import { createMemoryHistory, MemoryHistory } from 'history'; import React from 'react'; import { Provider } from 'react-redux'; import { Store } from 'redux'; -import CreatingStepCheckExistingWorkspaces from '..'; -import { ROUTE } from '../../../../../Routes/routes'; -import devfileApi from '../../../../../services/devfileApi'; + +import { MIN_STEP_DURATION_MS } from '@/components/WorkspaceProgress/const'; +import { ROUTE } from '@/Routes/routes'; +import getComponentRenderer from '@/services/__mocks__/getComponentRenderer'; +import devfileApi from '@/services/devfileApi'; +import { getDefer } from '@/services/helpers/deferred'; import { DEV_WORKSPACE_ATTR, FACTORY_URL_ATTR, POLICIES_CREATE_ATTR, -} from '../../../../../services/helpers/factoryFlow/buildFactoryParams'; -import { getDefer } from '../../../../../services/helpers/deferred'; -import { AlertItem } from '../../../../../services/helpers/types'; -import getComponentRenderer from '../../../../../services/__mocks__/getComponentRenderer'; -import { DevWorkspaceResources } from '../../../../../store/DevfileRegistries'; -import { DevWorkspaceBuilder } from '../../../../../store/__mocks__/devWorkspaceBuilder'; -import { FakeStoreBuilder } from '../../../../../store/__mocks__/storeBuilder'; -import { MIN_STEP_DURATION_MS } from '../../../const'; +} from '@/services/helpers/factoryFlow/buildFactoryParams'; +import { AlertItem } from '@/services/helpers/types'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { DevWorkspaceResources } from '@/store/DevfileRegistries'; + +import CreatingStepCheckExistingWorkspaces from '..'; const { renderComponent } = getComponentRenderer(getComponent); let history: MemoryHistory; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/CheckExistingWorkspaces/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/CheckExistingWorkspaces/index.tsx index 184aa97923..02482242c0 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/CheckExistingWorkspaces/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/CheckExistingWorkspaces/index.tsx @@ -15,22 +15,27 @@ import { AlertVariant } from '@patternfly/react-core'; import { isEqual } from 'lodash'; import React from 'react'; import { connect, ConnectedProps } from 'react-redux'; + +import { + ProgressStep, + ProgressStepProps, + ProgressStepState, +} from '@/components/WorkspaceProgress/ProgressStep'; +import { ProgressStepTitle } from '@/components/WorkspaceProgress/StepTitle'; import { buildFactoryParams, FactoryParams, -} from '../../../../services/helpers/factoryFlow/buildFactoryParams'; -import { buildIdeLoaderLocation } from '../../../../services/helpers/location'; -import { AlertItem } from '../../../../services/helpers/types'; -import { Workspace } from '../../../../services/workspace-adapter'; -import { AppState } from '../../../../store'; -import { selectDevWorkspaceResources } from '../../../../store/DevfileRegistries/selectors'; +} from '@/services/helpers/factoryFlow/buildFactoryParams'; +import { buildIdeLoaderLocation } from '@/services/helpers/location'; +import { AlertItem } from '@/services/helpers/types'; +import { Workspace } from '@/services/workspace-adapter'; +import { AppState } from '@/store'; +import { selectDevWorkspaceResources } from '@/store/DevfileRegistries/selectors'; import { selectFactoryResolver, selectFactoryResolverConverted, -} from '../../../../store/FactoryResolver/selectors'; -import { selectAllWorkspaces } from '../../../../store/Workspaces/selectors'; -import { ProgressStep, ProgressStepProps, ProgressStepState } from '../../ProgressStep'; -import { ProgressStepTitle } from '../../StepTitle'; +} from '@/store/FactoryResolver/selectors'; +import { selectAllWorkspaces } from '@/store/Workspaces/selectors'; export type Props = MappedProps & ProgressStepProps & { diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/CreateWorkspace/__mocks__/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/CreateWorkspace/__mocks__/index.tsx index a1efc84b15..8d39e84d14 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/CreateWorkspace/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/CreateWorkspace/__mocks__/index.tsx @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { ProgressStep } from '../../../__mocks__/ProgressStep'; +import { ProgressStep } from '@/components/WorkspaceProgress/__mocks__/ProgressStep'; export default class CreatingStepCreateWorkspace extends ProgressStep { protected readonly name = 'Creating step: Create workspace'; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/CreateWorkspace/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/CreateWorkspace/__tests__/index.spec.tsx index d7001bfbdf..cef0b1690b 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/CreateWorkspace/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/CreateWorkspace/__tests__/index.spec.tsx @@ -15,10 +15,12 @@ import { createMemoryHistory } from 'history'; import React from 'react'; import { Provider } from 'react-redux'; import { Store } from 'redux'; + +import { MIN_STEP_DURATION_MS } from '@/components/WorkspaceProgress/const'; +import getComponentRenderer from '@/services/__mocks__/getComponentRenderer'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; + import CreateWorkspace from '..'; -import getComponentRenderer from '../../../../../services/__mocks__/getComponentRenderer'; -import { FakeStoreBuilder } from '../../../../../store/__mocks__/storeBuilder'; -import { MIN_STEP_DURATION_MS } from '../../../const'; const { renderComponent } = getComponentRenderer(getComponent); diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/CreateWorkspace/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/CreateWorkspace/index.tsx index fc85f4d049..614bd31767 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/CreateWorkspace/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/CreateWorkspace/index.tsx @@ -11,13 +11,18 @@ */ import React from 'react'; + +import { + ProgressStep, + ProgressStepProps, + ProgressStepState, +} from '@/components/WorkspaceProgress/ProgressStep'; +import { ProgressStepTitle } from '@/components/WorkspaceProgress/StepTitle'; import { buildFactoryParams, FactoryParams, -} from '../../../../services/helpers/factoryFlow/buildFactoryParams'; -import { AlertItem } from '../../../../services/helpers/types'; -import { ProgressStep, ProgressStepProps, ProgressStepState } from '../../ProgressStep'; -import { ProgressStepTitle } from '../../StepTitle'; +} from '@/services/helpers/factoryFlow/buildFactoryParams'; +import { AlertItem } from '@/services/helpers/types'; export type Props = ProgressStepProps & { searchParams: URLSearchParams; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Devfile/__mocks__/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Devfile/__mocks__/index.tsx index 0b0ef9808d..5f50a66b22 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Devfile/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Devfile/__mocks__/index.tsx @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { ProgressStep } from '../../../../__mocks__/ProgressStep'; +import { ProgressStep } from '@/components/WorkspaceProgress/__mocks__/ProgressStep'; export default class CreatingStepFetchDevfile extends ProgressStep { protected readonly name = 'Creating step: Fetch devfile'; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Devfile/__tests__/buildStepName.spec.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Devfile/__tests__/buildStepName.spec.tsx index f714e8e584..7f2eb17d5c 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Devfile/__tests__/buildStepName.spec.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Devfile/__tests__/buildStepName.spec.tsx @@ -12,13 +12,13 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import devfileApi from '../../../../../../services/devfileApi'; -import { FakeStoreBuilder } from '../../../../../../store/__mocks__/storeBuilder'; +import { buildStepName } from '@/components/WorkspaceProgress/CreatingSteps/Fetch/Devfile/buildStepName'; +import devfileApi from '@/services/devfileApi'; import { buildFactoryParams, FACTORY_URL_ATTR, -} from '../../../../../../services/helpers/factoryFlow/buildFactoryParams'; -import { buildStepName } from '../buildStepName'; +} from '@/services/helpers/factoryFlow/buildFactoryParams'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; const factoryUrl = 'https://factory-url'; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Devfile/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Devfile/__tests__/index.spec.tsx index 8fba37e022..9db76f7f65 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Devfile/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Devfile/__tests__/index.spec.tsx @@ -15,26 +15,28 @@ import { FACTORY_LINK_ATTR } from '@eclipse-che/common'; import { cleanup, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import { MemoryHistory, createMemoryHistory } from 'history'; +import { createMemoryHistory, MemoryHistory } from 'history'; import React from 'react'; import { Provider } from 'react-redux'; import { Action, Store } from 'redux'; -import CreatingStepFetchDevfile from '..'; -import getComponentRenderer from '../../../../../../services/__mocks__/getComponentRenderer'; -import devfileApi from '../../../../../../services/devfileApi'; -import { getDefer } from '../../../../../../services/helpers/deferred'; + +import ExpandableWarning from '@/components/ExpandableWarning'; +import { MIN_STEP_DURATION_MS, TIMEOUT_TO_RESOLVE_SEC } from '@/components/WorkspaceProgress/const'; +import getComponentRenderer from '@/services/__mocks__/getComponentRenderer'; +import devfileApi from '@/services/devfileApi'; +import { getDefer } from '@/services/helpers/deferred'; import { FACTORY_URL_ATTR, OVERRIDE_ATTR_PREFIX, REMOTES_ATTR, -} from '../../../../../../services/helpers/factoryFlow/buildFactoryParams'; -import { AlertItem } from '../../../../../../services/helpers/types'; -import OAuthService from '../../../../../../services/oauth'; -import { AppThunk } from '../../../../../../store'; -import { ActionCreators, OAuthResponse } from '../../../../../../store/FactoryResolver'; -import { FakeStoreBuilder } from '../../../../../../store/__mocks__/storeBuilder'; -import ExpandableWarning from '../../../../../ExpandableWarning'; -import { MIN_STEP_DURATION_MS, TIMEOUT_TO_RESOLVE_SEC } from '../../../../const'; +} from '@/services/helpers/factoryFlow/buildFactoryParams'; +import { AlertItem } from '@/services/helpers/types'; +import OAuthService from '@/services/oauth'; +import { AppThunk } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { ActionCreators, OAuthResponse } from '@/store/FactoryResolver'; + +import CreatingStepFetchDevfile from '..'; jest.mock('../../../../TimeLimit'); diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Devfile/buildStepName.ts b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Devfile/buildStepName.ts index 3cee8b2f5a..809a0e9994 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Devfile/buildStepName.ts +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Devfile/buildStepName.ts @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import * as FactoryResolverStore from '../../../../../store/FactoryResolver'; +import * as FactoryResolverStore from '@/store/FactoryResolver'; export function buildStepName( sourceUrl: string, diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Devfile/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Devfile/index.tsx index 3a864299f1..589e73cf17 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Devfile/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Devfile/index.tsx @@ -15,27 +15,32 @@ import { AlertVariant } from '@patternfly/react-core'; import { isEqual } from 'lodash'; import React from 'react'; import { connect, ConnectedProps } from 'react-redux'; + +import ExpandableWarning from '@/components/ExpandableWarning'; +import { TIMEOUT_TO_RESOLVE_SEC } from '@/components/WorkspaceProgress/const'; +import { buildStepName } from '@/components/WorkspaceProgress/CreatingSteps/Fetch/Devfile/buildStepName'; +import { + ProgressStep, + ProgressStepProps, + ProgressStepState, +} from '@/components/WorkspaceProgress/ProgressStep'; +import { ProgressStepTitle } from '@/components/WorkspaceProgress/StepTitle'; +import { TimeLimit } from '@/components/WorkspaceProgress/TimeLimit'; import { buildFactoryParams, FactoryParams, USE_DEFAULT_DEVFILE, -} from '../../../../../services/helpers/factoryFlow/buildFactoryParams'; -import { AlertItem } from '../../../../../services/helpers/types'; -import OAuthService, { isOAuthResponse } from '../../../../../services/oauth'; -import SessionStorageService, { SessionStorageKey } from '../../../../../services/session-storage'; -import { AppState } from '../../../../../store'; -import * as FactoryResolverStore from '../../../../../store/FactoryResolver'; +} from '@/services/helpers/factoryFlow/buildFactoryParams'; +import { AlertItem } from '@/services/helpers/types'; +import OAuthService, { isOAuthResponse } from '@/services/oauth'; +import SessionStorageService, { SessionStorageKey } from '@/services/session-storage'; +import { AppState } from '@/store'; +import * as FactoryResolverStore from '@/store/FactoryResolver'; import { selectFactoryResolver, selectFactoryResolverConverted, -} from '../../../../../store/FactoryResolver/selectors'; -import { selectAllWorkspaces } from '../../../../../store/Workspaces/selectors'; -import ExpandableWarning from '../../../../ExpandableWarning'; -import { ProgressStep, ProgressStepProps, ProgressStepState } from '../../../ProgressStep'; -import { ProgressStepTitle } from '../../../StepTitle'; -import { TimeLimit } from '../../../TimeLimit'; -import { TIMEOUT_TO_RESOLVE_SEC } from '../../../const'; -import { buildStepName } from './buildStepName'; +} from '@/store/FactoryResolver/selectors'; +import { selectAllWorkspaces } from '@/store/Workspaces/selectors'; export class ApplyingDevfileError extends Error { constructor(message: string) { diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Resources/__mocks__/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Resources/__mocks__/index.tsx index 4ea64fc29f..0ad679edb4 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Resources/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Resources/__mocks__/index.tsx @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { ProgressStep } from '../../../../__mocks__/ProgressStep'; +import { ProgressStep } from '@/components/WorkspaceProgress/__mocks__/ProgressStep'; export default class CreatingStepFetchResources extends ProgressStep { protected readonly name = 'Creating step: Fetch resources'; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Resources/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Resources/__tests__/index.spec.tsx index 9b94112151..7e48b4ed30 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Resources/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Resources/__tests__/index.spec.tsx @@ -16,19 +16,21 @@ import { createMemoryHistory } from 'history'; import React from 'react'; import { Provider } from 'react-redux'; import { Action, Store } from 'redux'; -import CreatingStepFetchResources from '..'; -import devfileApi from '../../../../../../services/devfileApi'; + +import { MIN_STEP_DURATION_MS, TIMEOUT_TO_RESOLVE_SEC } from '@/components/WorkspaceProgress/const'; +import getComponentRenderer from '@/services/__mocks__/getComponentRenderer'; +import devfileApi from '@/services/devfileApi'; +import { getDefer } from '@/services/helpers/deferred'; import { DEV_WORKSPACE_ATTR, FACTORY_URL_ATTR, -} from '../../../../../../services/helpers/factoryFlow/buildFactoryParams'; -import { getDefer } from '../../../../../../services/helpers/deferred'; -import { AlertItem } from '../../../../../../services/helpers/types'; -import getComponentRenderer from '../../../../../../services/__mocks__/getComponentRenderer'; -import { AppThunk } from '../../../../../../store'; -import { ActionCreators } from '../../../../../../store/DevfileRegistries'; -import { FakeStoreBuilder } from '../../../../../../store/__mocks__/storeBuilder'; -import { MIN_STEP_DURATION_MS, TIMEOUT_TO_RESOLVE_SEC } from '../../../../const'; +} from '@/services/helpers/factoryFlow/buildFactoryParams'; +import { AlertItem } from '@/services/helpers/types'; +import { AppThunk } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { ActionCreators } from '@/store/DevfileRegistries'; + +import CreatingStepFetchResources from '..'; jest.mock('../../../../TimeLimit'); diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Resources/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Resources/index.tsx index d899c122ef..809ea41ad8 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Resources/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Fetch/Resources/index.tsx @@ -15,19 +15,24 @@ import { AlertVariant } from '@patternfly/react-core'; import { isEqual } from 'lodash'; import React from 'react'; import { connect, ConnectedProps } from 'react-redux'; + +import { TIMEOUT_TO_RESOLVE_SEC } from '@/components/WorkspaceProgress/const'; +import { + ProgressStep, + ProgressStepProps, + ProgressStepState, +} from '@/components/WorkspaceProgress/ProgressStep'; +import { ProgressStepTitle } from '@/components/WorkspaceProgress/StepTitle'; +import { TimeLimit } from '@/components/WorkspaceProgress/TimeLimit'; import { buildFactoryParams, FactoryParams, -} from '../../../../../services/helpers/factoryFlow/buildFactoryParams'; -import { AlertItem } from '../../../../../services/helpers/types'; -import { AppState } from '../../../../../store'; -import * as DevfileRegistriesStore from '../../../../../store/DevfileRegistries'; -import { selectDevWorkspaceResources } from '../../../../../store/DevfileRegistries/selectors'; -import { selectAllWorkspaces } from '../../../../../store/Workspaces/selectors'; -import { TIMEOUT_TO_RESOLVE_SEC } from '../../../const'; -import { ProgressStep, ProgressStepProps, ProgressStepState } from '../../../ProgressStep'; -import { ProgressStepTitle } from '../../../StepTitle'; -import { TimeLimit } from '../../../TimeLimit'; +} from '@/services/helpers/factoryFlow/buildFactoryParams'; +import { AlertItem } from '@/services/helpers/types'; +import { AppState } from '@/store'; +import * as DevfileRegistriesStore from '@/store/DevfileRegistries'; +import { selectDevWorkspaceResources } from '@/store/DevfileRegistries/selectors'; +import { selectAllWorkspaces } from '@/store/Workspaces/selectors'; export type Props = MappedProps & ProgressStepProps & { diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Initialize/__mocks__/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Initialize/__mocks__/index.tsx index b3376536b4..5d683ac95b 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Initialize/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Initialize/__mocks__/index.tsx @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { ProgressStep } from '../../../__mocks__/ProgressStep'; +import { ProgressStep } from '@/components/WorkspaceProgress/__mocks__/ProgressStep'; export default class CreatingStepInitialize extends ProgressStep { protected readonly name = 'Creating step: Initialize'; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Initialize/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Initialize/__tests__/index.spec.tsx index f16a4f8989..c4337e74b6 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Initialize/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Initialize/__tests__/index.spec.tsx @@ -14,20 +14,20 @@ import { createMemoryHistory } from 'history'; import React from 'react'; import { Provider } from 'react-redux'; import { Store } from 'redux'; -import CreatingStepInitialize from '..'; + +import { MIN_STEP_DURATION_MS } from '@/components/WorkspaceProgress/const'; +import getComponentRenderer, { waitFor } from '@/services/__mocks__/getComponentRenderer'; import { DEV_WORKSPACE_ATTR, ERROR_CODE_ATTR, FACTORY_URL_ATTR, POLICIES_CREATE_ATTR, -} from '../../../../../services/helpers/factoryFlow/buildFactoryParams'; -import { AlertItem } from '../../../../../services/helpers/types'; -import getComponentRenderer, { - waitFor, -} from '../../../../../services/__mocks__/getComponentRenderer'; -import { DevWorkspaceBuilder } from '../../../../../store/__mocks__/devWorkspaceBuilder'; -import { FakeStoreBuilder } from '../../../../../store/__mocks__/storeBuilder'; -import { MIN_STEP_DURATION_MS } from '../../../const'; +} from '@/services/helpers/factoryFlow/buildFactoryParams'; +import { AlertItem } from '@/services/helpers/types'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; + +import CreatingStepInitialize from '..'; const { renderComponent } = getComponentRenderer(getComponent); diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Initialize/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Initialize/index.tsx index 80e30d3c5e..1db9ff0db1 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Initialize/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/CreatingSteps/Initialize/index.tsx @@ -16,19 +16,24 @@ import isEqual from 'lodash/isEqual'; import React from 'react'; import { connect, ConnectedProps } from 'react-redux'; import { generatePath } from 'react-router-dom'; -import { ROUTE } from '../../../../Routes/routes'; + +import { + ProgressStep, + ProgressStepProps, + ProgressStepState, +} from '@/components/WorkspaceProgress/ProgressStep'; +import { ProgressStepTitle } from '@/components/WorkspaceProgress/StepTitle'; +import { ROUTE } from '@/Routes/routes'; import { buildFactoryParams, FactoryParams, PoliciesCreate, -} from '../../../../services/helpers/factoryFlow/buildFactoryParams'; -import { AlertItem } from '../../../../services/helpers/types'; -import { AppState } from '../../../../store'; -import { selectAllWorkspacesLimit } from '../../../../store/ClusterConfig/selectors'; -import { selectInfrastructureNamespaces } from '../../../../store/InfrastructureNamespaces/selectors'; -import { selectAllWorkspaces } from '../../../../store/Workspaces/selectors'; -import { ProgressStep, ProgressStepProps, ProgressStepState } from '../../ProgressStep'; -import { ProgressStepTitle } from '../../StepTitle'; +} from '@/services/helpers/factoryFlow/buildFactoryParams'; +import { AlertItem } from '@/services/helpers/types'; +import { AppState } from '@/store'; +import { selectAllWorkspacesLimit } from '@/store/ClusterConfig/selectors'; +import { selectInfrastructureNamespaces } from '@/store/InfrastructureNamespaces/selectors'; +import { selectAllWorkspaces } from '@/store/Workspaces/selectors'; export type Props = MappedProps & ProgressStepProps & { diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/ProgressStep.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/ProgressStep.tsx index 6eb6feb132..fb7ef8405a 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/ProgressStep.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/ProgressStep.tsx @@ -13,10 +13,11 @@ import { helpers } from '@eclipse-che/common'; import { History } from 'history'; import React from 'react'; -import { DisposableCollection } from '../../services/helpers/disposable'; -import { AlertItem, LoaderTab } from '../../services/helpers/types'; -import { Debounce } from '../../services/helpers/debounce'; -import { MIN_STEP_DURATION_MS } from './const'; + +import { MIN_STEP_DURATION_MS } from '@/components/WorkspaceProgress/const'; +import { Debounce } from '@/services/helpers/debounce'; +import { DisposableCollection } from '@/services/helpers/disposable'; +import { AlertItem, LoaderTab } from '@/services/helpers/types'; export type ProgressStepProps = { distance: -1 | 0 | 1 | undefined; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/Initialize/__mocks__/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/Initialize/__mocks__/index.tsx index 14db914a41..5b1fc04ced 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/Initialize/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/Initialize/__mocks__/index.tsx @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { ProgressStep } from '../../../__mocks__/ProgressStep'; +import { ProgressStep } from '@/components/WorkspaceProgress/__mocks__/ProgressStep'; export default class StartingStepInitialize extends ProgressStep { protected readonly name = 'Starting step: Initialize'; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/Initialize/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/Initialize/__tests__/index.spec.tsx index 4bf41230d3..b0a37527a1 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/Initialize/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/Initialize/__tests__/index.spec.tsx @@ -10,20 +10,22 @@ * Red Hat, Inc. - initial API and implementation */ -import { waitFor, screen } from '@testing-library/react'; +import { screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { createMemoryHistory } from 'history'; import React from 'react'; import { Provider } from 'react-redux'; import { Store } from 'redux'; + +import { MIN_STEP_DURATION_MS, TIMEOUT_TO_STOP_SEC } from '@/components/WorkspaceProgress/const'; +import { WorkspaceParams } from '@/Routes/routes'; +import getComponentRenderer from '@/services/__mocks__/getComponentRenderer'; +import { getDefer } from '@/services/helpers/deferred'; +import { AlertItem } from '@/services/helpers/types'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; + import StartingStepInitialize from '..'; -import { WorkspaceParams } from '../../../../../Routes/routes'; -import { getDefer } from '../../../../../services/helpers/deferred'; -import { AlertItem } from '../../../../../services/helpers/types'; -import getComponentRenderer from '../../../../../services/__mocks__/getComponentRenderer'; -import { DevWorkspaceBuilder } from '../../../../../store/__mocks__/devWorkspaceBuilder'; -import { FakeStoreBuilder } from '../../../../../store/__mocks__/storeBuilder'; -import { MIN_STEP_DURATION_MS, TIMEOUT_TO_STOP_SEC } from '../../../const'; jest.mock('../../../TimeLimit'); diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/Initialize/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/Initialize/index.tsx index a85a1c318a..62c43d46eb 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/Initialize/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/Initialize/index.tsx @@ -15,18 +15,23 @@ import { AlertVariant } from '@patternfly/react-core'; import isEqual from 'lodash/isEqual'; import React from 'react'; import { connect, ConnectedProps } from 'react-redux'; -import { WorkspaceParams } from '../../../../Routes/routes'; -import { delay } from '../../../../services/helpers/delay'; -import { findTargetWorkspace } from '../../../../services/helpers/factoryFlow/findTargetWorkspace'; -import { AlertItem, DevWorkspaceStatus, LoaderTab } from '../../../../services/helpers/types'; -import { Workspace } from '../../../../services/workspace-adapter'; -import { AppState } from '../../../../store'; -import * as WorkspaceStore from '../../../../store/Workspaces'; -import { selectAllWorkspaces } from '../../../../store/Workspaces/selectors'; -import { MIN_STEP_DURATION_MS, TIMEOUT_TO_STOP_SEC } from '../../const'; -import { ProgressStep, ProgressStepProps, ProgressStepState } from '../../ProgressStep'; -import { ProgressStepTitle } from '../../StepTitle'; -import { TimeLimit } from '../../TimeLimit'; + +import { MIN_STEP_DURATION_MS, TIMEOUT_TO_STOP_SEC } from '@/components/WorkspaceProgress/const'; +import { + ProgressStep, + ProgressStepProps, + ProgressStepState, +} from '@/components/WorkspaceProgress/ProgressStep'; +import { ProgressStepTitle } from '@/components/WorkspaceProgress/StepTitle'; +import { TimeLimit } from '@/components/WorkspaceProgress/TimeLimit'; +import { WorkspaceParams } from '@/Routes/routes'; +import { delay } from '@/services/helpers/delay'; +import { findTargetWorkspace } from '@/services/helpers/factoryFlow/findTargetWorkspace'; +import { AlertItem, DevWorkspaceStatus, LoaderTab } from '@/services/helpers/types'; +import { Workspace } from '@/services/workspace-adapter'; +import { AppState } from '@/store'; +import * as WorkspaceStore from '@/store/Workspaces'; +import { selectAllWorkspaces } from '@/store/Workspaces/selectors'; export type Props = MappedProps & ProgressStepProps & { diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/OpenWorkspace/__mocks__/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/OpenWorkspace/__mocks__/index.tsx index 27f64c91b8..0763387edd 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/OpenWorkspace/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/OpenWorkspace/__mocks__/index.tsx @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { ProgressStep } from '../../../__mocks__/ProgressStep'; +import { ProgressStep } from '@/components/WorkspaceProgress/__mocks__/ProgressStep'; export default class StartingStepOpenWorkspace extends ProgressStep { protected readonly name = 'Starting step: Open workspace'; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/OpenWorkspace/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/OpenWorkspace/__tests__/index.spec.tsx index c5387304de..a13f39b7f9 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/OpenWorkspace/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/OpenWorkspace/__tests__/index.spec.tsx @@ -16,14 +16,16 @@ import { createMemoryHistory } from 'history'; import React from 'react'; import { Provider } from 'react-redux'; import { Store } from 'redux'; + +import { MIN_STEP_DURATION_MS, TIMEOUT_TO_GET_URL_SEC } from '@/components/WorkspaceProgress/const'; +import { WorkspaceParams } from '@/Routes/routes'; +import getComponentRenderer from '@/services/__mocks__/getComponentRenderer'; +import { getDefer } from '@/services/helpers/deferred'; +import { AlertItem } from '@/services/helpers/types'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; + import StartingStepOpenWorkspace from '..'; -import { WorkspaceParams } from '../../../../../Routes/routes'; -import { getDefer } from '../../../../../services/helpers/deferred'; -import { AlertItem } from '../../../../../services/helpers/types'; -import getComponentRenderer from '../../../../../services/__mocks__/getComponentRenderer'; -import { DevWorkspaceBuilder } from '../../../../../store/__mocks__/devWorkspaceBuilder'; -import { FakeStoreBuilder } from '../../../../../store/__mocks__/storeBuilder'; -import { MIN_STEP_DURATION_MS, TIMEOUT_TO_GET_URL_SEC } from '../../../const'; jest.mock('../../../TimeLimit'); diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/OpenWorkspace/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/OpenWorkspace/index.tsx index 930e55f81e..548bac6e8f 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/OpenWorkspace/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/OpenWorkspace/index.tsx @@ -15,22 +15,27 @@ import { AlertVariant } from '@patternfly/react-core'; import { isEqual } from 'lodash'; import React from 'react'; import { connect, ConnectedProps } from 'react-redux'; -import { WorkspaceParams } from '../../../../Routes/routes'; -import { isAvailableEndpoint } from '../../../../services/helpers/api-ping'; -import { findTargetWorkspace } from '../../../../services/helpers/factoryFlow/findTargetWorkspace'; -import { AlertItem, LoaderTab } from '../../../../services/helpers/types'; -import { Workspace } from '../../../../services/workspace-adapter'; -import { AppState } from '../../../../store'; -import * as WorkspaceStore from '../../../../store/Workspaces'; -import { selectAllWorkspaces } from '../../../../store/Workspaces/selectors'; -import { TIMEOUT_TO_GET_URL_SEC } from '../../const'; -import { ProgressStep, ProgressStepProps, ProgressStepState } from '../../ProgressStep'; -import { ProgressStepTitle } from '../../StepTitle'; -import { TimeLimit } from '../../TimeLimit'; + +import { TIMEOUT_TO_GET_URL_SEC } from '@/components/WorkspaceProgress/const'; +import { + ProgressStep, + ProgressStepProps, + ProgressStepState, +} from '@/components/WorkspaceProgress/ProgressStep'; import { applyRestartDefaultLocation, applyRestartInSafeModeLocation, -} from '../StartWorkspace/prepareRestart'; +} from '@/components/WorkspaceProgress/StartingSteps/StartWorkspace/prepareRestart'; +import { ProgressStepTitle } from '@/components/WorkspaceProgress/StepTitle'; +import { TimeLimit } from '@/components/WorkspaceProgress/TimeLimit'; +import { WorkspaceParams } from '@/Routes/routes'; +import { isAvailableEndpoint } from '@/services/helpers/api-ping'; +import { findTargetWorkspace } from '@/services/helpers/factoryFlow/findTargetWorkspace'; +import { AlertItem, LoaderTab } from '@/services/helpers/types'; +import { Workspace } from '@/services/workspace-adapter'; +import { AppState } from '@/store'; +import * as WorkspaceStore from '@/store/Workspaces'; +import { selectAllWorkspaces } from '@/store/Workspaces/selectors'; export type Props = MappedProps & ProgressStepProps & { diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/StartWorkspace/__mocks__/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/StartWorkspace/__mocks__/index.tsx index 26561d6cc2..0a497392b4 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/StartWorkspace/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/StartWorkspace/__mocks__/index.tsx @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { ProgressStep } from '../../../__mocks__/ProgressStep'; +import { ProgressStep } from '@/components/WorkspaceProgress/__mocks__/ProgressStep'; export default class StartingStepStartWorkspace extends ProgressStep { protected readonly name = 'Starting step: Start workspace'; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/StartWorkspace/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/StartWorkspace/__tests__/index.spec.tsx index 414f0037cd..7a83b6c929 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/StartWorkspace/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/StartWorkspace/__tests__/index.spec.tsx @@ -17,16 +17,18 @@ import { createMemoryHistory } from 'history'; import React from 'react'; import { Provider } from 'react-redux'; import { Action, Store } from 'redux'; + +import { MIN_STEP_DURATION_MS } from '@/components/WorkspaceProgress/const'; +import { WorkspaceParams } from '@/Routes/routes'; +import getComponentRenderer from '@/services/__mocks__/getComponentRenderer'; +import { getDefer } from '@/services/helpers/deferred'; +import { AlertItem } from '@/services/helpers/types'; +import { AppThunk } from '@/store'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { ActionCreators } from '@/store/Workspaces'; + import StartingStepStartWorkspace from '..'; -import { WorkspaceParams } from '../../../../../Routes/routes'; -import { getDefer } from '../../../../../services/helpers/deferred'; -import { AlertItem } from '../../../../../services/helpers/types'; -import getComponentRenderer from '../../../../../services/__mocks__/getComponentRenderer'; -import { AppThunk } from '../../../../../store'; -import { ActionCreators } from '../../../../../store/Workspaces'; -import { DevWorkspaceBuilder } from '../../../../../store/__mocks__/devWorkspaceBuilder'; -import { FakeStoreBuilder } from '../../../../../store/__mocks__/storeBuilder'; -import { MIN_STEP_DURATION_MS } from '../../../const'; jest.mock('../../../TimeLimit'); diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/StartWorkspace/__tests__/prepareRestart.spec.ts b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/StartWorkspace/__tests__/prepareRestart.spec.ts index 41fc7bc2eb..5268800c26 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/StartWorkspace/__tests__/prepareRestart.spec.ts +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/StartWorkspace/__tests__/prepareRestart.spec.ts @@ -11,14 +11,15 @@ */ import { Location } from 'history'; + import { applyRestartDefaultLocation, applyRestartInDebugModeLocation, applyRestartInSafeModeLocation, - getStartParams, getRestartInSafeModeLocation, + getStartParams, resetRestartInSafeModeLocation, -} from '../prepareRestart'; +} from '@/components/WorkspaceProgress/StartingSteps/StartWorkspace/prepareRestart'; describe('Prepare workspace start', () => { test('apply Safe Mode location', () => { diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/StartWorkspace/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/StartWorkspace/index.tsx index 8bd513afd6..a98cc1a4c5 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/StartWorkspace/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/StartWorkspace/index.tsx @@ -15,24 +15,29 @@ import { AlertVariant } from '@patternfly/react-core'; import { isEqual } from 'lodash'; import React from 'react'; import { connect, ConnectedProps } from 'react-redux'; -import { WorkspaceParams } from '../../../../Routes/routes'; -import { findTargetWorkspace } from '../../../../services/helpers/factoryFlow/findTargetWorkspace'; -import { AlertItem, DevWorkspaceStatus, LoaderTab } from '../../../../services/helpers/types'; -import { Workspace } from '../../../../services/workspace-adapter'; -import { AppState } from '../../../../store'; -import { selectStartTimeout } from '../../../../store/ServerConfig/selectors'; -import * as WorkspaceStore from '../../../../store/Workspaces'; -import { selectAllWorkspaces } from '../../../../store/Workspaces/selectors'; -import { ProgressStep, ProgressStepProps, ProgressStepState } from '../../ProgressStep'; -import { ProgressStepTitle } from '../../StepTitle'; -import { TimeLimit } from '../../TimeLimit'; -import workspaceStatusIs from '../../workspaceStatusIs'; + +import { + ProgressStep, + ProgressStepProps, + ProgressStepState, +} from '@/components/WorkspaceProgress/ProgressStep'; import { applyRestartDefaultLocation, applyRestartInSafeModeLocation, getStartParams, resetRestartInSafeModeLocation, -} from './prepareRestart'; +} from '@/components/WorkspaceProgress/StartingSteps/StartWorkspace/prepareRestart'; +import { ProgressStepTitle } from '@/components/WorkspaceProgress/StepTitle'; +import { TimeLimit } from '@/components/WorkspaceProgress/TimeLimit'; +import workspaceStatusIs from '@/components/WorkspaceProgress/workspaceStatusIs'; +import { WorkspaceParams } from '@/Routes/routes'; +import { findTargetWorkspace } from '@/services/helpers/factoryFlow/findTargetWorkspace'; +import { AlertItem, DevWorkspaceStatus, LoaderTab } from '@/services/helpers/types'; +import { Workspace } from '@/services/workspace-adapter'; +import { AppState } from '@/store'; +import { selectStartTimeout } from '@/store/ServerConfig/selectors'; +import * as WorkspaceStore from '@/store/Workspaces'; +import { selectAllWorkspaces } from '@/store/Workspaces/selectors'; export type Props = MappedProps & ProgressStepProps & { diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/StartWorkspace/prepareRestart.ts b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/StartWorkspace/prepareRestart.ts index 7bf406908c..16676c935a 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/StartWorkspace/prepareRestart.ts +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/StartWorkspace/prepareRestart.ts @@ -11,10 +11,11 @@ */ import { Location } from 'history'; + import { DEBUG_WORKSPACE_START, USE_DEFAULT_DEVFILE, -} from '../../../../services/helpers/factoryFlow/buildFactoryParams'; +} from '@/services/helpers/factoryFlow/buildFactoryParams'; export function applyRestartDefaultLocation(location: Location): void { const searchParams = new URLSearchParams(location.search); diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/WorkspaceConditions/__mocks__/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/WorkspaceConditions/__mocks__/index.tsx index 6e61b51870..2af92c9cc4 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/WorkspaceConditions/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/WorkspaceConditions/__mocks__/index.tsx @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { ProgressStep } from '../../../__mocks__/ProgressStep'; +import { ProgressStep } from '@/components/WorkspaceProgress/__mocks__/ProgressStep'; export default class StartingStepWorkspaceConditions extends ProgressStep { protected readonly name = 'Starting step: Workspace conditions'; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/WorkspaceConditions/__tests__/fixtures.ts b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/WorkspaceConditions/__tests__/fixtures.ts index 68cfccaaf7..6faee1ace2 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/WorkspaceConditions/__tests__/fixtures.ts +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/WorkspaceConditions/__tests__/fixtures.ts @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { ConditionType } from '../../../utils'; +import { ConditionType } from '@/components/WorkspaceProgress/utils'; export const conditionChangedTo: { [key: string]: [condition: ConditionType, prevCondition: ConditionType | undefined]; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/WorkspaceConditions/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/WorkspaceConditions/__tests__/index.spec.tsx index 0a7b9c9906..0c18497573 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/WorkspaceConditions/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/WorkspaceConditions/__tests__/index.spec.tsx @@ -15,16 +15,18 @@ import { screen, waitFor } from '@testing-library/react'; import { createMemoryHistory } from 'history'; import React from 'react'; -import StartingStepWorkspaceConditions from '..'; -import { WorkspaceParams } from '../../../../../Routes/routes'; -import getComponentRenderer from '../../../../../services/__mocks__/getComponentRenderer'; -import { ConditionType } from '../../../utils'; + import { conditionChangedTo, conditionError, conditionStatusFalse, conditionStatusTrue, -} from './fixtures'; +} from '@/components/WorkspaceProgress/StartingSteps/WorkspaceConditions/__tests__/fixtures'; +import { ConditionType } from '@/components/WorkspaceProgress/utils'; +import { WorkspaceParams } from '@/Routes/routes'; +import getComponentRenderer from '@/services/__mocks__/getComponentRenderer'; + +import StartingStepWorkspaceConditions from '..'; jest.mock('../../../TimeLimit'); jest.mock('../../../StepTitle'); diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/WorkspaceConditions/__tests__/utils.spec.ts b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/WorkspaceConditions/__tests__/utils.spec.ts index 9e1ff65c8c..9e672faa79 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/WorkspaceConditions/__tests__/utils.spec.ts +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/WorkspaceConditions/__tests__/utils.spec.ts @@ -10,14 +10,14 @@ * Red Hat, Inc. - initial API and implementation */ -import { isConditionReady, isConditionError } from '../../../utils'; import { conditionChangedTo, conditionError, conditionStatusFalse, conditionStatusTrue, conditionStatusUnknown, -} from './fixtures'; +} from '@/components/WorkspaceProgress/StartingSteps/WorkspaceConditions/__tests__/fixtures'; +import { isConditionError, isConditionReady } from '@/components/WorkspaceProgress/utils'; describe('utils', () => { test('isReady', () => { diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/WorkspaceConditions/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/WorkspaceConditions/index.tsx index 029879d5e8..840452f0ee 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/WorkspaceConditions/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/StartingSteps/WorkspaceConditions/index.tsx @@ -14,13 +14,21 @@ import common from '@eclipse-che/common'; import { AlertVariant } from '@patternfly/react-core'; import isEqual from 'lodash/isEqual'; import React from 'react'; -import { WorkspaceParams } from '../../../../Routes/routes'; -import { AlertItem, LoaderTab } from '../../../../services/helpers/types'; -import { ProgressStep, ProgressStepProps, ProgressStepState } from '../../ProgressStep'; -import { ProgressStepTitle } from '../../StepTitle'; -import { ConditionType, isConditionError, isConditionReady } from '../../utils'; -import styles from './index.module.css'; +import { + ProgressStep, + ProgressStepProps, + ProgressStepState, +} from '@/components/WorkspaceProgress/ProgressStep'; +import styles from '@/components/WorkspaceProgress/StartingSteps/WorkspaceConditions/index.module.css'; +import { ProgressStepTitle } from '@/components/WorkspaceProgress/StepTitle'; +import { + ConditionType, + isConditionError, + isConditionReady, +} from '@/components/WorkspaceProgress/utils'; +import { WorkspaceParams } from '@/Routes/routes'; +import { AlertItem, LoaderTab } from '@/services/helpers/types'; export type Props = ProgressStepProps & { condition: ConditionType; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/StepTitle/Icon/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/StepTitle/Icon/__tests__/index.spec.tsx index 1e4c044eea..adc3a43748 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/StepTitle/Icon/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/StepTitle/Icon/__tests__/index.spec.tsx @@ -11,8 +11,10 @@ */ import React from 'react'; + +import getComponentRenderer from '@/services/__mocks__/getComponentRenderer'; + import { ProgressStepTitleIcon } from '..'; -import getComponentRenderer from '../../../../../services/__mocks__/getComponentRenderer'; const { createSnapshot } = getComponentRenderer(getComponent); diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/StepTitle/Icon/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/StepTitle/Icon/index.tsx index 47ea6e7d21..df00da3262 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/StepTitle/Icon/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/StepTitle/Icon/index.tsx @@ -18,8 +18,8 @@ import { } from '@patternfly/react-icons'; import React from 'react'; -import styles from './index.module.css'; -import workspaceStatusLabelStyles from '../../../WorkspaceStatusLabel/index.module.css'; +import styles from '@/components/WorkspaceProgress/StepTitle/Icon/index.module.css'; +import workspaceStatusLabelStyles from '@/components/WorkspaceStatusLabel/index.module.css'; type Props = { distance: -1 | 0 | 1 | undefined; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/StepTitle/__mocks__/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/StepTitle/__mocks__/index.tsx index e4cd506563..21ca8da500 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/StepTitle/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/StepTitle/__mocks__/index.tsx @@ -11,7 +11,8 @@ */ import React from 'react'; -import { Props } from '../'; + +import { Props } from '@/components/WorkspaceProgress/StepTitle'; export class ProgressStepTitle extends React.Component { render(): React.ReactElement { diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/StepTitle/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/StepTitle/__tests__/index.spec.tsx index d85b6ea4ae..8c3cad8618 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/StepTitle/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/StepTitle/__tests__/index.spec.tsx @@ -11,8 +11,10 @@ */ import React from 'react'; + +import getComponentRenderer from '@/services/__mocks__/getComponentRenderer'; + import { ProgressStepTitle } from '..'; -import getComponentRenderer from '../../../../services/__mocks__/getComponentRenderer'; const { createSnapshot } = getComponentRenderer(getComponent); diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/StepTitle/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/StepTitle/index.tsx index 3510f997c3..cee5e36c1d 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/StepTitle/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/StepTitle/index.tsx @@ -11,9 +11,9 @@ */ import React, { PropsWithChildren } from 'react'; -import { ProgressStepTitleIcon } from './Icon'; -import styles from './index.module.css'; +import { ProgressStepTitleIcon } from '@/components/WorkspaceProgress/StepTitle/Icon'; +import styles from '@/components/WorkspaceProgress/StepTitle/index.module.css'; export type Props = PropsWithChildren<{ className?: string; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/TimeLimit/__mocks__/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/TimeLimit/__mocks__/index.tsx index 3ed5e99cd7..70254dde4c 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/TimeLimit/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/TimeLimit/__mocks__/index.tsx @@ -11,6 +11,7 @@ */ import React from 'react'; + import { Props } from '..'; export class TimeLimit extends React.Component { diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/TimeLimit/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/TimeLimit/__tests__/index.spec.tsx index b699bf71f7..848f5145c2 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/TimeLimit/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/TimeLimit/__tests__/index.spec.tsx @@ -11,7 +11,9 @@ */ import React from 'react'; -import getComponentRenderer from '../../../../services/__mocks__/getComponentRenderer'; + +import getComponentRenderer from '@/services/__mocks__/getComponentRenderer'; + import { TimeLimit } from '..'; const { renderComponent } = getComponentRenderer(getComponent); diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/TimeLimit/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/TimeLimit/index.tsx index c639a5829f..d6c625e4b9 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/TimeLimit/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/TimeLimit/index.tsx @@ -10,9 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ -import { DisposableCollection } from '../../../services/helpers/disposable'; import React from 'react'; +import { DisposableCollection } from '@/services/helpers/disposable'; + export type Props = { timeLimitSec: number; onTimeout: () => void; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/Wizard/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/Wizard/__tests__/index.spec.tsx index 1fdcf3969d..fc6d414921 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/Wizard/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/Wizard/__tests__/index.spec.tsx @@ -11,9 +11,11 @@ */ import React from 'react'; + +import { Step, StepId } from '@/components/WorkspaceProgress'; +import getComponentRenderer, { screen } from '@/services/__mocks__/getComponentRenderer'; + import WorkspaceProgressWizard, { WorkspaceProgressWizardStep } from '..'; -import { Step, StepId } from '../..'; -import getComponentRenderer, { screen } from '../../../../services/__mocks__/getComponentRenderer'; const mockGoToNext = jest.fn(); diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/Wizard/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/Wizard/index.tsx index 474dec14b6..41775abc3f 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/Wizard/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/Wizard/index.tsx @@ -13,8 +13,10 @@ import * as PF from '@patternfly/react-core'; import wizardStyles from '@patternfly/react-styles/css/components/Wizard/wizard'; import React from 'react'; + +import styles from '@/components/WorkspaceProgress/Wizard/index.module.css'; + import { StepId } from '..'; -import styles from './index.module.css'; export interface WorkspaceProgressWizardStep extends PF.WizardStep { id: StepId; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/__mocks__/ProgressStep.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/__mocks__/ProgressStep.tsx index f7e144e82e..0181a65da3 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/__mocks__/ProgressStep.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/__mocks__/ProgressStep.tsx @@ -12,8 +12,9 @@ import { AlertVariant } from '@patternfly/react-core'; import React from 'react'; -import { AlertItem } from '../../../services/helpers/types'; -import { ProgressStepProps, ProgressStepState } from '../ProgressStep'; + +import { ProgressStepProps, ProgressStepState } from '@/components/WorkspaceProgress/ProgressStep'; +import { AlertItem } from '@/services/helpers/types'; export class ProgressStep extends React.Component { protected readonly name: string; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/__tests__/index.spec.tsx index 9396e30600..03a42f08ca 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/__tests__/index.spec.tsx @@ -16,23 +16,25 @@ import { createMemoryHistory, History, MemoryHistory } from 'history'; import React from 'react'; import { Provider } from 'react-redux'; import { Store } from 'redux'; -import Progress, { State, Step } from '..'; -import { ROUTE } from '../../../Routes/routes'; -import devfileApi from '../../../services/devfileApi'; -import { - buildFactoryParams, - DEV_WORKSPACE_ATTR, - FACTORY_URL_ATTR, -} from '../../../services/helpers/factoryFlow/buildFactoryParams'; -import { buildIdeLoaderLocation } from '../../../services/helpers/location'; -import { constructWorkspace } from '../../../services/workspace-adapter'; + +import { ROUTE } from '@/Routes/routes'; import getComponentRenderer, { screen, waitFor, within, -} from '../../../services/__mocks__/getComponentRenderer'; -import { DevWorkspaceBuilder } from '../../../store/__mocks__/devWorkspaceBuilder'; -import { FakeStoreBuilder } from '../../../store/__mocks__/storeBuilder'; +} from '@/services/__mocks__/getComponentRenderer'; +import devfileApi from '@/services/devfileApi'; +import { + buildFactoryParams, + DEV_WORKSPACE_ATTR, + FACTORY_URL_ATTR, +} from '@/services/helpers/factoryFlow/buildFactoryParams'; +import { buildIdeLoaderLocation } from '@/services/helpers/location'; +import { constructWorkspace } from '@/services/workspace-adapter'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; + +import Progress, { State, Step } from '..'; jest.mock('../CommonSteps/CheckRunningWorkspacesLimit'); jest.mock('../CreatingSteps/Apply/Devfile'); diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceProgress/index.tsx index 828e5ff21a..66c4e9ba54 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/index.tsx @@ -15,32 +15,35 @@ import { History } from 'history'; import isEqual from 'lodash/isEqual'; import React from 'react'; import { connect, ConnectedProps } from 'react-redux'; + +import { ProgressAlert } from '@/components/WorkspaceProgress/Alert'; +import CommonStepCheckRunningWorkspacesLimit from '@/components/WorkspaceProgress/CommonSteps/CheckRunningWorkspacesLimit'; +import CreatingStepApplyDevfile from '@/components/WorkspaceProgress/CreatingSteps/Apply/Devfile'; +import CreatingStepApplyResources from '@/components/WorkspaceProgress/CreatingSteps/Apply/Resources'; +import CreatingStepCheckExistingWorkspaces from '@/components/WorkspaceProgress/CreatingSteps/CheckExistingWorkspaces'; +import CreatingStepCreateWorkspace from '@/components/WorkspaceProgress/CreatingSteps/CreateWorkspace'; +import CreatingStepFetchDevfile from '@/components/WorkspaceProgress/CreatingSteps/Fetch/Devfile'; +import CreatingStepFetchResources from '@/components/WorkspaceProgress/CreatingSteps/Fetch/Resources'; +import CreatingStepInitialize from '@/components/WorkspaceProgress/CreatingSteps/Initialize'; +import StartingStepInitialize from '@/components/WorkspaceProgress/StartingSteps/Initialize'; +import StartingStepOpenWorkspace from '@/components/WorkspaceProgress/StartingSteps/OpenWorkspace'; +import StartingStepStartWorkspace from '@/components/WorkspaceProgress/StartingSteps/StartWorkspace'; +import StartingStepWorkspaceConditions from '@/components/WorkspaceProgress/StartingSteps/WorkspaceConditions'; +import { ConditionType, isWorkspaceStatusCondition } from '@/components/WorkspaceProgress/utils'; +import WorkspaceProgressWizard, { + WorkspaceProgressWizardStep, +} from '@/components/WorkspaceProgress/Wizard'; import { buildFactoryParams, FactoryParams, -} from '../../services/helpers/factoryFlow/buildFactoryParams'; -import { findTargetWorkspace } from '../../services/helpers/factoryFlow/findTargetWorkspace'; -import { getLoaderMode, LoaderMode } from '../../services/helpers/factoryFlow/getLoaderMode'; -import { AlertItem, DevWorkspaceStatus, LoaderTab } from '../../services/helpers/types'; -import { Workspace } from '../../services/workspace-adapter'; -import { AppState } from '../../store'; -import * as WorkspaceStore from '../../store/Workspaces'; -import { selectAllWorkspaces } from '../../store/Workspaces/selectors'; -import { ProgressAlert } from './Alert'; -import CommonStepCheckRunningWorkspacesLimit from './CommonSteps/CheckRunningWorkspacesLimit'; -import CreatingStepApplyDevfile from './CreatingSteps/Apply/Devfile'; -import CreatingStepApplyResources from './CreatingSteps/Apply/Resources'; -import CreatingStepCheckExistingWorkspaces from './CreatingSteps/CheckExistingWorkspaces'; -import CreatingStepCreateWorkspace from './CreatingSteps/CreateWorkspace'; -import CreatingStepFetchDevfile from './CreatingSteps/Fetch/Devfile'; -import CreatingStepFetchResources from './CreatingSteps/Fetch/Resources'; -import CreatingStepInitialize from './CreatingSteps/Initialize'; -import StartingStepInitialize from './StartingSteps/Initialize'; -import StartingStepOpenWorkspace from './StartingSteps/OpenWorkspace'; -import StartingStepStartWorkspace from './StartingSteps/StartWorkspace'; -import StartingStepWorkspaceConditions from './StartingSteps/WorkspaceConditions'; -import { ConditionType, isWorkspaceStatusCondition } from './utils'; -import WorkspaceProgressWizard, { WorkspaceProgressWizardStep } from './Wizard'; +} from '@/services/helpers/factoryFlow/buildFactoryParams'; +import { findTargetWorkspace } from '@/services/helpers/factoryFlow/findTargetWorkspace'; +import { getLoaderMode, LoaderMode } from '@/services/helpers/factoryFlow/getLoaderMode'; +import { AlertItem, DevWorkspaceStatus, LoaderTab } from '@/services/helpers/types'; +import { Workspace } from '@/services/workspace-adapter'; +import { AppState } from '@/store'; +import * as WorkspaceStore from '@/store/Workspaces'; +import { selectAllWorkspaces } from '@/store/Workspaces/selectors'; export type Props = MappedProps & { history: History; diff --git a/packages/dashboard-frontend/src/components/WorkspaceProgress/workspaceStatusIs.ts b/packages/dashboard-frontend/src/components/WorkspaceProgress/workspaceStatusIs.ts index f424c64d97..87743acbe1 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceProgress/workspaceStatusIs.ts +++ b/packages/dashboard-frontend/src/components/WorkspaceProgress/workspaceStatusIs.ts @@ -10,8 +10,8 @@ * Red Hat, Inc. - initial API and implementation */ -import { DevWorkspaceStatus } from '../../services/helpers/types'; -import { Workspace } from '../../services/workspace-adapter'; +import { DevWorkspaceStatus } from '@/services/helpers/types'; +import { Workspace } from '@/services/workspace-adapter'; export default function workspaceStatusIs( workspace: Workspace, diff --git a/packages/dashboard-frontend/src/components/WorkspaceStatusLabel/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/WorkspaceStatusLabel/__tests__/index.spec.tsx index d9ffce6ab6..806c9db6af 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceStatusLabel/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceStatusLabel/__tests__/index.spec.tsx @@ -12,8 +12,10 @@ import React from 'react'; import renderer from 'react-test-renderer'; + +import { DevWorkspaceStatus, WorkspaceStatus } from '@/services/helpers/types'; + import WorkspaceStatusLabel from '..'; -import { WorkspaceStatus, DevWorkspaceStatus } from '../../../services/helpers/types'; jest.mock('react-tooltip', () => { return function DummyTooltip(): React.ReactElement { diff --git a/packages/dashboard-frontend/src/components/WorkspaceStatusLabel/index.tsx b/packages/dashboard-frontend/src/components/WorkspaceStatusLabel/index.tsx index 503e105c0d..5bb5fcc6e2 100644 --- a/packages/dashboard-frontend/src/components/WorkspaceStatusLabel/index.tsx +++ b/packages/dashboard-frontend/src/components/WorkspaceStatusLabel/index.tsx @@ -19,12 +19,13 @@ import { } from '@patternfly/react-icons'; import React from 'react'; import ReactTooltip from 'react-tooltip'; + +import styles from '@/components/WorkspaceStatusLabel/index.module.css'; import { DeprecatedWorkspaceStatus, DevWorkspaceStatus, WorkspaceStatus, -} from '../../services/helpers/types'; -import styles from './index.module.css'; +} from '@/services/helpers/types'; // stopped icon color const grey = window diff --git a/packages/dashboard-frontend/src/containers/Loader/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/containers/Loader/__tests__/index.spec.tsx index 7d9796c19d..460b8c34b6 100644 --- a/packages/dashboard-frontend/src/containers/Loader/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/containers/Loader/__tests__/index.spec.tsx @@ -16,13 +16,15 @@ import React from 'react'; import { Provider } from 'react-redux'; import { RouteComponentProps } from 'react-router'; import { Store } from 'redux'; + +import { ROUTE } from '@/Routes/routes'; +import getComponentRenderer from '@/services/__mocks__/getComponentRenderer'; +import { getMockRouterProps } from '@/services/__mocks__/router'; +import { constructWorkspace } from '@/services/workspace-adapter'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; + import LoaderContainer from '..'; -import { ROUTE } from '../../../Routes/routes'; -import { constructWorkspace } from '../../../services/workspace-adapter'; -import getComponentRenderer from '../../../services/__mocks__/getComponentRenderer'; -import { getMockRouterProps } from '../../../services/__mocks__/router'; -import { DevWorkspaceBuilder } from '../../../store/__mocks__/devWorkspaceBuilder'; -import { FakeStoreBuilder } from '../../../store/__mocks__/storeBuilder'; jest.mock('../../../pages/Loader'); diff --git a/packages/dashboard-frontend/src/containers/Loader/index.tsx b/packages/dashboard-frontend/src/containers/Loader/index.tsx index 3091c974cb..bcb4c6f024 100644 --- a/packages/dashboard-frontend/src/containers/Loader/index.tsx +++ b/packages/dashboard-frontend/src/containers/Loader/index.tsx @@ -14,13 +14,14 @@ import { helpers } from '@eclipse-che/common'; import React from 'react'; import { connect, ConnectedProps } from 'react-redux'; import { RouteComponentProps } from 'react-router-dom'; -import { LoaderPage } from '../../pages/Loader'; -import { findTargetWorkspace } from '../../services/helpers/factoryFlow/findTargetWorkspace'; -import { getLoaderMode } from '../../services/helpers/factoryFlow/getLoaderMode'; -import { LoaderTab } from '../../services/helpers/types'; -import { Workspace } from '../../services/workspace-adapter'; -import { AppState } from '../../store'; -import { selectAllWorkspaces } from '../../store/Workspaces/selectors'; + +import { LoaderPage } from '@/pages/Loader'; +import { findTargetWorkspace } from '@/services/helpers/factoryFlow/findTargetWorkspace'; +import { getLoaderMode } from '@/services/helpers/factoryFlow/getLoaderMode'; +import { LoaderTab } from '@/services/helpers/types'; +import { Workspace } from '@/services/workspace-adapter'; +import { AppState } from '@/store'; +import { selectAllWorkspaces } from '@/store/Workspaces/selectors'; export type Props = MappedProps & RouteComponentProps; export type State = { diff --git a/packages/dashboard-frontend/src/containers/WorkspaceDetails/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/containers/WorkspaceDetails/__tests__/index.spec.tsx index 0011e58184..4d8111de5e 100644 --- a/packages/dashboard-frontend/src/containers/WorkspaceDetails/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/containers/WorkspaceDetails/__tests__/index.spec.tsx @@ -10,21 +10,20 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { render, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; +import React from 'react'; import { Provider } from 'react-redux'; import { RouteComponentProps } from 'react-router'; + +import { ROUTE } from '@/Routes/routes'; +import { getMockRouterProps } from '@/services/__mocks__/router'; +import { constructWorkspace, WorkspaceAdapter } from '@/services/workspace-adapter'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { ActionCreators, actionCreators as workspacesActionCreators } from '@/store/Workspaces'; + import WorkspaceDetailsContainer from '..'; -import { getMockRouterProps } from '../../../services/__mocks__/router'; -import { ROUTE } from '../../../Routes/routes'; -import { FakeStoreBuilder } from '../../../store/__mocks__/storeBuilder'; -import { constructWorkspace, WorkspaceAdapter } from '../../../services/workspace-adapter'; -import { - ActionCreators, - actionCreators as workspacesActionCreators, -} from '../../../store/Workspaces'; -import { DevWorkspaceBuilder } from '../../../store/__mocks__/devWorkspaceBuilder'; const mockUpdateWorkspace = jest.fn(); diff --git a/packages/dashboard-frontend/src/containers/WorkspaceDetails/index.tsx b/packages/dashboard-frontend/src/containers/WorkspaceDetails/index.tsx index 66555369a4..79efc9f2bc 100644 --- a/packages/dashboard-frontend/src/containers/WorkspaceDetails/index.tsx +++ b/packages/dashboard-frontend/src/containers/WorkspaceDetails/index.tsx @@ -11,24 +11,21 @@ */ import { Location } from 'history'; +import { isEqual } from 'lodash'; import React from 'react'; import { connect, ConnectedProps } from 'react-redux'; import { RouteComponentProps } from 'react-router'; -import { WorkspaceDetails } from '../../pages/WorkspaceDetails'; -import { - buildDetailsLocation, - toHref, - buildWorkspacesLocation, -} from '../../services/helpers/location'; -import { WorkspaceDetailsTab } from '../../services/helpers/types'; -import { Workspace } from '../../services/workspace-adapter'; -import { AppState } from '../../store'; -import * as WorkspacesStore from '../../store/Workspaces'; -import { selectAllWorkspaces, selectIsLoading } from '../../store/Workspaces/selectors'; -import { isDevWorkspace } from '../../services/devfileApi'; -import { DEVWORKSPACE_ID_OVERRIDE_ANNOTATION } from '../../services/devfileApi/devWorkspace/metadata'; -import { selectDefaultNamespace } from '../../store/InfrastructureNamespaces/selectors'; -import { isEqual } from 'lodash'; + +import { WorkspaceDetails } from '@/pages/WorkspaceDetails'; +import { isDevWorkspace } from '@/services/devfileApi'; +import { DEVWORKSPACE_ID_OVERRIDE_ANNOTATION } from '@/services/devfileApi/devWorkspace/metadata'; +import { buildDetailsLocation, buildWorkspacesLocation, toHref } from '@/services/helpers/location'; +import { WorkspaceDetailsTab } from '@/services/helpers/types'; +import { Workspace } from '@/services/workspace-adapter'; +import { AppState } from '@/store'; +import { selectDefaultNamespace } from '@/store/InfrastructureNamespaces/selectors'; +import * as WorkspacesStore from '@/store/Workspaces'; +import { selectAllWorkspaces, selectIsLoading } from '@/store/Workspaces/selectors'; type Props = MappedProps & RouteComponentProps<{ diff --git a/packages/dashboard-frontend/src/containers/WorkspacesList.tsx b/packages/dashboard-frontend/src/containers/WorkspacesList.tsx index c2bd2d8a8d..872f756e81 100644 --- a/packages/dashboard-frontend/src/containers/WorkspacesList.tsx +++ b/packages/dashboard-frontend/src/containers/WorkspacesList.tsx @@ -10,19 +10,20 @@ * Red Hat, Inc. - initial API and implementation */ +import { History } from 'history'; import React from 'react'; import { connect, ConnectedProps } from 'react-redux'; -import { History } from 'history'; -import { AppState } from '../store'; -import { selectAllWorkspaces, selectIsLoading } from '../store/Workspaces/selectors'; -import * as WorkspacesStore from '../store/Workspaces'; -import Fallback from '../components/Fallback'; -import WorkspacesList from '../pages/WorkspacesList'; -import WorkspaceActionsProvider from '../contexts/WorkspaceActions/Provider'; -import { WorkspaceActionsConsumer } from '../contexts/WorkspaceActions'; -import { lazyInject } from '../inversify.config'; -import { AppAlerts } from '../services/alerts/appAlerts'; -import { selectBranding } from '../store/Branding/selectors'; + +import Fallback from '@/components/Fallback'; +import { WorkspaceActionsConsumer } from '@/contexts/WorkspaceActions'; +import WorkspaceActionsProvider from '@/contexts/WorkspaceActions/Provider'; +import { lazyInject } from '@/inversify.config'; +import WorkspacesList from '@/pages/WorkspacesList'; +import { AppAlerts } from '@/services/alerts/appAlerts'; +import { AppState } from '@/store'; +import { selectBranding } from '@/store/Branding/selectors'; +import * as WorkspacesStore from '@/store/Workspaces'; +import { selectAllWorkspaces, selectIsLoading } from '@/store/Workspaces/selectors'; type Props = MappedProps & { history: History }; diff --git a/packages/dashboard-frontend/src/containers/__tests__/WorkspacesList.spec.tsx b/packages/dashboard-frontend/src/containers/__tests__/WorkspacesList.spec.tsx index 40ec843937..24602db60a 100644 --- a/packages/dashboard-frontend/src/containers/__tests__/WorkspacesList.spec.tsx +++ b/packages/dashboard-frontend/src/containers/__tests__/WorkspacesList.spec.tsx @@ -11,17 +11,19 @@ */ import 'reflect-metadata'; + +import { render, RenderResult, screen } from '@testing-library/react'; +import { createHashHistory } from 'history'; import React from 'react'; import { Provider } from 'react-redux'; -import { RenderResult, render, screen } from '@testing-library/react'; -import { createHashHistory } from 'history'; -import { AppThunk } from '../../store'; import { Action, Store } from 'redux'; -import { ActionCreators } from '../../store/Workspaces'; -import WorkspacesList from '../WorkspacesList'; -import { FakeStoreBuilder } from '../../store/__mocks__/storeBuilder'; -import { DevWorkspaceBuilder } from '../../store/__mocks__/devWorkspaceBuilder'; -import { Workspace } from '../../services/workspace-adapter'; + +import WorkspacesList from '@/containers/WorkspacesList'; +import { Workspace } from '@/services/workspace-adapter'; +import { AppThunk } from '@/store'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { ActionCreators } from '@/store/Workspaces'; jest.mock('../../store/Workspaces/index', () => { return { diff --git a/packages/dashboard-frontend/src/contexts/ToggleBars/__mocks__/index.tsx b/packages/dashboard-frontend/src/contexts/ToggleBars/__mocks__/index.tsx index bd792e4ed3..0066a3a0ee 100644 --- a/packages/dashboard-frontend/src/contexts/ToggleBars/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/contexts/ToggleBars/__mocks__/index.tsx @@ -11,6 +11,7 @@ */ import React from 'react'; + import { ToggleBarsType } from '..'; /* istanbul ignore next */ diff --git a/packages/dashboard-frontend/src/contexts/WorkspaceActions/Provider.tsx b/packages/dashboard-frontend/src/contexts/WorkspaceActions/Provider.tsx index 7ca372db90..e1bbc22089 100644 --- a/packages/dashboard-frontend/src/contexts/WorkspaceActions/Provider.tsx +++ b/packages/dashboard-frontend/src/contexts/WorkspaceActions/Provider.tsx @@ -10,9 +10,6 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; -import { History, Location } from 'history'; -import { connect, ConnectedProps } from 'react-redux'; import { Button, ButtonVariant, @@ -23,18 +20,23 @@ import { TextContent, TextVariants, } from '@patternfly/react-core'; +import { History, Location } from 'history'; +import React from 'react'; +import { connect, ConnectedProps } from 'react-redux'; + import { buildDetailsLocation, buildIdeLoaderLocation, buildWorkspacesLocation, toHref, -} from '../../services/helpers/location'; -import { LoaderTab, WorkspaceAction, WorkspaceDetailsTab } from '../../services/helpers/types'; -import { AppState } from '../../store'; -import { selectAllWorkspaces } from '../../store/Workspaces/selectors'; -import * as WorkspacesStore from '../../store/Workspaces'; +} from '@/services/helpers/location'; +import { LoaderTab, WorkspaceAction, WorkspaceDetailsTab } from '@/services/helpers/types'; +import { Workspace } from '@/services/workspace-adapter'; +import { AppState } from '@/store'; +import * as WorkspacesStore from '@/store/Workspaces'; +import { selectAllWorkspaces } from '@/store/Workspaces/selectors'; + import { WorkspaceActionsContext } from '.'; -import { Workspace } from '../../services/workspace-adapter'; type Deferred = { resolve: () => void; diff --git a/packages/dashboard-frontend/src/contexts/WorkspaceActions/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/contexts/WorkspaceActions/__tests__/index.spec.tsx index 38cb48843c..cac5deb451 100644 --- a/packages/dashboard-frontend/src/contexts/WorkspaceActions/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/contexts/WorkspaceActions/__tests__/index.spec.tsx @@ -10,20 +10,22 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; -import { Action, Store } from 'redux'; -import { Provider } from 'react-redux'; import { render, RenderResult, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import WorkspaceActionsProvider from '../Provider'; -import { WorkspaceAction } from '../../../services/helpers/types'; -import { ActionContextType, WorkspaceActionsConsumer } from '..'; -import { FakeStoreBuilder } from '../../../store/__mocks__/storeBuilder'; -import { ActionCreators } from '../../../store/Workspaces'; -import { AppThunk } from '../../../store'; -import { Workspace } from '../../../services/workspace-adapter'; import { createHashHistory } from 'history'; -import { DevWorkspaceBuilder } from '../../../store/__mocks__/devWorkspaceBuilder'; +import React from 'react'; +import { Provider } from 'react-redux'; +import { Action, Store } from 'redux'; + +import WorkspaceActionsProvider from '@/contexts/WorkspaceActions/Provider'; +import { WorkspaceAction } from '@/services/helpers/types'; +import { Workspace } from '@/services/workspace-adapter'; +import { AppThunk } from '@/store'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { ActionCreators } from '@/store/Workspaces'; + +import { ActionContextType, WorkspaceActionsConsumer } from '..'; jest.mock('../../../store/Workspaces/index', () => { /* eslint-disable @typescript-eslint/no-unused-vars */ diff --git a/packages/dashboard-frontend/src/contexts/WorkspaceActions/index.tsx b/packages/dashboard-frontend/src/contexts/WorkspaceActions/index.tsx index 57a6893f51..329fc1c980 100644 --- a/packages/dashboard-frontend/src/contexts/WorkspaceActions/index.tsx +++ b/packages/dashboard-frontend/src/contexts/WorkspaceActions/index.tsx @@ -10,9 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { Location } from 'history'; -import { WorkspaceAction } from '../../services/helpers/types'; +import React from 'react'; + +import { WorkspaceAction } from '@/services/helpers/types'; export type ActionContextType = { handleAction: (action: WorkspaceAction, uid: string) => Promise; diff --git a/packages/dashboard-frontend/src/index.tsx b/packages/dashboard-frontend/src/index.tsx index 8bb00ff640..f17a855f4c 100644 --- a/packages/dashboard-frontend/src/index.tsx +++ b/packages/dashboard-frontend/src/index.tsx @@ -11,16 +11,17 @@ */ import '@patternfly/react-core/dist/styles/base.css'; +import 'reflect-metadata'; +import '@/overrides.css'; + import { createHashHistory } from 'history'; import React from 'react'; import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; -import 'reflect-metadata'; -import App from './App'; -import PreloadData from './services/bootstrap'; -import configureStore from './store/configureStore'; -import './overrides.css'; +import App from '@/App'; +import PreloadData from '@/services/bootstrap'; +import configureStore from '@/store/configureStore'; startApp(); diff --git a/packages/dashboard-frontend/src/inversify.config.ts b/packages/dashboard-frontend/src/inversify.config.ts index 601d8faf45..4f23a2946d 100644 --- a/packages/dashboard-frontend/src/inversify.config.ts +++ b/packages/dashboard-frontend/src/inversify.config.ts @@ -11,15 +11,17 @@ */ import 'reflect-metadata'; + import { Container } from 'inversify'; import getDecorators from 'inversify-inject-decorators'; -import { CheWorkspaceClient } from './services/workspace-client/cheworkspace/cheWorkspaceClient'; -import { AppAlerts } from './services/alerts/appAlerts'; -import { IssuesReporterService } from './services/bootstrap/issuesReporter'; -import { DevWorkspaceClient } from './services/workspace-client/devworkspace/devWorkspaceClient'; -import { DevWorkspaceDefaultPluginsHandler } from './services/workspace-client/devworkspace/DevWorkspaceDefaultPluginsHandler'; -import { WorkspaceStoppedDetector } from './services/bootstrap/workspaceStoppedDetector'; -import { WebsocketClient } from './services/dashboard-backend-client/websocketClient'; + +import { AppAlerts } from '@/services/alerts/appAlerts'; +import { IssuesReporterService } from '@/services/bootstrap/issuesReporter'; +import { WorkspaceStoppedDetector } from '@/services/bootstrap/workspaceStoppedDetector'; +import { WebsocketClient } from '@/services/dashboard-backend-client/websocketClient'; +import { CheWorkspaceClient } from '@/services/workspace-client/cheworkspace/cheWorkspaceClient'; +import { DevWorkspaceClient } from '@/services/workspace-client/devworkspace/devWorkspaceClient'; +import { DevWorkspaceDefaultPluginsHandler } from '@/services/workspace-client/devworkspace/DevWorkspaceDefaultPluginsHandler'; const container = new Container(); const { lazyInject } = getDecorators(container); diff --git a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/DropdownEditors/index.tsx b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/DropdownEditors/index.tsx index f8dcc0c1f9..195c1679cb 100644 --- a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/DropdownEditors/index.tsx +++ b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/DropdownEditors/index.tsx @@ -10,13 +10,13 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; -import { TargetEditor } from '../SamplesListGallery'; -import { CheckIcon } from '@patternfly/react-icons'; import { DropdownGroup, DropdownItem } from '@patternfly/react-core'; -import TagLabel from '../../../../components/TagLabel'; +import { CheckIcon } from '@patternfly/react-icons'; +import React from 'react'; -import styles from './index.module.css'; +import TagLabel from '@/components/TagLabel'; +import styles from '@/pages/GetStarted/GetStartedTab/DropdownEditors/index.module.css'; +import { TargetEditor } from '@/pages/GetStarted/GetStartedTab/SamplesListGallery'; type Props = { targetEditors: TargetEditor[]; diff --git a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/ImportFromGit/GitRepoLocationInput.tsx b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/ImportFromGit/GitRepoLocationInput.tsx index 4ea52209f9..2aba8efe0f 100644 --- a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/ImportFromGit/GitRepoLocationInput.tsx +++ b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/ImportFromGit/GitRepoLocationInput.tsx @@ -10,22 +10,23 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { Button, ButtonVariant, - TextInput, - ValidatedOptions, Flex, FlexItem, Form, FormGroup, Text, - TextVariants, TextContent, + TextInput, + TextVariants, + ValidatedOptions, } from '@patternfly/react-core'; import { ExclamationCircleIcon } from '@patternfly/react-icons'; -import { FactoryLocationAdapter } from '../../../../services/factory-location-adapter'; +import React from 'react'; + +import { FactoryLocationAdapter } from '@/services/factory-location-adapter'; const ERROR_PATTERN_MISMATCH = 'The URL or SSHLocation is not valid.'; const ERROR_FAILED_LOAD = 'Failed to load the devfile.'; diff --git a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/ImportFromGit/index.tsx b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/ImportFromGit/index.tsx index 1363c6bca5..e7ec5d66e1 100644 --- a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/ImportFromGit/index.tsx +++ b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/ImportFromGit/index.tsx @@ -10,14 +10,15 @@ * Red Hat, Inc. - initial API and implementation */ +import { Flex, FlexItem, FormGroup, Text, TextContent, TextVariants } from '@patternfly/react-core'; import React from 'react'; import { connect, ConnectedProps } from 'react-redux'; -import { Flex, FlexItem, FormGroup, Text, TextContent, TextVariants } from '@patternfly/react-core'; -import { AppState } from '../../../../store'; -import * as DevfileRegistriesStore from '../../../../store/DevfileRegistries'; -import * as FactoryResolverStore from '../../../../store/FactoryResolver'; -import { GitRepoLocationInput } from './GitRepoLocationInput'; -import { FactoryLocationAdapter } from '../../../../services/factory-location-adapter'; + +import { GitRepoLocationInput } from '@/pages/GetStarted/GetStartedTab/ImportFromGit/GitRepoLocationInput'; +import { FactoryLocationAdapter } from '@/services/factory-location-adapter'; +import { AppState } from '@/store'; +import * as DevfileRegistriesStore from '@/store/DevfileRegistries'; +import * as FactoryResolverStore from '@/store/FactoryResolver'; type Props = MappedProps & { onDevfileResolve: (resolverState: FactoryResolverStore.ResolverState, location: string) => void; diff --git a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/SampleCard/index.tsx b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/SampleCard/index.tsx index a590d8cdaf..cdb8ee1658 100644 --- a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/SampleCard/index.tsx +++ b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/SampleCard/index.tsx @@ -10,25 +10,25 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { + Badge, Brand, Card, + CardActions, CardBody, CardHeader, CardHeaderMain, - Badge, - CardActions, Dropdown, - KebabToggle, DropdownPosition, + KebabToggle, } from '@patternfly/react-core'; -import { TargetEditor, VISIBLE_TAGS } from '../SamplesListGallery'; -import DropdownEditors from '../DropdownEditors'; import { CubesIcon } from '@patternfly/react-icons'; +import React from 'react'; -import styles from './index.module.css'; -import { convertIconToSrc } from '../../../../services/registry/devfiles'; +import DropdownEditors from '@/pages/GetStarted/GetStartedTab/DropdownEditors'; +import styles from '@/pages/GetStarted/GetStartedTab/SampleCard/index.module.css'; +import { TargetEditor, VISIBLE_TAGS } from '@/pages/GetStarted/GetStartedTab/SamplesListGallery'; +import { convertIconToSrc } from '@/services/registry/devfiles'; type Props = { metadata: che.DevfileMetaData; diff --git a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/SamplesListGallery.tsx b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/SamplesListGallery.tsx index 263772e3d2..bc3d30b0d0 100644 --- a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/SamplesListGallery.tsx +++ b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/SamplesListGallery.tsx @@ -10,12 +10,11 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; -import { connect, ConnectedProps } from 'react-redux'; import { Alert, AlertActionCloseButton, AlertGroup, + AlertVariant, Button, EmptyState, EmptyStateBody, @@ -24,20 +23,19 @@ import { EmptyStateVariant, Gallery, Title, - AlertVariant, } from '@patternfly/react-core'; import { SearchIcon } from '@patternfly/react-icons'; -import { AppState } from '../../../store'; -import * as DevfileRegistriesStore from '../../../store/DevfileRegistries'; -import { SampleCard } from './SampleCard'; -import { AlertItem } from '../../../services/helpers/types'; -import { - EMPTY_WORKSPACE_TAG, - selectMetadataFiltered, -} from '../../../store/DevfileRegistries/selectors'; -import * as FactoryResolverStore from '../../../store/FactoryResolver'; -import { selectDefaultEditor } from '../../../store/Plugins/devWorkspacePlugins/selectors'; -import { selectEditors } from '../../../store/Plugins/chePlugins/selectors'; +import React from 'react'; +import { connect, ConnectedProps } from 'react-redux'; + +import { SampleCard } from '@/pages/GetStarted/GetStartedTab/SampleCard'; +import { AlertItem } from '@/services/helpers/types'; +import { AppState } from '@/store'; +import * as DevfileRegistriesStore from '@/store/DevfileRegistries'; +import { EMPTY_WORKSPACE_TAG, selectMetadataFiltered } from '@/store/DevfileRegistries/selectors'; +import * as FactoryResolverStore from '@/store/FactoryResolver'; +import { selectEditors } from '@/store/Plugins/chePlugins/selectors'; +import { selectDefaultEditor } from '@/store/Plugins/devWorkspacePlugins/selectors'; export type TargetEditor = { id: string; diff --git a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/SamplesListHeader.tsx b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/SamplesListHeader.tsx index 28398b2e88..654c856380 100644 --- a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/SamplesListHeader.tsx +++ b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/SamplesListHeader.tsx @@ -10,8 +10,8 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { Text, TextContent, TextVariants } from '@patternfly/react-core'; +import React from 'react'; const TITLE = 'Select a Sample'; const DESCRIPTION = 'Select a sample to create your first workspace.'; diff --git a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/SamplesListToolbar.tsx b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/SamplesListToolbar.tsx index 92eea1f1ce..c1435a7f88 100644 --- a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/SamplesListToolbar.tsx +++ b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/SamplesListToolbar.tsx @@ -10,24 +10,22 @@ * Red Hat, Inc. - initial API and implementation */ -import { connect, ConnectedProps } from 'react-redux'; -import React from 'react'; -import Pluralize from 'react-pluralize'; import { - TextContent, Flex, FlexItem, Text, + TextContent, TextInput, TextInputProps, } from '@patternfly/react-core'; -import TemporaryStorageSwitch from './TemporaryStorageSwitch'; -import * as DevfileRegistriesStore from '../../../store/DevfileRegistries'; -import { AppState } from '../../../store'; -import { - selectFilterValue, - selectMetadataFiltered, -} from '../../../store/DevfileRegistries/selectors'; +import React from 'react'; +import Pluralize from 'react-pluralize'; +import { connect, ConnectedProps } from 'react-redux'; + +import TemporaryStorageSwitch from '@/pages/GetStarted/GetStartedTab/TemporaryStorageSwitch'; +import { AppState } from '@/store'; +import * as DevfileRegistriesStore from '@/store/DevfileRegistries'; +import { selectFilterValue, selectMetadataFiltered } from '@/store/DevfileRegistries/selectors'; type Props = MappedProps & { persistVolumesDefault: string; diff --git a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/TemporaryStorageSwitch.tsx b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/TemporaryStorageSwitch.tsx index 7239745a29..81d872a07f 100644 --- a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/TemporaryStorageSwitch.tsx +++ b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/TemporaryStorageSwitch.tsx @@ -10,12 +10,13 @@ * Red Hat, Inc. - initial API and implementation */ -import React, { FormEvent } from 'react'; import { Switch, Text, Tooltip, TooltipPosition } from '@patternfly/react-core'; -import { connect, ConnectedProps } from 'react-redux'; -import { AppState } from '../../../store'; import { OutlinedQuestionCircleIcon } from '@patternfly/react-icons'; -import { selectBranding } from '../../../store/Branding/selectors'; +import React, { FormEvent } from 'react'; +import { connect, ConnectedProps } from 'react-redux'; + +import { AppState } from '@/store'; +import { selectBranding } from '@/store/Branding/selectors'; type Props = MappedProps & { persistVolumesDefault: string; diff --git a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/__tests__/DropdownEditors.spec.tsx b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/__tests__/DropdownEditors.spec.tsx index 188c61f361..137126e8bf 100644 --- a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/__tests__/DropdownEditors.spec.tsx +++ b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/__tests__/DropdownEditors.spec.tsx @@ -10,11 +10,12 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; -import DropdownEditors from '../DropdownEditors'; -import { fireEvent, render, RenderResult, screen, within } from '@testing-library/react'; -import { TargetEditor } from '../SamplesListGallery'; import { Dropdown, KebabToggle } from '@patternfly/react-core'; +import { fireEvent, render, RenderResult, screen, within } from '@testing-library/react'; +import React from 'react'; + +import DropdownEditors from '@/pages/GetStarted/GetStartedTab/DropdownEditors'; +import { TargetEditor } from '@/pages/GetStarted/GetStartedTab/SamplesListGallery'; const onItemClick = jest.fn(); diff --git a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/__tests__/GetStartedTab.spec.tsx b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/__tests__/GetStartedTab.spec.tsx index b32a300bd8..40d1885da6 100644 --- a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/__tests__/GetStartedTab.spec.tsx +++ b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/__tests__/GetStartedTab.spec.tsx @@ -10,15 +10,17 @@ * Red Hat, Inc. - initial API and implementation */ +import { api } from '@eclipse-che/common'; +import { render, RenderResult, screen } from '@testing-library/react'; import React from 'react'; import { Provider } from 'react-redux'; -import { RenderResult, render, screen } from '@testing-library/react'; -import { FakeStoreBuilder } from '../../../../store/__mocks__/storeBuilder'; + +import { BrandingData } from '@/services/bootstrap/branding.constant'; +import devfileApi from '@/services/devfileApi'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { selectPvcStrategy } from '@/store/ServerConfig/selectors'; + import { SamplesListTab } from '..'; -import { BrandingData } from '../../../../services/bootstrap/branding.constant'; -import { selectPvcStrategy } from '../../../../store/ServerConfig/selectors'; -import { api } from '@eclipse-che/common'; -import devfileApi from '../../../../services/devfileApi'; const onDevfileMock: ( devfileContent: string, diff --git a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/__tests__/SampleCard.spec.tsx b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/__tests__/SampleCard.spec.tsx index 1fd85f1b59..27b42bba13 100644 --- a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/__tests__/SampleCard.spec.tsx +++ b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/__tests__/SampleCard.spec.tsx @@ -10,9 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ +import { fireEvent, render, RenderResult, screen } from '@testing-library/react'; import React from 'react'; -import { render, screen, RenderResult, fireEvent } from '@testing-library/react'; -import { SampleCard } from '../SampleCard'; + +import { SampleCard } from '@/pages/GetStarted/GetStartedTab/SampleCard'; describe('Devfile Metadata Card', () => { const onCardClick = jest.fn(); diff --git a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/__tests__/SamplesListGallery.spec.tsx b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/__tests__/SamplesListGallery.spec.tsx index 73898cbc5d..c2a74c0f2d 100644 --- a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/__tests__/SamplesListGallery.spec.tsx +++ b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/__tests__/SamplesListGallery.spec.tsx @@ -10,17 +10,18 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; -import { Store } from 'redux'; -import { render, screen, RenderResult, fireEvent } from '@testing-library/react'; +import { fireEvent, render, RenderResult, screen } from '@testing-library/react'; import mockAxios from 'axios'; -import SamplesListGallery from '../SamplesListGallery'; +import React from 'react'; import { Provider } from 'react-redux'; -import mockMetadata from '../../__tests__/devfileMetadata.json'; -import { FakeStoreBuilder } from '../../../../store/__mocks__/storeBuilder'; -import { BrandingData } from '../../../../services/bootstrap/branding.constant'; -import { ConvertedState } from '../../../../store/FactoryResolver'; -import devfileApi from '../../../../services/devfileApi'; +import { Store } from 'redux'; + +import mockMetadata from '@/pages/GetStarted/__tests__/devfileMetadata.json'; +import SamplesListGallery from '@/pages/GetStarted/GetStartedTab/SamplesListGallery'; +import { BrandingData } from '@/services/bootstrap/branding.constant'; +import devfileApi from '@/services/devfileApi'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { ConvertedState } from '@/store/FactoryResolver'; const requestFactoryResolverMock = jest.fn().mockResolvedValue(undefined); diff --git a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/__tests__/SamplesListToolbar.spec.tsx b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/__tests__/SamplesListToolbar.spec.tsx index 95f0b629f9..a86f5ef402 100644 --- a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/__tests__/SamplesListToolbar.spec.tsx +++ b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/__tests__/SamplesListToolbar.spec.tsx @@ -10,15 +10,16 @@ * Red Hat, Inc. - initial API and implementation */ +import { fireEvent, render, RenderResult, screen } from '@testing-library/react'; import React from 'react'; -import { RenderResult, render, screen, fireEvent } from '@testing-library/react'; import { Provider } from 'react-redux'; import { Store } from 'redux'; -import SamplesListToolbar from '../SamplesListToolbar'; -import mockMetadata from '../../__tests__/devfileMetadata.json'; -import * as DevfileRegistriesStore from '../../../../store/DevfileRegistries'; -import { FakeStoreBuilder } from '../../../../store/__mocks__/storeBuilder'; -import { BrandingData } from '../../../../services/bootstrap/branding.constant'; + +import mockMetadata from '@/pages/GetStarted/__tests__/devfileMetadata.json'; +import SamplesListToolbar from '@/pages/GetStarted/GetStartedTab/SamplesListToolbar'; +import { BrandingData } from '@/services/bootstrap/branding.constant'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import * as DevfileRegistriesStore from '@/store/DevfileRegistries'; describe('Samples List Toolbar', () => { function renderToolbar(): RenderResult { diff --git a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/__tests__/TemporaryStorageSwitch.spec.tsx b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/__tests__/TemporaryStorageSwitch.spec.tsx index f150e7577f..0cc7e7a396 100644 --- a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/__tests__/TemporaryStorageSwitch.spec.tsx +++ b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/__tests__/TemporaryStorageSwitch.spec.tsx @@ -10,14 +10,15 @@ * Red Hat, Inc. - initial API and implementation */ +import { render, RenderResult, screen } from '@testing-library/react'; import React from 'react'; -import { RenderResult, render, screen } from '@testing-library/react'; -import TemporaryStorageSwitch from '../TemporaryStorageSwitch'; import { Provider } from 'react-redux'; import { Store } from 'redux'; -import mockMetadata from '../../__tests__/devfileMetadata.json'; -import { FakeStoreBuilder } from '../../../../store/__mocks__/storeBuilder'; -import { BrandingData } from '../../../../services/bootstrap/branding.constant'; + +import mockMetadata from '@/pages/GetStarted/__tests__/devfileMetadata.json'; +import TemporaryStorageSwitch from '@/pages/GetStarted/GetStartedTab/TemporaryStorageSwitch'; +import { BrandingData } from '@/services/bootstrap/branding.constant'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; describe('Temporary Storage Switch', () => { const mockOnChange = jest.fn(); diff --git a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/index.tsx b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/index.tsx index dcb18b25ae..a6537e3ca6 100644 --- a/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/index.tsx +++ b/packages/dashboard-frontend/src/pages/GetStarted/GetStartedTab/index.tsx @@ -10,20 +10,21 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; -import { connect, ConnectedProps } from 'react-redux'; import { Flex, FlexItem, PageSection, PageSectionVariants } from '@patternfly/react-core'; -import { AppState } from '../../../store'; -import { SamplesListHeader } from './SamplesListHeader'; -import SamplesListToolbar from './SamplesListToolbar'; -import SamplesListGallery from './SamplesListGallery'; import { load } from 'js-yaml'; -import stringify from '../../../services/helpers/editor'; -import ImportFromGit from './ImportFromGit'; -import { ResolverState } from '../../../store/FactoryResolver'; -import { DevfileAdapter } from '../../../services/devfile/adapter'; -import { selectPvcStrategy } from '../../../store/ServerConfig/selectors'; -import devfileApi from '../../../services/devfileApi'; +import React from 'react'; +import { connect, ConnectedProps } from 'react-redux'; + +import ImportFromGit from '@/pages/GetStarted/GetStartedTab/ImportFromGit'; +import SamplesListGallery from '@/pages/GetStarted/GetStartedTab/SamplesListGallery'; +import { SamplesListHeader } from '@/pages/GetStarted/GetStartedTab/SamplesListHeader'; +import SamplesListToolbar from '@/pages/GetStarted/GetStartedTab/SamplesListToolbar'; +import { DevfileAdapter } from '@/services/devfile/adapter'; +import devfileApi from '@/services/devfileApi'; +import stringify from '@/services/helpers/editor'; +import { AppState } from '@/store'; +import { ResolverState } from '@/store/FactoryResolver'; +import { selectPvcStrategy } from '@/store/ServerConfig/selectors'; // At runtime, Redux will merge together... type Props = { diff --git a/packages/dashboard-frontend/src/pages/GetStarted/__tests__/GetStarted.spec.tsx b/packages/dashboard-frontend/src/pages/GetStarted/__tests__/GetStarted.spec.tsx index 925256c43b..8eeecd55fa 100644 --- a/packages/dashboard-frontend/src/pages/GetStarted/__tests__/GetStarted.spec.tsx +++ b/packages/dashboard-frontend/src/pages/GetStarted/__tests__/GetStarted.spec.tsx @@ -10,18 +10,20 @@ * Red Hat, Inc. - initial API and implementation */ +import { render, screen, waitFor } from '@testing-library/react'; import { createHashHistory } from 'history'; +import React from 'react'; import { Provider } from 'react-redux'; -import { render, screen, waitFor } from '@testing-library/react'; import { Store } from 'redux'; -import React from 'react'; + +import { BrandingData } from '@/services/bootstrap/branding.constant'; +import devfileApi from '@/services/devfileApi'; +import { constructWorkspace, Workspace } from '@/services/workspace-adapter'; +import { devfileToDevWorkspace } from '@/services/workspace-client/devworkspace/converters'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; + import GetStarted from '..'; -import { FakeStoreBuilder } from '../../../store/__mocks__/storeBuilder'; -import { BrandingData } from '../../../services/bootstrap/branding.constant'; -import { constructWorkspace, Workspace } from '../../../services/workspace-adapter'; -import { DevWorkspaceBuilder } from '../../../store/__mocks__/devWorkspaceBuilder'; -import { devfileToDevWorkspace } from '../../../services/workspace-client/devworkspace/converters'; -import devfileApi from '../../../services/devfileApi'; const setWorkspaceQualifiedName = jest.fn(); const createWorkspaceFromDevfileMock = jest.fn().mockResolvedValue(undefined); diff --git a/packages/dashboard-frontend/src/pages/GetStarted/index.tsx b/packages/dashboard-frontend/src/pages/GetStarted/index.tsx index 1c25e18b80..99e8b54bdc 100644 --- a/packages/dashboard-frontend/src/pages/GetStarted/index.tsx +++ b/packages/dashboard-frontend/src/pages/GetStarted/index.tsx @@ -10,10 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import React, { Suspense } from 'react'; -import { History } from 'history'; -import { connect, ConnectedProps } from 'react-redux'; -import { load } from 'js-yaml'; +import common from '@eclipse-che/common'; import { AlertVariant, PageSection, @@ -22,22 +19,26 @@ import { Tabs, Title, } from '@patternfly/react-core'; -import common from '@eclipse-che/common'; -import Fallback from '../../components/Fallback'; -import Head from '../../components/Head'; -import { lazyInject } from '../../inversify.config'; -import { AppAlerts } from '../../services/alerts/appAlerts'; -import * as WorkspaceStore from '../../store/Workspaces'; -import { AppState } from '../../store'; -import { AlertItem, CreateWorkspaceTab } from '../../services/helpers/types'; -import { ROUTE } from '../../Routes/routes'; -import { Workspace, isCheDevfile } from '../../services/workspace-adapter'; -import { selectRegistriesErrors } from '../../store/DevfileRegistries/selectors'; -import { selectWorkspaceByQualifiedName } from '../../store/Workspaces/selectors'; -import { selectDefaultNamespace } from '../../store/InfrastructureNamespaces/selectors'; -import getRandomString from '../../services/helpers/random'; -import devfileApi from '../../services/devfileApi'; -import { FactoryParams } from '../../services/helpers/factoryFlow/buildFactoryParams'; +import { History } from 'history'; +import { load } from 'js-yaml'; +import React, { Suspense } from 'react'; +import { connect, ConnectedProps } from 'react-redux'; + +import Fallback from '@/components/Fallback'; +import Head from '@/components/Head'; +import { lazyInject } from '@/inversify.config'; +import { ROUTE } from '@/Routes/routes'; +import { AppAlerts } from '@/services/alerts/appAlerts'; +import devfileApi from '@/services/devfileApi'; +import { FactoryParams } from '@/services/helpers/factoryFlow/buildFactoryParams'; +import getRandomString from '@/services/helpers/random'; +import { AlertItem, CreateWorkspaceTab } from '@/services/helpers/types'; +import { isCheDevfile, Workspace } from '@/services/workspace-adapter'; +import { AppState } from '@/store'; +import { selectRegistriesErrors } from '@/store/DevfileRegistries/selectors'; +import { selectDefaultNamespace } from '@/store/InfrastructureNamespaces/selectors'; +import * as WorkspaceStore from '@/store/Workspaces'; +import { selectWorkspaceByQualifiedName } from '@/store/Workspaces/selectors'; const SamplesListTab = React.lazy(() => import('./GetStartedTab')); diff --git a/packages/dashboard-frontend/src/pages/Loader/__mocks__/index.tsx b/packages/dashboard-frontend/src/pages/Loader/__mocks__/index.tsx index 272cb63480..36e3f8cd2a 100644 --- a/packages/dashboard-frontend/src/pages/Loader/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/pages/Loader/__mocks__/index.tsx @@ -11,8 +11,10 @@ */ import React from 'react'; + +import { LoaderTab } from '@/services/helpers/types'; + import { Props } from '..'; -import { LoaderTab } from '../../../services/helpers/types'; export class LoaderPage extends React.PureComponent { render(): React.ReactNode { diff --git a/packages/dashboard-frontend/src/pages/Loader/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/Loader/__tests__/index.spec.tsx index efde9f0830..a5691a4d2d 100644 --- a/packages/dashboard-frontend/src/pages/Loader/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/Loader/__tests__/index.spec.tsx @@ -16,13 +16,15 @@ import { createMemoryHistory, History } from 'history'; import React from 'react'; import { Provider } from 'react-redux'; import { Store } from 'redux'; + +import getComponentRenderer from '@/services/__mocks__/getComponentRenderer'; +import devfileApi from '@/services/devfileApi'; +import { LoaderTab } from '@/services/helpers/types'; +import { constructWorkspace, Workspace } from '@/services/workspace-adapter'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; + import { LoaderPage, Props } from '..'; -import devfileApi from '../../../services/devfileApi'; -import { LoaderTab } from '../../../services/helpers/types'; -import { constructWorkspace, Workspace } from '../../../services/workspace-adapter'; -import getComponentRenderer from '../../../services/__mocks__/getComponentRenderer'; -import { DevWorkspaceBuilder } from '../../../store/__mocks__/devWorkspaceBuilder'; -import { FakeStoreBuilder } from '../../../store/__mocks__/storeBuilder'; jest.mock('react-tooltip', () => { return function DummyTooltip(): React.ReactElement { diff --git a/packages/dashboard-frontend/src/pages/Loader/index.tsx b/packages/dashboard-frontend/src/pages/Loader/index.tsx index 8034a1f906..29deeb5245 100644 --- a/packages/dashboard-frontend/src/pages/Loader/index.tsx +++ b/packages/dashboard-frontend/src/pages/Loader/index.tsx @@ -13,18 +13,19 @@ import { PageSection, PageSectionVariants, Tab, Tabs } from '@patternfly/react-core'; import { History } from 'history'; import React from 'react'; -import Head from '../../components/Head'; -import Header from '../../components/Header'; -import WorkspaceEvents from '../../components/WorkspaceEvents'; -import WorkspaceLogs from '../../components/WorkspaceLogs'; -import WorkspaceProgress from '../../components/WorkspaceProgress'; -import { DevWorkspaceStatus, LoaderTab } from '../../services/helpers/types'; -import { Workspace } from '../../services/workspace-adapter'; -import styles from './index.module.css'; + +import Head from '@/components/Head'; +import Header from '@/components/Header'; +import WorkspaceEvents from '@/components/WorkspaceEvents'; +import WorkspaceLogs from '@/components/WorkspaceLogs'; +import WorkspaceProgress from '@/components/WorkspaceProgress'; import { getRestartInDebugModeLocation, getRestartInSafeModeLocation, -} from '../../components/WorkspaceProgress/StartingSteps/StartWorkspace/prepareRestart'; +} from '@/components/WorkspaceProgress/StartingSteps/StartWorkspace/prepareRestart'; +import styles from '@/pages/Loader/index.module.css'; +import { DevWorkspaceStatus, LoaderTab } from '@/services/helpers/types'; +import { Workspace } from '@/services/workspace-adapter'; export type Props = { history: History; diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/EmptyState/NoRegistries.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/EmptyState/NoRegistries.tsx index 2aa9a0c4f8..6186996312 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/EmptyState/NoRegistries.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/EmptyState/NoRegistries.tsx @@ -10,16 +10,16 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { - Title, Button, EmptyState, - EmptyStateVariant, - EmptyStateIcon, EmptyStateBody, + EmptyStateIcon, + EmptyStateVariant, + Title, } from '@patternfly/react-core'; -import { RegistryIcon, PlusCircleIcon } from '@patternfly/react-icons'; +import { PlusCircleIcon, RegistryIcon } from '@patternfly/react-icons'; +import React from 'react'; type Props = { onAddRegistry: () => void; diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/EmptyState/__tests__/NoRegistries.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/EmptyState/__tests__/NoRegistries.spec.tsx index 81dd89a9ef..7f6132d6b3 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/EmptyState/__tests__/NoRegistries.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/EmptyState/__tests__/NoRegistries.spec.tsx @@ -12,7 +12,8 @@ import React from 'react'; import renderer from 'react-test-renderer'; -import NoRegistriesEmptyState from '../NoRegistries'; + +import NoRegistriesEmptyState from '@/pages/UserPreferences/ContainerRegistriesTab/EmptyState/NoRegistries'; describe('No registries component for empty state', () => { const onAdd = jest.fn(); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/Modals/DeleteRegistriesModal.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/Modals/DeleteRegistriesModal.tsx index 2be83b25df..d333915b27 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/Modals/DeleteRegistriesModal.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/Modals/DeleteRegistriesModal.tsx @@ -10,17 +10,18 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { Button, ButtonVariant, - ModalVariant, + Checkbox, Modal, - TextContent, + ModalVariant, Text, - Checkbox, + TextContent, } from '@patternfly/react-core'; -import { RegistryEntry } from '../../../../store/DockerConfig/types'; +import React from 'react'; + +import { RegistryEntry } from '@/store/DockerConfig/types'; type Props = { registry?: RegistryEntry; diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/Modals/EditRegistryModal.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/Modals/EditRegistryModal.tsx index 241a623a0a..710b0037db 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/Modals/EditRegistryModal.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/Modals/EditRegistryModal.tsx @@ -19,10 +19,11 @@ import { ValidatedOptions, } from '@patternfly/react-core'; import React from 'react'; -import { RegistryEntry } from '../../../../store/DockerConfig/types'; -import { RegistryPasswordFormGroup } from '../RegistryPassword'; -import { RegistryUrlFormGroup } from '../RegistryUrl'; -import { RegistryUsernameFormGroup } from '../RegistryUsername'; + +import { RegistryPasswordFormGroup } from '@/pages/UserPreferences/ContainerRegistriesTab/RegistryPassword'; +import { RegistryUrlFormGroup } from '@/pages/UserPreferences/ContainerRegistriesTab/RegistryUrl'; +import { RegistryUsernameFormGroup } from '@/pages/UserPreferences/ContainerRegistriesTab/RegistryUsername'; +import { RegistryEntry } from '@/store/DockerConfig/types'; type Props = { registry: RegistryEntry; diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/Modals/__tests__/DeleteRegistriesModal.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/Modals/__tests__/DeleteRegistriesModal.spec.tsx index 5068d5f066..b8d106c0f1 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/Modals/__tests__/DeleteRegistriesModal.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/Modals/__tests__/DeleteRegistriesModal.spec.tsx @@ -10,13 +10,14 @@ * Red Hat, Inc. - initial API and implementation */ +import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import React from 'react'; -import { render, screen } from '@testing-library/react'; import renderer from 'react-test-renderer'; -import { RegistryEntry } from '../../../../../store/DockerConfig/types'; -import DeleteRegistriesModal from '../DeleteRegistriesModal'; -import { FakeRegistryBuilder } from '../../__tests__/__mocks__/registryRowBuilder'; + +import { FakeRegistryBuilder } from '@/pages/UserPreferences/ContainerRegistriesTab/__tests__/__mocks__/registryRowBuilder'; +import DeleteRegistriesModal from '@/pages/UserPreferences/ContainerRegistriesTab/Modals/DeleteRegistriesModal'; +import { RegistryEntry } from '@/store/DockerConfig/types'; describe('Delete Registries Modal', () => { const mockOnDelete = jest.fn(); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/Modals/__tests__/EditRegistryModal.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/Modals/__tests__/EditRegistryModal.spec.tsx index 28cc99e3cc..c071a1939c 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/Modals/__tests__/EditRegistryModal.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/Modals/__tests__/EditRegistryModal.spec.tsx @@ -10,13 +10,14 @@ * Red Hat, Inc. - initial API and implementation */ +import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import React from 'react'; -import { render, screen } from '@testing-library/react'; import renderer from 'react-test-renderer'; -import { RegistryEntry } from '../../../../../store/DockerConfig/types'; -import EditRegistryModal from '../EditRegistryModal'; -import { FakeRegistryBuilder } from '../../__tests__/__mocks__/registryRowBuilder'; + +import { FakeRegistryBuilder } from '@/pages/UserPreferences/ContainerRegistriesTab/__tests__/__mocks__/registryRowBuilder'; +import EditRegistryModal from '@/pages/UserPreferences/ContainerRegistriesTab/Modals/EditRegistryModal'; +import { RegistryEntry } from '@/store/DockerConfig/types'; describe('Edit Registry Modal', () => { const mockOnChange = jest.fn(); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryPassword/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryPassword/__tests__/index.spec.tsx index 9a0ff85e5d..bc7bfd1a29 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryPassword/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryPassword/__tests__/index.spec.tsx @@ -11,10 +11,11 @@ */ import { Form } from '@patternfly/react-core'; +import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import React from 'react'; -import { render, screen } from '@testing-library/react'; import renderer from 'react-test-renderer'; + import { RegistryPasswordFormGroup } from '..'; describe('Registry Password Input', () => { diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryPassword/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryPassword/index.tsx index 9f825c7661..d3f83039f9 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryPassword/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryPassword/index.tsx @@ -10,8 +10,6 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; -import { EyeIcon, EyeSlashIcon, ExclamationCircleIcon } from '@patternfly/react-icons'; import { Button, FormGroup, @@ -19,6 +17,8 @@ import { TextInput, ValidatedOptions, } from '@patternfly/react-core'; +import { ExclamationCircleIcon, EyeIcon, EyeSlashIcon } from '@patternfly/react-icons'; +import React from 'react'; const MAX_LENGTH = 10000; const ERROR_REQUIRED_VALUE = 'A value is required.'; diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUrl/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUrl/__tests__/index.spec.tsx index bba2fd61ad..01b9c1b138 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUrl/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUrl/__tests__/index.spec.tsx @@ -11,10 +11,11 @@ */ import { Form } from '@patternfly/react-core'; +import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import React from 'react'; -import { render, screen } from '@testing-library/react'; import renderer from 'react-test-renderer'; + import { RegistryUrlFormGroup } from '..'; describe('Registry Url Input', () => { diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUsername/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUsername/__tests__/index.spec.tsx index a607e537b6..90347f32fe 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUsername/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUsername/__tests__/index.spec.tsx @@ -11,10 +11,11 @@ */ import { Form } from '@patternfly/react-core'; +import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import React from 'react'; -import { render, screen } from '@testing-library/react'; import renderer from 'react-test-renderer'; + import { RegistryUsernameFormGroup } from '..'; describe('Registry Username Input', () => { diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUsername/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUsername/index.tsx index 446feaf809..c51b5bbbc4 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUsername/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUsername/index.tsx @@ -10,8 +10,8 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { FormGroup, TextInput, ValidatedOptions } from '@patternfly/react-core'; +import React from 'react'; const MAX_LENGTH = 100; const ERROR_MAX_LENGTH = `The username is too long. The maximum length is ${MAX_LENGTH} characters.`; diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/__tests__/__mocks__/registryRowBuilder.ts b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/__tests__/__mocks__/registryRowBuilder.ts index 11b9c47d64..1163a5376f 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/__tests__/__mocks__/registryRowBuilder.ts +++ b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/__tests__/__mocks__/registryRowBuilder.ts @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { RegistryEntry } from '../../../../../store/DockerConfig/types'; +import { RegistryEntry } from '@/store/DockerConfig/types'; export class FakeRegistryBuilder { private registry: RegistryEntry = { url: '', password: '', username: '' }; diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/__tests__/index.spec.tsx index a69c551960..c0348a122e 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/__tests__/index.spec.tsx @@ -10,16 +10,18 @@ * Red Hat, Inc. - initial API and implementation */ +import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import { Provider } from 'react-redux'; import React from 'react'; -import { render, screen } from '@testing-library/react'; +import { Provider } from 'react-redux'; import renderer from 'react-test-renderer'; import { Store } from 'redux'; + +import { FakeRegistryBuilder } from '@/pages/UserPreferences/ContainerRegistriesTab/__tests__/__mocks__/registryRowBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { selectIsLoading, selectRegistries } from '@/store/DockerConfig/selectors'; + import { ContainerRegistries } from '..'; -import { selectIsLoading, selectRegistries } from '../../../../store/DockerConfig/selectors'; -import { FakeRegistryBuilder } from './__mocks__/registryRowBuilder'; -import { FakeStoreBuilder } from '../../../../store/__mocks__/storeBuilder'; describe('ContainerRegistries', () => { const mockRequestCredentials = jest.fn(); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/index.tsx index 4279b64b3a..3e362a1ba6 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/index.tsx @@ -10,6 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ +import { helpers } from '@eclipse-che/common'; import { AlertVariant, Button, @@ -23,18 +24,18 @@ import { PlusCircleIcon } from '@patternfly/react-icons'; import { Table, TableBody, TableHeader } from '@patternfly/react-table'; import React from 'react'; import { connect, ConnectedProps } from 'react-redux'; -import ProgressIndicator from '../../../components/Progress'; -import { lazyInject } from '../../../inversify.config'; -import { AppAlerts } from '../../../services/alerts/appAlerts'; -import { AlertItem } from '../../../services/helpers/types'; -import { AppState } from '../../../store'; -import * as DockerConfigStore from '../../../store/DockerConfig'; -import { RegistryEntry } from '../../../store/DockerConfig/types'; -import { selectIsLoading, selectRegistries } from '../../../store/DockerConfig/selectors'; -import NoRegistriesEmptyState from './EmptyState/NoRegistries'; -import DeleteRegistriesModal from './Modals/DeleteRegistriesModal'; -import EditRegistryModal from './Modals/EditRegistryModal'; -import { helpers } from '@eclipse-che/common'; + +import ProgressIndicator from '@/components/Progress'; +import { lazyInject } from '@/inversify.config'; +import NoRegistriesEmptyState from '@/pages/UserPreferences/ContainerRegistriesTab/EmptyState/NoRegistries'; +import DeleteRegistriesModal from '@/pages/UserPreferences/ContainerRegistriesTab/Modals/DeleteRegistriesModal'; +import EditRegistryModal from '@/pages/UserPreferences/ContainerRegistriesTab/Modals/EditRegistryModal'; +import { AppAlerts } from '@/services/alerts/appAlerts'; +import { AlertItem } from '@/services/helpers/types'; +import { AppState } from '@/store'; +import * as DockerConfigStore from '@/store/DockerConfig'; +import { selectIsLoading, selectRegistries } from '@/store/DockerConfig/selectors'; +import { RegistryEntry } from '@/store/DockerConfig/types'; type Props = MappedProps; diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/EmptyState/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/EmptyState/__tests__/index.spec.tsx index f902a277d0..76e2e25614 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/EmptyState/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/EmptyState/__tests__/index.spec.tsx @@ -11,8 +11,10 @@ */ import React from 'react'; + +import getComponentRenderer from '@/services/__mocks__/getComponentRenderer'; + import { GitConfigEmptyState } from '..'; -import getComponentRenderer from '../../../../../services/__mocks__/getComponentRenderer'; const { createSnapshot } = getComponentRenderer(getComponent); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/Email/__mocks__/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/Email/__mocks__/index.tsx index c474d0e72b..a1e0e5eb2a 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/Email/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/Email/__mocks__/index.tsx @@ -11,6 +11,7 @@ */ import * as React from 'react'; + import { Props } from '..'; export class GitConfigUserEmail extends React.PureComponent { diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/Email/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/Email/__tests__/index.spec.tsx index 39f7ca7a9b..e6330b5358 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/Email/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/Email/__tests__/index.spec.tsx @@ -10,13 +10,13 @@ * Red Hat, Inc. - initial API and implementation */ -import * as React from 'react'; -import { GitConfigUserEmail } from '..'; -import getComponentRenderer, { - screen, -} from '../../../../../../services/__mocks__/getComponentRenderer'; import { ValidatedOptions } from '@patternfly/react-core'; import userEvent from '@testing-library/user-event'; +import * as React from 'react'; + +import getComponentRenderer, { screen } from '@/services/__mocks__/getComponentRenderer'; + +import { GitConfigUserEmail } from '..'; jest.mock('../../../../../../components/InputGroupExtended'); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/Email/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/Email/index.tsx index 046d75e711..5484908efd 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/Email/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/Email/index.tsx @@ -11,9 +11,10 @@ */ import { FormGroup, TextInput, ValidatedOptions } from '@patternfly/react-core'; -import React from 'react'; -import { InputGroupExtended } from '../../../../../components/InputGroupExtended'; import { ExclamationCircleIcon } from '@patternfly/react-icons'; +import React from 'react'; + +import { InputGroupExtended } from '@/components/InputGroupExtended'; const ERROR_REQUIRED_VALUE = 'A value is required.'; const MAX_LENGTH = 128; diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/Name/__mocks__/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/Name/__mocks__/index.tsx index c7de948551..8bded09914 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/Name/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/Name/__mocks__/index.tsx @@ -11,6 +11,7 @@ */ import * as React from 'react'; + import { Props } from '..'; export class GitConfigUserName extends React.PureComponent { diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/Name/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/Name/__tests__/index.spec.tsx index 0e1cfb14d6..73753d3bd3 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/Name/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/Name/__tests__/index.spec.tsx @@ -10,13 +10,13 @@ * Red Hat, Inc. - initial API and implementation */ -import * as React from 'react'; -import { GitConfigUserName } from '..'; -import getComponentRenderer, { - screen, -} from '../../../../../../services/__mocks__/getComponentRenderer'; import { ValidatedOptions } from '@patternfly/react-core'; import userEvent from '@testing-library/user-event'; +import * as React from 'react'; + +import getComponentRenderer, { screen } from '@/services/__mocks__/getComponentRenderer'; + +import { GitConfigUserName } from '..'; jest.mock('../../../../../../components/InputGroupExtended'); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/Name/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/Name/index.tsx index 33b3e21095..ab1885b266 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/Name/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/Name/index.tsx @@ -13,7 +13,8 @@ import { FormGroup, TextInput, ValidatedOptions } from '@patternfly/react-core'; import { ExclamationCircleIcon } from '@patternfly/react-icons'; import React from 'react'; -import { InputGroupExtended } from '../../../../../components/InputGroupExtended'; + +import { InputGroupExtended } from '@/components/InputGroupExtended'; const ERROR_REQUIRED_VALUE = 'A value is required.'; const MAX_LENGTH = 128; diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/__mocks__/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/__mocks__/index.tsx index 76c7cb23e1..f1c5c6dff1 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/__mocks__/index.tsx @@ -11,6 +11,7 @@ */ import * as React from 'react'; + import { Props } from '..'; export class GitConfigSectionUser extends React.PureComponent { diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/__tests__/index.spec.tsx index 111f974f34..8caed2bc9c 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/__tests__/index.spec.tsx @@ -11,10 +11,10 @@ */ import * as React from 'react'; + +import getComponentRenderer, { screen } from '@/services/__mocks__/getComponentRenderer'; + import { GitConfigSectionUser, Props } from '..'; -import getComponentRenderer, { - screen, -} from '../../../../../services/__mocks__/getComponentRenderer'; jest.mock('../Email'); jest.mock('../Name'); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/index.tsx index 93c25cf5bc..799f60a404 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/SectionUser/index.tsx @@ -12,9 +12,10 @@ import { Form, FormSection, Panel, PanelMain, PanelMainBody } from '@patternfly/react-core'; import * as React from 'react'; -import { GitConfigUser } from '../../../../store/GitConfig'; -import { GitConfigUserName } from './Name'; -import { GitConfigUserEmail } from './Email'; + +import { GitConfigUserEmail } from '@/pages/UserPreferences/GitConfig/SectionUser/Email'; +import { GitConfigUserName } from '@/pages/UserPreferences/GitConfig/SectionUser/Name'; +import { GitConfigUser } from '@/store/GitConfig'; export type Props = { config: GitConfigUser; diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/__tests__/index.spec.tsx index 98d35147b4..d89abd9362 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/__tests__/index.spec.tsx @@ -15,18 +15,17 @@ import userEvent from '@testing-library/user-event'; import * as React from 'react'; import { Provider } from 'react-redux'; import { Action, Store } from 'redux'; + +import { container } from '@/inversify.config'; +import { mockShowAlert } from '@/pages/WorkspaceDetails/__mocks__'; +import getComponentRenderer, { screen, waitFor } from '@/services/__mocks__/getComponentRenderer'; +import { AppAlerts } from '@/services/alerts/appAlerts'; +import { AlertItem } from '@/services/helpers/types'; +import { AppThunk } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { ActionCreators } from '@/store/GitConfig'; + import GitConfig from '..'; -import { container } from '../../../../inversify.config'; -import getComponentRenderer, { - screen, - waitFor, -} from '../../../../services/__mocks__/getComponentRenderer'; -import { AppAlerts } from '../../../../services/alerts/appAlerts'; -import { AlertItem } from '../../../../services/helpers/types'; -import { AppThunk } from '../../../../store'; -import { ActionCreators } from '../../../../store/GitConfig'; -import { FakeStoreBuilder } from '../../../../store/__mocks__/storeBuilder'; -import { mockShowAlert } from '../../../WorkspaceDetails/__mocks__'; jest.mock('../SectionUser'); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/index.tsx index 8902584e40..54d448f74e 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/index.tsx @@ -13,19 +13,20 @@ import { helpers } from '@eclipse-che/common'; import { AlertVariant, PageSection } from '@patternfly/react-core'; import React from 'react'; -import { ConnectedProps, connect } from 'react-redux'; -import ProgressIndicator from '../../../components/Progress'; -import { lazyInject } from '../../../inversify.config'; -import { AppAlerts } from '../../../services/alerts/appAlerts'; -import { AppState } from '../../../store'; -import * as GitConfigStore from '../../../store/GitConfig'; +import { connect, ConnectedProps } from 'react-redux'; + +import ProgressIndicator from '@/components/Progress'; +import { lazyInject } from '@/inversify.config'; +import { GitConfigEmptyState } from '@/pages/UserPreferences/GitConfig/EmptyState'; +import { GitConfigSectionUser } from '@/pages/UserPreferences/GitConfig/SectionUser'; +import { AppAlerts } from '@/services/alerts/appAlerts'; +import { AppState } from '@/store'; +import * as GitConfigStore from '@/store/GitConfig'; import { selectGitConfigError, selectGitConfigIsLoading, selectGitConfigUser, -} from '../../../store/GitConfig/selectors'; -import { GitConfigEmptyState } from './EmptyState'; -import { GitConfigSectionUser } from './SectionUser'; +} from '@/store/GitConfig/selectors'; export type Props = MappedProps; diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/EmptyState/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/EmptyState/__tests__/index.spec.tsx index 18defb92d2..46a7394d05 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/EmptyState/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/EmptyState/__tests__/index.spec.tsx @@ -12,7 +12,8 @@ import React from 'react'; import renderer from 'react-test-renderer'; -import EmptyState from '../index'; + +import EmptyState from '@/pages/UserPreferences/GitServicesTab/EmptyState/index'; describe('No git services component for empty state', () => { it('should render title correctly', () => { diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/EmptyState/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/EmptyState/index.tsx index 40a2d24e79..d5f3aee5cc 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/EmptyState/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/EmptyState/index.tsx @@ -10,9 +10,9 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; -import { Title, EmptyState, EmptyStateVariant, EmptyStateIcon } from '@patternfly/react-core'; +import { EmptyState, EmptyStateIcon, EmptyStateVariant, Title } from '@patternfly/react-core'; import { RegistryIcon } from '@patternfly/react-icons'; +import React from 'react'; type Props = { text: string; diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/GitServicesToolbar/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/GitServicesToolbar/index.tsx index 6a81731058..f8f016c328 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/GitServicesToolbar/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/GitServicesToolbar/index.tsx @@ -10,6 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ +import { api, helpers } from '@eclipse-che/common'; import { AlertVariant, Button, @@ -18,17 +19,17 @@ import { ToolbarContent, ToolbarItem, } from '@patternfly/react-core'; +import { isEqual } from 'lodash'; import React from 'react'; import { connect, ConnectedProps } from 'react-redux'; -import { lazyInject } from '../../../../inversify.config'; -import { AppAlerts } from '../../../../services/alerts/appAlerts'; -import { AlertItem } from '../../../../services/helpers/types'; -import RevokeGitServicesModal from '../Modals/RevokeGitServicesModal'; -import { api, helpers } from '@eclipse-che/common'; -import * as GitOauthConfig from '../../../../store/GitOauthConfig'; -import { isEqual } from 'lodash'; -import { AppState } from '../../../../store'; -import { selectGitOauth } from '../../../../store/GitOauthConfig/selectors'; + +import { lazyInject } from '@/inversify.config'; +import RevokeGitServicesModal from '@/pages/UserPreferences/GitServicesTab/Modals/RevokeGitServicesModal'; +import { AppAlerts } from '@/services/alerts/appAlerts'; +import { AlertItem } from '@/services/helpers/types'; +import { AppState } from '@/store'; +import * as GitOauthConfig from '@/store/GitOauthConfig'; +import { selectGitOauth } from '@/store/GitOauthConfig/selectors'; type Props = MappedProps & { callbacks: { diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/Modals/RevokeGitServicesModal.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/Modals/RevokeGitServicesModal.tsx index 5bff4b2ba7..b6e7b10e36 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/Modals/RevokeGitServicesModal.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/Modals/RevokeGitServicesModal.tsx @@ -21,7 +21,8 @@ import { TextContent, } from '@patternfly/react-core'; import React from 'react'; -import { GIT_OAUTH_PROVIDERS } from '../../const'; + +import { GIT_OAUTH_PROVIDERS } from '@/pages/UserPreferences/const'; type Props = { gitOauth?: api.GitOauthProvider; diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/Modals/__tests__/RevokeRegistriesModal.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/Modals/__tests__/RevokeRegistriesModal.spec.tsx index c34b10a623..a4fbbc5283 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/Modals/__tests__/RevokeRegistriesModal.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/Modals/__tests__/RevokeRegistriesModal.spec.tsx @@ -10,11 +10,12 @@ * Red Hat, Inc. - initial API and implementation */ +import { api } from '@eclipse-che/common'; +import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import React from 'react'; -import { render, screen } from '@testing-library/react'; -import RevokeRegistriesModal from '../RevokeGitServicesModal'; -import { api } from '@eclipse-che/common'; + +import RevokeRegistriesModal from '@/pages/UserPreferences/GitServicesTab/Modals/RevokeGitServicesModal'; describe('Revoke Registries Modal', () => { const mockOnRevoke = jest.fn(); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/ProviderWarning/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/ProviderWarning/__tests__/index.spec.tsx index dc9aa402c6..2fbc8eb773 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/ProviderWarning/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/ProviderWarning/__tests__/index.spec.tsx @@ -12,6 +12,7 @@ import React from 'react'; import renderer from 'react-test-renderer'; + import ProviderWarning from '..'; jest.mock('@patternfly/react-core', () => { diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/ProviderWarning/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/ProviderWarning/index.tsx index 474c45479c..9ab45d19b9 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/ProviderWarning/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/ProviderWarning/index.tsx @@ -10,9 +10,9 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { Tooltip, TooltipPosition } from '@patternfly/react-core'; import { WarningTriangleIcon } from '@patternfly/react-icons'; +import React from 'react'; type Props = { warning: React.ReactNode; diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/__tests__/__mocks__/gitOauthRowBuilder.ts b/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/__tests__/__mocks__/gitOauthRowBuilder.ts index aa6390f445..aa88cdca1a 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/__tests__/__mocks__/gitOauthRowBuilder.ts +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/__tests__/__mocks__/gitOauthRowBuilder.ts @@ -10,9 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ -import { IGitOauth } from '../../../../../store/GitOauthConfig/types'; import { api } from '@eclipse-che/common'; +import { IGitOauth } from '@/store/GitOauthConfig/types'; + export class FakeGitOauthBuilder { private gitOauth: IGitOauth = { name: 'github', endpointUrl: '-' }; diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/__tests__/index.spec.tsx index 358e92a4b9..92f3bc1d1b 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/__tests__/index.spec.tsx @@ -10,17 +10,19 @@ * Red Hat, Inc. - initial API and implementation */ +import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import { Provider } from 'react-redux'; import React from 'react'; -import { render, screen } from '@testing-library/react'; +import { Provider } from 'react-redux'; import renderer from 'react-test-renderer'; import { Store } from 'redux'; + +import { FakeGitOauthBuilder } from '@/pages/UserPreferences/GitServicesTab/__tests__/__mocks__/gitOauthRowBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { actionCreators } from '@/store/GitOauthConfig'; +import { selectGitOauth, selectIsLoading } from '@/store/GitOauthConfig/selectors'; + import { GitServices } from '..'; -import { FakeGitOauthBuilder } from './__mocks__/gitOauthRowBuilder'; -import { FakeStoreBuilder } from '../../../../store/__mocks__/storeBuilder'; -import { selectIsLoading, selectGitOauth } from '../../../../store/GitOauthConfig/selectors'; -import { actionCreators } from '../../../../store/GitOauthConfig'; // mute the outputs console.error = jest.fn(); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/index.tsx index ce46fb04ea..86163e55b5 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitServicesTab/index.tsx @@ -15,14 +15,17 @@ import { PageSection } from '@patternfly/react-core'; import { Table, TableBody, TableHeader } from '@patternfly/react-table'; import React from 'react'; import { connect, ConnectedProps } from 'react-redux'; -import ProgressIndicator from '../../../components/Progress'; -import { AppState } from '../../../store'; -import * as GitOauthConfig from '../../../store/GitOauthConfig'; -import { selectGitOauth, selectIsLoading } from '../../../store/GitOauthConfig/selectors'; -import { GIT_OAUTH_PROVIDERS } from '../const'; -import EmptyState from './EmptyState'; -import GitServicesToolbar, { GitServicesToolbar as Toolbar } from './GitServicesToolbar'; -import ProviderWarning from './ProviderWarning'; + +import ProgressIndicator from '@/components/Progress'; +import { GIT_OAUTH_PROVIDERS } from '@/pages/UserPreferences/const'; +import EmptyState from '@/pages/UserPreferences/GitServicesTab/EmptyState'; +import GitServicesToolbar, { + GitServicesToolbar as Toolbar, +} from '@/pages/UserPreferences/GitServicesTab/GitServicesToolbar'; +import ProviderWarning from '@/pages/UserPreferences/GitServicesTab/ProviderWarning'; +import { AppState } from '@/store'; +import * as GitOauthConfig from '@/store/GitOauthConfig'; +import { selectGitOauth, selectIsLoading } from '@/store/GitOauthConfig/selectors'; export const enabledProviders: api.GitOauthProvider[] = ['github']; diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderEndpoint/__mocks__/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderEndpoint/__mocks__/index.tsx index 8e90a77ca7..95de480888 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderEndpoint/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderEndpoint/__mocks__/index.tsx @@ -11,6 +11,7 @@ */ import React from 'react'; + import { Props, State } from '..'; export const NEW_GIT_PROVIDER_ENDPOINT_BUTTON = 'Submit Valid Git Provider Endpoint'; diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderEndpoint/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderEndpoint/__tests__/index.spec.tsx index 224f82f059..4299ebfe73 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderEndpoint/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderEndpoint/__tests__/index.spec.tsx @@ -13,10 +13,10 @@ import { Form } from '@patternfly/react-core'; import userEvent from '@testing-library/user-event'; import React from 'react'; + +import getComponentRenderer, { screen } from '@/services/__mocks__/getComponentRenderer'; + import { GitProviderEndpoint } from '..'; -import getComponentRenderer, { - screen, -} from '../../../../../../../services/__mocks__/getComponentRenderer'; const { createSnapshot, renderComponent } = getComponentRenderer(getComponent); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderOrganization/__mocks__/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderOrganization/__mocks__/index.tsx index 43baac087e..a50a204763 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderOrganization/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderOrganization/__mocks__/index.tsx @@ -11,6 +11,7 @@ */ import React from 'react'; + import { Props, State } from '..'; export const NEW_GIT_PROVIDER_ORGANIZATION_BUTTON = 'Submit Valid Git Provider Organization'; diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderOrganization/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderOrganization/__tests__/index.spec.tsx index 6a7a9316f8..76cf051f61 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderOrganization/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderOrganization/__tests__/index.spec.tsx @@ -13,10 +13,10 @@ import { Form } from '@patternfly/react-core'; import userEvent from '@testing-library/user-event'; import React from 'react'; + +import getComponentRenderer, { screen } from '@/services/__mocks__/getComponentRenderer'; + import { GitProviderOrganization } from '..'; -import getComponentRenderer, { - screen, -} from '../../../../../../../services/__mocks__/getComponentRenderer'; const { createSnapshot, renderComponent } = getComponentRenderer(getComponent); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderSelector/__mocks__/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderSelector/__mocks__/index.tsx index 8f289945bc..76c69e2c86 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderSelector/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderSelector/__mocks__/index.tsx @@ -11,6 +11,7 @@ */ import React from 'react'; + import { Props, State } from '..'; export class GitProviderSelector extends React.PureComponent { diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderSelector/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderSelector/__tests__/index.spec.tsx index dd026f41cb..5f78a47a23 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderSelector/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderSelector/__tests__/index.spec.tsx @@ -14,10 +14,10 @@ import { api } from '@eclipse-che/common'; import { Form } from '@patternfly/react-core'; import userEvent from '@testing-library/user-event'; import React from 'react'; + +import getComponentRenderer, { screen } from '@/services/__mocks__/getComponentRenderer'; + import { GitProviderSelector } from '..'; -import getComponentRenderer, { - screen, -} from '../../../../../../../services/__mocks__/getComponentRenderer'; const { createSnapshot, renderComponent } = getComponentRenderer(getComponent); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderSelector/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderSelector/index.tsx index da2b15952a..aaf3393144 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderSelector/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderSelector/index.tsx @@ -13,7 +13,8 @@ import { api } from '@eclipse-che/common'; import { Dropdown, DropdownItem, DropdownToggle, FormGroup } from '@patternfly/react-core'; import React from 'react'; -import { DEFAULT_GIT_PROVIDER, GIT_PROVIDERS } from '../../../../const'; + +import { DEFAULT_GIT_PROVIDER, GIT_PROVIDERS } from '@/pages/UserPreferences/const'; export type Props = { provider: api.GitProvider | undefined; diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenData/__mocks__/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenData/__mocks__/index.tsx index 555188a4ae..e67256292d 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenData/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenData/__mocks__/index.tsx @@ -11,6 +11,7 @@ */ import React from 'react'; + import { Props, State } from '..'; export const NEW_TOKEN_DATA_BUTTON = 'Submit Valid Token Data'; diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenData/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenData/__tests__/index.spec.tsx index e1e7ded771..be45ebe321 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenData/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenData/__tests__/index.spec.tsx @@ -12,11 +12,10 @@ import { Form } from '@patternfly/react-core'; import React from 'react'; + +import getComponentRenderer, { fireEvent, screen } from '@/services/__mocks__/getComponentRenderer'; + import { TokenData } from '..'; -import getComponentRenderer, { - fireEvent, - screen, -} from '../../../../../../../services/__mocks__/getComponentRenderer'; const { createSnapshot, renderComponent } = getComponentRenderer(getComponent); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenName/__mocks__/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenName/__mocks__/index.tsx index 46e1411cd5..beb4c68c18 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenName/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenName/__mocks__/index.tsx @@ -11,6 +11,7 @@ */ import React from 'react'; + import { Props, State } from '..'; export const NEW_TOKEN_NAME_BUTTON = 'Submit Valid Token Name'; diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenName/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenName/__tests__/index.spec.tsx index 5a85a6aa19..efac395067 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenName/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenName/__tests__/index.spec.tsx @@ -12,11 +12,10 @@ import { Form } from '@patternfly/react-core'; import React from 'react'; + +import getComponentRenderer, { fireEvent, screen } from '@/services/__mocks__/getComponentRenderer'; + import { TokenName } from '..'; -import getComponentRenderer, { - fireEvent, - screen, -} from '../../../../../../../services/__mocks__/getComponentRenderer'; const { createSnapshot, renderComponent } = getComponentRenderer(getComponent); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/__mocks__/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/__mocks__/index.tsx index ca15d5c63e..9cccb58398 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/__mocks__/index.tsx @@ -10,9 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ +import { api } from '@eclipse-che/common'; import React from 'react'; + import { Props, State } from '..'; -import { api } from '@eclipse-che/common'; export const SUBMIT_VALID_FORM = 'Submit Valid Form'; export const SUBMIT_INVALID_FORM = 'Submit Invalid Form'; diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/__tests__/index.spec.tsx index 35b1e84e33..95ae320f7e 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/__tests__/index.spec.tsx @@ -13,35 +13,35 @@ import { api } from '@eclipse-che/common'; import userEvent from '@testing-library/user-event'; import React from 'react'; -import { AddEditModalForm } from '..'; -import getComponentRenderer, { - screen, -} from '../../../../../../services/__mocks__/getComponentRenderer'; -import { EditTokenProps } from '../../../types'; + import { - NEW_GIT_PROVIDER_ENDPOINT, INVALID_GIT_PROVIDER_ENDPOINT, INVALID_GIT_PROVIDER_ENDPOINT_BUTTON, + NEW_GIT_PROVIDER_ENDPOINT, NEW_GIT_PROVIDER_ENDPOINT_BUTTON, -} from '../GitProviderEndpoint/__mocks__'; +} from '@/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderEndpoint/__mocks__'; import { - NEW_GIT_PROVIDER_ORGANIZATION, INVALID_GIT_PROVIDER_ORGANIZATION, - NEW_GIT_PROVIDER_ORGANIZATION_BUTTON, INVALID_GIT_PROVIDER_ORGANIZATION_BUTTON, -} from '../GitProviderOrganization/__mocks__'; + NEW_GIT_PROVIDER_ORGANIZATION, + NEW_GIT_PROVIDER_ORGANIZATION_BUTTON, +} from '@/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderOrganization/__mocks__'; import { INVALID_TOKEN_DATA, INVALID_TOKEN_DATA_BUTTON, NEW_TOKEN_DATA, NEW_TOKEN_DATA_BUTTON, -} from '../TokenData/__mocks__'; +} from '@/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenData/__mocks__'; import { INVALID_TOKEN_NAME, INVALID_TOKEN_NAME_BUTTON, NEW_TOKEN_NAME, NEW_TOKEN_NAME_BUTTON, -} from '../TokenName/__mocks__'; +} from '@/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenName/__mocks__'; +import { EditTokenProps } from '@/pages/UserPreferences/PersonalAccessTokens/types'; +import getComponentRenderer, { screen } from '@/services/__mocks__/getComponentRenderer'; + +import { AddEditModalForm } from '..'; jest.mock('../GitProviderEndpoint'); jest.mock('../GitProviderOrganization'); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/index.tsx index da265f4fd9..f78c657555 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/index.tsx @@ -13,13 +13,14 @@ import { api } from '@eclipse-che/common'; import { Form } from '@patternfly/react-core'; import React from 'react'; -import { DEFAULT_GIT_PROVIDER, PROVIDER_ENDPOINTS } from '../../../const'; -import { EditTokenProps } from '../../types'; -import { GitProviderEndpoint } from './GitProviderEndpoint'; -import { GitProviderOrganization } from './GitProviderOrganization'; -import { GitProviderSelector } from './GitProviderSelector'; -import { TokenData } from './TokenData'; -import { TokenName } from './TokenName'; + +import { DEFAULT_GIT_PROVIDER, PROVIDER_ENDPOINTS } from '@/pages/UserPreferences/const'; +import { GitProviderEndpoint } from '@/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderEndpoint'; +import { GitProviderOrganization } from '@/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderOrganization'; +import { GitProviderSelector } from '@/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderSelector'; +import { TokenData } from '@/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenData'; +import { TokenName } from '@/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenName'; +import { EditTokenProps } from '@/pages/UserPreferences/PersonalAccessTokens/types'; export type Props = EditTokenProps & { cheUserId: string; diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/__mocks__/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/__mocks__/index.tsx index 5959e98073..6a5b88be1f 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/__mocks__/index.tsx @@ -13,6 +13,7 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ import React from 'react'; + import { Props } from '..'; export class PersonalAccessTokenAddEditModal extends React.PureComponent { diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/__tests__/index.spec.tsx index 15a932318e..4df4caf747 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/__tests__/index.spec.tsx @@ -15,12 +15,15 @@ import { api } from '@eclipse-che/common'; import userEvent from '@testing-library/user-event'; import React from 'react'; + +import { + SUBMIT_INVALID_FORM, + SUBMIT_VALID_FORM, +} from '@/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/__mocks__'; +import { EditTokenProps } from '@/pages/UserPreferences/PersonalAccessTokens/types'; +import getComponentRenderer, { screen } from '@/services/__mocks__/getComponentRenderer'; + import { PersonalAccessTokenAddEditModal } from '..'; -import getComponentRenderer, { - screen, -} from '../../../../../services/__mocks__/getComponentRenderer'; -import { SUBMIT_INVALID_FORM, SUBMIT_VALID_FORM } from '../Form/__mocks__'; -import { EditTokenProps } from '../../types'; const { renderComponent } = getComponentRenderer(getComponent); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/index.tsx index ee8d0b9e89..82ee2e526c 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/index.tsx @@ -13,8 +13,9 @@ import { api } from '@eclipse-che/common'; import { Button, ButtonVariant, Modal, ModalVariant } from '@patternfly/react-core'; import React from 'react'; -import { AddEditModalForm } from './Form'; -import { EditTokenProps } from '../types'; + +import { AddEditModalForm } from '@/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form'; +import { EditTokenProps } from '@/pages/UserPreferences/PersonalAccessTokens/types'; export type Props = EditTokenProps & { cheUserId: string; diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/DeleteModal/__mocks__/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/DeleteModal/__mocks__/index.tsx index 46bcc373e4..c3fbdc5f0d 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/DeleteModal/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/DeleteModal/__mocks__/index.tsx @@ -13,6 +13,7 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ import React from 'react'; + import { Props } from '..'; export class PersonalAccessTokenDeleteModal extends React.PureComponent { diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/DeleteModal/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/DeleteModal/__tests__/index.spec.tsx index a2327c4869..06915eb5f3 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/DeleteModal/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/DeleteModal/__tests__/index.spec.tsx @@ -15,11 +15,14 @@ import { api } from '@eclipse-che/common'; import userEvent from '@testing-library/user-event'; import React from 'react'; + +import { + token1, + token2, +} from '@/pages/UserPreferences/PersonalAccessTokens/DeleteModal/__tests__/stub'; +import getComponentRenderer, { screen } from '@/services/__mocks__/getComponentRenderer'; + import { PersonalAccessTokenDeleteModal } from '..'; -import getComponentRenderer, { - screen, -} from '../../../../../services/__mocks__/getComponentRenderer'; -import { token1, token2 } from './stub'; const { renderComponent } = getComponentRenderer(getComponent); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/EmptyState/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/EmptyState/__tests__/index.spec.tsx index 5cc1ef8543..6778be24c3 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/EmptyState/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/EmptyState/__tests__/index.spec.tsx @@ -11,11 +11,10 @@ */ import React from 'react'; + +import getComponentRenderer, { fireEvent, screen } from '@/services/__mocks__/getComponentRenderer'; + import { PersonalAccessTokenEmptyState } from '..'; -import getComponentRenderer, { - fireEvent, - screen, -} from '../../../../../services/__mocks__/getComponentRenderer'; const { createSnapshot, renderComponent } = getComponentRenderer(getComponent); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/List/Toolbar/__mocks__/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/List/Toolbar/__mocks__/index.tsx index 150a312f54..72b3b86588 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/List/Toolbar/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/List/Toolbar/__mocks__/index.tsx @@ -11,6 +11,7 @@ */ import React from 'react'; + import { Props } from '..'; export class PersonalAccessTokenListToolbar extends React.PureComponent { diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/List/Toolbar/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/List/Toolbar/__tests__/index.spec.tsx index 5561440cad..84aaf952a3 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/List/Toolbar/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/List/Toolbar/__tests__/index.spec.tsx @@ -11,10 +11,10 @@ */ import React from 'react'; + +import getComponentRenderer, { screen } from '@/services/__mocks__/getComponentRenderer'; + import { PersonalAccessTokenListToolbar } from '..'; -import getComponentRenderer, { - screen, -} from '../../../../../../services/__mocks__/getComponentRenderer'; const { createSnapshot, renderComponent } = getComponentRenderer(getComponent); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/List/__mocks__/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/List/__mocks__/index.tsx index 37b22cf600..6d0f083e18 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/List/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/List/__mocks__/index.tsx @@ -11,6 +11,7 @@ */ import React from 'react'; + import { Props } from '..'; export class PersonalAccessTokenList extends React.Component { diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/List/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/List/__tests__/index.spec.tsx index e0d7780156..e43785e687 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/List/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/List/__tests__/index.spec.tsx @@ -12,12 +12,14 @@ import { api } from '@eclipse-che/common'; import React from 'react'; -import { PersonalAccessTokenList } from '..'; + import getComponentRenderer, { fireEvent, screen, within, -} from '../../../../../services/__mocks__/getComponentRenderer'; +} from '@/services/__mocks__/getComponentRenderer'; + +import { PersonalAccessTokenList } from '..'; jest.mock('../Toolbar'); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/List/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/List/index.tsx index ea95496c62..5070311658 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/List/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/List/index.tsx @@ -24,7 +24,8 @@ import { Tr, } from '@patternfly/react-table'; import React from 'react'; -import { PersonalAccessTokenListToolbar } from './Toolbar'; + +import { PersonalAccessTokenListToolbar } from '@/pages/UserPreferences/PersonalAccessTokens/List/Toolbar'; const COLUMN_NAMES: Omit< Record, diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/__tests__/index.spec.tsx index 895f7c74d8..4474f9cc81 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/__tests__/index.spec.tsx @@ -14,20 +14,22 @@ import { StateMock } from '@react-mock/state'; import React from 'react'; import { Provider } from 'react-redux'; import { Action, Store } from 'redux'; -import PersonalAccessTokens, { State } from '..'; -import { container } from '../../../../inversify.config'; -import { AppAlerts } from '../../../../services/alerts/appAlerts'; -import { AlertItem } from '../../../../services/helpers/types'; + +import { container } from '@/inversify.config'; +import { token1, token2 } from '@/pages/UserPreferences/PersonalAccessTokens/__tests__/stub'; import getComponentRenderer, { fireEvent, screen, waitFor, within, -} from '../../../../services/__mocks__/getComponentRenderer'; -import { AppThunk } from '../../../../store'; -import { ActionCreators } from '../../../../store/PersonalAccessToken'; -import { FakeStoreBuilder } from '../../../../store/__mocks__/storeBuilder'; -import { token1, token2 } from './stub'; +} from '@/services/__mocks__/getComponentRenderer'; +import { AppAlerts } from '@/services/alerts/appAlerts'; +import { AlertItem } from '@/services/helpers/types'; +import { AppThunk } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { ActionCreators } from '@/store/PersonalAccessToken'; + +import PersonalAccessTokens, { State } from '..'; jest.mock('../AddEditModal'); jest.mock('../DeleteModal'); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/index.tsx index 2e4e9a920f..4a7e35a7aa 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/index.tsx @@ -14,27 +14,28 @@ import { api, helpers } from '@eclipse-che/common'; import { AlertVariant, pluralize } from '@patternfly/react-core'; import React from 'react'; import { connect, ConnectedProps } from 'react-redux'; -import ProgressIndicator from '../../../components/Progress'; -import { lazyInject } from '../../../inversify.config'; -import { AppAlerts } from '../../../services/alerts/appAlerts'; -import { AppState } from '../../../store'; -import * as PersonalAccessTokenStore from '../../../store/PersonalAccessToken'; + +import ProgressIndicator from '@/components/Progress'; +import { lazyInject } from '@/inversify.config'; +import { PersonalAccessTokenAddEditModal } from '@/pages/UserPreferences/PersonalAccessTokens/AddEditModal'; +import { PersonalAccessTokenDeleteModal } from '@/pages/UserPreferences/PersonalAccessTokens/DeleteModal'; +import { PersonalAccessTokenEmptyState } from '@/pages/UserPreferences/PersonalAccessTokens/EmptyState'; +import { PersonalAccessTokenList } from '@/pages/UserPreferences/PersonalAccessTokens/List'; +import { EditTokenProps } from '@/pages/UserPreferences/PersonalAccessTokens/types'; +import { AppAlerts } from '@/services/alerts/appAlerts'; +import { AppState } from '@/store'; +import * as PersonalAccessTokenStore from '@/store/PersonalAccessToken'; import { - selectPersonalAccessTokensIsLoading, selectPersonalAccessTokens, selectPersonalAccessTokensError, -} from '../../../store/PersonalAccessToken/selectors'; -import * as UserIdStore from '../../../store/User/Id'; + selectPersonalAccessTokensIsLoading, +} from '@/store/PersonalAccessToken/selectors'; +import * as UserIdStore from '@/store/User/Id'; import { selectCheUserId, selectCheUserIdError, selectCheUserIsLoading, -} from '../../../store/User/Id/selectors'; -import { PersonalAccessTokenAddEditModal } from './AddEditModal'; -import { PersonalAccessTokenDeleteModal } from './DeleteModal'; -import { PersonalAccessTokenEmptyState } from './EmptyState'; -import { PersonalAccessTokenList } from './List'; -import { EditTokenProps } from './types'; +} from '@/store/User/Id/selectors'; export type Props = MappedProps; export type State = { diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/__tests__/index.spec.tsx index e03d905096..82330c980b 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/__tests__/index.spec.tsx @@ -15,9 +15,11 @@ import { createHashHistory, History } from 'history'; import React from 'react'; import { Provider } from 'react-redux'; import { Router } from 'react-router'; + +import getComponentRenderer, { screen } from '@/services/__mocks__/getComponentRenderer'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; + import UserPreferences from '..'; -import getComponentRenderer, { screen } from '../../../services/__mocks__/getComponentRenderer'; -import { FakeStoreBuilder } from '../../../store/__mocks__/storeBuilder'; jest.mock('../GitServicesTab'); jest.mock('../ContainerRegistriesTab'); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/index.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/index.tsx index 7415726d8b..db3cac8916 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/index.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/index.tsx @@ -13,17 +13,18 @@ import { PageSection, PageSectionVariants, Tab, Tabs, Title } from '@patternfly/react-core'; import { History } from 'history'; import React from 'react'; -import { ConnectedProps, connect } from 'react-redux'; -import { ROUTE } from '../../Routes/routes'; -import Head from '../../components/Head'; -import { UserPreferencesTab } from '../../services/helpers/types'; -import { AppState } from '../../store'; -import { actionCreators } from '../../store/GitOauthConfig'; -import { selectIsLoading } from '../../store/GitOauthConfig/selectors'; -import ContainerRegistries from './ContainerRegistriesTab'; -import GitConfig from './GitConfig'; -import GitServicesTab from './GitServicesTab'; -import PersonalAccessTokens from './PersonalAccessTokens'; +import { connect, ConnectedProps } from 'react-redux'; + +import Head from '@/components/Head'; +import ContainerRegistries from '@/pages/UserPreferences/ContainerRegistriesTab'; +import GitConfig from '@/pages/UserPreferences/GitConfig'; +import GitServicesTab from '@/pages/UserPreferences/GitServicesTab'; +import PersonalAccessTokens from '@/pages/UserPreferences/PersonalAccessTokens'; +import { ROUTE } from '@/Routes/routes'; +import { UserPreferencesTab } from '@/services/helpers/types'; +import { AppState } from '@/store'; +import { actionCreators } from '@/store/GitOauthConfig'; +import { selectIsLoading } from '@/store/GitOauthConfig/selectors'; const CONTAINER_REGISTRIES_TAB: UserPreferencesTab = 'container-registries'; const GIT_SERVICES_TAB: UserPreferencesTab = 'git-services'; diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/ConversionButton/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/WorkspaceDetails/ConversionButton/__tests__/index.spec.tsx index d0bb336625..da270d1656 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/ConversionButton/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/ConversionButton/__tests__/index.spec.tsx @@ -10,11 +10,12 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { render, RenderResult, screen, waitFor } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; +import React from 'react'; import renderer, { ReactTestRendererJSON } from 'react-test-renderer'; + import WorkspaceConversionButton from '..'; -import userEvent from '@testing-library/user-event'; const mockOnConvert = jest.fn(); diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/ConversionButton/index.tsx b/packages/dashboard-frontend/src/pages/WorkspaceDetails/ConversionButton/index.tsx index 2b8f2e67e5..08dd6559b3 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/ConversionButton/index.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/ConversionButton/index.tsx @@ -10,8 +10,8 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { Button } from '@patternfly/react-core'; +import React from 'react'; type Props = { onConvert: () => Promise; diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/DevfileEditorTab/__mocks__/index.tsx b/packages/dashboard-frontend/src/pages/WorkspaceDetails/DevfileEditorTab/__mocks__/index.tsx index 721ef75035..204ec44e21 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/DevfileEditorTab/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/DevfileEditorTab/__mocks__/index.tsx @@ -12,9 +12,11 @@ import common from '@eclipse-che/common'; import React from 'react'; + +import devfileApi from '@/services/devfileApi'; +import { Workspace } from '@/services/workspace-adapter'; + import { Props, State } from '..'; -import devfileApi from '../../../../services/devfileApi'; -import { Workspace } from '../../../../services/workspace-adapter'; export default class EditorTab extends React.PureComponent { cancelChanges: () => void; diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/DevfileEditorTab/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/WorkspaceDetails/DevfileEditorTab/__tests__/index.spec.tsx index 79e004bb8a..c0cce745a7 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/DevfileEditorTab/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/DevfileEditorTab/__tests__/index.spec.tsx @@ -17,17 +17,19 @@ import React from 'react'; import { Provider } from 'react-redux'; import renderer, { ReactTestRenderer } from 'react-test-renderer'; import { Store } from 'redux'; -import EditorTab from '..'; -import { container } from '../../../../inversify.config'; -import devfileApi from '../../../../services/devfileApi'; -import { DEVWORKSPACE_STORAGE_TYPE_ATTR } from '../../../../services/devfileApi/devWorkspace/spec/template'; -import { constructWorkspace, Workspace } from '../../../../services/workspace-adapter'; + +import { container } from '@/inversify.config'; +import devfileApi from '@/services/devfileApi'; +import { DEVWORKSPACE_STORAGE_TYPE_ATTR } from '@/services/devfileApi/devWorkspace/spec/template'; +import { constructWorkspace, Workspace } from '@/services/workspace-adapter'; import { - DevWorkspaceClient, DEVWORKSPACE_METADATA_ANNOTATION, -} from '../../../../services/workspace-client/devworkspace/devWorkspaceClient'; -import { DevWorkspaceBuilder } from '../../../../store/__mocks__/devWorkspaceBuilder'; -import { FakeStoreBuilder } from '../../../../store/__mocks__/storeBuilder'; + DevWorkspaceClient, +} from '@/services/workspace-client/devworkspace/devWorkspaceClient'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; + +import EditorTab from '..'; // uses the Devfile Editor mock jest.mock('../../../../components/DevfileEditor'); diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/DevfileEditorTab/index.tsx b/packages/dashboard-frontend/src/pages/WorkspaceDetails/DevfileEditorTab/index.tsx index 9c121630d5..f1ce52abdf 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/DevfileEditorTab/index.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/DevfileEditorTab/index.tsx @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; +import common from '@eclipse-che/common'; import { Alert, AlertActionCloseButton, @@ -24,22 +24,22 @@ import { Text, TextContent, } from '@patternfly/react-core'; -import * as lodash from 'lodash'; import { load } from 'js-yaml'; -import common from '@eclipse-che/common'; -import DevfileEditor, { DevfileEditor as Editor } from '../../../components/DevfileEditor'; -import EditorTools from '../../../components/EditorTools'; -import { constructWorkspace, Workspace } from '../../../services/workspace-adapter'; -import devfileApi, { isDevfileV2, isDevWorkspace } from '../../../services/devfileApi'; +import * as lodash from 'lodash'; +import React from 'react'; + +import DevfileEditor, { DevfileEditor as Editor } from '@/components/DevfileEditor'; +import EditorTools from '@/components/EditorTools'; +import { container } from '@/inversify.config'; +import styles from '@/pages/WorkspaceDetails/DevfileEditorTab/index.module.css'; +import devfileApi, { isDevfileV2, isDevWorkspace } from '@/services/devfileApi'; +import { DevWorkspaceStatus } from '@/services/helpers/types'; +import { constructWorkspace, Workspace } from '@/services/workspace-adapter'; import { + DEVWORKSPACE_METADATA_ANNOTATION, DEVWORKSPACE_NEXT_START_ANNOTATION, DevWorkspaceClient, - DEVWORKSPACE_METADATA_ANNOTATION, -} from '../../../services/workspace-client/devworkspace/devWorkspaceClient'; -import { container } from '../../../inversify.config'; - -import styles from './index.module.css'; -import { DevWorkspaceStatus } from '../../../services/helpers/types'; +} from '@/services/workspace-client/devworkspace/devWorkspaceClient'; export type Props = { onSave: (workspace: Workspace) => Promise; diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/DevworkspaceEditorTab/index.tsx b/packages/dashboard-frontend/src/pages/WorkspaceDetails/DevworkspaceEditorTab/index.tsx index 0f4d9c4325..95fed789f4 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/DevworkspaceEditorTab/index.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/DevworkspaceEditorTab/index.tsx @@ -10,13 +10,13 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { TextContent } from '@patternfly/react-core'; -import DevworkspaceEditor from '../../../components/WorkspaceEditor'; -import EditorTools from '../../../components/EditorTools'; -import { Workspace } from '../../../services/workspace-adapter'; +import React from 'react'; -import styles from './index.module.css'; +import EditorTools from '@/components/EditorTools'; +import DevworkspaceEditor from '@/components/WorkspaceEditor'; +import styles from '@/pages/WorkspaceDetails/DevworkspaceEditorTab/index.module.css'; +import { Workspace } from '@/services/workspace-adapter'; export type Props = { workspace: Workspace; diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/Header/Actions/Button.tsx b/packages/dashboard-frontend/src/pages/WorkspaceDetails/Header/Actions/Button.tsx index 09262f9a5f..ad057980f5 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/Header/Actions/Button.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/Header/Actions/Button.tsx @@ -10,10 +10,11 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { Button } from '@patternfly/react-core'; -import { WorkspaceAction } from '../../../../services/helpers/types'; -import { ActionContextType } from '../../../../contexts/WorkspaceActions'; +import React from 'react'; + +import { ActionContextType } from '@/contexts/WorkspaceActions'; +import { WorkspaceAction } from '@/services/helpers/types'; type Props = { context: ActionContextType; diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/Header/Actions/Dropdown/index.tsx b/packages/dashboard-frontend/src/pages/WorkspaceDetails/Header/Actions/Dropdown/index.tsx index ca330d7310..e33c5f1913 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/Header/Actions/Dropdown/index.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/Header/Actions/Dropdown/index.tsx @@ -10,19 +10,19 @@ * Red Hat, Inc. - initial API and implementation */ -import { History } from 'history'; -import React from 'react'; import { Dropdown, DropdownItem, DropdownPosition, DropdownToggle } from '@patternfly/react-core'; import { CaretDownIcon } from '@patternfly/react-icons'; +import { History } from 'history'; +import React from 'react'; + +import { ActionContextType } from '@/contexts/WorkspaceActions'; +import styles from '@/pages/WorkspaceDetails/Header/Actions/Dropdown/index.module.css'; import { - WorkspaceStatus, + DeprecatedWorkspaceStatus, DevWorkspaceStatus, WorkspaceAction, - DeprecatedWorkspaceStatus, -} from '../../../../../services/helpers/types'; -import { ActionContextType } from '../../../../../contexts/WorkspaceActions'; - -import styles from './index.module.css'; + WorkspaceStatus, +} from '@/services/helpers/types'; type Props = { context: ActionContextType; diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/Header/Actions/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/WorkspaceDetails/Header/Actions/__tests__/index.spec.tsx index b394fb0827..f0dd359ab5 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/Header/Actions/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/Header/Actions/__tests__/index.spec.tsx @@ -14,19 +14,21 @@ import { render, RenderResult, screen, waitFor } from '@testing-library/react'; import { createHashHistory, History } from 'history'; import React from 'react'; import { Provider } from 'react-redux'; -import { HeaderActionSelect } from '..'; +import { Store } from 'redux'; + +import devfileApi from '@/services/devfileApi'; import { + DeprecatedWorkspaceStatus, WorkspaceAction, WorkspaceStatus, - DeprecatedWorkspaceStatus, -} from '../../../../../services/helpers/types'; -import { Workspace } from '../../../../../services/workspace-adapter'; -import { AppThunk } from '../../../../../store'; -import { ActionCreators, ResourceQueryParams } from '../../../../../store/Workspaces'; -import { FakeStoreBuilder } from '../../../../../store/__mocks__/storeBuilder'; -import { DevWorkspaceBuilder } from '../../../../../store/__mocks__/devWorkspaceBuilder'; -import { Store } from 'redux'; -import devfileApi from '../../../../../services/devfileApi'; +} from '@/services/helpers/types'; +import { Workspace } from '@/services/workspace-adapter'; +import { AppThunk } from '@/store'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { ActionCreators, ResourceQueryParams } from '@/store/Workspaces'; + +import { HeaderActionSelect } from '..'; /* eslint-disable @typescript-eslint/no-unused-vars */ jest.mock('../../../../../store/Workspaces/index', () => { diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/Header/Actions/index.tsx b/packages/dashboard-frontend/src/pages/WorkspaceDetails/Header/Actions/index.tsx index 636fc786ac..8602d312c0 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/Header/Actions/index.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/Header/Actions/index.tsx @@ -10,23 +10,24 @@ * Red Hat, Inc. - initial API and implementation */ +import common from '@eclipse-che/common'; import { AlertVariant } from '@patternfly/react-core'; -import React from 'react'; import { History } from 'history'; -import common from '@eclipse-che/common'; -import WorkspaceActionsProvider from '../../../../contexts/WorkspaceActions/Provider'; +import React from 'react'; + +import { ActionContextType, WorkspaceActionsConsumer } from '@/contexts/WorkspaceActions'; +import WorkspaceActionsProvider from '@/contexts/WorkspaceActions/Provider'; +import { lazyInject } from '@/inversify.config'; +import ButtonAction from '@/pages/WorkspaceDetails/Header/Actions/Button'; +import DropdownActions from '@/pages/WorkspaceDetails/Header/Actions/Dropdown'; +import { AppAlerts } from '@/services/alerts/appAlerts'; +import getRandomString from '@/services/helpers/random'; import { + DeprecatedWorkspaceStatus, + DevWorkspaceStatus, WorkspaceAction, WorkspaceStatus, - DevWorkspaceStatus, - DeprecatedWorkspaceStatus, -} from '../../../../services/helpers/types'; -import { ActionContextType, WorkspaceActionsConsumer } from '../../../../contexts/WorkspaceActions'; -import { lazyInject } from '../../../../inversify.config'; -import { AppAlerts } from '../../../../services/alerts/appAlerts'; -import getRandomString from '../../../../services/helpers/random'; -import DropdownActions from './Dropdown'; -import ButtonAction from './Button'; +} from '@/services/helpers/types'; type Props = { workspaceUID: string; diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/Header/index.tsx b/packages/dashboard-frontend/src/pages/WorkspaceDetails/Header/index.tsx index 8c3924e2f4..b9a8f0589a 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/Header/index.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/Header/index.tsx @@ -10,8 +10,9 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { + Breadcrumb, + BreadcrumbItem, Flex, FlexItem, PageSection, @@ -22,15 +23,15 @@ import { TextContent, TextVariants, } from '@patternfly/react-core'; -import { Breadcrumb, BreadcrumbItem } from '@patternfly/react-core'; -import WorkspaceStatusLabel from '../../../components/WorkspaceStatusLabel'; +import React from 'react'; -import styles from './index.module.css'; +import WorkspaceStatusLabel from '@/components/WorkspaceStatusLabel'; +import styles from '@/pages/WorkspaceDetails/Header/index.module.css'; import { DeprecatedWorkspaceStatus, DevWorkspaceStatus, WorkspaceStatus, -} from '../../../services/helpers/types'; +} from '@/services/helpers/types'; type Props = { workspacesLink: string; diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/InfrastructureNamespace.tsx b/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/InfrastructureNamespace.tsx index 111147ffcd..1a34120bb4 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/InfrastructureNamespace.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/InfrastructureNamespace.tsx @@ -10,10 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { FormGroup } from '@patternfly/react-core'; +import React from 'react'; -import overviewStyles from './index.module.css'; +import overviewStyles from '@/pages/WorkspaceDetails/OverviewTab/index.module.css'; type Props = { namespace: string; diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/Projects.tsx b/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/Projects.tsx index b4e0d0325f..d02f3d5f9b 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/Projects.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/Projects.tsx @@ -10,10 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { FormGroup } from '@patternfly/react-core'; +import React from 'react'; -import overviewStyles from './index.module.css'; +import overviewStyles from '@/pages/WorkspaceDetails/OverviewTab/index.module.css'; type Props = { projects: string[]; diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/StorageType/__mocks__/index.tsx b/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/StorageType/__mocks__/index.tsx index a1bfdee87a..075fbcc369 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/StorageType/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/StorageType/__mocks__/index.tsx @@ -11,6 +11,7 @@ */ import React from 'react'; + import { Props, State } from '..'; export default class StorageTypeFormGroup extends React.PureComponent { diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/StorageType/index.tsx b/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/StorageType/index.tsx index 3c036726b4..bf1fb75db8 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/StorageType/index.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/StorageType/index.tsx @@ -10,29 +10,28 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { - FormGroup, + Alert, + AlertVariant, Button, + FormGroup, Modal, ModalVariant, - TextVariants, - TextContent, - Text, Radio, - Alert, - AlertVariant, + Text, + TextContent, + TextVariants, } from '@patternfly/react-core'; -import { AppState } from '../../../../store'; -import { connect, ConnectedProps } from 'react-redux'; import { OutlinedQuestionCircleIcon, PencilAltIcon } from '@patternfly/react-icons'; -import * as storageTypeService from '../../../../services/storageTypes'; -import { selectBranding } from '../../../../store/Branding/selectors'; +import React from 'react'; +import { connect, ConnectedProps } from 'react-redux'; -import overviewStyles from '../index.module.css'; -import styles from './index.module.css'; -import { selectPvcStrategy } from '../../../../store/ServerConfig/selectors'; -import * as storageTypesService from '../../../../services/storageTypes'; +import overviewStyles from '@/pages/WorkspaceDetails/OverviewTab/index.module.css'; +import styles from '@/pages/WorkspaceDetails/OverviewTab/StorageType/index.module.css'; +import * as storageTypeService from '@/services/storageTypes'; +import { AppState } from '@/store'; +import { selectBranding } from '@/store/Branding/selectors'; +import { selectPvcStrategy } from '@/store/ServerConfig/selectors'; export type Props = MappedProps & { readonly: boolean; @@ -58,7 +57,7 @@ export class StorageTypeFormGroup extends React.PureComponent { isInfoOpen: false, }; - const availableTypes = storageTypesService.getAvailable(); + const availableTypes = storageTypeService.getAvailable(); if (Array.isArray(availableTypes)) { this.storageTypes = availableTypes; diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/WorkspaceName/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/WorkspaceName/__tests__/index.spec.tsx index 81bcd21694..b7a7d0e878 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/WorkspaceName/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/WorkspaceName/__tests__/index.spec.tsx @@ -10,8 +10,9 @@ * Red Hat, Inc. - initial API and implementation */ +import { fireEvent, render, RenderResult, screen } from '@testing-library/react'; import React from 'react'; -import { RenderResult, render, screen, fireEvent } from '@testing-library/react'; + import { WorkspaceNameFormGroup } from '..'; describe('Overview Tab Workspace Name Input', () => { diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/WorkspaceName/index.tsx b/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/WorkspaceName/index.tsx index e7d337654b..354c9d8a57 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/WorkspaceName/index.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/WorkspaceName/index.tsx @@ -19,8 +19,8 @@ import { } from '@patternfly/react-icons'; import React from 'react'; -import overviewStyles from '../index.module.css'; -import workspaceNameStyles from './index.module.css'; +import overviewStyles from '@/pages/WorkspaceDetails/OverviewTab/index.module.css'; +import workspaceNameStyles from '@/pages/WorkspaceDetails/OverviewTab/WorkspaceName/index.module.css'; const MIN_LENGTH = 3; const MAX_LENGTH = 100; diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/index.tsx b/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/index.tsx index 09d123be15..e61d4fdfd8 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/index.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/index.tsx @@ -10,15 +10,16 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { Form, PageSection, PageSectionVariants } from '@patternfly/react-core'; -import StorageTypeFormGroup from './StorageType'; -import { WorkspaceNameFormGroup } from './WorkspaceName'; -import InfrastructureNamespaceFormGroup from './InfrastructureNamespace'; -import ProjectsFormGroup from './Projects'; -import { constructWorkspace, Workspace } from '../../../services/workspace-adapter'; import { cloneDeep } from 'lodash'; -import { DevWorkspaceStatus } from '../../../services/helpers/types'; +import React from 'react'; + +import InfrastructureNamespaceFormGroup from '@/pages/WorkspaceDetails/OverviewTab/InfrastructureNamespace'; +import ProjectsFormGroup from '@/pages/WorkspaceDetails/OverviewTab/Projects'; +import StorageTypeFormGroup from '@/pages/WorkspaceDetails/OverviewTab/StorageType'; +import { WorkspaceNameFormGroup } from '@/pages/WorkspaceDetails/OverviewTab/WorkspaceName'; +import { DevWorkspaceStatus } from '@/services/helpers/types'; +import { constructWorkspace, Workspace } from '@/services/workspace-adapter'; type Props = { onSave: (workspace: Workspace) => Promise; diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/__mocks__/index.tsx b/packages/dashboard-frontend/src/pages/WorkspaceDetails/__mocks__/index.tsx index 0698da4b84..2d8d64ecb2 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/__mocks__/index.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/__mocks__/index.tsx @@ -11,6 +11,7 @@ */ import React from 'react'; + import { Props, State } from '..'; export const mockShowAlert = jest.fn(); diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/WorkspaceDetails/__tests__/index.spec.tsx index 05914646f4..51fe2d1ff0 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/__tests__/index.spec.tsx @@ -10,17 +10,19 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { render, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { createHashHistory, History, Location } from 'history'; +import React from 'react'; import { Provider } from 'react-redux'; import { Router } from 'react-router'; -import { WorkspaceDetails, Props } from '..'; -import { DevWorkspaceBuilder } from '../../../store/__mocks__/devWorkspaceBuilder'; -import { FakeStoreBuilder } from '../../../store/__mocks__/storeBuilder'; -import { constructWorkspace } from '../../../services/workspace-adapter'; -import devfileApi from '../../../services/devfileApi'; + +import devfileApi from '@/services/devfileApi'; +import { constructWorkspace } from '@/services/workspace-adapter'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; + +import { Props, WorkspaceDetails } from '..'; const mockOnSave = jest.fn(); diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/index.tsx b/packages/dashboard-frontend/src/pages/WorkspaceDetails/index.tsx index 0366249e98..762c63cbe3 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/index.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/index.tsx @@ -10,8 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; -import { Link } from 'react-router-dom'; +import common from '@eclipse-che/common'; import { AlertVariant, Button, @@ -20,25 +19,28 @@ import { Tab, Tabs, } from '@patternfly/react-core'; -import common from '@eclipse-che/common'; -import Head from '../../components/Head'; -import { WorkspaceDetailsTab } from '../../services/helpers/types'; -import Header from './Header'; -import ProgressIndicator from '../../components/Progress'; -import { HeaderActionSelect } from './Header/Actions'; -import { lazyInject } from '../../inversify.config'; -import { AppAlerts } from '../../services/alerts/appAlerts'; -import OverviewTab, { OverviewTab as Overview } from './OverviewTab'; -import DevfileEditorTab, { DevfileEditorTab as Editor } from './DevfileEditorTab'; -import DevworkspaceEditorTab from './DevworkspaceEditorTab'; -import { History, UnregisterCallback, Location } from 'history'; -import { Workspace } from '../../services/workspace-adapter'; -import UnsavedChangesModal from '../../components/UnsavedChangesModal'; -import { buildDetailsLocation } from '../../services/helpers/location'; -import WorkspaceEvents from '../../components/WorkspaceEvents'; +import { History, Location, UnregisterCallback } from 'history'; +import React from 'react'; +import { Link } from 'react-router-dom'; -import styles from './index.module.css'; -import WorkspaceLogs from '../../components/WorkspaceLogs'; +import Head from '@/components/Head'; +import ProgressIndicator from '@/components/Progress'; +import UnsavedChangesModal from '@/components/UnsavedChangesModal'; +import WorkspaceEvents from '@/components/WorkspaceEvents'; +import WorkspaceLogs from '@/components/WorkspaceLogs'; +import { lazyInject } from '@/inversify.config'; +import DevfileEditorTab, { + DevfileEditorTab as Editor, +} from '@/pages/WorkspaceDetails/DevfileEditorTab'; +import DevworkspaceEditorTab from '@/pages/WorkspaceDetails/DevworkspaceEditorTab'; +import Header from '@/pages/WorkspaceDetails/Header'; +import { HeaderActionSelect } from '@/pages/WorkspaceDetails/Header/Actions'; +import styles from '@/pages/WorkspaceDetails/index.module.css'; +import OverviewTab, { OverviewTab as Overview } from '@/pages/WorkspaceDetails/OverviewTab'; +import { AppAlerts } from '@/services/alerts/appAlerts'; +import { buildDetailsLocation } from '@/services/helpers/location'; +import { WorkspaceDetailsTab } from '@/services/helpers/types'; +import { Workspace } from '@/services/workspace-adapter'; export const SECTION_THEME = PageSectionVariants.light; diff --git a/packages/dashboard-frontend/src/pages/WorkspacesList/EmptyState/NoWorkspaces.tsx b/packages/dashboard-frontend/src/pages/WorkspacesList/EmptyState/NoWorkspaces.tsx index 326531ea48..fe8276e5ba 100644 --- a/packages/dashboard-frontend/src/pages/WorkspacesList/EmptyState/NoWorkspaces.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspacesList/EmptyState/NoWorkspaces.tsx @@ -10,16 +10,16 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { - Title, Button, EmptyState, - EmptyStateVariant, - EmptyStateIcon, EmptyStateBody, + EmptyStateIcon, + EmptyStateVariant, + Title, } from '@patternfly/react-core'; import { CubesIcon } from '@patternfly/react-icons'; +import React from 'react'; type Props = { onAddWorkspace: () => void; diff --git a/packages/dashboard-frontend/src/pages/WorkspacesList/EmptyState/NothingFound.tsx b/packages/dashboard-frontend/src/pages/WorkspacesList/EmptyState/NothingFound.tsx index 4de9dd9644..57dc606ca3 100644 --- a/packages/dashboard-frontend/src/pages/WorkspacesList/EmptyState/NothingFound.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspacesList/EmptyState/NothingFound.tsx @@ -10,15 +10,15 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { - Title, EmptyState, - EmptyStateVariant, - EmptyStateIcon, EmptyStateBody, + EmptyStateIcon, + EmptyStateVariant, + Title, } from '@patternfly/react-core'; import { SearchIcon } from '@patternfly/react-icons'; +import React from 'react'; export default class NothingFoundEmptyState extends React.PureComponent { public render(): React.ReactElement { diff --git a/packages/dashboard-frontend/src/pages/WorkspacesList/Rows.tsx b/packages/dashboard-frontend/src/pages/WorkspacesList/Rows.tsx index 8681af2dc5..dd9a942386 100644 --- a/packages/dashboard-frontend/src/pages/WorkspacesList/Rows.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspacesList/Rows.tsx @@ -10,17 +10,18 @@ * Red Hat, Inc. - initial API and implementation */ +import { Button } from '@patternfly/react-core'; +import { IRow, SortByDirection } from '@patternfly/react-table'; +import { Location } from 'history'; import React from 'react'; import { Link } from 'react-router-dom'; -import { Location } from 'history'; -import { IRow, SortByDirection } from '@patternfly/react-table'; -import { Button } from '@patternfly/react-core'; -import WorkspaceIndicator from '../../components/Workspace/Indicator'; -import { formatDate, formatRelativeDate } from '../../services/helpers/date'; -import { buildDetailsLocation, buildIdeLoaderLocation } from '../../services/helpers/location'; -import { Workspace } from '../../services/workspace-adapter'; -import devfileApi from '../../services/devfileApi'; -import { DevWorkspaceStatus, WorkspaceDetailsTab } from '../../services/helpers/types'; + +import WorkspaceIndicator from '@/components/Workspace/Indicator'; +import devfileApi from '@/services/devfileApi'; +import { formatDate, formatRelativeDate } from '@/services/helpers/date'; +import { buildDetailsLocation, buildIdeLoaderLocation } from '@/services/helpers/location'; +import { DevWorkspaceStatus, WorkspaceDetailsTab } from '@/services/helpers/types'; +import { Workspace } from '@/services/workspace-adapter'; export interface RowData extends IRow { props: { diff --git a/packages/dashboard-frontend/src/pages/WorkspacesList/Toolbar/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/WorkspacesList/Toolbar/__tests__/index.spec.tsx index 4fefa74b09..effa20235b 100644 --- a/packages/dashboard-frontend/src/pages/WorkspacesList/Toolbar/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspacesList/Toolbar/__tests__/index.spec.tsx @@ -12,12 +12,14 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import React from 'react'; -import { render, screen, RenderResult, fireEvent } from '@testing-library/react'; +import { fireEvent, render, RenderResult, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; +import React from 'react'; + +import { constructWorkspace, Workspace } from '@/services/workspace-adapter'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; + import WorkspacesListToolbar from '..'; -import { constructWorkspace, Workspace } from '../../../../services/workspace-adapter'; -import { DevWorkspaceBuilder } from '../../../../store/__mocks__/devWorkspaceBuilder'; let workspaces: Workspace[]; let isSelectedAll: boolean; diff --git a/packages/dashboard-frontend/src/pages/WorkspacesList/Toolbar/index.tsx b/packages/dashboard-frontend/src/pages/WorkspacesList/Toolbar/index.tsx index bd3298ffff..11445d9092 100644 --- a/packages/dashboard-frontend/src/pages/WorkspacesList/Toolbar/index.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspacesList/Toolbar/index.tsx @@ -10,22 +10,22 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { - ToolbarContent, - ToolbarItem, - Checkbox, - Toolbar, Button, + Checkbox, InputGroup, TextInput, + Toolbar, + ToolbarContent, + ToolbarItem, ToolbarToggleGroup, } from '@patternfly/react-core'; import { EllipsisVIcon, PlusCircleIcon, SearchIcon } from '@patternfly/react-icons'; -import match from '../../../services/helpers/filter'; +import React from 'react'; -import styles from './index.module.css'; -import { Workspace } from '../../../services/workspace-adapter'; +import styles from '@/pages/WorkspacesList/Toolbar/index.module.css'; +import match from '@/services/helpers/filter'; +import { Workspace } from '@/services/workspace-adapter'; type Props = { selectedAll: boolean; diff --git a/packages/dashboard-frontend/src/pages/WorkspacesList/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/WorkspacesList/__tests__/index.spec.tsx index 38c11688a3..35b71a2f0a 100644 --- a/packages/dashboard-frontend/src/pages/WorkspacesList/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspacesList/__tests__/index.spec.tsx @@ -12,16 +12,18 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import React from 'react'; +import { render, RenderResult, screen, waitFor } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; import { createMemoryHistory } from 'history'; -import { render, screen, RenderResult, waitFor } from '@testing-library/react'; +import React from 'react'; import { Router } from 'react-router'; -import userEvent from '@testing-library/user-event'; + +import { BrandingData } from '@/services/bootstrap/branding.constant'; +import { WorkspaceAction } from '@/services/helpers/types'; +import { constructWorkspace, Workspace } from '@/services/workspace-adapter'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; + import WorkspacesList from '..'; -import { BrandingData } from '../../../services/bootstrap/branding.constant'; -import { WorkspaceAction } from '../../../services/helpers/types'; -import { constructWorkspace, Workspace } from '../../../services/workspace-adapter'; -import { DevWorkspaceBuilder } from '../../../store/__mocks__/devWorkspaceBuilder'; jest.mock('../../../components/Head', () => { const FakeHead = () => { diff --git a/packages/dashboard-frontend/src/pages/WorkspacesList/index.tsx b/packages/dashboard-frontend/src/pages/WorkspacesList/index.tsx index ddf4c342e2..2fc6479d3b 100644 --- a/packages/dashboard-frontend/src/pages/WorkspacesList/index.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspacesList/index.tsx @@ -11,7 +11,17 @@ */ import 'reflect-metadata'; -import React from 'react'; + +import common from '@eclipse-che/common'; +import { + AlertVariant, + Divider, + PageSection, + PageSectionVariants, + Text, + TextContent, +} from '@patternfly/react-core'; +import { ExternalLinkAltIcon } from '@patternfly/react-icons'; import { classNames, IAction, @@ -26,30 +36,21 @@ import { Visibility, } from '@patternfly/react-table'; import { History, Location } from 'history'; -import { - AlertVariant, - Divider, - PageSection, - PageSectionVariants, - Text, - TextContent, -} from '@patternfly/react-core'; -import { ExternalLinkAltIcon } from '@patternfly/react-icons'; -import common from '@eclipse-che/common'; -import { BrandingData } from '../../services/bootstrap/branding.constant'; -import { DevWorkspaceStatus, WorkspaceAction } from '../../services/helpers/types'; -import Head from '../../components/Head'; -import { buildGettingStartedLocation } from '../../services/helpers/location'; -import { AppAlerts } from '../../services/alerts/appAlerts'; -import getRandomString from '../../services/helpers/random'; -import WorkspacesListToolbar from './Toolbar'; -import { lazyInject } from '../../inversify.config'; -import NoWorkspacesEmptyState from './EmptyState/NoWorkspaces'; -import NothingFoundEmptyState from './EmptyState/NothingFound'; -import { buildRows, RowData } from './Rows'; -import { Workspace } from '../../services/workspace-adapter'; - -import styles from './index.module.css'; +import React from 'react'; + +import Head from '@/components/Head'; +import { lazyInject } from '@/inversify.config'; +import NothingFoundEmptyState from '@/pages/WorkspacesList/EmptyState/NothingFound'; +import NoWorkspacesEmptyState from '@/pages/WorkspacesList/EmptyState/NoWorkspaces'; +import styles from '@/pages/WorkspacesList/index.module.css'; +import { buildRows, RowData } from '@/pages/WorkspacesList/Rows'; +import WorkspacesListToolbar from '@/pages/WorkspacesList/Toolbar'; +import { AppAlerts } from '@/services/alerts/appAlerts'; +import { BrandingData } from '@/services/bootstrap/branding.constant'; +import { buildGettingStartedLocation } from '@/services/helpers/location'; +import getRandomString from '@/services/helpers/random'; +import { DevWorkspaceStatus, WorkspaceAction } from '@/services/helpers/types'; +import { Workspace } from '@/services/workspace-adapter'; type Props = { branding: BrandingData; diff --git a/packages/dashboard-frontend/src/preload/__tests__/main.spec.ts b/packages/dashboard-frontend/src/preload/__tests__/main.spec.ts index edc9749798..9a2c2b275e 100644 --- a/packages/dashboard-frontend/src/preload/__tests__/main.spec.ts +++ b/packages/dashboard-frontend/src/preload/__tests__/main.spec.ts @@ -10,9 +10,9 @@ * Red Hat, Inc. - initial API and implementation */ -import { REMOTES_ATTR } from '../../services/helpers/factoryFlow/buildFactoryParams'; -import SessionStorageService, { SessionStorageKey } from '../../services/session-storage'; -import { redirectToDashboard, buildFactoryLoaderPath, storePathIfNeeded } from '../main'; +import { buildFactoryLoaderPath, redirectToDashboard, storePathIfNeeded } from '@/preload/main'; +import { REMOTES_ATTR } from '@/services/helpers/factoryFlow/buildFactoryParams'; +import SessionStorageService, { SessionStorageKey } from '@/services/session-storage'; describe('test buildFactoryLoaderPath()', () => { describe('SSHLocation', () => { diff --git a/packages/dashboard-frontend/src/preload/index.ts b/packages/dashboard-frontend/src/preload/index.ts index 527a62a0cb..2b3570c014 100644 --- a/packages/dashboard-frontend/src/preload/index.ts +++ b/packages/dashboard-frontend/src/preload/index.ts @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { redirectToDashboard } from './main'; +import { redirectToDashboard } from '@/preload/main'; (function (): void { redirectToDashboard(); diff --git a/packages/dashboard-frontend/src/preload/main.ts b/packages/dashboard-frontend/src/preload/main.ts index f6567a51c7..e47eeee2b4 100644 --- a/packages/dashboard-frontend/src/preload/main.ts +++ b/packages/dashboard-frontend/src/preload/main.ts @@ -11,12 +11,13 @@ */ import { helpers } from '@eclipse-che/common'; -import { FactoryLocation, FactoryLocationAdapter } from '../services/factory-location-adapter'; + +import { FactoryLocation, FactoryLocationAdapter } from '@/services/factory-location-adapter'; import { PROPAGATE_FACTORY_ATTRS, REMOTES_ATTR, -} from '../services/helpers/factoryFlow/buildFactoryParams'; -import SessionStorageService, { SessionStorageKey } from '../services/session-storage'; +} from '@/services/helpers/factoryFlow/buildFactoryParams'; +import SessionStorageService, { SessionStorageKey } from '@/services/session-storage'; export function redirectToDashboard(): void { if (window.location.pathname.startsWith('/dashboard/')) { diff --git a/packages/dashboard-frontend/src/services/__mocks__/getComponentRenderer.tsx b/packages/dashboard-frontend/src/services/__mocks__/getComponentRenderer.tsx index 008e1db8d5..3f18a6a333 100644 --- a/packages/dashboard-frontend/src/services/__mocks__/getComponentRenderer.tsx +++ b/packages/dashboard-frontend/src/services/__mocks__/getComponentRenderer.tsx @@ -10,8 +10,8 @@ * Red Hat, Inc. - initial API and implementation */ -import React from 'react'; import { render } from '@testing-library/react'; +import React from 'react'; import renderer from 'react-test-renderer'; export * from '@testing-library/react'; diff --git a/packages/dashboard-frontend/src/services/alerts/appAlerts.ts b/packages/dashboard-frontend/src/services/alerts/appAlerts.ts index 81702ba7fa..ea96095832 100644 --- a/packages/dashboard-frontend/src/services/alerts/appAlerts.ts +++ b/packages/dashboard-frontend/src/services/alerts/appAlerts.ts @@ -11,8 +11,10 @@ */ import 'reflect-metadata'; + import { injectable } from 'inversify'; -import { AlertItem } from '../helpers/types'; + +import { AlertItem } from '@/services/helpers/types'; type Handler = (alerts: AlertItem[]) => void; diff --git a/packages/dashboard-frontend/src/services/bootstrap/__tests__/workspaceStoppedDetector.spec.ts b/packages/dashboard-frontend/src/services/bootstrap/__tests__/workspaceStoppedDetector.spec.ts index 529fbaefe1..d45b17a223 100644 --- a/packages/dashboard-frontend/src/services/bootstrap/__tests__/workspaceStoppedDetector.spec.ts +++ b/packages/dashboard-frontend/src/services/bootstrap/__tests__/workspaceStoppedDetector.spec.ts @@ -10,12 +10,15 @@ * Red Hat, Inc. - initial API and implementation */ -import { FakeStoreBuilder } from '../../../store/__mocks__/storeBuilder'; -import { DevWorkspaceBuilder } from '../../../store/__mocks__/devWorkspaceBuilder'; -import SessionStorageService, { SessionStorageKey } from '../../session-storage'; -import { WorkspaceRunningError, WorkspaceStoppedDetector } from '../workspaceStoppedDetector'; -import { constructWorkspace } from '../../workspace-adapter'; -import { IssueType } from '../issuesReporter'; +import { IssueType } from '@/services/bootstrap/issuesReporter'; +import { + WorkspaceRunningError, + WorkspaceStoppedDetector, +} from '@/services/bootstrap/workspaceStoppedDetector'; +import SessionStorageService, { SessionStorageKey } from '@/services/session-storage'; +import { constructWorkspace } from '@/services/workspace-adapter'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; describe('WorkspaceStoppedDetector', () => { describe('checkWorkspaceStopped()', () => { diff --git a/packages/dashboard-frontend/src/services/bootstrap/index.ts b/packages/dashboard-frontend/src/services/bootstrap/index.ts index 7662967cf3..56fd4cff29 100644 --- a/packages/dashboard-frontend/src/services/bootstrap/index.ts +++ b/packages/dashboard-frontend/src/services/bootstrap/index.ts @@ -10,44 +10,52 @@ * Red Hat, Inc. - initial API and implementation */ -import { Store } from 'redux'; import common, { api, ApplicationId } from '@eclipse-che/common'; -import { lazyInject } from '../../inversify.config'; -import { AppState } from '../../store'; -import * as BannerAlertStore from '../../store/BannerAlert'; -import * as BrandingStore from '../../store/Branding'; -import * as ClusterConfigStore from '../../store/ClusterConfig'; -import * as ClusterInfoStore from '../../store/ClusterInfo'; -import * as ServerConfigStore from '../../store/ServerConfig'; -import * as DevfileRegistriesStore from '../../store/DevfileRegistries'; -import * as InfrastructureNamespacesStore from '../../store/InfrastructureNamespaces'; -import * as PluginsStore from '../../store/Plugins/chePlugins'; -import * as SanityCheckStore from '../../store/SanityCheck'; -import * as DwPluginsStore from '../../store/Plugins/devWorkspacePlugins'; -import * as UserProfileStore from '../../store/User/Profile'; -import * as WorkspacesStore from '../../store/Workspaces'; -import * as EventsStore from '../../store/Events'; -import * as PodsStore from '../../store/Pods'; -import * as DevWorkspacesStore from '../../store/Workspaces/devWorkspaces'; -import { ResourceFetcherService } from '../resource-fetcher'; -import { IssuesReporterService, IssueType, WorkspaceData } from './issuesReporter'; -import { DevWorkspaceClient } from '../workspace-client/devworkspace/devWorkspaceClient'; -import { selectDwEditorsPluginsList } from '../../store/Plugins/devWorkspacePlugins/selectors'; -import devfileApi from '../devfileApi'; -import { selectDefaultNamespace } from '../../store/InfrastructureNamespaces/selectors'; -import { selectDevWorkspacesResourceVersion } from '../../store/Workspaces/devWorkspaces/selectors'; -import { buildDetailsLocation, buildIdeLoaderLocation } from '../helpers/location'; -import { Workspace } from '../workspace-adapter'; -import { WorkspaceRunningError, WorkspaceStoppedDetector } from './workspaceStoppedDetector'; -import { selectOpenVSXUrl } from '../../store/ServerConfig/selectors'; -import { selectEmptyWorkspaceUrl } from '../../store/DevfileRegistries/selectors'; -import { WebsocketClient } from '../dashboard-backend-client/websocketClient'; -import { selectEventsResourceVersion } from '../../store/Events/selectors'; -import { selectPodsResourceVersion } from '../../store/Pods/selectors'; -import { ChannelListener } from '../dashboard-backend-client/websocketClient/messageHandler'; -import { selectApplications } from '../../store/ClusterInfo/selectors'; -import { isAvailableEndpoint } from '../helpers/api-ping'; -import { DEFAULT_REGISTRY } from '../../store/DevfileRegistries'; +import { Store } from 'redux'; + +import { lazyInject } from '@/inversify.config'; +import { + IssuesReporterService, + IssueType, + WorkspaceData, +} from '@/services/bootstrap/issuesReporter'; +import { + WorkspaceRunningError, + WorkspaceStoppedDetector, +} from '@/services/bootstrap/workspaceStoppedDetector'; +import { WebsocketClient } from '@/services/dashboard-backend-client/websocketClient'; +import { ChannelListener } from '@/services/dashboard-backend-client/websocketClient/messageHandler'; +import devfileApi from '@/services/devfileApi'; +import { isAvailableEndpoint } from '@/services/helpers/api-ping'; +import { buildDetailsLocation, buildIdeLoaderLocation } from '@/services/helpers/location'; +import { ResourceFetcherService } from '@/services/resource-fetcher'; +import { Workspace } from '@/services/workspace-adapter'; +import { DevWorkspaceClient } from '@/services/workspace-client/devworkspace/devWorkspaceClient'; +import { AppState } from '@/store'; +import * as BannerAlertStore from '@/store/BannerAlert'; +import * as BrandingStore from '@/store/Branding'; +import * as ClusterConfigStore from '@/store/ClusterConfig'; +import * as ClusterInfoStore from '@/store/ClusterInfo'; +import { selectApplications } from '@/store/ClusterInfo/selectors'; +import * as DevfileRegistriesStore from '@/store/DevfileRegistries'; +import { DEFAULT_REGISTRY } from '@/store/DevfileRegistries'; +import { selectEmptyWorkspaceUrl } from '@/store/DevfileRegistries/selectors'; +import * as EventsStore from '@/store/Events'; +import { selectEventsResourceVersion } from '@/store/Events/selectors'; +import * as InfrastructureNamespacesStore from '@/store/InfrastructureNamespaces'; +import { selectDefaultNamespace } from '@/store/InfrastructureNamespaces/selectors'; +import * as PluginsStore from '@/store/Plugins/chePlugins'; +import * as DwPluginsStore from '@/store/Plugins/devWorkspacePlugins'; +import { selectDwEditorsPluginsList } from '@/store/Plugins/devWorkspacePlugins/selectors'; +import * as PodsStore from '@/store/Pods'; +import { selectPodsResourceVersion } from '@/store/Pods/selectors'; +import * as SanityCheckStore from '@/store/SanityCheck'; +import * as ServerConfigStore from '@/store/ServerConfig'; +import { selectOpenVSXUrl } from '@/store/ServerConfig/selectors'; +import * as UserProfileStore from '@/store/User/Profile'; +import * as WorkspacesStore from '@/store/Workspaces'; +import * as DevWorkspacesStore from '@/store/Workspaces/devWorkspaces'; +import { selectDevWorkspacesResourceVersion } from '@/store/Workspaces/devWorkspaces/selectors'; /** * This class executes a few initial instructions diff --git a/packages/dashboard-frontend/src/services/bootstrap/workspaceStoppedDetector.ts b/packages/dashboard-frontend/src/services/bootstrap/workspaceStoppedDetector.ts index 1dbffe6708..99fadca98b 100644 --- a/packages/dashboard-frontend/src/services/bootstrap/workspaceStoppedDetector.ts +++ b/packages/dashboard-frontend/src/services/bootstrap/workspaceStoppedDetector.ts @@ -10,14 +10,15 @@ * Red Hat, Inc. - initial API and implementation */ -import { AppState } from '../../store'; -import { selectAllWorkspaces } from '../../store/Workspaces/selectors'; import { injectable } from 'inversify'; -import devfileApi from '../devfileApi'; -import { DevWorkspaceStatus } from '../helpers/types'; -import SessionStorageService, { SessionStorageKey } from '../session-storage'; -import { Workspace } from '../workspace-adapter'; -import { IssueType } from './issuesReporter'; + +import { IssueType } from '@/services/bootstrap/issuesReporter'; +import devfileApi from '@/services/devfileApi'; +import { DevWorkspaceStatus } from '@/services/helpers/types'; +import SessionStorageService, { SessionStorageKey } from '@/services/session-storage'; +import { Workspace } from '@/services/workspace-adapter'; +import { AppState } from '@/store'; +import { selectAllWorkspaces } from '@/store/Workspaces/selectors'; export class WorkspaceRunningError extends Error { public workspace: Workspace; diff --git a/packages/dashboard-frontend/src/services/che-user-id/__tests__/index.spec.ts b/packages/dashboard-frontend/src/services/che-user-id/__tests__/index.spec.ts index 51fb1f90f0..d735f2764d 100644 --- a/packages/dashboard-frontend/src/services/che-user-id/__tests__/index.spec.ts +++ b/packages/dashboard-frontend/src/services/che-user-id/__tests__/index.spec.ts @@ -11,6 +11,7 @@ */ import axios from 'axios'; + import { fetchCheUserId } from '..'; jest.mock('axios'); diff --git a/packages/dashboard-frontend/src/services/che-user-id/index.ts b/packages/dashboard-frontend/src/services/che-user-id/index.ts index c5a37deed1..c1f4e877c8 100644 --- a/packages/dashboard-frontend/src/services/che-user-id/index.ts +++ b/packages/dashboard-frontend/src/services/che-user-id/index.ts @@ -10,8 +10,8 @@ * Red Hat, Inc. - initial API and implementation */ -import axios from 'axios'; import common from '@eclipse-che/common'; +import axios from 'axios'; /** * Fetches Che user ID from Che server. diff --git a/packages/dashboard-frontend/src/services/dashboard-backend-client/clusterConfigApi.ts b/packages/dashboard-frontend/src/services/dashboard-backend-client/clusterConfigApi.ts index 1530b223be..a955a29f36 100644 --- a/packages/dashboard-frontend/src/services/dashboard-backend-client/clusterConfigApi.ts +++ b/packages/dashboard-frontend/src/services/dashboard-backend-client/clusterConfigApi.ts @@ -10,9 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ -import axios from 'axios'; import common, { ClusterConfig } from '@eclipse-che/common'; -import { dashboardBackendPrefix } from './const'; +import axios from 'axios'; + +import { dashboardBackendPrefix } from '@/services/dashboard-backend-client/const'; export async function fetchClusterConfig(): Promise { try { diff --git a/packages/dashboard-frontend/src/services/dashboard-backend-client/clusterInfoApi.ts b/packages/dashboard-frontend/src/services/dashboard-backend-client/clusterInfoApi.ts index 0acee7af85..bd69ce11f2 100644 --- a/packages/dashboard-frontend/src/services/dashboard-backend-client/clusterInfoApi.ts +++ b/packages/dashboard-frontend/src/services/dashboard-backend-client/clusterInfoApi.ts @@ -10,9 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ -import axios from 'axios'; import common, { ClusterInfo } from '@eclipse-che/common'; -import { dashboardBackendPrefix } from './const'; +import axios from 'axios'; + +import { dashboardBackendPrefix } from '@/services/dashboard-backend-client/const'; export async function fetchClusterInfo(): Promise { try { diff --git a/packages/dashboard-frontend/src/services/dashboard-backend-client/devWorkspaceApi.ts b/packages/dashboard-frontend/src/services/dashboard-backend-client/devWorkspaceApi.ts index 8395e22f47..87a7b2a610 100644 --- a/packages/dashboard-frontend/src/services/dashboard-backend-client/devWorkspaceApi.ts +++ b/packages/dashboard-frontend/src/services/dashboard-backend-client/devWorkspaceApi.ts @@ -13,8 +13,9 @@ import { api, helpers } from '@eclipse-che/common'; import axios from 'axios'; import { JSONSchema7 } from 'json-schema'; -import devfileApi, { IDevWorkspacesList } from '../devfileApi'; -import { dashboardBackendPrefix } from './const'; + +import { dashboardBackendPrefix } from '@/services/dashboard-backend-client/const'; +import devfileApi, { IDevWorkspacesList } from '@/services/devfileApi'; export type Headers = { [key: string]: string }; diff --git a/packages/dashboard-frontend/src/services/dashboard-backend-client/devWorkspaceTemplateApi.ts b/packages/dashboard-frontend/src/services/dashboard-backend-client/devWorkspaceTemplateApi.ts index 45caf423b3..8808d99c3a 100644 --- a/packages/dashboard-frontend/src/services/dashboard-backend-client/devWorkspaceTemplateApi.ts +++ b/packages/dashboard-frontend/src/services/dashboard-backend-client/devWorkspaceTemplateApi.ts @@ -10,10 +10,11 @@ * Red Hat, Inc. - initial API and implementation */ -import axios from 'axios'; import common, { api } from '@eclipse-che/common'; -import devfileApi from '../devfileApi'; -import { dashboardBackendPrefix } from './const'; +import axios from 'axios'; + +import { dashboardBackendPrefix } from '@/services/dashboard-backend-client/const'; +import devfileApi from '@/services/devfileApi'; export async function createTemplate( template: devfileApi.DevWorkspaceTemplate, diff --git a/packages/dashboard-frontend/src/services/dashboard-backend-client/devworkspaceResourcesApi.ts b/packages/dashboard-frontend/src/services/dashboard-backend-client/devworkspaceResourcesApi.ts index 2713dc0c2a..ecca4d2fa0 100644 --- a/packages/dashboard-frontend/src/services/dashboard-backend-client/devworkspaceResourcesApi.ts +++ b/packages/dashboard-frontend/src/services/dashboard-backend-client/devworkspaceResourcesApi.ts @@ -12,7 +12,8 @@ import { api, helpers } from '@eclipse-che/common'; import axios from 'axios'; -import { dashboardBackendPrefix } from './const'; + +import { dashboardBackendPrefix } from '@/services/dashboard-backend-client/const'; export async function fetchResources(params: api.IDevWorkspaceResources): Promise { try { diff --git a/packages/dashboard-frontend/src/services/dashboard-backend-client/eventsApi.ts b/packages/dashboard-frontend/src/services/dashboard-backend-client/eventsApi.ts index 88d352f7df..be3d530cae 100644 --- a/packages/dashboard-frontend/src/services/dashboard-backend-client/eventsApi.ts +++ b/packages/dashboard-frontend/src/services/dashboard-backend-client/eventsApi.ts @@ -10,9 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ -import axios from 'axios'; import { api, helpers } from '@eclipse-che/common'; -import { dashboardBackendPrefix } from './const'; +import axios from 'axios'; + +import { dashboardBackendPrefix } from '@/services/dashboard-backend-client/const'; export async function fetchEvents(namespace: string): Promise { try { diff --git a/packages/dashboard-frontend/src/services/dashboard-backend-client/factoryResolverApi.ts b/packages/dashboard-frontend/src/services/dashboard-backend-client/factoryResolverApi.ts index bace207744..7b2ff30ada 100644 --- a/packages/dashboard-frontend/src/services/dashboard-backend-client/factoryResolverApi.ts +++ b/packages/dashboard-frontend/src/services/dashboard-backend-client/factoryResolverApi.ts @@ -11,8 +11,9 @@ */ import axios from 'axios'; -import { cheServerPrefix } from './const'; -import { FactoryResolver } from '../helpers/types'; + +import { cheServerPrefix } from '@/services/dashboard-backend-client/const'; +import { FactoryResolver } from '@/services/helpers/types'; const factoryResolverEndpoint = '/factory/resolver'; diff --git a/packages/dashboard-frontend/src/services/dashboard-backend-client/gitConfigApi.ts b/packages/dashboard-frontend/src/services/dashboard-backend-client/gitConfigApi.ts index 3cc6570b51..2728ec36db 100644 --- a/packages/dashboard-frontend/src/services/dashboard-backend-client/gitConfigApi.ts +++ b/packages/dashboard-frontend/src/services/dashboard-backend-client/gitConfigApi.ts @@ -12,7 +12,8 @@ import { api } from '@eclipse-che/common'; import axios from 'axios'; -import { dashboardBackendPrefix } from './const'; + +import { dashboardBackendPrefix } from '@/services/dashboard-backend-client/const'; export async function fetchGitConfig(namespace: string): Promise { const response = await axios.get(`${dashboardBackendPrefix}/namespace/${namespace}/gitconfig`); diff --git a/packages/dashboard-frontend/src/services/dashboard-backend-client/personalAccessTokenApi.ts b/packages/dashboard-frontend/src/services/dashboard-backend-client/personalAccessTokenApi.ts index 08368feaab..ae030f2cf9 100644 --- a/packages/dashboard-frontend/src/services/dashboard-backend-client/personalAccessTokenApi.ts +++ b/packages/dashboard-frontend/src/services/dashboard-backend-client/personalAccessTokenApi.ts @@ -12,7 +12,8 @@ import { api, helpers } from '@eclipse-che/common'; import axios from 'axios'; -import { dashboardBackendPrefix } from './const'; + +import { dashboardBackendPrefix } from '@/services/dashboard-backend-client/const'; export async function fetchTokens(namespace: string): Promise { try { diff --git a/packages/dashboard-frontend/src/services/dashboard-backend-client/podsApi.ts b/packages/dashboard-frontend/src/services/dashboard-backend-client/podsApi.ts index 8a9b1a2c44..d70506d7c6 100644 --- a/packages/dashboard-frontend/src/services/dashboard-backend-client/podsApi.ts +++ b/packages/dashboard-frontend/src/services/dashboard-backend-client/podsApi.ts @@ -10,9 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ -import axios from 'axios'; import { api, helpers } from '@eclipse-che/common'; -import { dashboardBackendPrefix } from './const'; +import axios from 'axios'; + +import { dashboardBackendPrefix } from '@/services/dashboard-backend-client/const'; export async function fetchPods(namespace: string): Promise { try { diff --git a/packages/dashboard-frontend/src/services/dashboard-backend-client/serverConfigApi.ts b/packages/dashboard-frontend/src/services/dashboard-backend-client/serverConfigApi.ts index a17239637c..1ab5b0d3ee 100644 --- a/packages/dashboard-frontend/src/services/dashboard-backend-client/serverConfigApi.ts +++ b/packages/dashboard-frontend/src/services/dashboard-backend-client/serverConfigApi.ts @@ -12,7 +12,8 @@ import { api } from '@eclipse-che/common'; import axios from 'axios'; -import { dashboardBackendPrefix } from './const'; + +import { dashboardBackendPrefix } from '@/services/dashboard-backend-client/const'; /** * Returns an array of default plug-ins per editor diff --git a/packages/dashboard-frontend/src/services/dashboard-backend-client/userProfileApi.ts b/packages/dashboard-frontend/src/services/dashboard-backend-client/userProfileApi.ts index dfa872d9a0..12d672e83c 100644 --- a/packages/dashboard-frontend/src/services/dashboard-backend-client/userProfileApi.ts +++ b/packages/dashboard-frontend/src/services/dashboard-backend-client/userProfileApi.ts @@ -12,7 +12,8 @@ import common, { api } from '@eclipse-che/common'; import axios from 'axios'; -import { dashboardBackendPrefix } from './const'; + +import { dashboardBackendPrefix } from '@/services/dashboard-backend-client/const'; /** * Returns object with user profile data. diff --git a/packages/dashboard-frontend/src/services/dashboard-backend-client/websocketClient/__tests__/index.spec.ts b/packages/dashboard-frontend/src/services/dashboard-backend-client/websocketClient/__tests__/index.spec.ts index b731c68e1b..a68d2991ce 100644 --- a/packages/dashboard-frontend/src/services/dashboard-backend-client/websocketClient/__tests__/index.spec.ts +++ b/packages/dashboard-frontend/src/services/dashboard-backend-client/websocketClient/__tests__/index.spec.ts @@ -12,8 +12,10 @@ import { api } from '@eclipse-che/common'; import WS from 'jest-websocket-mock'; + +import { delay } from '@/services/helpers/delay'; + import { ConnectionEvent, WebsocketClient } from '..'; -import { delay } from '../../../helpers/delay'; // mute console logs console.log = jest.fn(); diff --git a/packages/dashboard-frontend/src/services/dashboard-backend-client/websocketClient/__tests__/messageHandler.spec.ts b/packages/dashboard-frontend/src/services/dashboard-backend-client/websocketClient/__tests__/messageHandler.spec.ts index 9242a6dcab..bc7ba06a89 100644 --- a/packages/dashboard-frontend/src/services/dashboard-backend-client/websocketClient/__tests__/messageHandler.spec.ts +++ b/packages/dashboard-frontend/src/services/dashboard-backend-client/websocketClient/__tests__/messageHandler.spec.ts @@ -10,10 +10,11 @@ * Red Hat, Inc. - initial API and implementation */ -import { WebSocketMessageHandler } from '../messageHandler'; import { api } from '@eclipse-che/common'; import { CoreV1Event } from '@kubernetes/client-node'; +import { WebSocketMessageHandler } from '@/services/dashboard-backend-client/websocketClient/messageHandler'; + describe('messageHandler', () => { afterEach(() => { jest.clearAllMocks(); diff --git a/packages/dashboard-frontend/src/services/dashboard-backend-client/websocketClient/__tests__/subscriptionsManager.spec.ts b/packages/dashboard-frontend/src/services/dashboard-backend-client/websocketClient/__tests__/subscriptionsManager.spec.ts index 9be7c246cc..0de50aa0ec 100644 --- a/packages/dashboard-frontend/src/services/dashboard-backend-client/websocketClient/__tests__/subscriptionsManager.spec.ts +++ b/packages/dashboard-frontend/src/services/dashboard-backend-client/websocketClient/__tests__/subscriptionsManager.spec.ts @@ -11,7 +11,8 @@ */ import { api } from '@eclipse-che/common'; -import { WebSocketSubscriptionsManager } from '../subscriptionsManager'; + +import { WebSocketSubscriptionsManager } from '@/services/dashboard-backend-client/websocketClient/subscriptionsManager'; describe('subscriptionsManager', () => { let subscriptionsManager: WebSocketSubscriptionsManager; diff --git a/packages/dashboard-frontend/src/services/dashboard-backend-client/websocketClient/index.ts b/packages/dashboard-frontend/src/services/dashboard-backend-client/websocketClient/index.ts index f446fef34c..36fee832ad 100644 --- a/packages/dashboard-frontend/src/services/dashboard-backend-client/websocketClient/index.ts +++ b/packages/dashboard-frontend/src/services/dashboard-backend-client/websocketClient/index.ts @@ -13,10 +13,17 @@ import { api } from '@eclipse-che/common'; import { injectable } from 'inversify'; import ReconnectingWebSocket from 'reconnecting-websocket'; -import { getDefer, IDeferred } from '../../helpers/deferred'; -import { dashboardBackendPrefix } from '../const'; -import { ChannelListener, WebSocketMessageHandler } from './messageHandler'; -import { SubscriptionArgs, WebSocketSubscriptionsManager } from './subscriptionsManager'; + +import { dashboardBackendPrefix } from '@/services/dashboard-backend-client/const'; +import { + ChannelListener, + WebSocketMessageHandler, +} from '@/services/dashboard-backend-client/websocketClient/messageHandler'; +import { + SubscriptionArgs, + WebSocketSubscriptionsManager, +} from '@/services/dashboard-backend-client/websocketClient/subscriptionsManager'; +import { getDefer, IDeferred } from '@/services/helpers/deferred'; export enum ConnectionEvent { OPEN = 'open', diff --git a/packages/dashboard-frontend/src/services/dashboard-backend-client/yamlResolverApi.ts b/packages/dashboard-frontend/src/services/dashboard-backend-client/yamlResolverApi.ts index 39e277729a..25923a59cc 100644 --- a/packages/dashboard-frontend/src/services/dashboard-backend-client/yamlResolverApi.ts +++ b/packages/dashboard-frontend/src/services/dashboard-backend-client/yamlResolverApi.ts @@ -10,12 +10,13 @@ * Red Hat, Inc. - initial API and implementation */ -import axios from 'axios'; import { helpers } from '@eclipse-che/common'; -import { dashboardBackendPrefix } from './const'; +import axios from 'axios'; import * as yaml from 'js-yaml'; -import devfileApi from '../devfileApi'; -import { FactoryResolver } from '../helpers/types'; + +import { dashboardBackendPrefix } from '@/services/dashboard-backend-client/const'; +import devfileApi from '@/services/devfileApi'; +import { FactoryResolver } from '@/services/helpers/types'; export async function getYamlResolver( namespace: string, diff --git a/packages/dashboard-frontend/src/services/devfile/__tests__/devfileAdapter.spec.ts b/packages/dashboard-frontend/src/services/devfile/__tests__/devfileAdapter.spec.ts index e1a403df8b..27736a88ac 100644 --- a/packages/dashboard-frontend/src/services/devfile/__tests__/devfileAdapter.spec.ts +++ b/packages/dashboard-frontend/src/services/devfile/__tests__/devfileAdapter.spec.ts @@ -10,11 +10,11 @@ * Red Hat, Inc. - initial API and implementation */ -import { DevfileBuilder } from '../../../store/__mocks__/devfile'; -import { DEVWORKSPACE_STORAGE_TYPE_ATTR } from '../../devfileApi/devWorkspace/spec/template'; -import { DevfileAdapter } from '../adapter'; -import { convertDevfileV1toDevfileV2 } from '../converters'; -import devfileApi from '../../devfileApi'; +import { DevfileAdapter } from '@/services/devfile/adapter'; +import { convertDevfileV1toDevfileV2 } from '@/services/devfile/converters'; +import devfileApi from '@/services/devfileApi'; +import { DEVWORKSPACE_STORAGE_TYPE_ATTR } from '@/services/devfileApi/devWorkspace/spec/template'; +import { DevfileBuilder } from '@/store/__mocks__/devfile'; describe('DevfileAdapter Service', () => { describe('getAttributesFromDevfileV2', () => { diff --git a/packages/dashboard-frontend/src/services/devfile/adapter.ts b/packages/dashboard-frontend/src/services/devfile/adapter.ts index 728aa3973b..146a3b69d7 100644 --- a/packages/dashboard-frontend/src/services/devfile/adapter.ts +++ b/packages/dashboard-frontend/src/services/devfile/adapter.ts @@ -10,9 +10,9 @@ * Red Hat, Inc. - initial API and implementation */ -import devfileApi, { isDevfileV2 } from '../devfileApi'; -import { DEVWORKSPACE_STORAGE_TYPE_ATTR } from '../devfileApi/devWorkspace/spec/template'; -import { attributesToType } from '../storageTypes'; +import devfileApi, { isDevfileV2 } from '@/services/devfileApi'; +import { DEVWORKSPACE_STORAGE_TYPE_ATTR } from '@/services/devfileApi/devWorkspace/spec/template'; +import { attributesToType } from '@/services/storageTypes'; export type Devfile = che.WorkspaceDevfile | devfileApi.Devfile; diff --git a/packages/dashboard-frontend/src/services/devfile/converters.ts b/packages/dashboard-frontend/src/services/devfile/converters.ts index f5e3dcbc1b..6ea35f2acb 100644 --- a/packages/dashboard-frontend/src/services/devfile/converters.ts +++ b/packages/dashboard-frontend/src/services/devfile/converters.ts @@ -11,7 +11,8 @@ */ import * as devfileConverter from '@eclipse-che/devfile-converter'; -import devfileApi from '../devfileApi'; + +import devfileApi from '@/services/devfileApi'; export async function convertDevfileV2toDevfileV1( devfile: devfileApi.Devfile, diff --git a/packages/dashboard-frontend/src/services/devfileApi/devWorkspace/index.ts b/packages/dashboard-frontend/src/services/devfileApi/devWorkspace/index.ts index f9ff5907b1..432885d732 100644 --- a/packages/dashboard-frontend/src/services/devfileApi/devWorkspace/index.ts +++ b/packages/dashboard-frontend/src/services/devfileApi/devWorkspace/index.ts @@ -11,8 +11,9 @@ */ import { V1alpha2DevWorkspace } from '@devfile/api'; -import { DevWorkspaceMetadata } from './metadata'; -import { DevWorkspaceSpec } from './spec'; + +import { DevWorkspaceMetadata } from '@/services/devfileApi/devWorkspace/metadata'; +import { DevWorkspaceSpec } from '@/services/devfileApi/devWorkspace/spec'; export type DevWorkspaceKind = 'DevWorkspace'; export type DevWorkspacePlugin = { diff --git a/packages/dashboard-frontend/src/services/devfileApi/devWorkspace/spec/index.ts b/packages/dashboard-frontend/src/services/devfileApi/devWorkspace/spec/index.ts index 21fa97048f..2c56292a21 100644 --- a/packages/dashboard-frontend/src/services/devfileApi/devWorkspace/spec/index.ts +++ b/packages/dashboard-frontend/src/services/devfileApi/devWorkspace/spec/index.ts @@ -11,7 +11,8 @@ */ import { V1alpha2DevWorkspaceSpec } from '@devfile/api'; -import { DevWorkspaceSpecTemplate } from './template'; + +import { DevWorkspaceSpecTemplate } from '@/services/devfileApi/devWorkspace/spec/template'; export type DevWorkspaceSpec = V1alpha2DevWorkspaceSpec & { template: DevWorkspaceSpecTemplate; diff --git a/packages/dashboard-frontend/src/services/devfileApi/devWorkspaceTemplate/index.ts b/packages/dashboard-frontend/src/services/devfileApi/devWorkspaceTemplate/index.ts index e01b330c4b..6a56a657ab 100644 --- a/packages/dashboard-frontend/src/services/devfileApi/devWorkspaceTemplate/index.ts +++ b/packages/dashboard-frontend/src/services/devfileApi/devWorkspaceTemplate/index.ts @@ -11,7 +11,8 @@ */ import { V1alpha2DevWorkspaceTemplate } from '@devfile/api'; -import { DevWorkspaceTemplateMetadata } from './metadata'; + +import { DevWorkspaceTemplateMetadata } from '@/services/devfileApi/devWorkspaceTemplate/metadata'; export type DevWorkspaceTemplateLike = V1alpha2DevWorkspaceTemplate & Required>; diff --git a/packages/dashboard-frontend/src/services/devfileApi/devfile/index.ts b/packages/dashboard-frontend/src/services/devfileApi/devfile/index.ts index 3e681c8ef0..8e186b44d6 100644 --- a/packages/dashboard-frontend/src/services/devfileApi/devfile/index.ts +++ b/packages/dashboard-frontend/src/services/devfileApi/devfile/index.ts @@ -11,7 +11,8 @@ */ import { V221Devfile } from '@devfile/api'; -import { DevfileMetadata, DevfileMetadataLike } from './metadata'; + +import { DevfileMetadata, DevfileMetadataLike } from '@/services/devfileApi/devfile/metadata'; export type DevfileLike = V221Devfile & { metadata?: DevfileMetadataLike; diff --git a/packages/dashboard-frontend/src/services/devfileApi/devfileApi.ts b/packages/dashboard-frontend/src/services/devfileApi/devfileApi.ts index a7859f06d1..d47c296227 100644 --- a/packages/dashboard-frontend/src/services/devfileApi/devfileApi.ts +++ b/packages/dashboard-frontend/src/services/devfileApi/devfileApi.ts @@ -11,19 +11,11 @@ */ export { Devfile, DevfileLike } from './devfile'; - export { DevfileMetadata } from './devfile/metadata'; - export { DevWorkspace, DevWorkspaceKind, DevWorkspaceLike } from './devWorkspace'; - +export { DevWorkspaceMetadata } from './devWorkspace/metadata'; export { DevWorkspaceSpec } from './devWorkspace/spec'; - export { DevWorkspaceSpecTemplate } from './devWorkspace/spec/template'; - -export { DevWorkspaceMetadata } from './devWorkspace/metadata'; - export { DevWorkspaceTemplate, DevWorkspaceTemplateLike } from './devWorkspaceTemplate'; - export { DevWorkspaceTemplateMetadata } from './devWorkspaceTemplate/metadata'; - export { V1alpha2DevWorkspaceStatus as DevWorkspaceStatus } from '@devfile/api'; diff --git a/packages/dashboard-frontend/src/services/devfileApi/index.ts b/packages/dashboard-frontend/src/services/devfileApi/index.ts index a36a114bf0..db66e9174a 100644 --- a/packages/dashboard-frontend/src/services/devfileApi/index.ts +++ b/packages/dashboard-frontend/src/services/devfileApi/index.ts @@ -10,9 +10,9 @@ * Red Hat, Inc. - initial API and implementation */ -export * from './typeguards'; +import * as devfileApi from '@/services/devfileApi/devfileApi'; -import * as devfileApi from './devfileApi'; +export * from './typeguards'; export default devfileApi; export interface IDevWorkspacesList { diff --git a/packages/dashboard-frontend/src/services/factory-location-adapter/__tests__/factoryLocationAdapter.spec.ts b/packages/dashboard-frontend/src/services/factory-location-adapter/__tests__/factoryLocationAdapter.spec.ts index 3d94d310c8..6cbac105e3 100644 --- a/packages/dashboard-frontend/src/services/factory-location-adapter/__tests__/factoryLocationAdapter.spec.ts +++ b/packages/dashboard-frontend/src/services/factory-location-adapter/__tests__/factoryLocationAdapter.spec.ts @@ -10,9 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ -import { FactoryLocation, FactoryLocationAdapter } from '../'; import common from '@eclipse-che/common'; +import { FactoryLocation, FactoryLocationAdapter } from '@/services/factory-location-adapter'; + describe('FactoryLocationAdapter Service', () => { let factoryLocation: FactoryLocation; diff --git a/packages/dashboard-frontend/src/services/helpers/__tests__/api-ping.spec.ts b/packages/dashboard-frontend/src/services/helpers/__tests__/api-ping.spec.ts index 960a192c08..448a6fe8eb 100644 --- a/packages/dashboard-frontend/src/services/helpers/__tests__/api-ping.spec.ts +++ b/packages/dashboard-frontend/src/services/helpers/__tests__/api-ping.spec.ts @@ -10,9 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ -import { isAvailableEndpoint } from '../api-ping'; import axios from 'axios'; +import { isAvailableEndpoint } from '@/services/helpers/api-ping'; + jest.mock('axios'); const delayMock = jest.fn(); diff --git a/packages/dashboard-frontend/src/services/helpers/__tests__/filter.spec.ts b/packages/dashboard-frontend/src/services/helpers/__tests__/filter.spec.ts index 164dc18bba..3dfebec012 100644 --- a/packages/dashboard-frontend/src/services/helpers/__tests__/filter.spec.ts +++ b/packages/dashboard-frontend/src/services/helpers/__tests__/filter.spec.ts @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import match from '../filter'; +import match from '@/services/helpers/filter'; describe('filter/match', () => { const value = 'Lorem ipsum dolor sit amet'; diff --git a/packages/dashboard-frontend/src/services/helpers/__tests__/getProjectName.spec.ts b/packages/dashboard-frontend/src/services/helpers/__tests__/getProjectName.spec.ts index 5278135acf..19d5578eb7 100644 --- a/packages/dashboard-frontend/src/services/helpers/__tests__/getProjectName.spec.ts +++ b/packages/dashboard-frontend/src/services/helpers/__tests__/getProjectName.spec.ts @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { getProjectName } from '../getProjectName'; +import { getProjectName } from '@/services/helpers/getProjectName'; describe('Get a project name based on location', () => { it('should return a valid name less then 63 symbols', () => { diff --git a/packages/dashboard-frontend/src/services/helpers/__tests__/sanitizeName.spec.ts b/packages/dashboard-frontend/src/services/helpers/__tests__/sanitizeName.spec.ts index 86ff129393..13e78234d4 100644 --- a/packages/dashboard-frontend/src/services/helpers/__tests__/sanitizeName.spec.ts +++ b/packages/dashboard-frontend/src/services/helpers/__tests__/sanitizeName.spec.ts @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import sanitizeName from '../sanitizeName'; +import sanitizeName from '@/services/helpers/sanitizeName'; describe('sanitizeName', () => { test('correct name', () => { diff --git a/packages/dashboard-frontend/src/services/helpers/__tests__/types.spec.ts b/packages/dashboard-frontend/src/services/helpers/__tests__/types.spec.ts index d891ac0a65..c2b544ca49 100644 --- a/packages/dashboard-frontend/src/services/helpers/__tests__/types.spec.ts +++ b/packages/dashboard-frontend/src/services/helpers/__tests__/types.spec.ts @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { DevWorkspaceStatus, isDevWorkspaceStatus } from '../types'; +import { DevWorkspaceStatus, isDevWorkspaceStatus } from '@/services/helpers/types'; describe('typeguards', () => { describe('isDevWorkspaceStatus', () => { diff --git a/packages/dashboard-frontend/src/services/helpers/api-ping.ts b/packages/dashboard-frontend/src/services/helpers/api-ping.ts index da8d175ebb..5a6f90a010 100644 --- a/packages/dashboard-frontend/src/services/helpers/api-ping.ts +++ b/packages/dashboard-frontend/src/services/helpers/api-ping.ts @@ -10,9 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ -import axios from 'axios'; import common, { helpers } from '@eclipse-che/common'; -import { delay } from './delay'; +import axios from 'axios'; + +import { delay } from '@/services/helpers/delay'; const MAX_ATTEMPT_QUANTITY = 12; const DELAY_TIME = 2500; diff --git a/packages/dashboard-frontend/src/services/helpers/devworkspace.ts b/packages/dashboard-frontend/src/services/helpers/devworkspace.ts index 3af8ff9c2e..b4a2723efd 100644 --- a/packages/dashboard-frontend/src/services/helpers/devworkspace.ts +++ b/packages/dashboard-frontend/src/services/helpers/devworkspace.ts @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import * as devfileApi from '../devfileApi/devfileApi'; +import * as devfileApi from '@/services/devfileApi/devfileApi'; /** * Check to see if the workspace is a web terminal diff --git a/packages/dashboard-frontend/src/services/helpers/editor.ts b/packages/dashboard-frontend/src/services/helpers/editor.ts index a3c29ef7f6..cf9e397016 100644 --- a/packages/dashboard-frontend/src/services/helpers/editor.ts +++ b/packages/dashboard-frontend/src/services/helpers/editor.ts @@ -12,10 +12,11 @@ import { dump } from 'js-yaml'; import { - LanguageConfiguration, IMonarchLanguage, + LanguageConfiguration, } from 'monaco-editor-core/esm/vs/editor/editor.main'; -import devfileApi from '../devfileApi'; + +import devfileApi from '@/services/devfileApi'; const sortOrder: Array = [ 'apiVersion', diff --git a/packages/dashboard-frontend/src/services/helpers/factoryFlow/__tests__/getLoaderMode.spec.ts b/packages/dashboard-frontend/src/services/helpers/factoryFlow/__tests__/getLoaderMode.spec.ts index 24ac5cbf98..f20a8adb8e 100644 --- a/packages/dashboard-frontend/src/services/helpers/factoryFlow/__tests__/getLoaderMode.spec.ts +++ b/packages/dashboard-frontend/src/services/helpers/factoryFlow/__tests__/getLoaderMode.spec.ts @@ -11,7 +11,8 @@ */ import { Location } from 'history'; -import { getLoaderMode, LoaderMode } from '../getLoaderMode'; + +import { getLoaderMode, LoaderMode } from '@/services/helpers/factoryFlow/getLoaderMode'; describe('getLoaderMode', () => { const namespace = 'user-che'; diff --git a/packages/dashboard-frontend/src/services/helpers/factoryFlow/findTargetWorkspace.ts b/packages/dashboard-frontend/src/services/helpers/factoryFlow/findTargetWorkspace.ts index 89cbcc3d8c..45660329b7 100644 --- a/packages/dashboard-frontend/src/services/helpers/factoryFlow/findTargetWorkspace.ts +++ b/packages/dashboard-frontend/src/services/helpers/factoryFlow/findTargetWorkspace.ts @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { Workspace } from '../../workspace-adapter'; +import { Workspace } from '@/services/workspace-adapter'; export function findTargetWorkspace( workspaces: Workspace[], diff --git a/packages/dashboard-frontend/src/services/helpers/factoryFlow/getLoaderMode.ts b/packages/dashboard-frontend/src/services/helpers/factoryFlow/getLoaderMode.ts index 7595261bc5..82c6133e3f 100644 --- a/packages/dashboard-frontend/src/services/helpers/factoryFlow/getLoaderMode.ts +++ b/packages/dashboard-frontend/src/services/helpers/factoryFlow/getLoaderMode.ts @@ -12,7 +12,8 @@ import { Location } from 'history'; import { matchPath } from 'react-router-dom'; -import { ROUTE, WorkspaceParams } from '../../../Routes/routes'; + +import { ROUTE, WorkspaceParams } from '@/Routes/routes'; export type LoaderMode = | { mode: 'factory' } diff --git a/packages/dashboard-frontend/src/services/helpers/generateName.ts b/packages/dashboard-frontend/src/services/helpers/generateName.ts index 8528cd508b..599a5bfb51 100644 --- a/packages/dashboard-frontend/src/services/helpers/generateName.ts +++ b/packages/dashboard-frontend/src/services/helpers/generateName.ts @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import getRandomString from './random'; +import getRandomString from '@/services/helpers/random'; export function generateWorkspaceName(generateName: string): string { return generateName + generateSuffix(); diff --git a/packages/dashboard-frontend/src/services/helpers/location.ts b/packages/dashboard-frontend/src/services/helpers/location.ts index d5ee140194..a0a3ce216d 100644 --- a/packages/dashboard-frontend/src/services/helpers/location.ts +++ b/packages/dashboard-frontend/src/services/helpers/location.ts @@ -11,9 +11,10 @@ */ import { History, Location } from 'history'; -import { ROUTE } from '../../Routes/routes'; -import { CreateWorkspaceTab, LoaderTab, WorkspaceDetailsTab } from './types'; -import { Workspace } from '../workspace-adapter'; + +import { ROUTE } from '@/Routes/routes'; +import { CreateWorkspaceTab, LoaderTab, WorkspaceDetailsTab } from '@/services/helpers/types'; +import { Workspace } from '@/services/workspace-adapter'; /* eslint-disable @typescript-eslint/no-non-null-assertion */ diff --git a/packages/dashboard-frontend/src/services/helpers/types.ts b/packages/dashboard-frontend/src/services/helpers/types.ts index 80a2b4af62..7447a7aa0b 100644 --- a/packages/dashboard-frontend/src/services/helpers/types.ts +++ b/packages/dashboard-frontend/src/services/helpers/types.ts @@ -12,7 +12,8 @@ import { AlertVariant } from '@patternfly/react-core'; import * as React from 'react'; -import devfileApi from '../devfileApi'; + +import devfileApi from '@/services/devfileApi'; export type ActionCallback = { title: string; diff --git a/packages/dashboard-frontend/src/services/oauth/__tests__/index.spec.ts b/packages/dashboard-frontend/src/services/oauth/__tests__/index.spec.ts index 21aff60299..74b9eac33f 100644 --- a/packages/dashboard-frontend/src/services/oauth/__tests__/index.spec.ts +++ b/packages/dashboard-frontend/src/services/oauth/__tests__/index.spec.ts @@ -10,12 +10,14 @@ * Red Hat, Inc. - initial API and implementation */ -import { AxiosError } from 'axios'; import common from '@eclipse-che/common'; +import { AxiosError } from 'axios'; + +import { container } from '@/inversify.config'; +import { CheWorkspaceClient } from '@/services/workspace-client/cheworkspace/cheWorkspaceClient'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; + import OAuthService from '..'; -import { container } from '../../../inversify.config'; -import { DevWorkspaceBuilder } from '../../../store/__mocks__/devWorkspaceBuilder'; -import { CheWorkspaceClient } from '../../workspace-client/cheworkspace/cheWorkspaceClient'; const cheWorkspaceClient = container.get(CheWorkspaceClient); diff --git a/packages/dashboard-frontend/src/services/oauth/index.ts b/packages/dashboard-frontend/src/services/oauth/index.ts index 9f6953d690..726ab23a45 100644 --- a/packages/dashboard-frontend/src/services/oauth/index.ts +++ b/packages/dashboard-frontend/src/services/oauth/index.ts @@ -11,10 +11,11 @@ */ import common, { helpers } from '@eclipse-che/common'; -import { OAuthResponse } from '../../store/FactoryResolver'; -import { container } from '../../inversify.config'; -import { CheWorkspaceClient } from '../workspace-client/cheworkspace/cheWorkspaceClient'; -import devfileApi from '../devfileApi'; + +import { container } from '@/inversify.config'; +import devfileApi from '@/services/devfileApi'; +import { CheWorkspaceClient } from '@/services/workspace-client/cheworkspace/cheWorkspaceClient'; +import { OAuthResponse } from '@/store/FactoryResolver'; const WorkspaceClient = container.get(CheWorkspaceClient); diff --git a/packages/dashboard-frontend/src/services/registry/__tests__/devfiles.spec.ts b/packages/dashboard-frontend/src/services/registry/__tests__/devfiles.spec.ts index d541349a4b..03ef7ad5ab 100644 --- a/packages/dashboard-frontend/src/services/registry/__tests__/devfiles.spec.ts +++ b/packages/dashboard-frontend/src/services/registry/__tests__/devfiles.spec.ts @@ -10,10 +10,16 @@ * Red Hat, Inc. - initial API and implementation */ -import { fetchRegistryMetadata, resolveLinks, resolveTags, updateObjectLinks } from '../devfiles'; -import SessionStorageService, { SessionStorageKey } from '../../session-storage'; import common from '@eclipse-che/common'; +import { + fetchRegistryMetadata, + resolveLinks, + resolveTags, + updateObjectLinks, +} from '@/services/registry/devfiles'; +import SessionStorageService, { SessionStorageKey } from '@/services/session-storage'; + const mockFetchData = jest.fn(); jest.mock('../fetchData', () => { return { diff --git a/packages/dashboard-frontend/src/services/registry/__tests__/types.spec.ts b/packages/dashboard-frontend/src/services/registry/__tests__/types.spec.ts index d2b5a13018..217ac4a265 100644 --- a/packages/dashboard-frontend/src/services/registry/__tests__/types.spec.ts +++ b/packages/dashboard-frontend/src/services/registry/__tests__/types.spec.ts @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { isDevfileMetaData } from '../types'; +import { isDevfileMetaData } from '@/services/registry/types'; describe('api.webSocket typeguards', () => { test('isWebSocketUnsubscribeParams', () => { diff --git a/packages/dashboard-frontend/src/services/registry/devfiles.ts b/packages/dashboard-frontend/src/services/registry/devfiles.ts index caac061c37..8017f614b3 100644 --- a/packages/dashboard-frontend/src/services/registry/devfiles.ts +++ b/packages/dashboard-frontend/src/services/registry/devfiles.ts @@ -10,13 +10,13 @@ * Red Hat, Inc. - initial API and implementation */ -import { isDevfileMetaData } from './types'; +import common from '@eclipse-che/common'; -const EXPIRATION_TIME_FOR_STORED_METADATA = 60 * 60 * 1000; // expiration time in milliseconds +import { fetchData } from '@/services/registry/fetchData'; +import { isDevfileMetaData } from '@/services/registry/types'; +import SessionStorageService, { SessionStorageKey } from '@/services/session-storage'; -import { fetchData } from './fetchData'; -import SessionStorageService, { SessionStorageKey } from '../session-storage'; -import common from '@eclipse-che/common'; +const EXPIRATION_TIME_FOR_STORED_METADATA = 60 * 60 * 1000; // expiration time in milliseconds export class DevfileMetaDataIsNotArrayError extends Error { public location: string; diff --git a/packages/dashboard-frontend/src/services/registry/fetchData.ts b/packages/dashboard-frontend/src/services/registry/fetchData.ts index d5cdd81b4f..fdc81755f5 100644 --- a/packages/dashboard-frontend/src/services/registry/fetchData.ts +++ b/packages/dashboard-frontend/src/services/registry/fetchData.ts @@ -10,8 +10,8 @@ * Red Hat, Inc. - initial API and implementation */ -import axios from 'axios'; import common from '@eclipse-che/common'; +import axios from 'axios'; export async function fetchData(url: string): Promise { try { diff --git a/packages/dashboard-frontend/src/services/registry/resources.ts b/packages/dashboard-frontend/src/services/registry/resources.ts index bbbc122bb6..791e424668 100644 --- a/packages/dashboard-frontend/src/services/registry/resources.ts +++ b/packages/dashboard-frontend/src/services/registry/resources.ts @@ -12,8 +12,9 @@ import common from '@eclipse-che/common'; import { loadAll } from 'js-yaml'; -import devfileApi from '../devfileApi'; -import { fetchData } from './fetchData'; + +import devfileApi from '@/services/devfileApi'; +import { fetchData } from '@/services/registry/fetchData'; export type PreBuiltResources = Array; diff --git a/packages/dashboard-frontend/src/services/resource-fetcher/__tests__/index.spec.ts b/packages/dashboard-frontend/src/services/resource-fetcher/__tests__/index.spec.ts index b60b5187a8..61585924da 100644 --- a/packages/dashboard-frontend/src/services/resource-fetcher/__tests__/index.spec.ts +++ b/packages/dashboard-frontend/src/services/resource-fetcher/__tests__/index.spec.ts @@ -11,8 +11,10 @@ */ import axios from 'axios'; -import { FakeStoreBuilder } from '../../../store/__mocks__/storeBuilder'; -import { BrandingData } from '../../bootstrap/branding.constant'; + +import { BrandingData } from '@/services/bootstrap/branding.constant'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; + import { ResourceFetcherService } from '..'; jest.mock('axios'); diff --git a/packages/dashboard-frontend/src/services/resource-fetcher/index.ts b/packages/dashboard-frontend/src/services/resource-fetcher/index.ts index 70463e5787..96be87eb8f 100644 --- a/packages/dashboard-frontend/src/services/resource-fetcher/index.ts +++ b/packages/dashboard-frontend/src/services/resource-fetcher/index.ts @@ -11,7 +11,8 @@ */ import axios from 'axios'; -import { AppState } from '../../store'; + +import { AppState } from '@/store'; // source: https://github.com/eclipse/che-dashboard/blob/381ff548a9fff3537f1a29ce8e9b228f6c145338/src/components/service/resource-fetcher/resource-fetcher.service.ts diff --git a/packages/dashboard-frontend/src/services/workspace-adapter/__tests__/index.spec.ts b/packages/dashboard-frontend/src/services/workspace-adapter/__tests__/index.spec.ts index 51893e4b1e..1b20b470ee 100644 --- a/packages/dashboard-frontend/src/services/workspace-adapter/__tests__/index.spec.ts +++ b/packages/dashboard-frontend/src/services/workspace-adapter/__tests__/index.spec.ts @@ -10,12 +10,13 @@ * Red Hat, Inc. - initial API and implementation */ -import { WorkspaceAdapter, constructWorkspace } from '..'; -import { DevWorkspaceBuilder } from '../../../store/__mocks__/devWorkspaceBuilder'; -import { DEVWORKSPACE_UPDATING_TIMESTAMP_ANNOTATION } from '../../devfileApi/devWorkspace/metadata'; -import { DEVWORKSPACE_STORAGE_TYPE_ATTR } from '../../devfileApi/devWorkspace/spec/template'; -import { DevWorkspaceStatus } from '../../helpers/types'; -import { StorageTypeTitle } from '../../storageTypes'; +import { DEVWORKSPACE_UPDATING_TIMESTAMP_ANNOTATION } from '@/services/devfileApi/devWorkspace/metadata'; +import { DEVWORKSPACE_STORAGE_TYPE_ATTR } from '@/services/devfileApi/devWorkspace/spec/template'; +import { DevWorkspaceStatus } from '@/services/helpers/types'; +import { StorageTypeTitle } from '@/services/storageTypes'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; + +import { constructWorkspace, WorkspaceAdapter } from '..'; /** * @jest-environment node diff --git a/packages/dashboard-frontend/src/services/workspace-adapter/index.ts b/packages/dashboard-frontend/src/services/workspace-adapter/index.ts index 376f3883fe..bc4e3ff6b3 100644 --- a/packages/dashboard-frontend/src/services/workspace-adapter/index.ts +++ b/packages/dashboard-frontend/src/services/workspace-adapter/index.ts @@ -10,15 +10,19 @@ * Red Hat, Inc. - initial API and implementation */ -import devfileApi, { isDevfileV2, isDevWorkspace } from '../devfileApi'; -import { DEVWORKSPACE_UPDATING_TIMESTAMP_ANNOTATION } from '../devfileApi/devWorkspace/metadata'; -import { DEVWORKSPACE_STORAGE_TYPE_ATTR } from '../devfileApi/devWorkspace/spec/template'; -import { DeprecatedWorkspaceStatus, DevWorkspaceStatus, WorkspaceStatus } from '../helpers/types'; +import devfileApi, { isDevfileV2, isDevWorkspace } from '@/services/devfileApi'; +import { DEVWORKSPACE_UPDATING_TIMESTAMP_ANNOTATION } from '@/services/devfileApi/devWorkspace/metadata'; +import { DEVWORKSPACE_STORAGE_TYPE_ATTR } from '@/services/devfileApi/devWorkspace/spec/template'; +import { + DeprecatedWorkspaceStatus, + DevWorkspaceStatus, + WorkspaceStatus, +} from '@/services/helpers/types'; import { devfileToDevWorkspace, devWorkspaceToDevfile, -} from '../workspace-client/devworkspace/converters'; -import { DEVWORKSPACE_NEXT_START_ANNOTATION } from '../workspace-client/devworkspace/devWorkspaceClient'; +} from '@/services/workspace-client/devworkspace/converters'; +import { DEVWORKSPACE_NEXT_START_ANNOTATION } from '@/services/workspace-client/devworkspace/devWorkspaceClient'; export interface Workspace { readonly ref: devfileApi.DevWorkspace; diff --git a/packages/dashboard-frontend/src/services/workspace-client/__tests__/helpers.spec.ts b/packages/dashboard-frontend/src/services/workspace-client/__tests__/helpers.spec.ts index 124c824011..58b41352e0 100644 --- a/packages/dashboard-frontend/src/services/workspace-client/__tests__/helpers.spec.ts +++ b/packages/dashboard-frontend/src/services/workspace-client/__tests__/helpers.spec.ts @@ -10,12 +10,18 @@ * Red Hat, Inc. - initial API and implementation */ -import { getCustomEditor, isForbidden, isInternalServerError, isUnauthorized } from '../helpers'; -import { CHE_EDITOR_YAML_PATH } from '../'; -import { dump } from 'js-yaml'; import common from '@eclipse-che/common'; -import devfileApi from '../../devfileApi'; -import { FakeStoreBuilder } from '../../../store/__mocks__/storeBuilder'; +import { dump } from 'js-yaml'; + +import devfileApi from '@/services/devfileApi'; +import { CHE_EDITOR_YAML_PATH } from '@/services/workspace-client'; +import { + getCustomEditor, + isForbidden, + isInternalServerError, + isUnauthorized, +} from '@/services/workspace-client/helpers'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; describe('Workspace-client helpers', () => { describe('checks for HTTP 401 Unauthorized response status code', () => { diff --git a/packages/dashboard-frontend/src/services/workspace-client/cheworkspace/cheWorkspaceClient.ts b/packages/dashboard-frontend/src/services/workspace-client/cheworkspace/cheWorkspaceClient.ts index 9c783beeb6..1cd38a8b16 100644 --- a/packages/dashboard-frontend/src/services/workspace-client/cheworkspace/cheWorkspaceClient.ts +++ b/packages/dashboard-frontend/src/services/workspace-client/cheworkspace/cheWorkspaceClient.ts @@ -10,8 +10,8 @@ * Red Hat, Inc. - initial API and implementation */ -import { injectable } from 'inversify'; import { default as WorkspaceClientLib, IRemoteAPI } from '@eclipse-che/workspace-client'; +import { injectable } from 'inversify'; /** * This class manages the api connection. diff --git a/packages/dashboard-frontend/src/services/workspace-client/devworkspace/DevWorkspaceDefaultPluginsHandler.ts b/packages/dashboard-frontend/src/services/workspace-client/devworkspace/DevWorkspaceDefaultPluginsHandler.ts index aceaf43dd5..28274e5107 100644 --- a/packages/dashboard-frontend/src/services/workspace-client/devworkspace/DevWorkspaceDefaultPluginsHandler.ts +++ b/packages/dashboard-frontend/src/services/workspace-client/devworkspace/DevWorkspaceDefaultPluginsHandler.ts @@ -10,17 +10,18 @@ * Red Hat, Inc. - initial API and implementation */ -import * as DwApi from '../../dashboard-backend-client/devWorkspaceApi'; -import devfileApi from '../../devfileApi'; -import { api } from '@eclipse-che/common'; -import { createHash } from 'crypto'; -import { injectable } from 'inversify'; import { V1alpha2DevWorkspaceSpecContributions, V1alpha2DevWorkspaceSpecTemplateComponents, } from '@devfile/api'; -import { WorkspacesDefaultPlugins } from 'dashboard-frontend/src/store/Plugins/devWorkspacePlugins'; -import { DevWorkspacePlugin } from '../../devfileApi/devWorkspace'; +import { api } from '@eclipse-che/common'; +import { createHash } from 'crypto'; +import { injectable } from 'inversify'; + +import * as DwApi from '@/services/dashboard-backend-client/devWorkspaceApi'; +import devfileApi from '@/services/devfileApi'; +import { DevWorkspacePlugin } from '@/services/devfileApi/devWorkspace'; +import { WorkspacesDefaultPlugins } from '@/store/Plugins/devWorkspacePlugins'; const DEFAULT_PLUGIN_ATTRIBUTE = 'che.eclipse.org/default-plugin'; diff --git a/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.changeWorkspaceStatus.spec.ts b/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.changeWorkspaceStatus.spec.ts index 2e1738a3f8..535407174f 100644 --- a/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.changeWorkspaceStatus.spec.ts +++ b/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.changeWorkspaceStatus.spec.ts @@ -10,10 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ -import { container } from '../../../../inversify.config'; -import { DevWorkspaceBuilder } from '../../../../store/__mocks__/devWorkspaceBuilder'; -import { DevWorkspaceClient } from '../devWorkspaceClient'; -import * as DwApi from '../../../dashboard-backend-client/devWorkspaceApi'; +import { container } from '@/inversify.config'; +import * as DwApi from '@/services/dashboard-backend-client/devWorkspaceApi'; +import { DevWorkspaceClient } from '@/services/workspace-client/devworkspace/devWorkspaceClient'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; describe('DevWorkspace client, changeWorkspaceStatus', () => { let client: DevWorkspaceClient; diff --git a/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.create.spec.ts b/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.create.spec.ts index 557432a824..6d65ca32a3 100644 --- a/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.create.spec.ts +++ b/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.create.spec.ts @@ -10,11 +10,11 @@ * Red Hat, Inc. - initial API and implementation */ -import { container } from '../../../../inversify.config'; -import { DevWorkspaceClient } from '../devWorkspaceClient'; -import * as DwtApi from '../../../dashboard-backend-client/devWorkspaceTemplateApi'; -import * as DwApi from '../../../dashboard-backend-client/devWorkspaceApi'; -import devfileApi from '../../../devfileApi'; +import { container } from '@/inversify.config'; +import * as DwApi from '@/services/dashboard-backend-client/devWorkspaceApi'; +import * as DwtApi from '@/services/dashboard-backend-client/devWorkspaceTemplateApi'; +import devfileApi from '@/services/devfileApi'; +import { DevWorkspaceClient } from '@/services/workspace-client/devworkspace/devWorkspaceClient'; describe('DevWorkspace client, create', () => { let client: DevWorkspaceClient; diff --git a/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.debugMode.spec.ts b/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.debugMode.spec.ts index 55e3b75859..6b5fbb5d1b 100644 --- a/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.debugMode.spec.ts +++ b/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.debugMode.spec.ts @@ -10,11 +10,15 @@ * Red Hat, Inc. - initial API and implementation */ -import { DEVWORKSPACE_DEBUG_START_ANNOTATION, DevWorkspaceClient } from '../devWorkspaceClient'; -import { container } from '../../../../inversify.config'; -import devfileApi from '../../../devfileApi'; import mockAxios from 'axios'; -import { DevWorkspaceBuilder } from '../../../../store/__mocks__/devWorkspaceBuilder'; + +import { container } from '@/inversify.config'; +import devfileApi from '@/services/devfileApi'; +import { + DEVWORKSPACE_DEBUG_START_ANNOTATION, + DevWorkspaceClient, +} from '@/services/workspace-client/devworkspace/devWorkspaceClient'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; describe('DevWorkspaceClient debug mode', () => { const devWorkspaceClient = container.get(DevWorkspaceClient); diff --git a/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.editorUpdate.spec.ts b/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.editorUpdate.spec.ts index 555362c378..efb6d3a9fd 100644 --- a/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.editorUpdate.spec.ts +++ b/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.editorUpdate.spec.ts @@ -10,13 +10,14 @@ * Red Hat, Inc. - initial API and implementation */ -import { container } from '../../../../inversify.config'; -import { DevWorkspaceClient } from '../devWorkspaceClient'; import mockAxios from 'axios'; -import { dashboardBackendPrefix } from '../../../dashboard-backend-client/const'; -import getDevWorkspaceTemplate from './__mocks__/devWorkspaceSpecTemplates'; -import devfileApi from '../../../devfileApi'; -import * as DwtApi from '../../../dashboard-backend-client/devWorkspaceTemplateApi'; + +import { container } from '@/inversify.config'; +import { dashboardBackendPrefix } from '@/services/dashboard-backend-client/const'; +import * as DwtApi from '@/services/dashboard-backend-client/devWorkspaceTemplateApi'; +import devfileApi from '@/services/devfileApi'; +import getDevWorkspaceTemplate from '@/services/workspace-client/devworkspace/__tests__/__mocks__/devWorkspaceSpecTemplates'; +import { DevWorkspaceClient } from '@/services/workspace-client/devworkspace/devWorkspaceClient'; describe('DevWorkspace client editor update', () => { const namespace = 'admin-che'; diff --git a/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.onStart.spec.ts b/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.onStart.spec.ts index 223b1836cd..3417ec88dd 100644 --- a/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.onStart.spec.ts +++ b/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.onStart.spec.ts @@ -10,12 +10,13 @@ * Red Hat, Inc. - initial API and implementation */ -import { container } from '../../../../inversify.config'; -import { DevWorkspaceBuilder } from '../../../../store/__mocks__/devWorkspaceBuilder'; -import { DevWorkspaceClient } from '../devWorkspaceClient'; -import * as DwApi from '../../../dashboard-backend-client/devWorkspaceApi'; import mockAxios from 'axios'; +import { container } from '@/inversify.config'; +import * as DwApi from '@/services/dashboard-backend-client/devWorkspaceApi'; +import { DevWorkspaceClient } from '@/services/workspace-client/devworkspace/devWorkspaceClient'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; + /* eslint-disable @typescript-eslint/no-non-null-assertion */ describe('DevWorkspace client, start', () => { let client: DevWorkspaceClient; diff --git a/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.spec.ts b/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.spec.ts index b83a6b7b93..b7aee50cdb 100644 --- a/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.spec.ts +++ b/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.spec.ts @@ -10,10 +10,11 @@ * Red Hat, Inc. - initial API and implementation */ -import { container } from '../../../../inversify.config'; -import { DevWorkspaceBuilder } from '../../../../store/__mocks__/devWorkspaceBuilder'; import mockAxios from 'axios'; -import { DevWorkspaceClient } from '../devWorkspaceClient'; + +import { container } from '@/inversify.config'; +import { DevWorkspaceClient } from '@/services/workspace-client/devworkspace/devWorkspaceClient'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; describe('DevWorkspace client', () => { let client: DevWorkspaceClient; diff --git a/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.update.spec.ts b/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.update.spec.ts index 72eb58f9fe..3d10a00637 100644 --- a/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.update.spec.ts +++ b/packages/dashboard-frontend/src/services/workspace-client/devworkspace/__tests__/devWorkspaceClient.update.spec.ts @@ -10,10 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ -import { container } from '../../../../inversify.config'; -import { DevWorkspaceBuilder } from '../../../../store/__mocks__/devWorkspaceBuilder'; -import { DevWorkspaceClient } from '../devWorkspaceClient'; -import * as DwApi from '../../../dashboard-backend-client/devWorkspaceApi'; +import { container } from '@/inversify.config'; +import * as DwApi from '@/services/dashboard-backend-client/devWorkspaceApi'; +import { DevWorkspaceClient } from '@/services/workspace-client/devworkspace/devWorkspaceClient'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; describe('DevWorkspace client, update', () => { let client: DevWorkspaceClient; diff --git a/packages/dashboard-frontend/src/services/workspace-client/devworkspace/converters/__tests__/converter.spec.ts b/packages/dashboard-frontend/src/services/workspace-client/devworkspace/converters/__tests__/converter.spec.ts index c634b6f975..82eb8e96cd 100644 --- a/packages/dashboard-frontend/src/services/workspace-client/devworkspace/converters/__tests__/converter.spec.ts +++ b/packages/dashboard-frontend/src/services/workspace-client/devworkspace/converters/__tests__/converter.spec.ts @@ -12,6 +12,7 @@ import * as fs from 'fs'; import * as yaml from 'js-yaml'; + import { devfileSchemaVersion, devfileToDevWorkspace, devWorkspaceToDevfile } from '..'; describe('testing sample conversions', () => { diff --git a/packages/dashboard-frontend/src/services/workspace-client/devworkspace/converters/index.ts b/packages/dashboard-frontend/src/services/workspace-client/devworkspace/converters/index.ts index c95658f7f0..7ab99e574f 100644 --- a/packages/dashboard-frontend/src/services/workspace-client/devworkspace/converters/index.ts +++ b/packages/dashboard-frontend/src/services/workspace-client/devworkspace/converters/index.ts @@ -11,11 +11,15 @@ */ import { V1alpha2DevWorkspaceSpecTemplateComponents } from '@devfile/api'; -import devfileApi, { isDevfileV2 } from '../../../devfileApi'; -import { DevWorkspaceSpecTemplateAttribute } from '../../../devfileApi/devWorkspace/spec/template'; -import { DEVWORKSPACE_DEVFILE, DEVWORKSPACE_METADATA_ANNOTATION } from '../devWorkspaceClient'; -import { load } from 'js-yaml'; import { helpers } from '@eclipse-che/common'; +import { load } from 'js-yaml'; + +import devfileApi, { isDevfileV2 } from '@/services/devfileApi'; +import { DevWorkspaceSpecTemplateAttribute } from '@/services/devfileApi/devWorkspace/spec/template'; +import { + DEVWORKSPACE_DEVFILE, + DEVWORKSPACE_METADATA_ANNOTATION, +} from '@/services/workspace-client/devworkspace/devWorkspaceClient'; export const devfileSchemaVersion = '2.2.0'; diff --git a/packages/dashboard-frontend/src/services/workspace-client/devworkspace/devWorkspaceClient.ts b/packages/dashboard-frontend/src/services/workspace-client/devworkspace/devWorkspaceClient.ts index 629ce1cc2e..a78dc5824c 100644 --- a/packages/dashboard-frontend/src/services/workspace-client/devworkspace/devWorkspaceClient.ts +++ b/packages/dashboard-frontend/src/services/workspace-client/devworkspace/devWorkspaceClient.ts @@ -17,35 +17,36 @@ import { V221DevfileComponentsItemsContainer, } from '@devfile/api'; import { api } from '@eclipse-che/common'; -import { WorkspacesDefaultPlugins } from 'dashboard-frontend/src/store/Plugins/devWorkspacePlugins'; import { decorate, inject, injectable } from 'inversify'; import { load } from 'js-yaml'; import { cloneDeep, isEqual } from 'lodash'; -import * as DwApi from '../../dashboard-backend-client/devWorkspaceApi'; -import * as DwtApi from '../../dashboard-backend-client/devWorkspaceTemplateApi'; -import devfileApi from '../../devfileApi'; + +import * as DwApi from '@/services/dashboard-backend-client/devWorkspaceApi'; +import * as DwtApi from '@/services/dashboard-backend-client/devWorkspaceTemplateApi'; +import devfileApi from '@/services/devfileApi'; +import { DevWorkspacePlugin } from '@/services/devfileApi/devWorkspace'; import { DEVWORKSPACE_CHE_EDITOR, DEVWORKSPACE_UPDATING_TIMESTAMP_ANNOTATION, -} from '../../devfileApi/devWorkspace/metadata'; +} from '@/services/devfileApi/devWorkspace/metadata'; import { DEVWORKSPACE_CONFIG_ATTR, DEVWORKSPACE_CONTAINER_BUILD_ATTR, DEVWORKSPACE_STORAGE_TYPE_ATTR, -} from '../../devfileApi/devWorkspace/spec/template'; -import { delay } from '../../helpers/delay'; -import { isWebTerminal } from '../../helpers/devworkspace'; -import { DevWorkspaceStatus } from '../../helpers/types'; -import { fetchData } from '../../registry/fetchData'; -import { WorkspaceAdapter } from '../../workspace-adapter'; -import { WorkspaceClient } from '../index'; +} from '@/services/devfileApi/devWorkspace/spec/template'; +import { delay } from '@/services/helpers/delay'; +import { isWebTerminal } from '@/services/helpers/devworkspace'; +import { DevWorkspaceStatus } from '@/services/helpers/types'; +import { fetchData } from '@/services/registry/fetchData'; +import { WorkspaceAdapter } from '@/services/workspace-adapter'; import { devWorkspaceApiGroup, devWorkspaceSingularSubresource, devWorkspaceVersion, -} from './converters'; -import { DevWorkspaceDefaultPluginsHandler } from './DevWorkspaceDefaultPluginsHandler'; -import { DevWorkspacePlugin } from '../../devfileApi/devWorkspace'; +} from '@/services/workspace-client/devworkspace/converters'; +import { DevWorkspaceDefaultPluginsHandler } from '@/services/workspace-client/devworkspace/DevWorkspaceDefaultPluginsHandler'; +import { WorkspaceClient } from '@/services/workspace-client/index'; +import { WorkspacesDefaultPlugins } from '@/store/Plugins/devWorkspacePlugins'; export const COMPONENT_UPDATE_POLICY = 'che.eclipse.org/components-update-policy'; export const REGISTRY_URL = 'che.eclipse.org/plugin-registry-url'; diff --git a/packages/dashboard-frontend/src/services/workspace-client/helpers.ts b/packages/dashboard-frontend/src/services/workspace-client/helpers.ts index 847816c313..e65f342047 100644 --- a/packages/dashboard-frontend/src/services/workspace-client/helpers.ts +++ b/packages/dashboard-frontend/src/services/workspace-client/helpers.ts @@ -11,14 +11,15 @@ */ import common from '@eclipse-che/common'; -import devfileApi, { isDevfileV2 } from '../devfileApi'; -import { load, dump } from 'js-yaml'; -import { ICheEditorYaml } from './devworkspace/devWorkspaceClient'; -import { CHE_EDITOR_YAML_PATH } from './'; -import { AppState } from '../../store'; +import { dump, load } from 'js-yaml'; import { ThunkDispatch } from 'redux-thunk'; -import { KnownAction } from '../../store/DevfileRegistries'; -import { getEditor } from '../../store/DevfileRegistries/getEditor'; + +import devfileApi, { isDevfileV2 } from '@/services/devfileApi'; +import { CHE_EDITOR_YAML_PATH } from '@/services/workspace-client'; +import { ICheEditorYaml } from '@/services/workspace-client/devworkspace/devWorkspaceClient'; +import { AppState } from '@/store'; +import { KnownAction } from '@/store/DevfileRegistries'; +import { getEditor } from '@/store/DevfileRegistries/getEditor'; /** * Checks for HTTP 401 Unauthorized response status code diff --git a/packages/dashboard-frontend/src/store/BannerAlert/index.ts b/packages/dashboard-frontend/src/store/BannerAlert/index.ts index 2bcac8a609..a260fbeb01 100644 --- a/packages/dashboard-frontend/src/store/BannerAlert/index.ts +++ b/packages/dashboard-frontend/src/store/BannerAlert/index.ts @@ -11,8 +11,10 @@ */ import { Action, Reducer } from 'redux'; + +import { createObject } from '@/store/helpers'; + import { AppThunk } from '..'; -import { createObject } from '../helpers'; export interface State { messages: string[]; diff --git a/packages/dashboard-frontend/src/store/BannerAlert/selectors.ts b/packages/dashboard-frontend/src/store/BannerAlert/selectors.ts index 187fb16ac5..70857166ed 100644 --- a/packages/dashboard-frontend/src/store/BannerAlert/selectors.ts +++ b/packages/dashboard-frontend/src/store/BannerAlert/selectors.ts @@ -11,6 +11,7 @@ */ import { createSelector } from 'reselect'; + import { AppState } from '..'; const selectState = (state: AppState) => state.bannerAlert; diff --git a/packages/dashboard-frontend/src/store/Branding/index.ts b/packages/dashboard-frontend/src/store/Branding/index.ts index 5d0ae02010..ca0233e616 100644 --- a/packages/dashboard-frontend/src/store/Branding/index.ts +++ b/packages/dashboard-frontend/src/store/Branding/index.ts @@ -10,15 +10,17 @@ * Red Hat, Inc. - initial API and implementation */ +import common from '@eclipse-che/common'; +import axios from 'axios'; +import { merge } from 'lodash'; import { Action, Reducer } from 'redux'; -import { fetchBranding } from '../../services/assets/branding'; + +import { fetchBranding } from '@/services/assets/branding'; +import { BRANDING_DEFAULT, BrandingData } from '@/services/bootstrap/branding.constant'; +import { createObject } from '@/store/helpers'; +import { AUTHORIZED, SanityCheckAction } from '@/store/sanityCheckMiddleware'; + import { AppThunk } from '..'; -import { merge } from 'lodash'; -import axios from 'axios'; -import common from '@eclipse-che/common'; -import { BRANDING_DEFAULT, BrandingData } from '../../services/bootstrap/branding.constant'; -import { createObject } from '../helpers'; -import { AUTHORIZED, SanityCheckAction } from '../sanityCheckMiddleware'; export const ASSET_PREFIX = './assets/branding/'; diff --git a/packages/dashboard-frontend/src/store/Branding/selectors.ts b/packages/dashboard-frontend/src/store/Branding/selectors.ts index 77e7e9cf46..1e1ab8b581 100644 --- a/packages/dashboard-frontend/src/store/Branding/selectors.ts +++ b/packages/dashboard-frontend/src/store/Branding/selectors.ts @@ -11,6 +11,7 @@ */ import { createSelector } from 'reselect'; + import { AppState } from '..'; const selectState = (state: AppState) => state.branding; diff --git a/packages/dashboard-frontend/src/store/ClusterConfig/__tests__/index.spec.ts b/packages/dashboard-frontend/src/store/ClusterConfig/__tests__/index.spec.ts index a6430956b9..242eefd16b 100644 --- a/packages/dashboard-frontend/src/store/ClusterConfig/__tests__/index.spec.ts +++ b/packages/dashboard-frontend/src/store/ClusterConfig/__tests__/index.spec.ts @@ -10,15 +10,17 @@ * Red Hat, Inc. - initial API and implementation */ +import { ClusterConfig } from '@eclipse-che/common'; import mockAxios, { AxiosError } from 'axios'; -import { MockStoreEnhanced } from 'redux-mock-store'; import { AnyAction } from 'redux'; +import { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; -import { ClusterConfig } from '@eclipse-che/common'; -import { FakeStoreBuilder } from '../../__mocks__/storeBuilder'; -import { AppState } from '../..'; + +import { AppState } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { AUTHORIZED } from '@/store/sanityCheckMiddleware'; + import * as testStore from '..'; -import { AUTHORIZED } from '../../sanityCheckMiddleware'; describe('clusterConfig store', () => { const clusterConfig: ClusterConfig = { diff --git a/packages/dashboard-frontend/src/store/ClusterConfig/__tests__/selectors.spec.ts b/packages/dashboard-frontend/src/store/ClusterConfig/__tests__/selectors.spec.ts index 64f8ce1339..53c58e31dd 100644 --- a/packages/dashboard-frontend/src/store/ClusterConfig/__tests__/selectors.spec.ts +++ b/packages/dashboard-frontend/src/store/ClusterConfig/__tests__/selectors.spec.ts @@ -12,14 +12,16 @@ import { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; -import { AppState } from '../..'; -import { FakeStoreBuilder } from '../../__mocks__/storeBuilder'; -import * as store from '..'; + +import { AppState } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; import { selectClusterConfigError, selectDashboardWarning, selectRunningWorkspacesLimit, -} from '../selectors'; +} from '@/store/ClusterConfig/selectors'; + +import * as store from '..'; describe('ClusterConfig', () => { it('should return an error', () => { diff --git a/packages/dashboard-frontend/src/store/ClusterConfig/index.ts b/packages/dashboard-frontend/src/store/ClusterConfig/index.ts index e6e10ec318..5817e6ed55 100644 --- a/packages/dashboard-frontend/src/store/ClusterConfig/index.ts +++ b/packages/dashboard-frontend/src/store/ClusterConfig/index.ts @@ -10,14 +10,16 @@ * Red Hat, Inc. - initial API and implementation */ -import { Action, Reducer } from 'redux'; import common, { ClusterConfig } from '@eclipse-che/common'; +import { Action, Reducer } from 'redux'; + +import { fetchClusterConfig } from '@/services/dashboard-backend-client/clusterConfigApi'; +import * as BannerAlertStore from '@/store/BannerAlert'; +import { AddBannerAction } from '@/store/BannerAlert'; +import { createObject } from '@/store/helpers'; +import { AUTHORIZED, SanityCheckAction } from '@/store/sanityCheckMiddleware'; + import { AppThunk } from '..'; -import { createObject } from '../helpers'; -import * as BannerAlertStore from '../BannerAlert'; -import { fetchClusterConfig } from '../../services/dashboard-backend-client/clusterConfigApi'; -import { AddBannerAction } from '../BannerAlert'; -import { AUTHORIZED, SanityCheckAction } from '../sanityCheckMiddleware'; export interface State { isLoading: boolean; diff --git a/packages/dashboard-frontend/src/store/ClusterConfig/selectors.ts b/packages/dashboard-frontend/src/store/ClusterConfig/selectors.ts index 63626422e2..4a2b5a4cf2 100644 --- a/packages/dashboard-frontend/src/store/ClusterConfig/selectors.ts +++ b/packages/dashboard-frontend/src/store/ClusterConfig/selectors.ts @@ -11,6 +11,7 @@ */ import { createSelector } from 'reselect'; + import { AppState } from '..'; const selectState = (state: AppState) => state.clusterConfig; diff --git a/packages/dashboard-frontend/src/store/ClusterInfo/__tests__/index.spec.ts b/packages/dashboard-frontend/src/store/ClusterInfo/__tests__/index.spec.ts index cde12189c7..0ee83330ea 100644 --- a/packages/dashboard-frontend/src/store/ClusterInfo/__tests__/index.spec.ts +++ b/packages/dashboard-frontend/src/store/ClusterInfo/__tests__/index.spec.ts @@ -10,15 +10,17 @@ * Red Hat, Inc. - initial API and implementation */ +import { ApplicationId, ClusterInfo } from '@eclipse-che/common'; import mockAxios, { AxiosError } from 'axios'; -import { MockStoreEnhanced } from 'redux-mock-store'; import { AnyAction } from 'redux'; +import { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; -import { ApplicationId, ClusterInfo } from '@eclipse-che/common'; -import { FakeStoreBuilder } from '../../__mocks__/storeBuilder'; -import { AppState } from '../..'; + +import { AppState } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { AUTHORIZED } from '@/store/sanityCheckMiddleware'; + import * as testStore from '..'; -import { AUTHORIZED } from '../../sanityCheckMiddleware'; describe('clusterInfo store', () => { const clusterInfo: ClusterInfo = { diff --git a/packages/dashboard-frontend/src/store/ClusterInfo/__tests__/selectors.spec.ts b/packages/dashboard-frontend/src/store/ClusterInfo/__tests__/selectors.spec.ts index 3cd3a667d7..da4d22efb1 100644 --- a/packages/dashboard-frontend/src/store/ClusterInfo/__tests__/selectors.spec.ts +++ b/packages/dashboard-frontend/src/store/ClusterInfo/__tests__/selectors.spec.ts @@ -12,10 +12,12 @@ import { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; -import { AppState } from '../..'; -import { FakeStoreBuilder } from '../../__mocks__/storeBuilder'; + +import { AppState } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { selectApplications, selectClusterInfoError } from '@/store/ClusterInfo/selectors'; + import * as store from '..'; -import { selectApplications, selectClusterInfoError } from '../selectors'; const applications = [ { diff --git a/packages/dashboard-frontend/src/store/ClusterInfo/index.ts b/packages/dashboard-frontend/src/store/ClusterInfo/index.ts index b1593808df..dbe4e27e98 100644 --- a/packages/dashboard-frontend/src/store/ClusterInfo/index.ts +++ b/packages/dashboard-frontend/src/store/ClusterInfo/index.ts @@ -10,12 +10,14 @@ * Red Hat, Inc. - initial API and implementation */ -import { Action, Reducer } from 'redux'; import common, { ClusterInfo } from '@eclipse-che/common'; +import { Action, Reducer } from 'redux'; + +import { fetchClusterInfo } from '@/services/dashboard-backend-client/clusterInfoApi'; +import { createObject } from '@/store/helpers'; +import { AUTHORIZED, SanityCheckAction } from '@/store/sanityCheckMiddleware'; + import { AppThunk } from '..'; -import { createObject } from '../helpers'; -import { fetchClusterInfo } from '../../services/dashboard-backend-client/clusterInfoApi'; -import { AUTHORIZED, SanityCheckAction } from '../sanityCheckMiddleware'; export interface State { isLoading: boolean; diff --git a/packages/dashboard-frontend/src/store/ClusterInfo/selectors.ts b/packages/dashboard-frontend/src/store/ClusterInfo/selectors.ts index e3af88d387..31eed7cece 100644 --- a/packages/dashboard-frontend/src/store/ClusterInfo/selectors.ts +++ b/packages/dashboard-frontend/src/store/ClusterInfo/selectors.ts @@ -11,6 +11,7 @@ */ import { createSelector } from 'reselect'; + import { AppState } from '..'; const selectState = (state: AppState) => state.clusterInfo; diff --git a/packages/dashboard-frontend/src/store/DevfileRegistries/__tests__/fetchAndUpdateDevfileSchema.spec.ts b/packages/dashboard-frontend/src/store/DevfileRegistries/__tests__/fetchAndUpdateDevfileSchema.spec.ts index 184be02235..c28e1c7539 100644 --- a/packages/dashboard-frontend/src/store/DevfileRegistries/__tests__/fetchAndUpdateDevfileSchema.spec.ts +++ b/packages/dashboard-frontend/src/store/DevfileRegistries/__tests__/fetchAndUpdateDevfileSchema.spec.ts @@ -10,10 +10,11 @@ * Red Hat, Inc. - initial API and implementation */ -import fetchAndUpdateDevfileSchema from '../fetchAndUpdateDevfileSchema'; +import mockAxios from 'axios'; import { JSONSchema7 } from 'json-schema'; import { cloneDeep } from 'lodash'; -import mockAxios from 'axios'; + +import fetchAndUpdateDevfileSchema from '@/store/DevfileRegistries/fetchAndUpdateDevfileSchema'; describe('Get devfile schema', () => { afterEach(() => { diff --git a/packages/dashboard-frontend/src/store/DevfileRegistries/__tests__/getEditor.spec.ts b/packages/dashboard-frontend/src/store/DevfileRegistries/__tests__/getEditor.spec.ts index 9c5da16010..66599dd53c 100644 --- a/packages/dashboard-frontend/src/store/DevfileRegistries/__tests__/getEditor.spec.ts +++ b/packages/dashboard-frontend/src/store/DevfileRegistries/__tests__/getEditor.spec.ts @@ -10,12 +10,13 @@ * Red Hat, Inc. - initial API and implementation */ -import { dump } from 'js-yaml'; -import mockAxios from 'axios'; import common from '@eclipse-che/common'; -import devfileApi from '../../../services/devfileApi'; -import { getEditor } from '../getEditor'; -import { FakeStoreBuilder } from '../../__mocks__/storeBuilder'; +import mockAxios from 'axios'; +import { dump } from 'js-yaml'; + +import devfileApi from '@/services/devfileApi'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { getEditor } from '@/store/DevfileRegistries/getEditor'; describe('Get Devfile by URL', () => { let editor: devfileApi.Devfile; diff --git a/packages/dashboard-frontend/src/store/DevfileRegistries/__tests__/index.spec.ts b/packages/dashboard-frontend/src/store/DevfileRegistries/__tests__/index.spec.ts index 58fa8b3f84..714425cbc5 100644 --- a/packages/dashboard-frontend/src/store/DevfileRegistries/__tests__/index.spec.ts +++ b/packages/dashboard-frontend/src/store/DevfileRegistries/__tests__/index.spec.ts @@ -11,13 +11,15 @@ */ import mockAxios from 'axios'; +import { AnyAction } from 'redux'; import { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; -import { FakeStoreBuilder } from '../../__mocks__/storeBuilder'; + +import { AppState } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { AUTHORIZED } from '@/store/sanityCheckMiddleware'; + import * as devfileRegistriesStore from '..'; -import { AppState } from '../..'; -import { AnyAction } from 'redux'; -import { AUTHORIZED } from '../../sanityCheckMiddleware'; // mute error outputs console.error = jest.fn(); diff --git a/packages/dashboard-frontend/src/store/DevfileRegistries/__tests__/selectors.spec.ts b/packages/dashboard-frontend/src/store/DevfileRegistries/__tests__/selectors.spec.ts index e230e732df..8fc0e07ade 100644 --- a/packages/dashboard-frontend/src/store/DevfileRegistries/__tests__/selectors.spec.ts +++ b/packages/dashboard-frontend/src/store/DevfileRegistries/__tests__/selectors.spec.ts @@ -10,15 +10,16 @@ * Red Hat, Inc. - initial API and implementation */ +import { api } from '@eclipse-che/common'; +import { dump } from 'js-yaml'; +import { AnyAction } from 'redux'; import { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; -import { FakeStoreBuilder } from '../../__mocks__/storeBuilder'; -import { AppState } from '../..'; -import { selectDefaultDevfile } from '../selectors'; -import { AnyAction } from 'redux'; -import { dump } from 'js-yaml'; -import devfileApi from '../../../services/devfileApi'; -import { api } from '@eclipse-che/common'; + +import devfileApi from '@/services/devfileApi'; +import { AppState } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { selectDefaultDevfile } from '@/store/DevfileRegistries/selectors'; describe('devfileRegistries selectors', () => { const registryUrl = 'https://registry-url'; diff --git a/packages/dashboard-frontend/src/store/DevfileRegistries/fetchAndUpdateDevfileSchema.ts b/packages/dashboard-frontend/src/store/DevfileRegistries/fetchAndUpdateDevfileSchema.ts index 9f0c4ae6b1..a3b52e224a 100644 --- a/packages/dashboard-frontend/src/store/DevfileRegistries/fetchAndUpdateDevfileSchema.ts +++ b/packages/dashboard-frontend/src/store/DevfileRegistries/fetchAndUpdateDevfileSchema.ts @@ -11,7 +11,8 @@ */ import { JSONSchema7 } from 'json-schema'; -import { getDevfileSchema } from '../../services/dashboard-backend-client/devWorkspaceApi'; + +import { getDevfileSchema } from '@/services/dashboard-backend-client/devWorkspaceApi'; export default async function fetchAndUpdateDevfileSchema( schemaVersion: string, diff --git a/packages/dashboard-frontend/src/store/DevfileRegistries/getEditor.ts b/packages/dashboard-frontend/src/store/DevfileRegistries/getEditor.ts index dd1f7b411f..5516ac4fd1 100644 --- a/packages/dashboard-frontend/src/store/DevfileRegistries/getEditor.ts +++ b/packages/dashboard-frontend/src/store/DevfileRegistries/getEditor.ts @@ -11,8 +11,9 @@ */ import { ThunkDispatch } from 'redux-thunk'; -import { AppState } from '../index'; -import { KnownAction, actionCreators } from './index'; + +import { actionCreators, KnownAction } from '@/store/DevfileRegistries/index'; +import { AppState } from '@/store/index'; export async function getEditor( editorIdOrPath: string, diff --git a/packages/dashboard-frontend/src/store/DevfileRegistries/index.ts b/packages/dashboard-frontend/src/store/DevfileRegistries/index.ts index f8980f7b40..3c2b75c2a3 100644 --- a/packages/dashboard-frontend/src/store/DevfileRegistries/index.ts +++ b/packages/dashboard-frontend/src/store/DevfileRegistries/index.ts @@ -10,15 +10,17 @@ * Red Hat, Inc. - initial API and implementation */ -import { Action, Reducer } from 'redux'; import common from '@eclipse-che/common'; +import { Action, Reducer } from 'redux'; + +import devfileApi from '@/services/devfileApi'; +import { fetchDevfile, fetchRegistryMetadata } from '@/services/registry/devfiles'; +import { fetchResources, loadResourcesContent } from '@/services/registry/resources'; +import fetchAndUpdateDevfileSchema from '@/store/DevfileRegistries/fetchAndUpdateDevfileSchema'; +import { createObject } from '@/store/helpers'; +import { AUTHORIZED, SanityCheckAction } from '@/store/sanityCheckMiddleware'; + import { AppThunk } from '..'; -import { fetchRegistryMetadata, fetchDevfile } from '../../services/registry/devfiles'; -import { createObject } from '../helpers'; -import fetchAndUpdateDevfileSchema from './fetchAndUpdateDevfileSchema'; -import devfileApi from '../../services/devfileApi'; -import { fetchResources, loadResourcesContent } from '../../services/registry/resources'; -import { AUTHORIZED, SanityCheckAction } from '../sanityCheckMiddleware'; export const DEFAULT_REGISTRY = '/dashboard/devfile-registry/'; diff --git a/packages/dashboard-frontend/src/store/DevfileRegistries/selectors.ts b/packages/dashboard-frontend/src/store/DevfileRegistries/selectors.ts index 9cba59c3c4..a73d0ee48c 100644 --- a/packages/dashboard-frontend/src/store/DevfileRegistries/selectors.ts +++ b/packages/dashboard-frontend/src/store/DevfileRegistries/selectors.ts @@ -10,12 +10,14 @@ * Red Hat, Inc. - initial API and implementation */ +import { load } from 'js-yaml'; import { createSelector } from 'reselect'; + +import devfileApi from '@/services/devfileApi'; +import match from '@/services/helpers/filter'; +import { selectDefaultComponents } from '@/store/ServerConfig/selectors'; + import { AppState } from '..'; -import match from '../../services/helpers/filter'; -import { load } from 'js-yaml'; -import devfileApi from '../../services/devfileApi'; -import { selectDefaultComponents } from '../ServerConfig/selectors'; export const EMPTY_WORKSPACE_TAG = 'Empty'; diff --git a/packages/dashboard-frontend/src/store/DockerConfig/__tests__/index.spec.ts b/packages/dashboard-frontend/src/store/DockerConfig/__tests__/index.spec.ts index cb00ccd91f..8a9917048c 100644 --- a/packages/dashboard-frontend/src/store/DockerConfig/__tests__/index.spec.ts +++ b/packages/dashboard-frontend/src/store/DockerConfig/__tests__/index.spec.ts @@ -11,13 +11,15 @@ */ import mockAxios from 'axios'; +import { AnyAction } from 'redux'; import { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; -import { FakeStoreBuilder } from '../../__mocks__/storeBuilder'; + +import { AppState } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { AUTHORIZED } from '@/store/sanityCheckMiddleware'; + import * as dwDockerConfigStore from '..'; -import { AppState } from '../..'; -import { AnyAction } from 'redux'; -import { AUTHORIZED } from '../../sanityCheckMiddleware'; // mute the outputs console.error = jest.fn(); diff --git a/packages/dashboard-frontend/src/store/DockerConfig/__tests__/selectors.spec.ts b/packages/dashboard-frontend/src/store/DockerConfig/__tests__/selectors.spec.ts index 61722b5ca3..4a2b19677e 100644 --- a/packages/dashboard-frontend/src/store/DockerConfig/__tests__/selectors.spec.ts +++ b/packages/dashboard-frontend/src/store/DockerConfig/__tests__/selectors.spec.ts @@ -10,12 +10,13 @@ * Red Hat, Inc. - initial API and implementation */ +import { AnyAction } from 'redux'; import { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; -import { FakeStoreBuilder } from '../../__mocks__/storeBuilder'; -import { AppState } from '../..'; -import { selectIsLoading, selectRegistries, selectError } from '../selectors'; -import { AnyAction } from 'redux'; + +import { AppState } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { selectError, selectIsLoading, selectRegistries } from '@/store/DockerConfig/selectors'; describe('dockerConfig selectors', () => { const registries = [ diff --git a/packages/dashboard-frontend/src/store/DockerConfig/dockerConfigState.ts b/packages/dashboard-frontend/src/store/DockerConfig/dockerConfigState.ts index 4e9229efe1..18d0731648 100644 --- a/packages/dashboard-frontend/src/store/DockerConfig/dockerConfigState.ts +++ b/packages/dashboard-frontend/src/store/DockerConfig/dockerConfigState.ts @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { RegistryEntry } from './types'; +import { RegistryEntry } from '@/store/DockerConfig/types'; export interface State { isLoading: boolean; diff --git a/packages/dashboard-frontend/src/store/DockerConfig/index.ts b/packages/dashboard-frontend/src/store/DockerConfig/index.ts index 453e045561..d4f1e9c5da 100644 --- a/packages/dashboard-frontend/src/store/DockerConfig/index.ts +++ b/packages/dashboard-frontend/src/store/DockerConfig/index.ts @@ -10,15 +10,18 @@ * Red Hat, Inc. - initial API and implementation */ -import { Action, Reducer } from 'redux'; import { api, helpers } from '@eclipse-che/common'; +import { Action, Reducer } from 'redux'; + +import * as DwApi from '@/services/dashboard-backend-client/devWorkspaceApi'; +import { State } from '@/store/DockerConfig/dockerConfigState'; +import { RegistryEntry } from '@/store/DockerConfig/types'; +import { createObject } from '@/store/helpers'; +import { selectDefaultNamespace } from '@/store/InfrastructureNamespaces/selectors'; +import { AUTHORIZED, SanityCheckAction } from '@/store/sanityCheckMiddleware'; + import { AppThunk } from '..'; -import { createObject } from '../helpers'; -import * as DwApi from '../../services/dashboard-backend-client/devWorkspaceApi'; -import { RegistryEntry } from './types'; -import { State } from './dockerConfigState'; -import { AUTHORIZED, SanityCheckAction } from '../sanityCheckMiddleware'; -import { selectDefaultNamespace } from '../InfrastructureNamespaces/selectors'; + export * from './dockerConfigState'; export interface RequestCredentialsAction extends Action, SanityCheckAction { diff --git a/packages/dashboard-frontend/src/store/DockerConfig/selectors.ts b/packages/dashboard-frontend/src/store/DockerConfig/selectors.ts index 2464bf0095..f64f58471e 100644 --- a/packages/dashboard-frontend/src/store/DockerConfig/selectors.ts +++ b/packages/dashboard-frontend/src/store/DockerConfig/selectors.ts @@ -11,8 +11,10 @@ */ import { createSelector } from 'reselect'; + +import { State } from '@/store/DockerConfig/dockerConfigState'; + import { AppState } from '..'; -import { State } from './dockerConfigState'; const selectState = (state: AppState) => state.dockerConfig; diff --git a/packages/dashboard-frontend/src/store/Events/__tests__/actions.spec.ts b/packages/dashboard-frontend/src/store/Events/__tests__/actions.spec.ts index 6679b20abd..d5f5640749 100644 --- a/packages/dashboard-frontend/src/store/Events/__tests__/actions.spec.ts +++ b/packages/dashboard-frontend/src/store/Events/__tests__/actions.spec.ts @@ -15,13 +15,15 @@ import { V1Status } from '@kubernetes/client-node'; import mockAxios, { AxiosError } from 'axios'; import { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; + +import { container } from '@/inversify.config'; +import { WebsocketClient } from '@/services/dashboard-backend-client/websocketClient'; +import { AppState } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { event1, event2 } from '@/store/Events/__tests__/stubs'; +import { AUTHORIZED } from '@/store/sanityCheckMiddleware'; + import * as testStore from '..'; -import { AppState } from '../..'; -import { container } from '../../../inversify.config'; -import { WebsocketClient } from '../../../services/dashboard-backend-client/websocketClient'; -import { AUTHORIZED } from '../../sanityCheckMiddleware'; -import { FakeStoreBuilder } from '../../__mocks__/storeBuilder'; -import { event1, event2 } from './stubs'; describe('Events store, actions', () => { let appStore: MockStoreEnhanced< diff --git a/packages/dashboard-frontend/src/store/Events/__tests__/reducers.spec.ts b/packages/dashboard-frontend/src/store/Events/__tests__/reducers.spec.ts index f5ef4c460b..4f28ea2983 100644 --- a/packages/dashboard-frontend/src/store/Events/__tests__/reducers.spec.ts +++ b/packages/dashboard-frontend/src/store/Events/__tests__/reducers.spec.ts @@ -13,9 +13,11 @@ import { CoreV1Event } from '@kubernetes/client-node'; import { cloneDeep } from 'lodash'; import { AnyAction } from 'redux'; + +import * as stub from '@/store/Events/__tests__/stubs'; +import { AUTHORIZED } from '@/store/sanityCheckMiddleware'; + import * as testStore from '..'; -import { AUTHORIZED } from '../../sanityCheckMiddleware'; -import * as stub from './stubs'; describe('Events store, reducers', () => { let event1: CoreV1Event; diff --git a/packages/dashboard-frontend/src/store/Events/__tests__/selectors.spec.ts b/packages/dashboard-frontend/src/store/Events/__tests__/selectors.spec.ts index c69119ab27..42a6cfd94c 100644 --- a/packages/dashboard-frontend/src/store/Events/__tests__/selectors.spec.ts +++ b/packages/dashboard-frontend/src/store/Events/__tests__/selectors.spec.ts @@ -14,16 +14,18 @@ import { CoreV1Event } from '@kubernetes/client-node'; import { cloneDeep } from 'lodash'; import { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; -import * as store from '..'; -import { AppState } from '../..'; -import { FakeStoreBuilder } from '../../__mocks__/storeBuilder'; + +import { AppState } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import * as stub from '@/store/Events/__tests__/stubs'; import { selectAllEvents, selectEventsError, selectEventsFromResourceVersion, selectEventsResourceVersion, -} from '../selectors'; -import * as stub from './stubs'; +} from '@/store/Events/selectors'; + +import * as store from '..'; describe('Events store, selectors', () => { let event1: CoreV1Event; diff --git a/packages/dashboard-frontend/src/store/Events/index.ts b/packages/dashboard-frontend/src/store/Events/index.ts index cb0a5b8c5b..70eda2bb79 100644 --- a/packages/dashboard-frontend/src/store/Events/index.ts +++ b/packages/dashboard-frontend/src/store/Events/index.ts @@ -13,15 +13,17 @@ import { api, helpers } from '@eclipse-che/common'; import { CoreV1Event } from '@kubernetes/client-node'; import { Action, Reducer } from 'redux'; + +import { container } from '@/inversify.config'; +import { fetchEvents } from '@/services/dashboard-backend-client/eventsApi'; +import { WebsocketClient } from '@/services/dashboard-backend-client/websocketClient'; +import { getNewerResourceVersion } from '@/services/helpers/resourceVersion'; +import { selectEventsResourceVersion } from '@/store/Events/selectors'; +import { createObject } from '@/store/helpers'; +import { selectDefaultNamespace } from '@/store/InfrastructureNamespaces/selectors'; +import { AUTHORIZED, SanityCheckAction } from '@/store/sanityCheckMiddleware'; + import { AppThunk } from '..'; -import { container } from '../../inversify.config'; -import { fetchEvents } from '../../services/dashboard-backend-client/eventsApi'; -import { WebsocketClient } from '../../services/dashboard-backend-client/websocketClient'; -import { getNewerResourceVersion } from '../../services/helpers/resourceVersion'; -import { createObject } from '../helpers'; -import { selectDefaultNamespace } from '../InfrastructureNamespaces/selectors'; -import { AUTHORIZED, SanityCheckAction } from '../sanityCheckMiddleware'; -import { selectEventsResourceVersion } from './selectors'; export interface State { isLoading: boolean; diff --git a/packages/dashboard-frontend/src/store/Events/selectors.ts b/packages/dashboard-frontend/src/store/Events/selectors.ts index 2efc4b6eb1..3e478d19ec 100644 --- a/packages/dashboard-frontend/src/store/Events/selectors.ts +++ b/packages/dashboard-frontend/src/store/Events/selectors.ts @@ -11,6 +11,7 @@ */ import { createSelector } from 'reselect'; + import { AppState } from '..'; const selectState = (state: AppState) => state.events; diff --git a/packages/dashboard-frontend/src/store/FactoryResolver/__tests__/index.spec.ts b/packages/dashboard-frontend/src/store/FactoryResolver/__tests__/index.spec.ts index 3e60c7fc4f..7f03452d59 100644 --- a/packages/dashboard-frontend/src/store/FactoryResolver/__tests__/index.spec.ts +++ b/packages/dashboard-frontend/src/store/FactoryResolver/__tests__/index.spec.ts @@ -10,23 +10,25 @@ * Red Hat, Inc. - initial API and implementation */ -import { MockStoreEnhanced } from 'redux-mock-store'; -import { ThunkDispatch } from 'redux-thunk'; import common from '@eclipse-che/common'; -import { AppState } from '../..'; -import { FakeStoreBuilder } from '../../__mocks__/storeBuilder'; -import devfileApi from '../../../services/devfileApi'; -import * as factoryResolver from '../../../services/dashboard-backend-client/factoryResolverApi'; -import * as factoryResolverStore from '..'; import { AxiosError } from 'axios'; -import normalizeDevfileV1 from '../normalizeDevfileV1'; -import normalizeDevfileV2 from '../normalizeDevfileV2'; +import { MockStoreEnhanced } from 'redux-mock-store'; +import { ThunkDispatch } from 'redux-thunk'; + +import * as factoryResolver from '@/services/dashboard-backend-client/factoryResolverApi'; +import * as yamlResolver from '@/services/dashboard-backend-client/yamlResolverApi'; import { - convertDevfileV2toDevfileV1, convertDevfileV1toDevfileV2, -} from '../../../services/devfile/converters'; -import { AUTHORIZED } from '../../sanityCheckMiddleware'; -import * as yamlResolver from '../../../services/dashboard-backend-client/yamlResolverApi'; + convertDevfileV2toDevfileV1, +} from '@/services/devfile/converters'; +import devfileApi from '@/services/devfileApi'; +import { AppState } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import normalizeDevfileV1 from '@/store/FactoryResolver/normalizeDevfileV1'; +import normalizeDevfileV2 from '@/store/FactoryResolver/normalizeDevfileV2'; +import { AUTHORIZED } from '@/store/sanityCheckMiddleware'; + +import * as factoryResolverStore from '..'; jest.mock('../normalizeDevfileV1.ts'); (normalizeDevfileV1 as jest.Mock).mockImplementation(devfile => { diff --git a/packages/dashboard-frontend/src/store/FactoryResolver/__tests__/normalizeDevfileV2.spec.ts b/packages/dashboard-frontend/src/store/FactoryResolver/__tests__/normalizeDevfileV2.spec.ts index 561cf7e601..86fb84e249 100644 --- a/packages/dashboard-frontend/src/store/FactoryResolver/__tests__/normalizeDevfileV2.spec.ts +++ b/packages/dashboard-frontend/src/store/FactoryResolver/__tests__/normalizeDevfileV2.spec.ts @@ -10,11 +10,12 @@ * Red Hat, Inc. - initial API and implementation */ -import normalizeDevfileV2 from '../normalizeDevfileV2'; -import devfileApi from '../../../services/devfileApi'; -import { FactoryResolver } from '../../../services/helpers/types'; import { V221DevfileComponents } from '@devfile/api'; +import devfileApi from '@/services/devfileApi'; +import { FactoryResolver } from '@/services/helpers/types'; +import normalizeDevfileV2 from '@/store/FactoryResolver/normalizeDevfileV2'; + describe('Normalize Devfile V2', () => { let defaultComponents: V221DevfileComponents[]; diff --git a/packages/dashboard-frontend/src/store/FactoryResolver/index.ts b/packages/dashboard-frontend/src/store/FactoryResolver/index.ts index f390dab1ef..fb21743713 100644 --- a/packages/dashboard-frontend/src/store/FactoryResolver/index.ts +++ b/packages/dashboard-frontend/src/store/FactoryResolver/index.ts @@ -10,25 +10,26 @@ * Red Hat, Inc. - initial API and implementation */ -import { Action, Reducer } from 'redux'; -import axios from 'axios'; import common from '@eclipse-che/common'; -import { FactoryResolver } from '../../services/helpers/types'; -import { AppThunk } from '../index'; -import { createObject } from '../helpers'; -import { selectDefaultComponents, selectPvcStrategy } from '../ServerConfig/selectors'; -import devfileApi, { isDevfileV2 } from '../../services/devfileApi'; -import { convertDevfileV1toDevfileV2 } from '../../services/devfile/converters'; -import normalizeDevfileV2 from './normalizeDevfileV2'; -import normalizeDevfileV1 from './normalizeDevfileV1'; -import { selectDefaultNamespace } from '../InfrastructureNamespaces/selectors'; -import { getYamlResolver } from '../../services/dashboard-backend-client/yamlResolverApi'; -import { DEFAULT_REGISTRY } from '../DevfileRegistries'; -import { isOAuthResponse } from '../../services/oauth'; -import { AUTHORIZED, SanityCheckAction } from '../sanityCheckMiddleware'; -import { CHE_EDITOR_YAML_PATH } from '../../services/workspace-client'; -import { FactoryParams } from '../../services/helpers/factoryFlow/buildFactoryParams'; -import { getFactoryResolver } from '../../services/dashboard-backend-client/factoryResolverApi'; +import axios from 'axios'; +import { Action, Reducer } from 'redux'; + +import { getFactoryResolver } from '@/services/dashboard-backend-client/factoryResolverApi'; +import { getYamlResolver } from '@/services/dashboard-backend-client/yamlResolverApi'; +import { convertDevfileV1toDevfileV2 } from '@/services/devfile/converters'; +import devfileApi, { isDevfileV2 } from '@/services/devfileApi'; +import { FactoryParams } from '@/services/helpers/factoryFlow/buildFactoryParams'; +import { FactoryResolver } from '@/services/helpers/types'; +import { isOAuthResponse } from '@/services/oauth'; +import { CHE_EDITOR_YAML_PATH } from '@/services/workspace-client'; +import { DEFAULT_REGISTRY } from '@/store/DevfileRegistries'; +import normalizeDevfileV1 from '@/store/FactoryResolver/normalizeDevfileV1'; +import normalizeDevfileV2 from '@/store/FactoryResolver/normalizeDevfileV2'; +import { createObject } from '@/store/helpers'; +import { AppThunk } from '@/store/index'; +import { selectDefaultNamespace } from '@/store/InfrastructureNamespaces/selectors'; +import { AUTHORIZED, SanityCheckAction } from '@/store/sanityCheckMiddleware'; +import { selectDefaultComponents, selectPvcStrategy } from '@/store/ServerConfig/selectors'; export type OAuthResponse = { attributes: { diff --git a/packages/dashboard-frontend/src/store/FactoryResolver/normalizeDevfileV1.ts b/packages/dashboard-frontend/src/store/FactoryResolver/normalizeDevfileV1.ts index 5805ad4c6e..56c0c90dff 100644 --- a/packages/dashboard-frontend/src/store/FactoryResolver/normalizeDevfileV1.ts +++ b/packages/dashboard-frontend/src/store/FactoryResolver/normalizeDevfileV1.ts @@ -10,9 +10,10 @@ * Red Hat, Inc. - initial API and implementation */ -import { DevfileAdapter } from '../../services/devfile/adapter'; import { cloneDeep } from 'lodash'; +import { DevfileAdapter } from '@/services/devfile/adapter'; + export default function normalizeDevfileV1( devfile: che.WorkspaceDevfile, preferredStorageType: che.WorkspaceStorageType, diff --git a/packages/dashboard-frontend/src/store/FactoryResolver/normalizeDevfileV2.ts b/packages/dashboard-frontend/src/store/FactoryResolver/normalizeDevfileV2.ts index 46f6a871a8..fa3e5e47d7 100644 --- a/packages/dashboard-frontend/src/store/FactoryResolver/normalizeDevfileV2.ts +++ b/packages/dashboard-frontend/src/store/FactoryResolver/normalizeDevfileV2.ts @@ -13,16 +13,17 @@ import { V221DevfileComponents } from '@devfile/api'; import { dump } from 'js-yaml'; import { cloneDeep } from 'lodash'; -import { FactoryParams } from '../../services/helpers/factoryFlow/buildFactoryParams'; -import { DevfileAdapter } from '../../services/devfile/adapter'; -import devfileApi from '../../services/devfileApi'; -import { generateWorkspaceName } from '../../services/helpers/generateName'; -import { getProjectName } from '../../services/helpers/getProjectName'; -import { DevfileV2ProjectSource, FactoryResolver } from '../../services/helpers/types'; + +import { DevfileAdapter } from '@/services/devfile/adapter'; +import devfileApi from '@/services/devfileApi'; +import { FactoryParams } from '@/services/helpers/factoryFlow/buildFactoryParams'; +import { generateWorkspaceName } from '@/services/helpers/generateName'; +import { getProjectName } from '@/services/helpers/getProjectName'; +import { DevfileV2ProjectSource, FactoryResolver } from '@/services/helpers/types'; import { DEVWORKSPACE_DEVFILE_SOURCE, DEVWORKSPACE_METADATA_ANNOTATION, -} from '../../services/workspace-client/devworkspace/devWorkspaceClient'; +} from '@/services/workspace-client/devworkspace/devWorkspaceClient'; /** * Returns a devfile from the FactoryResolver object. diff --git a/packages/dashboard-frontend/src/store/FactoryResolver/selectors.ts b/packages/dashboard-frontend/src/store/FactoryResolver/selectors.ts index c4a94aa461..2fd39d25b2 100644 --- a/packages/dashboard-frontend/src/store/FactoryResolver/selectors.ts +++ b/packages/dashboard-frontend/src/store/FactoryResolver/selectors.ts @@ -11,6 +11,7 @@ */ import { createSelector } from 'reselect'; + import { AppState } from '..'; const selectState = (state: AppState) => state.factoryResolver; diff --git a/packages/dashboard-frontend/src/store/GitConfig/__tests__/index.spec.ts b/packages/dashboard-frontend/src/store/GitConfig/__tests__/index.spec.ts index a7c5020dd9..b5fed0d2bb 100644 --- a/packages/dashboard-frontend/src/store/GitConfig/__tests__/index.spec.ts +++ b/packages/dashboard-frontend/src/store/GitConfig/__tests__/index.spec.ts @@ -13,10 +13,12 @@ import { api } from '@eclipse-che/common'; import { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; + +import { AppState } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { AUTHORIZED } from '@/store/sanityCheckMiddleware'; + import * as TestStore from '..'; -import { AppState } from '../..'; -import { FakeStoreBuilder } from '../../__mocks__/storeBuilder'; -import { AUTHORIZED } from '../../sanityCheckMiddleware'; const mockFetchGitConfig = jest.fn().mockResolvedValue({ gitconfig: {} } as api.IGitConfig); const mockPatchGitConfig = jest.fn().mockResolvedValue({ gitconfig: {} } as api.IGitConfig); diff --git a/packages/dashboard-frontend/src/store/GitConfig/__tests__/reducer.spec.ts b/packages/dashboard-frontend/src/store/GitConfig/__tests__/reducer.spec.ts index e9fbe9451d..1778fbb53a 100644 --- a/packages/dashboard-frontend/src/store/GitConfig/__tests__/reducer.spec.ts +++ b/packages/dashboard-frontend/src/store/GitConfig/__tests__/reducer.spec.ts @@ -11,9 +11,11 @@ */ import { AnyAction } from 'redux'; + +import * as unloadedState from '@/store/GitConfig/reducer'; +import { AUTHORIZED } from '@/store/sanityCheckMiddleware'; + import * as TestStore from '..'; -import { AUTHORIZED } from '../../sanityCheckMiddleware'; -import * as unloadedState from '../reducer'; describe('GitConfig store, reducer', () => { it('should return initial state', () => { diff --git a/packages/dashboard-frontend/src/store/GitConfig/__tests__/selectors.spec.ts b/packages/dashboard-frontend/src/store/GitConfig/__tests__/selectors.spec.ts index 4afe099fd9..b068ca1258 100644 --- a/packages/dashboard-frontend/src/store/GitConfig/__tests__/selectors.spec.ts +++ b/packages/dashboard-frontend/src/store/GitConfig/__tests__/selectors.spec.ts @@ -13,10 +13,15 @@ import { api } from '@eclipse-che/common'; import { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; -import * as TestStore from '..'; -import { AppState } from '../..'; -import { FakeStoreBuilder } from '../../__mocks__/storeBuilder'; -import { selectGitConfigError, selectGitConfigIsLoading, selectGitConfigUser } from '../selectors'; + +import { AppState } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import * as TestStore from '@/store/GitConfig'; +import { + selectGitConfigError, + selectGitConfigIsLoading, + selectGitConfigUser, +} from '@/store/GitConfig/selectors'; describe('GitConfig store, selectors', () => { afterEach(() => { diff --git a/packages/dashboard-frontend/src/store/GitConfig/index.ts b/packages/dashboard-frontend/src/store/GitConfig/index.ts index 77576d2796..5a54f58ef1 100644 --- a/packages/dashboard-frontend/src/store/GitConfig/index.ts +++ b/packages/dashboard-frontend/src/store/GitConfig/index.ts @@ -11,14 +11,14 @@ */ import common, { api, helpers } from '@eclipse-che/common'; + +import { fetchGitConfig, patchGitConfig } from '@/services/dashboard-backend-client/gitConfigApi'; +import { GitConfigUser, KnownAction, Type } from '@/store/GitConfig/types'; +import { selectDefaultNamespace } from '@/store/InfrastructureNamespaces/selectors'; +import { AUTHORIZED } from '@/store/sanityCheckMiddleware'; + import { AppThunk } from '..'; -import { - fetchGitConfig, - patchGitConfig, -} from '../../services/dashboard-backend-client/gitConfigApi'; -import { selectDefaultNamespace } from '../InfrastructureNamespaces/selectors'; -import { AUTHORIZED } from '../sanityCheckMiddleware'; -import { GitConfigUser, KnownAction, Type } from './types'; + export * from './reducer'; export * from './types'; diff --git a/packages/dashboard-frontend/src/store/GitConfig/reducer.ts b/packages/dashboard-frontend/src/store/GitConfig/reducer.ts index 8368157a37..82d7dd3774 100644 --- a/packages/dashboard-frontend/src/store/GitConfig/reducer.ts +++ b/packages/dashboard-frontend/src/store/GitConfig/reducer.ts @@ -11,8 +11,9 @@ */ import { Action, Reducer } from 'redux'; -import { createObject } from '../helpers'; -import { KnownAction, State, Type } from './types'; + +import { KnownAction, State, Type } from '@/store/GitConfig/types'; +import { createObject } from '@/store/helpers'; const unloadedState: State = { isLoading: false, diff --git a/packages/dashboard-frontend/src/store/GitConfig/selectors.ts b/packages/dashboard-frontend/src/store/GitConfig/selectors.ts index 76ca7c6fb7..75779525bd 100644 --- a/packages/dashboard-frontend/src/store/GitConfig/selectors.ts +++ b/packages/dashboard-frontend/src/store/GitConfig/selectors.ts @@ -11,8 +11,10 @@ */ import { createSelector } from 'reselect'; + +import { State } from '@/store/GitConfig/types'; + import { AppState } from '..'; -import { State } from './types'; const selectState = (state: AppState) => state.gitConfig; diff --git a/packages/dashboard-frontend/src/store/GitConfig/types.ts b/packages/dashboard-frontend/src/store/GitConfig/types.ts index 3b6213b0da..80a30c402a 100644 --- a/packages/dashboard-frontend/src/store/GitConfig/types.ts +++ b/packages/dashboard-frontend/src/store/GitConfig/types.ts @@ -12,7 +12,8 @@ import { api } from '@eclipse-che/common'; import { Action } from 'redux'; -import { SanityCheckAction } from '../sanityCheckMiddleware'; + +import { SanityCheckAction } from '@/store/sanityCheckMiddleware'; export type GitConfigUser = api.IGitConfig['gitconfig']['user']; diff --git a/packages/dashboard-frontend/src/store/GitOauthConfig/index.ts b/packages/dashboard-frontend/src/store/GitOauthConfig/index.ts index 500add1964..6c6869e4fd 100644 --- a/packages/dashboard-frontend/src/store/GitOauthConfig/index.ts +++ b/packages/dashboard-frontend/src/store/GitOauthConfig/index.ts @@ -10,14 +10,16 @@ * Red Hat, Inc. - initial API and implementation */ -import { Action, Reducer } from 'redux'; import common, { api } from '@eclipse-che/common'; +import { Action, Reducer } from 'redux'; + +import { container } from '@/inversify.config'; +import { CheWorkspaceClient } from '@/services/workspace-client/cheworkspace/cheWorkspaceClient'; +import { IGitOauth } from '@/store/GitOauthConfig/types'; +import { createObject } from '@/store/helpers'; +import { AUTHORIZED } from '@/store/sanityCheckMiddleware'; + import { AppThunk } from '..'; -import { createObject } from '../helpers'; -import { AUTHORIZED } from '../sanityCheckMiddleware'; -import { container } from '../../inversify.config'; -import { CheWorkspaceClient } from '../../services/workspace-client/cheworkspace/cheWorkspaceClient'; -import { IGitOauth } from './types'; export interface State { isLoading: boolean; diff --git a/packages/dashboard-frontend/src/store/GitOauthConfig/selectors.ts b/packages/dashboard-frontend/src/store/GitOauthConfig/selectors.ts index e706185cbd..2fb1c6253b 100644 --- a/packages/dashboard-frontend/src/store/GitOauthConfig/selectors.ts +++ b/packages/dashboard-frontend/src/store/GitOauthConfig/selectors.ts @@ -11,8 +11,10 @@ */ import { createSelector } from 'reselect'; + +import { State } from '@/store/GitOauthConfig/index'; + import { AppState } from '..'; -import { State } from './index'; const selectState = (state: AppState) => state.gitOauthConfig; diff --git a/packages/dashboard-frontend/src/store/InfrastructureNamespaces/index.ts b/packages/dashboard-frontend/src/store/InfrastructureNamespaces/index.ts index 9aadd84314..af33d1b258 100644 --- a/packages/dashboard-frontend/src/store/InfrastructureNamespaces/index.ts +++ b/packages/dashboard-frontend/src/store/InfrastructureNamespaces/index.ts @@ -10,13 +10,15 @@ * Red Hat, Inc. - initial API and implementation */ -import { Action, Reducer } from 'redux'; import common from '@eclipse-che/common'; -import { container } from '../../inversify.config'; -import { CheWorkspaceClient } from '../../services/workspace-client/cheworkspace/cheWorkspaceClient'; +import { Action, Reducer } from 'redux'; + +import { container } from '@/inversify.config'; +import { CheWorkspaceClient } from '@/services/workspace-client/cheworkspace/cheWorkspaceClient'; +import { createObject } from '@/store/helpers'; +import { AUTHORIZED, SanityCheckAction } from '@/store/sanityCheckMiddleware'; + import { AppThunk } from '..'; -import { createObject } from '../helpers'; -import { AUTHORIZED, SanityCheckAction } from '../sanityCheckMiddleware'; const WorkspaceClient = container.get(CheWorkspaceClient); diff --git a/packages/dashboard-frontend/src/store/InfrastructureNamespaces/selectors.ts b/packages/dashboard-frontend/src/store/InfrastructureNamespaces/selectors.ts index 13f2914532..98121dc0de 100644 --- a/packages/dashboard-frontend/src/store/InfrastructureNamespaces/selectors.ts +++ b/packages/dashboard-frontend/src/store/InfrastructureNamespaces/selectors.ts @@ -11,6 +11,7 @@ */ import { createSelector } from 'reselect'; + import { AppState } from '..'; const selectState = (state: AppState) => state.infrastructureNamespaces; diff --git a/packages/dashboard-frontend/src/store/PersonalAccessToken/__tests__/actions.spec.ts b/packages/dashboard-frontend/src/store/PersonalAccessToken/__tests__/actions.spec.ts index 80a300b394..fab5cef0ed 100644 --- a/packages/dashboard-frontend/src/store/PersonalAccessToken/__tests__/actions.spec.ts +++ b/packages/dashboard-frontend/src/store/PersonalAccessToken/__tests__/actions.spec.ts @@ -12,14 +12,16 @@ import { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; + +import { container } from '@/inversify.config'; +import * as PersonalAccessTokenApi from '@/services/dashboard-backend-client/personalAccessTokenApi'; +import { CheWorkspaceClient } from '@/services/workspace-client/cheworkspace/cheWorkspaceClient'; +import { AppState } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { token1, token2 } from '@/store/PersonalAccessToken/__tests__/stub'; +import { AUTHORIZED } from '@/store/sanityCheckMiddleware'; + import * as testStore from '..'; -import { AppState } from '../..'; -import { AUTHORIZED } from '../../sanityCheckMiddleware'; -import { FakeStoreBuilder } from '../../__mocks__/storeBuilder'; -import { token1, token2 } from './stub'; -import * as PersonalAccessTokenApi from '../../../services/dashboard-backend-client/personalAccessTokenApi'; -import { container } from '../../../inversify.config'; -import { CheWorkspaceClient } from '../../../services/workspace-client/cheworkspace/cheWorkspaceClient'; const cheWorkspaceClient = container.get(CheWorkspaceClient); jest diff --git a/packages/dashboard-frontend/src/store/PersonalAccessToken/__tests__/reducers.spec.ts b/packages/dashboard-frontend/src/store/PersonalAccessToken/__tests__/reducers.spec.ts index 6e72796601..98dac83f44 100644 --- a/packages/dashboard-frontend/src/store/PersonalAccessToken/__tests__/reducers.spec.ts +++ b/packages/dashboard-frontend/src/store/PersonalAccessToken/__tests__/reducers.spec.ts @@ -12,9 +12,11 @@ import { api } from '@eclipse-che/common'; import { AnyAction } from 'redux'; + +import { token1, token2 } from '@/store/PersonalAccessToken/__tests__/stub'; +import { AUTHORIZED } from '@/store/sanityCheckMiddleware'; + import * as testStore from '..'; -import { AUTHORIZED } from '../../sanityCheckMiddleware'; -import { token1, token2 } from './stub'; describe('Personal Access Token store', () => { afterEach(() => { diff --git a/packages/dashboard-frontend/src/store/PersonalAccessToken/__tests__/selectors.spec.ts b/packages/dashboard-frontend/src/store/PersonalAccessToken/__tests__/selectors.spec.ts index 1c9b6e440d..9f3f61548c 100644 --- a/packages/dashboard-frontend/src/store/PersonalAccessToken/__tests__/selectors.spec.ts +++ b/packages/dashboard-frontend/src/store/PersonalAccessToken/__tests__/selectors.spec.ts @@ -12,15 +12,17 @@ import { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; -import * as store from '..'; -import { AppState } from '../..'; -import { FakeStoreBuilder } from '../../__mocks__/storeBuilder'; + +import { AppState } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { token1, token2 } from '@/store/PersonalAccessToken/__tests__/stub'; import { + selectPersonalAccessTokens, selectPersonalAccessTokensError, selectPersonalAccessTokensIsLoading, - selectPersonalAccessTokens, -} from '../selectors'; -import { token1, token2 } from './stub'; +} from '@/store/PersonalAccessToken/selectors'; + +import * as store from '..'; describe('Personal Access Token store, selectors', () => { afterEach(() => { diff --git a/packages/dashboard-frontend/src/store/PersonalAccessToken/index.ts b/packages/dashboard-frontend/src/store/PersonalAccessToken/index.ts index 52773b06d5..c936108d77 100644 --- a/packages/dashboard-frontend/src/store/PersonalAccessToken/index.ts +++ b/packages/dashboard-frontend/src/store/PersonalAccessToken/index.ts @@ -12,19 +12,21 @@ import { api, helpers } from '@eclipse-che/common'; import { Action, Reducer } from 'redux'; -import { AppThunk } from '..'; -import { container } from '../../inversify.config'; + +import { container } from '@/inversify.config'; import { addToken, fetchTokens, removeToken, updateToken, -} from '../../services/dashboard-backend-client/personalAccessTokenApi'; -import { CheWorkspaceClient } from '../../services/workspace-client/cheworkspace/cheWorkspaceClient'; -import { createObject } from '../helpers'; -import { selectDefaultNamespace } from '../InfrastructureNamespaces/selectors'; -import { AUTHORIZED, SanityCheckAction } from '../sanityCheckMiddleware'; -import { State } from './state'; +} from '@/services/dashboard-backend-client/personalAccessTokenApi'; +import { CheWorkspaceClient } from '@/services/workspace-client/cheworkspace/cheWorkspaceClient'; +import { createObject } from '@/store/helpers'; +import { selectDefaultNamespace } from '@/store/InfrastructureNamespaces/selectors'; +import { State } from '@/store/PersonalAccessToken/state'; +import { AUTHORIZED, SanityCheckAction } from '@/store/sanityCheckMiddleware'; + +import { AppThunk } from '..'; export * from './state'; diff --git a/packages/dashboard-frontend/src/store/PersonalAccessToken/selectors.ts b/packages/dashboard-frontend/src/store/PersonalAccessToken/selectors.ts index 68bcf1550c..1f218efe1e 100644 --- a/packages/dashboard-frontend/src/store/PersonalAccessToken/selectors.ts +++ b/packages/dashboard-frontend/src/store/PersonalAccessToken/selectors.ts @@ -11,8 +11,10 @@ */ import { createSelector } from 'reselect'; + +import { State } from '@/store/PersonalAccessToken/state'; + import { AppState } from '..'; -import { State } from './state'; const selectState = (state: AppState) => state.personalAccessToken; diff --git a/packages/dashboard-frontend/src/store/Plugins/chePlugins/index.ts b/packages/dashboard-frontend/src/store/Plugins/chePlugins/index.ts index 05148122fa..b464d75b40 100644 --- a/packages/dashboard-frontend/src/store/Plugins/chePlugins/index.ts +++ b/packages/dashboard-frontend/src/store/Plugins/chePlugins/index.ts @@ -10,12 +10,13 @@ * Red Hat, Inc. - initial API and implementation */ +import common from '@eclipse-che/common'; import axios from 'axios'; import { Action, Reducer } from 'redux'; -import common from '@eclipse-che/common'; -import { AppThunk } from '../..'; -import { createObject } from '../../helpers'; -import { AUTHORIZED, SanityCheckAction } from '../../sanityCheckMiddleware'; + +import { AppThunk } from '@/store'; +import { createObject } from '@/store/helpers'; +import { AUTHORIZED, SanityCheckAction } from '@/store/sanityCheckMiddleware'; // create new instance of `axios` to avoid adding an authorization header const axiosInstance = axios.create(); diff --git a/packages/dashboard-frontend/src/store/Plugins/chePlugins/selectors.ts b/packages/dashboard-frontend/src/store/Plugins/chePlugins/selectors.ts index 50d59ec569..6699f23634 100644 --- a/packages/dashboard-frontend/src/store/Plugins/chePlugins/selectors.ts +++ b/packages/dashboard-frontend/src/store/Plugins/chePlugins/selectors.ts @@ -11,7 +11,8 @@ */ import { createSelector } from 'reselect'; -import { AppState } from '../..'; + +import { AppState } from '@/store'; const CHE_EDITOR = 'Che Editor'; diff --git a/packages/dashboard-frontend/src/store/Plugins/devWorkspacePlugins/__tests__/index.spec.ts b/packages/dashboard-frontend/src/store/Plugins/devWorkspacePlugins/__tests__/index.spec.ts index 3fad5d3d62..e93ff4f0b1 100644 --- a/packages/dashboard-frontend/src/store/Plugins/devWorkspacePlugins/__tests__/index.spec.ts +++ b/packages/dashboard-frontend/src/store/Plugins/devWorkspacePlugins/__tests__/index.spec.ts @@ -10,17 +10,18 @@ * Red Hat, Inc. - initial API and implementation */ +import { api } from '@eclipse-che/common'; import mockAxios, { AxiosError } from 'axios'; -import { MockStoreEnhanced } from 'redux-mock-store'; import { AnyAction } from 'redux'; +import { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; -import devfileApi from '../../../../services/devfileApi'; -import { FakeStoreBuilder } from '../../../__mocks__/storeBuilder'; + +import devfileApi from '@/services/devfileApi'; +import { AppState } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { AUTHORIZED } from '@/store/sanityCheckMiddleware'; + import * as dwPluginsStore from '..'; -import { AppState } from '../../..'; -import axios from 'axios'; -import { AUTHORIZED } from '../../../sanityCheckMiddleware'; -import { api } from '@eclipse-che/common'; // mute the outputs console.error = jest.fn(); @@ -193,7 +194,7 @@ describe('dwPlugins store', () => { expect(actions).toEqual(expectedActions); // check that we fetched the editor on axios - expect(axios.get).toBeCalledWith(editorLink); + expect(mockAxios.get).toBeCalledWith(editorLink); }); it('should create REQUEST_DW_EDITOR and RECEIVE_DW_EDITOR_ERROR when failed to fetch an editor', async () => { diff --git a/packages/dashboard-frontend/src/store/Plugins/devWorkspacePlugins/__tests__/selectors.spec.ts b/packages/dashboard-frontend/src/store/Plugins/devWorkspacePlugins/__tests__/selectors.spec.ts index 6e3de5a459..364faeeb57 100644 --- a/packages/dashboard-frontend/src/store/Plugins/devWorkspacePlugins/__tests__/selectors.spec.ts +++ b/packages/dashboard-frontend/src/store/Plugins/devWorkspacePlugins/__tests__/selectors.spec.ts @@ -12,11 +12,17 @@ import { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; -import devfileApi from '../../../../services/devfileApi'; -import { FakeStoreBuilder } from '../../../__mocks__/storeBuilder'; + +import devfileApi from '@/services/devfileApi'; +import { AppState } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { + selectDwDefaultEditorError, + selectDwPlugins, + selectDwPluginsList, +} from '@/store/Plugins/devWorkspacePlugins/selectors'; + import * as store from '..'; -import { AppState } from '../../..'; -import { selectDwPlugins, selectDwPluginsList, selectDwDefaultEditorError } from '../selectors'; const url = 'devworkspace-devfile-location'; diff --git a/packages/dashboard-frontend/src/store/Plugins/devWorkspacePlugins/index.ts b/packages/dashboard-frontend/src/store/Plugins/devWorkspacePlugins/index.ts index 6b65d1915b..b9f1c04e82 100644 --- a/packages/dashboard-frontend/src/store/Plugins/devWorkspacePlugins/index.ts +++ b/packages/dashboard-frontend/src/store/Plugins/devWorkspacePlugins/index.ts @@ -10,15 +10,16 @@ * Red Hat, Inc. - initial API and implementation */ +import common from '@eclipse-che/common'; import { load } from 'js-yaml'; import { Action, Reducer } from 'redux'; -import common from '@eclipse-che/common'; -import devfileApi from '../../../services/devfileApi'; -import { AppThunk } from '../..'; -import { fetchDevfile } from '../../../services/registry/devfiles'; -import { fetchData } from '../../../services/registry/fetchData'; -import { createObject } from '../../helpers'; -import { AUTHORIZED, SanityCheckAction } from '../../sanityCheckMiddleware'; + +import devfileApi from '@/services/devfileApi'; +import { fetchDevfile } from '@/services/registry/devfiles'; +import { fetchData } from '@/services/registry/fetchData'; +import { AppThunk } from '@/store'; +import { createObject } from '@/store/helpers'; +import { AUTHORIZED, SanityCheckAction } from '@/store/sanityCheckMiddleware'; export interface PluginDefinition { plugin?: devfileApi.Devfile; diff --git a/packages/dashboard-frontend/src/store/Plugins/devWorkspacePlugins/selectors.ts b/packages/dashboard-frontend/src/store/Plugins/devWorkspacePlugins/selectors.ts index 97f7d06a65..f9b7afc742 100644 --- a/packages/dashboard-frontend/src/store/Plugins/devWorkspacePlugins/selectors.ts +++ b/packages/dashboard-frontend/src/store/Plugins/devWorkspacePlugins/selectors.ts @@ -10,10 +10,11 @@ * Red Hat, Inc. - initial API and implementation */ -import { createSelector } from 'reselect'; -import { AppState } from '../..'; -import devfileApi from '../../../services/devfileApi'; import { cloneDeep } from 'lodash'; +import { createSelector } from 'reselect'; + +import devfileApi from '@/services/devfileApi'; +import { AppState } from '@/store'; const selectState = (state: AppState) => state.dwPlugins; export const selectPluginsState = selectState; diff --git a/packages/dashboard-frontend/src/store/Pods/Logs/__tests__/actions.spec.ts b/packages/dashboard-frontend/src/store/Pods/Logs/__tests__/actions.spec.ts index 17ca36e379..9893aedb15 100644 --- a/packages/dashboard-frontend/src/store/Pods/Logs/__tests__/actions.spec.ts +++ b/packages/dashboard-frontend/src/store/Pods/Logs/__tests__/actions.spec.ts @@ -16,11 +16,13 @@ import { api } from '@eclipse-che/common'; import { CoreV1Event, V1Pod, V1Status } from '@kubernetes/client-node'; import { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; + +import { container } from '@/inversify.config'; +import { WebsocketClient } from '@/services/dashboard-backend-client/websocketClient'; +import { AppState } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; + import * as testStore from '..'; -import { AppState } from '../../..'; -import { container } from '../../../../inversify.config'; -import { WebsocketClient } from '../../../../services/dashboard-backend-client/websocketClient'; -import { FakeStoreBuilder } from '../../../__mocks__/storeBuilder'; describe('Pod logs store, actions', () => { const podName = 'pod1'; diff --git a/packages/dashboard-frontend/src/store/Pods/Logs/__tests__/reducers.spec.ts b/packages/dashboard-frontend/src/store/Pods/Logs/__tests__/reducers.spec.ts index bf3571faad..0b595c700d 100644 --- a/packages/dashboard-frontend/src/store/Pods/Logs/__tests__/reducers.spec.ts +++ b/packages/dashboard-frontend/src/store/Pods/Logs/__tests__/reducers.spec.ts @@ -11,6 +11,7 @@ */ import { AnyAction } from 'redux'; + import * as testStore from '..'; describe('Logs store, reducers', () => { diff --git a/packages/dashboard-frontend/src/store/Pods/Logs/__tests__/selectors.spec.ts b/packages/dashboard-frontend/src/store/Pods/Logs/__tests__/selectors.spec.ts index c807fd3195..6bbf02db77 100644 --- a/packages/dashboard-frontend/src/store/Pods/Logs/__tests__/selectors.spec.ts +++ b/packages/dashboard-frontend/src/store/Pods/Logs/__tests__/selectors.spec.ts @@ -12,10 +12,12 @@ import { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; + +import { AppState } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { selectAllLogs, selectPodLogs } from '@/store/Pods/Logs/selectors'; + import * as store from '..'; -import { AppState } from '../../..'; -import { FakeStoreBuilder } from '../../../__mocks__/storeBuilder'; -import { selectAllLogs, selectPodLogs } from '../selectors'; describe('Logs store, selectors', () => { let logs: store.State['logs']; diff --git a/packages/dashboard-frontend/src/store/Pods/Logs/index.ts b/packages/dashboard-frontend/src/store/Pods/Logs/index.ts index 490e5a3650..d9db7dda17 100644 --- a/packages/dashboard-frontend/src/store/Pods/Logs/index.ts +++ b/packages/dashboard-frontend/src/store/Pods/Logs/index.ts @@ -13,13 +13,14 @@ import { api } from '@eclipse-che/common'; import { V1Pod } from '@kubernetes/client-node'; import { Action, Reducer } from 'redux'; -import { AppThunk } from '../..'; -import { container } from '../../../inversify.config'; -import { WebsocketClient } from '../../../services/dashboard-backend-client/websocketClient'; -import { ChannelListener } from '../../../services/dashboard-backend-client/websocketClient/messageHandler'; -import { createObject } from '../../helpers'; -import { selectDefaultNamespace } from '../../InfrastructureNamespaces/selectors'; -import { selectAllPods } from '../selectors'; + +import { container } from '@/inversify.config'; +import { WebsocketClient } from '@/services/dashboard-backend-client/websocketClient'; +import { ChannelListener } from '@/services/dashboard-backend-client/websocketClient/messageHandler'; +import { AppThunk } from '@/store'; +import { createObject } from '@/store/helpers'; +import { selectDefaultNamespace } from '@/store/InfrastructureNamespaces/selectors'; +import { selectAllPods } from '@/store/Pods/selectors'; export type ContainerLogs = { logs: string; diff --git a/packages/dashboard-frontend/src/store/Pods/Logs/selectors.ts b/packages/dashboard-frontend/src/store/Pods/Logs/selectors.ts index 90dcce81e3..aeafbf397b 100644 --- a/packages/dashboard-frontend/src/store/Pods/Logs/selectors.ts +++ b/packages/dashboard-frontend/src/store/Pods/Logs/selectors.ts @@ -11,7 +11,8 @@ */ import { createSelector } from 'reselect'; -import { AppState } from '../..'; + +import { AppState } from '@/store'; const selectState = (state: AppState) => state.logs; diff --git a/packages/dashboard-frontend/src/store/Pods/__tests__/actions.spec.ts b/packages/dashboard-frontend/src/store/Pods/__tests__/actions.spec.ts index b5299a2d0f..c5198a3252 100644 --- a/packages/dashboard-frontend/src/store/Pods/__tests__/actions.spec.ts +++ b/packages/dashboard-frontend/src/store/Pods/__tests__/actions.spec.ts @@ -15,13 +15,15 @@ import { V1Status } from '@kubernetes/client-node'; import mockAxios, { AxiosError } from 'axios'; import { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; + +import { container } from '@/inversify.config'; +import { WebsocketClient } from '@/services/dashboard-backend-client/websocketClient'; +import { AppState } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { pod1, pod2 } from '@/store/Pods/__tests__/stub'; +import { AUTHORIZED } from '@/store/sanityCheckMiddleware'; + import * as testStore from '..'; -import { AppState } from '../..'; -import { container } from '../../../inversify.config'; -import { WebsocketClient } from '../../../services/dashboard-backend-client/websocketClient'; -import { AUTHORIZED } from '../../sanityCheckMiddleware'; -import { FakeStoreBuilder } from '../../__mocks__/storeBuilder'; -import { pod1, pod2 } from './stub'; describe('Pods store, actions', () => { let appStore: MockStoreEnhanced< diff --git a/packages/dashboard-frontend/src/store/Pods/__tests__/isSamePod.spec.ts b/packages/dashboard-frontend/src/store/Pods/__tests__/isSamePod.spec.ts index 515c9468cf..4c702f6d9b 100644 --- a/packages/dashboard-frontend/src/store/Pods/__tests__/isSamePod.spec.ts +++ b/packages/dashboard-frontend/src/store/Pods/__tests__/isSamePod.spec.ts @@ -12,8 +12,8 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import isSamePod from '../isSamePod'; -import { pod1, pod2 } from './stub'; +import { pod1, pod2 } from '@/store/Pods/__tests__/stub'; +import isSamePod from '@/store/Pods/isSamePod'; describe('isSamePod', () => { it('should compare pods by uid', () => { diff --git a/packages/dashboard-frontend/src/store/Pods/__tests__/reducers.spec.ts b/packages/dashboard-frontend/src/store/Pods/__tests__/reducers.spec.ts index e989cf26a7..5417e659fa 100644 --- a/packages/dashboard-frontend/src/store/Pods/__tests__/reducers.spec.ts +++ b/packages/dashboard-frontend/src/store/Pods/__tests__/reducers.spec.ts @@ -12,9 +12,11 @@ import { cloneDeep } from 'lodash'; import { AnyAction } from 'redux'; + +import { pod1, pod2 } from '@/store/Pods/__tests__/stub'; +import { AUTHORIZED } from '@/store/sanityCheckMiddleware'; + import * as testStore from '..'; -import { AUTHORIZED } from '../../sanityCheckMiddleware'; -import { pod1, pod2 } from './stub'; describe('Pods store, reducers', () => { it('should return initial state', () => { diff --git a/packages/dashboard-frontend/src/store/Pods/__tests__/selectors.spec.ts b/packages/dashboard-frontend/src/store/Pods/__tests__/selectors.spec.ts index 581eef75b6..b14683759b 100644 --- a/packages/dashboard-frontend/src/store/Pods/__tests__/selectors.spec.ts +++ b/packages/dashboard-frontend/src/store/Pods/__tests__/selectors.spec.ts @@ -12,11 +12,13 @@ import { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; + +import { AppState } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { pod1, pod2 } from '@/store/Pods/__tests__/stub'; +import { selectAllPods, selectPodsError, selectPodsResourceVersion } from '@/store/Pods/selectors'; + import * as store from '..'; -import { AppState } from '../..'; -import { FakeStoreBuilder } from '../../__mocks__/storeBuilder'; -import { selectAllPods, selectPodsError, selectPodsResourceVersion } from '../selectors'; -import { pod1, pod2 } from './stub'; describe('Pods store, selectors', () => { it('should return the error', () => { diff --git a/packages/dashboard-frontend/src/store/Pods/index.ts b/packages/dashboard-frontend/src/store/Pods/index.ts index d4d0d09e46..dd32666cbb 100644 --- a/packages/dashboard-frontend/src/store/Pods/index.ts +++ b/packages/dashboard-frontend/src/store/Pods/index.ts @@ -13,16 +13,18 @@ import { api, helpers } from '@eclipse-che/common'; import { V1Pod } from '@kubernetes/client-node'; import { Action, Reducer } from 'redux'; + +import { container } from '@/inversify.config'; +import { fetchPods } from '@/services/dashboard-backend-client/podsApi'; +import { WebsocketClient } from '@/services/dashboard-backend-client/websocketClient'; +import { getNewerResourceVersion } from '@/services/helpers/resourceVersion'; +import { createObject } from '@/store/helpers'; +import { selectDefaultNamespace } from '@/store/InfrastructureNamespaces/selectors'; +import isSamePod from '@/store/Pods/isSamePod'; +import { selectPodsResourceVersion } from '@/store/Pods/selectors'; +import { AUTHORIZED, SanityCheckAction } from '@/store/sanityCheckMiddleware'; + import { AppThunk } from '..'; -import { container } from '../../inversify.config'; -import { fetchPods } from '../../services/dashboard-backend-client/podsApi'; -import { WebsocketClient } from '../../services/dashboard-backend-client/websocketClient'; -import { getNewerResourceVersion } from '../../services/helpers/resourceVersion'; -import { createObject } from '../helpers'; -import { selectDefaultNamespace } from '../InfrastructureNamespaces/selectors'; -import { AUTHORIZED, SanityCheckAction } from '../sanityCheckMiddleware'; -import isSamePod from './isSamePod'; -import { selectPodsResourceVersion } from './selectors'; export interface State { isLoading: boolean; diff --git a/packages/dashboard-frontend/src/store/Pods/selectors.ts b/packages/dashboard-frontend/src/store/Pods/selectors.ts index 6b7941b954..25f0e3680a 100644 --- a/packages/dashboard-frontend/src/store/Pods/selectors.ts +++ b/packages/dashboard-frontend/src/store/Pods/selectors.ts @@ -11,6 +11,7 @@ */ import { createSelector } from 'reselect'; + import { AppState } from '..'; const selectState = (state: AppState) => state.pods; diff --git a/packages/dashboard-frontend/src/store/SanityCheck/index.ts b/packages/dashboard-frontend/src/store/SanityCheck/index.ts index b43807b09a..11f90f3001 100644 --- a/packages/dashboard-frontend/src/store/SanityCheck/index.ts +++ b/packages/dashboard-frontend/src/store/SanityCheck/index.ts @@ -10,15 +10,17 @@ * Red Hat, Inc. - initial API and implementation */ +import { helpers } from '@eclipse-che/common'; import { Action, Reducer } from 'redux'; + +import { container } from '@/inversify.config'; +import { getDefer } from '@/services/helpers/deferred'; +import { delay } from '@/services/helpers/delay'; +import { CheWorkspaceClient } from '@/services/workspace-client/cheworkspace/cheWorkspaceClient'; +import { isForbidden, isUnauthorized } from '@/services/workspace-client/helpers'; +import { createObject } from '@/store/helpers'; + import { AppThunk } from '..'; -import { helpers } from '@eclipse-che/common'; -import { container } from '../../inversify.config'; -import { getDefer } from '../../services/helpers/deferred'; -import { delay } from '../../services/helpers/delay'; -import { CheWorkspaceClient } from '../../services/workspace-client/cheworkspace/cheWorkspaceClient'; -import { isForbidden, isUnauthorized } from '../../services/workspace-client/helpers'; -import { createObject } from '../helpers'; const WorkspaceClient = container.get(CheWorkspaceClient); diff --git a/packages/dashboard-frontend/src/store/SanityCheck/selectors.ts b/packages/dashboard-frontend/src/store/SanityCheck/selectors.ts index 78aee40069..7e6d8cde91 100644 --- a/packages/dashboard-frontend/src/store/SanityCheck/selectors.ts +++ b/packages/dashboard-frontend/src/store/SanityCheck/selectors.ts @@ -11,6 +11,7 @@ */ import { createSelector } from 'reselect'; + import { AppState } from '..'; const selectState = (state: AppState) => state.sanityCheck; diff --git a/packages/dashboard-frontend/src/store/ServerConfig/__tests__/index.spec.ts b/packages/dashboard-frontend/src/store/ServerConfig/__tests__/index.spec.ts index 683fe9fa56..d385abd8c0 100644 --- a/packages/dashboard-frontend/src/store/ServerConfig/__tests__/index.spec.ts +++ b/packages/dashboard-frontend/src/store/ServerConfig/__tests__/index.spec.ts @@ -13,11 +13,12 @@ import mockAxios from 'axios'; import { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; -import { AppState } from '../..'; -import { AUTHORIZED } from '../../sanityCheckMiddleware'; -import * as dwServerConfigStore from '../../ServerConfig'; -import { FakeStoreBuilder } from '../../__mocks__/storeBuilder'; -import { serverConfig } from './stubs'; + +import { AppState } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { AUTHORIZED } from '@/store/sanityCheckMiddleware'; +import * as dwServerConfigStore from '@/store/ServerConfig'; +import { serverConfig } from '@/store/ServerConfig/__tests__/stubs'; // mute the outputs console.error = jest.fn(); diff --git a/packages/dashboard-frontend/src/store/ServerConfig/__tests__/selectors.spec.ts b/packages/dashboard-frontend/src/store/ServerConfig/__tests__/selectors.spec.ts index 01a106d713..15edd2225c 100644 --- a/packages/dashboard-frontend/src/store/ServerConfig/__tests__/selectors.spec.ts +++ b/packages/dashboard-frontend/src/store/ServerConfig/__tests__/selectors.spec.ts @@ -10,12 +10,13 @@ * Red Hat, Inc. - initial API and implementation */ +import { AnyAction } from 'redux'; import { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; -import { FakeStoreBuilder } from '../../__mocks__/storeBuilder'; -import { AppState } from '../..'; -import { AnyAction } from 'redux'; -import { serverConfig } from './stubs'; + +import { AppState } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { serverConfig } from '@/store/ServerConfig/__tests__/stubs'; import { selectDashboardLogo, selectDefaultComponents, @@ -24,7 +25,7 @@ import { selectOpenVSXUrl, selectPluginRegistryInternalUrl, selectPluginRegistryUrl, -} from '../selectors'; +} from '@/store/ServerConfig/selectors'; describe('serverConfig selectors', () => { describe('selectDefaultComponents', () => { diff --git a/packages/dashboard-frontend/src/store/ServerConfig/index.ts b/packages/dashboard-frontend/src/store/ServerConfig/index.ts index a81b545bda..b86ac987af 100644 --- a/packages/dashboard-frontend/src/store/ServerConfig/index.ts +++ b/packages/dashboard-frontend/src/store/ServerConfig/index.ts @@ -10,12 +10,13 @@ * Red Hat, Inc. - initial API and implementation */ -import { Action, Reducer } from 'redux'; import common, { api } from '@eclipse-che/common'; -import { AppThunk } from '../'; -import { createObject } from '../helpers'; -import * as ServerConfigApi from '../../services/dashboard-backend-client/serverConfigApi'; -import { AUTHORIZED, SanityCheckAction } from '../sanityCheckMiddleware'; +import { Action, Reducer } from 'redux'; + +import * as ServerConfigApi from '@/services/dashboard-backend-client/serverConfigApi'; +import { AppThunk } from '@/store'; +import { createObject } from '@/store/helpers'; +import { AUTHORIZED, SanityCheckAction } from '@/store/sanityCheckMiddleware'; export interface State { isLoading: boolean; diff --git a/packages/dashboard-frontend/src/store/ServerConfig/selectors.ts b/packages/dashboard-frontend/src/store/ServerConfig/selectors.ts index f1eb2df3a6..6b09dea089 100644 --- a/packages/dashboard-frontend/src/store/ServerConfig/selectors.ts +++ b/packages/dashboard-frontend/src/store/ServerConfig/selectors.ts @@ -11,6 +11,7 @@ */ import { createSelector } from 'reselect'; + import { AppState } from '..'; const selectState = (state: AppState) => state.dwServerConfig; diff --git a/packages/dashboard-frontend/src/store/User/Id/__tests__/actions.spec.ts b/packages/dashboard-frontend/src/store/User/Id/__tests__/actions.spec.ts index 3985bd23f0..e0deab300c 100644 --- a/packages/dashboard-frontend/src/store/User/Id/__tests__/actions.spec.ts +++ b/packages/dashboard-frontend/src/store/User/Id/__tests__/actions.spec.ts @@ -13,10 +13,12 @@ import mockAxios, { AxiosError } from 'axios'; import { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; + +import { AppState } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { AUTHORIZED } from '@/store/sanityCheckMiddleware'; + import * as testStore from '..'; -import { AppState } from '../../..'; -import { AUTHORIZED } from '../../../sanityCheckMiddleware'; -import { FakeStoreBuilder } from '../../../__mocks__/storeBuilder'; const cheUserId = 'che-user-id'; diff --git a/packages/dashboard-frontend/src/store/User/Id/__tests__/reducers.spec.ts b/packages/dashboard-frontend/src/store/User/Id/__tests__/reducers.spec.ts index a12be242c2..d0d5c69d94 100644 --- a/packages/dashboard-frontend/src/store/User/Id/__tests__/reducers.spec.ts +++ b/packages/dashboard-frontend/src/store/User/Id/__tests__/reducers.spec.ts @@ -11,8 +11,10 @@ */ import { AnyAction } from 'redux'; + +import { AUTHORIZED } from '@/store/sanityCheckMiddleware'; + import * as testStore from '..'; -import { AUTHORIZED } from '../../../sanityCheckMiddleware'; const cheUserId = 'che-user-id'; diff --git a/packages/dashboard-frontend/src/store/User/Id/__tests__/selectors.spec.ts b/packages/dashboard-frontend/src/store/User/Id/__tests__/selectors.spec.ts index b741c9d489..ca101179ac 100644 --- a/packages/dashboard-frontend/src/store/User/Id/__tests__/selectors.spec.ts +++ b/packages/dashboard-frontend/src/store/User/Id/__tests__/selectors.spec.ts @@ -12,10 +12,12 @@ import { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; + +import { AppState } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { selectCheUserId, selectCheUserIdError } from '@/store/User/Id/selectors'; + import * as store from '..'; -import { AppState } from '../../..'; -import { FakeStoreBuilder } from '../../../__mocks__/storeBuilder'; -import { selectCheUserId, selectCheUserIdError } from '../selectors'; describe('Pods store, selectors', () => { it('should return the error', () => { diff --git a/packages/dashboard-frontend/src/store/User/Id/index.ts b/packages/dashboard-frontend/src/store/User/Id/index.ts index 47391d31af..b5684f8a94 100644 --- a/packages/dashboard-frontend/src/store/User/Id/index.ts +++ b/packages/dashboard-frontend/src/store/User/Id/index.ts @@ -12,10 +12,11 @@ import common from '@eclipse-che/common'; import { Action, Reducer } from 'redux'; -import { fetchCheUserId } from '../../../services/che-user-id'; -import { createObject } from '../../helpers'; -import { AppThunk } from '../../index'; -import { AUTHORIZED, SanityCheckAction } from '../../sanityCheckMiddleware'; + +import { fetchCheUserId } from '@/services/che-user-id'; +import { createObject } from '@/store/helpers'; +import { AppThunk } from '@/store/index'; +import { AUTHORIZED, SanityCheckAction } from '@/store/sanityCheckMiddleware'; export interface State { cheUserId: string; diff --git a/packages/dashboard-frontend/src/store/User/Id/selectors.ts b/packages/dashboard-frontend/src/store/User/Id/selectors.ts index 8e00ed34c4..0b5b02be21 100644 --- a/packages/dashboard-frontend/src/store/User/Id/selectors.ts +++ b/packages/dashboard-frontend/src/store/User/Id/selectors.ts @@ -11,7 +11,8 @@ */ import { createSelector } from 'reselect'; -import { AppState } from '../..'; + +import { AppState } from '@/store'; const selectState = (state: AppState) => state.userId; diff --git a/packages/dashboard-frontend/src/store/User/Profile/__tests__/index.spec.ts b/packages/dashboard-frontend/src/store/User/Profile/__tests__/index.spec.ts index 6bb5fdea86..1fe4765819 100644 --- a/packages/dashboard-frontend/src/store/User/Profile/__tests__/index.spec.ts +++ b/packages/dashboard-frontend/src/store/User/Profile/__tests__/index.spec.ts @@ -15,10 +15,12 @@ import mockAxios, { AxiosError } from 'axios'; import { AnyAction } from 'redux'; import { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; + +import { AppState } from '@/store'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { AUTHORIZED } from '@/store/sanityCheckMiddleware'; + import * as testStore from '..'; -import { AppState } from '../../..'; -import { AUTHORIZED } from '../../../sanityCheckMiddleware'; -import { FakeStoreBuilder } from '../../../__mocks__/storeBuilder'; const namespace = 'user1-che'; diff --git a/packages/dashboard-frontend/src/store/User/Profile/index.ts b/packages/dashboard-frontend/src/store/User/Profile/index.ts index af906e3764..39c57d5881 100644 --- a/packages/dashboard-frontend/src/store/User/Profile/index.ts +++ b/packages/dashboard-frontend/src/store/User/Profile/index.ts @@ -14,10 +14,11 @@ import common, { api } from '@eclipse-che/common'; import { Action, Reducer } from 'redux'; -import { fetchUserProfile } from '../../../services/dashboard-backend-client/userProfileApi'; -import { createObject } from '../../helpers'; -import { AppThunk } from '../../index'; -import { AUTHORIZED, SanityCheckAction } from '../../sanityCheckMiddleware'; + +import { fetchUserProfile } from '@/services/dashboard-backend-client/userProfileApi'; +import { createObject } from '@/store/helpers'; +import { AppThunk } from '@/store/index'; +import { AUTHORIZED, SanityCheckAction } from '@/store/sanityCheckMiddleware'; export interface State { userProfile: api.IUserProfile; diff --git a/packages/dashboard-frontend/src/store/User/Profile/selectors.ts b/packages/dashboard-frontend/src/store/User/Profile/selectors.ts index 4a2b199334..ca67c0b019 100644 --- a/packages/dashboard-frontend/src/store/User/Profile/selectors.ts +++ b/packages/dashboard-frontend/src/store/User/Profile/selectors.ts @@ -11,7 +11,8 @@ */ import { createSelector } from 'reselect'; -import { AppState } from '../..'; + +import { AppState } from '@/store'; const selectState = (state: AppState) => state.userProfile; export const selectUserProfileState = selectState; diff --git a/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/__tests__/actions.spec.ts b/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/__tests__/actions.spec.ts index 86acb05e85..babf32c27c 100644 --- a/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/__tests__/actions.spec.ts +++ b/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/__tests__/actions.spec.ts @@ -18,20 +18,22 @@ import { dump } from 'js-yaml'; import { AnyAction } from 'redux'; import { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; + +import { container } from '@/inversify.config'; +import { fetchServerConfig } from '@/services/dashboard-backend-client/serverConfigApi'; +import { WebsocketClient } from '@/services/dashboard-backend-client/websocketClient'; +import devfileApi from '@/services/devfileApi'; +import { DEVWORKSPACE_STORAGE_TYPE_ATTR } from '@/services/devfileApi/devWorkspace/spec/template'; +import { FactoryParams } from '@/services/helpers/factoryFlow/buildFactoryParams'; +import { DevWorkspaceClient } from '@/services/workspace-client/devworkspace/devWorkspaceClient'; +import { AppState } from '@/store'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; +import { FakeStoreBuilder } from '@/store/__mocks__/storeBuilder'; +import { AUTHORIZED } from '@/store/sanityCheckMiddleware'; +import * as ServerConfigStore from '@/store/ServerConfig'; +import { checkRunningWorkspacesLimit } from '@/store/Workspaces/devWorkspaces/checkRunningWorkspacesLimit'; + import * as testStore from '..'; -import { AppState } from '../../..'; -import { container } from '../../../../inversify.config'; -import { FactoryParams } from '../../../../services/helpers/factoryFlow/buildFactoryParams'; -import { fetchServerConfig } from '../../../../services/dashboard-backend-client/serverConfigApi'; -import { WebsocketClient } from '../../../../services/dashboard-backend-client/websocketClient'; -import devfileApi from '../../../../services/devfileApi'; -import { DevWorkspaceClient } from '../../../../services/workspace-client/devworkspace/devWorkspaceClient'; -import { AUTHORIZED } from '../../../sanityCheckMiddleware'; -import * as ServerConfigStore from '../../../ServerConfig'; -import { DevWorkspaceBuilder } from '../../../__mocks__/devWorkspaceBuilder'; -import { FakeStoreBuilder } from '../../../__mocks__/storeBuilder'; -import { checkRunningWorkspacesLimit } from '../checkRunningWorkspacesLimit'; -import { DEVWORKSPACE_STORAGE_TYPE_ATTR } from '../../../../services/devfileApi/devWorkspace/spec/template'; jest.mock('../../../../services/dashboard-backend-client/serverConfigApi'); jest.mock('../../../../services/helpers/delay', () => ({ diff --git a/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/__tests__/reducers.spec.ts b/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/__tests__/reducers.spec.ts index a4c5932813..48bb16cb46 100644 --- a/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/__tests__/reducers.spec.ts +++ b/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/__tests__/reducers.spec.ts @@ -12,12 +12,14 @@ import { cloneDeep } from 'lodash'; import { AnyAction } from 'redux'; + +import devfileApi from '@/services/devfileApi'; +import { DevWorkspaceStatus } from '@/services/helpers/types'; +import { WorkspaceAdapter } from '@/services/workspace-adapter'; +import { DevWorkspaceBuilder } from '@/store/__mocks__/devWorkspaceBuilder'; +import { AUTHORIZED } from '@/store/sanityCheckMiddleware'; + import * as testStore from '..'; -import devfileApi from '../../../../services/devfileApi'; -import { DevWorkspaceStatus } from '../../../../services/helpers/types'; -import { WorkspaceAdapter } from '../../../../services/workspace-adapter'; -import { AUTHORIZED } from '../../../sanityCheckMiddleware'; -import { DevWorkspaceBuilder } from '../../../__mocks__/devWorkspaceBuilder'; describe('DevWorkspace, reducers', () => { let devWorkspace: devfileApi.DevWorkspace; diff --git a/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/checkRunningWorkspacesLimit.ts b/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/checkRunningWorkspacesLimit.ts index 85972c66ed..43040b7ed8 100644 --- a/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/checkRunningWorkspacesLimit.ts +++ b/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/checkRunningWorkspacesLimit.ts @@ -10,10 +10,11 @@ * Red Hat, Inc. - initial API and implementation */ +import { AppState } from '@/store'; +import { selectRunningWorkspacesLimit } from '@/store/ClusterConfig/selectors'; +import { selectRunningDevWorkspacesLimitExceeded } from '@/store/Workspaces/devWorkspaces/selectors'; + import { RunningWorkspacesExceededError } from '.'; -import { AppState } from '../..'; -import { selectRunningWorkspacesLimit } from '../../ClusterConfig/selectors'; -import { selectRunningDevWorkspacesLimitExceeded } from './selectors'; export function checkRunningWorkspacesLimit(state: AppState) { const runningLimitExceeded = selectRunningDevWorkspacesLimitExceeded(state); diff --git a/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/index.ts b/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/index.ts index cbe99da2f8..aa3040fdbb 100644 --- a/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/index.ts +++ b/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/index.ts @@ -13,54 +13,52 @@ import common, { api, ApplicationId } from '@eclipse-che/common'; import { dump } from 'js-yaml'; import { Action, Reducer } from 'redux'; -import { AppThunk } from '../..'; -import { container } from '../../../inversify.config'; -import { FactoryParams } from '../../../services/helpers/factoryFlow/buildFactoryParams'; -import { - injectKubeConfig, - podmanLogin, -} from '../../../services/dashboard-backend-client/devWorkspaceApi'; -import { fetchResources } from '../../../services/dashboard-backend-client/devworkspaceResourcesApi'; -import { WebsocketClient } from '../../../services/dashboard-backend-client/websocketClient'; -import devfileApi, { isDevWorkspace } from '../../../services/devfileApi'; -import { devWorkspaceKind } from '../../../services/devfileApi/devWorkspace'; + +import { container } from '@/inversify.config'; +import { injectKubeConfig, podmanLogin } from '@/services/dashboard-backend-client/devWorkspaceApi'; +import * as DwApi from '@/services/dashboard-backend-client/devWorkspaceApi'; +import { fetchResources } from '@/services/dashboard-backend-client/devworkspaceResourcesApi'; +import * as DwtApi from '@/services/dashboard-backend-client/devWorkspaceTemplateApi'; +import { WebsocketClient } from '@/services/dashboard-backend-client/websocketClient'; +import devfileApi, { isDevWorkspace } from '@/services/devfileApi'; +import { devWorkspaceKind } from '@/services/devfileApi/devWorkspace'; import { DEVWORKSPACE_CHE_EDITOR, DEVWORKSPACE_UPDATING_TIMESTAMP_ANNOTATION, -} from '../../../services/devfileApi/devWorkspace/metadata'; -import { getDefer, IDeferred } from '../../../services/helpers/deferred'; -import { delay } from '../../../services/helpers/delay'; -import { DisposableCollection } from '../../../services/helpers/disposable'; -import { getNewerResourceVersion } from '../../../services/helpers/resourceVersion'; -import { DevWorkspaceStatus } from '../../../services/helpers/types'; -import OAuthService from '../../../services/oauth'; -import { loadResourcesContent } from '../../../services/registry/resources'; -import { WorkspaceAdapter } from '../../../services/workspace-adapter'; +} from '@/services/devfileApi/devWorkspace/metadata'; +import { DEVWORKSPACE_STORAGE_TYPE_ATTR } from '@/services/devfileApi/devWorkspace/spec/template'; +import { getDefer, IDeferred } from '@/services/helpers/deferred'; +import { delay } from '@/services/helpers/delay'; +import { DisposableCollection } from '@/services/helpers/disposable'; +import { FactoryParams } from '@/services/helpers/factoryFlow/buildFactoryParams'; +import { getNewerResourceVersion } from '@/services/helpers/resourceVersion'; +import { DevWorkspaceStatus } from '@/services/helpers/types'; +import OAuthService from '@/services/oauth'; +import { loadResourcesContent } from '@/services/registry/resources'; +import { WorkspaceAdapter } from '@/services/workspace-adapter'; import { - DevWorkspaceClient, - DEVWORKSPACE_NEXT_START_ANNOTATION, COMPONENT_UPDATE_POLICY, + DEVWORKSPACE_NEXT_START_ANNOTATION, + DevWorkspaceClient, REGISTRY_URL, -} from '../../../services/workspace-client/devworkspace/devWorkspaceClient'; -import { getCustomEditor } from '../../../services/workspace-client/helpers'; -import { selectApplications } from '../../ClusterInfo/selectors'; -import { getEditor } from '../../DevfileRegistries/getEditor'; -import { createObject } from '../../helpers'; -import { selectDefaultNamespace } from '../../InfrastructureNamespaces/selectors'; -import { AUTHORIZED, SanityCheckAction } from '../../sanityCheckMiddleware'; -import * as DwServerConfigStore from '../../ServerConfig'; +} from '@/services/workspace-client/devworkspace/devWorkspaceClient'; +import { getCustomEditor } from '@/services/workspace-client/helpers'; +import { AppThunk } from '@/store'; +import { selectApplications } from '@/store/ClusterInfo/selectors'; +import { getEditor } from '@/store/DevfileRegistries/getEditor'; +import { selectDefaultDevfile } from '@/store/DevfileRegistries/selectors'; +import { createObject } from '@/store/helpers'; +import { selectDefaultNamespace } from '@/store/InfrastructureNamespaces/selectors'; +import { selectDefaultEditor } from '@/store/Plugins/devWorkspacePlugins/selectors'; +import { AUTHORIZED, SanityCheckAction } from '@/store/sanityCheckMiddleware'; +import * as DwServerConfigStore from '@/store/ServerConfig'; import { selectOpenVSXUrl, selectPluginRegistryInternalUrl, selectPluginRegistryUrl, -} from '../../ServerConfig/selectors'; -import { checkRunningWorkspacesLimit } from './checkRunningWorkspacesLimit'; -import { selectDevWorkspacesResourceVersion } from './selectors'; -import * as DwtApi from '../../../services/dashboard-backend-client/devWorkspaceTemplateApi'; -import { selectDefaultDevfile } from '../../DevfileRegistries/selectors'; -import * as DwApi from '../../../services/dashboard-backend-client/devWorkspaceApi'; -import { selectDefaultEditor } from '../../Plugins/devWorkspacePlugins/selectors'; -import { DEVWORKSPACE_STORAGE_TYPE_ATTR } from '../../../services/devfileApi/devWorkspace/spec/template'; +} from '@/store/ServerConfig/selectors'; +import { checkRunningWorkspacesLimit } from '@/store/Workspaces/devWorkspaces/checkRunningWorkspacesLimit'; +import { selectDevWorkspacesResourceVersion } from '@/store/Workspaces/devWorkspaces/selectors'; export const onStatusChangeCallbacks = new Map void>(); diff --git a/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/selectors.ts b/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/selectors.ts index f66bbb6d3d..0d6a64356f 100644 --- a/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/selectors.ts +++ b/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/selectors.ts @@ -11,9 +11,10 @@ */ import { createSelector } from 'reselect'; -import { AppState } from '../..'; -import { DevWorkspaceStatus } from '../../../services/helpers/types'; -import { selectRunningWorkspacesLimit } from '../../ClusterConfig/selectors'; + +import { DevWorkspaceStatus } from '@/services/helpers/types'; +import { AppState } from '@/store'; +import { selectRunningWorkspacesLimit } from '@/store/ClusterConfig/selectors'; const selectState = (state: AppState) => state.devWorkspaces; export const selectDevWorkspacesState = selectState; diff --git a/packages/dashboard-frontend/src/store/Workspaces/index.ts b/packages/dashboard-frontend/src/store/Workspaces/index.ts index e5b8736a5b..9669a76d8c 100644 --- a/packages/dashboard-frontend/src/store/Workspaces/index.ts +++ b/packages/dashboard-frontend/src/store/Workspaces/index.ts @@ -11,12 +11,14 @@ */ import { Reducer } from 'redux'; + +import devfileApi from '@/services/devfileApi'; +import { FactoryParams } from '@/services/helpers/factoryFlow/buildFactoryParams'; +import { Workspace } from '@/services/workspace-adapter'; +import { createObject } from '@/store/helpers'; +import * as DevWorkspacesStore from '@/store/Workspaces/devWorkspaces'; + import { AppThunk } from '..'; -import { FactoryParams } from '../../services/helpers/factoryFlow/buildFactoryParams'; -import devfileApi from '../../services/devfileApi'; -import { Workspace } from '../../services/workspace-adapter'; -import { createObject } from '../helpers'; -import * as DevWorkspacesStore from './devWorkspaces'; // This state defines the type of data maintained in the Redux store. export interface State { diff --git a/packages/dashboard-frontend/src/store/Workspaces/selectors.ts b/packages/dashboard-frontend/src/store/Workspaces/selectors.ts index 0e6e7718f8..324561f860 100644 --- a/packages/dashboard-frontend/src/store/Workspaces/selectors.ts +++ b/packages/dashboard-frontend/src/store/Workspaces/selectors.ts @@ -11,9 +11,14 @@ */ import { createSelector } from 'reselect'; + +import { constructWorkspace, Workspace } from '@/services/workspace-adapter'; +import { + selectDevWorkspacesError, + selectRunningDevWorkspaces, +} from '@/store/Workspaces/devWorkspaces/selectors'; + import { AppState } from '..'; -import { constructWorkspace, Workspace } from '../../services/workspace-adapter'; -import { selectRunningDevWorkspaces, selectDevWorkspacesError } from './devWorkspaces/selectors'; const selectState = (state: AppState) => state.workspaces; const selectDevWorkspacesState = (state: AppState) => state.devWorkspaces; diff --git a/packages/dashboard-frontend/src/store/__mocks__/devWorkspaceBuilder.ts b/packages/dashboard-frontend/src/store/__mocks__/devWorkspaceBuilder.ts index 291aed0577..61f3f6c933 100644 --- a/packages/dashboard-frontend/src/store/__mocks__/devWorkspaceBuilder.ts +++ b/packages/dashboard-frontend/src/store/__mocks__/devWorkspaceBuilder.ts @@ -11,10 +11,11 @@ */ import { V1alpha2DevWorkspaceStatusConditions } from '@devfile/api'; -import devfileApi from '../../services/devfileApi'; -import getRandomString from '../../services/helpers/random'; -import { DevWorkspaceStatus } from '../../services/helpers/types'; -import { DevWorkspacePlugin } from '../../services/devfileApi/devWorkspace'; + +import devfileApi from '@/services/devfileApi'; +import { DevWorkspacePlugin } from '@/services/devfileApi/devWorkspace'; +import getRandomString from '@/services/helpers/random'; +import { DevWorkspaceStatus } from '@/services/helpers/types'; export class DevWorkspaceBuilder { private workspace: devfileApi.DevWorkspace = { diff --git a/packages/dashboard-frontend/src/store/__mocks__/factoryResolverBuilder.ts b/packages/dashboard-frontend/src/store/__mocks__/factoryResolverBuilder.ts index b5e2999527..fbd6d2a358 100644 --- a/packages/dashboard-frontend/src/store/__mocks__/factoryResolverBuilder.ts +++ b/packages/dashboard-frontend/src/store/__mocks__/factoryResolverBuilder.ts @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { FactoryResolver, FactoryResolverScmInfo } from '../../services/helpers/types'; +import { FactoryResolver, FactoryResolverScmInfo } from '@/services/helpers/types'; export class FactoryResolverBuilder { private factoryResolver = { diff --git a/packages/dashboard-frontend/src/store/__mocks__/storeBuilder.ts b/packages/dashboard-frontend/src/store/__mocks__/storeBuilder.ts index 611cb08b8b..c716dcd1e0 100644 --- a/packages/dashboard-frontend/src/store/__mocks__/storeBuilder.ts +++ b/packages/dashboard-frontend/src/store/__mocks__/storeBuilder.ts @@ -15,20 +15,26 @@ import { CoreV1Event, V1Pod } from '@kubernetes/client-node'; import { AnyAction } from 'redux'; import createMockStore, { MockStoreEnhanced } from 'redux-mock-store'; import { ThunkDispatch } from 'redux-thunk'; + +import { BrandingData } from '@/services/bootstrap/branding.constant'; +import devfileApi from '@/services/devfileApi'; +import mockThunk from '@/store/__mocks__/thunk'; +import { State as BrandingState } from '@/store/Branding'; +import { DevWorkspaceResources, State as DevfileRegistriesState } from '@/store/DevfileRegistries'; +import { RegistryEntry } from '@/store/DockerConfig/types'; +import { + ConvertedState, + ResolverState, + State as FactoryResolverState, +} from '@/store/FactoryResolver'; +import { IGitOauth } from '@/store/GitOauthConfig/types'; +import { State as InfrastructureNamespaceState } from '@/store/InfrastructureNamespaces'; +import { State as PluginsState } from '@/store/Plugins/chePlugins'; +import { State as LogsState } from '@/store/Pods/Logs'; +import { State as UserProfileState } from '@/store/User/Profile'; +import { State as WorkspacesState } from '@/store/Workspaces'; + import { AppState } from '..'; -import { BrandingData } from '../../services/bootstrap/branding.constant'; -import devfileApi from '../../services/devfileApi'; -import { State as BrandingState } from '../Branding'; -import { DevWorkspaceResources, State as DevfileRegistriesState } from '../DevfileRegistries'; -import { RegistryEntry } from '../DockerConfig/types'; -import { ConvertedState, ResolverState, State as FactoryResolverState } from '../FactoryResolver'; -import { IGitOauth } from '../GitOauthConfig/types'; -import { State as InfrastructureNamespaceState } from '../InfrastructureNamespaces'; -import { State as PluginsState } from '../Plugins/chePlugins'; -import { State as LogsState } from '../Pods/Logs'; -import { State as UserProfileState } from '../User/Profile'; -import { State as WorkspacesState } from '../Workspaces'; -import mockThunk from './thunk'; export class FakeStoreBuilder { private state: AppState = { diff --git a/packages/dashboard-frontend/src/store/__tests__/helpers.spec.ts b/packages/dashboard-frontend/src/store/__tests__/helpers.spec.ts index adfd000ae8..b23e502950 100644 --- a/packages/dashboard-frontend/src/store/__tests__/helpers.spec.ts +++ b/packages/dashboard-frontend/src/store/__tests__/helpers.spec.ts @@ -10,7 +10,7 @@ * Red Hat, Inc. - initial API and implementation */ -import { createObject } from '../helpers'; +import { createObject } from '@/store/helpers'; describe('Store helpers', () => { describe('Creates a new state object', () => { diff --git a/packages/dashboard-frontend/src/store/configureStore.ts b/packages/dashboard-frontend/src/store/configureStore.ts index 2bee535480..5e04736d61 100644 --- a/packages/dashboard-frontend/src/store/configureStore.ts +++ b/packages/dashboard-frontend/src/store/configureStore.ts @@ -14,8 +14,10 @@ import { connectRouter, routerMiddleware } from 'connected-react-router'; import { History } from 'history'; import { applyMiddleware, combineReducers, compose, createStore, Store } from 'redux'; import thunk from 'redux-thunk'; + +import { sanityCheckMiddleware } from '@/store/sanityCheckMiddleware'; + import { AppState, reducers } from '.'; -import { sanityCheckMiddleware } from './sanityCheckMiddleware'; export default function configureStore(history: History, initialState?: AppState): Store { const rootReducer = combineReducers({ diff --git a/packages/dashboard-frontend/src/store/index.ts b/packages/dashboard-frontend/src/store/index.ts index 5b9da7d720..53893be4b0 100644 --- a/packages/dashboard-frontend/src/store/index.ts +++ b/packages/dashboard-frontend/src/store/index.ts @@ -12,28 +12,29 @@ import { Action } from 'redux'; import { ThunkAction } from 'redux-thunk'; -import * as BannerAlertStore from './BannerAlert'; -import * as BrandingStore from './Branding'; -import * as ClusterConfig from './ClusterConfig'; -import * as ClusterInfo from './ClusterInfo'; -import * as DevWorkspacesStore from './Workspaces/devWorkspaces'; -import * as DevfileRegistriesStore from './DevfileRegistries'; -import * as DockerConfigStore from './DockerConfig'; -import * as DwPluginsStore from './Plugins/devWorkspacePlugins'; -import * as DwServerConfigStore from './ServerConfig'; -import * as EventsStore from './Events'; -import * as FactoryResolverStore from './FactoryResolver'; -import * as GitConfigStore from './GitConfig'; -import * as GitOauthConfigStore from './GitOauthConfig'; -import * as InfrastructureNamespacesStore from './InfrastructureNamespaces'; -import * as LogsStore from './Pods/Logs'; -import * as PersonalAccessToken from './PersonalAccessToken'; -import * as PluginsStore from './Plugins/chePlugins'; -import * as PodsStore from './Pods'; -import * as SanityCheckStore from './SanityCheck'; -import * as UserIdStore from './User/Id'; -import * as UserProfileStore from './User/Profile'; -import * as WorkspacesStore from './Workspaces'; + +import * as BannerAlertStore from '@/store/BannerAlert'; +import * as BrandingStore from '@/store/Branding'; +import * as ClusterConfig from '@/store/ClusterConfig'; +import * as ClusterInfo from '@/store/ClusterInfo'; +import * as DevfileRegistriesStore from '@/store/DevfileRegistries'; +import * as DockerConfigStore from '@/store/DockerConfig'; +import * as EventsStore from '@/store/Events'; +import * as FactoryResolverStore from '@/store/FactoryResolver'; +import * as GitConfigStore from '@/store/GitConfig'; +import * as GitOauthConfigStore from '@/store/GitOauthConfig'; +import * as InfrastructureNamespacesStore from '@/store/InfrastructureNamespaces'; +import * as PersonalAccessToken from '@/store/PersonalAccessToken'; +import * as PluginsStore from '@/store/Plugins/chePlugins'; +import * as DwPluginsStore from '@/store/Plugins/devWorkspacePlugins'; +import * as PodsStore from '@/store/Pods'; +import * as LogsStore from '@/store/Pods/Logs'; +import * as SanityCheckStore from '@/store/SanityCheck'; +import * as DwServerConfigStore from '@/store/ServerConfig'; +import * as UserIdStore from '@/store/User/Id'; +import * as UserProfileStore from '@/store/User/Profile'; +import * as WorkspacesStore from '@/store/Workspaces'; +import * as DevWorkspacesStore from '@/store/Workspaces/devWorkspaces'; // the top-level state object export interface AppState { diff --git a/packages/dashboard-frontend/src/store/sanityCheckMiddleware.ts b/packages/dashboard-frontend/src/store/sanityCheckMiddleware.ts index 32be488392..c08b3ad2e6 100644 --- a/packages/dashboard-frontend/src/store/sanityCheckMiddleware.ts +++ b/packages/dashboard-frontend/src/store/sanityCheckMiddleware.ts @@ -12,8 +12,10 @@ import { AnyAction } from 'redux'; import { ThunkMiddleware } from 'redux-thunk'; + +import * as AuthorizationStore from '@/store/SanityCheck'; + import { AppState } from '.'; -import * as AuthorizationStore from './SanityCheck'; export const AUTHORIZED = Symbol('Authorized resource'); diff --git a/packages/dashboard-frontend/src/typings/api.che.d.ts b/packages/dashboard-frontend/src/typings/api.che.d.ts index ebd085c37d..23ed7e3285 100755 --- a/packages/dashboard-frontend/src/typings/api.che.d.ts +++ b/packages/dashboard-frontend/src/typings/api.che.d.ts @@ -12,6 +12,7 @@ declare namespace api { import { che } from '@eclipse-che/api'; + export { che }; } diff --git a/packages/dashboard-frontend/tsconfig.json b/packages/dashboard-frontend/tsconfig.json index 7f42914f83..86d062e86b 100644 --- a/packages/dashboard-frontend/tsconfig.json +++ b/packages/dashboard-frontend/tsconfig.json @@ -8,14 +8,21 @@ "preserveConstEnums": true, "removeComments": true, "target": "ES2021", - "lib": ["ES2021", "dom"], + "lib": [ + "ES2021", + "dom" + ], "experimentalDecorators": true, "emitDecoratorMetadata": true, "strictPropertyInitialization": false, "allowJs": true, "resolveJsonModule": true, + "baseUrl": "./", + "moduleResolution": "node", "paths": { - "@eclipse-che/common": ["../common/src"] + "@/*": [ + "./src/*", + ], }, "outDir": "lib", "rootDir": "src" @@ -28,7 +35,4 @@ "node_modules", "lib", ], - "references": [ - { "path": "../common" } - ] -} +} \ No newline at end of file diff --git a/packages/dashboard-frontend/webpack.config.common.js b/packages/dashboard-frontend/webpack.config.common.js index 59f3b0832f..7d2ee4dc28 100644 --- a/packages/dashboard-frontend/webpack.config.common.js +++ b/packages/dashboard-frontend/webpack.config.common.js @@ -25,7 +25,7 @@ const config = { output: { path: path.join(__dirname, 'lib', 'public/dashboard'), publicPath: './', - filename: (pathData) => { + filename: pathData => { if (pathData.chunk.name === 'accept-factory-link') { return 'static/preload/[name].js'; } @@ -40,7 +40,7 @@ const config = { }, optimization: { splitChunks: { - chunks: (chunk) => { + chunks: chunk => { // exclude `accept-factory-link` from being split return chunk.name !== 'accept-factory-link'; }, @@ -78,19 +78,19 @@ const config = { }, { test: /node_modules[\\\\|\/](yaml-language-server)/, - use: ['umd-compat-loader'] + use: ['umd-compat-loader'], }, { test: /node_modules[\\\\|/](vscode-json-languageservice)/, - use: ['umd-compat-loader'] + use: ['umd-compat-loader'], }, { test: /prettier\/parser-yaml/, - use: ['null-loader'] + use: ['null-loader'], }, { test: /prettier/, - use: ['null-loader'] + use: ['null-loader'], }, { test: /\.(png|svg|jpg|jpeg|gif)$/i, @@ -100,22 +100,26 @@ const config = { test: /\.(woff|woff2|ttf|eot|ico)$/i, type: 'asset/resource', }, - ] + ], }, resolve: { extensions: ['.js', '.ts', '.tsx'], alias: { - 'vscode-languageserver-protocol/lib/utils/is': 'vscode-languageserver-protocol/lib/common/utils/is', + // alias for absolute imports (see tsconfig.json) + '@': path.resolve(__dirname, 'src/'), + + 'vscode-languageserver-protocol/lib/utils/is': + 'vscode-languageserver-protocol/lib/common/utils/is', 'vscode-languageserver-protocol/lib/main': 'vscode-languageserver-protocol/lib/node/main', }, fallback: { - "fs": false, - "net": false, - "module": false, - "path": false, - "os": false, - "crypto": require.resolve("crypto-browserify"), - "stream": require.resolve("stream-browserify"), + fs: false, + net: false, + module: false, + path: false, + os: false, + crypto: require.resolve('crypto-browserify'), + stream: require.resolve('stream-browserify'), }, }, resolveLoader: {}, @@ -132,12 +136,12 @@ const config = { }), new HtmlWebpackPlugin({ template: path.resolve(__dirname, './index.html'), - chunks : ['client', 'service-worker', 'editor.worker'], + chunks: ['client', 'service-worker', 'editor.worker'], filename: 'index.html', }), new HtmlWebpackPlugin({ template: path.resolve(__dirname, 'src/preload/index.html'), - chunks : ['accept-factory-link'], + chunks: ['accept-factory-link'], filename: '../index.html', publicPath: '/dashboard/', }), @@ -145,7 +149,7 @@ const config = { patterns: [ { from: path.join(__dirname, 'assets'), to: 'assets' }, { from: path.join(__dirname, 'static'), to: 'static' }, - ] + ], }), ], }; diff --git a/tsconfig.json b/tsconfig.json index a4d93c7369..3ec56dc3fe 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,7 +13,6 @@ "experimentalDecorators": true, "emitDecoratorMetadata": true, "noEmit": false, - "baseUrl": "./packages", - "sourceMap": true + "sourceMap": true, }, } diff --git a/yarn.lock b/yarn.lock index 0a98245fb7..4418e35011 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1816,6 +1816,11 @@ resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.12.tgz#d70faba7039d5fca54c83c7dbab41051d2b6f6cb" integrity sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA== +"@types/json5@^0.0.29": + version "0.0.29" + resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" + integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== + "@types/jsonfile@*": version "6.1.1" resolved "https://registry.yarnpkg.com/@types/jsonfile/-/jsonfile-6.1.1.tgz#ac84e9aefa74a2425a0fb3012bdea44f58970f1b" @@ -2548,6 +2553,17 @@ array-union@^2.1.0: resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== +array.prototype.findlastindex@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.3.tgz#b37598438f97b579166940814e2c0493a4f50207" + integrity sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + es-shim-unscopables "^1.0.0" + get-intrinsic "^1.2.1" + array.prototype.flat@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz#ffc6576a7ca3efc2f46a143b9d1dda9b4b3cf5e2" @@ -2591,6 +2607,19 @@ arraybuffer.prototype.slice@^1.0.1: is-array-buffer "^3.0.2" is-shared-array-buffer "^1.0.2" +arraybuffer.prototype.slice@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz#98bd561953e3e74bb34938e77647179dfe6e9f12" + integrity sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw== + dependencies: + array-buffer-byte-length "^1.0.0" + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + get-intrinsic "^1.2.1" + is-array-buffer "^3.0.2" + is-shared-array-buffer "^1.0.2" + arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" @@ -4147,6 +4176,15 @@ defaults@^1.0.3: dependencies: clone "^1.0.2" +define-data-property@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.0.tgz#0db13540704e1d8d479a0656cf781267531b9451" + integrity sha512-UzGwzcjyv3OtAvolTj1GoyNYzfFR+iqbGjcnBEENZVCpM4/Ng1yhGNvS3lR/xDS74Tb2wGG9WzNSNIOS9UVb2g== + dependencies: + get-intrinsic "^1.2.1" + gopd "^1.0.1" + has-property-descriptors "^1.0.0" + define-lazy-prop@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f" @@ -4539,6 +4577,51 @@ es-abstract@^1.19.0, es-abstract@^1.20.4, es-abstract@^1.21.3: unbox-primitive "^1.0.2" which-typed-array "^1.1.10" +es-abstract@^1.22.1: + version "1.22.2" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.22.2.tgz#90f7282d91d0ad577f505e423e52d4c1d93c1b8a" + integrity sha512-YoxfFcDmhjOgWPWsV13+2RNjq1F6UQnfs+8TftwNqtzlmFzEXvlUwdrNrYeaizfjQzRMxkZ6ElWMOJIFKdVqwA== + dependencies: + array-buffer-byte-length "^1.0.0" + arraybuffer.prototype.slice "^1.0.2" + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + es-set-tostringtag "^2.0.1" + es-to-primitive "^1.2.1" + function.prototype.name "^1.1.6" + get-intrinsic "^1.2.1" + get-symbol-description "^1.0.0" + globalthis "^1.0.3" + gopd "^1.0.1" + has "^1.0.3" + has-property-descriptors "^1.0.0" + has-proto "^1.0.1" + has-symbols "^1.0.3" + internal-slot "^1.0.5" + is-array-buffer "^3.0.2" + is-callable "^1.2.7" + is-negative-zero "^2.0.2" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.2" + is-string "^1.0.7" + is-typed-array "^1.1.12" + is-weakref "^1.0.2" + object-inspect "^1.12.3" + object-keys "^1.1.1" + object.assign "^4.1.4" + regexp.prototype.flags "^1.5.1" + safe-array-concat "^1.0.1" + safe-regex-test "^1.0.0" + string.prototype.trim "^1.2.8" + string.prototype.trimend "^1.0.7" + string.prototype.trimstart "^1.0.7" + typed-array-buffer "^1.0.0" + typed-array-byte-length "^1.0.0" + typed-array-byte-offset "^1.0.0" + typed-array-length "^1.0.4" + unbox-primitive "^1.0.2" + which-typed-array "^1.1.11" + es-iterator-helpers@^1.0.12: version "1.0.12" resolved "https://registry.yarnpkg.com/es-iterator-helpers/-/es-iterator-helpers-1.0.12.tgz#272f7270f270f4d63dd8aa718228ffa901fd086e" @@ -4638,6 +4721,50 @@ eslint-config-prettier@^9.0.0: resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz#eb25485946dd0c66cd216a46232dc05451518d1f" integrity sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw== +eslint-import-resolver-node@^0.3.7: + version "0.3.9" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz#d4eaac52b8a2e7c3cd1903eb00f7e053356118ac" + integrity sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g== + dependencies: + debug "^3.2.7" + is-core-module "^2.13.0" + resolve "^1.22.4" + +eslint-module-utils@^2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz#e439fee65fc33f6bba630ff621efc38ec0375c49" + integrity sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw== + dependencies: + debug "^3.2.7" + +eslint-plugin-import@^2.28.1: + version "2.28.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.28.1.tgz#63b8b5b3c409bfc75ebaf8fb206b07ab435482c4" + integrity sha512-9I9hFlITvOV55alzoKBI+K9q74kv0iKMeY6av5+umsNwayt59fz692daGyjR+oStBQgx6nwR9rXldDev3Clw+A== + dependencies: + array-includes "^3.1.6" + array.prototype.findlastindex "^1.2.2" + array.prototype.flat "^1.3.1" + array.prototype.flatmap "^1.3.1" + debug "^3.2.7" + doctrine "^2.1.0" + eslint-import-resolver-node "^0.3.7" + eslint-module-utils "^2.8.0" + has "^1.0.3" + is-core-module "^2.13.0" + is-glob "^4.0.3" + minimatch "^3.1.2" + object.fromentries "^2.0.6" + object.groupby "^1.0.0" + object.values "^1.1.6" + semver "^6.3.1" + tsconfig-paths "^3.14.2" + +eslint-plugin-no-relative-import-paths@^1.5.2: + version "1.5.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-no-relative-import-paths/-/eslint-plugin-no-relative-import-paths-1.5.2.tgz#c35f2fd0bf2a6a57b268193ed7df63ff7000134e" + integrity sha512-wMlL+TVuDhKk1plP+w3L4Hc7+u89vUkrOYq6/0ARjcYqwc9/YaS9uEXNzaqAk+WLoEgakzNL5JgJJw6m4qd5zw== + eslint-plugin-notice@^0.9.10: version "0.9.10" resolved "https://registry.yarnpkg.com/eslint-plugin-notice/-/eslint-plugin-notice-0.9.10.tgz#89cf6377bf1c004a219c4e541321ea9125b408c8" @@ -4682,6 +4809,11 @@ eslint-plugin-react@^7.33.1: semver "^6.3.1" string.prototype.matchall "^4.0.8" +eslint-plugin-simple-import-sort@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-10.0.0.tgz#cc4ceaa81ba73252427062705b64321946f61351" + integrity sha512-AeTvO9UCMSNzIHRkg8S6c3RPy5YEwKWSQPx3DYghLedo2ZQxowPFLGDN1AZ2evfg6r6mjBSZSLxLFsWSu3acsw== + eslint-scope@5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" @@ -5310,6 +5442,16 @@ function.prototype.name@^1.1.5: es-abstract "^1.19.0" functions-have-names "^1.2.2" +function.prototype.name@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.6.tgz#cdf315b7d90ee77a4c6ee216c3c3362da07533fd" + integrity sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + functions-have-names "^1.2.3" + functions-have-names@^1.2.2, functions-have-names@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" @@ -6475,7 +6617,7 @@ is-text-path@^1.0.1: dependencies: text-extensions "^1.0.0" -is-typed-array@^1.1.10, is-typed-array@^1.1.9: +is-typed-array@^1.1.10, is-typed-array@^1.1.12, is-typed-array@^1.1.9: version "1.1.12" resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.12.tgz#d0bab5686ef4a76f7a73097b95470ab199c57d4a" integrity sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg== @@ -7162,7 +7304,7 @@ json5@^0.5.1: resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" integrity sha512-4xrs1aW+6N5DalkqSVA8fxh458CXvR99WU8WLKmq4v8eWAL86Xo3BVqyd3SkA9wEVjCMqyvvRRkshAdOnBp5rw== -json5@^1.0.1: +json5@^1.0.1, json5@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== @@ -8511,6 +8653,16 @@ object.fromentries@^2.0.6: define-properties "^1.1.4" es-abstract "^1.20.4" +object.groupby@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object.groupby/-/object.groupby-1.0.1.tgz#d41d9f3c8d6c778d9cbac86b4ee9f5af103152ee" + integrity sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + get-intrinsic "^1.2.1" + object.hasown@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/object.hasown/-/object.hasown-1.1.2.tgz#f919e21fad4eb38a57bc6345b3afd496515c3f92" @@ -9960,6 +10112,15 @@ regexp.prototype.flags@^1.4.3, regexp.prototype.flags@^1.5.0: define-properties "^1.2.0" functions-have-names "^1.2.3" +regexp.prototype.flags@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz#90ce989138db209f81492edd734183ce99f9677e" + integrity sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + set-function-name "^2.0.0" + relateurl@^0.2.7: version "0.2.7" resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" @@ -10074,6 +10235,15 @@ resolve@^1.10.0, resolve@^1.20.0: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" +resolve@^1.22.4: + version "1.22.6" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.6.tgz#dd209739eca3aef739c626fea1b4f3c506195362" + integrity sha512-njhxM7mV12JfufShqGy3Rz8j11RPdLy4xi15UurGJeoHLfJpVXKdh3ueuOqbYUcDZnffr6X739JBo5LzyahEsw== + dependencies: + is-core-module "^2.13.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + resolve@^2.0.0-next.4: version "2.0.0-next.4" resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.4.tgz#3d37a113d6429f496ec4752d2a2e58efb1fd4660" @@ -10196,6 +10366,16 @@ safe-array-concat@^1.0.0: has-symbols "^1.0.3" isarray "^2.0.5" +safe-array-concat@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.0.1.tgz#91686a63ce3adbea14d61b14c99572a8ff84754c" + integrity sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.1" + has-symbols "^1.0.3" + isarray "^2.0.5" + safe-buffer@5.2.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" @@ -10336,6 +10516,15 @@ set-cookie-parser@^2.4.1: resolved "https://registry.yarnpkg.com/set-cookie-parser/-/set-cookie-parser-2.6.0.tgz#131921e50f62ff1a66a461d7d62d7b21d5d15a51" integrity sha512-RVnVQxTXuerk653XfuliOxBP81Sf0+qfQE73LIYKcyMYHG94AuH0kgrQpRDuTZnSmjpysHmzxJXKNfa6PjFhyQ== +set-function-name@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-function-name/-/set-function-name-2.0.1.tgz#12ce38b7954310b9f61faa12701620a0c882793a" + integrity sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA== + dependencies: + define-data-property "^1.0.1" + functions-have-names "^1.2.3" + has-property-descriptors "^1.0.0" + setprototypeof@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" @@ -10706,6 +10895,15 @@ string.prototype.trim@^1.2.7: define-properties "^1.1.4" es-abstract "^1.20.4" +string.prototype.trim@^1.2.8: + version "1.2.8" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz#f9ac6f8af4bd55ddfa8895e6aea92a96395393bd" + integrity sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + string.prototype.trimend@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz#c4a27fa026d979d79c04f17397f250a462944533" @@ -10715,6 +10913,15 @@ string.prototype.trimend@^1.0.6: define-properties "^1.1.4" es-abstract "^1.20.4" +string.prototype.trimend@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz#1bb3afc5008661d73e2dc015cd4853732d6c471e" + integrity sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + string.prototype.trimstart@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz#e90ab66aa8e4007d92ef591bbf3cd422c56bdcf4" @@ -10724,6 +10931,15 @@ string.prototype.trimstart@^1.0.6: define-properties "^1.1.4" es-abstract "^1.20.4" +string.prototype.trimstart@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz#d4cdb44b83a4737ffbac2d406e405d43d0184298" + integrity sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + string_decoder@^1.1.1, string_decoder@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" @@ -11298,6 +11514,16 @@ ts-loader@^9.4.4: micromatch "^4.0.0" semver "^7.3.4" +tsconfig-paths@^3.14.2: + version "3.14.2" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz#6e32f1f79412decd261f92d633a9dc1cfa99f088" + integrity sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g== + dependencies: + "@types/json5" "^0.0.29" + json5 "^1.0.2" + minimist "^1.2.6" + strip-bom "^3.0.0" + tsconfig-paths@^4.1.2: version "4.2.0" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz#ef78e19039133446d244beac0fd6a1632e2d107c"