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

Add TypeScript types to Switcher, SwitcherDivider, SwitcherItem #13584 #14989

Merged
merged 16 commits into from
Nov 27, 2023

Conversation

shreeup
Copy link
Contributor

@shreeup shreeup commented Oct 21, 2023

Closes #13584

Add TypeScript types to Switcher, SwitcherDivider, SwitcherItem

Changelog

New

  • Added 3 new typescript equivalent of Switcher, SwitcherItem, SwitcherDivider components by executing git mv command and making required changes

Changed

  • Updated snapshot to fix test

Removed

  • Deleted old components written in .js

Testing / Reviewing

executed lint, run test suite and ensured no new failures after the commit, Added these component in UIShell storybook and verified.

@shreeup shreeup requested review from a team as code owners October 21, 2023 19:42
@github-actions
Copy link
Contributor

github-actions bot commented Oct 21, 2023

DCO Assistant Lite bot All contributors have signed the DCO.

@shreeup
Copy link
Contributor Author

shreeup commented Oct 21, 2023

I have read the DCO document and I hereby sign the DCO.

@netlify
Copy link

netlify bot commented Oct 21, 2023

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 625d22d
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/655ed6d742d945000842f8ef
😎 Deploy Preview https://deploy-preview-14989--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@netlify
Copy link

netlify bot commented Oct 21, 2023

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit a3a4507
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/654afcf596376900081ec743
😎 Deploy Preview https://deploy-preview-14989--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@shreeup shreeup changed the title Carboncontr Add TypeScript types to Switcher, SwitcherDivider, SwitcherItem #13584 Oct 22, 2023
@shreeup
Copy link
Contributor Author

shreeup commented Oct 26, 2023

For 'DCO Assistant / DCO (pull_request_target)' step to pass, is there any action required from my end? I have already commented saying "I have read the DCO document and I hereby sign the DCO."

@shreeup
Copy link
Contributor Author

shreeup commented Oct 26, 2023

recheck

Comment on lines 577 to 611

export const SwitcherItems = () => (
<>
<Header aria-label="IBM Platform Name">
<SkipToContent />
<HeaderName href="#" prefix="IBM">
Switcher
</HeaderName>
</Header>
<Switcher
aria-label="dummy-aria-label"
role="separator"
className="custom-class">
<SwitcherItem
role="separator"
aria-label="test-aria-label-switcheritem"
aria-valuenow={'100'}>
Dummy child
</SwitcherItem>
</Switcher>
<SwitcherDivider role="separator" className="custom-class" />
<Switcher role="separator" aria-label="dummy-aria-label">
<SwitcherItem
role="separator"
aria-label="test-aria-label-switcheritem1"
aria-valuenow={'100'}>
Dummy child1
</SwitcherItem>
</Switcher>
<SwitcherDivider role="separator" data-testid="test-id" />
<StoryContent />
</>
);

SwitcherItems.storyName = 'Switcher';
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can delete this as these components are already used in other stories, like HeaderWActionsAndSwitcher

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Deleted SwitcherItems as per review commendt

Copy link
Member

@tay1orjones tay1orjones left a comment

Choose a reason for hiding this comment

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

Thanks for this! Overall I think this looks good but have a few questions below

packages/react/src/components/UIShell/Switcher.tsx Outdated Show resolved Hide resolved
packages/react/src/components/UIShell/Switcher.tsx Outdated Show resolved Hide resolved
packages/react/src/components/UIShell/Switcher.tsx Outdated Show resolved Hide resolved
packages/react/src/components/UIShell/SwitcherItem.tsx Outdated Show resolved Hide resolved
packages/react/src/components/UIShell/SwitcherItem.tsx Outdated Show resolved Hide resolved
Copy link
Member

@tay1orjones tay1orjones left a comment

Choose a reason for hiding this comment

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

Thank you!

@tay1orjones tay1orjones requested a review from tw15egan November 13, 2023 21:01
@github-actions github-actions bot added this pull request to the merge queue Nov 15, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Nov 15, 2023
@tay1orjones tay1orjones added this pull request to the merge queue Nov 27, 2023
Merged via the queue into carbon-design-system:main with commit a640108 Nov 27, 2023
18 checks passed
danoro96 pushed a commit to danoro96/carbon that referenced this pull request Jan 18, 2024
…n-design-system#13584 (carbon-design-system#14989)

* fix(react): convert js to typescript carbon-design-system#13584

* fix(react): js -> ts -SwitcherItem ,Divider carbon-design-system#13584

* fix(code): tests, proptype description carbon-design-system#13584

* fix(code): warning carbon-design-system#13584

* fix(code): deleted from storybook as per review

* fix(react): incorporate feedback

---------

Co-authored-by: Andrea N. Cardona <cardona.n.andrea@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add TypeScript types to Switcher, SwitcherDivider, SwitcherItem
5 participants