Skip to content

Commit

Permalink
- CHG: Support for dataset details modification on trials creation page.
Browse files Browse the repository at this point in the history
- ADD: Added initial support for GridScore trial creation link creation.
  • Loading branch information
sebastian-raubach committed Feb 13, 2024
1 parent de0481a commit 1881b1a
Show file tree
Hide file tree
Showing 5 changed files with 312 additions and 17 deletions.
194 changes: 194 additions & 0 deletions public/img/tools/gridscore.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 32 additions & 7 deletions src/components/modals/DatasetEditModal.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<template>
<b-modal :ref="`datasetEditModal-${id}`" size="lg" :title="dataset ? dataset.datasetName : $t('modalTitleAddDataset')" :ok-title="$t(dataset ? 'buttonUpdate' : 'buttonUpload')" @ok.prevent="updateDataset" header-class="dataset-edit-modal-header">
<b-modal :ref="`datasetEditModal-${id}`"
size="lg"
:title="dataset ? dataset.datasetName : $t('modalTitleAddDataset')"
:ok-title="$t(dataset ? 'buttonUpdate' : 'buttonUpload')"
@ok.prevent="updateDataset"
:ok-disabled="loading"
header-class="dataset-edit-modal-header">
<b-form @submit.prevent="updateDataset" novalidate>
<b-row>
<b-col cols=12 lg=6>
Expand All @@ -14,12 +20,22 @@
</b-col>
<b-col cols=12 lg=6>
<b-form-group label-for="dataset-start-date" :label="$t('tableColumnDatasetStartDate')">
<b-form-datepicker :value-as-date="true" v-model="datasetStartDate" id="dataset-start-date" />
<b-input-group>
<b-form-datepicker :value-as-date="true" v-model="datasetStartDate" id="dataset-start-date" />
<b-input-group-append>
<b-button @click="datasetStartDate = null"><MdiIcon :path="mdiCancel" /></b-button>
</b-input-group-append>
</b-input-group>
</b-form-group>
</b-col>
<b-col cols=12 lg=6>
<b-form-group label-for="dataset-end-date" :label="$t('tableColumnDatasetEndDate')">
<b-form-datepicker :value-as-date="true" v-model="datasetEndDate" id="dataset-end-date" />
<b-input-group>
<b-form-datepicker :value-as-date="true" v-model="datasetEndDate" id="dataset-end-date" />
<b-input-group-append>
<b-button @click="datasetEndDate = null"><MdiIcon :path="mdiCancel" /></b-button>
</b-input-group-append>
</b-input-group>
</b-form-group>
</b-col>
<b-col cols=12 lg=6>
Expand Down Expand Up @@ -85,7 +101,7 @@ import { apiPatchDataset, apiPostDataset, apiGetLicenses, apiPostExperimentTable
import { datasetStates, datasetTypes } from '@/mixins/types'
import { uuidv4 } from '@/mixins/util'
import { mdiPlusBox, mdiPencil } from '@mdi/js'
import { mdiPlusBox, mdiPencil, mdiCancel } from '@mdi/js'
import { MAX_JAVA_INTEGER } from '@/mixins/api/base'
export default {
Expand All @@ -108,6 +124,7 @@ export default {
return {
mdiPlusBox,
mdiPencil,
mdiCancel,
id: uuidv4(),
datasetState: null,
selectedDatasetType: null,
Expand All @@ -127,7 +144,8 @@ export default {
datasetState: null,
selectedDatasetType: null
},
formFeedback: null
formFeedback: null,
loading: false
}
},
computed: {
Expand Down Expand Up @@ -227,6 +245,7 @@ export default {
selectedDatasetType: null
}
this.formFeedback = null
this.loading = false
if (this.dataset) {
this.datasetState = datasetStates[this.dataset.datasetState].id
Expand All @@ -246,8 +265,8 @@ export default {
this.isExternal = false
this.licenseId = null
this.experimentId = null
this.datasetStartDate = new Date()
this.datasetEndDate = new Date()
this.datasetStartDate = null
this.datasetEndDate = null
}
this.updateExperiments()
Expand Down Expand Up @@ -315,6 +334,8 @@ export default {
this.formFeedback = null
}
this.loading = true
if (this.dataset) {
return apiPatchDataset(this.dataset.datasetId, {
name: this.datasetName,
Expand All @@ -325,6 +346,8 @@ export default {
dateEnd: this.datasetEndDate,
datasetStateId: this.datasetState
}, (result) => {
this.loading = false
if (result) {
this.$emit('changed', result)
this.hide()
Expand All @@ -342,6 +365,8 @@ export default {
datasettypeId: this.selectedDatasetType,
isExternal: this.isExternal
}, (result) => {
this.loading = false
if (result) {
this.$emit('changed', result)
this.hide()
Expand Down
5 changes: 4 additions & 1 deletion src/mixins/api/trait.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ const apiGetTraitDistinctValues = (traitId, onSuccess, onError) => authAxios({ u

const apiPostTrialLocationCount = (queryData, onSuccess, onError) => authAxios({ url: 'dataset/data/trial/location/count', method: 'POST', data: queryData, success: onSuccess, error: onError })

const apiPostTrialCreation = (data, onSuccess, onError) => authAxios({ url: 'dataset/data/trial', method: 'POST', data: data, success: onSuccess, error: onError })

export {
apiPostTrialsDataTable,
apiPostTrialsDataTableIds,
Expand All @@ -67,5 +69,6 @@ export {
apiPostTrialLocationCount,
apiPostTraitAttributeTable,
apiPostTrialsDataTimepoints,
apiPostTrialGermplasm
apiPostTrialGermplasm,
apiPostTrialCreation
}
Loading

0 comments on commit 1881b1a

Please sign in to comment.