From 2f4eec49ae7e50b1fe8c4dc0e6e5c047d279f8d1 Mon Sep 17 00:00:00 2001 From: Vivek Singh Date: Fri, 31 May 2024 15:06:44 +0530 Subject: [PATCH] avniproject/avni-client#1381 - do not show delete button if there are no items. in report card listing display standard report card type name. --- src/common/components/EncounterTypeSelect.js | 8 +++++--- src/common/components/ProgramSelect.js | 8 +++++--- src/formDesigner/components/ReportCard/ReportCardList.js | 5 +++++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/common/components/EncounterTypeSelect.js b/src/common/components/EncounterTypeSelect.js index 84b9f7d40..ae1a5e654 100644 --- a/src/common/components/EncounterTypeSelect.js +++ b/src/common/components/EncounterTypeSelect.js @@ -36,9 +36,11 @@ export function EncounterTypeSelect({ isMulti, selectedSubjectTypes = [], select maxMenuHeight={200} /> - onChange([])}> - - + {selectedEncounterTypes.length > 0 && ( + onChange([])}> + + + )} ); diff --git a/src/common/components/ProgramSelect.js b/src/common/components/ProgramSelect.js index ca523a0ee..86deb65e8 100644 --- a/src/common/components/ProgramSelect.js +++ b/src/common/components/ProgramSelect.js @@ -35,9 +35,11 @@ export function ProgramSelect({ isMulti, selectedSubjectTypes, selectedPrograms, maxMenuHeight={200} /> - onChange([])}> - - + {selectedPrograms.length > 0 && ( + onChange([])}> + + + )} ); diff --git a/src/formDesigner/components/ReportCard/ReportCardList.js b/src/formDesigner/components/ReportCard/ReportCardList.js index 02575503f..d0a9b7bda 100644 --- a/src/formDesigner/components/ReportCard/ReportCardList.js +++ b/src/formDesigner/components/ReportCard/ReportCardList.js @@ -3,12 +3,17 @@ import ColorValue from "../../common/ColorValue"; import ResourceListView from "../../common/ResourceListView"; import { connect } from "react-redux"; import { Privilege } from "openchs-models"; +import _ from "lodash"; const columns = [ { title: "Name", render: rowData => !rowData.voided && {rowData.name} }, + { + title: "Standard Report Card", + render: rowData => _.get(rowData, "standardReportCardType.name") + }, { title: "Description", render: rowData => rowData.description