From 8f5312f6d5631319a39b9435990b6ad58438d999 Mon Sep 17 00:00:00 2001 From: HMS17 <84345306+HMS17@users.noreply.github.com> Date: Mon, 13 Dec 2021 14:59:21 -0500 Subject: [PATCH 01/14] [BI-1086] Germplasm lists table --- .../germplasm/GermplasmListsTable.vue | 141 ++++++++++++++++++ src/components/layouts/UserSideBarLayout.vue | 24 +++ src/router/index.ts | 23 +++ src/views/germplasm/GermplasmLists.vue | 40 +++++ 4 files changed, 228 insertions(+) create mode 100644 src/components/germplasm/GermplasmListsTable.vue create mode 100644 src/views/germplasm/GermplasmLists.vue diff --git a/src/components/germplasm/GermplasmListsTable.vue b/src/components/germplasm/GermplasmListsTable.vue new file mode 100644 index 000000000..1e7fcd074 --- /dev/null +++ b/src/components/germplasm/GermplasmListsTable.vue @@ -0,0 +1,141 @@ + + + + + diff --git a/src/components/layouts/UserSideBarLayout.vue b/src/components/layouts/UserSideBarLayout.vue index 59ac7d6d2..65b0c734a 100644 --- a/src/components/layouts/UserSideBarLayout.vue +++ b/src/components/layouts/UserSideBarLayout.vue @@ -175,6 +175,30 @@ +
  • + + Germplasm + + + + +
  • + + + + \ No newline at end of file From fdd8ca5567d40e2d056f54b01388c3fd9dd4f8ce Mon Sep 17 00:00:00 2001 From: HMS17 <84345306+HMS17@users.noreply.github.com> Date: Mon, 13 Dec 2021 17:28:11 -0500 Subject: [PATCH 02/14] [BI-1086] Germplasm lists table 2 --- .../germplasm/GermplasmListsTable.vue | 35 ++++++-------- src/components/layouts/UserSideBarLayout.vue | 48 +++++++++---------- 2 files changed, 38 insertions(+), 45 deletions(-) diff --git a/src/components/germplasm/GermplasmListsTable.vue b/src/components/germplasm/GermplasmListsTable.vue index 1e7fcd074..70425c238 100644 --- a/src/components/germplasm/GermplasmListsTable.vue +++ b/src/components/germplasm/GermplasmListsTable.vue @@ -43,7 +43,12 @@ @@ -62,16 +67,11 @@ diff --git a/src/components/layouts/UserSideBarLayout.vue b/src/components/layouts/UserSideBarLayout.vue index 65b0c734a..4675c0a8a 100644 --- a/src/components/layouts/UserSideBarLayout.vue +++ b/src/components/layouts/UserSideBarLayout.vue @@ -109,6 +109,30 @@ Home
  • +
  • + + Germplasm + + + + +
  • -
  • - - Germplasm - - - - -
  • Date: Tue, 21 Dec 2021 15:48:11 -0500 Subject: [PATCH 03/14] Small variable name fix --- src/components/germplasm/GermplasmListsTable.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/germplasm/GermplasmListsTable.vue b/src/components/germplasm/GermplasmListsTable.vue index 70425c238..63fd1a7f0 100644 --- a/src/components/germplasm/GermplasmListsTable.vue +++ b/src/components/germplasm/GermplasmListsTable.vue @@ -19,7 +19,7 @@
    ({GermplasmLists}) + } }) export default class GermplasmListsTable extends Vue { private activeProgram?: Program; private germplasmListsPagination?: Pagination = new Pagination(); private paginationController: PaginationController = new PaginationController(); + private germplasmLists: String[] = []; + //private germplasmLists: Germplasm[] = []; + //todo do i need to make a germplasm model mounted() { this.getGermplasmLists(); From 38ddd7b1f8faf62f9f9e989e70e67fedb15e7bad Mon Sep 17 00:00:00 2001 From: HMS17 <84345306+HMS17@users.noreply.github.com> Date: Mon, 13 Dec 2021 14:59:21 -0500 Subject: [PATCH 04/14] [BI-1086] Germplasm lists table --- src/components/layouts/UserSideBarLayout.vue | 24 ++++++++++++++++++++ src/router/index.ts | 1 + 2 files changed, 25 insertions(+) diff --git a/src/components/layouts/UserSideBarLayout.vue b/src/components/layouts/UserSideBarLayout.vue index 4675c0a8a..1a30ed139 100644 --- a/src/components/layouts/UserSideBarLayout.vue +++ b/src/components/layouts/UserSideBarLayout.vue @@ -199,6 +199,30 @@
  • +
  • + + Germplasm + + + + +
  • Date: Mon, 13 Dec 2021 17:28:11 -0500 Subject: [PATCH 05/14] [BI-1086] Germplasm lists table 2 --- .../germplasm/GermplasmListsTable.vue | 2 +- src/components/layouts/UserSideBarLayout.vue | 24 ------------------- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/src/components/germplasm/GermplasmListsTable.vue b/src/components/germplasm/GermplasmListsTable.vue index 63fd1a7f0..321b41918 100644 --- a/src/components/germplasm/GermplasmListsTable.vue +++ b/src/components/germplasm/GermplasmListsTable.vue @@ -19,7 +19,7 @@
  • -
  • - - Germplasm - - - - -
  • Date: Tue, 21 Dec 2021 15:48:11 -0500 Subject: [PATCH 06/14] Small variable name fix --- src/components/germplasm/GermplasmListsTable.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/germplasm/GermplasmListsTable.vue b/src/components/germplasm/GermplasmListsTable.vue index 321b41918..63fd1a7f0 100644 --- a/src/components/germplasm/GermplasmListsTable.vue +++ b/src/components/germplasm/GermplasmListsTable.vue @@ -19,7 +19,7 @@
    Date: Wed, 5 Jan 2022 18:40:15 -0500 Subject: [PATCH 07/14] Working on retrieving lists, table still empty --- .../service/GermplasmService.ts | 73 +++++++++++++++++++ .../germplasm/GermplasmListsTable.vue | 25 +++---- 2 files changed, 85 insertions(+), 13 deletions(-) create mode 100644 src/breeding-insight/service/GermplasmService.ts diff --git a/src/breeding-insight/service/GermplasmService.ts b/src/breeding-insight/service/GermplasmService.ts new file mode 100644 index 000000000..cf3cdb412 --- /dev/null +++ b/src/breeding-insight/service/GermplasmService.ts @@ -0,0 +1,73 @@ +/* + * See the NOTICE file distributed with this work for additional information + * regarding copyright ownership. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {GermplasmList} from "@/breeding-insight/model/GermplasmList"; +import {BiResponse, Metadata} from "@/breeding-insight/model/BiResponse"; +import {PaginationQuery} from "@/breeding-insight/model/PaginationQuery"; +import {PaginationController} from "@/breeding-insight/model/view_models/PaginationController"; +import * as api from "@/util/api"; + +export class GermplasmService { + + static getAll(programId: string, paginationQuery?: PaginationQuery): Promise<[GermplasmList[], Metadata]> { + return new Promise<[GermplasmList[], Metadata]>(((resolve, reject) => { + + let germplasmLists: GermplasmList[] = []; + + if (paginationQuery === undefined) { + paginationQuery = new PaginationQuery(0, 0, true); + } + + if (programId) { + const config: any = {}; + config.url = `${process.env.VUE_APP_BI_API_V1_PATH}/programs/${programId}/brapi/v2/lists`; + //http://localhost:8081/v1/lists + + config.method = 'get'; + config.programId = programId; + + return new Promise<[GermplasmList[], Metadata]>(((resolve, reject) => { + api.call(config) + .then((response: any) => { + const biResponse = new BiResponse(response.data); + if (biResponse.result.data) { + //TODO: Remove when backend default sorting is implemented + biResponse.result.data = PaginationController.mockSortRecords(biResponse.result.data); + germplasmLists = biResponse.result.data.map((germplasmList: any) => { + return germplasmList as GermplasmList; + }); + } + + //TODO: Remove when backend pagination is implemented + let newPagination; + [germplasmLists, newPagination] = PaginationController.mockPagination(germplasmLists, paginationQuery!.page, paginationQuery!.pageSize, paginationQuery!.showAll); + biResponse.metadata.pagination = newPagination; + + resolve([germplasmLists, biResponse.metadata]); + //resolve(biResponse); + }).catch((error) => { + reject(error); + }) + + })) + } else { + reject(); + } + })); + } + +} diff --git a/src/components/germplasm/GermplasmListsTable.vue b/src/components/germplasm/GermplasmListsTable.vue index 63fd1a7f0..8091c8e12 100644 --- a/src/components/germplasm/GermplasmListsTable.vue +++ b/src/components/germplasm/GermplasmListsTable.vue @@ -16,11 +16,10 @@ -->