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
Teacher Tool: Max Count for Catalog Criteria #9986
Conversation
… this is too specific.
…ks/teachertool/max_count_flag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
return ( | ||
<div className={css["catalog-item-label"]}> | ||
<div className={css["action-indicators"]}> | ||
{canAddMore ? ( | ||
{isMaxed ? ( | ||
<span className={css["max-label"]}>{Strings.Max}</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not seeing a scss change. Did the max-label
class already exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. This just isn't needed or used. I'll remove it.
This change allows us to specify a maximum count for catalog criteria, which defines how many instances a user is allowed to have for a given catalog criteria. It also removes the attempted auto-detection of whether or not we should allow multiple instances (which was based the presence of parameters), since that didn't work well for criteria like "Must have [count] comments". If the field is not set, we assume no max.
I decided to go with a max count rather than a simple
allowMultiple
boolean, because I thought it might be useful to have some criteria where multiple instances are allowed, but not an unlimited number of them. (For example, I've limited the copilot questions to a max of 10, since they're expensive.)I've also removed "All function definitions have comments" per feedback in microsoft/pxt-microbit#5597