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

Feature/437 document text search #197

Merged
merged 26 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1a6d5cd
EQ-437 Prototyping full text search functionality
maxdiebold-erg Oct 24, 2024
34b9114
EQ-437 Added search results preview to UI
maxdiebold-erg Oct 24, 2024
231414b
EQ-437 Move percent sign into column header
maxdiebold-erg Nov 7, 2024
464d23c
EQ-437 Move search preview into modal
maxdiebold-erg Nov 19, 2024
2b5c246
EQ-437 Enabled sorting on table
maxdiebold-erg Nov 21, 2024
c31aabd
EQ-437 Added new document profiles to ETL
maxdiebold-erg Dec 4, 2024
03de730
EQ-437 Configured auxiliary search vector table and functions
maxdiebold-erg Dec 5, 2024
6c273e0
EQ-437 Updated server code to handle new profiles
maxdiebold-erg Dec 12, 2024
1c46347
EQ-437 Updated UI fields to accommodate new profiles
maxdiebold-erg Dec 12, 2024
26e9ff8
EQ-437 Fixed error raised when query returns no results
maxdiebold-erg Dec 30, 2024
cf32e1c
EQ-437 Configurable field width
maxdiebold-erg Dec 30, 2024
7e62799
EQ-437 Adjusted table layout
maxdiebold-erg Dec 31, 2024
f80ad09
EQ-437 Addressed some lingering issues
maxdiebold-erg Dec 31, 2024
629991c
EQ-437 Added Action Documents filter fields
maxdiebold-erg Dec 31, 2024
0a27c8a
EQ-437 Changed documentType to actionDocumentType
maxdiebold-erg Dec 31, 2024
b2d64ec
EQ-437 Updated OpenAPI spec
maxdiebold-erg Dec 31, 2024
659b272
EQ-437 Updated empty result to generic message
maxdiebold-erg Jan 2, 2025
8b1599b
EQ-437 Updated API to check for views in values query
maxdiebold-erg Jan 2, 2025
98a5e37
Merge branch 'develop' into feature/437_document-text-search
maxdiebold-erg Jan 2, 2025
b5e7aa4
EQ-437 Removed unused variable
maxdiebold-erg Jan 2, 2025
16071a0
EQ-437 Adjusted modal height, removed unused environment variables
maxdiebold-erg Jan 3, 2025
0c0abff
EQ-437 Moved preview modal layout to config
maxdiebold-erg Jan 3, 2025
b97d91c
EQ-437 Moved rank percent to front of download file
maxdiebold-erg Jan 3, 2025
62dcd14
EQ-437 Removed unused environment variables from build process.
cschwinderg Jan 3, 2025
af80677
EQ-437 Updated Actions profile client-side config
maxdiebold-erg Jan 3, 2025
30f8688
Update app/client/src/routes/home.tsx
maxdiebold-erg Jan 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ jobs:
EQ_BASIC_USER_NAME: ${{ secrets.EQ_BASIC_USER_NAME }}
EQ_BASIC_USER_PWD: ${{ secrets.EQ_BASIC_USER_PWD }}
EQ_SECRET: ${{ secrets.EQ_SECRET_DEV }}
JSON_PAGE_SIZE: 1000
MAX_QUERY_SIZE: 1000000
MAX_VALUES_QUERY_SIZE: 100
SERVER_BASE_PATH: /expertquery
SERVER_URL: https://owapps-dev.app.cloud.gov/expertquery
STREAM_BATCH_SIZE: 2000
Expand Down Expand Up @@ -146,9 +144,7 @@ jobs:
cf set-env $APP_NAME "EQ_BASIC_USER_NAME" "$EQ_BASIC_USER_NAME" > /dev/null
cf set-env $APP_NAME "EQ_BASIC_USER_PWD" "$EQ_BASIC_USER_PWD" > /dev/null
cf set-env $APP_NAME "EQ_SECRET" "$EQ_SECRET" > /dev/null
cf set-env $APP_NAME "JSON_PAGE_SIZE" "$JSON_PAGE_SIZE" > /dev/null
cf set-env $APP_NAME "MAX_QUERY_SIZE" "$MAX_QUERY_SIZE" > /dev/null
cf set-env $APP_NAME "MAX_VALUES_QUERY_SIZE" "$MAX_VALUES_QUERY_SIZE" > /dev/null
cf set-env $APP_NAME "PUBLIC_URL" "$SERVER_URL" > /dev/null
cf set-env $APP_NAME "SERVER_BASE_PATH" "$SERVER_BASE_PATH" > /dev/null
cf set-env $APP_NAME "SERVER_URL" "$SERVER_URL" > /dev/null
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ jobs:
EQ_BASIC_USER_NAME: ${{ secrets.EQ_BASIC_USER_NAME }}
EQ_BASIC_USER_PWD: ${{ secrets.EQ_BASIC_USER_PWD }}
EQ_SECRET: ${{ secrets.EQ_SECRET_STAGING }}
JSON_PAGE_SIZE: 1000
MAX_QUERY_SIZE: 1000000
MAX_VALUES_QUERY_SIZE: 100
SERVER_BASE_PATH: /expertquery
SERVER_URL: https://owapps-stage.app.cloud.gov/expertquery
STREAM_BATCH_SIZE: 2000
Expand Down Expand Up @@ -147,9 +145,7 @@ jobs:
cf set-env $APP_NAME "EQ_BASIC_USER_NAME" "$EQ_BASIC_USER_NAME" > /dev/null
cf set-env $APP_NAME "EQ_BASIC_USER_PWD" "$EQ_BASIC_USER_PWD" > /dev/null
cf set-env $APP_NAME "EQ_SECRET" "$EQ_SECRET" > /dev/null
cf set-env $APP_NAME "JSON_PAGE_SIZE" "$JSON_PAGE_SIZE" > /dev/null
cf set-env $APP_NAME "MAX_QUERY_SIZE" "$MAX_QUERY_SIZE" > /dev/null
cf set-env $APP_NAME "MAX_VALUES_QUERY_SIZE" "$MAX_VALUES_QUERY_SIZE" > /dev/null
cf set-env $APP_NAME "PUBLIC_URL" "$SERVER_URL" > /dev/null
cf set-env $APP_NAME "SERVER_BASE_PATH" "$SERVER_BASE_PATH" > /dev/null
cf set-env $APP_NAME "SERVER_URL" "$SERVER_URL" > /dev/null
Expand Down
12 changes: 12 additions & 0 deletions app/client/public/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@
cursor: pointer;
}

.layout-fixed {
table-layout: fixed;
}

.maxh-90vh {
max-height: 90vh;
}

.sr-only {
border: 0;
clip: rect(0, 0, 0, 0);
Expand All @@ -115,6 +123,10 @@
text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

.whitespace-wrap tbody td {
white-space: normal;
}

.width-fit {
width: fit-content;
}
Expand Down
4 changes: 4 additions & 0 deletions app/client/public/scss/_uswds-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ in the form $setting: value,
'output': true,
'responsive': true,
),
$max-height-settings: (
'output': true,
'responsive': true,
),
$theme-font-weight-semibold: 600,
$theme-show-notifications: false,
$theme-utility-breakpoints: (
Expand Down
22 changes: 3 additions & 19 deletions app/client/src/components/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { cloudSpace, serverBasePath, serverUrl } from 'config';
// utils
import { getData } from 'utils';
// types
import type { Content, JsonContent } from 'contexts/content';
import type { Content } from 'contexts/content';

declare global {
interface Window {
Expand All @@ -27,19 +27,6 @@ declare global {
}
}

// Map profile columns arrays to Sets
function parseProfileConfig(jsonConfig: JsonContent['profileConfig']) {
return Object.entries(jsonConfig).reduce((current, [key, config]) => {
return {
...current,
[key]: {
...config,
columns: new Set(config.columns),
},
};
}, {}) as Content['profileConfig'];
}

/** Custom hook to fetch static content */
function useFetchedContent() {
const contentDispatch = useContentDispatch();
Expand All @@ -48,17 +35,14 @@ function useFetchedContent() {
const controller = new AbortController();

contentDispatch({ type: 'FETCH_CONTENT_REQUEST' });
getData<JsonContent>({
getData<Content>({
url: `${serverUrl}/api/lookupFiles`,
signal: controller.signal,
})
.then((res) => {
contentDispatch({
type: 'FETCH_CONTENT_SUCCESS',
payload: {
...res,
profileConfig: parseProfileConfig(res.profileConfig),
},
payload: res,
});
})
.catch((err: Error) => {
Expand Down
16 changes: 3 additions & 13 deletions app/client/src/components/downloadModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import { clientUrl } from 'config';
// styles
import '@reach/dialog/styles.css';
// types
import type { FetchState, Status, Value } from 'types';
import type { FetchState, QueryData, Status } from 'types';

/*
## Components
*/

export function DownloadModal<D extends PostData>({
export function DownloadModal<D extends QueryData>({
apiKey,
dataId,
downloadStatus,
Expand Down Expand Up @@ -231,7 +231,7 @@ export function DownloadModal<D extends PostData>({
## Types
*/

type DownloadModalProps<D extends PostData> = {
type DownloadModalProps<D extends QueryData> = {
apiKey: string;
dataId?: string;
downloadStatus: Status;
Expand All @@ -241,13 +241,3 @@ type DownloadModalProps<D extends PostData> = {
queryUrl: string | null;
setDownloadStatus: (status: Status) => void;
};

type PostData = {
columns: string[];
filters: {
[field: string]: Value | Value[];
};
options: {
[field: string]: Value;
};
};
4 changes: 3 additions & 1 deletion app/client/src/components/inPageNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ function useInPageNavDispatch() {
## Components
*/

export function InPageNavLayout({ children }: Readonly<{ children: ReactNode }>) {
export function InPageNavLayout({
children,
}: Readonly<{ children: ReactNode }>) {
return (
<InPageNavProvider>
<InPageNavLayoutInner>{children}</InPageNavLayoutInner>
Expand Down
7 changes: 6 additions & 1 deletion app/client/src/components/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ type HeaderLinkProps = {
href: string;
};

function HeaderLink({ className, children, icon, href }: Readonly<HeaderLinkProps>) {
function HeaderLink({
className,
children,
icon,
href,
}: Readonly<HeaderLinkProps>) {
const Icon = icon;

return (
Expand Down
Loading
Loading