Skip to content

Invert Switcher hideLabel when migrating to showLabels - #334

Merged
KevinJump merged 1 commit into
Jumoo:v17/mainfrom
johnkhigginson:fix/306-switcher-show-labels
Nov 6, 2026
Merged

KevinJump merged 1 commit into
Jumoo:v17/mainfrom
johnkhigginson:fix/306-switcher-show-labels

Conversation

@johnkhigginson

Copy link
Copy Markdown
Contributor

What does this change?

Closes #306

Switcher's hideLabel and True/False's showLabels mean opposite things, but the migrator just renamed the key, so hidden labels showed after migration and the other way round. It now negates the value before renaming the other keys.

Notes for the reviewer

The value goes through ToString().TryConvertTo<bool>(), so bool, "1"/"0", "true"/"false" and JsonElement/JsonNode all work. If it can't be parsed, showLabels is left out and the editor default applies.

There's no test project, so I checked it with a throwaway console app against the Migrators project: true/"1"/"true"/JsonElement true gave showLabels=False, false/"0"/"False"/JsonNode false gave showLabels=True, junk or missing left it out, and the label keys were renamed as before.

Checklist

  • dotnet build src/uSync.Migrations.slnx -c Release is clean
  • CHANGELOG.md updated under Unreleased
  • Migrator/backoffice changes were clicked through against uSync.Migrations.Site, not just built

Switcher's hideLabel and True/False's showLabels mean opposite things, so
renaming the key flipped the setting. Negate the value instead.

Refs Jumoo#306
@KevinJump
KevinJump merged commit 92822fd into Jumoo:v17/main Nov 6, 2026
4 checks passed
@KevinJump

Copy link
Copy Markdown
Member

Thanks John, nice catch, and thanks for checking all the value formats. Merged into v17/main; it'll go forward to v18 with the next merge.

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.

Switcher 'ShowLabels' boolean config transfers as opposite value

2 participants