Skip to content

closes #376 - Implement search and admin-filter functionality into Admin Users page #377

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
merged 33 commits into from
Aug 12, 2020

Conversation

anthonykhoa
Copy link
Collaborator

@anthonykhoa anthonykhoa commented Aug 6, 2020

Users should be able to see a search bar, search options, as well as filter options when on the admin users page. These functionalities should all work as well.

This PR will:

  • Create and implement filter/search options and search bar into admin users page
  • Set up a state that changes when someone clicks on another search or filter option button
  • Remove some custom css styling from pages/admin/users.tsx to look more professional, used bootstrap classes instead where possible
  • Highlight searchTerm in the search results

Screen Shot 2020-08-09 at 9 28 29 PM

@vercel
Copy link

vercel bot commented Aug 6, 2020

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

🔍 Inspect: https://vercel.com/c0d3/c0d3-app/fnn9nbbhb
✅ Preview: https://c0d3-app-git-searchfilters.c0d3.vercel.app

@anthonykhoa anthonykhoa changed the title Searchfilters closes #376 - Display search-bar, search options, and filter options on admin users page Aug 6, 2020
@codecov
Copy link

codecov bot commented Aug 6, 2020

Codecov Report

Merging #377 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #377   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           80        80           
  Lines         1027      1027           
  Branches       231       231           
=========================================
  Hits          1027      1027           

@anthonykhoa anthonykhoa marked this pull request as ready for review August 6, 2020 00:32
@vercel vercel bot temporarily deployed to Preview August 10, 2020 04:33 Inactive
const splitArr = str.toLowerCase().split(lowerCaseSearchTerm)
let tracker = 0

const res = splitArr.reduce((acc: string[], word: string) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of using a tracker, couldn't you use the index?

...reduce( (acc: string[], word: string, i: number) => {

let tracker = 0

const res = splitArr.reduce((acc: string[], word: string) => {
acc.push(word)
Copy link
Contributor

Choose a reason for hiding this comment

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

const originalWord = str.substr( tracker, word.length )
acc.push(originalWord)

khoa added 2 commits August 11, 2020 16:18
…more comments, take out unused variable
…more comments, take out unused variable
str: string,
lowerCaseSearchTerm: string,
searchTerm: string
) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

const lowerCaseSearchTerm = searchTerm.toLowerCase() you don't need to pass this in as a variable.

@songz songz merged commit 153372e into master Aug 12, 2020
@ggwadera ggwadera deleted the searchfilters branch April 10, 2021 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants