@abi-software/flatmapvuer 0.6.3-vue.3.9 → 1.0.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 (38) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +120 -120
  3. package/cypress.config.js +23 -23
  4. package/dist/flatmapvuer.js +15894 -16259
  5. package/dist/flatmapvuer.umd.cjs +132 -145
  6. package/dist/index.html +17 -17
  7. package/dist/style.css +1 -1
  8. package/package.json +95 -95
  9. package/public/index.html +17 -17
  10. package/reporter-config.json +9 -9
  11. package/src/App.vue +310 -310
  12. package/src/assets/_variables.scss +43 -43
  13. package/src/assets/styles.scss +5 -5
  14. package/src/components/AnnotationTool.vue +450 -446
  15. package/src/components/EventBus.js +3 -3
  16. package/src/components/ExternalResourceCard.vue +107 -107
  17. package/src/components/FlatmapVuer.vue +2600 -2531
  18. package/src/components/MultiFlatmapVuer.vue +731 -731
  19. package/src/components/ProvenancePopup.vue +503 -495
  20. package/src/components/SelectionsGroup.vue +255 -255
  21. package/src/components/Tooltip.vue +50 -50
  22. package/src/components/TreeControls.vue +231 -231
  23. package/src/components/index.js +7 -7
  24. package/src/components/legends/DynamicLegends.vue +106 -106
  25. package/src/components/legends/SvgLegends.vue +112 -112
  26. package/src/icons/flatmap-marker.js +1 -1
  27. package/src/icons/fonts/mapicon-species.svg +14 -14
  28. package/src/icons/fonts/mapicon-species.ttf +0 -0
  29. package/src/icons/fonts/mapicon-species.woff +0 -0
  30. package/src/icons/mapicon-species-style.css +42 -42
  31. package/src/icons/yellowstar.js +5 -5
  32. package/src/legends/legend.svg +25 -25
  33. package/src/main.js +19 -19
  34. package/src/services/flatmapQueries.js +453 -453
  35. package/src/store/index.js +23 -23
  36. package/vite.config.js +73 -73
  37. package/vite.static-build.js +12 -12
  38. package/vuese-generator.js +64 -64
@@ -1,446 +1,450 @@
1
- <template>
2
- <el-main class="main">
3
- <div class="block">
4
- <el-row class="info-field">
5
- <span class="title">Feature Annotations</span>
6
- </el-row>
7
- <template v-if="annotationEntry">
8
- <el-row
9
- v-for="(key, label) in displayPair"
10
- v-show="annotationEntry[key]"
11
- class="dialog-text"
12
- :key="key"
13
- >
14
- <strong>{{ label }}: </strong>&nbsp;{{ annotationEntry[key] }}
15
- </el-row>
16
- <template v-if="prevSubs.length > 0">
17
- <div
18
- v-show="showSubmissions"
19
- class="hide"
20
- @click="showSubmissions = false"
21
- >
22
- Hide previous submissions
23
- <el-icon><el-icon-arrow-up /></el-icon>
24
- </div>
25
- <div
26
- v-show="!showSubmissions"
27
- class="hide"
28
- @click="showSubmissions = true"
29
- >
30
- Show previous {{ prevSubs.length }} submission(s)
31
- <el-icon><el-icon-arrow-down /></el-icon>
32
- </div>
33
- <template v-if="showSubmissions">
34
- <el-row class="dialog-spacer"></el-row>
35
- <el-row class="dialog-text">
36
- <strong class="sub-title">Previous submissions:</strong>
37
- </el-row>
38
- <div class="entry" v-for="(sub, index) in prevSubs" :key="index">
39
- <el-row class="dialog-text">
40
- <strong>{{ formatTime(sub.created) }}</strong>
41
- {{ sub.creator.name }}
42
- </el-row>
43
- <el-row class="dialog-text">
44
- <strong>Evidence: </strong>
45
- <el-row
46
- v-for="evidence in sub.body.evidence"
47
- :key="evidence"
48
- class="dialog-text"
49
- >
50
- <a :href="evidence" target="_blank"> {{ evidence }}</a>
51
- </el-row>
52
- </el-row>
53
- <el-row class="dialog-text">
54
- <strong>Comment: </strong> {{ sub.body.comment }}
55
- </el-row>
56
- </div>
57
- </template>
58
- </template>
59
- <template v-if="authenticated">
60
- <template v-if="isEditable">
61
- <el-row class="dialog-spacer"></el-row>
62
- <el-row v-if="!editing">
63
- <el-icon class="standard-icon"><el-icon-edit @click="editing = true"/></el-icon>
64
- </el-row>
65
- <template v-else>
66
- <el-row class="dialog-text">
67
- <strong class="sub-title">Suggest changes:</strong>
68
- </el-row>
69
- <el-row class="dialog-text">
70
- <strong>Evidvence:</strong>
71
- </el-row>
72
- <el-row v-for="(value, index) in evidence" :key="value">
73
- <el-col :span="20">
74
- {{ evidence[index] }}
75
- </el-col>
76
- <el-col :span="4">
77
- <el-icon class="standard-icon"><el-icon-close @click="removeEvidence(index)" /></el-icon>
78
- </el-col>
79
- </el-row>
80
- <el-row>
81
- <el-input
82
- size="small"
83
- placeholder="Enter"
84
- v-model="newEvidence"
85
- @change="evidenceEntered($event)"
86
- >
87
- <template #prepend>
88
- <el-select
89
- :teleported="false"
90
- v-model="evidencePrefix"
91
- placeholder="Select"
92
- class="select-box"
93
- popper-class="flatmap_dropdown"
94
- >
95
- <el-option
96
- v-for="item in evidencePrefixes"
97
- :key="item"
98
- :label="item"
99
- :value="item"
100
- >
101
- <el-row>
102
- <el-col :span="12">{{ item }}</el-col>
103
- </el-row>
104
- </el-option>
105
- </el-select>
106
- </template>
107
- </el-input>
108
- </el-row>
109
- <el-row>
110
- <strong>Comment:</strong>
111
- </el-row>
112
- <el-row class="dialog-text">
113
- <el-input
114
- type="textarea"
115
- :autosize="{ minRows: 2, maxRows: 4 }"
116
- placeholder="Enter"
117
- v-model="comment"
118
- />
119
- </el-row>
120
- <el-row class="dialog-text">
121
- <el-button class="button" type="primary" plain @click="submit">
122
- Submit
123
- </el-button>
124
- </el-row>
125
- </template>
126
- <el-row class="dialog-text" v-if="errorMessage">
127
- <strong class="sub-title"> {{ errorMessage }} </strong>
128
- </el-row>
129
- </template>
130
- </template>
131
- </template>
132
- </div>
133
- </el-main>
134
- </template>
135
-
136
- <script>
137
- import {
138
- ArrowUp as ElIconArrowUp,
139
- ArrowDown as ElIconArrowDown,
140
- Edit as ElIconEdit,
141
- Close as ElIconClose,
142
- } from '@element-plus/icons-vue'
143
- /* eslint-disable no-alert, no-console */
144
- /* eslint-disable no-alert, no-console */
145
- import { AnnotationService } from '@abi-software/sparc-annotation'
146
- import {
147
- ElButton as Button,
148
- ElCol as Col,
149
- ElInput as Input,
150
- ElMain as Main,
151
- ElRow as Row,
152
- ElSelect as Select,
153
- } from 'element-plus'
154
-
155
- export default {
156
- name: 'AnnotationTool',
157
- components: {
158
- Button,
159
- Col,
160
- Input,
161
- Main,
162
- Row,
163
- Select,
164
- ElIconArrowUp,
165
- ElIconArrowDown,
166
- ElIconEdit,
167
- ElIconClose,
168
- },
169
- props: {
170
- annotationEntry: {
171
- type: Object,
172
- },
173
- },
174
- inject: ['flatmapAPI', 'userApiKey'],
175
- data: function () {
176
- return {
177
- displayPair: {
178
- 'Feature ID': 'featureId',
179
- Tooltip: 'label',
180
- Models: 'models',
181
- Name: 'name',
182
- Resource: 'resourceId',
183
- },
184
- editing: false,
185
- evidencePrefixes: ['DOI:', 'PMID:'],
186
- evidencePrefix: 'DOI:',
187
- evidence: [],
188
- authenticated: false,
189
- newEvidence: '',
190
- comment: '',
191
- prevSubs: [],
192
- showSubmissions: true,
193
- errorMessage: '',
194
- creator: undefined,
195
- }
196
- },
197
- computed: {
198
- isEditable: function () {
199
- return (
200
- this.annotationEntry['resource'] && this.annotationEntry['featureId']
201
- )
202
- },
203
- },
204
- methods: {
205
- evidenceEntered: function (value) {
206
- if (value) {
207
- this.evidence.push(this.evidencePrefix + value)
208
- this.newEvidence = ''
209
- }
210
- },
211
- formatTime: function (dateString) {
212
- const options = {
213
- year: 'numeric',
214
- month: 'long',
215
- day: 'numeric',
216
- hour: 'numeric',
217
- minute: 'numeric',
218
- second: 'numeric',
219
- }
220
- return new Date(dateString).toLocaleDateString(undefined, options)
221
- },
222
- updatePrevSubmissions: function () {
223
- if (this.$annotator && this.authenticated) {
224
- if (
225
- this.annotationEntry['resource'] &&
226
- this.annotationEntry['featureId']
227
- ) {
228
- this.$annotator
229
- .itemAnnotations(
230
- this.userApiKey,
231
- this.annotationEntry['resource'],
232
- this.annotationEntry['featureId']
233
- )
234
- .then((value) => {
235
- this.prevSubs = value
236
- })
237
- .catch((reason) => {
238
- console.log(reason) // Error!
239
- })
240
- }
241
- }
242
- },
243
- submit: function () {
244
- if (this.evidence.length > 0 || this.comment) {
245
- if (
246
- this.annotationEntry['resource'] &&
247
- this.annotationEntry['featureId']
248
- ) {
249
- const evidenceURLs = []
250
- this.evidence.forEach((evidence) => {
251
- if (evidence.includes('DOI:')) {
252
- const link = evidence.replace('DOI:', 'https://doi.org/')
253
- evidenceURLs.push(new URL(link))
254
- } else if (evidence.includes('PMID:')) {
255
- const link = evidence.replace(
256
- 'PMID:',
257
- 'https://pubmed.ncbi.nlm.nih.gov/'
258
- )
259
- evidenceURLs.push(new URL(link))
260
- }
261
- })
262
- const userAnnotation = {
263
- resource: this.annotationEntry['resource'],
264
- item: this.annotationEntry['featureId'],
265
- body: {
266
- evidence: evidenceURLs,
267
- comment: this.comment,
268
- },
269
- }
270
- if (this.creator) userAnnotation.creator = this.creator
271
- this.$annotator
272
- .addAnnotation(this.userApiKey, userAnnotation)
273
- .then(() => {
274
- this.errorMessage = ''
275
- this.resetSubmission()
276
- this.updatePrevSubmissions()
277
- })
278
- .catch(() => {
279
- this.errorMessage =
280
- 'There is a problem with the submission, please try again later'
281
- })
282
- }
283
- }
284
- },
285
- removeEvidence: function (index) {
286
- this.evidence.splice(index, 1)
287
- },
288
- resetSubmission: function () {
289
- this.editing = false
290
- this.evidence = []
291
- this.newFeature = ''
292
- this.comment = ''
293
- },
294
- },
295
- watch: {
296
- annotationEntry: {
297
- handler: function (newVal, oldVal) {
298
- if (newVal !== oldVal) {
299
- this.resetSubmission()
300
- this.updatePrevSubmissions()
301
- }
302
- },
303
- immediate: false,
304
- deep: false,
305
- },
306
- },
307
- mounted: function () {
308
- if (!this.$annotator) {
309
- this.$annotator = new AnnotationService(
310
- `${this.flatmapAPI}annotator`
311
- )
312
- }
313
- this.$annotator.authenticate(this.userApiKey).then((userData) => {
314
- if (userData.name && userData.email) {
315
- this.creator = userData
316
- if (!userData.orcid) this.creator.orcid = '0000-0000-0000-0000'
317
- this.authenticated = true
318
- this.updatePrevSubmissions()
319
- } else {
320
- this.errorMessage = ''
321
- }
322
- })
323
- },
324
- }
325
- </script>
326
-
327
- <style lang="scss" scoped>
328
-
329
- .info-field {
330
- display: flex;
331
- }
332
-
333
- .block {
334
- margin-bottom: 0.5em;
335
- }
336
-
337
- .button {
338
- padding-top: 5px;
339
- padding-bottom: 5px;
340
- }
341
-
342
- .standard-icon {
343
- color: $app-primary-color;
344
- &:hover {
345
- cursor: pointer;
346
- }
347
- }
348
-
349
- .dialog-text {
350
- color: rgb(48, 49, 51);
351
- font-size: 14px;
352
- font-weight: normal;
353
- line-height: 20px;
354
- }
355
-
356
- .main {
357
- font-size: 14px;
358
- text-align: left;
359
- line-height: 1.5em;
360
- font-family: Asap, sans-serif, Helvetica;
361
- font-weight: 400;
362
- /* outline: thin red solid; */
363
- padding: 1em !important;
364
- overflow-x: hidden;
365
- overflow-y: auto;
366
- min-width: 20rem;
367
- max-height: 400px;
368
- scrollbar-width: thin;
369
-
370
- &::-webkit-scrollbar {
371
- width: 4px;
372
- }
373
-
374
- &::-webkit-scrollbar-thumb {
375
- border-radius: 10px;
376
- box-shadow: inset 0 0 6px #c0c4cc;
377
- }
378
- }
379
-
380
- .title {
381
- font-size: 18px;
382
- font-weight: 500;
383
- font-weight: bold;
384
- padding-bottom: 8px;
385
- color: rgb(131, 0, 191);
386
- }
387
-
388
- .sub-title {
389
- font-size: 16px;
390
- }
391
-
392
- .dialog-spacer {
393
- border-bottom: 1px solid #e4e7ed;
394
- margin-bottom: 10px;
395
- }
396
-
397
- .submit {
398
- color: $app-primary-color;
399
- &:hover {
400
- cursor: pointer;
401
- }
402
- }
403
-
404
- .entry ~ .entry {
405
- border-top: 1px solid #e4e7ed;
406
- margin-top: 10px;
407
- }
408
-
409
- .hide {
410
- color: $app-primary-color;
411
- cursor: pointer;
412
- margin-right: 6px;
413
- margin-top: 3px;
414
- }
415
-
416
- :deep(.el-input__inner),
417
- :deep(.el-textarea__inner) {
418
- font-family: Asap, sans-serif;
419
- }
420
-
421
- .select-box {
422
- width: 80px;
423
- background-color: var(--white);
424
- font-weight: 500;
425
- color: rgb(48, 49, 51);
426
- :deep(.el-input__inner) {
427
- height: 30px;
428
- color: rgb(48, 49, 51);
429
- }
430
- :deep(.el-input__icon) {
431
- line-height: 30px;
432
- }
433
- }
434
-
435
- :deep(.flatmap_dropdown) {
436
- min-width: 80px !important;
437
- .el-select-dropdown__item {
438
- white-space: nowrap;
439
- text-align: left;
440
- &.selected {
441
- color: $app-primary-color;
442
- font-weight: normal;
443
- }
444
- }
445
- }
446
- </style>
1
+ <template>
2
+ <el-main class="main">
3
+ <div class="block">
4
+ <el-row class="info-field">
5
+ <div class="title">Feature Annotations</div>
6
+ </el-row>
7
+ <template v-if="annotationEntry">
8
+ <el-row
9
+ v-for="(key, label) in displayPair"
10
+ v-show="annotationEntry[key]"
11
+ class="dialog-text"
12
+ :key="key"
13
+ >
14
+ <strong>{{ label }}: </strong>&nbsp;{{ annotationEntry[key] }}
15
+ </el-row>
16
+ <template v-if="prevSubs.length > 0">
17
+ <div
18
+ v-show="showSubmissions"
19
+ class="hide"
20
+ @click="showSubmissions = false"
21
+ >
22
+ Hide previous submissions
23
+ <el-icon><el-icon-arrow-up /></el-icon>
24
+ </div>
25
+ <div
26
+ v-show="!showSubmissions"
27
+ class="hide"
28
+ @click="showSubmissions = true"
29
+ >
30
+ Show previous {{ prevSubs.length }} submission(s)
31
+ <el-icon><el-icon-arrow-down /></el-icon>
32
+ </div>
33
+ <template v-if="showSubmissions">
34
+ <el-row class="dialog-spacer"></el-row>
35
+ <el-row class="dialog-text">
36
+ <strong class="sub-title">Previous submissions:</strong>
37
+ </el-row>
38
+ <div class="entry" v-for="(sub, index) in prevSubs" :key="index">
39
+ <el-row class="dialog-text">
40
+ <strong>{{ formatTime(sub.created) }}</strong>
41
+ {{ sub.creator.name }}
42
+ </el-row>
43
+ <el-row class="dialog-text">
44
+ <strong>Evidence: </strong>
45
+ <el-row
46
+ v-for="evidence in sub.body.evidence"
47
+ :key="evidence"
48
+ class="dialog-text"
49
+ >
50
+ <a :href="evidence" target="_blank"> {{ evidence }}</a>
51
+ </el-row>
52
+ </el-row>
53
+ <el-row class="dialog-text">
54
+ <strong>Comment: </strong> {{ sub.body.comment }}
55
+ </el-row>
56
+ </div>
57
+ </template>
58
+ </template>
59
+ <template v-if="authenticated">
60
+ <template v-if="isEditable">
61
+ <el-row class="dialog-spacer"></el-row>
62
+ <el-row v-if="!editing">
63
+ <el-icon class="standard-icon"><el-icon-edit @click="editing = true"/></el-icon>
64
+ </el-row>
65
+ <template v-else>
66
+ <el-row class="dialog-text">
67
+ <strong class="sub-title">Suggest changes:</strong>
68
+ </el-row>
69
+ <el-row class="dialog-text">
70
+ <strong>Evidvence:</strong>
71
+ </el-row>
72
+ <el-row v-for="(value, index) in evidence" :key="value">
73
+ <el-col :span="20">
74
+ {{ evidence[index] }}
75
+ </el-col>
76
+ <el-col :span="4">
77
+ <el-icon class="standard-icon"><el-icon-close @click="removeEvidence(index)" /></el-icon>
78
+ </el-col>
79
+ </el-row>
80
+ <el-row>
81
+ <el-input
82
+ size="small"
83
+ placeholder="Enter"
84
+ v-model="newEvidence"
85
+ @change="evidenceEntered($event)"
86
+ >
87
+ <template #prepend>
88
+ <el-select
89
+ :teleported="false"
90
+ v-model="evidencePrefix"
91
+ placeholder="Select"
92
+ class="select-box"
93
+ popper-class="flatmap_dropdown"
94
+ >
95
+ <el-option
96
+ v-for="item in evidencePrefixes"
97
+ :key="item"
98
+ :label="item"
99
+ :value="item"
100
+ >
101
+ <el-row>
102
+ <el-col :span="12">{{ item }}</el-col>
103
+ </el-row>
104
+ </el-option>
105
+ </el-select>
106
+ </template>
107
+ </el-input>
108
+ </el-row>
109
+ <el-row>
110
+ <strong>Comment:</strong>
111
+ </el-row>
112
+ <el-row class="dialog-text">
113
+ <el-input
114
+ type="textarea"
115
+ :autosize="{ minRows: 2, maxRows: 4 }"
116
+ placeholder="Enter"
117
+ v-model="comment"
118
+ />
119
+ </el-row>
120
+ <el-row class="dialog-text">
121
+ <el-button class="button" type="primary" plain @click="submit">
122
+ Submit
123
+ </el-button>
124
+ </el-row>
125
+ </template>
126
+ <el-row class="dialog-text" v-if="errorMessage">
127
+ <strong class="sub-title"> {{ errorMessage }} </strong>
128
+ </el-row>
129
+ </template>
130
+ </template>
131
+ </template>
132
+ </div>
133
+ </el-main>
134
+ </template>
135
+
136
+ <script>
137
+ import {
138
+ ArrowUp as ElIconArrowUp,
139
+ ArrowDown as ElIconArrowDown,
140
+ Edit as ElIconEdit,
141
+ Close as ElIconClose,
142
+ } from '@element-plus/icons-vue'
143
+ /* eslint-disable no-alert, no-console */
144
+ /* eslint-disable no-alert, no-console */
145
+ import { AnnotationService } from '@abi-software/sparc-annotation'
146
+ import {
147
+ ElButton as Button,
148
+ ElCol as Col,
149
+ ElInput as Input,
150
+ ElMain as Main,
151
+ ElRow as Row,
152
+ ElSelect as Select,
153
+ } from 'element-plus'
154
+
155
+ export default {
156
+ name: 'AnnotationTool',
157
+ components: {
158
+ Button,
159
+ Col,
160
+ Input,
161
+ Main,
162
+ Row,
163
+ Select,
164
+ ElIconArrowUp,
165
+ ElIconArrowDown,
166
+ ElIconEdit,
167
+ ElIconClose,
168
+ },
169
+ props: {
170
+ annotationEntry: {
171
+ type: Object,
172
+ },
173
+ },
174
+ inject: ['flatmapAPI', 'userApiKey'],
175
+ data: function () {
176
+ return {
177
+ displayPair: {
178
+ 'Feature ID': 'featureId',
179
+ Tooltip: 'label',
180
+ Models: 'models',
181
+ Name: 'name',
182
+ Resource: 'resourceId',
183
+ },
184
+ editing: false,
185
+ evidencePrefixes: ['DOI:', 'PMID:'],
186
+ evidencePrefix: 'DOI:',
187
+ evidence: [],
188
+ authenticated: false,
189
+ newEvidence: '',
190
+ comment: '',
191
+ prevSubs: [],
192
+ showSubmissions: true,
193
+ errorMessage: '',
194
+ creator: undefined,
195
+ }
196
+ },
197
+ computed: {
198
+ isEditable: function () {
199
+ return (
200
+ this.annotationEntry['resource'] && this.annotationEntry['featureId']
201
+ )
202
+ },
203
+ },
204
+ methods: {
205
+ evidenceEntered: function (value) {
206
+ if (value) {
207
+ this.evidence.push(this.evidencePrefix + value)
208
+ this.newEvidence = ''
209
+ }
210
+ },
211
+ formatTime: function (dateString) {
212
+ const options = {
213
+ year: 'numeric',
214
+ month: 'long',
215
+ day: 'numeric',
216
+ hour: 'numeric',
217
+ minute: 'numeric',
218
+ second: 'numeric',
219
+ }
220
+ return new Date(dateString).toLocaleDateString(undefined, options)
221
+ },
222
+ updatePrevSubmissions: function () {
223
+ if (this.$annotator && this.authenticated) {
224
+ if (
225
+ this.annotationEntry['resource'] &&
226
+ this.annotationEntry['featureId']
227
+ ) {
228
+ this.$annotator
229
+ .itemAnnotations(
230
+ this.userApiKey,
231
+ this.annotationEntry['resource'],
232
+ this.annotationEntry['featureId']
233
+ )
234
+ .then((value) => {
235
+ this.prevSubs = value
236
+ })
237
+ .catch((reason) => {
238
+ console.log(reason) // Error!
239
+ })
240
+ }
241
+ }
242
+ },
243
+ submit: function () {
244
+ if (this.evidence.length > 0 || this.comment) {
245
+ if (
246
+ this.annotationEntry['resource'] &&
247
+ this.annotationEntry['featureId']
248
+ ) {
249
+ const evidenceURLs = []
250
+ this.evidence.forEach((evidence) => {
251
+ if (evidence.includes('DOI:')) {
252
+ const link = evidence.replace('DOI:', 'https://doi.org/')
253
+ evidenceURLs.push(new URL(link))
254
+ } else if (evidence.includes('PMID:')) {
255
+ const link = evidence.replace(
256
+ 'PMID:',
257
+ 'https://pubmed.ncbi.nlm.nih.gov/'
258
+ )
259
+ evidenceURLs.push(new URL(link))
260
+ }
261
+ })
262
+ const userAnnotation = {
263
+ resource: this.annotationEntry['resource'],
264
+ item: this.annotationEntry['featureId'],
265
+ body: {
266
+ evidence: evidenceURLs,
267
+ comment: this.comment,
268
+ },
269
+ }
270
+ if (this.creator) userAnnotation.creator = this.creator
271
+ this.$annotator
272
+ .addAnnotation(this.userApiKey, userAnnotation)
273
+ .then(() => {
274
+ this.errorMessage = ''
275
+ this.resetSubmission()
276
+ this.updatePrevSubmissions()
277
+ })
278
+ .catch(() => {
279
+ this.errorMessage =
280
+ 'There is a problem with the submission, please try again later'
281
+ })
282
+ }
283
+ }
284
+ },
285
+ removeEvidence: function (index) {
286
+ this.evidence.splice(index, 1)
287
+ },
288
+ resetSubmission: function () {
289
+ this.editing = false
290
+ this.evidence = []
291
+ this.newFeature = ''
292
+ this.comment = ''
293
+ },
294
+ },
295
+ watch: {
296
+ annotationEntry: {
297
+ handler: function (newVal, oldVal) {
298
+ if (newVal !== oldVal) {
299
+ this.resetSubmission()
300
+ this.updatePrevSubmissions()
301
+ }
302
+ },
303
+ immediate: false,
304
+ deep: false,
305
+ },
306
+ },
307
+ mounted: function () {
308
+ if (!this.$annotator) {
309
+ this.$annotator = new AnnotationService(
310
+ `${this.flatmapAPI}annotator`
311
+ )
312
+ }
313
+ this.$annotator.authenticate(this.userApiKey).then((userData) => {
314
+ if (userData.name && userData.email) {
315
+ this.creator = userData
316
+ if (!userData.orcid) this.creator.orcid = '0000-0000-0000-0000'
317
+ this.authenticated = true
318
+ this.updatePrevSubmissions()
319
+ } else {
320
+ this.errorMessage = ''
321
+ }
322
+ })
323
+ },
324
+ }
325
+ </script>
326
+
327
+ <style lang="scss" scoped>
328
+
329
+ .info-field {
330
+ display: flex;
331
+ }
332
+
333
+ .block {
334
+ margin-bottom: 0.5em;
335
+
336
+ .main > &:first-of-type {
337
+ margin-right: 0.5em;
338
+ }
339
+ }
340
+
341
+ .button {
342
+ padding-top: 5px;
343
+ padding-bottom: 5px;
344
+ }
345
+
346
+ .standard-icon {
347
+ color: $app-primary-color;
348
+ &:hover {
349
+ cursor: pointer;
350
+ }
351
+ }
352
+
353
+ .dialog-text {
354
+ color: rgb(48, 49, 51);
355
+ font-size: 14px;
356
+ font-weight: normal;
357
+ line-height: 20px;
358
+ }
359
+
360
+ .main {
361
+ font-size: 14px;
362
+ text-align: left;
363
+ line-height: 1.5em;
364
+ font-family: Asap, sans-serif, Helvetica;
365
+ font-weight: 400;
366
+ /* outline: thin red solid; */
367
+ padding: 1em !important;
368
+ overflow-x: hidden;
369
+ overflow-y: auto;
370
+ min-width: 300px; // .maplibregl-popup max-width
371
+ max-height: 400px;
372
+ scrollbar-width: thin;
373
+
374
+ &::-webkit-scrollbar {
375
+ width: 4px;
376
+ }
377
+
378
+ &::-webkit-scrollbar-thumb {
379
+ border-radius: 10px;
380
+ box-shadow: inset 0 0 6px #c0c4cc;
381
+ }
382
+ }
383
+
384
+ .title {
385
+ font-size: 18px;
386
+ font-weight: 500;
387
+ font-weight: bold;
388
+ padding-bottom: 8px;
389
+ color: rgb(131, 0, 191);
390
+ }
391
+
392
+ .sub-title {
393
+ font-size: 16px;
394
+ }
395
+
396
+ .dialog-spacer {
397
+ border-bottom: 1px solid #e4e7ed;
398
+ margin-bottom: 10px;
399
+ }
400
+
401
+ .submit {
402
+ color: $app-primary-color;
403
+ &:hover {
404
+ cursor: pointer;
405
+ }
406
+ }
407
+
408
+ .entry ~ .entry {
409
+ border-top: 1px solid #e4e7ed;
410
+ margin-top: 10px;
411
+ }
412
+
413
+ .hide {
414
+ color: $app-primary-color;
415
+ cursor: pointer;
416
+ margin-right: 6px;
417
+ margin-top: 3px;
418
+ }
419
+
420
+ :deep(.el-input__inner),
421
+ :deep(.el-textarea__inner) {
422
+ font-family: Asap, sans-serif;
423
+ }
424
+
425
+ .select-box {
426
+ width: 80px;
427
+ background-color: var(--white);
428
+ font-weight: 500;
429
+ color: rgb(48, 49, 51);
430
+ :deep(.el-input__inner) {
431
+ height: 30px;
432
+ color: rgb(48, 49, 51);
433
+ }
434
+ :deep(.el-input__icon) {
435
+ line-height: 30px;
436
+ }
437
+ }
438
+
439
+ :deep(.flatmap_dropdown) {
440
+ min-width: 80px !important;
441
+ .el-select-dropdown__item {
442
+ white-space: nowrap;
443
+ text-align: left;
444
+ &.selected {
445
+ color: $app-primary-color;
446
+ font-weight: normal;
447
+ }
448
+ }
449
+ }
450
+ </style>