Use `iconName` in return value of `getPicturePasswordIcons`
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Context
PR https://github.com/learningequality/kolibri/pull/14573 added ambiguous iconName to the objects returned by getPicturePasswordIcons to eliminate the need for consumers to switch on whether to use iconColorful or iconStandard in the response. Since getPicturePasswordIcons switches on that already, it's simplest to have it return a single property iconName.
Task
- [ ] Eliminate
iconStandardandiconColorfulfromgetPicturePasswordIcons - [ ] Update any usages of
iconStandardandiconColorfulto useiconNameinstead - [ ] Update the tests for
getPicturePasswordIcons - [ ] Update any other consumer tests for the change
Reference
Thanks for updating this function to use constants instead. I wonder if this function should be updated to return only the
labelandiconName?Right now this function is only used in two places, the
AllPasswordsPage.vueand now theUserEditPage.vue, and updating it now won't affect the changes inAllPasswordsPage.vue, only the tests.
Doesn't have to be done in this PR though, it can also be done when the All Passwords Page is updated to display the actual icons, just wondering about your thoughts?
Originally posted by @LianaHarris360 in https://github.com/learningequality/kolibri/pull/14573#discussion_r3066603652
Plan: getPicturePasswordIcons returns only label and iconName; the style-specific iconColorful / iconStandard keys are gone.
- [ ] Narrow the descriptor to
{label, iconName} - [ ] Self-review the produced code
Assumptions — the issue did not settle these; say so if one is wrong.
iconNamestays absent wheniconStyleis omitted, rather than defaulting to colorful. If wrong,UserPicturePasswordon a facility with nopicture_password_settingskeeps renderingKIconwith an undefined icon.- The
iconStyleparameter stays. If wrong, callers resolve the style themselves and the function loses its second argument, which changes all three call sites. - No consumer exists outside
develop— the AC's "update any other consumer tests" implies some did. If wrong, an in-flight branch reads a key that is now silentlyundefined, with no runtime error to flag it.
Open questions
- None.
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?
- Implemented code following the pre-approved plan using test-driven development (red-green-refactor)
- Ran the project's full test suite and linter before committing
- For UI changes: captured live screenshots to verify rendering
- For backend changes: verified with example API/CLI output