stable

Clone or download

Read-only

feat: Call REST endpoint from frontend

When `fts_db` is enabled, a REST call is made to retrieve results. For now we only display the title, but it will evolve later to provide rich content. * the REST call is not made if keywords is less than 3 chars * a spinner is displayed to show that something is happening * If REST call is in error, an error message is displayed * only the first page of results is displayed for now * to not flood the server for every keystroke while user is typing, the REST call is delayed Note: pagination will be done in a dedicated commit When `fts_db` is disabled, no functional changes ("No results" is still displayed when no projects and no recent items match the search). Note: there is a first try to call the search API, but since we end up in a 404, we stop searching stuff. Part of story #26771: Index artifact fields (REST + Switch to) on updated artifacts only Change-Id: I8ba3087c103db07b9ea2de3fa5410b095f996657

Modified Files

Name
M src/common/User/SwitchToPresenter.php +4 −16 Go to diff View file
M src/common/User/SwitchToPresenterBuilder.php +3 −14 Go to diff View file
M src/package.json +4 −0 Go to diff View file
M src/pnpm-lock.yaml +12 −0 Go to diff View file
M src/scripts/switch-to/po/fr_FR.po +6 −0 Go to diff View file
M src/scripts/switch-to/po/pt_BR.po +6 −0 Go to diff View file
A src/scripts/switch-to/src/components/Body/HighlightMatchingText.vue +38 −0 Go to diff View file
M src/scripts/switch-to/src/components/Body/Projects/ListOfProjects.vue +2 −2 Go to diff View file
M src/scripts/switch-to/src/components/Body/Projects/ProjectLink.vue +4 −11 Go to diff View file
M src/scripts/switch-to/src/components/Body/Projects/__snapshots__/ProjectLink.test.ts.snap +2 −10 Go to diff View file
M src/scripts/switch-to/src/components/Body/RecentItems/ListOfRecentItems.test.ts +9 −9 Go to diff View file
M src/scripts/switch-to/src/components/Body/RecentItems/ListOfRecentItems.vue +2 −2 Go to diff View file
M src/scripts/switch-to/src/components/Body/RecentItems/RecentItemsEntry.test.ts +6 −6 Go to diff View file
M src/scripts/switch-to/src/components/Body/RecentItems/RecentItemsEntry.vue +9 −19 Go to diff View file
M src/scripts/switch-to/src/components/Body/RecentItems/__snapshots__/RecentItemsEntry.test.ts.snap +16 −51 Go to diff View file
A src/scripts/switch-to/src/components/Body/SearchResults/SearchQueryTooSmall.vue +39 −0 Go to diff View file
M src/scripts/switch-to/src/components/Body/SearchResults/SearchResults.test.ts +278 −30 Go to diff View file
M src/scripts/switch-to/src/components/Body/SearchResults/SearchResults.vue +40 −4 Go to diff View file
A src/scripts/switch-to/src/components/Body/SearchResults/SearchResultsEmpty.vue +23 −0 Go to diff View file
A src/scripts/switch-to/src/components/Body/SearchResults/SearchResultsError.vue +29 −0 Go to diff View file
A src/scripts/switch-to/src/components/Body/SearchResults/SearchResultsList.vue +37 −0 Go to diff View file
A src/scripts/switch-to/src/helpers/delayed-querier.test.ts +61 −0 Go to diff View file
A src/scripts/switch-to/src/helpers/delayed-querier.ts +44 −0 Go to diff View file
M src/scripts/switch-to/src/initiate-app.ts +14 −3 Go to diff View file
A src/scripts/switch-to/src/stores/fulltext.test.ts +227 −0 Go to diff View file
A src/scripts/switch-to/src/stores/fulltext.ts +104 −0 Go to diff View file
M src/scripts/switch-to/src/stores/index.test.ts +60 −28 Go to diff View file
M src/scripts/switch-to/src/stores/index.ts +10 −10 Go to diff View file
M src/scripts/switch-to/src/stores/type.ts +13 −3 Go to diff View file
M src/scripts/switch-to/src/type.ts +2 −2 Go to diff View file
M src/themes/common/css/utils/_switch-to.scss +16 −0 Go to diff View file