Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
d9e1ceb
fix handleSelect in ConditionTable.tsx
brick-green Aug 4, 2026
b3c57c2
set type for selectField obj
brick-green Aug 4, 2026
931c2a9
update toBeCalledWith to toHaveBeenCalledWith
brick-green Aug 4, 2026
513ad59
add type for callback on handleExternalOnBlur
brick-green Aug 4, 2026
c72a7e4
add parens to fn
brick-green Aug 4, 2026
3e239ae
set types on params for handleFieldOnChange
brick-green Aug 4, 2026
994faa0
dateRangeFilter updates
brick-green Aug 4, 2026
5b901bd
null coalesce the value on NumericInput
brick-green Aug 4, 2026
e501745
null coalesce on Modal id
brick-green Aug 4, 2026
21b6d69
mock filter missing required defaultIncludeNulls
brick-green Aug 4, 2026
1dfb52f
null coalesce NumericInput value
brick-green Aug 4, 2026
25ed0e7
ValueEditorSwitch pass any type for default
brick-green Aug 4, 2026
ca3a281
replace toBeCalled with toHaveBeenCalled
brick-green Aug 4, 2026
9963990
validateNumericRange expects string array
brick-green Aug 4, 2026
7a422ae
cast type as QbQuery
brick-green Aug 4, 2026
1ff73ce
add parens to fn
brick-green Aug 4, 2026
4ed430f
update toBeCalledTimes to toHaveBeenCalledTime and lastCalledWith to …
brick-green Aug 4, 2026
664d2ce
mock the modalRef
brick-green Aug 4, 2026
2ff5171
remove unused React import
brick-green Aug 4, 2026
da4c730
typecheck script
brick-green Aug 4, 2026
e166a6d
Merge branch 'main' into bg/app-917/automated-typescript-check
brick-green Aug 4, 2026
9cdbdd6
address remaining failures
brick-green Aug 4, 2026
36c424d
add ci type check
brick-green Aug 4, 2026
585e599
Merge branch 'main' into bg/app-917/automated-typescript-check
brick-green Aug 4, 2026
518ff11
Merge branch 'main' into bg/app-917/automated-typescript-check
brick-green Aug 4, 2026
bf0d2f1
lint fix
brick-green Aug 5, 2026
b9717d8
valueInput accepts extended FullField
brick-green Aug 5, 2026
23a5cfe
fix remaining lint and typecheck
brick-green Aug 5, 2026
5d2c6b8
Merge branch 'main' into bg/app-917/automated-typescript-check
brick-green Aug 5, 2026
6fb695e
lint fix
brick-green Aug 5, 2026
c9d716b
type checks again
brick-green Aug 5, 2026
cbf96df
lower target to ES2020
brick-green Aug 5, 2026
29ea3ab
Merge branch 'main' into bg/app-917/automated-typescript-check
brick-green Aug 5, 2026
4778521
rename test.tsx to spec.tsx
brick-green Aug 5, 2026
dbf7066
format fix
brick-green Aug 5, 2026
6672ace
update tests
brick-green Aug 5, 2026
afc426b
update lint:fix
brick-green Aug 5, 2026
4384349
Merge branch 'main' into bg/app-917/automated-typescript-check
brick-green Aug 6, 2026
75405e1
Merge branch 'main' into bg/app-917/automated-typescript-check
brick-green Aug 6, 2026
65cf1d6
add alt text
brick-green Aug 7, 2026
a4d6a97
Merge branch 'main' into bg/app-917/automated-typescript-check
brick-green Aug 7, 2026
7db4d1e
test
brick-green Aug 7, 2026
7e82bea
remove import
brick-green Aug 7, 2026
4a75634
meaningful alts
brick-green Aug 10, 2026
079c902
test id on ManageSection.spec.tsx
brick-green Aug 10, 2026
315b093
remove as DbQuery
brick-green Aug 10, 2026
937de00
object to Record<string, unknown>
brick-green Aug 10, 2026
7022e8b
update NumericInput value type to `number | null`
brick-green Aug 10, 2026
d513128
remove use of deprecations and js in config
brick-green Aug 10, 2026
d0fa40f
add @vitejs/plugin-legacy and terser to add polyfills
brick-green Aug 10, 2026
d312ba2
Merge branch 'main' into bg/app-917/automated-typescript-check
brick-green Aug 10, 2026
5d5744f
lint fix
brick-green Aug 11, 2026
0477710
prettier format
brick-green Aug 11, 2026
96599c2
remove use of screen in checkbox test
brick-green Aug 11, 2026
02b8143
Merge branch 'main' into bg/app-917/automated-typescript-check
brick-green Aug 11, 2026
ba4ea9d
remove terser
brick-green Aug 11, 2026
2983ca1
another use of condition table to string
brick-green Aug 11, 2026
b26825e
prettier format
brick-green Aug 11, 2026
459df6b
remove map to string
brick-green Aug 11, 2026
35e1e84
Merge branch 'main' into bg/app-917/automated-typescript-check
brick-green Aug 11, 2026
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: 4 additions & 0 deletions .github/workflows/verify-modernization-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ jobs:
working-directory: ./apps/modernization-ui
run: npm run format:check

- name: Type Check
working-directory: ./apps/modernization-ui
run: npm run typecheck

- name: Unit Test
working-directory: ./apps/modernization-ui
run: npm run test:all
Expand Down
1,682 changes: 1,553 additions & 129 deletions apps/modernization-ui/package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions apps/modernization-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"@types/react-dom": "^18",
"@typescript-eslint/eslint-plugin": "^8.34.0",
"@typescript-eslint/parser": "^8.34.0",
"@vitejs/plugin-legacy": "^8.2.3",
"@vitejs/plugin-react": "^6.0.1",
"@vitest/coverage-v8": "^4.1.0",
"eslint": "9.31.0",
Expand Down Expand Up @@ -93,6 +94,8 @@
"scripts": {
"start": "vite",
"build": "vite build",
"typecheck": "tsc -b --noEmit",
"typecheck:watch": "tsc -b --noEmit --watch",
"preview": "vite preview",
"test": "vitest --changed",
"test:all": "vitest run",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('SelectPass', () => {
const { getAllByText } = render(<SelectPass passCount={0} />);
expect(
getAllByText(
(content, element) =>
(_content, element) =>
element?.textContent === 'To get started, select "Add pass configuration" from the left panel.'
)[0]
).toBeInTheDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ describe('BlockingCriteriaSidePanel', () => {
expect(cancel).toHaveTextContent('Cancel');
await user.click(cancel);

expect(onCancel).toBeCalledTimes(1);
expect(onCancel).toHaveBeenCalledTimes(1);
});

it('should trigger onAccept when Add attribute(s) is clicked', async () => {
Expand All @@ -177,6 +177,6 @@ describe('BlockingCriteriaSidePanel', () => {

await user.click(add);

expect(onAccept).toBeCalledTimes(1);
expect(onAccept).toHaveBeenCalledTimes(1);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ describe('MatchingCriteriaSidePanel', () => {

await user.click(cancel);

expect(onCancel).toBeCalledTimes(1);
expect(onCancel).toHaveBeenCalledTimes(1);
});

it('should trigger onAccept when Add attribute(s) is clicked', async () => {
Expand All @@ -255,6 +255,6 @@ describe('MatchingCriteriaSidePanel', () => {

await user.click(add);

expect(onAccept).toBeCalledWith([]);
expect(onAccept).toHaveBeenCalledWith([]);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { FormProvider, useForm } from 'react-hook-form';

import { MergeCandidate } from 'apps/deduplication/api/model/MergeCandidate';

import { SexAndBirthSelection } from '../sex-and-birth/SexAndBirthSelection';

import { GeneralSelection } from './GeneralSelection';

const mergeCandidates: Partial<MergeCandidate>[] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,41 +113,41 @@ describe('MatchesRequiringReviewTable', () => {

// default sort
await waitFor(() => {
expect(mockFetch).lastCalledWith(0, 20, 'identified,desc');
expect(mockFetch).toHaveBeenLastCalledWith(0, 20, 'identified,desc');
});

await user.click(getByText('Patient ID').children[0]); // sort on patient Id asc
expect(mockFetch).lastCalledWith(0, 20, 'patient-id,asc');
expect(mockFetch).toHaveBeenLastCalledWith(0, 20, 'patient-id,asc');

await user.click(getByText('Patient ID').children[0]); // sort on patient Id desc
expect(mockFetch).lastCalledWith(0, 20, 'patient-id,desc');
expect(mockFetch).toHaveBeenLastCalledWith(0, 20, 'patient-id,desc');

await user.click(getByText('Person name').children[0]); // sort on Person name
expect(mockFetch).lastCalledWith(0, 20, 'name,asc');
expect(mockFetch).toHaveBeenLastCalledWith(0, 20, 'name,asc');

await user.click(getByText('Person name').children[0]); // sort on Person name desc
expect(mockFetch).lastCalledWith(0, 20, 'name,desc');
expect(mockFetch).toHaveBeenLastCalledWith(0, 20, 'name,desc');

await user.click(getByText('Date created').children[0]); // sort on Date created
expect(mockFetch).lastCalledWith(0, 20, 'created,asc');
expect(mockFetch).toHaveBeenLastCalledWith(0, 20, 'created,asc');

await user.click(getByText('Date created').children[0]); // sort on Date created desc
expect(mockFetch).lastCalledWith(0, 20, 'created,desc');
expect(mockFetch).toHaveBeenLastCalledWith(0, 20, 'created,desc');

await user.click(getByText('Date identified').children[0]); // sort on Date identified
expect(mockFetch).lastCalledWith(0, 20, 'identified,asc');
expect(mockFetch).toHaveBeenLastCalledWith(0, 20, 'identified,asc');

await user.click(getByText('Date identified').children[0]); // sort on Date identified desc
expect(mockFetch).lastCalledWith(0, 20, 'identified,desc');
expect(mockFetch).toHaveBeenLastCalledWith(0, 20, 'identified,desc');

await user.click(getByText('Number of matching records').children[0]); // sort on Number of matching records
expect(mockFetch).lastCalledWith(0, 20, 'count,asc');
expect(mockFetch).toHaveBeenLastCalledWith(0, 20, 'count,asc');

await user.click(getByText('Number of matching records').children[0]); // sort on Number of matching records desc
expect(mockFetch).lastCalledWith(0, 20, 'count,desc');
expect(mockFetch).toHaveBeenLastCalledWith(0, 20, 'count,desc');

await user.click(getByText('Number of matching records').children[0]); // clear sort on Number
expect(mockFetch).lastCalledWith(0, 20, 'identified,desc'); // back to default
expect(mockFetch).toHaveBeenLastCalledWith(0, 20, 'identified,desc'); // back to default
});

it('should display the proper match data', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
import { render, renderHook } from '@testing-library/react';
import { render } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { FormProvider, useForm } from 'react-hook-form';

import { CreateQuestionForm } from '../QuestionForm';

import { BasicInformationFields } from './BasicInformationFields';

const { result } = renderHook(() =>
useForm<CreateQuestionForm>({
mode: 'onBlur',
defaultValues: { uniqueId: 'duplicateUniqueId', uniqueName: 'duplicateUniqueName' },
})
);

const setError = vi.fn();
const validate = vi.fn();
const mockUseQuestionValidation = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
import { render, renderHook } from '@testing-library/react';
import { render } from '@testing-library/react';
import { FormProvider, useForm } from 'react-hook-form';

import { CreateQuestionForm } from '../QuestionForm';

import { DataMartFields } from './DataMartFields';

const { result } = renderHook(() =>
useForm<CreateQuestionForm>({
mode: 'onBlur',
defaultValues: {
subgroup: 'RSK',
dataMartInfo: {
dataMartColumnName: 'duplicateDataMartColumnName',
rdbColumnName: 'duplicateRdbColumnName',
},
},
})
);

const setError = vi.fn();
const validate = vi.fn();
const mockUseQuestionValidation = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import { createRef } from 'react';

import { render } from '@testing-library/react';
import { BrowserRouter } from 'react-router';

import { SaveTemplates } from './SaveTemplate';

describe('When SaveTemplates component loads', () => {
it('Save button should be disabled', () => {
const mockModalRef = createRef<any>();

const { container } = render(
<BrowserRouter>
<SaveTemplates />
<SaveTemplates modalRef={mockModalRef} />
</BrowserRouter>
);
const btn = container.getElementsByClassName('usa-button')[0];
expect(btn.hasAttribute('disabled'));
expect(btn).toBeDisabled();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('Tabbed button bar', () => {
await waitFor(() => {
fireEvent.click(buttons[1]);
});
expect(mockFn).toBeCalledWith('2');
expect(mockFn).toHaveBeenCalledWith('2');
});

it('should set active class on click', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import styles from './condition-search.module.scss';

type Props = {
id: string;
onConditionSelect: (ids: number[]) => void;
onConditionSelect: (ids: string[]) => void;
onCancel: () => void;
onCreateNew: () => void;
};
Expand All @@ -32,7 +32,7 @@ const ConditionSearchContent = ({ id, onConditionSelect, onCancel, onCreateNew }
const { search, response, isLoading, keyword, reset } = useConditionSearch();
const { page, ready, request } = usePagination();
const [sort, setSort] = useState<ConditionSort | undefined>();
const [selected, setSelected] = useState<number[]>([]);
const [selected, setSelected] = useState<string[]>([]);
const [resetTable, setResetTable] = useState<boolean>(false);

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ const asTableRow = (condition: Condition): TableBody => ({
title: condition.conditionFamily,
},
{ id: 5, title: condition.coinfectionGroup },

{ id: 6, title: condition.nndInd },
{ id: 7, title: condition.page },
{ id: 8, title: condition.status === 'A' ? 'Active' : 'Inactive' },
Expand All @@ -65,13 +64,14 @@ const asTableRow = (condition: Condition): TableBody => ({
type Props = {
conditions: Condition[];
isLoading: boolean;
onSelectionChange: (selection: number[]) => void;
onSelectionChange: (selection: string[]) => void;
onSort?: (sort?: ConditionSort) => void;
};

export const ConditionTable = ({ conditions, isLoading, onSelectionChange, onSort }: Props) => {
const { page, request } = usePagination();
const [tableRows, setTableRows] = useState<TableBody[]>([]);
const [selected, setSelected] = useState<number[]>([]);
const [selected, setSelected] = useState<string[]>([]);

useEffect(() => {
setSelected([]);
Expand All @@ -82,11 +82,15 @@ export const ConditionTable = ({ conditions, isLoading, onSelectionChange, onSor
onSelectionChange(selected);
}, [selected]);

const handleSelect = (event: ChangeEvent<HTMLInputElement>, item: { id: number }) => {
const handleSelect = (event: ChangeEvent<HTMLInputElement>, item: TableBody) => {
if (item.id === undefined || item.id === null) return;

const itemId = String(item.id);

if (event.target.checked) {
setSelected((current) => [...current, item.id]);
setSelected((current) => [...current, itemId]);
} else {
setSelected((current) => current.filter((id) => id !== item.id));
setSelected((current) => current.filter((id) => id !== itemId));
}
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PagePageSummary, PageSummaryService } from 'apps/page-builder/generated';

export const fetchPageSummaries = async (
token: string,
_token: string,
search?: string,
sort?: string,
currentPage?: number,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const RepeatingBlock = ({ questions, valid, setValid }: Props) => {
</tr>
</thead>
<tbody data-testid="group-questions-tbody">
{fields.map((item: Batch, index: number) => (
{fields.map((_item: Batch, index: number) => (
<tr className={styles.row} key={index}>
<td className={styles.number}>
<p>{index + 1}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ export const ReorderQuestion = ({ question, index, visible }: Props) => {
>
<div className={styles.tile}>
<div className={styles.handle} {...prov.dragHandleProps}>
<Icon name="drag" size="m" />
<Icon name="drag" size="m" alt="Drag handle to reorder question" />
</div>
<Icon name="question" size="m" />
<Icon name="question" size="m" alt="Question icon" />
{question.displayComponent === 1003 ? (
<p> &#60; Hyperlink &#62;</p>
) : question.displayComponent === 1012 ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ export const ReorderSection = ({ section, index, visible }: Props) => {
<div className={styles.tile}>
<div className={styles.toggle} onClick={() => setSubsectionsOpen(!subsectionsOpen)}>
{subsectionsOpen ? (
<Icon name="expand-more" size="s" />
<Icon name="expand-more" size="s" alt="Collapse section" />
) : (
<Icon name="navigate-next" size="s" />
<Icon name="navigate-next" size="s" alt="Expand section" />
)}
</div>
<div className={styles.handle} {...provided.dragHandleProps}>
<Icon name="drag" size="m" />
<Icon name="drag" size="m" alt="Drag handle to reorder section" />
</div>
<Icon name="group" size="m" />
<Icon name="group" size="m" alt="Section icon" />
<p>{section.name}</p>
</div>
<div className={`${styles.subsections} ${subsectionsOpen ? '' : styles.closed}`}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ export const ReorderSubsection = ({ subsection, index, visible }: Props) => {
<div className={styles.tile}>
<div className={styles.toggle} onClick={() => setQuestionsOpen(!questionsOpen)}>
{!questionsOpen ? (
<Icon name="navigate-next" size="s" />
<Icon name="navigate-next" size="s" alt="Expand subsection" />
) : (
<Icon name="expand-more" size="s" />
<Icon name="expand-more" size="s" alt="Collapse subsection" />
)}
</div>
<div className={styles.handle} {...provided.dragHandleProps}>
<Icon name="drag" size="m" />
<Icon name="drag" size="m" alt="Drag handle to reorder subsection" />
</div>
<Icon name="subsection" size="m" />
<Icon name="subsection" size="m" alt="Subsection icon" />
{subsection.name}
</div>
<div className={`${styles.questions} ${!questionsOpen ? styles.closed : ''}`}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ export const ReorderTab = ({ tab, index, visible }: Props) => {
<div className={styles.tile}>
<div className={styles.toggle} onClick={() => setSectionsOpen(!sectionsOpen)}>
{sectionsOpen ? (
<Icon name="expand-more" size="s" />
<Icon name="expand-more" size="s" alt="Collapse sections" />
) : (
<Icon name="navigate-next" size="s" />
<Icon name="navigate-next" size="s" alt="Expand sections" />
)}
</div>
<div className={styles.handle} {...provided.dragHandleProps}>
<Icon name="drag" size="m" />
<Icon name="drag" size="m" alt="Drag to reorder" />
</div>
<Icon name="folder" size="m" />
<Icon name="folder" size="m" alt="Tab folder" />
<p>{tab.name}</p>
</div>
<div className={`${styles.sections} ${sectionsOpen ? '' : styles.closed}`}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,14 @@ describe('when ManageSection renders', () => {
it('should show the heading', () => {
const { getByTestId } = render(
<DragDropProvider pageData={content}>
<ManageSection pageId={1} tab={tabData} key={1} onContentChange={vi.fn()} onCancel={vi.fn()} />
<ManageSection
id="test"
pageId={1}
tab={tabData}
key={1}
onContentChange={vi.fn()}
onCancel={vi.fn()}
/>
</DragDropProvider>
);
const header = getByTestId('header');
Expand All @@ -71,7 +78,14 @@ describe('when ManageSection renders', () => {
it('should display two buttons', () => {
const { container } = render(
<DragDropProvider pageData={content}>
<ManageSection pageId={1} tab={tabData} key={1} onContentChange={vi.fn()} onCancel={vi.fn()} />
<ManageSection
id="test"
pageId={1}
tab={tabData}
key={1}
onContentChange={vi.fn()}
onCancel={vi.fn()}
/>
</DragDropProvider>
);
const buttons = container.getElementsByTagName('button');
Expand Down
Loading