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

#6049: fix page state namespace labels; support custom labels for enums #6050

Merged
merged 6 commits into from Jul 10, 2023

Conversation

twschiller
Copy link
Contributor

@twschiller twschiller commented Jul 9, 2023

What does this PR do?

  • Closes Update naming in UI for Page State #6049
  • Add support to Schema Field for using oneOf + const to provide options with choices (see discussion)
  • Updates labels for Page State locations in the Get/Set Page State Bricks. The values are kept the same for backward compatibility
    • extension → Private
    • blueprint → Mod
    • shared → Public
  • Adds analysis rules for improper usage of Page State Location
  • Update Page State labels in the Data Panel
  • Adds a isPageStateAware method to bricks to determine if the bricks may read/write page state. That's used to determine whether the panel is shown in the Data Panel

Discussion

  • RJSF supports a non-standard enumNames property, but it's semi-deprecated. JSON Schema is also likely in the future going to drop support for non-standard field. Therefore, I went with the oneOf + const approach, which is also what we use in the Form Builder.

Demo

Future Work

Checklist

  • Add tests
  • Designate a primary reviewer: @BLoe

@twschiller twschiller changed the title #6049: support custom labels for enums; fix page state labelling #6049: fix page state namespace labels; support custom labels for enums Jul 9, 2023
@codecov
Copy link

codecov bot commented Jul 9, 2023

Codecov Report

Merging #6050 (5cb1f02) into main (fa2763b) will increase coverage by 0.08%.
The diff coverage is 94.87%.

@@            Coverage Diff             @@
##             main    #6050      +/-   ##
==========================================
+ Coverage   67.27%   67.36%   +0.08%     
==========================================
  Files        1095     1096       +1     
  Lines       33947    34030      +83     
  Branches     6398     6422      +24     
==========================================
+ Hits        22839    22923      +84     
+ Misses      11108    11107       -1     
Impacted Files Coverage Δ
...elds/schemaFields/widgets/TemplateToggleWidget.tsx 80.00% <ø> (ø)
src/pageEditor/fields/FormRendererOptions.tsx 0.00% <0.00%> (ø)
src/types/schemaTypes.ts 100.00% <ø> (ø)
src/pageEditor/exampleBlockConfigs.ts 77.35% <50.00%> (-2.24%) ⬇️
...fields/schemaFields/widgets/SchemaSelectWidget.tsx 85.71% <88.88%> (+0.86%) ⬆️
...sisVisitors/pageStateAnalysis/pageStateAnalysis.ts 100.00% <100.00%> (ø)
src/blocks/effects/pageState.ts 88.57% <100.00%> (+3.95%) ⬆️
src/blocks/renderers/customForm.tsx 59.45% <100.00%> (+1.12%) ⬆️
src/blocks/transformers/brickFactory.ts 79.74% <100.00%> (+1.96%) ⬆️
...c/components/fields/schemaFields/fieldInputMode.ts 78.72% <100.00%> (+0.46%) ⬆️
... and 6 more

... and 2 files with indirect coverage changes

@twschiller twschiller marked this pull request as ready for review July 9, 2023 17:24
@twschiller twschiller added the user experience Improve the user experience (UX) label Jul 10, 2023
@twschiller twschiller enabled auto-merge (squash) July 10, 2023 21:02
@twschiller twschiller added this to the 1.7.34 milestone Jul 10, 2023
@twschiller twschiller merged commit 7df9c45 into main Jul 10, 2023
11 checks passed
@twschiller twschiller deleted the feature/6049-page-state-labels branch July 10, 2023 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user experience Improve the user experience (UX)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update naming in UI for Page State
3 participants