Skip to content
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

Circulars: Add In-Page Lucene Documentation #2713

Merged
35 changes: 35 additions & 0 deletions app/routes/circulars._archive._index/LuceneMenu.tsx
tylerbarna marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*!
* 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'

Check warning on line 8 in app/routes/circulars._archive._index/LuceneMenu.tsx

View check run for this annotation

Codecov / codecov/patch

app/routes/circulars._archive._index/LuceneMenu.tsx#L8

Added line #L8 was not covered by tests

import { CopyableCode } from '~/components/CopyableCode'

Check warning on line 10 in app/routes/circulars._archive._index/LuceneMenu.tsx

View check run for this annotation

Codecov / codecov/patch

app/routes/circulars._archive._index/LuceneMenu.tsx#L10

Added line #L10 was not covered by tests

export function LuceneAccordion() {
return (

Check warning on line 13 in app/routes/circulars._archive._index/LuceneMenu.tsx

View check run for this annotation

Codecov / codecov/patch

app/routes/circulars._archive._index/LuceneMenu.tsx#L12-L13

Added lines #L12 - L13 were not covered by tests
<details>
<summary>Advanced Search</summary>
<p className="usa-paragraph">
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{' '}
<Link className="usa-link" to="/docs/circulars/advanced-search">
here
</Link>
{'. '}
</p>
<h4>Lucene Examples (click to copy):</h4>
<div>
<CopyableCode text='subject:"Swift"' />
<br />
<CopyableCode text='body:"GRB"' />
<br />
<CopyableCode text='submitter:"Tomas Ahumada Mena"' />
</div>
</details>
)
}
24 changes: 13 additions & 11 deletions app/routes/circulars._archive._index/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,21 @@
import clamp from 'lodash/clamp'
import { useId, useState } from 'react'

import {

Check warning on line 21 in app/routes/circulars._archive._index/route.tsx

View check run for this annotation

Codecov / codecov/patch

app/routes/circulars._archive._index/route.tsx#L21

Added line #L21 was not covered by tests
circularRedirect,
createChangeRequest,
get,
getChangeRequest,
getChangeRequests,
moderatorGroup,
put,
putVersion,
search,
} from '../circulars/circulars.server'
import CircularsHeader from './CircularsHeader'
import CircularsIndex from './CircularsIndex'
import { DateSelector } from './DateSelectorMenu'
import { LuceneAccordion } from './LuceneMenu'

Check warning on line 35 in app/routes/circulars._archive._index/route.tsx

View check run for this annotation

Codecov / codecov/patch

app/routes/circulars._archive._index/route.tsx#L35

Added line #L35 was not covered by tests
import { SortSelector } from './SortSelectorButton'
import SynonymGroupIndex from './SynonymGroupIndex'
import Hint from '~/components/Hint'
Expand All @@ -36,17 +48,6 @@
type CircularMetadata,
circularFormats,
} from '~/routes/circulars/circulars.lib'
import {
circularRedirect,
createChangeRequest,
get,
getChangeRequest,
getChangeRequests,
moderatorGroup,
put,
putVersion,
search,
} from '~/routes/circulars/circulars.server'
import type { SynonymGroupWithMembers } from '~/routes/synonyms/synonyms.lib'
import { groupMembersByEventId } from '~/routes/synonyms/synonyms.server'

Expand Down Expand Up @@ -319,6 +320,7 @@
To navigate to a specific circular, enter the associated Circular ID
(e.g. 'gcn123', 'Circular 123', or '123').
</Hint>
{useFeature('CIRCULARS_LUCENE') && <LuceneAccordion />}
{clean && (
<>
{isGroupView ? (
Expand Down
Loading