mirror of
https://github.com/apache/superset.git
synced 2026-06-06 16:19:18 +00:00
Add maximize and minimize feature to charts (#9210)
* Add maximize and minimize feature to charts * Fixed lint issues * Update superset-frontend/src/dashboard/components/SliceHeaderControls.jsx Add translation function Co-Authored-By: David Aaron Suddjian <1858430+suddjian@users.noreply.github.com> * Remove resizeEvent property, change condition to use the nextProps * Minor changes, improve source code * Fixed lint issues * Remove unnecessary resizeEvent props * Move inline style to css class style * Minor fixes, improvements css Co-authored-by: David Aaron Suddjian <1858430+suddjian@users.noreply.github.com>
This commit is contained in:
@@ -41,6 +41,7 @@ const propTypes = {
|
||||
height: PropTypes.number.isRequired,
|
||||
updateSliceName: PropTypes.func.isRequired,
|
||||
isComponentVisible: PropTypes.bool,
|
||||
handleToggleFullSize: PropTypes.func.isRequired,
|
||||
|
||||
// from redux
|
||||
chart: chartPropShape.isRequired,
|
||||
@@ -117,6 +118,12 @@ class Chart extends React.Component {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (nextProps.isFullSize !== this.props.isFullSize) {
|
||||
clearTimeout(this.resizeTimeout);
|
||||
this.resizeTimeout = setTimeout(this.resize, RESIZE_TIMEOUT);
|
||||
return false;
|
||||
}
|
||||
|
||||
for (let i = 0; i < SHOULD_UPDATE_ON_PROP_CHANGES.length; i += 1) {
|
||||
const prop = SHOULD_UPDATE_ON_PROP_CHANGES[i];
|
||||
if (nextProps[prop] !== this.props[prop]) {
|
||||
@@ -238,6 +245,8 @@ class Chart extends React.Component {
|
||||
supersetCanCSV,
|
||||
sliceCanEdit,
|
||||
addDangerToast,
|
||||
handleToggleFullSize,
|
||||
isFullSize,
|
||||
} = this.props;
|
||||
|
||||
const { width } = this.state;
|
||||
@@ -283,6 +292,8 @@ class Chart extends React.Component {
|
||||
dashboardId={dashboardId}
|
||||
filters={filters}
|
||||
addDangerToast={addDangerToast}
|
||||
handleToggleFullSize={handleToggleFullSize}
|
||||
isFullSize={isFullSize}
|
||||
/>
|
||||
|
||||
{/*
|
||||
|
||||
Reference in New Issue
Block a user