Skip to content

Commit

Permalink
Merge branch 'develop' into feature/BI-1473
Browse files Browse the repository at this point in the history
  • Loading branch information
nickpalladino authored Apr 19, 2023
2 parents 5f4abed + 9293a4b commit a85b58f
Show file tree
Hide file tree
Showing 19 changed files with 104 additions and 45 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ npx npm-check -u
See [Configuration Reference](https://cli.vuejs.org/config/).

## Style and layout
A guide to visual design conventions and writing style can be found at `/styleguide` after authentication.
For example, if you are running the app locally on port 8080, the style guide URL would be [http://localhost:8080/styleguide].
A guide to visual design conventions and writing style can be found at `/style-guide` after authentication.
For example, if you are running the app locally on port 8080, the style guide URL would be [http://localhost:8080/style-guide](http://localhost:8080/style-guide).

## Layout template usage standards
General guidance for using each of the layout templates in `/components/layouts`:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bi-web",
"version": "v0.8.0+519",
"version": "v0.8.0+527",
"private": true,
"scripts": {
"build": "node $npm_package_config_task_path/build.js --dev-audit-level=critical --prod-audit-level=none",
Expand Down Expand Up @@ -93,5 +93,5 @@
"vue-cli-plugin-axios": "0.0.4",
"vue-template-compiler": "^2.6.10"
},
"versionInfo": "https://github.com/Breeding-Insight/bi-web/commit/8939ce282fdba86a7b50f3ce735ef713d2dfc2b4"
"versionInfo": "https://github.com/Breeding-Insight/bi-web/commit/b6c481fedb53107564dd3723be0f69794f7f9e87"
}
24 changes: 24 additions & 0 deletions src/breeding-insight/model/BaseFilter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* 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.
*/

export enum BaseField {
DateFormat = "dateDisplayFormat",
}

export class BaseFilter {
[BaseField.DateFormat]: string = "yyyy-MM-dd";
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,24 @@
* limitations under the License.
*/


// germplasm
import {GermplasmSortField} from "@/breeding-insight/model/Sort";
import {BaseFilter} from "@/breeding-insight/model/BaseFilter";

export enum GermplasmBIField {
ListDbId = "listDbId",
ListName = "listName",
ListDbId = "listDbId",
ListName = "listName",
}

export class GermplasmFilter {
[GermplasmBIField.ListDbId]: string;
[GermplasmBIField.ListName]: string;
[GermplasmSortField.AccessionNumber]: string;
[GermplasmSortField.DefaultDisplayName]: string;
[GermplasmSortField.BreedingMethod]: string;
[GermplasmSortField.SeedSource]: string;
[GermplasmSortField.Pedigree]: string;
[GermplasmSortField.FemaleParent]: string;
[GermplasmSortField.MaleParent]: string;
[GermplasmSortField.CreatedDate]: string;
[GermplasmSortField.UserName]: string;
export class GermplasmFilter extends BaseFilter {
[GermplasmBIField.ListDbId]: string;
[GermplasmBIField.ListName]: string;
[GermplasmSortField.AccessionNumber]: string;
[GermplasmSortField.DefaultDisplayName]: string;
[GermplasmSortField.BreedingMethod]: string;
[GermplasmSortField.SeedSource]: string;
[GermplasmSortField.Pedigree]: string;
[GermplasmSortField.FemaleParent]: string;
[GermplasmSortField.MaleParent]: string;
[GermplasmSortField.CreatedDate]: string;
[GermplasmSortField.UserName]: string;
}
2 changes: 1 addition & 1 deletion src/breeding-insight/service/GermplasmService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {Germplasm} from "@/breeding-insight/brapi/model/germplasm";
import {Result, ResultGenerator} from "@/breeding-insight/model/Result";
import {SortOrder} from "@/breeding-insight/model/Sort";
import * as api from "@/util/api";
import {GermplasmFilter} from "@/breeding-insight/model/Filter";
import {GermplasmFilter} from "@/breeding-insight/model/GermplasmFilter";

export class GermplasmService {

Expand Down
25 changes: 25 additions & 0 deletions src/breeding-insight/utils/BrAPIDateTime.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* 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.
*/

// DateTime format strings based on the BrAPI spec,
// see https://plant-breeding-api.readthedocs.io/en/latest/docs/best_practices/Dates_and_Times.html
// for more information.

// The Java BI API interpretable format for displayed Date values, e.g. 2023-03-31.
export const JAVA_BRAPI_DATE_FORMAT = 'yyyy-MM-dd';
// The moment.js interpretable format for displayed Date values, e.g. 2023-03-31.
export const MOMENT_BRAPI_DATE_FORMAT = 'YYYY-MM-DD';
8 changes: 6 additions & 2 deletions src/breeding-insight/utils/GermplasmUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ import moment from "moment";
import {Germplasm} from "@/breeding-insight/brapi/model/germplasm";
import {ExternalReferences} from "@/breeding-insight/brapi/model/externalReferences";
import {GermplasmService} from "@/breeding-insight/service/GermplasmService";
import {MOMENT_BRAPI_DATE_FORMAT} from "@/breeding-insight/utils/BrAPIDateTime";

// The moment.js interpretable format for Date values sent and received via the BI API.
export const MOMENT_DATE_PERSISTED_FORMAT = 'DD/MM/YYYY h:mm:ss';

export class GermplasmUtils {
static getExternalUID(germplasm: Germplasm): string | undefined {
Expand All @@ -33,8 +37,8 @@ export class GermplasmUtils {

static getCreatedDate(germplasm: Germplasm): string | undefined {
if (germplasm.additionalInfo && germplasm.additionalInfo.createdDate) {
let dateTime = moment(germplasm.additionalInfo!.createdDate!, "DD/MM/YYYY h:mm:ss");
return dateTime.format("YYYY-MM-DD");
let dateTime = moment(germplasm.additionalInfo!.createdDate!, MOMENT_DATE_PERSISTED_FORMAT);
return dateTime.format(MOMENT_BRAPI_DATE_FORMAT);
}
return "";
}
Expand Down
11 changes: 8 additions & 3 deletions src/components/germplasm/GermplasmListsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ import {
} from "@/breeding-insight/model/Sort";
import {UPDATE_EXPERIMENT_SORT} from "@/store/sorting/mutation-types";
import { PaginationQuery } from '@/breeding-insight/model/PaginationQuery';
import {BaseFilter} from "@/breeding-insight/model/BaseFilter";
import {MOMENT_BRAPI_DATE_FORMAT} from "@/breeding-insight/utils/BrAPIDateTime";

@Component({
mixins: [validationMixin],
Expand Down Expand Up @@ -134,7 +136,7 @@ export default class GermplasmListsTable extends Vue {
private fileOptions = Object.values(FileType);

private germplasmListSort!: GermplasmListSort;
private filters: any = {};
private filters: BaseFilter = new BaseFilter();
private germplasmListCallStack?: CallStack;

private updateSort!: (sort: GermplasmListSort) => void;
Expand All @@ -147,7 +149,10 @@ export default class GermplasmListsTable extends Vue {
};

initSearch(filter: any) {
this.filters = filter;

// Merge, overriding any properties of this.filters that exist in filter.
this.filters = {...this.filters, ...filter};

// When filtering the list, set the page to the first page.
this.paginationController.updatePage(1);
}
Expand Down Expand Up @@ -197,7 +202,7 @@ export default class GermplasmListsTable extends Vue {
}

formatDate(date: Date) {
return moment(date).format('YYYY-MM-DD');
return moment(date).format(MOMENT_BRAPI_DATE_FORMAT);
}

setSort(field: string, order: string) {
Expand Down
8 changes: 5 additions & 3 deletions src/components/germplasm/GermplasmTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ import {
import {UPDATE_GERMPLASM_SORT} from "@/store/sorting/mutation-types";
import {GermplasmService} from "@/breeding-insight/service/GermplasmService";
import { PaginationQuery } from '@/breeding-insight/model/PaginationQuery';
import {GermplasmFilter} from "@/breeding-insight/model/GermplasmFilter";
@Component({
mixins: [validationMixin],
Expand Down Expand Up @@ -127,7 +128,7 @@ export default class GermplasmTable extends Vue {
private paginationController: PaginationController = new PaginationController();
private germplasmLoading: Boolean = true;
private germplasm: Germplasm[] = [];
private filters: any = {};
private filters: GermplasmFilter = new GermplasmFilter();
private germplasmCallStack?: CallStack;
Expand Down Expand Up @@ -201,8 +202,9 @@ export default class GermplasmTable extends Vue {
}
initSearch(filters: any) {
this.filters = filters;
// Merge, overriding any properties of this.filters that exist in filters.
this.filters = {...this.filters, ...filters};
// When filtering the list, set a page to the first page.
this.paginationController.updatePage(1);
Expand Down
10 changes: 5 additions & 5 deletions src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ import GermplasmByList from "@/views/germplasm/GermplasmByList.vue";
import GermplasmLists from "@/views/germplasm/GermplasmLists.vue";
import BreedingMethods from "@/views/germplasm/BreedingMethods.vue";
import GermplasmDetails from "@/views/germplasm/GermplasmDetails.vue";
import OntologySharing from "@/views/program/OntologySharing.vue";
import ProgramConfiguration from "@/views/program/ProgramConfiguration.vue";
import JobManagement from '@/views/program/JobManagement.vue';
import GermplasmPedigreesView from "@/components/germplasm/GermplasmPedigreesView.vue";
import GermplasmGenotypeView from "@/components/germplasm/GermplasmGenotypeView.vue";
Expand Down Expand Up @@ -223,13 +223,13 @@ const routes = [
component: BreedingMethods
},
{
path: 'ontology-sharing',
name: 'ontology-sharing',
path: 'configuration',
name: 'configuration',
meta: {
title: 'Ontology Sharing',
title: 'Configuration',
layout: layouts.userSideBar
},
component: OntologySharing
component: ProgramConfiguration
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion src/store/filtering/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import {GetterTree} from 'vuex';
import {RootState} from "@/store/types";
import {FilterState} from "@/store/filtering/types";
import {GermplasmFilter} from "@/breeding-insight/model/Filter";
import {GermplasmFilter} from "@/breeding-insight/model/GermplasmFilter";

export const getters: GetterTree<FilterState, RootState> = {
// germplasm
Expand Down
2 changes: 1 addition & 1 deletion src/store/filtering/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {getters} from '@/store/filtering/getters';
import {mutations} from '@/store/filtering/mutations';
import {RootState} from '@/store/types';
import {FilterState} from "@/store/filtering/types";
import {GermplasmFilter} from "@/breeding-insight/model/Filter";
import {GermplasmFilter} from "@/breeding-insight/model/GermplasmFilter";

export let state: FilterState;
state = {
Expand Down
2 changes: 1 addition & 1 deletion src/store/filtering/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import {MutationTree} from 'vuex';
import {FilterState} from "@/store/filtering/types";
import {GermplasmFilter} from "@/breeding-insight/model/Filter";
import {GermplasmFilter} from "@/breeding-insight/model/GermplasmFilter";
import {UPDATE_GERMPLASM_FILTER} from "@/store/filtering/mutation-types";

export const mutations: MutationTree<FilterState> = {
Expand Down
2 changes: 1 addition & 1 deletion src/store/filtering/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GermplasmFilter } from "@/breeding-insight/model/Filter";
import { GermplasmFilter } from "@/breeding-insight/model/GermplasmFilter";

export interface FilterState {
// germplasm table
Expand Down
2 changes: 1 addition & 1 deletion src/views/import/ImportExperiment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

<template v-slot:importInfoTemplateMessageBox>
<ImportInfoTemplateMessageBox v-bind:import-type-name="'Experiments & Observations'"
v-bind:template-url="'https://cornell.box.com/shared/static/wp6tmlt0585ryid3csccj3q1w2fiyg9d.xls'"
v-bind:template-url="'https://cornell.box.com/shared/static/28k65fg3mrrcv5s8hm86ap9qijbbi06b.xls'"
class="mb-5">
<strong>Before You Import...</strong>
<br/>
Expand Down
2 changes: 1 addition & 1 deletion src/views/import/ImportGermplasm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

<template v-slot:importInfoTemplateMessageBox>
<ImportInfoTemplateMessageBox v-bind:import-type-name="'Germplasm'"
v-bind:template-url="'https://cornell.box.com/shared/static/7ct5k3tljr20uzo2wt2qlc5jgi46sopg.xls'"
v-bind:template-url="'https://cornell.box.com/shared/static/raxqv3pbz858jjdb33ymsepbyizt9imd.xls'"
class="mb-5">
<strong>Before You Import...</strong>
<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
-->

<template>
<div id="ontology-sharing">
<div id="program-configuration">
<SharedOntologyConfiguration
v-on="$listeners"
class="mb-6"
Expand Down Expand Up @@ -51,7 +51,7 @@ import BreedingMethods from "@/views/germplasm/BreedingMethods.vue";
])
}
})
export default class OntologySharing extends ProgramsBase {
export default class ProgramConfiguration extends ProgramsBase {
// Change tracker to pass to children for refresh
private subscribeAction: number = 0;
private shareAction: number = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/views/program/ProgramManagement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
</router-link>
<router-link
v-if="$ability.can('access', 'ProgramConfiguration')"
v-bind:to="{name: 'ontology-sharing', params: {programId: activeProgram.id}}"
v-bind:to="{name: 'configuration', params: {programId: activeProgram.id}}"
tag="li" active-class="is-active">
<a>Ontology Sharing</a>
<a>Configuration</a>
</router-link>
</ul>
</nav>
Expand Down
2 changes: 1 addition & 1 deletion src/views/trait/TraitsImport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export default class TraitsImport extends ProgramsBase {
private showAbortModal = false;

private yesAbortId: string = "traitsimport-yes-abort";
private templateUrl: string = "https://cornell.box.com/shared/static/7vtd4vkzc2efrdlion74miql9surugqd.xls";
private templateUrl: string = "https://cornell.box.com/shared/static/2erlubbeobuv1tochwkbuq5jghdayuei.xls";

private confirmImportState: DataFormEventBusHandler = new DataFormEventBusHandler();

Expand Down

0 comments on commit a85b58f

Please sign in to comment.