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

Component Request - SearchGeneric #48

Open
z3cka opened this issue May 8, 2021 · 0 comments
Open

Component Request - SearchGeneric #48

z3cka opened this issue May 8, 2021 · 0 comments
Assignees
Labels
DO NOT MERGE This PR with break stuff, do not merge it yet.

Comments

@z3cka
Copy link
Contributor

z3cka commented May 8, 2021

Component Description

This component is be be used anywhere a search block is needed to display filtered results of the current data of the page searched. Example, if SearchGeneric is used in the header of the exhibits & events page, the results will be within the context of exhibits & events and further filtered by user input.

The number of top level filters is dynamic based on the context of the page. The sub filters may be support multi or single select option values. These options have a specific hover state, see screenshot.

Some instances (variants) require a user selected "View mode" that is displayed inline with the filters.

Selected filters should show as "pills" below the filters. Said pills should have "x" buttons next to them that remove the filters from the query. Assumption: The page should update the search results immediately upon filter removal. (may want to get that clarified, but I think that's how it should work)

There should be a count of applied filters shown next to each top level filter dropdown.

Design

Please also see attached screenshots for quick reference.

  • Desktop:

Screen Shot 2021-05-07 at 4 42 49 PM

Screen Shot 2021-05-07 at 4 45 34 PM

Screen Shot 2021-05-07 at 4 46 18 PM

Screen Shot 2021-05-07 at 5 48 21 PM

No mobile designs provided, so use your best judgment for responsiveness by extending the Home page search shown here:

  • Mobile Guide:

Screen Shot 2021-05-07 at 5 05 56 PM

Props

props: {
   searchType: {
        type: String, 
        required: true,
       default:"help"
    },
    filters: {
        // Mock: api.pages
        type: Array,         // array of objects that contain the filter objects
        default: () => []
    },
    viewModes: {
        type: Array,
        default: () => []
    },
}

Developer Tips

  1. Example of filters prop:
    filters: [
        {
            label: "location",
            field: "location_tesim",
            selection: "single",
            filterItems: [
                {
                    name: "Arts Library",
                },
                {
                    name: "Bio Med",
                },
            ]
        },
        {
            name: "department",
            field: "department_tesim",
            selection: "multiple",
            filterItems: [
                {
                    name: "Science Department",
                },
                {
                    name: "Music Department",
                },
            ]
        },
    ]

Events

  1. onSubmit when search form is submitted on enter
  2. filterChange when filters are removed from the submitted search
    • this will allow the parent to update the results
  3. viewModeChange when the viewMode changes value an event should be emitted to the parent so that the parent can display the results with the desired view mode.
@jendiamond jendiamond added the DO NOT MERGE This PR with break stuff, do not merge it yet. label May 13, 2021
@z3cka z3cka mentioned this issue May 14, 2021
8 tasks
@pghorpade pghorpade self-assigned this Jun 2, 2021
@pghorpade pghorpade mentioned this issue Jun 10, 2021
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DO NOT MERGE This PR with break stuff, do not merge it yet.
Projects
None yet
Development

No branches or pull requests

3 participants