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

Sample details refactor/ default assembly #1327

Conversation

deepsidhu85
Copy link
Contributor

@deepsidhu85 deepsidhu85 commented Jun 23, 2022

Description of changes

What did you change in this pull request? Provide a description of files changed, user interactions changed, etc. Include how to test your changes.

Added functionality to allow setting of a default genome assembly for a sample. This will be useful when #1257 is merged in.

Related issue

Link to the GitHub issue this pull request addresses using the #issuenum format. If it completes an issue, use Fixes #issuenum to automatically close the issue.

Checklist

Things for the developer to confirm they've done before the PR should be accepted:

* [ ] CHANGELOG.md (and UPGRADING.md if necessary) updated with information for new change.

  • Tests added (or description of how to test) for any new features.
    * [ ] User documentation updated for UI or technical changes.

@deepsidhu85 deepsidhu85 changed the title WIP: Sample details refactor/ default assembly Sample details refactor/ default assembly Jun 29, 2022
@deepsidhu85 deepsidhu85 added the UI User Interface Issue label Jun 29, 2022
genomeAssemblyId: genomeAssemblyObj.identifier,
})
.then(({ data }) => {
dispatch(setDefaultGenomeAssembly(genomeAssemblyObj));
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you need to store this as state? The point to using redux toolkit is that it handles the state and you just need to invalidate to update. It has it's own cache to handle this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The default tag doesn't update in the UI without it. If you look in samples.js we invalidateTags: ["SampleDetails"]. However even with this it doesn't update the UI side even when a different assembly is updated. Same thing applies to the setting of a default sequencing object

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is because the tag here is set up wrong.  If you look at the docs for invalidating tags, we do not actually set the tag type on the object itself. I think where we dropped the ball was, instead of:

providesTags: ["SampleDetails"],
providesTags: (result) =>  [{ type: 'SampleDetails', id: details.identifier }],

I have not played with it, but it seems more like what they are looking for and probably why we are not getting invalidation and refetching.

@joshsadam joshsadam merged commit 5e26af3 into phac-nml:sample-details-refactor Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UI User Interface Issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants