@opencloning/ui 1.8.1 → 1.9.1

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,37 @@
1
1
  # @opencloning/ui
2
2
 
3
+ ## 1.9.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#715](https://github.com/OpenCloning/OpenCloning_frontend/pull/715) [`e4d9515`](https://github.com/OpenCloning/OpenCloning_frontend/commit/e4d9515a7f6fcad09e5c196f3cb090f70fe3a156) Thanks [@manulera](https://github.com/manulera)! - Allow to copy features when editing annotation
8
+
9
+ - Updated dependencies []:
10
+ - @opencloning/store@1.9.1
11
+ - @opencloning/utils@1.9.1
12
+
13
+ ## 1.9.0
14
+
15
+ ### Minor Changes
16
+
17
+ - [#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
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies [[`6813620`](https://github.com/OpenCloning/OpenCloning_frontend/commit/6813620f4a47c44857045866d667474efbf9a64c)]:
22
+ - @opencloning/utils@1.9.0
23
+ - @opencloning/store@1.9.0
24
+
25
+ ## 1.8.2
26
+
27
+ ### Patch Changes
28
+
29
+ - [#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
30
+
31
+ - Updated dependencies []:
32
+ - @opencloning/store@1.8.2
33
+ - @opencloning/utils@1.8.2
34
+
3
35
  ## 1.8.1
4
36
 
5
37
  ### 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.1",
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.1",
43
+ "@opencloning/utils": "1.9.1",
44
44
  "@teselagen/bio-parsers": "^0.4.38",
45
45
  "@teselagen/ove": "^0.8.42",
46
46
  "@teselagen/range-utils": "^0.3.20",
@@ -73,6 +73,18 @@ function MainSequenceEditor() {
73
73
  "--",
74
74
  "editFeature",
75
75
  "deleteFeature",
76
+ {
77
+ text: "Duplicate Feature",
78
+ disabled: props.readOnly,
79
+ onClick: () => {
80
+ const { id, ...rest } = annotation;
81
+ props.upsertFeature({
82
+ ...rest,
83
+ // omit id → upsertDeleteActionGenerator assigns a new shortid
84
+ name: annotation.name ? `${annotation.name} (copy)` : undefined,
85
+ });
86
+ },
87
+ },
76
88
  "showRemoveDuplicatesDialogFeatures",
77
89
  "--",
78
90
  "toggleCdsFeatureTranslations",
@@ -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.1";