@opencloning/ui 2.1.0 → 2.1.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 +10 -0
- package/package.json +3 -3
- package/src/hooks/useUrlParamsLoader.js +24 -0
- package/src/version.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @opencloning/ui
|
|
2
2
|
|
|
3
|
+
## 2.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#790](https://github.com/OpenCloning/OpenCloning_frontend/pull/790) [`0b2a21d`](https://github.com/OpenCloning/OpenCloning_frontend/commit/0b2a21dde79f5539579bee39f0de49b01cd6c10c) Thanks [@manulera](https://github.com/manulera)! - Support for fetchin sequences created by the OC mcp server
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`0b2a21d`](https://github.com/OpenCloning/OpenCloning_frontend/commit/0b2a21dde79f5539579bee39f0de49b01cd6c10c)]:
|
|
10
|
+
- @opencloning/utils@2.1.1
|
|
11
|
+
- @opencloning/store@2.1.1
|
|
12
|
+
|
|
3
13
|
## 2.1.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"license": "MIT",
|
|
3
3
|
"name": "@opencloning/ui",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
7
7
|
"scripts": {
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"@mui/icons-material": "^5.18.0",
|
|
41
41
|
"@mui/material": "^5.18.0",
|
|
42
42
|
"@mui/x-data-grid": "^8.28.5",
|
|
43
|
-
"@opencloning/store": "2.1.
|
|
44
|
-
"@opencloning/utils": "2.1.
|
|
43
|
+
"@opencloning/store": "2.1.1",
|
|
44
|
+
"@opencloning/utils": "2.1.1",
|
|
45
45
|
"@teselagen/bio-parsers": "^0.4.38",
|
|
46
46
|
"@teselagen/ove": "^0.8.42",
|
|
47
47
|
"@teselagen/range-utils": "^0.3.20",
|
|
@@ -16,6 +16,9 @@ const httpClient = getExternalHttpClient();
|
|
|
16
16
|
|
|
17
17
|
const { updateSource } = cloningActions;
|
|
18
18
|
|
|
19
|
+
// OpenCloning MCP server, set at build time
|
|
20
|
+
const mcpUrl = import.meta.env.VITE_MCP_SERVER_URL;
|
|
21
|
+
|
|
19
22
|
/**
|
|
20
23
|
* Hook to load sequences from URL parameters
|
|
21
24
|
* Handles various source types: database, example, template, genome_coordinates, locus_tag
|
|
@@ -75,6 +78,27 @@ export default function useUrlParamsLoader() {
|
|
|
75
78
|
});
|
|
76
79
|
console.error(error);
|
|
77
80
|
}
|
|
81
|
+
} else if (urlParams.source === 'mcp' && urlParams.strategy) {
|
|
82
|
+
// Only the MCP server set at build time (VITE_MCP_SERVER_URL) is fetched from, never a url from the query
|
|
83
|
+
try {
|
|
84
|
+
if (!mcpUrl) {
|
|
85
|
+
throw new Error('No MCP server configured');
|
|
86
|
+
}
|
|
87
|
+
if (!/^[A-Za-z0-9_-]+$/.test(urlParams.strategy)) {
|
|
88
|
+
throw new Error('Invalid strategy id');
|
|
89
|
+
}
|
|
90
|
+
const url = `${mcpUrl.replace(/\/$/, '')}/strategies/${encodePathSegment(urlParams.strategy)}.json`;
|
|
91
|
+
const resp = await httpClient.get(url);
|
|
92
|
+
const file = new File([JSON.stringify(resp.data)], 'mcp_strategy.json');
|
|
93
|
+
const prepared = await loadHistoryFromFile(file, { onError: setHistoryFileError });
|
|
94
|
+
await prepared?.replace();
|
|
95
|
+
} catch (error) {
|
|
96
|
+
addAlert({
|
|
97
|
+
message: 'Error loading strategy from the MCP server (it may have expired or not exist)',
|
|
98
|
+
severity: 'error',
|
|
99
|
+
});
|
|
100
|
+
console.error(error);
|
|
101
|
+
}
|
|
78
102
|
} else if (urlParams.source === 'template' && urlParams.template && urlParams.key) {
|
|
79
103
|
try {
|
|
80
104
|
const baseUrl = 'https://assets.opencloning.org/OpenCloning-submission';
|
package/src/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Version placeholder - replaced at publish time via prepack script
|
|
2
|
-
export const version = "2.1.
|
|
2
|
+
export const version = "2.1.1";
|