@opencloning/ui 1.8.1 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @opencloning/ui
2
2
 
3
+ ## 1.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#711](https://github.com/OpenCloning/OpenCloning_frontend/pull/711) [`6813620`](https://github.com/OpenCloning/OpenCloning_frontend/commit/6813620f4a47c44857045866d667474efbf9a64c) Thanks [@manulera](https://github.com/manulera)! - Use authentication for cloning endpoints in opencloning-db
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [[`6813620`](https://github.com/OpenCloning/OpenCloning_frontend/commit/6813620f4a47c44857045866d667474efbf9a64c)]:
12
+ - @opencloning/utils@1.9.0
13
+ - @opencloning/store@1.9.0
14
+
15
+ ## 1.8.2
16
+
17
+ ### Patch Changes
18
+
19
+ - [#709](https://github.com/OpenCloning/OpenCloning_frontend/pull/709) [`08144c0`](https://github.com/OpenCloning/OpenCloning_frontend/commit/08144c085cb5da37e902edc1a3b9c593c58ab680) Thanks [@manulera](https://github.com/manulera)! - Fix QueryStatusWrapper and its effect on SequenceDetailPage
20
+
21
+ - Updated dependencies []:
22
+ - @opencloning/store@1.8.2
23
+ - @opencloning/utils@1.8.2
24
+
3
25
  ## 1.8.1
4
26
 
5
27
  ### Patch Changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "license": "MIT",
3
3
  "name": "@opencloning/ui",
4
- "version": "1.8.1",
4
+ "version": "1.9.0",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
7
7
  "scripts": {
@@ -39,8 +39,8 @@
39
39
  "@mui/icons-material": "^5.18.0",
40
40
  "@mui/material": "^5.18.0",
41
41
  "@mui/x-data-grid": "^8.28.5",
42
- "@opencloning/store": "1.8.1",
43
- "@opencloning/utils": "1.8.1",
42
+ "@opencloning/store": "1.9.0",
43
+ "@opencloning/utils": "1.9.0",
44
44
  "@teselagen/bio-parsers": "^0.4.38",
45
45
  "@teselagen/ove": "^0.8.42",
46
46
  "@teselagen/range-utils": "^0.3.20",
@@ -9,8 +9,7 @@ export default function QueryStatusWrapper({
9
9
  errorMessage = 'Could not load options',
10
10
  renderIfLoading = false,
11
11
  }) {
12
- const { isLoading, isError, refetch } = queryResult;
13
-
12
+ const { isError, isSuccess, refetch } = queryResult;
14
13
  if (isError) {
15
14
  return (
16
15
  <RetryAlert onRetry={refetch} sx={{ alignItems: 'center' }}>
@@ -18,14 +17,12 @@ export default function QueryStatusWrapper({
18
17
  </RetryAlert>
19
18
  );
20
19
  }
21
-
22
- if (isLoading && !renderIfLoading) {
20
+ if (!isSuccess && !renderIfLoading) {
23
21
  return (
24
22
  <Alert severity="info" icon={<CircularProgress color="inherit" size="1em" />}>
25
23
  {loadingMessage}
26
24
  </Alert>
27
25
  );
28
26
  }
29
-
30
27
  return children;
31
28
  }
@@ -1,18 +1,20 @@
1
1
  import React from 'react';
2
- import getHttpClient from '@opencloning/utils/getHttpClient';
2
+ import getHttpClient, { getAuthenticatedHttpClient } from '@opencloning/utils/getHttpClient';
3
3
  import { useConfig } from './useConfig';
4
4
 
5
5
  export default function useHttpClient() {
6
- const { backendUrl } = useConfig();
6
+ const { backendUrl, requiresBackendAuth = false } = useConfig();
7
7
 
8
8
  // Memoize the client creation and interceptor setup
9
9
  const apiClient = React.useMemo(() => {
10
+ const createHttpClient = requiresBackendAuth ? getAuthenticatedHttpClient : getHttpClient;
11
+
10
12
  if (!backendUrl) {
11
13
  // Return a client without backend URL if config not loaded yet
12
- return getHttpClient([]);
14
+ return createHttpClient([]);
13
15
  }
14
- return getHttpClient([backendUrl]);
15
- }, [backendUrl]);
16
+ return createHttpClient([backendUrl]);
17
+ }, [backendUrl, requiresBackendAuth]);
16
18
 
17
19
  return apiClient;
18
20
  }
@@ -33,6 +33,7 @@ export function ConfigProvider({ config, children }) {
33
33
  * - showAppBar: boolean
34
34
  * - enableAssembler: boolean
35
35
  * - enablePlannotate: boolean
36
+ * - requiresBackendAuth: boolean
36
37
  * - noExternalRequests: boolean
37
38
  * - database: string | null
38
39
  *
package/src/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Version placeholder - replaced at publish time via prepack script
2
- export const version = "1.8.1";
2
+ export const version = "1.9.0";