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

feat: add disabled flag and tooltip to radio group field options (sc-25841) #791

Merged
merged 3 commits into from
Jan 19, 2023

Conversation

Andrielson
Copy link
Contributor

image

Changes in RadioGroupField include:

  • add optional disabled attribute to RadioFieldOption
  • add optional disabledTooltip attribute to RadioFieldOption

@shortcut-integration
Copy link

This pull request has been linked to Shortcut Story #25831: [UI] Archive templates modal.

@Andrielson Andrielson marked this pull request as ready for review January 19, 2023 01:48
Copy link
Contributor

@stephenh stephenh left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

]}
/>,
);
const radioInput = r.container.querySelector(`[data-testid="favoriteCheese_a"]`)!;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: Given how our render DSL works, this can probably be just:

expect(r.favoriteCheese_a).toBeDisabled();

I think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've tried this approach, but it returns an error:

TypeError: Cannot read property 'message' of undefined

    at new JestAssertionError (~/homebound/beam/node_modules/jest-chain/dist/chain.js:10:18)
    at Object.newMatcher [as toBeDisabled] (~/homebound/beam/node_modules/jest-chain/dist/chain.js:31:17)
    at Object.<anonymous> (~/homebound/beam/src/inputs/RadioGroupField.test.tsx:32:31)

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah yeah, np that this is merged, but I forgot the (), so:

expect(r.favoriteCheese_a()).toBeDisabled()

@Andrielson Andrielson merged commit a69611a into main Jan 19, 2023
@Andrielson Andrielson deleted the sc-25831/upgrade-radio-group-field-options branch January 19, 2023 03:19
homebound-team-bot pushed a commit that referenced this pull request Jan 19, 2023
## [2.239.0](v2.238.2...v2.239.0) (2023-01-19)

### Features

* add disabled flag and tooltip to radio group field options (sc-25841) ([#791](#791)) ([a69611a](a69611a))
@homebound-team-bot
Copy link

🎉 This PR is included in version 2.239.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants