Skip to content

Commit

Permalink
Prettier linter changes
Browse files Browse the repository at this point in the history
Signed-off-by: Courtney Gosselin <[email protected]>
  • Loading branch information
CourtneyGosselin committed Jan 17, 2024
1 parent f05bdae commit 986678e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/views/clinicalGenomic/useClinicalPatientData.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function useClinicalPatientData(patientId, programId) {
function filterNestedObject(obj) {
return Object.fromEntries(
Object.entries(obj).filter(
([key, value]) =>
(value) =>
value !== null &&
!(
(Array.isArray(value) && value.length === 0) || // Exclude empty arrays
Expand Down
17 changes: 2 additions & 15 deletions src/views/clinicalGenomic/widgets/patientSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const HeaderButton = styled(Button)(({ theme, selected }) => ({
flexDirection: 'row'
}));

const SubHeader = styled('div')(({ theme, isExpanded, depth, selected, paddingValue, folderDepth }) => ({
const SubHeader = styled('div')(({ theme, isExpanded, depth, selected, folderDepth }) => ({
borderRadius: 0,
margin: 0,
fontWeight: 'bold',
Expand All @@ -45,13 +45,7 @@ const SubHeaderTypography = styled(Typography)(({ theme, selected }) => ({
paddingLeft: `1.5em`
}));

const CenteredIconText = styled('div')({
display: 'flex',
alignItems: 'center'
});

function PatientSidebar({ sidebar = {}, setColumns, setRows, setTitle }) {
const theme = useTheme();
const [initialHeader, setInitialHeader] = useState(true);
const [expandedSections, setExpandedSections] = useState({});
const [selected, setSelected] = useState('');
Expand Down Expand Up @@ -136,12 +130,6 @@ function PatientSidebar({ sidebar = {}, setColumns, setRows, setTitle }) {
return idKeys.filter((idKey) => idKey !== undefined && idKey !== null);
}

const handleHeaderClick = (key, obj, parentID) => {
const idKey = findIdKey(obj[key]);
handleTableSet(key, obj[key], parentID, idKey);
setSelected(key);
};

useEffect(() => {
const handleHeaderClick = (key, obj, parentID) => {
const idKey = findIdKey(obj[key]);
Expand All @@ -166,7 +154,7 @@ function PatientSidebar({ sidebar = {}, setColumns, setRows, setTitle }) {
handleHeaderClick(firstHeaderKey, sidebar, null);
}
}
}, [initialHeader, sidebar]);
}, [initialHeader, sidebar, handleTableSet]);

function createSubSidebarHeaders(array = [], depth = 0, hasChildren = false) {
const sidebarTitles = [];
Expand Down Expand Up @@ -199,7 +187,6 @@ function PatientSidebar({ sidebar = {}, setColumns, setRows, setTitle }) {
Object.keys(subTableMap).forEach((key) => {
const isExpanded = expandedSections[key] || false;
const folderDepth = hasChildren ? 0 : 1.5;
const paddingValue = `${folderDepth + depth * 1}em`;

sidebarTitles.push(
<div key={`${key}-${depth}-${folderDepth}`}>
Expand Down

0 comments on commit 986678e

Please sign in to comment.