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

#5580 - Add omitted field click handlers for the rest of the input types #5685

Merged
merged 3 commits into from May 9, 2023

Conversation

BLoe
Copy link
Collaborator

@BLoe BLoe commented May 9, 2023

@BLoe BLoe added this to the 1.7.27 milestone May 9, 2023
@BLoe BLoe requested review from twschiller and turbochef May 9, 2023 02:47
@codecov
Copy link

codecov bot commented May 9, 2023

Codecov Report

Merging #5685 (504d9d5) into main (9df33d1) will increase coverage by 0.00%.
The diff coverage is 66.66%.

@@           Coverage Diff           @@
##             main    #5685   +/-   ##
=======================================
  Coverage   64.65%   64.66%           
=======================================
  Files        1044     1044           
  Lines       32727    32735    +8     
  Branches     6203     6202    -1     
=======================================
+ Hits        21161    21169    +8     
  Misses      11566    11566           
Impacted Files Coverage Δ
...rc/extensionConsole/pages/brickEditor/EditPage.tsx 0.00% <ø> (ø)
...elds/schemaFields/widgets/TemplateToggleWidget.tsx 80.00% <37.50%> (+2.22%) ⬆️
...ents/fields/schemaFields/widgets/BooleanWidget.tsx 90.00% <83.33%> (-10.00%) ⬇️
...fields/schemaFields/widgets/SchemaSelectWidget.tsx 85.71% <100.00%> (+1.33%) ⬆️

@@ -112,6 +112,16 @@ const TemplateToggleWidget: React.VFC<TemplateToggleWidgetProps> = ({
onModeChange("number");
} else if (inputModeOptions.some((option) => option.value === "var")) {
onModeChange("var");
} else if (inputModeOptions.some((option) => option.value === "select")) {
Copy link
Contributor

@twschiller twschiller May 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be first before string and var? Won't all variables generally support a "var"? Or is this just meant to address the issues in the Mod Options setup?

} else if (inputModeOptions.some((option) => option.value === "select")) {
onModeChange("select");
} else if (
inputModeOptions.some((option) => option.value === "boolean")
Copy link
Contributor

@twschiller twschiller May 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For boolean the behavior I'd like to see is toggling to boolean and setting the value to true. That's much more common than wanting to show the var input

You could also consider writing as a for-each-loop with a break

Copy link
Contributor

@twschiller twschiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BLoe this is probably fine, but see comments about expected behavior

Also, this could be made much cleaner by creating a set of option values and then using includes/has instead of repeatedly using some

@github-actions
Copy link

github-actions bot commented May 9, 2023

No loom links were found in the first post. Please add one there if you'd like to it to appear on Slack.

Do not edit this comment manually.

@BLoe BLoe merged commit 4f0bbfd into main May 9, 2023
11 checks passed
@BLoe BLoe deleted the feature/5580-more-omit-click-handlers branch May 9, 2023 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants