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

New mutation setHeuristic for phase 2 store refactor #337

Merged
merged 7 commits into from
Feb 2, 2023

Conversation

jarmoza
Copy link
Contributor

@jarmoza jarmoza commented Feb 1, 2023

This PR addresses #270.

  1. setHeuristic is now a mutation that takes a column and heuristic name and assigns the heuristic to the transformationHeuristic field in the data dictionary object for that column
  2. A unit test has been created for the new setHeuristic mutation.
  3. The annot-continuous-values component has been amended to understand setHeuristic as a mutation instead of an action.

@jarmoza jarmoza added annotation page maint:refactor Simplifying or restructuring existing code or documentation. labels Feb 1, 2023
@jarmoza jarmoza requested a review from surchs February 1, 2023 22:05

dataDictionary: {
annotated: {
column1: { transformationHeuristic: "" }
Copy link
Contributor

Choose a reason for hiding this comment

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

minor point: in the default state of the store.state the transformationHeuristic attribute doesn't exist for a column.
That makes sense, not every column will need one, so probably best not to create the field by default.
However: it would be good to have a test here that checks that we actually successfully create the attribute as well.
i.e.:

  • mock the state to not have transformationHeuristic (i.e. to reflect the default state),
  • fire the mutation
  • ensure that 1) the respective column now does have the transformationHeuristic attribute, and 2) that the value of this attribute is correct

Copy link
Contributor Author

@jarmoza jarmoza Feb 2, 2023

Choose a reason for hiding this comment

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

@surchs Makes sense. One moment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@surchs Okay. Just added the existence check as well. Check it out and see what you think.

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.

Nice, looks good @jarmoza. I left some suggestions for clarity - all minor. Add where you agree, but otherwise good to go!

components/annot-continuous-values.vue Show resolved Hide resolved
cypress/component/annot-continuous-values.cy.js Outdated Show resolved Hide resolved
cypress/component/annot-continuous-values.cy.js Outdated Show resolved Hide resolved
@jarmoza jarmoza merged commit d0994d2 into dev_components_talk_to_store_directly Feb 2, 2023
@jarmoza jarmoza deleted the jarmoza-270 branch February 2, 2023 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
annotation page 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