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

getUniqueValues getter for Phase 2 Store Refactor #363

Merged
merged 8 commits into from
Feb 17, 2023

Conversation

jarmoza
Copy link
Contributor

@jarmoza jarmoza commented Feb 16, 2023

This PR closes #277 by implementing the following:

  1. getUniqueValues getter in the store that takes every column linked to a given category and gathers unique values for each column via the dataTable. The getter outputs an object keyed on column with values that are an array of the unique values for that column. Missing values are skipped via lookup in the dataDictionary
  2. getUniqueValues also takes an optional parameter maxValues to limit how many values are returned
  3. displayItems in the annot-categorical component has been rewritten to accommodate the new output of getUniqueValues
  4. Unit tests for this getter in store-getter-getUniqueValues.cy.js test the following scenarios: a) unique values for a single column, b) unique values for multiple columns, c) retrieving unique values with the optional maximum amount argument, and d) ensuring that no 'missing' values are returned with the unique values

@jarmoza jarmoza added annotation page maint:refactor Simplifying or restructuring existing code or documentation. labels Feb 16, 2023
@jarmoza jarmoza requested a review from surchs February 16, 2023 19:57
@jarmoza jarmoza marked this pull request as draft February 16, 2023 19:57
@jarmoza jarmoza removed the request for review from surchs February 16, 2023 19:58
@jarmoza jarmoza requested a review from surchs February 16, 2023 20:06
@jarmoza jarmoza marked this pull request as ready for review February 16, 2023 20:07
@jarmoza jarmoza requested review from rmanaem and removed request for surchs February 16, 2023 20:28
store/index.js Outdated Show resolved Hide resolved
store/index.js Outdated Show resolved Hide resolved
Copy link
Contributor

@rmanaem rmanaem left a comment

Choose a reason for hiding this comment

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

Great work on the PR @jarmoza! The unit-test test is thorough and in-line comments are nice and helpful. I left two comments that simply address the type of uniqueValues mentioned in the in-line comments other than that It's good to go!

@jarmoza jarmoza merged commit 1d9a09f into dev_components_talk_to_store_directly Feb 17, 2023
@jarmoza jarmoza deleted the jarmoza-277 branch February 17, 2023 17:28
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