Skip to content

Commit

Permalink
#19 extract treatment from formater-metadata to formater-opensearch
Browse files Browse the repository at this point in the history
  • Loading branch information
epointal committed Aug 22, 2019
1 parent c74af7f commit 84dc1ee
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 228 deletions.
18 changes: 9 additions & 9 deletions src/formater-list-contact.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ export default {
FormaterContact
},
props: {
lang: {
type: String,
default: 'en'
},
// lang: {
// type: String,
// default: 'en'
// },
responsibleParty: {
type: Array,
default: () => []
Expand All @@ -56,9 +56,9 @@ export default {
}
},
watch: {
lang (newvalue) {
this.$i18n.locale = newvalue
},
// lang (newvalue) {
// this.$i18n.locale = newvalue
// },
responsibleParty2 (newvalue) {
this.updateContacts(newvalue)
}
Expand All @@ -72,8 +72,8 @@ export default {
}
},
created () {
this.$i18n.locale = this.lang
this.$setGnLocale(this.lang)
//this.$i18n.locale = this.lang
//this.$setGnLocale(this.lang)
this.updateContacts(this.responsibleParty)
this.updateContacts(this.responsibleParty2)
Expand Down
28 changes: 14 additions & 14 deletions src/formater-list-metadata.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<template>
<div class="mtdt-list" >
<div v-if="!metadatas" style="width:calc(100% - 150px);">{{$t('no_result')}}</div>
<formater-cartouche-metadata :width="capsuleWidth" :color="color" :depth="depth" :type="type" v-for="(meta, index) in metadatas" :key="index" :metadata="meta" v-if="meta" :lang="lang"></formater-cartouche-metadata>
<formater-cartouche-metadata :width="capsuleWidth" :color="color" :depth="depth" :type="type" v-for="(meta, index) in metadatas" :key="index" :metadata="meta" v-if="meta" :lang="$i18n.locale"></formater-cartouche-metadata>
</div>
</template>
<script>
Expand All @@ -25,10 +25,10 @@ export default {
type: Array,
default: null
},
lang: {
type: String,
default: 'en'
},
// lang: {
// type: String,
// default: 'en'
// },
depth: {
type: Number,
default: 0
Expand All @@ -42,12 +42,12 @@ export default {
default: 300
}
},
watch: {
lang (newvalue) {
this.$i18n.locale = newvalue
this.$setGnLocale(this.lang)
}
},
// watch: {
// lang (newvalue) {
// this.$i18n.locale = newvalue
// this.$setGnLocale(this.lang)
// }
// },
data() {
return {
metadatas: {},
Expand All @@ -59,8 +59,8 @@ export default {
}
},
created: function() {
this.$i18n.locale = this.lang
this.$setGnLocale(this.lang)
//this.$i18n.locale = this.lang
// this.$setGnLocale(this.lang)
this.metadataListListener = this.receiveMetadatas.bind(this)
document.addEventListener('fmt:metadataListEvent', this.metadataListListener)
},
Expand All @@ -87,7 +87,7 @@ export default {
}
var headers = {
'Accept': 'application/json, text/plain, */*',
'Accept-Language': this.lang === 'fr' ? 'fre': 'eng'
'Accept-Language': this.$i18n.locale === 'fr' ? 'fre': 'eng'
}
var url = this.$store.state.geonetwork + 'srv/api/related?type=children'
url += '&uuid=' + Object.keys(this.metadatas).join('&uuid=')
Expand Down
Loading

0 comments on commit 84dc1ee

Please sign in to comment.