diff --git a/arches_lingo/src/arches_lingo/App.vue b/arches_lingo/src/arches_lingo/App.vue index 262bc710..4c8ad376 100644 --- a/arches_lingo/src/arches_lingo/App.vue +++ b/arches_lingo/src/arches_lingo/App.vue @@ -77,6 +77,7 @@ main { font-family: sans-serif; height: 100vh; width: 100vw; + overflow-x: hidden; display: flex; flex-direction: column; } diff --git a/arches_lingo/src/arches_lingo/api.ts b/arches_lingo/src/arches_lingo/api.ts index f6b9f3d2..657efbe4 100644 --- a/arches_lingo/src/arches_lingo/api.ts +++ b/arches_lingo/src/arches_lingo/api.ts @@ -54,3 +54,28 @@ export const fetchUser = async () => { throw new Error((error as Error).message || response.statusText); } }; + +export const fetchSearchResults = async ( + searchTerm: string, + items: number, + page: number, +) => { + const params = new URLSearchParams({ + term: searchTerm, + items: items.toString(), + page: page.toString(), + }); + + const url = `${arches.urls.api_search}?${params.toString()}`; + + const response = await fetch(url); + try { + const responseJson = await response.json(); + if (response.ok) { + return responseJson; + } + throw new Error(responseJson.message); + } catch (error) { + throw new Error((error as Error).message || response.statusText); + } +}; diff --git a/arches_lingo/src/arches_lingo/components/basic-search/BasicSearch.vue b/arches_lingo/src/arches_lingo/components/basic-search/BasicSearch.vue new file mode 100644 index 00000000..5a8f46da --- /dev/null +++ b/arches_lingo/src/arches_lingo/components/basic-search/BasicSearch.vue @@ -0,0 +1,313 @@ + + + + + diff --git a/arches_lingo/src/arches_lingo/components/basic-search/SearchResult.vue b/arches_lingo/src/arches_lingo/components/basic-search/SearchResult.vue new file mode 100644 index 00000000..166a0892 --- /dev/null +++ b/arches_lingo/src/arches_lingo/components/basic-search/SearchResult.vue @@ -0,0 +1,72 @@ + + + + + diff --git a/arches_lingo/src/arches_lingo/components/basic-search/SortAndFilterControls.vue b/arches_lingo/src/arches_lingo/components/basic-search/SortAndFilterControls.vue new file mode 100644 index 00000000..fcad02fb --- /dev/null +++ b/arches_lingo/src/arches_lingo/components/basic-search/SortAndFilterControls.vue @@ -0,0 +1,130 @@ + + + + + diff --git a/arches_lingo/src/arches_lingo/components/header/PageHeader.vue b/arches_lingo/src/arches_lingo/components/header/PageHeader.vue index c653ff50..c5d4a0cd 100644 --- a/arches_lingo/src/arches_lingo/components/header/PageHeader.vue +++ b/arches_lingo/src/arches_lingo/components/header/PageHeader.vue @@ -6,15 +6,11 @@ import Menubar from "primevue/menubar"; import { routeNames } from "@/arches_lingo/routes.ts"; import UserInteraction from "@/arches_lingo/components/user/UserInteraction.vue"; +import SearchDialog from "@/arches_lingo/components/header/SearchDialog.vue"; const { $gettext } = useGettext(); const items = ref([ - { - label: $gettext("Search"), - icon: "fa fa-search", - name: routeNames.search, - }, { label: $gettext("Advanced Search"), icon: "fa fa-file", @@ -35,6 +31,7 @@ const items = ref([ >

{{ $gettext("Arches Lingo") }}

+