Skip to content

Commit d35c71d

Browse files
authored
feat(web): add pull request list filters (pingdotgg#8809)
Co-authored-by: maria-rcks <[email protected]>
1 parent b17cc3d commit d35c71d

7 files changed

Lines changed: 585 additions & 154 deletions

File tree

‎apps/web/src/components/pullRequest/PullRequestListFilters.test.tsx‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ function findLabeledGroup(node: ReactNode, label: string): ReactNode {
3434
if (!isValidElement(child)) continue;
3535
const props = child.props as { readonly children?: ReactNode; readonly label?: string };
3636
if (props.label === label && typeof child.type === "function") {
37-
return (child.type as (properties: unknown) => ReactNode)(child.props);
37+
const rendered = (child.type as (properties: unknown) => ReactNode)(child.props);
38+
return findLabeledGroup(rendered, label) ?? rendered;
3839
}
3940
const nested = findLabeledGroup(props.children, label);
4041
if (nested !== undefined) return nested;
@@ -126,7 +127,7 @@ describe("pull request filters menu", () => {
126127
projectEnvironmentId: environmentId,
127128
onProject,
128129
});
129-
const radioGroup = findValueChange(view);
130+
const radioGroup = findValueChange(findLabeledGroup(view, "Project"));
130131
expect(radioGroup).toBeDefined();
131132

132133
radioGroup?.props.onValueChange(pullRequestProjectKey({ id: projectId, environmentId }));
@@ -156,7 +157,7 @@ describe("pull request filters menu", () => {
156157
],
157158
onProject,
158159
});
159-
const radioGroup = findValueChange(view);
160+
const radioGroup = findValueChange(findLabeledGroup(view, "Project"));
160161
expect(radioGroup).toBeDefined();
161162

162163
radioGroup?.props.onValueChange(

0 commit comments

Comments
 (0)