From a27f1291aa0a0ee84db6b90e84885da97973920d Mon Sep 17 00:00:00 2001 From: Aiga115 Date: Fri, 17 Nov 2023 12:23:18 +0100 Subject: [PATCH] #328 nested elements ui changes --- .../frontend/src/components/common/SwitchLabel.jsx | 4 ++-- .../components/sidebar/CustomAccordionSummary.jsx | 9 +++++---- .../src/components/sidebar/ExperimentSidebar.jsx | 12 ++++++------ 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/applications/portal/frontend/src/components/common/SwitchLabel.jsx b/applications/portal/frontend/src/components/common/SwitchLabel.jsx index 0847370e..299efc69 100644 --- a/applications/portal/frontend/src/components/common/SwitchLabel.jsx +++ b/applications/portal/frontend/src/components/common/SwitchLabel.jsx @@ -19,12 +19,12 @@ const SwitchLabel = ({ label, isParentLabel }) => { return ( -
+
{label.substr(0, MAX_STR_LENGTH_SIDEBAR)} { - isParentLabel && -parent + isParentLabel && - parent }
diff --git a/applications/portal/frontend/src/components/sidebar/CustomAccordionSummary.jsx b/applications/portal/frontend/src/components/sidebar/CustomAccordionSummary.jsx index df51470b..b269e405 100644 --- a/applications/portal/frontend/src/components/sidebar/CustomAccordionSummary.jsx +++ b/applications/portal/frontend/src/components/sidebar/CustomAccordionSummary.jsx @@ -102,11 +102,14 @@ const CustomAccordionSummary = ({ } className={isParent ? 'nested' : 'nested_child_element'} > - handlePopoverClick(event, population.id)}> + className='square' + /> {hasEditPermission && status === POPULATION_FINISHED_STATE && } @@ -135,7 +138,6 @@ const CustomAccordionSummary = ({ labelPlacement="start" onChange={() => isParent ? handlePopulationSwitch(population.children, !checked) : handlePopulationSwitch(population.id)} checked={checked} - style={populationTextStyle(status !== POPULATION_FINISHED_STATE)} disabled={status !== POPULATION_FINISHED_STATE} /> ) : ( @@ -160,7 +162,6 @@ const CustomAccordionSummary = ({ disabled={status !== POPULATION_FINISHED_STATE} labelPlacement="start" className={'population-label-parent'} - style={populationTextStyle(status !== POPULATION_FINISHED_STATE)} /> ) diff --git a/applications/portal/frontend/src/components/sidebar/ExperimentSidebar.jsx b/applications/portal/frontend/src/components/sidebar/ExperimentSidebar.jsx index 2a777857..1c682322 100644 --- a/applications/portal/frontend/src/components/sidebar/ExperimentSidebar.jsx +++ b/applications/portal/frontend/src/components/sidebar/ExperimentSidebar.jsx @@ -81,7 +81,7 @@ const useStyles = makeStyles({ overflow: 'hidden', }, '& .ellipsis': { width: '100%' }, - '& .ellipsis-parent': { width: '3rem' }, + '& .ellipsis-parent': { maxWidth: '3rem' }, '& .MuiAccordionSummary-root': { padding: '0.5rem 1rem 0.5rem 3rem', flexDirection: 'row-reverse', @@ -91,10 +91,10 @@ const useStyles = makeStyles({ display: 'block' }, '& .ellipsis': { - width: '5.25rem' + maxWidth: '5.25rem' }, '& .ellipsis-parent': { - width: '2rem' + maxWidth: '2rem' } }, '&.nested': { @@ -112,7 +112,8 @@ const useStyles = makeStyles({ }, '& .trail-icon': { width: 'auto', - height: 'auto' + height: 'auto', + opacity: 'unset' } } }, @@ -153,8 +154,7 @@ const useStyles = makeStyles({ alignItems: 'center', lineHeight: '0.938rem', fontWeight: 400, - fontSize: '0.75rem', - paddingRight: '0.5rem', + fontSize: '0.75rem' }, '& .population-switch': {