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

Feat: replace active quantifier #503

Merged
merged 32 commits into from
Jun 29, 2022
Merged

Conversation

mattyg
Copy link
Collaborator

@mattyg mattyg commented Jun 26, 2022

Resolves #432

Overview

  • refactor button components MarkDismissedButton, MarkDuplicateButton to use a generic IconButton
  • refactor UserPopover to no longer use headlessui's Popover (as it only supports click-based popover and wasn't being utilized)
  • Resolve Allow admins to replace quantifiers #432
  • Remove cli command replace-quantifier

Note that we are currently including all quantifiers in the list of possible replacements, not just those currently unassigned.

mattyg added 18 commits June 22, 2022 14:03
… to a bucket of praise in 'prepareAssignmentsByAllQuantifiers()' - as this is impossible if there are more quantifiers in pool than praise receivers in period
…QUANTIFIERS_ASSIGN_EVENLY to clarify that the algorithm cannot assign *all* quantifiers in some conditions (such as if there are more quantifiers than available receivers)
… was not actually being used (it only supports click-based popovers)
@mattyg
Copy link
Collaborator Author

mattyg commented Jun 27, 2022

Currently, only unassigned quantifiers appear in the list of possible replacements. Should we instead include all quantifiers in the list of possible replacements?

@kristoferlund

mattyg added 2 commits June 27, 2022 11:56
…ses in frontend store, to ensure praise quantification data is fresh
@mattyg mattyg changed the title WIP Feat: replace active quantifier Feat: replace active quantifier Jun 27, 2022
@mattyg mattyg requested a review from kristoferlund June 27, 2022 16:39
@mattyg mattyg marked this pull request as ready for review June 27, 2022 17:07
@mattyg mattyg changed the title Feat: replace active quantifier WIP Feat: replace active quantifier Jun 27, 2022
@mattyg
Copy link
Collaborator Author

mattyg commented Jun 27, 2022

Currently, only unassigned quantifiers appear in the list of possible replacements. Should we instead include all quantifiers in the list of possible replacements?

@kristoferlund

We decided to include all quantifiers for now.

@mattyg mattyg changed the title WIP Feat: replace active quantifier Feat: replace active quantifier Jun 27, 2022
@mattyg mattyg removed the request for review from kristoferlund June 27, 2022 20:21
@mattyg mattyg requested a review from kristoferlund June 27, 2022 20:21
Copy link
Member

@kristoferlund kristoferlund left a comment

Choose a reason for hiding this comment

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

Looks great!

One thing needs fixing though. Allowing the choice of any quantifier can cause a situation like this:

image

Perhaps we need to check if the new quantifier already have been assigned any of the receivers of the quantifier being replaced?

@mattyg
Copy link
Collaborator Author

mattyg commented Jun 28, 2022

Perhaps we need to check if the new quantifier already have been assigned any of the receivers of the quantifier being replaced?

good catch! Fixed.

Also made a few other changes:

  • Exclude the original quantifier from the list of possible replacements
  • Clear the selected user from the SelectUserRadioGroup after clicking "Replace" button
  • Update success message to clarify that the scores are reset
  • added tests for replaceQuantifier controller

@mattyg mattyg requested a review from kristoferlund June 28, 2022 19:22
Copy link
Member

@kristoferlund kristoferlund left a comment

Choose a reason for hiding this comment

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

Great fixes! Merging.

onClick();
}

const MarkDuplicateButton = ({
const IconButton = ({
Copy link
Member

Choose a reason for hiding this comment

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

Nice!

@kristoferlund kristoferlund merged commit 40c389e into main Jun 29, 2022
@kristoferlund kristoferlund deleted the feat/replace_active_quantifier branch June 29, 2022 07:11
@kristoferlund kristoferlund mentioned this pull request Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow admins to replace quantifiers
2 participants