Skip to content

Commit

Permalink
fix: preload data service
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksii Orel <[email protected]>
  • Loading branch information
olexii4 committed Oct 25, 2023
1 parent 9e37924 commit b80c6ba
Show file tree
Hide file tree
Showing 27 changed files with 305 additions and 110 deletions.
8 changes: 4 additions & 4 deletions .deps/EXCLUDED/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This file contains a manual contribution to .deps/dev.md and it's needed because
| `@sigstore/[email protected]` | transitive dependency |
| `@sigstore/[email protected]` | transitive dependency |
| `@sigstore/[email protected]` | transitive dependency |
| `@testing-library/[email protected]` | (clearlydefined)[https://clearlydefined.io/definitions/npm/npmjs/@testing-library/dom/7.31.2] |
| `@testing-library/[email protected]` | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/@testing-library/dom/7.31.2) |
| `@typescript-eslint/[email protected]` | transitive dependency |
| `@typescript-eslint/[email protected]` | transitive dependency |
| `@typescript-eslint/[email protected]` | transitive dependency |
Expand All @@ -28,14 +28,14 @@ This file contains a manual contribution to .deps/dev.md and it's needed because
| `[email protected]` | transitive dependency |
| `[email protected]` | transitive dependency |
| `[email protected]` | transitive dependency |
| `[email protected]` | (clearlydefined)[https://clearlydefined.io/definitions/npm/npmjs/-/eslint-config-prettier/9.0.0] |
| `[email protected]` | (clearlydefined)[https://clearlydefined.io/definitions/npm/npmjs/-/eslint/8.47.0] |
| `[email protected]` | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/eslint-config-prettier/9.0.0) |
| `[email protected]` | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/eslint/8.47.0) |
| `[email protected]` | transitive dependency |
| `[email protected]` | transitive dependency |
| `[email protected]` | transitive dependency |
| `[email protected]` | transitive dependency |
| `[email protected]` | transitive dependency |
| `[email protected]` | (clearlydefined)[https://clearlydefined.io/definitions/npm/npmjs/-/prettier/3.0.2] |
| `[email protected]` | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/prettier/3.0.2) |
| `[email protected]` | transitive dependency |
| `[email protected]` | transitive dependency |
| `[email protected]` | transitive dependency |
Expand Down
14 changes: 7 additions & 7 deletions .deps/EXCLUDED/prod.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ This file lists dependencies that do not need CQs or auto-detection does not wor

| Packages | Resolved CQs |
| --- | --- |
| `@patternfly/[email protected]` | (clearlydefined)[https://clearlydefined.io/definitions/npm/npmjs/@patternfly/react-core/4.276.11] |
| `@patternfly/[email protected]` | (clearlydefined)[https://clearlydefined.io/definitions/npm/npmjs/@patternfly/react-icons/4.93.7] |
| `[email protected]` | (clearlydefined)[https://clearlydefined.io/definitions/npm/npmjs/-/blueimp-md5/2.19.0] |
| `[email protected]` | (clearlydefined)[https://clearlydefined.io/definitions/npm/npmjs/-/codemirror/5.65.15] |
| `[email protected]` | (clearlydefined)[https://clearlydefined.io/definitions/npm/npmjs/-/fast-uri/2.2.0] |
| `[email protected]` | (clearlydefined)[https://clearlydefined.io/definitions/npm/npmjs/-/fastify/4.21.0] |
| `[email protected]` | (clearlydefined)[https://clearlydefined.io/definitions/npm/npmjs/-/real-require/0.2.0] |
| `@patternfly/[email protected]` | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/@patternfly/react-core/4.276.11) |
| `@patternfly/[email protected]` | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/@patternfly/react-icons/4.93.7) |
| `[email protected]` | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/blueimp-md5/2.19.0) |
| `[email protected]` | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/codemirror/5.65.15) |
| `[email protected]` | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/fast-uri/2.2.0) |
| `[email protected]` | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/fastify/4.21.0) |
| `[email protected]` | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/real-require/0.2.0) |
14 changes: 7 additions & 7 deletions .deps/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
| [`@sinclair/[email protected]`](https://github.com/sinclairzx81/typebox) | MIT | clearlydefined |
| [`@sinonjs/[email protected]`](git+https://github.com/sinonjs/commons.git) | BSD-3-Clause | clearlydefined |
| [`@sinonjs/[email protected]`](https://github.com/sinonjs/fake-timers.git) | BSD-3-Clause | #9214 |
| [`@testing-library/[email protected]`](https://github.com/testing-library/dom-testing-library) | MIT | (clearlydefined)[https://clearlydefined.io/definitions/npm/npmjs/@testing-library/dom/7.31.2] |
| [`@testing-library/[email protected]`](https://github.com/testing-library/dom-testing-library) | MIT | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/@testing-library/dom/7.31.2) |
| [`@testing-library/[email protected]`](https://github.com/testing-library/jest-dom) | MIT | clearlydefined |
| [`@testing-library/[email protected]`](https://github.com/testing-library/react-testing-library) | MIT | clearlydefined |
| [`@testing-library/[email protected]`](https://github.com/testing-library/user-event) | MIT | clearlydefined |
Expand Down Expand Up @@ -216,7 +216,7 @@
| [`@yarnpkg/[email protected]`](https://github.com/yarnpkg/yarn/blob/master/packages/lockfile) | BSD-2-Clause | #922 |
| [`@yarnpkg/[email protected]`](ssh://[email protected]/yarnpkg/berry.git) | BSD-2-Clause | #4660 |
| [`@zkochan/[email protected]`](https://github.com/nodeca/js-yaml.git) | MIT | clearlydefined |
| [`[email protected]`](git://github.com/dominictarr/JSONStream.git) | (MIT OR Apache-2.0) | clearlydefined |
| [`[email protected]`](git://github.com/dominictarr/JSONStream.git) | (MIT OR Apache-2.0) | #11081 |
| [`[email protected]`](git+https://github.com/jsdom/abab.git) | BSD-3-Clause | clearlydefined |
| [`[email protected]`](http://github.com/isaacs/abbrev-js) | ISC | clearlydefined |
| [`[email protected]`](https://github.com/ForbesLindesay/acorn-globals.git) | MIT | clearlydefined |
Expand Down Expand Up @@ -398,7 +398,7 @@
| [`[email protected]`](git://github.com/ljharb/es-to-primitive.git) | MIT | clearlydefined |
| [`[email protected]`](https://github.com/lukeed/escalade.git) | MIT | clearlydefined |
| [`[email protected]`](http://github.com/estools/escodegen.git) | BSD-2-Clause | #9306 |
| [`[email protected]`](https://github.com/prettier/eslint-config-prettier.git) | MIT | (clearlydefined)[https://clearlydefined.io/definitions/npm/npmjs/-/eslint-config-prettier/9.0.0] |
| [`[email protected]`](https://github.com/prettier/eslint-config-prettier.git) | MIT | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/eslint-config-prettier/9.0.0) |
| [`[email protected]`](https://github.com/import-js/eslint-plugin-import) | MIT | #9923 |
| [`[email protected]`](git+https://github.com/import-js/eslint-plugin-import.git) | MIT | #8209 |
| [`[email protected]`](https://github.com/import-js/eslint-plugin-import) | MIT | #9927 |
Expand All @@ -411,7 +411,7 @@
| [`[email protected]`](https://github.com/eslint/eslint-scope.git) | BSD-2-Clause | clearlydefined |
| [`[email protected]`](https://github.com/eslint/eslint-visitor-keys.git) | Apache-2.0 | #7729 |
| [`[email protected]`](https://github.com/webpack-contrib/eslint-webpack-plugin.git) | MIT | clearlydefined |
| [`[email protected]`](https://github.com/eslint/eslint.git) | MIT | (clearlydefined)[https://clearlydefined.io/definitions/npm/npmjs/-/eslint/8.47.0] |
| [`[email protected]`](https://github.com/eslint/eslint.git) | MIT | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/eslint/8.47.0) |
| [`[email protected]`](https://github.com/eslint/espree.git) | BSD-2-Clause | #9308 |
| [`[email protected]`](https://github.com/jquery/esprima.git) | BSD-2-Clause | #995 |
| [`[email protected]`](https://github.com/estools/esquery.git) | BSD-3-Clause | #7469 |
Expand Down Expand Up @@ -480,7 +480,7 @@
| [`[email protected]`](https://[email protected]/tvcutsem/harmony-reflect.git) | (Apache-2.0 OR MPL-1.1) | #2966 |
| [`[email protected]`](git+https://github.com/ljharb/has-bigints.git) | MIT | clearlydefined |
| [`[email protected]`](https://github.com/sindresorhus/has-flag.git) | MIT | clearlydefined |
| [`[email protected]`](git+https://github.com/inspect-js/has-property-descriptors.git) | MIT | clearlydefined |
| [`[email protected]`](git+https://github.com/inspect-js/has-property-descriptors.git) | MIT | #11098 |
| [`[email protected]`](git+https://github.com/inspect-js/has-tostringtag.git) | MIT | clearlydefined |
| [`[email protected]`](https://github.com/iarna/has-unicode) | ISC | clearlydefined |
| [`[email protected]`](https://github.com/mathiasbynens/he.git) | MIT | clearlydefined |
Expand Down Expand Up @@ -652,7 +652,7 @@
| `[email protected]` | ISC | clearlydefined |
| [`[email protected]`](git+https://github.com/isaacs/minipass-sized.git) | ISC | clearlydefined |
| [`[email protected]`](git+https://github.com/isaacs/mkdirp-infer-owner) | ISC | clearlydefined |
| [`mock-socket@9.2.1`](https://github.com/thoov/mock-socket.git) | MIT | clearlydefined |
| [`mock-socket@9.3.1`](https://github.com/thoov/mock-socket.git) | MIT | clearlydefined |
| [`[email protected]`](https://github.com/sindresorhus/modify-values.git) | MIT | clearlydefined |
| [`[email protected]`](https://github.com/lukeed/mrmime.git) | MIT | clearlydefined |
| [`[email protected]`](https://github.com/vercel/ms.git) | MIT | #5895 |
Expand Down Expand Up @@ -763,7 +763,7 @@
| [`[email protected]`](https://github.com/TrySound/postcss-value-parser.git) | MIT | clearlydefined |
| [`[email protected]`](git://github.com/gkz/prelude-ls.git) | MIT | clearlydefined |
| [`[email protected]`](git+https://github.com/prettier/prettier-linter-helpers.git) | MIT | clearlydefined |
| [`[email protected]`](https://github.com/prettier/prettier.git) | MIT | (clearlydefined)[https://clearlydefined.io/definitions/npm/npmjs/-/prettier/3.0.2] |
| [`[email protected]`](https://github.com/prettier/prettier.git) | MIT | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/prettier/3.0.2) |
| [`[email protected]`](https://github.com/AriaMinaei/pretty-error.git) | MIT | clearlydefined |
| [`[email protected]`](https://github.com/jestjs/jest.git) | MIT | clearlydefined |
| [`[email protected]`](https://github.com/npm/proc-log.git) | ISC | clearlydefined |
Expand Down
18 changes: 9 additions & 9 deletions .deps/prod.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
| [`@hapi/[email protected]`](git://github.com/hapijs/wreck) | BSD-3-Clause | clearlydefined |
| [`@kubernetes/[email protected]`](https://github.com/kubernetes-client/javascript.git) | Apache-2.0 | clearlydefined |
| [`@lukeed/[email protected]`](https://github.com/lukeed/ms.git) | MIT | clearlydefined |
| [`@patternfly/[email protected]`](https://github.com/patternfly/patternfly-react.git) | MIT | (clearlydefined)[https://clearlydefined.io/definitions/npm/npmjs/@patternfly/react-core/4.276.11] |
| [`@patternfly/[email protected]`](https://github.com/patternfly/patternfly-react.git) | MIT | (clearlydefined)[https://clearlydefined.io/definitions/npm/npmjs/@patternfly/react-icons/4.93.7] |
| [`@patternfly/[email protected]`](https://github.com/patternfly/patternfly-react.git) | MIT | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/@patternfly/react-core/4.276.11) |
| [`@patternfly/[email protected]`](https://github.com/patternfly/patternfly-react.git) | MIT | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/@patternfly/react-icons/4.93.7) |
| `@patternfly/[email protected]` | MIT | clearlydefined |
| [`@patternfly/[email protected]`](https://github.com/patternfly/patternfly-react.git) | MIT | clearlydefined |
| [`@patternfly/[email protected]`](https://github.com/patternfly/patternfly-react.git) | MIT | clearlydefined |
Expand Down Expand Up @@ -87,7 +87,7 @@
| [`[email protected]`](git://github.com/beatgammit/base64-js.git) | MIT | clearlydefined |
| [`[email protected]`](git://github.com/joyent/node-bcrypt-pbkdf.git) | BSD-3-Clause | #2725 |
| [`[email protected]`](git://github.com/petkaantonov/bluebird.git) | MIT | clearlydefined |
| [`[email protected]`](git://github.com/blueimp/JavaScript-MD5.git) | MIT | (clearlydefined)[https://clearlydefined.io/definitions/npm/npmjs/-/blueimp-md5/2.19.0] |
| [`[email protected]`](git://github.com/blueimp/JavaScript-MD5.git) | MIT | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/blueimp-md5/2.19.0) |
| [`[email protected]`]([email protected]:indutny/bn.js) | MIT | clearlydefined |
| [`[email protected]`](git://github.com/juliangruber/brace-expansion.git) | MIT | clearlydefined |
| [`[email protected]`]([email protected]:indutny/brorand) | MIT | clearlydefined |
Expand All @@ -100,13 +100,13 @@
| [`[email protected]`](git://github.com/feross/buffer.git) | MIT | clearlydefined |
| [`[email protected]`](http://github.com/mscdex/busboy.git) | MIT | clearlydefined |
| [`[email protected]`](https://github.com/jahewson/node-byline) | MIT | clearlydefined |
| [`[email protected]`](git+https://github.com/ljharb/call-bind.git) | MIT | clearlydefined |
| [`[email protected]`](git+https://github.com/ljharb/call-bind.git) | MIT | #11092 |
| [`[email protected]`](https://github.com/sindresorhus/camelcase.git) | MIT | clearlydefined |
| [`[email protected]`](https://github.com/mikeal/caseless) | Apache-2.0 | clearlydefined |
| [`[email protected]`](https://github.com/chalk/chalk.git) | MIT | clearlydefined |
| [`[email protected]`](git://github.com/isaacs/chownr.git) | ISC | clearlydefined |
| [`[email protected]`](git+https://github.com/crypto-browserify/cipher-base.git) | MIT | clearlydefined |
| [`[email protected]`](https://github.com/codemirror/CodeMirror.git) | MIT | (clearlydefined)[https://clearlydefined.io/definitions/npm/npmjs/-/codemirror/5.65.15] |
| [`[email protected]`](https://github.com/codemirror/CodeMirror.git) | MIT | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/codemirror/5.65.15) |
| [`[email protected]`](https://github.com/Qix-/color-convert.git) | MIT | clearlydefined |
| [`[email protected]`]([email protected]:dfcreative/color-name.git) | MIT | clearlydefined |
| [`[email protected]`](https://github.com/jorgebucaran/colorette.git) | MIT | clearlydefined |
Expand Down Expand Up @@ -160,9 +160,9 @@
| [`[email protected]`](git+https://github.com/anonrig/fast-querystring.git) | MIT | clearlydefined |
| [`[email protected]`](git+https://github.com/davidmarkclements/fast-redact.git) | MIT | clearlydefined |
| [`[email protected]`](git+https://github.com/davidmarkclements/fast-safe-stringify.git) | MIT | clearlydefined |
| [`[email protected]`](https://github.com/fastify/fast-uri) | MIT | (clearlydefined)[https://clearlydefined.io/definitions/npm/npmjs/-/fast-uri/2.2.0] |
| [`[email protected]`](https://github.com/fastify/fast-uri) | MIT | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/fast-uri/2.2.0) |
| [`[email protected]`](git+https://github.com/fastify/fastify-plugin.git) | MIT | clearlydefined |
| [`[email protected]`](git+https://github.com/fastify/fastify.git) | MIT | (clearlydefined)[https://clearlydefined.io/definitions/npm/npmjs/-/fastify/4.21.0] |
| [`[email protected]`](git+https://github.com/fastify/fastify.git) | MIT | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/fastify/4.21.0) |
| [`[email protected]`](git+https://github.com/mcollina/fastq.git) | ISC | #6021 |
| [`[email protected]`](https://github.com/react-dropzone/file-selector.git) | MIT | [CQ22350](https://dev.eclipse.org/ipzilla/show_bug.cgi?id=22350) |
| [`[email protected]`](git+https://github.com/delvedor/find-my-way.git) | MIT | clearlydefined |
Expand All @@ -174,7 +174,7 @@
| [`[email protected]`](https://github.com/jprichardson/node-fs-extra) | MIT | #5742 |
| [`[email protected]`](git+https://github.com/npm/fs-minipass.git) | ISC | clearlydefined |
| [`[email protected]`](git+https://github.com/isaacs/fs.realpath.git) | ISC | clearlydefined |
| [`[email protected]`](git://github.com/Raynos/function-bind.git) | MIT | clearlydefined |
| [`[email protected]`](git://github.com/Raynos/function-bind.git) | MIT | #11063 |
| [`[email protected]`](git+https://github.com/ljharb/get-intrinsic.git) | MIT | #8453 |
| [`[email protected]`](https://github.com/arekinath/node-getpass.git) | MIT | clearlydefined |
| [`[email protected]`](git://github.com/isaacs/node-glob.git) | ISC | #7145 |
Expand Down Expand Up @@ -310,7 +310,7 @@
| [`[email protected]`](https://github.com/ReactTooltip/react-tooltip) | MIT | #5006 |
| [`[email protected]`](git+https://github.com/facebook/react.git) | MIT | clearlydefined |
| [`[email protected]`](git://github.com/nodejs/readable-stream) | MIT | [CQ22627](https://dev.eclipse.org/ipzilla/show_bug.cgi?id=22627) |
| [`[email protected]`](git+https://github.com/pinojs/real-require.git) | MIT | (clearlydefined)[https://clearlydefined.io/definitions/npm/npmjs/-/real-require/0.2.0] |
| [`[email protected]`](git+https://github.com/pinojs/real-require.git) | MIT | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/real-require/0.2.0) |
| [`[email protected]`](git+https://github.com/pladaria/reconnecting-websocket.git) | MIT | #940 |
| [`[email protected]`](https://github.com/reduxjs/redux-thunk.git) | MIT | clearlydefined |
| [`[email protected]`](https://github.com/reduxjs/redux.git) | MIT | #7046 |
Expand Down
2 changes: 1 addition & 1 deletion packages/dashboard-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
"identity-obj-proxy": "^3.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.6.4",
"jest-websocket-mock": "^2.4.1",
"jest-websocket-mock": "2.4.1",
"loader-utils": "^3.2.1",
"mini-css-extract-plugin": "^2.7.6",
"null-loader": "^4.0.1",
Expand Down
7 changes: 4 additions & 3 deletions packages/dashboard-frontend/src/services/assets/branding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
* Red Hat, Inc. - initial API and implementation
*/

import axios from 'axios';
import { BrandingData } from '../bootstrap/branding.constant';
import { getAxiosInstance } from '@/services/axios-wrapper/getAxiosInstance';
import { BrandingData } from '@/services/bootstrap/branding.constant';

export async function fetchBranding(url: string): Promise<BrandingData> {
const axiosInstance = getAxiosInstance();
try {
const response = await axios.get<BrandingData>(url);
const response = await axiosInstance.get<BrandingData>(url);
return response.data;
} catch (e) {
throw new Error(`Failed to fetch branding data by URL: ${url}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import mockAxios, { AxiosInstance, AxiosResponse } from 'axios';
import {
AxiosWrapper,
bearerTokenAuthorizationIsRequiredErrorMsg,
} from '@/services/backend-client/axiosWrapper';
} from '@/services/axios-wrapper/axiosWrapper';

// mute console logs
console.log = jest.fn();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
*/

import common from '@eclipse-che/common';
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';

import { getAxiosInstance } from '@/services/axios-wrapper/getAxiosInstance';
import { delay } from '@/services/helpers/delay';

type AxiosFunc = (url: string, config?: AxiosRequestConfig) => Promise<any>;
Expand All @@ -32,11 +33,11 @@ export class AxiosWrapper {
}

static createToRetryMissedBearerTokenError(): AxiosWrapper {
return new AxiosWrapper(axios.create(), bearerTokenAuthorizationIsRequiredErrorMsg);
return new AxiosWrapper(getAxiosInstance(), bearerTokenAuthorizationIsRequiredErrorMsg);
}

static createToRetryAnyErrors(): AxiosWrapper {
return new AxiosWrapper(axios.create());
return new AxiosWrapper(getAxiosInstance());
}

get<T = any, R = AxiosResponse<T>>(url: string, config?: AxiosRequestConfig): Promise<R> {
Expand Down
Loading

0 comments on commit b80c6ba

Please sign in to comment.