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

getOptions getter for Phase 2 store refactor #353

Merged
merged 14 commits into from
Feb 9, 2023

Conversation

jarmoza
Copy link
Contributor

@jarmoza jarmoza commented Feb 8, 2023

This closes #276.

This PR implements two new store getters getCategoricalOptions and getTransformOptions for the phase 2 store refactor, tests for them, and necessary refactors to components/tests that use these getters.

These getters handle retrieving options for categorical columns (via the Levels key in a column in dataDictionary.userProvided) and continuous values categories (soon to be for columns) from a new store field transformationHeuristics.

Unit tests have been implemented for current option retrieval scenarios in store-getters-getCategoricalOptions.cy.js and store-getters-getTransformOptions.cy.js.

Both the annot-continuous-values and annot-categorical components have been lightly refactored to make use of these new getters. (Additionally, some formatting changes have been made in these component/test files to accord with code formatting in the repo.)

At least one open question for this PR is a point of discussion as to whether or not this new store field transformationHeuristics is a reasonable spot and configuration for storing transform heuristic options.

@jarmoza jarmoza added annotation page data store maint:refactor Simplifying or restructuring existing code or documentation. labels Feb 8, 2023
@jarmoza jarmoza requested a review from surchs February 8, 2023 20:54
@jarmoza jarmoza added the flag:discuss Flag issue that needs to be discussed before it can be implemented. label Feb 8, 2023
Copy link
Contributor

@surchs surchs left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @jarmoza. All looks good, but I think we'll need to change where the categorical options are coming from, "Levels" or even the data dictionary in general don't make sense. I left a more detailed comment inline.

components/annot-continuous-values.vue Show resolved Hide resolved
cypress/component/annot-categorical.cy.js Outdated Show resolved Hide resolved
cypress/unit/store-getter-getCategoricalOptions.cy.js Outdated Show resolved Hide resolved
components/annot-categorical.vue Outdated Show resolved Hide resolved
cypress/unit/store-getter-getCategoricalOptions.cy.js Outdated Show resolved Hide resolved
store/index.js Outdated Show resolved Hide resolved
@surchs
Copy link
Contributor

surchs commented Feb 9, 2023

At least one open question for this PR is a point of discussion as to whether or not this new store field transformationHeuristics is a reasonable spot and configuration for storing transform heuristic options.

Ah, missed this. The transformHeuristics field makes sense to me - if you feel like this is a likely refactor target in the near future, we could add a TODO comment so we'll be reminded to think about it again after a while

jarmoza and others added 2 commits February 9, 2023 11:07
Co-authored-by: Sebastian Urchs <surchs@users.noreply.github.com>
Co-authored-by: Sebastian Urchs <surchs@users.noreply.github.com>
@jarmoza
Copy link
Contributor Author

jarmoza commented Feb 9, 2023

@surchs Will add a comment about possible different place for the `transformationHeuristics store field.

@jarmoza
Copy link
Contributor Author

jarmoza commented Feb 9, 2023

@surchs Take a look at my recent commits. I believe they address the issues mentioned above.

store/index.js Show resolved Hide resolved
Copy link
Contributor

@surchs surchs left a comment

Choose a reason for hiding this comment

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

Thanks @jarmoza, I agree. This looks good to go. I left two comments for my own clarity, but go ahead and merge when you've seen them.

@jarmoza jarmoza merged commit 30b9a99 into dev_components_talk_to_store_directly Feb 9, 2023
@jarmoza jarmoza deleted the jarmoza-276 branch February 9, 2023 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
annotation page data store flag:discuss Flag issue that needs to be discussed before it can be implemented. maint:refactor Simplifying or restructuring existing code or documentation.
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants