diff --git a/src/assets/scss/main.scss b/src/assets/scss/main.scss index 1c3930eca..1486694f2 100644 --- a/src/assets/scss/main.scss +++ b/src/assets/scss/main.scss @@ -322,6 +322,10 @@ table tr.is-edited + .detail { } } +.table td.fixed-width-wrapped { + word-break: break-word; + width: 25%; +} .table.is-striped tbody tr:not(.is-edited):nth-child(2n).is-new { background-color: $success-light; diff --git a/src/breeding-insight/dao/TrialDAO.ts b/src/breeding-insight/dao/TrialDAO.ts index df3cb999b..da7588ad5 100644 --- a/src/breeding-insight/dao/TrialDAO.ts +++ b/src/breeding-insight/dao/TrialDAO.ts @@ -23,13 +23,13 @@ import { Result, Err, Success, ResultGenerator } from "@/breeding-insight/model/ export class TrialDAO { - static async getAll(programId: string, paginationQuery: PaginationQuery, full : boolean): Promise> { + static async getAll(programId: string, paginationQuery: PaginationQuery, full : boolean, metadata: boolean): Promise> { try { // TODO: update pageSize setting when we can do backend brapi sorting const { data } = await api.call({ url: `${process.env.VUE_APP_BI_API_V1_PATH}/programs/${programId}/brapi/v2/trials`, method: 'get', - params: { full, pageSize: 1000000 } + params: { full, pageSize: 1000000, metadata: true } }) as Response; return ResultGenerator.success(new BiResponse(data)); diff --git a/src/breeding-insight/service/TrialService.ts b/src/breeding-insight/service/TrialService.ts index aad9ae68c..fa08779db 100644 --- a/src/breeding-insight/service/TrialService.ts +++ b/src/breeding-insight/service/TrialService.ts @@ -24,7 +24,7 @@ import {Result, Err, Success, ResultGenerator } from "@/breeding-insight/model/R export class TrialService { - static async getAll(programId: string, paginationQuery?: PaginationQuery, full?: boolean): Promise> { + static async getAll(programId: string, paginationQuery?: PaginationQuery, full?: boolean, metadata?:boolean): Promise> { if (paginationQuery === undefined){ paginationQuery = new PaginationQuery(0, 0, true); @@ -34,10 +34,14 @@ export class TrialService { full = false; } + if (metadata === undefined) { + metadata = true; + } + try { if(!programId) throw new Error('missing or invalid program id'); - let response = await TrialDAO.getAll(programId, paginationQuery, full) as Result; + let response = await TrialDAO.getAll(programId, paginationQuery, full, metadata) as Result; if(response.isErr()) throw response.value; const frontendModel = (res: BiResponse): [Trial[], Metadata] => { @@ -46,7 +50,7 @@ export class TrialService { data = PaginationController.mockSortRecords(data); trials = data.map((trial: any) => { - return new Trial(trial.trialDbId, trial.trialName, trial.active); + return trial as Trial; }); let newPagination; diff --git a/src/components/experiments/ExperimentsObservationsTable.vue b/src/components/experiments/ExperimentsObservationsTable.vue new file mode 100644 index 000000000..d3c603b5f --- /dev/null +++ b/src/components/experiments/ExperimentsObservationsTable.vue @@ -0,0 +1,163 @@ + + + + + diff --git a/src/components/layouts/UserSideBarLayout.vue b/src/components/layouts/UserSideBarLayout.vue index ac99c2a71..14f5252cc 100644 --- a/src/components/layouts/UserSideBarLayout.vue +++ b/src/components/layouts/UserSideBarLayout.vue @@ -138,9 +138,9 @@
  • - Trials and Studies Beta + Experiments & Observations
  • diff --git a/src/router/index.ts b/src/router/index.ts index 7d608e068..6267854a8 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -67,6 +67,7 @@ import ProgramConfiguration from "@/views/program/ProgramConfiguration.vue"; import JobManagement from '@/views/program/JobManagement.vue'; import GermplasmPedigreesView from "@/components/germplasm/GermplasmPedigreesView.vue"; import ImportExperiment from "@/views/import/ImportExperiment.vue"; +import ExperimentsAndObservations from "@/views/experiments-and-observations/ExperimentsAndObservations.vue"; Vue.use(VueRouter); @@ -171,35 +172,14 @@ const routes = [ component: StudiesList }, { - path: '/programs/:programId/trials-studies', - name: 'trials-studies', + path: '/programs/:programId/experiments-observations', + name: 'experiments-observations', meta: { - title: 'Trials and Studies', + title: 'Experiments & Observations', layout: layouts.userSideBar }, - component: TrialsAndStudies, - redirect: {name: 'trials-list'}, - beforeEnter: processProgramNavigation, - children: [ - { - path: 'studies', - name: 'studies-list', - meta: { - title: 'Studies', - layout: layouts.userSideBar - }, - component: StudiesList - }, - { - path: 'trials', - name: 'trials-list', - meta: { - title: 'Trials', - layout: layouts.userSideBar - }, - component: Trials - } - ] + component: ExperimentsAndObservations, + beforeEnter: processProgramNavigation }, { path: '/programs/:programId/program-management', diff --git a/src/views/experiments-and-observations/ExperimentsAndObservations.vue b/src/views/experiments-and-observations/ExperimentsAndObservations.vue new file mode 100644 index 000000000..41d2b60c2 --- /dev/null +++ b/src/views/experiments-and-observations/ExperimentsAndObservations.vue @@ -0,0 +1,70 @@ + + + + +