From fb50eea20c499f7c4bd56388602f6bfbb744acad Mon Sep 17 00:00:00 2001 From: tylerbarna Date: Tue, 12 Nov 2024 13:21:12 -0600 Subject: [PATCH 01/10] add in-page lucene docs --- .../circulars._archive._index/LuceneMenu.tsx | 19 +++++++++++++++++++ .../circulars._archive._index/route.tsx | 4 +++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 app/routes/circulars._archive._index/LuceneMenu.tsx diff --git a/app/routes/circulars._archive._index/LuceneMenu.tsx b/app/routes/circulars._archive._index/LuceneMenu.tsx new file mode 100644 index 000000000..e499844aa --- /dev/null +++ b/app/routes/circulars._archive._index/LuceneMenu.tsx @@ -0,0 +1,19 @@ +import { Link } from '@remix-run/react' + +export function LuceneAccordion() { + return ( +
+ Advanced Search + +
+ To narrow the search results, use Lucene search syntax. This allows for + specifying which circular field to search (submitter, subject, and/or + body). Further documentation can be found on the{' '} + + Lucene Search Syntax Page + + {'. '} +
+
+ ) +} diff --git a/app/routes/circulars._archive._index/route.tsx b/app/routes/circulars._archive._index/route.tsx index 005443b3a..717c55735 100644 --- a/app/routes/circulars._archive._index/route.tsx +++ b/app/routes/circulars._archive._index/route.tsx @@ -37,6 +37,7 @@ import { import CircularsHeader from './CircularsHeader' import CircularsIndex from './CircularsIndex' import { DateSelector } from './DateSelectorMenu' +import { LuceneAccordion } from './LuceneMenu' import { SortSelector } from './SortSelectorButton' import Hint from '~/components/Hint' import { ToolbarButtonGroup } from '~/components/ToolbarButtonGroup' @@ -44,7 +45,7 @@ import PaginationSelectionFooter from '~/components/pagination/PaginationSelecti import { origin } from '~/lib/env.server' import { getFormDataString } from '~/lib/utils' import { postZendeskRequest } from '~/lib/zendesk.server' -import { useModStatus } from '~/root' +import { useFeature, useModStatus } from '~/root' import searchImg from 'nasawds/src/img/usa-icons-bg/search--white.svg' @@ -271,6 +272,7 @@ export default function () { To navigate to a specific circular, enter the associated Circular ID (e.g. 'gcn123', 'Circular 123', or '123'). + {useFeature('CIRCULARS_LUCENE') && } {clean && ( <> Date: Sun, 8 Dec 2024 14:19:22 -0600 Subject: [PATCH 02/10] add lucene examples back this restores the lucene example buttons, but rather than populating the search bar, this copies them to the clipboard. There is not a visual feedback for this at the moment, but something like (https://remix.run/resources/remix-toast)[this] could be useful --- .../circulars._archive._index/LuceneMenu.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/routes/circulars._archive._index/LuceneMenu.tsx b/app/routes/circulars._archive._index/LuceneMenu.tsx index e499844aa..1c197f4f4 100644 --- a/app/routes/circulars._archive._index/LuceneMenu.tsx +++ b/app/routes/circulars._archive._index/LuceneMenu.tsx @@ -1,6 +1,17 @@ import { Link } from '@remix-run/react' +import { Button } from '@trussworks/react-uswds' +import CopyToClipboard from 'react-copy-to-clipboard' export function LuceneAccordion() { + function copyableButton(text: string) { + return ( + + + + ) + } return (
Advanced Search @@ -13,6 +24,12 @@ export function LuceneAccordion() { Lucene Search Syntax Page {'. '} +

Lucene Examples (click to copy):

+
+ {copyableButton('subject:"Swift"')} + {copyableButton('body:"GRB"')} + {copyableButton('submitter:"Tomas Ahumada Mena"')} +
) From 4cdd37a8f2c6c0fc9c7d89de7aa423173f9baa4c Mon Sep 17 00:00:00 2001 From: Tyler Barna Date: Thu, 12 Dec 2024 12:54:52 -0600 Subject: [PATCH 03/10] add copyright --- app/routes/circulars._archive._index/LuceneMenu.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/routes/circulars._archive._index/LuceneMenu.tsx b/app/routes/circulars._archive._index/LuceneMenu.tsx index 1c197f4f4..465c9d3e4 100644 --- a/app/routes/circulars._archive._index/LuceneMenu.tsx +++ b/app/routes/circulars._archive._index/LuceneMenu.tsx @@ -1,3 +1,10 @@ +/*! + * Copyright © 2023 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + * + * SPDX-License-Identifier: Apache-2.0 + */ import { Link } from '@remix-run/react' import { Button } from '@trussworks/react-uswds' import CopyToClipboard from 'react-copy-to-clipboard' From 6361cc6844758ca7245051e2be4b38f67246ed09 Mon Sep 17 00:00:00 2001 From: Tyler Barna Date: Thu, 12 Dec 2024 12:57:08 -0600 Subject: [PATCH 04/10] correct link to further docs --- app/routes/circulars._archive._index/LuceneMenu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/routes/circulars._archive._index/LuceneMenu.tsx b/app/routes/circulars._archive._index/LuceneMenu.tsx index 465c9d3e4..1d82debf1 100644 --- a/app/routes/circulars._archive._index/LuceneMenu.tsx +++ b/app/routes/circulars._archive._index/LuceneMenu.tsx @@ -27,7 +27,7 @@ export function LuceneAccordion() { To narrow the search results, use Lucene search syntax. This allows for specifying which circular field to search (submitter, subject, and/or body). Further documentation can be found on the{' '} - + Lucene Search Syntax Page {'. '} From 4877cd8ff0d8a76b6253ca0f7ba79d120810c8f1 Mon Sep 17 00:00:00 2001 From: Tyler Barna Date: Thu, 12 Dec 2024 13:01:39 -0600 Subject: [PATCH 05/10] remove reference to "page" --- app/routes/circulars._archive._index/LuceneMenu.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/routes/circulars._archive._index/LuceneMenu.tsx b/app/routes/circulars._archive._index/LuceneMenu.tsx index 1d82debf1..9c185fa69 100644 --- a/app/routes/circulars._archive._index/LuceneMenu.tsx +++ b/app/routes/circulars._archive._index/LuceneMenu.tsx @@ -26,9 +26,9 @@ export function LuceneAccordion() {
To narrow the search results, use Lucene search syntax. This allows for specifying which circular field to search (submitter, subject, and/or - body). Further documentation can be found on the{' '} + body). Further documentation can be found{' '} - Lucene Search Syntax Page + here {'. '}

Lucene Examples (click to copy):

From a5b7d414fd18175add74463472bd4b687980b965 Mon Sep 17 00:00:00 2001 From: Tyler Barna Date: Thu, 12 Dec 2024 13:03:00 -0600 Subject: [PATCH 06/10] remove unneeded div --- .../circulars._archive._index/LuceneMenu.tsx | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/app/routes/circulars._archive._index/LuceneMenu.tsx b/app/routes/circulars._archive._index/LuceneMenu.tsx index 9c185fa69..9907761fe 100644 --- a/app/routes/circulars._archive._index/LuceneMenu.tsx +++ b/app/routes/circulars._archive._index/LuceneMenu.tsx @@ -22,21 +22,18 @@ export function LuceneAccordion() { return (
Advanced Search - + To narrow the search results, use Lucene search syntax. This allows for + specifying which circular field to search (submitter, subject, and/or + body). Further documentation can be found{' '} + + here + + {'. '} +

Lucene Examples (click to copy):

- To narrow the search results, use Lucene search syntax. This allows for - specifying which circular field to search (submitter, subject, and/or - body). Further documentation can be found{' '} - - here - - {'. '} -

Lucene Examples (click to copy):

-
- {copyableButton('subject:"Swift"')} - {copyableButton('body:"GRB"')} - {copyableButton('submitter:"Tomas Ahumada Mena"')} -
+ {copyableButton('subject:"Swift"')} + {copyableButton('body:"GRB"')} + {copyableButton('submitter:"Tomas Ahumada Mena"')}
) From 7e6a6fdfba10a1d903915316ba3fa0e5374b82c7 Mon Sep 17 00:00:00 2001 From: Tyler Barna Date: Thu, 12 Dec 2024 13:11:56 -0600 Subject: [PATCH 07/10] correct merge with main --- .../circulars._archive._index/route.tsx | 27 ++++++------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/app/routes/circulars._archive._index/route.tsx b/app/routes/circulars._archive._index/route.tsx index e66e66c5a..c4a3da84b 100644 --- a/app/routes/circulars._archive._index/route.tsx +++ b/app/routes/circulars._archive._index/route.tsx @@ -18,24 +18,6 @@ import { Alert, Button, Icon, Label, TextInput } from '@trussworks/react-uswds' import clamp from 'lodash/clamp' import { useId, useState } from 'react' -import CircularsHeader from './CircularsHeader' -import CircularsIndex from './CircularsIndex' -import { DateSelector } from './DateSelectorMenu' -import { SortSelector } from './SortSelectorButton' -import SynonymGroupIndex from './SynonymGroupIndex' -import Hint from '~/components/Hint' -import { ToolbarButtonGroup } from '~/components/ToolbarButtonGroup' -import PaginationSelectionFooter from '~/components/pagination/PaginationSelectionFooter' -import { feature, origin } from '~/lib/env.server' -import { getFormDataString } from '~/lib/utils' -import { postZendeskRequest } from '~/lib/zendesk.server' -import { useFeature, useModStatus } from '~/root' -import { getUser } from '~/routes/_auth/user.server' -import { - type CircularFormat, - type CircularMetadata, - circularFormats, -} from '~/routes/circulars/circulars.lib' import { circularRedirect, createChangeRequest, @@ -52,13 +34,20 @@ import CircularsIndex from './CircularsIndex' import { DateSelector } from './DateSelectorMenu' import { LuceneAccordion } from './LuceneMenu' import { SortSelector } from './SortSelectorButton' +import SynonymGroupIndex from './SynonymGroupIndex' import Hint from '~/components/Hint' import { ToolbarButtonGroup } from '~/components/ToolbarButtonGroup' import PaginationSelectionFooter from '~/components/pagination/PaginationSelectionFooter' -import { origin } from '~/lib/env.server' +import { feature, origin } from '~/lib/env.server' import { getFormDataString } from '~/lib/utils' import { postZendeskRequest } from '~/lib/zendesk.server' import { useFeature, useModStatus } from '~/root' +import { getUser } from '~/routes/_auth/user.server' +import { + type CircularFormat, + type CircularMetadata, + circularFormats, +} from '~/routes/circulars/circulars.lib' import type { SynonymGroupWithMembers } from '~/routes/synonyms/synonyms.lib' import { groupMembersByEventId } from '~/routes/synonyms/synonyms.server' From d34ed8fc25c26da35021de7bcdb9597ddb9fdd0d Mon Sep 17 00:00:00 2001 From: tylerbarna Date: Mon, 16 Dec 2024 10:12:43 -0600 Subject: [PATCH 08/10] restyle details --- .../circulars._archive._index/LuceneMenu.tsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/routes/circulars._archive._index/LuceneMenu.tsx b/app/routes/circulars._archive._index/LuceneMenu.tsx index 9907761fe..d925af684 100644 --- a/app/routes/circulars._archive._index/LuceneMenu.tsx +++ b/app/routes/circulars._archive._index/LuceneMenu.tsx @@ -22,13 +22,15 @@ export function LuceneAccordion() { return (
Advanced Search - To narrow the search results, use Lucene search syntax. This allows for - specifying which circular field to search (submitter, subject, and/or - body). Further documentation can be found{' '} - - here - - {'. '} +

+ To narrow the search results, use Lucene search syntax. This allows for + specifying which circular field to search (submitter, subject, and/or + body). Further documentation can be found{' '} + + here + + {'. '} +

Lucene Examples (click to copy):

{copyableButton('subject:"Swift"')} From e4ca0ba557e43d826fa7daf9e8e23c1d96bdecfa Mon Sep 17 00:00:00 2001 From: tylerbarna Date: Mon, 16 Dec 2024 10:20:42 -0600 Subject: [PATCH 09/10] change example method --- .../circulars._archive._index/LuceneMenu.tsx | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/app/routes/circulars._archive._index/LuceneMenu.tsx b/app/routes/circulars._archive._index/LuceneMenu.tsx index d925af684..c5c6e6485 100644 --- a/app/routes/circulars._archive._index/LuceneMenu.tsx +++ b/app/routes/circulars._archive._index/LuceneMenu.tsx @@ -6,19 +6,10 @@ * SPDX-License-Identifier: Apache-2.0 */ import { Link } from '@remix-run/react' -import { Button } from '@trussworks/react-uswds' -import CopyToClipboard from 'react-copy-to-clipboard' + +import { CopyableCode } from '~/components/CopyableCode' export function LuceneAccordion() { - function copyableButton(text: string) { - return ( - - - - ) - } return (
Advanced Search @@ -33,9 +24,11 @@ export function LuceneAccordion() {

Lucene Examples (click to copy):

- {copyableButton('subject:"Swift"')} - {copyableButton('body:"GRB"')} - {copyableButton('submitter:"Tomas Ahumada Mena"')} + +
+ +
+
) From a1768560ec142bcf37ae1f15f32cc954aa841f92 Mon Sep 17 00:00:00 2001 From: tylerbarna Date: Tue, 17 Dec 2024 12:29:35 -0600 Subject: [PATCH 10/10] rerun checks