Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forcing a refresh when opening calendar filter. #527

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/client/components/filter-menu/filter-menu.mocha.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class Wrap extends React.Component {
changePosition={null}
onClose={null}
openOn={document.createElement("div")}
refreshMaxTime={() => ""}
/>;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/client/components/filter-menu/filter-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export interface FilterMenuProps {
dimension: Dimension;
changePosition: DragPosition;
onClose: Fn;
refreshMaxTime: Fn;
inside?: Element;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export interface TimeFilterMenuProps {
onClose: Fn;
containerStage?: Stage;
openOn: Element;
refreshMaxTime: Fn;
inside?: Element;
}

Expand All @@ -57,8 +58,9 @@ export class TimeFilterMenu extends React.Component<TimeFilterMenuProps, TimeFil
state: TimeFilterMenuState = { tab: null };

componentWillMount() {
const { essence: { filter }, dimension } = this.props;
const { essence: { filter }, dimension, refreshMaxTime } = this.props;
const clause = filter.clauseForReference(dimension.name);
refreshMaxTime();
if (clause && !isTimeFilter(clause)) {
throw new Error(`Expected TimeFilter. Got ${clause}`);
}
Expand Down
1 change: 1 addition & 0 deletions src/client/components/filter-tile/filter-tile.mocha.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ describe("FilterTile", () => {
essence={EssenceFixtures.wikiTotals()}
timekeeper={TimekeeperFixtures.fixed()}
menuStage={null}
refreshMaxTime={() => ""}
/>
);

Expand Down
5 changes: 4 additions & 1 deletion src/client/components/filter-tile/filter-tile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { FilterClause, isTimeFilter } from "../../../common/models/filter-clause
import { Stage } from "../../../common/models/stage/stage";
import { Timekeeper } from "../../../common/models/timekeeper/timekeeper";
import { getFormattedClause } from "../../../common/utils/formatter/formatter";
import { Fn } from "../../../common/utils/general/general";
import { Deferred } from "../../../common/utils/promise/promise";
import { CORE_ITEM_GAP, CORE_ITEM_WIDTH, STRINGS } from "../../config/constants";
import { classNames, findParentWithClass, getXFromEvent, isInside, setDragData, setDragGhost, transformStyle, uniqueId } from "../../utils/dom/dom";
Expand Down Expand Up @@ -56,6 +57,7 @@ export interface FilterTileProps {
essence: Essence;
timekeeper: Timekeeper;
menuStage: Stage;
refreshMaxTime: Fn;
}

export interface FilterTileState {
Expand Down Expand Up @@ -354,7 +356,7 @@ export class FilterTile extends React.Component<FilterTileProps, FilterTileState
}

renderMenu(): JSX.Element {
const { essence, timekeeper, clicker, menuStage } = this.props;
const { essence, timekeeper, clicker, menuStage, refreshMaxTime } = this.props;
const { menuOpenOn, menuDimension, menuInside, maxItems, overflowMenuOpenOn } = this.state;
let { possiblePosition } = this.state;
if (!menuDimension) return null;
Expand All @@ -373,6 +375,7 @@ export class FilterTile extends React.Component<FilterTileProps, FilterTileState
changePosition={possiblePosition}
onClose={this.closeMenu}
inside={menuInside}
refreshMaxTime={refreshMaxTime}
/>;
}

Expand Down
1 change: 1 addition & 0 deletions src/client/views/cube-view/cube-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,7 @@ export class CubeView extends React.Component<CubeViewProps, CubeViewState> {
essence={essence}
timekeeper={timekeeper}
menuStage={visualizationStage}
refreshMaxTime={this.refreshMaxTime}
/>
<SplitTile
ref={this.splitTile}
Expand Down