-
-
Notifications
You must be signed in to change notification settings - Fork 22
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(frontend): enable advanced research #463
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UI looks good but I think there may be some logic to update concerning the state
taxonomy-editor-frontend/src/client/models/EntryNodeSearchResult.ts
Outdated
Show resolved
Hide resolved
taxonomy-editor-frontend/src/pages/project/search/SearchResults.tsx
Outdated
Show resolved
Hide resolved
taxonomy-editor-frontend/src/pages/project/search/FiltersArea.tsx
Outdated
Show resolved
Hide resolved
<FiltersArea | ||
setCurrentPage={setCurrentPage} | ||
setQ={setQ} | ||
filters={entryNodeSearchResult?.filters ?? []} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This creates weird states: when you go and fetch a new search result, entryNodeSearchResult
is set to undefined
so the filters are reset during that time
You may want to use placeholderData
and isPlaceholderData
for this: https://tanstack.com/query/latest/docs/framework/react/guides/migrating-to-v5#removed-keeppreviousdata-in-favor-of-placeholderdata-identity-function
taxonomy-editor-frontend/src/pages/project/search/FiltersArea.tsx
Outdated
Show resolved
Hide resolved
taxonomy-editor-frontend/src/pages/project/search/MultipleSelectFilter.tsx
Show resolved
Hide resolved
taxonomy-editor-frontend/src/pages/project/search/SearchResults.tsx
Outdated
Show resolved
Hide resolved
taxonomy-editor-frontend/src/pages/project/search/SearchResults.tsx
Outdated
Show resolved
Hide resolved
taxonomy-editor-frontend/src/pages/project/search/MultipleSelectFilter.tsx
Show resolved
Hide resolved
taxonomy-editor-frontend/src/pages/project/search/FiltersArea.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The language selection seems super slow... Maybe modifying how the states are handled as suggested in other comments may help
taxonomy-editor-frontend/src/pages/project/search/MultipleSelectFilter.tsx
Outdated
Show resolved
Hide resolved
taxonomy-editor-frontend/src/pages/project/search/MultipleSelectFilter.tsx
Outdated
Show resolved
Hide resolved
taxonomy-editor-frontend/src/pages/project/search/ThreeOptionsSwitch.tsx
Outdated
Show resolved
Hide resolved
/> | ||
<MultipleSelectFilter | ||
label="Translated into" | ||
filterValue={chosenLanguagesCodes} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why you do not pass the setFilterValue
function to this component whereas you do that in other places
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, the filterValue
state in the MultipleSelectFilter
component is updated based on the response from the backend. However, MultipleSelectFilter
only updates the query (Q
) sent to the backend. Upon reflection, I realize that both filterValue
and setFilterValue
from FilterInput
should be maintained as component states rather than passed as props.
* feat(frontend): make language selection for translations more intuitive (#461) The PR modifies the translations section of the edit entry page: * Changes "All languages" terminology to "Fallback translations" (fixes #458) * Adds an info alert if "en" (English) or "xx" (Fallback translations) is not the main language for an entry (fixes #457) / Fixes the fact that the alert message about changing the display name of a language appears even if the language had no translations and we add the first one (fixes #459) * Adds a "Show all existing translations" checkbox to see all the languages that currently have translations, with their translations Adds a possibility to "pin" languages to select them (so they stay in local storage and appear at the top for each entry), and a possibility to hide (unselect) these languages easily (with an icon next to their title) * Modifies the selection of new languages: I removed the "number of languages shown" button that had to be clicked to add a language, and created a "Show another language" button at the bottom of the section. Also, the dialog is now an autocomplete instead of a select, and you just type the languages that you want to add and see languages that are not selected, instead of seeing all current languages and being able to remove them. The autocomplete with the options is also automatically focused when opening the dialog. * Adds vite-plugin-svgr to easily import svg files in React --------- Co-authored-by: Charles Perier <charlesperier@Charless-Laptop.local> * feat: add property filter to search API (#456) * feat: add property filter to search API * chore: generate SDK * chore: Add info banners on the frontend (#473) * docs: add info banners * refactor: delete unnecessary components * fix: add line break * improve search results, and few other improvements * show translations instead of translated languages --------- Co-authored-by: Charles Perier <charlesperier@Charless-Laptop.local> Co-authored-by: Eric Nguyen <ericnguyen.developper@gmail.com>
// filterValue: string; | ||
// setFilterValue: Dispatch<SetStateAction<string>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// filterValue: string; | |
// setFilterValue: Dispatch<SetStateAction<string>>; |
// filterValue, | ||
// setFilterValue, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// filterValue, | |
// setFilterValue, |
…ithub.com/openfoodfacts/taxonomy-editor into piv94165/frontend-advanced-research-merge
What
EntryNodes
with filters (example:is:root ancestor:en:ghee dairy
ordescendant:en:dairy language:fr not(language):fr
), full-text-search.Possible evolutions
is:modified property:vegan:en:no not(property):description:en
)Screenshot
advanced-research-V3.mp4