@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.
Files changed (34) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/package.json +10 -3
  3. package/src/components/assembler/Assembler.jsx +1 -0
  4. package/src/components/dummy/index.js +1 -0
  5. package/src/components/sources/FinishedSource.jsx +46 -1
  6. package/src/components/sources/RecombinaseList.cy.jsx +103 -0
  7. package/src/components/sources/RecombinaseList.jsx +131 -0
  8. package/src/components/sources/Source.jsx +2 -0
  9. package/src/components/sources/SourceAssembly.jsx +42 -17
  10. package/src/components/sources/SourceTypeSelector.jsx +1 -0
  11. package/src/hooks/useDatabase.js +2 -17
  12. package/src/providers/DatabaseContext.jsx +15 -0
  13. package/src/version.js +1 -1
  14. package/src/components/eLabFTW/ELabFTWCategorySelect.cy.jsx +0 -86
  15. package/src/components/eLabFTW/ELabFTWCategorySelect.jsx +0 -43
  16. package/src/components/eLabFTW/ELabFTWFileSelect.cy.jsx +0 -43
  17. package/src/components/eLabFTW/ELabFTWFileSelect.jsx +0 -29
  18. package/src/components/eLabFTW/ELabFTWResourceSelect.cy.jsx +0 -107
  19. package/src/components/eLabFTW/ELabFTWResourceSelect.jsx +0 -23
  20. package/src/components/eLabFTW/GetPrimerComponent.cy.jsx +0 -261
  21. package/src/components/eLabFTW/GetPrimerComponent.jsx +0 -55
  22. package/src/components/eLabFTW/GetSequenceFileAndDatabaseIdComponent.cy.jsx +0 -184
  23. package/src/components/eLabFTW/GetSequenceFileAndDatabaseIdComponent.jsx +0 -62
  24. package/src/components/eLabFTW/LoadHistoryComponent.cy.jsx +0 -235
  25. package/src/components/eLabFTW/LoadHistoryComponent.jsx +0 -51
  26. package/src/components/eLabFTW/PrimersNotInDatabaseComponent.cy.jsx +0 -159
  27. package/src/components/eLabFTW/PrimersNotInDatabaseComponent.jsx +0 -54
  28. package/src/components/eLabFTW/SubmitToDatabaseComponent.cy.jsx +0 -185
  29. package/src/components/eLabFTW/SubmitToDatabaseComponent.jsx +0 -51
  30. package/src/components/eLabFTW/common.js +0 -26
  31. package/src/components/eLabFTW/eLabFTWInterface.js +0 -293
  32. package/src/components/eLabFTW/eLabFTWInterface.test.js +0 -839
  33. package/src/components/eLabFTW/envValues.js +0 -7
  34. 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
- };