Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

[FEATURE] Display most popular icons in Search for Icons page #8421 #9068

Merged
merged 11 commits into from
Oct 1, 2023

Conversation

ZeeMonk-pixel
Copy link
Contributor

@ZeeMonk-pixel ZeeMonk-pixel commented Sep 14, 2023

Fixes Issue

Related to #8421

Changes proposed

Show the 20 most popular icons on the page before search.

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • My change requires changes to the documentation.
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • This PR does not contain plagiarized content.
  • The title of my pull request is a short description of the requested changes.

Screenshots

icons feature

Note to reviewers

@eddiejaoude
Copy link
Member

Thank you, please fix failing test on the GitHub action

@github-actions github-actions bot added issue linked Pull Request has issue linked tests and removed issue linked Pull Request has issue linked labels Sep 14, 2023
@ZeeMonk-pixel
Copy link
Contributor Author

Thank you, please fix failing test on the GitHub action

I’ll look further into it and fix.

@SaraJaoude SaraJaoude added issue linked Pull Request has issue linked and removed tests labels Sep 15, 2023
@ZeeMonk-pixel
Copy link
Contributor Author

Thank you, please fix failing test on the GitHub action

I’ll look further into it and fix.

@eddiejaoude I'll need help figuring out this failed test. I can't seem to wrap my head around it

@ckelwin
Copy link

ckelwin commented Sep 23, 2023

@ZeeMonk-pixel As stated here, the test is failing because the expected result count does not match.

The test is doing:

  • expect to have 20 (popular) icons listed by default - OK.
  • search for icons using the term "mobile"
  • expect to have at least 20 results returned (test is reusing the defaultIcons value) - KO. The original test was checking for "at least 5 results returned" which was OK.
    Expected: >= 20
    Received:    7
  • Your PR added extra 'popular icons' to be displayed by default but should not affect the search result of the icons.

image

Should be fine to update the tests accordingly, to expect at least 7 results (see screenshot below).

https://github.com/ZeeMonk-pixel/BioDrop/blob/main/tests/icon.spec.js#L23

  await expect(results).toBeGreaterThanOrEqual(7);

@ZeeMonk-pixel
Copy link
Contributor Author

@ZeeMonk-pixel As stated here, the test is failing because the expected result count does not match.

The test is doing:

  • expect to have 20 (popular) icons listed by default - OK.
  • search for icons using the term "mobile"
  • expect to have at least 20 results returned (test is reusing the defaultIcons value) - KO. The original test was checking for "at least 5 results returned" which was OK.
    Expected: >= 20
    Received:    7
  • Your PR added extra 'popular icons' to be displayed by default but should not affect the search result of the icons.

image

Should be fine to update the tests accordingly, to expect at least 7 results (see screenshot below).

https://github.com/ZeeMonk-pixel/BioDrop/blob/main/tests/icon.spec.js#L23

  await expect(results).toBeGreaterThanOrEqual(7);

Thank you for more insight to this, I'll look into it and complete this PR

@github-actions github-actions bot added the tests label Sep 30, 2023
Copy link
Member

@eddiejaoude eddiejaoude left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution. But this does not solve the issue.

We can merge this, but we will leave the issue open and unassign it, because the issue is for making this list of icons dynamic out of the database and moving away from having it hardcoded.

@eddiejaoude eddiejaoude merged commit 5794d38 into EddieHubCommunity:main Oct 1, 2023
13 checks passed
@ZeeMonk-pixel
Copy link
Contributor Author

Thank you for your contribution. But this does not solve the issue.

We can merge this, but we will leave the issue open and unassign it, because the issue is for making this list of icons dynamic out of the database and moving away from having it hardcoded.

Okay... so it's not just getting the popular ones from the database now but having the popular ones change as it changes on the database overtime?

@eddiejaoude
Copy link
Member

Yes sorry if that was not clear, we are improving our issue descriptions

@ZeeMonk-pixel
Copy link
Contributor Author

Yes sorry if that was not clear, we are improving our issue descriptions

okay. so if I'm getting this right... that means there'll be a getServerSideProps running the query to the database on every visit to the page?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue linked Pull Request has issue linked tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants