diff --git a/server/graph/schemas/page.graphql b/server/graph/schemas/page.graphql
index fb35dd67..ed083b86 100644
--- a/server/graph/schemas/page.graphql
+++ b/server/graph/schemas/page.graphql
@@ -15,10 +15,18 @@ extend type Query {
): PageVersion
searchPages(
+ siteId: UUID!
query: String!
path: String
- locale: String
- ): PageSearchResponse!
+ locale: [String]
+ tags: [String]
+ editor: String
+ publishState: PagePublishState
+ orderBy: PageSearchSort
+ orderByDirection: OrderByDirection
+ offset: Int
+ limit: Int
+ ): PageSearchResponse
pages(
limit: Int
@@ -28,7 +36,7 @@ extend type Query {
locale: String
creatorId: Int
authorId: Int
- ): [PageListItem!]!
+ ): [PageListItem]
pageById(
id: UUID!
@@ -261,10 +269,13 @@ type PageSearchResponse {
}
type PageSearchResult {
- id: String
+ id: UUID
title: String
description: String
+ icon: String
path: String
+ tags: [String]
+ updatedAt: Date
locale: String
}
@@ -378,6 +389,12 @@ input PageTocDepthInput {
max: Int!
}
+enum PageSearchSort {
+ relevancy
+ title
+ updated
+}
+
enum PageOrderBy {
CREATED
ID
diff --git a/server/locales/en.json b/server/locales/en.json
index 233cb0a4..44fbacd8 100644
--- a/server/locales/en.json
+++ b/server/locales/en.json
@@ -1752,6 +1752,9 @@
"profile.title": "Profile",
"profile.uploadNewAvatar": "Upload New Image",
"profile.viewPublicProfile": "View Public Profile",
+ "search.filters": "Filters",
+ "search.results": "Search Results",
+ "search.sortBy": "Sort By",
"tags.clearSelection": "Clear Selection",
"tags.currentSelection": "Current Selection",
"tags.locale": "Locale",
diff --git a/ux/src/components/HeaderNav.vue b/ux/src/components/HeaderNav.vue
index 0863becf..0cb602fb 100644
--- a/ux/src/components/HeaderNav.vue
+++ b/ux/src/components/HeaderNav.vue
@@ -31,37 +31,34 @@ q-header.bg-header.text-white.site-header(
)
q-input(
dark
- v-model='state.search'
+ v-model='siteStore.search'
standout='bg-white text-dark'
dense
rounded
ref='searchField'
style='width: 100%;'
label='Search...'
+ @keyup.enter='onSearchEnter'
+ @focus='state.searchKbdShortcutShown = false'
+ @blur='state.searchKbdShortcutShown = true'
)
template(v-slot:prepend)
q-icon(name='las la-search')
template(v-slot:append)
- q-icon.cursor-pointer(
- name='las la-times'
- @click='state.search=``'
- v-if='state.search.length > 0'
- :color='$q.dark.isActive ? `blue` : `grey-4`'
- )
- q-badge.q-ml-sm(
+ q-badge.q-mr-sm(
+ v-if='state.searchKbdShortcutShown'
label='Ctrl+K'
color='grey-7'
outline
@click='searchField.focus()'
)
- //- q-btn.q-ml-md(
- //- flat
- //- round
- //- dense
- //- icon='las la-tags'
- //- color='grey'
- //- to='/_tags'
- //- )
+ q-icon.cursor-pointer(
+ name='las la-times'
+ size='20px'
+ @click='siteStore.search=``'
+ v-if='siteStore.search.length > 0'
+ color='grey-6'
+ )
q-toolbar(
style='height: 64px;'
dark
@@ -124,17 +121,18 @@ q-header.bg-header.text-white.site-header(
+
+
diff --git a/ux/src/router/routes.js b/ux/src/router/routes.js
index a1bc5121..0f6c0b2c 100644
--- a/ux/src/router/routes.js
+++ b/ux/src/router/routes.js
@@ -32,6 +32,10 @@ const routes = [
{ path: 'groups', component: () => import('src/pages/ProfileGroups.vue') }
]
},
+ {
+ path: '/_search',
+ component: () => import('src/pages/Search.vue')
+ },
{
path: '/_admin',
component: () => import('layouts/AdminLayout.vue'),