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

Show lineage correctly when using QB actions

parent d645e489
No related branches found
No related tags found
No related merge requests found
......@@ -66,15 +66,28 @@ export default class ActionsWidget extends Component<*, Props, *> {
});
};
handleOnChangeCardAndRun(nextCard) {
const { card } = this.props;
// Include the original card id if present for showing the lineage next to title
const nextCardWithOriginalId = {
...nextCard,
original_card_id: card.id || card.original_card_id
};
if (nextCardWithOriginalId) {
this.props.setCardAndRun(nextCardWithOriginalId);
}
}
handleActionClick = (index: number) => {
const { mode, card, tableMetadata } = this.props;
const action = getModeActions(mode, card, tableMetadata)[index];
if (action && action.popover) {
this.setState({ selectedActionIndex: index });
} else if (action && action.card) {
const card = action.card();
if (card) {
this.props.setCardAndRun(card);
const nextCard = action.card();
if (nextCard) {
this.handleOnChangeCardAndRun(nextCard);
}
this.close();
}
......@@ -149,7 +162,7 @@ export default class ActionsWidget extends Component<*, Props, *> {
<PopoverComponent
onChangeCardAndRun={(card) => {
if (card) {
this.props.setCardAndRun(card);
this.handleOnChangeCardAndRun(card)
}
}}
onClose={this.close}
......
......@@ -230,7 +230,6 @@ export default class Visualization extends Component<*, Props, State> {
// $FlowFixMe
const hasOriginalCard = series[index] && series[index].card && (series[index].card.id || series[index].card.original_card_id);
if (hasOriginalCard) {
console.log('woohoo has original card', series[index].card, series[index].card.id || series[index].card.original_card_id);
const cardWithOriginalId: UnsavedCard = {
...card,
// $FlowFixMe
......
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