Skip to content

Commit

Permalink
scroll standards and keep search box at the top
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnDuprey committed Feb 10, 2025
1 parent dc07d6d commit 11fd2bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 20 deletions.
1 change: 0 additions & 1 deletion src/components/CippComponents/CippApiDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ export const CippApiDialog = (props) => {
};

var confirmText;
console.log(row);
if (typeof api?.confirmText === "string" && !Array.isArray(row)) {
confirmText = api.confirmText.replace(/\[([^\]]+)\]/g, (_, key) => {
return getNestedValue(row, key) || `[${key}]`;
Expand Down
31 changes: 12 additions & 19 deletions src/components/CippStandards/CippStandardDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,25 @@ const CippStandardDialog = ({
);

return (
<Dialog open={dialogOpen} onClose={handleCloseDialog} maxWidth="xxl"
PaperProps={{
<Dialog
open={dialogOpen}
onClose={handleCloseDialog}
maxWidth="xxl"
PaperProps={{
sx: {
minWidth: "720px",
},
}}>
}}
>
<DialogTitle>Select a Standard to Add</DialogTitle>
<DialogContent sx={{ backgroundColor: "background.default" }}>
<TextField
label="Filter Standards"
fullWidth
sx={{ mb: 3, mt: 3 }}
sx={{ mt: 3 }}
onChange={(e) => handleSearchQueryChange(e.target.value.toLowerCase())}
/>
<Grid container spacing={3}>
<Grid container spacing={3} sx={{ overflowY: "auto", maxHeight: "60vh", mt: 2 }}>
{Object.keys(categories).every(
(category) => filterStandards(categories[category]).length === 0
) ? (
Expand Down Expand Up @@ -101,12 +105,7 @@ const CippStandardDialog = ({
<Typography variant="subtitle2" sx={{ mt: 2 }}>
Category:
</Typography>
<Chip
label={category}
size="small"
color="primary"
sx={{ mt: 1, mb: 2 }}
/>
<Chip label={category} size="small" color="primary" sx={{ mt: 1, mb: 2 }} />
{standard.tag?.filter((tag) => !tag.toLowerCase().includes("impact")).length >
0 && (
<>
Expand Down Expand Up @@ -147,11 +146,7 @@ const CippStandardDialog = ({
<Typography variant="subtitle2" sx={{ mt: 2 }}>
Recommended By:
</Typography>
<Typography
variant="body2"
color="textSecondary"
paragraph
>
<Typography variant="body2" color="textSecondary" paragraph>
{standard.recommendedBy.join(", ")}
</Typography>
</>
Expand All @@ -172,9 +167,7 @@ const CippStandardDialog = ({
control={
<Switch
checked={!!selectedStandards[standard.name]}
onChange={() =>
handleToggleSingleStandard(standard.name)
}
onChange={() => handleToggleSingleStandard(standard.name)}
/>
}
label="Add this standard to the template"
Expand Down

0 comments on commit 11fd2bb

Please sign in to comment.