-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: updated filters dropdown and created stories for it #3174
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
Merged
asyncapi-bot
merged 28 commits into
asyncapi:master
from
ashmitjsg:update-filters-dropdown
Dec 18, 2025
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
5eda3ab
updated filters dropdown in tools
ashmitjsg 08ce480
Merge branch 'master' into update-filters-dropdown
ashmitjsg 67023b9
added stories for filters dropdown
ashmitjsg bf0d3c0
Merge branch 'master' into update-filters-dropdown
ashmitjsg 5d83bdc
Merge branch 'master' into update-filters-dropdown
asyncapi-bot 8d2b79d
Merge branch 'master' into update-filters-dropdown
ashmitjsg 88db099
Merge branch 'master' into update-filters-dropdown
ashmitjsg bd3efbb
Merge branch 'master' into update-filters-dropdown
ashmitjsg 09a5c76
Merge branch 'master' of https://github.com/asyncapi/website into upd…
ashmitjsg 3d94fcd
Merge branch 'asyncapi:master' into update-filters-dropdown
ashmitjsg 776008a
Merge branch 'asyncapi:master' into update-filters-dropdown
ashmitjsg 1903c13
Merge branch 'master' of https://github.com/asyncapi/website into upd…
ashmitjsg f501d55
fixed ci issue, and updated the design
ashmitjsg 36dcfd3
Merge branch 'asyncapi:master' into update-filters-dropdown
ashmitjsg 9971ea0
Merge branch 'master' into update-filters-dropdown
ashmitjsg 50ea482
Merge branch 'asyncapi:master' into update-filters-dropdown
ashmitjsg e4e5a7b
feat: shortened filters dropdown height and added functionality to pe…
ashmitjsg ec9aa51
fix: lint issue
ashmitjsg a39e73e
Merge branch 'master' into update-filters-dropdown
ashmitjsg 6643255
Merge branch 'master' into update-filters-dropdown
ashmitjsg 294f1e1
Merge branch 'master' into update-filters-dropdown
ashmitjsg 89687a7
refactor(filters): simplify dropdown toggle logic in Filters component
ashmitjsg 9540743
refactor: fix lint issue
ashmitjsg 57cf809
Merge branch 'master' into update-filters-dropdown
TRohit20 13f5a35
Merge branch 'master' of https://github.com/devilkiller-ag/asyncapi-w…
ashmitjsg 6602037
Merge branch 'master' into update-filters-dropdown
anshgoyalevil 096dee0
add addons package correctly
milesxporter 364b747
fix import
milesxporter 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
Some comments aren't visible on the classic Files Changed page.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| import { useArgs } from '@storybook/preview-api'; | ||
| import type { Meta, StoryObj } from '@storybook/react'; | ||
| import React from 'react'; | ||
|
|
||
| import type { Language, Technology } from '@/types/components/tools/ToolDataType'; | ||
|
|
||
| import tags from '../../config/all-tags.json'; | ||
| import FiltersDropdown from './FiltersDropdown'; | ||
|
|
||
| const meta: Meta<typeof FiltersDropdown> = { | ||
| title: 'Components/FiltersDropdown', | ||
| component: FiltersDropdown, | ||
| argTypes: { | ||
| dataList: { | ||
| control: false | ||
| }, | ||
| checkedOptions: { | ||
| control: { | ||
| type: 'object' | ||
| } | ||
| }, | ||
| setCheckedOptions: { | ||
| control: false | ||
| } | ||
| } | ||
| }; | ||
|
|
||
| export default meta; | ||
|
|
||
| type Story = StoryObj<typeof FiltersDropdown>; | ||
|
|
||
| const Dropdown: Story = { | ||
| args: { | ||
| checkedOptions: [] | ||
| }, | ||
|
|
||
| render: (args) => { | ||
| const [{ checkedOptions }, updateArgs] = useArgs(); | ||
|
|
||
| const setCheckedOptions: React.Dispatch<React.SetStateAction<string[]>> = (newValue) => { | ||
| if (typeof newValue === 'function') { | ||
| const updatedValue = (newValue as (prevState: string[]) => string[])(checkedOptions); | ||
|
|
||
| updateArgs({ checkedOptions: updatedValue }); | ||
| } else { | ||
| updateArgs({ checkedOptions: newValue }); | ||
| } | ||
| }; | ||
|
|
||
| return <FiltersDropdown {...args} checkedOptions={checkedOptions} setCheckedOptions={setCheckedOptions} />; | ||
| } | ||
| }; | ||
|
|
||
| const languageList = tags.languages as Language[]; | ||
|
|
||
| export const LanguageDropdown: Story = { | ||
| ...Dropdown, | ||
|
|
||
| args: { | ||
| ...Dropdown.args, | ||
| dataList: languageList, | ||
| checkedOptions: [] | ||
| } | ||
| }; | ||
|
|
||
| const technologyList = tags.technologies as Technology[]; | ||
|
|
||
| export const TechnologyDropdown: Story = { | ||
| ...Dropdown, | ||
|
|
||
| args: { | ||
| ...Dropdown.args, | ||
| dataList: technologyList, | ||
| checkedOptions: [] | ||
| } | ||
| }; |
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
Oops, something went wrong.
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.