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

Have a correct url and show the lineage correctly

parent ea331c73
No related branches found
No related tags found
No related merge requests found
......@@ -160,15 +160,15 @@ export const initializeQB = createThunkAction(INITIALIZE_QB, (location, params)
card = serializedCard ? deserializeCardFromUrl(serializedCard) : {}
// load the card either from `cardId` parameter or the serialized card
const cardId = params.cardId || card.id
if (cardId) {
const loadedCard = await loadCard(cardId);
if (params.cardId) {
card = await loadCard(params.cardId);
// when we are loading from a card id we want an explicit clone of the card we loaded which is unmodified
originalCard = Utils.copy(loadedCard);
// the serialized card often differs from the card stored in db so merge the properties to fetched card if needed
card = {...loadedCard, ...card};
originalCard = Utils.copy(card);
} else if (card.id) {
// deserialized card contains the card id, so just populate originalCard
originalCard = await loadCard(card.id);
// strip the card id from the deserialized card so that we have a correct url and show lineage correctly
card = _.omit(card, "id");
}
MetabaseAnalytics.trackEvent("QueryBuilder", "Query Loaded", card.dataset_query.type);
......
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