Skip to content

Commit

Permalink
Merge pull request #197 from Eastern-Research-Group/feature/437_docum…
Browse files Browse the repository at this point in the history
…ent-text-search

Feature/437 document text search
  • Loading branch information
cschwinderg authored Jan 3, 2025
2 parents a6122e8 + 30f8688 commit b20d045
Show file tree
Hide file tree
Showing 30 changed files with 2,965 additions and 752 deletions.
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

0 comments on commit b20d045

Please sign in to comment.