-
-
Notifications
You must be signed in to change notification settings - Fork 666
Feat/heroui v3 upgrade #5196
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
Closed
Adarshkumar0509
wants to merge
15
commits into
OWASP:main
from
Adarshkumar0509:feat/heroui-v3-upgrade
Closed
Feat/heroui v3 upgrade #5196
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
dfc5b16
chore(deps): upgrade @heroui/react to v3
Adarshkumar0509 d0ef89b
chore: fix eslint config and test mocks for heroui v3
Adarshkumar0509 201320c
chore(deps): upgrade @heroui/react to v3
Adarshkumar0509 42877f5
fix: address post-migration CI issues and coderabbit feedback
Adarshkumar0509 f37ec28
chore(deps): align @heroui/styles version to 3.2.1 in workspace
Adarshkumar0509 6572819
chore(deps): add @heroui/styles@3.2.2 to minimumReleaseAgeExclude
Adarshkumar0509 d59ef54
fix: address coderabbit and cubic bot feedback for heroui v3 migration
Adarshkumar0509 2b68d8a
fix: remove role=button from DropdownTrigger div to prevent nested in…
Adarshkumar0509 c250053
fix: align @heroui/styles to 3.2.2 and remove duplicate testid in mocks
Adarshkumar0509 2c0a571
fix: restore component styling after heroui v3 migration
Adarshkumar0509 80c2ac9
fix: migrate FormButtons from @heroui/button v2 to @heroui/react v3
Adarshkumar0509 9966805
fix: prettier formatting in ProjectsDashboardDropDown
Adarshkumar0509 d532b43
fix: correct Button variant and remove nested interactive in dropdown
Adarshkumar0509 b5b65d4
fix: address coderabbit and cubic feedback for heroui v3 migration
Adarshkumar0509 a7ba28c
fix: simplify breadcrumbs test selector and remove redundant dropdown…
Adarshkumar0509 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,102 +26,147 @@ jest.mock('@apollo/client/react', () => ({ | |
|
|
||
| // Mock heroui components | ||
| jest.mock('@heroui/react', () => ({ | ||
| Autocomplete: ({ | ||
| children, | ||
| inputValue, | ||
| _selectedKey, | ||
| onInputChange, | ||
| onSelectionChange, | ||
| isInvalid, | ||
| errorMessage, | ||
| isLoading, | ||
| label, | ||
| ComboBox: Object.assign( | ||
| ({ | ||
| children, | ||
| inputValue, | ||
| onInputChange, | ||
| onSelectionChange, | ||
| isInvalid, | ||
| className, | ||
| }: { | ||
| children?: React.ReactNode | ||
| inputValue?: string | ||
| onInputChange?: (value: string) => void | ||
| onSelectionChange?: (key: React.Key | null) => void | ||
| isInvalid?: boolean | ||
| className?: string | ||
| }) => ( | ||
| <div data-testid="autocomplete"> | ||
| <input | ||
| data-testid="autocomplete-input" | ||
| value={inputValue || ''} | ||
| onChange={(e) => onInputChange?.(e.target.value)} | ||
| /> | ||
| <div data-testid="combobox-children">{children}</div> | ||
|
Comment on lines
+29
to
+51
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value Stale 🤖 Prompt for AI Agents |
||
| <button | ||
| type="button" | ||
| data-testid="autocomplete-select-item" | ||
| onClick={() => onSelectionChange?.('project-1')} | ||
| > | ||
| Select Project 1 | ||
| </button> | ||
| <button | ||
| type="button" | ||
| data-testid="autocomplete-select-all" | ||
| onClick={() => onSelectionChange?.('all' as any)} | ||
| > | ||
| Select All | ||
| </button> | ||
| <button | ||
| type="button" | ||
| data-testid="autocomplete-clear" | ||
| onClick={() => { | ||
| onInputChange?.('') | ||
| onSelectionChange?.(null) | ||
| }} | ||
| > | ||
| Clear Selection | ||
| </button> | ||
| <button | ||
| type="button" | ||
| data-testid="autocomplete-select-single" | ||
| onClick={() => onSelectionChange?.('project-1')} | ||
| > | ||
| Select Single Key | ||
| </button> | ||
| </div> | ||
| ), | ||
| { | ||
| InputGroup: ({ children }: { children?: React.ReactNode }) => ( | ||
| <div data-testid="combobox-input-group">{children}</div> | ||
| ), | ||
| Popover: ({ children }: { children?: React.ReactNode }) => ( | ||
| <div data-testid="combobox-popover">{children}</div> | ||
| ), | ||
| Trigger: () => <button data-testid="combobox-trigger" />, | ||
| } | ||
| ), | ||
| Input: ({ | ||
| id, | ||
| placeholder, | ||
| className, | ||
| onChange, | ||
| }: { | ||
| children: React.ReactNode | ||
| inputValue?: string | ||
| _selectedKey?: string | null | ||
| onInputChange?: (value: string) => void | ||
| onSelectionChange?: (key: React.Key | Set<React.Key> | 'all') => void | ||
| isInvalid?: boolean | ||
| errorMessage?: string | ||
| isLoading?: boolean | ||
| label?: string | ||
| id?: string | ||
| }) => ( | ||
| <div data-testid="autocomplete"> | ||
| <label htmlFor={id}>{label}</label> | ||
| <input | ||
| id={id} | ||
| data-testid="autocomplete-input" | ||
| value={inputValue || ''} | ||
| data-selected-key={_selectedKey ?? ''} | ||
| onChange={(e) => onInputChange?.(e.target.value)} | ||
| data-loading={isLoading} | ||
| data-invalid={isInvalid} | ||
| /> | ||
| {errorMessage && <span data-testid="autocomplete-error">{errorMessage}</span>} | ||
| <div data-testid="autocomplete-items">{children}</div> | ||
| <button | ||
| type="button" | ||
| data-testid="autocomplete-select-item" | ||
| onClick={() => onSelectionChange?.(new Set(['project-1']))} | ||
| > | ||
| Select Project 1 | ||
| </button> | ||
| <button | ||
| type="button" | ||
| data-testid="autocomplete-select-all" | ||
| onClick={() => onSelectionChange?.('all')} | ||
| > | ||
| Select All | ||
| </button> | ||
| <button | ||
| type="button" | ||
| data-testid="autocomplete-clear" | ||
| onClick={() => { | ||
| onInputChange?.('') | ||
| onSelectionChange?.(null) | ||
| }} | ||
| > | ||
| Clear Selection | ||
| </button> | ||
| <button | ||
| type="button" | ||
| data-testid="autocomplete-select-single" | ||
| onClick={() => onSelectionChange?.('project-1')} | ||
| > | ||
| Select Single Key | ||
| </button> | ||
| </div> | ||
| ), | ||
| AutocompleteItem: ({ | ||
| placeholder?: string | ||
| className?: string | ||
| onChange?: React.ChangeEventHandler<HTMLInputElement> | ||
| }) => <input id={id} placeholder={placeholder} className={className} onChange={onChange} />, | ||
| Label: ({ | ||
| children, | ||
| textValue, | ||
| htmlFor, | ||
| className, | ||
| }: { | ||
| children: React.ReactNode | ||
| textValue?: string | ||
| children?: React.ReactNode | ||
| htmlFor?: string | ||
| className?: string | ||
| }) => ( | ||
| <div data-testid="autocomplete-item" data-text-value={textValue}> | ||
| <label htmlFor={htmlFor} className={className}> | ||
| {children} | ||
| </div> | ||
| </label> | ||
| ), | ||
| Switch: ({ | ||
| isSelected, | ||
| onValueChange, | ||
| 'aria-label': ariaLabel, | ||
| }: { | ||
| isSelected?: boolean | ||
| onValueChange?: (value: boolean) => void | ||
| 'aria-label'?: string | ||
| }) => ( | ||
| <input | ||
| type="checkbox" | ||
| role="switch" | ||
| aria-label={ariaLabel} | ||
| checked={!!isSelected} | ||
| onChange={(e) => onValueChange?.(e.target.checked)} | ||
| /> | ||
| ListBox: Object.assign( | ||
|
cubic-dev-ai[bot] marked this conversation as resolved.
|
||
| ({ children }: { children?: React.ReactNode }) => ( | ||
| <div data-testid="autocomplete-items">{children}</div> | ||
| ), | ||
| { | ||
| Item: ({ | ||
| children, | ||
| id, | ||
| textValue, | ||
| }: { | ||
| children?: React.ReactNode | ||
| id?: string | ||
| textValue?: string | ||
| }) => ( | ||
| <div data-testid="autocomplete-item" data-id={id} data-text-value={textValue}> | ||
| {children} | ||
| </div> | ||
| ), | ||
| } | ||
| ), | ||
| FieldError: ({ children }: { children?: React.ReactNode }) => ( | ||
| <span data-testid="autocomplete-error">{children}</span> | ||
| ), | ||
| Switch: Object.assign( | ||
| ({ | ||
| isSelected, | ||
| onChange, | ||
| 'aria-label': ariaLabel, | ||
| children, | ||
| }: { | ||
| isSelected?: boolean | ||
| onChange?: (value: boolean) => void | ||
| 'aria-label'?: string | ||
| children?: React.ReactNode | ||
| }) => ( | ||
| <div> | ||
| <input | ||
| type="checkbox" | ||
| role="switch" | ||
| aria-label={ariaLabel} | ||
| checked={!!isSelected} | ||
| onChange={(e) => onChange?.(e.target.checked)} | ||
| /> | ||
| {children} | ||
| </div> | ||
| ), | ||
| { | ||
| Content: ({ children }: { children?: React.ReactNode }) => <div>{children}</div>, | ||
| Control: ({ children }: { children?: React.ReactNode }) => <div>{children}</div>, | ||
| Thumb: () => <span />, | ||
| } | ||
| ), | ||
| })) | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.