@abi-software/map-utilities 1.2.2-beta.0 → 1.2.2-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/map-utilities",
3
- "version": "1.2.2-beta.0",
3
+ "version": "1.2.2-beta.1",
4
4
  "files": [
5
5
  "dist/*",
6
6
  "src/*",
@@ -3,7 +3,9 @@
3
3
  <div class="block">
4
4
  <el-row class="info-field">
5
5
  <div class="title">Feature Annotations</div>
6
- <copy-to-clipboard :content="updatedCopyContent" />
6
+ <div class="title-buttons">
7
+ <copy-to-clipboard :content="updatedCopyContent" />
8
+ </div>
7
9
  </el-row>
8
10
  <template v-if="annotationEntry">
9
11
  <el-row
@@ -46,11 +48,15 @@
46
48
  <el-row class="dialog-text">
47
49
  <strong>Evidence: </strong>
48
50
  <el-row
49
- v-for="evidence in sub.body.evidence"
51
+ v-for="(evidence, index) in sub.body.evidence"
50
52
  :key="evidence"
51
53
  class="dialog-text"
52
- >
53
- <a :href="evidence" target="_blank"> {{ evidence }}</a>
54
+ >
55
+ <a v-if="typeof evidence === 'object' ":href="Object.values(evidence)[0]" target="_blank">
56
+ {{ Object.keys(evidence)[0] }}
57
+ </a>
58
+ <span v-else> {{ evidence }}</span>
59
+ <span v-if="index !== sub.body.evidence.length - 1">, </span>
54
60
  </el-row>
55
61
  </el-row>
56
62
  <el-row class="dialog-text">
@@ -102,18 +108,17 @@
102
108
  <el-select
103
109
  :teleported="false"
104
110
  v-model="evidencePrefix"
105
- placeholder="No Prefix"
111
+ placeholder="Other:"
106
112
  class="select-box"
107
113
  popper-class="flatmap_dropdown"
108
114
  >
109
115
  <el-option
110
116
  v-for="item in evidencePrefixes"
111
- :key="item"
112
- :label="item"
113
- :value="item"
117
+ :key="item.label"
118
+ :value="item.value"
114
119
  >
115
120
  <el-row>
116
- <el-col :span="12">{{ item }}</el-col>
121
+ <el-col :span="12">{{ item.label }}</el-col>
117
122
  </el-row>
118
123
  </el-option>
119
124
  </el-select>
@@ -167,8 +172,12 @@ export default {
167
172
  Resource: "resourceId",
168
173
  },
169
174
  editing: false,
170
- evidencePrefixes: ["", "DOI:", "PMID:"],
171
- evidencePrefix: "",
175
+ evidencePrefixes: [
176
+ { value: "DOI:", label: "DOI:" },
177
+ { value: "PMID:", label: "PMID:" },
178
+ { value: "", label: "Other:" },
179
+ ],
180
+ evidencePrefix: "DOI:",
172
181
  evidence: [],
173
182
  authenticated: false,
174
183
  newEvidence: "",
@@ -270,18 +279,20 @@ export default {
270
279
  this.annotationEntry["featureId"]
271
280
  ) {
272
281
  const evidenceURLs = [];
273
- this.evidence.forEach((evidence) => {
274
- if (evidence.includes("DOI:")) {
275
- const link = evidence.replace("DOI:", "https://doi.org/");
276
- evidenceURLs.push(new URL(link));
277
- } else if (evidence.includes("PMID:")) {
278
- const link = evidence.replace(
282
+ this.evidence.forEach((evi) => {
283
+ let eviObject = {}
284
+ if (evi.includes("DOI:")) {
285
+ eviObject[evi] = evi.replace("DOI:", "https://doi.org/");
286
+ } else if (evi.includes("PMID:")) {
287
+ eviObject[evi] = evi.replace(
279
288
  "PMID:",
280
289
  "https://pubmed.ncbi.nlm.nih.gov/"
281
290
  );
282
- evidenceURLs.push(new URL(link));
291
+ }
292
+ if (evi in eviObject) {
293
+ evidenceURLs.push(eviObject);
283
294
  } else {
284
- evidenceURLs.push(evidence);
295
+ evidenceURLs.push(evi);
285
296
  }
286
297
  });
287
298
  const userAnnotation = {
@@ -364,8 +375,15 @@ export default {
364
375
  this.prevSubs.map((sub, index) => {
365
376
  annotationContent += `<div><strong>Created:</strong>${this.formatTime(sub.created)}</div>\n<br>`;
366
377
  annotationContent += `<div><strong>Creator:</strong>${sub.creator.name}</div>\n<br>`;
367
- annotationContent += `<div><strong>Contact:</strong>${sub.creator.email}</div>\n<br>`;
368
- annotationContent += `<div><strong>Evidence:</strong>${sub.body.evidence.join(', ')}</div>\n<br>`;
378
+ annotationContent += `<div><strong>Email:</strong>${sub.creator.email}</div>\n<br>`;
379
+ if (sub.body.evidence.length) {
380
+ let evidenceContent = '';
381
+ sub.body.evidence.forEach((evi, index) => {
382
+ evidenceContent += `${typeof evi === 'object' ? Object.values(evi)[0] : evi}`;
383
+ if (index !== sub.body.evidence.length - 1) evidenceContent += ', ';
384
+ })
385
+ annotationContent += `<div><strong>Evidence:</strong>${evidenceContent}</div>\n<br>`;
386
+ }
369
387
  annotationContent += `<div><strong>Comment:</strong>${sub.body.comment}</div>\n<br>`;
370
388
  })
371
389
  contentArray.push(`<div>${annotationContent}</div>`);
@@ -403,7 +421,11 @@ export default {
403
421
 
404
422
  <style lang="scss" scoped>
405
423
  .info-field {
424
+ padding: 0;
406
425
  display: flex;
426
+ flex-direction: row;
427
+ justify-content: space-between;
428
+ gap: 1rem;
407
429
  }
408
430
 
409
431
  .block {
@@ -462,7 +484,22 @@ export default {
462
484
  font-weight: 500;
463
485
  font-weight: bold;
464
486
  padding-bottom: 8px;
465
- color: rgb(131, 0, 191);
487
+ color: $app-primary-color;
488
+ }
489
+
490
+ .title-buttons {
491
+ display: flex;
492
+ flex-direction: row;
493
+ gap: 0.5rem;
494
+
495
+ :deep(.copy-clipboard-button) {
496
+ &,
497
+ &:hover,
498
+ &:focus {
499
+ border-color: $app-primary-color !important;
500
+ border-radius: 50%;
501
+ }
502
+ }
466
503
  }
467
504
 
468
505
  .sub-title {