@abi-software/map-side-bar 2.3.2-beta.0 → 2.3.2-beta.2
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/dist/map-side-bar.js +80 -40
- package/dist/map-side-bar.umd.cjs +18 -7
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/components/ConnectivityInfo.vue +48 -20
- package/src/components/DatasetCard.vue +40 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abi-software/map-side-bar",
|
|
3
|
-
"version": "2.3.2-beta.
|
|
3
|
+
"version": "2.3.2-beta.2",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist/*",
|
|
6
6
|
"src/*",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@abi-software/gallery": "^1.1.1",
|
|
42
|
-
"@abi-software/map-utilities": "^1.0.1-beta.
|
|
42
|
+
"@abi-software/map-utilities": "^1.0.1-beta.2",
|
|
43
43
|
"@abi-software/svg-sprite": "^1.0.0",
|
|
44
44
|
"@element-plus/icons-vue": "^2.3.1",
|
|
45
45
|
"algoliasearch": "^4.10.5",
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
|
|
178
178
|
<!-- Copy to clipboard button container -->
|
|
179
179
|
<div class="float-button-container">
|
|
180
|
-
<CopyToClipboard :content="
|
|
180
|
+
<CopyToClipboard :content="updatedCopyContent" />
|
|
181
181
|
</div>
|
|
182
182
|
</div>
|
|
183
183
|
</template>
|
|
@@ -256,12 +256,8 @@ export default {
|
|
|
256
256
|
},
|
|
257
257
|
componentsWithDatasets: [],
|
|
258
258
|
uberons: [{ id: undefined, name: undefined }],
|
|
259
|
-
copyContent: '',
|
|
260
259
|
}
|
|
261
260
|
},
|
|
262
|
-
mounted: function () {
|
|
263
|
-
this.updateCopyContent();
|
|
264
|
-
},
|
|
265
261
|
watch: {
|
|
266
262
|
availableAnatomyFacets: {
|
|
267
263
|
handler: function (val) {
|
|
@@ -272,6 +268,9 @@ export default {
|
|
|
272
268
|
},
|
|
273
269
|
},
|
|
274
270
|
computed: {
|
|
271
|
+
updatedCopyContent: function () {
|
|
272
|
+
return this.getUpdateCopyContent();
|
|
273
|
+
},
|
|
275
274
|
resources: function () {
|
|
276
275
|
let resources = [];
|
|
277
276
|
if (this.entry && this.entry.hyperlinks) {
|
|
@@ -359,54 +358,83 @@ export default {
|
|
|
359
358
|
// connected to flatmapvuer > moveMap(featureIds) function
|
|
360
359
|
this.$emit('show-connectivity', featureIds);
|
|
361
360
|
},
|
|
362
|
-
|
|
361
|
+
getUpdateCopyContent: function () {
|
|
362
|
+
if (!this.entry) {
|
|
363
|
+
return '';
|
|
364
|
+
}
|
|
365
|
+
|
|
363
366
|
const contentArray = [];
|
|
364
367
|
|
|
368
|
+
// Use <div> instead of <h1>..<h6> or <p>
|
|
369
|
+
// to avoid default formatting on font size and margin
|
|
370
|
+
|
|
365
371
|
// Title
|
|
366
372
|
if (this.entry.title) {
|
|
367
|
-
contentArray.push(capitalise(this.entry.title));
|
|
373
|
+
contentArray.push(`<div><strong>${capitalise(this.entry.title)}</strong></div>`);
|
|
368
374
|
} else {
|
|
369
|
-
contentArray.push(this.entry.featureId);
|
|
375
|
+
contentArray.push(`<div><strong>${this.entry.featureId}</strong></div>`);
|
|
370
376
|
}
|
|
371
377
|
|
|
372
378
|
// Description
|
|
373
379
|
if (this.entry.provenanceTaxonomyLabel?.length) {
|
|
374
|
-
contentArray.push(this.provSpeciesDescription);
|
|
380
|
+
contentArray.push(`<div>${this.provSpeciesDescription}</div>`);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
// PubMed URL
|
|
384
|
+
if (this.resources?.length) {
|
|
385
|
+
const pubmedContents = [];
|
|
386
|
+
this.resources.forEach((resource) => {
|
|
387
|
+
let pubmedContent = '';
|
|
388
|
+
if (resource.id === 'pubmed') {
|
|
389
|
+
pubmedContent += `<div><strong>PubMed URL:</strong></div>`;
|
|
390
|
+
pubmedContent += '\n';
|
|
391
|
+
pubmedContent += `<div><a href="${resource.url}">${resource.url}</a></div>`;
|
|
392
|
+
}
|
|
393
|
+
pubmedContents.push(pubmedContent);
|
|
394
|
+
});
|
|
395
|
+
contentArray.push(pubmedContents.join('\n\n<br>'));
|
|
375
396
|
}
|
|
376
397
|
|
|
377
398
|
// entry.paths
|
|
378
399
|
if (this.entry.paths) {
|
|
379
|
-
contentArray.push(this.entry.paths);
|
|
400
|
+
contentArray.push(`<div>${this.entry.paths}</div>`);
|
|
380
401
|
}
|
|
381
402
|
|
|
382
403
|
// Origins
|
|
383
404
|
if (this.entry.origins?.length) {
|
|
384
|
-
|
|
405
|
+
let originsContent = '<div><strong>Origin</strong></div>';
|
|
385
406
|
const origins = this.entry.origins
|
|
386
|
-
.map((item) => capitalise(item))
|
|
407
|
+
.map((item) => `<li>${capitalise(item)}</li>`)
|
|
387
408
|
.join('\n');
|
|
388
|
-
|
|
409
|
+
originsContent += '\n';
|
|
410
|
+
originsContent += `<ul>${origins}</ul>`;
|
|
411
|
+
contentArray.push(originsContent);
|
|
389
412
|
}
|
|
390
413
|
|
|
391
414
|
// Components
|
|
392
415
|
if (this.entry.components?.length) {
|
|
393
|
-
contentArray.push(
|
|
416
|
+
contentArray.push();
|
|
417
|
+
let componentsContent = '<div><strong>Components</strong></div>';
|
|
394
418
|
const components = this.entry.components
|
|
395
|
-
.map((item) => capitalise(item))
|
|
419
|
+
.map((item) => `<li>${capitalise(item)}</li>`)
|
|
396
420
|
.join('\n');
|
|
397
|
-
|
|
421
|
+
componentsContent += '\n';
|
|
422
|
+
componentsContent += `<ul>${components}</ul>`;
|
|
423
|
+
contentArray.push(componentsContent);
|
|
398
424
|
}
|
|
399
425
|
|
|
400
426
|
// Destination
|
|
401
427
|
if (this.entry.destinations?.length) {
|
|
402
|
-
|
|
428
|
+
let destinationsContent = '<div><strong>Destination</strong></div>';
|
|
403
429
|
const destinations = this.entry.destinations
|
|
404
|
-
.map((item) => capitalise(item))
|
|
430
|
+
.map((item) => `<li>${capitalise(item)}</li>`)
|
|
405
431
|
.join('\n');
|
|
406
|
-
|
|
432
|
+
destinationsContent += '\n';
|
|
433
|
+
destinationsContent += `<ul>${destinations}</ul>`;
|
|
434
|
+
contentArray.push(destinationsContent);
|
|
407
435
|
}
|
|
408
436
|
|
|
409
|
-
|
|
437
|
+
return contentArray.join('\n\n<br>');
|
|
410
438
|
},
|
|
411
439
|
},
|
|
412
440
|
}
|
|
@@ -238,6 +238,7 @@ export default {
|
|
|
238
238
|
this.dataLocation = `https://sparc.science/datasets/${data.id}?type=dataset`
|
|
239
239
|
this.getBiolucidaInfo(this.discoverId)
|
|
240
240
|
this.loading = false
|
|
241
|
+
this.updateCopyContent();
|
|
241
242
|
})
|
|
242
243
|
.catch(() => {
|
|
243
244
|
//set defaults if we hit an error
|
|
@@ -263,9 +264,12 @@ export default {
|
|
|
263
264
|
updateCopyContent: function () {
|
|
264
265
|
const contentArray = [];
|
|
265
266
|
|
|
267
|
+
// Use <div> instead of <h1>..<h6> or <p>
|
|
268
|
+
// to avoid default formatting on font size and margin
|
|
269
|
+
|
|
266
270
|
// Title
|
|
267
271
|
if (this.entry.name) {
|
|
268
|
-
contentArray.push(this.entry.name);
|
|
272
|
+
contentArray.push(`<div><strong>${this.entry.name}</strong></div>`);
|
|
269
273
|
}
|
|
270
274
|
|
|
271
275
|
// Contributors and Publish Date
|
|
@@ -275,15 +279,47 @@ export default {
|
|
|
275
279
|
if (this.entry.publishDate) {
|
|
276
280
|
details += ` (${this.publishYear})`;
|
|
277
281
|
}
|
|
278
|
-
contentArray.push(details);
|
|
282
|
+
contentArray.push(`<div>${details}</div>`);
|
|
279
283
|
}
|
|
280
284
|
|
|
281
285
|
// samples
|
|
282
286
|
if (this.samples) {
|
|
283
|
-
contentArray.push(this.samples);
|
|
287
|
+
contentArray.push(`<div>${this.samples}</div>`);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// DOI
|
|
291
|
+
if (this.entry.doi) {
|
|
292
|
+
let doiContent = `<div><strong>DOI:</strong></div>`;
|
|
293
|
+
doiContent += `\n`;
|
|
294
|
+
doiContent += `<a href="${this.entry.doi}">${this.entry.doi}</a>`;
|
|
295
|
+
contentArray.push(`<div>${doiContent}</div>`);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// Dataset ID
|
|
299
|
+
if (this.entry.datasetId) {
|
|
300
|
+
let datasetIdContent = `<div><strong>Dataset ID:</strong></div>`;
|
|
301
|
+
datasetIdContent += `\n`;
|
|
302
|
+
datasetIdContent += `${this.entry.datasetId}`;
|
|
303
|
+
contentArray.push(`<div>${datasetIdContent}</div>`);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// Dataset URL
|
|
307
|
+
if (this.dataLocation) {
|
|
308
|
+
let dataLocationContent = `<div><strong>Dataset URL:</strong></div>`;
|
|
309
|
+
dataLocationContent += `\n`;
|
|
310
|
+
dataLocationContent += `<a href="${this.dataLocation}">${this.dataLocation}</a>`;
|
|
311
|
+
contentArray.push(`<div>${dataLocationContent}</div>`);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// Dataset version
|
|
315
|
+
if (this.version) {
|
|
316
|
+
let versionContent = `<div><strong>Dataset version:</strong></div>`;
|
|
317
|
+
versionContent += `\n`;
|
|
318
|
+
versionContent += `${this.version}`;
|
|
319
|
+
contentArray.push(`<div>${versionContent}</div>`);
|
|
284
320
|
}
|
|
285
321
|
|
|
286
|
-
this.copyContent = contentArray.join('\n\n');
|
|
322
|
+
this.copyContent = contentArray.join('\n\n<br>');
|
|
287
323
|
},
|
|
288
324
|
},
|
|
289
325
|
created: function () {
|