@opencloning/ui 1.4.9 → 1.4.10

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,15 @@
1
1
  # @opencloning/ui
2
2
 
3
+ ## 1.4.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [#642](https://github.com/manulera/OpenCloning_frontend/pull/642) [`3028e98`](https://github.com/manulera/OpenCloning_frontend/commit/3028e98b60be89288327cc1b6dac87cb2479a3c7) Thanks [@manulera](https://github.com/manulera)! - When downloading from assembler, if name is too long change to id_construct
8
+
9
+ - Updated dependencies []:
10
+ - @opencloning/store@1.4.10
11
+ - @opencloning/utils@1.4.10
12
+
3
13
  ## 1.4.9
4
14
 
5
15
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencloning/ui",
3
- "version": "1.4.9",
3
+ "version": "1.4.10",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {
@@ -25,8 +25,8 @@
25
25
  "@emotion/styled": "^11.14.0",
26
26
  "@mui/icons-material": "^5.15.17",
27
27
  "@mui/material": "^5.15.17",
28
- "@opencloning/store": "1.4.9",
29
- "@opencloning/utils": "1.4.9",
28
+ "@opencloning/store": "1.4.10",
29
+ "@opencloning/utils": "1.4.10",
30
30
  "@teselagen/bio-parsers": "^0.4.34",
31
31
  "@teselagen/ove": "^0.8.34",
32
32
  "@teselagen/range-utils": "^0.3.20",
@@ -168,7 +168,10 @@ export function getFilesToExportFromAssembler({requestedAssemblies, expandedAsse
168
168
  }
169
169
 
170
170
  for (let i = 0; i < requestedAssemblies.length; i++) {
171
- const name = `${String(i + 1).padStart(3, '0')}_${assemblyNames[i].slice(1).join('+')}`;
171
+ let name = `${String(i + 1).padStart(3, '0')}_${assemblyNames[i].slice(1).join('+')}`;
172
+ if (name.length > 255) {
173
+ name = `${String(i + 1).padStart(3, '0')}_construct`;
174
+ }
172
175
  const requestedAssembly = requestedAssemblies[i];
173
176
  const jsonContent = formatStateForJsonExport({...requestedAssembly, appInfo});
174
177
  files2Export.push({
@@ -285,8 +285,8 @@ const dummyData = {
285
285
 
286
286
 
287
287
 
288
- describe('getZipFileFromAssemblies', () => {
289
- it('returns a zip file', () => {
288
+ describe('getFilesToExportFromAssembler', () => {
289
+ it('returns the correct files', () => {
290
290
  const files = getFilesToExportFromAssembler(dummyData);
291
291
  expect(files[0].name).toBe('assemblies.tsv');
292
292
  expect(files[0].content).toBe('Assembly\tCategory 1\tCategory 2\tCategory 3\n1\tp1\tp5\tp7\n2\tp1\tp2\tp3');
@@ -310,4 +310,15 @@ describe('getZipFileFromAssemblies', () => {
310
310
 
311
311
 
312
312
  })
313
+ it('changes name if file names are too long', () => {
314
+ const dummyData2 = {
315
+ ...dummyData,
316
+ plasmids: dummyData.plasmids.map(plasmid => ({...plasmid, plasmid_name: 'p1'.repeat(100)})),
317
+ }
318
+ const files = getFilesToExportFromAssembler(dummyData2);
319
+ expect(files[2].name).toBe('001_construct.json');
320
+ expect(files[3].name).toBe('001_construct.gbk');
321
+ expect(files[4].name).toBe('002_construct.json');
322
+ expect(files[5].name).toBe('002_construct.gbk');
323
+ })
313
324
  })
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.4.9";
2
+ export const version = "1.4.10";