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

feat(component-index): 1555-component-index-filter-ui-functionality #1584

Conversation

andreancardona
Copy link
Contributor

Closes #1555

Updates

This is the final step for a soft release on the component filter. This PR should have the following functionality:

  • Filter by different categories

  • Filter and sort different categories

  • Match the following filter

@vercel
Copy link

vercel bot commented Aug 18, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

undefined – ./

🔍 Inspect: https://vercel.com/carbon-design-system/carbondesignsystem/epilspahd
✅ Preview: https://carbondesignsy-git-fork-andreancardona-1555-component-in-f09851.carbon-design-system.vercel.app

@vercel
Copy link

vercel bot commented Aug 18, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

carbon-website – ./

🔍 Inspect: In Progress
✅ Preview: In Progress

carbondesignsystem – ./

🔍 Inspect: In Progress
✅ Preview: In Progress

Copy link
Member

@aagonzales aagonzales left a comment

Choose a reason for hiding this comment

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

Its looks good, its needs a few tweaks though.

  1. The left page alignment is off.
    As-is:
    image
    To-be:
    The type should be inset and the search and tiles should be the things that hang. This is similar to the alignment like on the Icon library page.
    image

  2. The border between cards shouldn't just be a space. It actually needs to be a color (gray20, $ui-03). The resource cards on the website will have this same treatment
    image

  3. The bottom of the cards are breaking at around 1060px screen size. Can we just drop the maintainer tag when they start getting close? Is that possible or do wee need to figure out a wrap of some sort?
    image

  4. It looks like there's a little extra space around the maintainer tags and is causing it items on the bottom to sit a little high. The framework and maintainer tag are also misaligne.
    image

image

  1. In mobile the cards should be flush to edge. Looks like its got about 32px on both sides right now.

image

  1. The notification at the top of the page should actually go below the intro text to be consistent with how it place it else where.

src/components/ComponentIndexPage/component-index.scss Outdated Show resolved Hide resolved
src/components/ComponentIndexPage/component-index.scss Outdated Show resolved Hide resolved
src/components/ComponentIndexPage/index.js Outdated Show resolved Hide resolved
.map((value) => (value === 'Cloud Data & AI' ? 'CD&AI' : value)),
};

const filterFunction = ({
Copy link
Contributor

Choose a reason for hiding this comment

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

You should be able to pull this into the outer scope and provide the selected options 👀 Maybe something like:

function filterItems(items, filters) {
  // ...
}

And then later on it becomes:

results = (
  <ComponentIndexList
    items={
      filterItems(searchOptions.slice(), selected)
        .sort(sortBy[activeSortOption])
    }
  />
);

filterItems could look like:

function filterItems(items, filters) {
  return items.filter(item => {
    // If there are no filters, return true
    if (filters.length === 0) {
      return true;
    }

    const { framework, designAsset, availability, maintainer } = item;
    const fields = [framework, designAsset, availability, maintainer];
    return filters.every(filter => {
      return fields.includes(filter);
    });
  });
}

In it, the idea is that you go through every item to be displayed and grab the relevant fields to be filtered by. The AND operation is the filters.every bit, in other words for every filter we need to see if the item has the corresponding field available.

…te into 1555-component-index-filter-ui-functionality
Co-authored-by: Josh Black <josh@josh.black>
Copy link
Member

@aagonzales aagonzales left a comment

Choose a reason for hiding this comment

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

Good work, looks awesome!

@joshblack
Copy link
Contributor

@andreancardona just saw the review re-request, still had those comments from above but beside that should be good 👍

@joshblack
Copy link
Contributor

Side-note, do we want to add it to the side nav with this PR? @aagonzales @andreancardona ?

andrea.cardonaibm.com added 2 commits August 24, 2020 16:12
….com:andreancardona/carbon-website into 1555-component-index-filter-ui-functionality
src/data/nav-items.yaml Outdated Show resolved Hide resolved
@vercel vercel bot temporarily deployed to Preview August 24, 2020 21:22 Inactive
@vpicone
Copy link
Contributor

vpicone commented Aug 24, 2020

The search filter styles are different than we have on the icon search page. @aagonzales should we try and normalize them? Our search pattern shows dropdowns inline.

Screen Shot 2020-08-24 at 4 34 52 PM

Screen Shot 2020-08-24 at 4 34 41 PM

@aagonzales
Copy link
Member

aagonzales commented Aug 24, 2020

@vpicone Its purposefully different. The icons dropdown is a sub category of search. In the index sort is a different function and didn't make sense to be inline with search. It also throws off page alignment. The design team talked it through awhile ago and Mike was also involved.

We could normalize the border bottom however. And make it the lighter gray in the index.

@vpicone
Copy link
Contributor

vpicone commented Aug 24, 2020

@aagonzales okay thanks for clarifying, let me know if we'd rather have the index use the darker border.

Copy link
Contributor

@jillianhowarth jillianhowarth left a comment

Choose a reason for hiding this comment

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

Just one small change but otherwise it looks awesome, @andreancardona!! 🎉

src/data/nav-items.yaml Outdated Show resolved Hide resolved
Co-authored-by: jillianhowarth <jillianlovesdogs@gmail.com>
Copy link
Contributor

@vpicone vpicone left a comment

Choose a reason for hiding this comment

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

Not sure about the border, but we can always tweak that later.

Looks good to me once search and dropdown are the same height!

@kodiakhq kodiakhq bot merged commit 56e72e8 into carbon-design-system:master Aug 25, 2020
natashadecoste pushed a commit to natashadecoste/carbon-website that referenced this pull request May 19, 2021
…arbon-design-system#1584)

* feat(component-index): 1555-component-index-filter-ui-functionality

* all design updates done - except grid

* responsive breakpoints updated - need to fix left grid alignment

* feat(component-index): 1555-component-index-filter-ui-functionality - soft launch preview

* things working

* feat(component-index): all features should be working

* updated filter refactor

* feat(component-index): 1555-component-index-filter-ui-functionality - soft launch

* Update src/components/ComponentIndexPage/index.js

Co-authored-by: Josh Black <josh@josh.black>

* feat(component-index): redirect, and css updates

* feat(component-index): deleted components mdx file

* Update src/data/nav-items.yaml

Co-authored-by: jillianhowarth <jillianlovesdogs@gmail.com>

Co-authored-by: andrea.cardonaibm.com <andrea.cardonaibm.com>
Co-authored-by: Josh Black <josh@josh.black>
Co-authored-by: Vince Picone <vpicone@gmail.com>
Co-authored-by: jillianhowarth <jillianlovesdogs@gmail.com>
natashadecoste pushed a commit to natashadecoste/carbon-website that referenced this pull request May 19, 2021
…arbon-design-system#1584)

* feat(component-index): 1555-component-index-filter-ui-functionality

* all design updates done - except grid

* responsive breakpoints updated - need to fix left grid alignment

* feat(component-index): 1555-component-index-filter-ui-functionality - soft launch preview

* things working

* feat(component-index): all features should be working

* updated filter refactor

* feat(component-index): 1555-component-index-filter-ui-functionality - soft launch

* Update src/components/ComponentIndexPage/index.js

Co-authored-by: Josh Black <josh@josh.black>

* feat(component-index): redirect, and css updates

* feat(component-index): deleted components mdx file

* Update src/data/nav-items.yaml

Co-authored-by: jillianhowarth <jillianlovesdogs@gmail.com>

Co-authored-by: andrea.cardonaibm.com <andrea.cardonaibm.com>
Co-authored-by: Josh Black <josh@josh.black>
Co-authored-by: Vince Picone <vpicone@gmail.com>
Co-authored-by: jillianhowarth <jillianlovesdogs@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.

component-index: Filtering
5 participants