Skip to content

Commit

Permalink
Remove Widget dev console errors (#4177)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieldutra authored Sep 24, 2019
1 parent ff041b7 commit 401d164
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ function RefreshIndicator({ refreshStartedAt }) {
);
}

RefreshIndicator.propTypes = { refreshStartedAt: Moment.isRequired };
RefreshIndicator.propTypes = { refreshStartedAt: Moment };
RefreshIndicator.defaultProps = { refreshStartedAt: null };

function VisualizationWidgetHeader({ widget, refreshStartedAt, parameters, onParametersUpdate }) {
const canViewQuery = currentUser.hasPermission('view_query');
Expand Down Expand Up @@ -293,7 +294,7 @@ class VisualizationWidget extends React.Component {
onExpand={this.expandWidget}
/>
)}
data-refreshing={isRefreshing}
tileProps={{ 'data-refreshing': isRefreshing }}
>
{this.renderVisualization()}
</Widget>
Expand Down
8 changes: 5 additions & 3 deletions client/app/components/dashboards/dashboard-widget/Widget.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class Widget extends React.Component {
isPublic: PropTypes.bool,
refreshStartedAt: Moment,
menuOptions: PropTypes.node,
tileProps: PropTypes.object, // eslint-disable-line react/forbid-prop-types
onDelete: PropTypes.func,
};

Expand All @@ -82,6 +83,7 @@ class Widget extends React.Component {
isPublic: false,
refreshStartedAt: null,
menuOptions: null,
tileProps: {},
onDelete: () => {},
};

Expand All @@ -105,12 +107,12 @@ class Widget extends React.Component {
};

render() {
const { widget, className, children, header, footer, canEdit, isPublic,
onDelete, menuOptions, ...otherProps } = this.props;
const { className, children, header, footer, canEdit, isPublic,
menuOptions, tileProps } = this.props;
const showDropdownButton = !isPublic && (canEdit || !isEmpty(menuOptions));
return (
<div className="widget-wrapper">
<div className={cx('tile body-container', className)} {...otherProps}>
<div className={cx('tile body-container', className)} {...tileProps}>
<div className="widget-actions">
{showDropdownButton && (
<WidgetDropdownButton
Expand Down

0 comments on commit 401d164

Please sign in to comment.