@opencloning/ui 1.5.5 → 1.6.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 +24 -0
- package/package.json +10 -3
- package/src/components/assembler/Assembler.jsx +1 -0
- package/src/components/dummy/index.js +1 -0
- package/src/components/sources/FinishedSource.jsx +46 -1
- package/src/components/sources/RecombinaseList.cy.jsx +103 -0
- package/src/components/sources/RecombinaseList.jsx +131 -0
- package/src/components/sources/Source.jsx +2 -0
- package/src/components/sources/SourceAssembly.jsx +42 -17
- package/src/components/sources/SourceTypeSelector.jsx +1 -0
- package/src/hooks/useDatabase.js +2 -17
- package/src/providers/DatabaseContext.jsx +15 -0
- package/src/version.js +1 -1
- package/src/components/eLabFTW/ELabFTWCategorySelect.cy.jsx +0 -86
- package/src/components/eLabFTW/ELabFTWCategorySelect.jsx +0 -43
- package/src/components/eLabFTW/ELabFTWFileSelect.cy.jsx +0 -43
- package/src/components/eLabFTW/ELabFTWFileSelect.jsx +0 -29
- package/src/components/eLabFTW/ELabFTWResourceSelect.cy.jsx +0 -107
- package/src/components/eLabFTW/ELabFTWResourceSelect.jsx +0 -23
- package/src/components/eLabFTW/GetPrimerComponent.cy.jsx +0 -261
- package/src/components/eLabFTW/GetPrimerComponent.jsx +0 -55
- package/src/components/eLabFTW/GetSequenceFileAndDatabaseIdComponent.cy.jsx +0 -184
- package/src/components/eLabFTW/GetSequenceFileAndDatabaseIdComponent.jsx +0 -62
- package/src/components/eLabFTW/LoadHistoryComponent.cy.jsx +0 -235
- package/src/components/eLabFTW/LoadHistoryComponent.jsx +0 -51
- package/src/components/eLabFTW/PrimersNotInDatabaseComponent.cy.jsx +0 -159
- package/src/components/eLabFTW/PrimersNotInDatabaseComponent.jsx +0 -54
- package/src/components/eLabFTW/SubmitToDatabaseComponent.cy.jsx +0 -185
- package/src/components/eLabFTW/SubmitToDatabaseComponent.jsx +0 -51
- package/src/components/eLabFTW/common.js +0 -26
- package/src/components/eLabFTW/eLabFTWInterface.js +0 -293
- package/src/components/eLabFTW/eLabFTWInterface.test.js +0 -839
- package/src/components/eLabFTW/envValues.js +0 -7
- package/src/components/eLabFTW/utils.js +0 -30
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/* v8 ignore start */
|
|
2
|
-
|
|
3
|
-
export const writeApiKey = import.meta.env.VITE_ELABFTW_API_WRITE_KEY || '';
|
|
4
|
-
export const readApiKey = import.meta.env.VITE_ELABFTW_API_READ_KEY || '';
|
|
5
|
-
export const baseUrl = import.meta.env.VITE_ELABFTW_BASE_URL || '';
|
|
6
|
-
|
|
7
|
-
/* v8 ignore end */
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// These functions are here because they are used across files,
|
|
2
|
-
// so including them in eLabFTWInterface.js would make circular dependencies.
|
|
3
|
-
// They are not included in common.js to be able to mock eLabFTWHttpClient in tests.
|
|
4
|
-
import { eLabFTWHttpClient, readHeaders } from './common';
|
|
5
|
-
|
|
6
|
-
export function error2String(error) {
|
|
7
|
-
if (error.code === 'ERR_NETWORK') { return 'Network error: Cannot connect to eLabFTW'; }
|
|
8
|
-
if (!error.code) {
|
|
9
|
-
return error.message || 'Internal error, please contact the developers.';
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
if (error.response.status === 500) return 'Internal server error';
|
|
13
|
-
const { description } = error.response.data;
|
|
14
|
-
if (typeof description === 'string') {
|
|
15
|
-
return description;
|
|
16
|
-
}
|
|
17
|
-
return 'Request error, please contact the developers.';
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export const getFileFromELabFTW = async (itemId, fileInfo) => {
|
|
21
|
-
const url = `/api/v2/items/${itemId}/uploads/${fileInfo.id}?format=binary`;
|
|
22
|
-
try {
|
|
23
|
-
const resp = await eLabFTWHttpClient.get(url, { headers: readHeaders, responseType: 'blob' });
|
|
24
|
-
// Convert blob to file
|
|
25
|
-
return new File([resp.data], fileInfo.real_name);
|
|
26
|
-
} catch (e) {
|
|
27
|
-
console.error(e);
|
|
28
|
-
throw new Error(`${error2String(e)}`);
|
|
29
|
-
}
|
|
30
|
-
};
|