Skip to content

Commit

Permalink
Merge branch 'develop' into MAT-7698_saveEditedParameter
Browse files Browse the repository at this point in the history
  • Loading branch information
sb-cecilialiu authored Nov 11, 2024
2 parents c5ddee5 + 48c4d6c commit efb98e9
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 80 deletions.
7 changes: 7 additions & 0 deletions src/CqlBuilderPanel/definitionsSection/Definitions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,10 @@
float: right;
}
}

#definitions-tbl {
tr > td {
padding: 10px;
border-bottom: 1px solid #8c8c8c;
}
}
46 changes: 22 additions & 24 deletions src/CqlBuilderPanel/definitionsSection/DefinitionsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,30 +58,28 @@ export default function DefinitionsSection({
definitionCount={measureDefinitions.length}
loading={loading}
/>
<div>
{activeTab === "definition" && (
<DefinitionBuilder
canEdit={canEdit}
handleApplyDefinition={handleApplyDefinition}
cqlBuilderLookup={cqlBuilderLookupsTypes}
/>
)}
{activeTab === "saved-definitions" && (
<Definitions
canEdit={canEdit}
definitions={measureDefinitions}
isCQLUnchanged={isCQLUnchanged}
cql={cql}
setEditorValue={setEditorVal}
handleDefinitionDelete={handleDefinitionDelete}
resetCql={resetCql}
getCqlDefinitionReturnTypes={getCqlDefinitionReturnTypes}
cqlBuilderLookup={cqlBuilderLookupsTypes}
handleDefinitionEdit={handleDefinitionEdit}
loading={loading}
/>
)}
</div>
{activeTab === "definition" && (
<DefinitionBuilder
canEdit={canEdit}
handleApplyDefinition={handleApplyDefinition}
cqlBuilderLookup={cqlBuilderLookupsTypes}
/>
)}
{activeTab === "saved-definitions" && (
<Definitions
canEdit={canEdit}
definitions={measureDefinitions}
isCQLUnchanged={isCQLUnchanged}
cql={cql}
setEditorValue={setEditorVal}
handleDefinitionDelete={handleDefinitionDelete}
resetCql={resetCql}
getCqlDefinitionReturnTypes={getCqlDefinitionReturnTypes}
cqlBuilderLookup={cqlBuilderLookupsTypes}
handleDefinitionEdit={handleDefinitionEdit}
loading={loading}
/>
)}
</>
);
}
99 changes: 43 additions & 56 deletions src/CqlBuilderPanel/definitionsSection/definitions/Definitions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import BorderColorOutlinedIcon from "@mui/icons-material/BorderColorOutlined";
import ToolTippedIcon from "../../../toolTippedIcon/ToolTippedIcon";
import { CqlBuilderLookup, Lookup } from "../../../model/CqlBuilderLookup";
import DefinitionBuilderDialog from "../definitionBuilderDialog/DefinitionBuilderDialog";
import { Stack, Tooltip, Typography } from "@mui/material";
import { Stack } from "@mui/material";

const TH = tw.th`p-3 text-left text-sm font-bold capitalize`;
const TD = tw.td`p-3 text-left text-sm break-all`;
const TD = tw.td`p-3 text-left text-sm w-1/2`;

type DefinitionsPropTypes = {
canEdit: boolean;
Expand Down Expand Up @@ -230,70 +230,57 @@ const Definitions = ({
<tr key={row.id} data-testid={`definitions-row-${row.id}`}>
{row.getVisibleCells().map((cell) => (
<TD key={cell.id}>
{cell.column.id === "comment" ? (
<div tw="w-3/5">
<Tooltip
arrow
title={
<div style={{ whiteSpace: "pre-line" }}>
{cell.getValue()}
</div>
}
>
<Typography noWrap>{cell.getValue()}</Typography>
</Tooltip>
</div>
) : (
flexRender(cell.column.columnDef.cell, cell.getContext())
)}
{flexRender(cell.column.columnDef.cell, cell.getContext())}
</TD>
))}
</tr>
))}
{loading && (
<div>
<Skeleton animation="wave" width="100%" height={45} />
<Skeleton animation="wave" width="100%" height={45} />
<Skeleton animation="wave" width="100%" height={45} />
</div>
<tr>
<td colSpan={2}>
<Skeleton animation="wave" height={45} />
<Skeleton animation="wave" height={45} />
<Skeleton animation="wave" height={45} />
</td>
</tr>
)}
</tbody>
<MadieDeleteDialog
open={deleteDialogOpen}
onContinue={() => {
handleDefinitionDelete(selectedDefinition);
setDeleteDialogOpen(false);
}}
onClose={() => setDeleteDialogOpen(false)}
dialogTitle="Are you sure?"
name={"this Definition"}
/>
<MadieDiscardDialog
open={discardDialog?.open}
onContinue={() => {
resetCql();
if (discardDialog?.operation === "delete") {
setDiscardDialog({
open: false,
operation: "delete",
});
setDeleteDialogOpen(true);
} else if (discardDialog?.operation === "edit") {
setDiscardDialog({
open: false,
operation: "edit",
});
setOpenDefinitionDialog(true);
}
}}
onClose={() => {
</table>
<MadieDeleteDialog
open={deleteDialogOpen}
onContinue={() => {
handleDefinitionDelete(selectedDefinition);
setDeleteDialogOpen(false);
}}
onClose={() => setDeleteDialogOpen(false)}
dialogTitle="Are you sure?"
name={"this Definition"}
/>
<MadieDiscardDialog
open={discardDialog?.open}
onContinue={() => {
resetCql();
if (discardDialog?.operation === "delete") {
setDiscardDialog({
open: false,
operation: null,
operation: "delete",
});
}}
/>
</table>
setDeleteDialogOpen(true);
} else if (discardDialog?.operation === "edit") {
setDiscardDialog({
open: false,
operation: "edit",
});
setOpenDefinitionDialog(true);
}
}}
onClose={() => {
setDiscardDialog({
open: false,
operation: null,
});
}}
/>
<DefinitionBuilderDialog
open={openDefinitionDialog}
definition={selectedDefinition}
Expand Down

0 comments on commit efb98e9

Please sign in to comment.