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

fix(trip form): add callback for detecting when all submodes are disabled #28

Merged
merged 35 commits into from
Sep 25, 2024

Conversation

daniel-heppner-ibigroup
Copy link

This PR adds a callback to detect when all the submodes under a mode button have been disabled. This will allow us to disable the mode button when all its submodes have been turned off.

Copy link

@amy-corson-ibigroup amy-corson-ibigroup left a comment

Choose a reason for hiding this comment

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

Looking good! Thanks for the changes

Copy link

@binh-dam-ibigroup binh-dam-ibigroup left a comment

Choose a reason for hiding this comment

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

Can you add a Storybook action so we can see the new onAllSubmodesDisabled callback being fired. See the other comments too.

Choose a reason for hiding this comment

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

Are the mock buttons intended to be used outside Storybook? Renaming this file will result in the contents to ship in the binary packages.

Choose a reason for hiding this comment

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

This was renamed because the build on the new version of storybook was failing. When .story is in the filename, a story is expected and there is no story in this file. These mocks are not used anywhere else besides storybook.

Choose a reason for hiding this comment

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

I just realized there is a __mocks__ folder for this package, could you move mockButtons.tsx into that folder?

@@ -111,7 +120,8 @@ export default {
argTypes: {
fillModeIcons: { control: "boolean" },
onSetModeSettingValue: { action: "set mode setting value" },
onToggleModeButton: { action: "toggle button" }
onToggleModeButton: { action: "toggle button" },
onAllSubmodesDisabled: { action: "all submodes disabled" }
Copy link

@binh-dam-ibigroup binh-dam-ibigroup Sep 24, 2024

Choose a reason for hiding this comment

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

I don't see "all submodes disabled" appearing in the Storybook action pane, did I miss something?

Choose a reason for hiding this comment

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

I don't see "all submodes disabled" appearing in the Storybook action pane, did I miss something?

I pulled a previous commit, sorry, ignore that comment.

Copy link

@binh-dam-ibigroup binh-dam-ibigroup left a comment

Choose a reason for hiding this comment

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

I think this is good to go!

@josh-willis-arcadis josh-willis-arcadis changed the title trip form: add callback for detecting when all submodes are disabled fix(trip form): add callback for detecting when all submodes are disabled Sep 25, 2024
@josh-willis-arcadis josh-willis-arcadis changed the base branch from wide-mode-buttons to master September 25, 2024 19:24
@josh-willis-arcadis josh-willis-arcadis merged commit 1415ce8 into master Sep 25, 2024
2 checks passed
@josh-willis-arcadis josh-willis-arcadis deleted the callback-disable-all-submodes branch September 25, 2024 19:40
@josh-willis-arcadis josh-willis-arcadis restored the callback-disable-all-submodes branch September 25, 2024 20:00
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.

4 participants