Skip to content
Snippets Groups Projects
Commit 62e8389c authored by Atte Keinänen's avatar Atte Keinänen
Browse files

Fix lint & Flow errors

parent 6471ed89
No related branches found
No related tags found
No related merge requests found
......@@ -517,7 +517,6 @@ export const navigateToNewCardFromDashboard = createThunkAction(
const dashboard = dashboards[dashboardId];
const cardIsDirty = !_.isEqual(previousCard.dataset_query, nextCard.dataset_query);
// $FlowFixMe
const url = questionUrlWithParameters(
getCardAfterVisualizationClick(nextCard, previousCard),
metadata,
......
......@@ -132,6 +132,7 @@ export function applyParameters(
}
const mapping = _.findWhere(parameterMappings, {
// $FlowFixMe original_card_id not included in the flow type of card
card_id: card.id || card.original_card_id,
parameter_id: parameter.id
});
......@@ -179,7 +180,7 @@ export function questionUrlWithParameters(
);
// If we have a clean question without parameters applied, don't add the dataset query hash
if (!cardIsDirty && datasetQuery.parameters.length === 0) {
if (!cardIsDirty && datasetQuery.parameters && datasetQuery.parameters.length === 0) {
return Urls.question(card.id);
}
......
......@@ -88,9 +88,14 @@ export default (name: string, icon: string, fieldFilter: FieldFilter) =>
fieldOptions={fieldOptions}
customFieldOptions={customFieldOptions}
onCommitBreakout={breakout => {
onChangeCardAndRun(
{ nextCard: pivot(card, breakout, tableMetadata, dimensions) }
);
onChangeCardAndRun({
nextCard: pivot(
card,
breakout,
tableMetadata,
dimensions
)
});
}}
onClose={onClose}
/>
......
......@@ -34,7 +34,13 @@ export default ({ card, tableMetadata }: ClickActionProps): ClickAction[] => {
customFields={Query.getExpressions(query)}
availableAggregations={tableMetadata.aggregation_options}
onCommitAggregation={aggregation => {
onChangeCardAndRun({ nextCard: summarize(card, aggregation, tableMetadata) });
onChangeCardAndRun({
nextCard: summarize(
card,
aggregation,
tableMetadata
)
});
onClose && onClose();
}}
/>
......
......@@ -12,7 +12,7 @@ import MetabaseAnalytics from "metabase/lib/analytics";
import cx from "classnames";
import _ from "underscore";
import type { Card } from "metabase/meta/types/Card";
import type { Card, UnsavedCard} from "metabase/meta/types/Card";
import type { QueryMode, ClickAction } from "metabase/meta/types/Visualization";
import type { TableMetadata } from "metabase/meta/types/Metadata";
......@@ -21,7 +21,7 @@ type Props = {
mode: QueryMode,
card: Card,
tableMetadata: TableMetadata,
navigateToNewCardInsideQB: (nextCard: Card, previousCard: Card) => void
navigateToNewCardInsideQB: any => void
};
const CIRCLE_SIZE = 48;
......@@ -71,7 +71,7 @@ export default class ActionsWidget extends Component<*, Props, *> {
});
};
handleOnChangeCardAndRun({ nextCard }) {
handleOnChangeCardAndRun = ({ nextCard }: { nextCard: Card|UnsavedCard}) => {
const { card: previousCard } = this.props;
this.props.navigateToNewCardInsideQB({ nextCard, previousCard });
}
......
......@@ -63,7 +63,7 @@ type Props = {
// for click actions
metadata: Metadata,
onChangeCardAndRun: (card: UnsavedCard) => void,
onChangeCardAndRun: any => void,
// used for showing content in place of visualization, e.x. dashcard filter mapping
replacementContent: Element<any>,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment