Skip to content

Commit

Permalink
Merge pull request #2157 from FAIRsharing/dev
Browse files Browse the repository at this point in the history
Merging Dev in Master
  • Loading branch information
ramGranell authored Oct 4, 2023
2 parents 1464751 + fc79ddd commit 8937013
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"prettier": "^2.8.6",
"roboto-fontface": "*",
"sigma": "^2.4.0",
"simple-analytics-vue": "^3.0.2",
"trace-unhandled": "^2.0.1",
"tsparticles": "^2.8.0",
"v-clipboard": "^2.2.3",
Expand Down
12 changes: 9 additions & 3 deletions src/components/Records/Record/AdditionalInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,15 @@ export default {
// if received node is not an array
if (!isArray(selectedNode)) {
this.tempData[key] = []
Object.keys(selectedNode).forEach(item_key => {
this.tempData[key].push({[item_key]: selectedNode[item_key]})
})
// Special case this is a string
if (typeof selectedNode === 'string' ){
this.tempData[key].push({"Value": selectedNode})
}
else {
Object.keys(selectedNode).forEach(item_key => {
this.tempData[key].push({[item_key]: selectedNode[item_key]})
})
}
return
}
// if received node is an array
Expand Down
4 changes: 4 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import VueSanitize from "vue-sanitize";
import Particles from "vue2-particles";
import VueGtag from "vue-gtag";
import VueHead from 'vue-head';
import SimpleAnalytics from "simple-analytics-vue";
import "vue-code-highlight/themes/prism-twilight.css";
import "vue-code-highlight/themes/window.css";
import 'prism-es6/components/prism-ruby.min';
Expand Down Expand Up @@ -63,6 +64,9 @@ Vue.use(VueGtag, {
config: { id: process.env.VUE_APP_ANALYTICS_ID }
});
Vue.use(VueHead);
Vue.use(SimpleAnalytics, {
skip: process.env.NODE_ENV !== 'production'
})

router.beforeEach(async(to, from, next) => await beforeEach(to, from, next, store));
router.afterEach(async(to) => await afterEach(to));
Expand Down
6 changes: 6 additions & 0 deletions tests/unit/components/Records/Record/AdditionalInfo.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ describe("AdditionalInfo.vue", function(){
await wrapper.vm.setAvailableData(selectedNode,'n')
selectedNode = [{}]
await wrapper.vm.setAvailableData(selectedNode,'a')
await wrapper.vm.setAvailableData("Hello",'justString')
expect(wrapper.vm.tempData).toStrictEqual({
"a": [
{
Expand All @@ -88,6 +89,11 @@ describe("AdditionalInfo.vue", function(){
{
"a": []
}
],
"justString": [
{
"Value": "Hello"
}
]
});
});
Expand Down

0 comments on commit 8937013

Please sign in to comment.