Repository navigation
fix(cards): keep adult profiles off the rewards, bonus, penalty and bounty cards (#1071) - #1073
Merged
Merged
Conversation
…ounty cards (#1071) The rewards card's child tabs, default child, jackpot breakdown and child badges, the bonuses/penalties child picker and a bounty's open-to-everyone row now follow the same family rule as the leaderboard: adults only with show_adults, and a pinned child_id is unaffected. A jackpot still lists an adult who has put points into it, so the shares add up. Each of those editors gains the Show adults toggle. The existing Show adults toggles also read off after reopening a card that had it on, because the editors' form data left the value out. They now pass it through.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1071
Adult profiles (#1061) are meant to stay off family-wide cards unless the card turns on Show adults, and the Adult profile switch in the child dialog says so. Some cards still listed them. This was found while testing v6.4.0 on the dev Home Assistant.
What changes
Rewards card (classic and every designed style)
Bonuses and Penalties cards: the child picker leaves adults out.
Bounty card: on a bounty open to everyone, the row of who can claim it leaves adults out. The card's own child is always in it, so an adult's own card still shows them.
All of these show adults after the kids when the card sets
show_adults: true, and each editor gains the Show adults toggle. It appears only once the family has an adult profile and reuses the existing strings, so there are no new translations. A card pinned to achild_idbehaves as before.Show adults toggle reads off after reopening. The 10 editors that already had the toggle (calendar, graph, leaderboard, overview, parent dashboard, points, points display, reward progress, streak, weekly) left the value out of the form data. A card saved with
show_adults: truetherefore showed the toggle as off when the editor was reopened. They now pass the saved value through. The sticker chart editor already did.The auction card needs no change. It is always pinned to a child and never lists the family.
Testing
taskmate-adult-profiles.test.cjs. Rewards and bonuses run under classic and playroom; bounty is covered too. They check that an adult is hidden by default and shown withshow_adults, that a pinned card is unaffected, that the default selection skips the adult, that the selection resets, that a jackpot keeps an adult who contributed, and that every editor reflects a savedshow_adults. The new tests fail on main (16 of 20 card tests and 10 of 14 editor tests; the rest guard behaviour that should not change).node --checkpasses on every edited file.show_adults: truethey show after the kids. No console errors. Checked by eye in screenshots.