Skip to content

Commit f535ec7

Browse files
MattuMattu
authored andcommitted
Updated Dataset-info Pages:
Updated Dataset pages to accommodate the discovery metadata change.
1 parent 254474f commit f535ec7

File tree

1 file changed

+45
-24
lines changed

1 file changed

+45
-24
lines changed

pages/data/dataset_info/_id.vue

Lines changed: 45 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@
4141
</template>
4242
</i18n>
4343
</div>
44-
<div class="mb-3">
45-
<strong>{{ $t('data.info.descriptors.category') }}</strong>
46-
&nbsp;
47-
<span>{{ category }}</span>
48-
</div>
4944
<div class="mb-3">
5045
<strong>{{ $t('data.info.descriptors.keywords') }}</strong>
5146
&nbsp;
@@ -62,8 +57,14 @@
6257
<div>
6358
<strong>{{ $t('data.info.descriptors.links') }}</strong>
6459
<ul>
65-
<li v-if="wafDataset">
66-
<a :href="datasetWafURL" target="_blank">
60+
<li>
61+
<a :href="firstwafURL" target="_blank">
62+
{{ $t('data.info.links.waf') }}
63+
<v-icon x-small>mdi-open-in-new</v-icon>
64+
</a>
65+
</li>
66+
<li v-if="hasSecondWAF">
67+
<a :href="secondwafURL" target="_blank">
6768
{{ $t('data.info.links.waf') }}
6869
<v-icon x-small>mdi-open-in-new</v-icon>
6970
</a>
@@ -117,10 +118,16 @@ export default {
117118
return {
118119
abstract: null,
119120
aliases: {
120-
broadband: 'broad-band',
121-
multiband: 'multi-band',
122-
umkehrn14_1: 'umkehrn14_1.0',
123-
umkehrn14_2: 'umkehrn14_2.0',
121+
broadband: 'Broad-band',
122+
multiband: 'Multi-band',
123+
umkehrn14_1: 'UmkehrN14_1.0',
124+
umkehrn14_2: 'UmkehrN14_2.0',
125+
totalozone: 'TotalOzone',
126+
totalozoneobs: 'TotalOzoneObs',
127+
lidar: 'Lidar',
128+
ozonesonde: 'OzoneSonde',
129+
rocketsonde: 'RocketSonde',
130+
spectral: 'Spectral',
124131
},
125132
category: null,
126133
collectionItem: null,
@@ -136,7 +143,8 @@ export default {
136143
stations: [],
137144
title: null,
138145
uriDatasetDef: null,
139-
wafDataset: null,
146+
// wafDataset: null,
147+
wafURL: [],
140148
}
141149
},
142150
head() {
@@ -159,10 +167,19 @@ export default {
159167
doiURL() {
160168
return `http://dx.doi.org/${this.doi}`
161169
},
170+
firstwafURL() {
171+
return this.wafURL[0]
172+
},
173+
secondwafURL() {
174+
return this.wafURL[1]
175+
},
162176
datasetWafURL() {
163177
const archivePath = this.$config.WOUDC_UI_WAF_URL + '/Archive-NewFormat'
164178
return `${archivePath}/${this.wafDataset}`
165179
},
180+
hasSecondWAF: function () {
181+
return this.wafURL.length > 1
182+
},
166183
},
167184
mounted() {
168185
this.init()
@@ -179,22 +196,26 @@ export default {
179196
} else {
180197
this.dataset = this.$route.params.id
181198
}
199+
182200
const discoveryMetadataURL =
183201
this.$config.WOUDC_UI_API_URL + '/collections/discovery_metadata/items'
184-
this.uriDatasetDef = discoveryMetadataURL + '?identifier=' + this.dataset
202+
203+
this.uriDatasetDef = `${discoveryMetadataURL}/${this.dataset}?f=json`
204+
185205
const response = await woudcClient.get(this.uriDatasetDef)
186-
this.collectionItem = response.data.features[0].properties
206+
this.collectionItem = response
187207
188-
this.dataset_id = this.collectionItem.identifier
189-
this.title = this.collectionItem[`title_${this.$i18n.locale}`]
190-
this.abstract = this.collectionItem[`abstract_${this.$i18n.locale}`]
191-
this.doi = this.collectionItem.doi
192-
this.dateFrom = this.collectionItem.temporal_begin
193-
this.dateTo = this.collectionItem.temporal_end
194-
this.category = this.collectionItem.topic_category
195-
this.keywords = this.collectionItem[`keywords_${this.$i18n.locale}`]
196-
if (this.dataset !== 'uv_index_hourly') {
197-
this.wafDataset = this.collectionItem.waf[`label_${this.$i18n.locale}`]
208+
this.dataset_id = this.collectionItem.data.id
209+
this.title = this.collectionItem.data.properties.title
210+
this.abstract = this.collectionItem.data.properties.description
211+
this.doi = this.collectionItem.data.properties.externalIds[0].value
212+
this.dateFrom = this.collectionItem.data.time.interval[0]
213+
this.dateTo = this.collectionItem.data.time.interval[1]
214+
this.keywords = this.collectionItem.data.properties.keywords
215+
for (const item of this.collectionItem.data.links) {
216+
if (item.title == 'Web Accessible Folder (WAF)') {
217+
this.wafURL.push(item.href)
218+
}
198219
}
199220
},
200221
stationText(station) {

0 commit comments

Comments
 (0)