Skip to content

Commit

Permalink
Merge pull request #412 from MeasureAuthoringTool/MAT-7937
Browse files Browse the repository at this point in the history
MAT-7937: add returntype to definitions table
  • Loading branch information
adongare authored Dec 31, 2024
2 parents 2d70195 + d017186 commit cd24d70
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions src/CqlBuilderPanel/definitionsSection/definitions/Definitions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,17 @@ const Definitions = ({
managePagination();
}, [definitions, currentPage, currentLimit]);

const showEditDefinitionDialog = (index) => {
const getReturnType = (index) => {
const rowModal = table.getRow(index).original;
const returnTypes = getCqlDefinitionReturnTypes();
const returnType = returnTypes
? returnTypes[_.camelCase(rowModal.name)]
: undefined;
setSelectedDefinition({ ...rowModal, returnType: returnType });
return returnTypes ? returnTypes[_.camelCase(rowModal.name)] : undefined;
};

const showEditDefinitionDialog = (index) => {
setSelectedDefinition({
...table.getRow(index).original,
returnType: getReturnType(index),
});
};

// table data
Expand All @@ -103,6 +107,14 @@ const Definitions = ({
header: "Name",
accessorKey: "name",
},
{
header: "Return Type",
accessorKey: "returnType",
cell: (row: any) => {
const returnTypeShow = getReturnType(row.cell.row.id);
return <div>{returnTypeShow == "NA" ? "" : returnTypeShow}</div>;
},
},
{
header: "Comment",
accessorKey: "comment",
Expand Down

0 comments on commit cd24d70

Please sign in to comment.