|
2 | 2 | <v-container class="mt-0 pt-0 pl-8"> |
3 | 3 | <!-- Documents --> |
4 | 4 | <v-row |
5 | | - v-if="tool.documentation && tool.documentation.length" |
| 5 | + v-if="documents.length" |
6 | 6 | class="mt-0 pt-0 mb-0 section-row" |
7 | 7 | align="center" |
8 | 8 | > |
|
11 | 11 | </v-col> |
12 | 12 | <v-col cols="9" class="pt-3 pb-3 d-flex flex-wrap" style="gap: 14px"> |
13 | 13 | <v-chip |
14 | | - v-for="(item, i) in tool.documentation.filter( |
15 | | - (d) => d.term && d.term.url |
16 | | - )" |
| 14 | + v-for="(item, i) in documents" |
17 | 15 | :key="i" |
18 | 16 | label |
19 | 17 | color="grey lighten-3" |
|
28 | 26 | </v-col> |
29 | 27 | </v-row> |
30 | 28 |
|
31 | | - <v-divider v-if="tool.documentation && tool.documentation.length" /> |
| 29 | + <v-divider v-if="documents.length" /> |
32 | 30 |
|
33 | 31 | <!-- Related topics --> |
34 | 32 | <!-- Vocabulary EDAM si lleva los 3 puntitos sino no. --> |
35 | 33 | <v-row |
36 | | - v-if="tool.topics && tool.topics.length" |
| 34 | + v-if="topics.length" |
37 | 35 | class="mt-0 pt-0 mb-0 section-row" |
38 | 36 | align="center" |
39 | 37 | > |
|
42 | 40 | </v-col> |
43 | 41 | <v-col cols="9" class="pt-3 pb-3 d-flex flex-wrap" style="gap: 14px"> |
44 | 42 | <ItemChipMenu |
45 | | - v-for="item in tool.topics.filter((t) => t.term && t.term.term)" |
| 43 | + v-for="item in topics" |
46 | 44 | :key="item.id" |
47 | 45 | :text="item.term.term" |
48 | 46 | :edam-id="item.term.uri" |
|
53 | 51 | </v-col> |
54 | 52 | </v-row> |
55 | 53 |
|
56 | | - <v-divider v-if="tool.topics && tool.topics.length" /> |
| 54 | + <v-divider v-if="topics.length" /> |
57 | 55 |
|
58 | 56 | <!-- Operations --> |
59 | 57 | <v-row |
60 | | - v-if="tool.operations && tool.operations.length" |
| 58 | + v-if="operations.length" |
61 | 59 | class="mt-0 pt-0 mb-0 section-row" |
62 | 60 | align="center" |
63 | 61 | > |
|
66 | 64 | </v-col> |
67 | 65 | <v-col cols="9" class="pt-3 pb-3 d-flex flex-wrap" style="gap: 14px"> |
68 | 66 | <ItemChipMenu |
69 | | - v-for="item in tool.operations" |
| 67 | + v-for="item in operations" |
70 | 68 | :key="item.id" |
71 | 69 | :text="item.term.term" |
72 | 70 | :edam-id="item.term.uri" |
@@ -101,6 +99,19 @@ export default { |
101 | 99 | tool: 'tool', |
102 | 100 | loading: 'loading', |
103 | 101 | }), |
| 102 | + // Documentation entries that carry a link; entries with only inline |
| 103 | + // `content` (no URL) render no chip, so they are excluded here. |
| 104 | + documents() { |
| 105 | + return (this.tool?.documentation || []).filter( |
| 106 | + (d) => d.term && d.term.url |
| 107 | + ); |
| 108 | + }, |
| 109 | + topics() { |
| 110 | + return (this.tool?.topics || []).filter((t) => t.term && t.term.term); |
| 111 | + }, |
| 112 | + operations() { |
| 113 | + return (this.tool?.operations || []).filter((o) => o.term && o.term.term); |
| 114 | + }, |
104 | 115 | }, |
105 | 116 | }; |
106 | 117 | </script> |
|
0 commit comments