Skip to content

Commit

Permalink
change sidebar behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
birm committed Dec 6, 2024
1 parent aca1551 commit 8320204
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 32 deletions.
2 changes: 2 additions & 0 deletions source/components/Layout/VisGridView/SideView/SideView.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ function SideView({ fullVisScreenHandler, fullScreened, designation }) {
operation={item}
toggleFullScreen={fullVisScreenHandler}
fullScreened={fullScreened}
isCollapsed={index!=0}

Check failure on line 90 in source/components/Layout/VisGridView/SideView/SideView.js

View workflow job for this annotation

GitHub Actions / Run npm lint

Operator '!=' must be spaced
index={index}
/>
</div>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ function VisItem(props) {
if (props.fullScreened) setHover(true);
}, [props.fullScreened]);

useEffect(() => {
if (props.isCollapsed) setIsCollapsed(true);
}, [props.isCollapsed]);

console.log([props.index, props.isCollapsed, props.operation.title])

Check failure on line 37 in source/components/Layout/VisGridView/SideView/VisItem/VisItem.js

View workflow job for this annotation

GitHub Actions / Run npm lint

Missing semicolon
return (
<div
className="vis-grid-item"
Expand Down Expand Up @@ -109,6 +114,7 @@ VisItem.propTypes = {
toggleFullScreen: PropTypes.func.isRequired,
isResizing: PropTypes.bool, // Ensuring isResizing is also considered
logScale: PropTypes.bool,

Check failure on line 116 in source/components/Layout/VisGridView/SideView/VisItem/VisItem.js

View workflow job for this annotation

GitHub Actions / Run npm lint

propType "logScale" is not required, but has no corresponding defaultProps declaration
isCollapsed: PropTypes.bool,

Check failure on line 117 in source/components/Layout/VisGridView/SideView/VisItem/VisItem.js

View workflow job for this annotation

GitHub Actions / Run npm lint

propType "isCollapsed" is not required, but has no corresponding defaultProps declaration
};

VisItem.defaultProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ import VisTypeComponents from '../../../../../VisualTools/VisTypeComponents';
const PieChart = React.lazy(() => import('../../../../../VisualTools/Chart/PieChart'));
const BarChart = React.lazy(() => import('../../../../../VisualTools/Chart/BarChart'));
const KMCurve = React.lazy(() => import('../../../../../VisualTools/Chart/KMCurve'));
const EnumList = React.lazy(() => import('../../../../../VisualTools/Chart/EnumList'));
const HorizontalBarChart = React.lazy(() => import('../../../../../VisualTools/Chart/HorizontalBarChart'));
const ScatterChart = React.lazy(() => import('../../../../../VisualTools/Chart/ScatterChart'));
const VisDataTable = React.lazy(() => import('../../../../../VisualTools/VisDataTable/VisDataTable'));
const VisCard = React.lazy(() => import('../../../../../VisualTools/VisGridCard/VisGridCard'));
const Histogram = React.lazy(() => import('../../../../../VisualTools/Chart/Histogram'));
const DensityChart = React.lazy(() => import('../../../../../VisualTools/Chart/DensityChart'));
const ParallelCoordinates = React.lazy(() => import('../../../../../VisualTools/Chart/ParallelCoordinates'));
const Heatmap = React.lazy(() => import('../../../../../VisualTools/Chart/Heatmap'));
const VisGridCard = React.lazy(() => import('../../../../../VisualTools/VisGridCard/VisGridCard'));

function VisItemContent(props) {
const TagName = VisTypeComponents[props.chartType];
Expand All @@ -32,9 +31,6 @@ function VisItemContent(props) {
case 'BarChart':
component = <BarChart {...props} />;
break;
case 'EnumList':
component = <EnumList {...props} />;
break;
case 'KMCurve':
component = <KMCurve {...props} />;
break;
Expand All @@ -44,8 +40,8 @@ function VisItemContent(props) {
case 'VisDataTable':
component = <VisDataTable {...props} />;
break;
case 'VisCard':
component = <VisCard {...props} />;
case 'VisGridCard':
component = <VisGridCard {...props} />;
break;
case 'Histogram':
component = <Histogram {...props} />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function VisItemControl(props) {
}
return (
<div>
{(props.hover || show) && (
{(props.hover || show || true) && (
<div className="vis-grid-item-control">
{btnFilterRemove}
<Button
Expand All @@ -42,16 +42,6 @@ function VisItemControl(props) {
>
<FontAwesomeIcon icon={props.isCollapsed ? faUpRightAndDownLeftFromCenter : faSquareMinus} />

Check failure on line 43 in source/components/Layout/VisGridView/SideView/VisItem/VisItemControl/VisItemControl.js

View workflow job for this annotation

GitHub Actions / Run npm lint

This line has a length of 105. Maximum allowed is 100
</Button>
<Button
style={{
background: 'none',
border: 'none',
}}
onClick={() => props.toggleFullScreen(props.id, !props.fullScreened)}
>

<FontAwesomeIcon icon={props.fullScreened ? faCompressArrowsAlt : faExpandArrowsAlt} />
</Button>
</div>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,3 @@
text-align: left !important;
font-weight: bold;
}

.name-header.draggable {
cursor: move;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ function VisItemHeader(props) {
const { config } = useContext(ConfigContext);
const { THEME_COLOR: color } = config;

let dragHeader = 'name-header';
if (config.DRAGGABLE) {
dragHeader = 'name-header draggable';
}

return (
<div
className="vis-grid-item-header text-light"
Expand All @@ -23,7 +18,7 @@ function VisItemHeader(props) {
borderRadius: config?.BORDER_RADIUS ? `${config.BORDER_RADIUS}px` : '0px',
}}
>
<div className={dragHeader}>
<div className='name-header'>
<div className="chartTitle">{props.title}</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import VisTypeComponents from '../../../../VisualTools/VisTypeComponents';

const PieChart = React.lazy(() => import('../../../../VisualTools/Chart/PieChart'));
const BarChart = React.lazy(() => import('../../../../VisualTools/Chart/BarChart'));
const EnumList = React.lazy(() => import('../../../../VisualTools/Chart/EnumList'));
const KMCurve = React.lazy(() => import('../../../../VisualTools/Chart/KMCurve'));
const HorizontalBarChart = React.lazy(() => import('../../../../VisualTools/Chart/HorizontalBarChart'));
const ScatterChart = React.lazy(() => import('../../../../VisualTools/Chart/ScatterChart'));
Expand All @@ -32,9 +31,6 @@ function VisGridItemContent(props) {
case 'BarChart':
component = <BarChart {...props} />;
break;
case 'EnumList':
component = <EnumList {...props} />;
break;
case 'KMCurve':
component = <KMCurve {...props} />;
break;
Expand Down

0 comments on commit 8320204

Please sign in to comment.