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

[TASK](ui): Migrate Menu(All related) component to TypeScript #237

Closed
6 tasks
Tracked by #62 ...
barsukov opened this issue Aug 16, 2024 · 0 comments · Fixed by #575
Closed
6 tasks
Tracked by #62 ...

[TASK](ui): Migrate Menu(All related) component to TypeScript #237

barsukov opened this issue Aug 16, 2024 · 0 comments · Fixed by #575
Assignees
Labels
enhancement New feature or request

Comments

@barsukov
Copy link
Contributor

barsukov commented Aug 16, 2024

Task Description

We need to convert Menu and all related components from @cloudoperators/juno-ui-components to TypeScript

List of potential dependencies

  • Check files that used with Menu, MenuSection.

Sub-tasks

  • change the name to .tsx of all related components
  • Change the stories to .tsx and all related componetns
  • fix all errors related to npm run typecheck
  • Transfer all related tests to vitests from jest
  • Check if npm run build is working and prove the working parts in storybook or example app
  • Check that npm run lint is working correctly and fix all tslint errors

Related Issues

Additional Context
Please check this online codemode editor to change the PropTypes to a proper Ts interfaces

https://github.com/mskelton/ratchet
Online editor: https://ratchet.mskelton.dev/

We need to be pretty concious about migration to ts cause it could create a potential breaking changes. Also if there will be too much changes at once maybe consider to split up the task again. Also some dependencies could be hidden and only discovered while executing the migration, could also lead to potential reconsidering the order of task execution.

@barsukov barsukov added the enhancement New feature or request label Aug 16, 2024
@barsukov barsukov changed the title Menu(All related) [TASK](ui): Migrate Menu(All related) component to TypeScript Aug 16, 2024
guoda-puidokaite added a commit that referenced this issue Nov 7, 2024
* feat(ui): migrate MenuSection to TypeScript

* feat(ui): add more tests

* chore(ui): migrate Menu, MenuItem, MenuSection components to TypeScript

* chore(ui): prevent headless-ui error

* chore(ui): fix button rendering issue detected in story and other tiny adjustments

* chore(ui): make tests for rendered element more explicit

* Create five-boats-cheat.md

* chore(ui): remove type casting when using context

don’t cast type when using MenuContext as per Vova’s suggestion

* chore(ui): re-introduce changed logic to determine MenuItem element

non-intentionally removed this chnage by Guoda

* Update .changeset/five-boats-cheat.md

Co-authored-by: Guoda <[email protected]>

* chore(ui): consistency

Co-authored-by: Guoda <[email protected]>

* chore(ui): consistency

Co-authored-by: Guoda <[email protected]>

* chore(ui): use React element type

Co-authored-by: Guoda <[email protected]>

* chore(ui): make sure href is only passed when element is anchor

Co-authored-by: Guoda <[email protected]>

* chore(ui): use React.FC to fix typecheck

* chore(ui): code formatting

* chore(ui): remove file extensions from relevant imports

* chore(ui): add more tests

* chore(ui): set onClick to null explicitly for standalone stories

* chore(ui): remove unnecessary underscores

* chore(ui): add more children to story

* chore(ui): add back children check to fix link/button issue

* chore(ui): remove underscore, eslint-ignore line

* chore(ui): apply interactive styles to interactive elements only

* chore(ui): disable `children` control in story

---------

Co-authored-by: I531348 <[email protected]>
Co-authored-by: Guoda <[email protected]>
Co-authored-by: Wowa Barsukov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants