Skip to content

Commit

Permalink
set cmit so qm table shows up per PR - 80
Browse files Browse the repository at this point in the history
  • Loading branch information
Rocio De Santiago authored and Rocio De Santiago committed Dec 16, 2024
1 parent 608e2bb commit 67064dd
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions services/ui-src/src/components/report/MeasureTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,7 @@ import { PageElementProps } from "./Elements";

export const MeasureTableElement = (props: PageElementProps) => {
const table = props.element as MeasureTableTemplate;
const {
report,
// setMeasure,
setModalComponent,
setModalOpen,
} = useStore();
const { report, setMeasure, setModalComponent, setModalOpen } = useStore();
const measures = report?.pages.filter((page) =>
isMeasureTemplate(page)
) as MeasurePageTemplate[];
Expand All @@ -50,11 +45,10 @@ export const MeasureTableElement = (props: PageElementProps) => {
const { reportType, state, reportId } = useParams();
const navigate = useNavigate();

// TO-DO: Where does cmit need to be set? Does it happen onEdit click?
const handleEditClick = (measureId: string) => {
const handleEditClick = (measureId: string, cmit: number | undefined) => {
setMeasure(cmit!);
const path = `/report/${reportType}/${state}/${reportId}/${measureId}`;
navigate(path);
// setMeasure(measure.cmit!);
};

// Build Rows
Expand All @@ -78,7 +72,10 @@ export const MeasureTableElement = (props: PageElementProps) => {

<Td>
{/* TO-DO: Fix format of measure id */}
<Button variant="outline" onClick={() => handleEditClick(measure.id)}>
<Button
variant="outline"
onClick={() => handleEditClick(measure.id, measure.cmit)}
>
Edit
</Button>
</Td>
Expand Down

0 comments on commit 67064dd

Please sign in to comment.