diff --git a/src/components/testCaseLanding/common/TestCaseTable/TestCaseTable.tsx b/src/components/testCaseLanding/common/TestCaseTable/TestCaseTable.tsx index 3c4be8b0..38e4c7d3 100644 --- a/src/components/testCaseLanding/common/TestCaseTable/TestCaseTable.tsx +++ b/src/components/testCaseLanding/common/TestCaseTable/TestCaseTable.tsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect, useMemo } from "react"; +import React, { useState, useEffect, useMemo, HTMLProps } from "react"; import tw from "twin.macro"; import "styled-components/macro"; import { Measure, TestCase } from "@madie/madie-models"; @@ -110,6 +110,34 @@ const TestCaseTable = (props: TestCaseTableProps) => { })); }; + function IndeterminateCheckbox({ + indeterminate, + className = "", + onChange, + id, + ...rest + }: { + indeterminate?: boolean; + } & HTMLProps) { + const ref = React.useRef(null!); + + React.useEffect(() => { + if (typeof indeterminate === "boolean") { + ref.current.indeterminate = !rest.checked && indeterminate; + } + }, [ref, indeterminate]); + + return ( + + ); + } + type TCRow = { status: any; group: string; @@ -130,6 +158,36 @@ const TestCaseTable = (props: TestCaseTableProps) => { const columns = useMemo[]>(() => { const columnDefs = []; + if (featureFlags?.TestCaseListButtons) { + columnDefs.push({ + id: "select", + header: ({ table }) => ( + + ), + cell: ({ row }) => { + return ( +
+ +
+ ); + }, + }); + } + if (featureFlags?.TestCaseID) { columnDefs.push({ header: "Case #", diff --git a/src/types/madie-madie-util.d.ts b/src/types/madie-madie-util.d.ts index e3c8de2e..7c133a5b 100644 --- a/src/types/madie-madie-util.d.ts +++ b/src/types/madie-madie-util.d.ts @@ -16,6 +16,7 @@ declare module "@madie/madie-util" { qdmHideJson: boolean; TestCaseListSearch: boolean; TestCaseID: boolean; + TestCaseListButtons: boolean; } export interface ServiceConfig {