Skip to content

Commit

Permalink
- ADD: Added placeholder cow json file.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-raubach committed Jul 3, 2024
1 parent e696a27 commit 78e7371
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/assets/data/cows.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
20 changes: 12 additions & 8 deletions src/views/LoadExampleView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ import { addTrial } from '@/plugins/idb'
import barley from '@/assets/data/barley.json'
import measurementset from '@/assets/data/measurementset.json'
import timeline from '@/assets/data/timeline.json'
import cows from '@/assets/data/cows.json'
const data = {
barley,
measurementset,
timeline
timeline,
cows
}
export default {
Expand Down Expand Up @@ -96,7 +98,7 @@ export default {
id: 'cow',
name: this.$t('pageLoadExampleCowName'),
description: this.$t('pageLoadExampleCowDescription'),
source: 'cow',
source: 'cows',
stats: {
traits: 3,
rows: 40,
Expand All @@ -110,13 +112,15 @@ export default {
loadExample: function (example) {
const json = data[example.source]
json.createdOn = new Date().toISOString()
json.updatedOn = new Date().toISOString()
if (json.name) {
json.createdOn = new Date().toISOString()
json.updatedOn = new Date().toISOString()
addTrial(json).then(trialId => {
this.$store.dispatch('setSelectedTrial', trialId)
this.$router.push({ name: 'home' })
})
addTrial(json).then(trialId => {
this.$store.dispatch('setSelectedTrial', trialId)
this.$router.push({ name: 'home' })
})
}
}
}
}
Expand Down

0 comments on commit 78e7371

Please sign in to comment.