Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BI-1717 (View experiment: Details, Summary Stats, Actions) #316

Merged
merged 11 commits into from
Jun 5, 2023

Conversation

davedrp
Copy link
Contributor

@davedrp davedrp commented May 23, 2023

Description

Story: BI-1717 Sub-story of BI-1644 View experiment: Details, Summary Stats, Actions

  • Created ExperimentDAO.ts and ExperimentService.ts to fetch an individual experiment
  • Created ExperimentDetails.vue to display an Experiments details.

Dependencies

bi-api: feature/BI-1716 branch

Testing

(See Acceptance Criteria in BI-1644)

Checklist:

  • I have performed a self-review of my own code
  • I have tested my code and ensured it meets the acceptance criteria of the story
  • I have create/modified unit tests to cover this change
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to documentation
  • I have run TAF: <link to TAF run>

@davedrp davedrp requested review from a team, timparsons and dmeidlin and removed request for a team May 23, 2023 17:44
@davedrp davedrp marked this pull request as ready for review May 23, 2023 18:29
Copy link
Member

@timparsons timparsons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of minor changes

config.method = 'get';
config.programId = programId;
config.experimentId = experimentId;
config.params = {stats: true};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth adding a parameter to this method for stats instead of hard-coding it to true. The parameter will need to be propagated up so that it can be set from the ExperimentDetails component

programName?: string;
startDate?: string;
trialPUI?: string;
additionalInfo?: AdditionalInfo;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be of type any to allow flexibility for future fields to be in the trial's additionalInfo

Comment on lines 63 to 79

}
export class AdditionalInfo {
createdDate?: string;
defaultObservationLevel?: string;
environmentsCount?: string;
germplasmCount?: number;

experimentNumber?: string;
experimentType?: string;

createdBy?: AdditionalInfoCreateBy;
}

export class AdditionalInfoCreateBy {
userName?: string;
userId?: string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These aren't needed if the additionalInfo field is changed to be of type any

Comment on lines 56 to 59
<!-- Per Shawn, remove this link in favor of wrapping the trial title in a link -->
<!-- <router-link v-bind:to="{name: 'experiment-details', params: {programId: activeProgram.id, experimentId: BrAPIUtils.getBreedingInsightId(props.row.data.externalReferences,'/trials')}}">-->
<!-- Details-->
<!-- </router-link>-->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. I think this commented code should be removed then.

Comment on lines 133 to 138
// console.log("TO");
// console.log(to);
// console.log("FROM");
// console.log(from);
// console.log("next");
// console.log(next);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these lines be removed?

@@ -155,6 +161,7 @@ export default class GermplasmDetails extends GermplasmBase {
private germplasmLoading: boolean = true;

mounted () {
console.log("-------mount----------");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this line be removed?

Comment on lines 181 to 184

console.log(',.,,..,.,.,.,.,.,GERMPLASM ,.,,.,...,.,.,.,');
console.log(this.germplasm);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these lines be removed?

Comment on lines +29 to +30
// contacts?: Array<Contact>;
//datasetAuthorships?: Array<TrialNewRequestDatasetAuthorships>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the commented out fields if not needed

Copy link
Member

@timparsons timparsons May 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dmeidlin I think they are commented out because the Contact and TrialNewRequestDatasetAuthorships types aren't in the code base, but these fields are a part of the BrAPI Trial model. Are you ok with leaving them in there with this in mind?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, np.

import {ExternalReferences} from "@/breeding-insight/brapi/model/externalReferences";

export class BrAPIUtils {
static getBreedingInsightId(references: ExternalReferences, referenceSourcePath: string = ""): string | undefined {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of typing the source as string with an empty string as default, would you mind making an ExternalReferenceSource enum and specify the arg as non-null?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method was copied from GermplasmUtils. I think there are places in the code that don't specify a referenceSourcePath parameter (because it's intended to just be breedinginsight.org) hence why there is a default of an empty string.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see. I'm fine leaving it as is, then.

if (this.data && this.data.synonyms && this.data.synonyms.length > 0) {
// Up to synonymsMaxLength synonyms will be shown before , ... cutoff
const synonyms = this.data.synonyms.slice(0, Math.min(this.data.synonyms.length, synonymsMaxLength)).join(", ");
console.log(synonyms);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a leftover console.log statement that needs to be deleted

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

Comment on lines 53 to 57
<a class="dropdown-item"
v-on:click="downloadFile"
>
Download file
</a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a component @/components/experiments/ExperimentObservationsDownloadButton.vue that can be used here for the Download link.

@davedrp davedrp force-pushed the feature/BI-1717 branch from a764186 to 0e3cdc0 Compare June 2, 2023 15:05
@davedrp davedrp merged commit e99a523 into develop Jun 5, 2023
@davedrp davedrp deleted the feature/BI-1717 branch June 5, 2023 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants