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

Filter resources by topic #32

Closed
wants to merge 64 commits into from

Conversation

alinosratipour
Copy link
Contributor

@alinosratipour alinosratipour commented Jan 18, 2024

This is a:

  • New feature - new behaviour has been implemented
  • 🐛 Bug fix - existing behaviour has been made to behave
  • ♻️ Refactor - the behaviour has not changed, just the implementation
  • Test backfill - tests for existing behaviour were added but the behaviour itself hasn't changed
  • ⚙️ Chore - maintenance task, behaviour and implementation haven't changed

Description

  • Purpose -
    we want user to be able to filter resource based on Topic we also want to make sure filter is apply to all pages not just current pages which means if we have same topic in other pages as well they must be shown when filter topic apply.
  • How to check -

You can check out to FilterTopic branch and npm run dev choose topic from drop down menu and see the result or see screen recording below
Screencast from 11-03-24 12:02:33.webm

Links

Author checklist

  • I have written a title that reflects the relevant ticket
  • I have written a description that says what the PR does and how to validate it
  • I have linked to the project board ticket (and any related PRs/issues) in the Links section
  • I have added a link to this PR to the ticket
  • I have made the PR to main from a branch named <category>/<name>, e.g. feature/edit-spaceships or bugfix/restore-oxygen
  • I have manually tested that the app still works correctly
  • I have requested reviewers here and in my team chat channel
  • I have spoken with my PM or TL about any parts of this task that may have become out-of-scope, or any additional improvements that I now realise may benefit my project
  • I have added tests, or new tests were not required
  • I have updated any documentation (e.g. diagrams, schemas), or documentation updates were not required

@alinosratipour alinosratipour marked this pull request as ready for review January 31, 2024 14:55
Copy link
Member

@textbook textbook left a comment

Choose a reason for hiding this comment

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

UX/UI

✅ First acceptance criterion passed, I can filter the list to show only resources of a given topic:

Screenshot 2024-02-01 at 01 28 23

❌ Second acceptance criterion failed, the pagination doesn't work correctly with topic filtering - it won't show resources from subsequent pages, and the number of pages shown doesn't correspond with the number of filtered resources

❓ It wasn't an explicit requirement, but did you realise you can't remove filtering by topic?

❓ Would it make sense for this to be closer to the pagination controls?

Implementation

✅ Resource list component uses topci service (mostly) sensibly

✅ Existing tests have been updated accordingly to keep pipeline passing

❌ Resource list has gained quite a lot of complexity but no additional low-level test cases for that

❌ No E2E test cases (except a brief check that the select is rendered at all)


💡 Also for you specifically we'd talked about SQL stuff, which still isn't shown here - even if we don't get to fixing pagination check my suggestion about using the topic ID, that would involve some.


Key:

  • ✅ approval, nothing needs doing before merge
  • ❌ problem, needs fixing before merge
  • ❓ question, needs answering before merge
  • 💡 suggestion, can be followed or ignored

.vscode/settings.json Show resolved Hide resolved
client/setupTests.js Show resolved Hide resolved
client/src/components/Form/Select.js Show resolved Hide resolved
client/src/components/ResourceList/ResourceList.scss Outdated Show resolved Hide resolved
client/src/components/ResourceList/index.js Outdated Show resolved Hide resolved
client/src/components/ResourceList/index.js Outdated Show resolved Hide resolved
client/src/components/ResourceList/index.js Outdated Show resolved Hide resolved
client/src/components/ResourceList/index.js Outdated Show resolved Hide resolved
client/src/components/ResourceList/index.js Outdated Show resolved Hide resolved
client/src/components/ResourceList/index.js Outdated Show resolved Hide resolved
@textbook
Copy link
Member

textbook commented Feb 15, 2024

A note on the conflicts: you can rebase this branch if you'd like to, but you are not required to. #33 changed the way the frontend is built and tested, which (among other things) requires a .jsx extension for React JSX files. We'll continue to review this as if it applied cleanly.

@alinosratipour alinosratipour requested a review from textbook March 14, 2024 10:16
@alinosratipour
Copy link
Contributor Author

alinosratipour commented Mar 14, 2024

@textbook I Removed Home.test since i moved fetching resources into its own hook and also placed Pagination into resourceList therefor no functionality left in home page.

@alinosratipour alinosratipour marked this pull request as ready for review March 14, 2024 10:22
Copy link
Member

@textbook textbook 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 iterating on this! I think we can consider this complete as far as the Tech Products application process is concerned.

If I were reviewing this as an actual change to merge (or not) into the codebase, I'd still want to do further work. Fundamentally this can't work in a sensible way without having an endpoint that handles filtering and pagination, so you can ask for e.g. "the third page of 20 resources in the React topic".

Also I think changing the filter selection currently resets the user's page size choice, which is a bit awkward (and would particularly conflict with the intent of #17).

I've left some comments for your information, but no further changes are needed for the application.

server/resources/resourcesService.js Outdated Show resolved Hide resolved
server/resources/resourcesService.js Outdated Show resolved Hide resolved
e2e/integration/suggest.test.js Outdated Show resolved Hide resolved
e2e/integration/home.test.js Show resolved Hide resolved
client/src/utils/utils.js Show resolved Hide resolved
client/src/pages/Drafts/Drafts.test.js Show resolved Hide resolved
client/src/pages/Drafts/Drafts.test.js Show resolved Hide resolved
client/src/hooks/usePagination.js Outdated Show resolved Hide resolved
client/src/components/Form/Select.js Show resolved Hide resolved
@alinosratipour
Copy link
Contributor Author

alinosratipour commented Mar 18, 2024

Thank you for iterating on this! I think we can consider this complete as far as the Tech Products application process is concerned.

If I were reviewing this as an actual change to merge (or not) into the codebase, I'd still want to do further work. Fundamentally this can't work in a sensible way without having an endpoint that handles filtering and pagination, so you can ask for e.g. "the third page of 20 resources in the React topic".

Also I think changing the filter selection currently resets the user's page size choice, which is a bit awkward (and would particularly conflict with the intent of #17).

I've left some comments for your information, but no further changes are needed for the application.

@textbook Thank you for your comment. I do agree with you If i understand it correctly we need to send topic id some how to backend and filter resource in there therefor we do not need to bring all data into front end and do filtering and pagination there. 👍

@alinosratipour
Copy link
Contributor Author

Thank you for iterating on this! I think we can consider this complete as far as the Tech Products application process is concerned.
If I were reviewing this as an actual change to merge (or not) into the codebase, I'd still want to do further work. Fundamentally this can't work in a sensible way without having an endpoint that handles filtering and pagination, so you can ask for e.g. "the third page of 20 resources in the React topic".
Also I think changing the filter selection currently resets the user's page size choice, which is a bit awkward (and would particularly conflict with the intent of #17).
I've left some comments for your information, but no further changes are needed for the application.

@textbook Thank you for your comment. I do agree with you If i understand it correctly we need to send topic id some how to backend and filter resource in there therefor we do not need to bring all data into front end and do filtering and pagination there.

Copy link

🍞 Closing as stale (more than one month without updates)

@github-actions github-actions bot closed this Apr 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants