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

chore(ui-react): lint primitives (P-S) #3265

Merged
merged 15 commits into from
Jan 11, 2023
Merged

Conversation

calebpollman
Copy link
Member

Description of changes

Lint all React UI primitives and related files between P and S

Issue #, if available

NA

Description of how you validated changes

yarn react lint && yarn react test

Checklist

  • PR description included
  • yarn test passes
  • Tests are updated
  • No side effects or sideEffects field updated
  • Relevant documentation is changed or added (and PR referenced)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@calebpollman calebpollman requested a review from a team as a code owner January 5, 2023 00:04
@changeset-bot
Copy link

changeset-bot bot commented Jan 5, 2023

🦋 Changeset detected

Latest commit: f944eab

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@aws-amplify/ui-react-core Patch
@aws-amplify/ui-react Patch
@aws-amplify/ui-react-native Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@calebpollman calebpollman temporarily deployed to ci January 5, 2023 00:45 — with GitHub Actions Inactive
@calebpollman calebpollman temporarily deployed to ci January 5, 2023 00:45 — with GitHub Actions Inactive
@calebpollman calebpollman temporarily deployed to ci January 5, 2023 00:45 — with GitHub Actions Inactive
@calebpollman calebpollman temporarily deployed to ci January 5, 2023 00:45 — with GitHub Actions Inactive
wlee221
wlee221 previously approved these changes Jan 5, 2023
Co-authored-by: Scott Rees <6165315+reesscot@users.noreply.github.com>
Co-authored-by: Scott Rees <6165315+reesscot@users.noreply.github.com>
@@ -43,7 +43,6 @@ const SliderFieldPrimitive: Primitive<SliderFieldProps, typeof Root> = (
testId,
thumbColor,
trackSize,
dir,
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we sure we didn't mean to throw this prop away?

Copy link
Member Author

Choose a reason for hiding this comment

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

It was unused, so technically it's no longer being thrown away 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, that should have been getting passed through, so your change looks correct:
https://www.radix-ui.com/docs/primitives/components/slider#root

@calebpollman calebpollman temporarily deployed to ci January 6, 2023 18:23 — with GitHub Actions Inactive
@calebpollman calebpollman temporarily deployed to ci January 6, 2023 18:23 — with GitHub Actions Inactive
@calebpollman calebpollman temporarily deployed to ci January 6, 2023 18:23 — with GitHub Actions Inactive
@calebpollman calebpollman temporarily deployed to ci January 6, 2023 18:23 — with GitHub Actions Inactive
@calebpollman calebpollman temporarily deployed to ci January 10, 2023 02:01 — with GitHub Actions Inactive
@calebpollman calebpollman temporarily deployed to ci January 10, 2023 02:01 — with GitHub Actions Inactive
@calebpollman calebpollman temporarily deployed to ci January 10, 2023 02:01 — with GitHub Actions Inactive
@calebpollman calebpollman force-pushed the ui-react/lint-primitives branch from db4808c to a413f6a Compare January 10, 2023 18:57
@calebpollman calebpollman temporarily deployed to ci January 10, 2023 19:12 — with GitHub Actions Inactive
@calebpollman calebpollman temporarily deployed to ci January 10, 2023 19:12 — with GitHub Actions Inactive
@calebpollman calebpollman temporarily deployed to ci January 10, 2023 19:12 — with GitHub Actions Inactive
@@ -20,7 +28,10 @@ export const useSwitch = (props: UseSwitchProps) => {
return;
}

typeof onChange === 'function' && onChange(event);
if (typeof onChange === 'function') {
Copy link
Contributor

Choose a reason for hiding this comment

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

We have a isFunction util under shared folder

Copy link
Member Author

Choose a reason for hiding this comment

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

Really trying not to get in to refactoring in these PRs to prevent scope creep from kicking in

setInputValue(event.target.value);

if (typeof onChange === 'function') {
onChange(event);
Copy link
Member Author

Choose a reason for hiding this comment

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

Just a note that this is a bug fix, previous to this PR onChange props passed to StepperField was never called

Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch

Comment on lines -60 to -62
* TODO:
* Extends StepperField props from Omit<TextFieldProps, 'onChange'>, after removing [key: string]: any from the base type
* and rename onStepChange to onChange
Copy link
Member Author

@calebpollman calebpollman Jan 10, 2023

Choose a reason for hiding this comment

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

This was being rendered in the docs StepperField props table

Copy link
Contributor

Choose a reason for hiding this comment

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

🤦‍♂️

@calebpollman calebpollman temporarily deployed to ci January 10, 2023 20:54 — with GitHub Actions Inactive
@calebpollman calebpollman temporarily deployed to ci January 10, 2023 20:54 — with GitHub Actions Inactive
@calebpollman calebpollman temporarily deployed to ci January 10, 2023 20:54 — with GitHub Actions Inactive
@calebpollman calebpollman temporarily deployed to ci January 11, 2023 00:05 — with GitHub Actions Inactive
@calebpollman calebpollman temporarily deployed to ci January 11, 2023 00:05 — with GitHub Actions Inactive
@calebpollman calebpollman temporarily deployed to ci January 11, 2023 00:05 — with GitHub Actions Inactive
@calebpollman calebpollman temporarily deployed to ci January 11, 2023 00:05 — with GitHub Actions Inactive
Copy link
Contributor

@reesscot reesscot left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for catching these issues

@calebpollman calebpollman merged commit 08111e7 into main Jan 11, 2023
@calebpollman calebpollman deleted the ui-react/lint-primitives branch January 11, 2023 00:32
@github-actions github-actions bot mentioned this pull request Jan 12, 2023
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