Skip to content
Snippets Groups Projects
Commit 3072231c authored by Allen Gilliland's avatar Allen Gilliland
Browse files

quick and dirty application of url params to card params.

parent 111b78ae
No related branches found
No related tags found
No related merge requests found
......@@ -929,6 +929,26 @@ CardControllers.controller('CardDetail', [
isEditing = true;
}
if (!_.isEmpty($location.search()) &&
card.dataset_query &&
card.dataset_query.parameters &&
card.dataset_query.parameters.length > 0) {
let parameters = card.dataset_query.parameters;
console.log("trying to map params");
// try mapping any parameters from the url onto our card query
let queryParameters = _.keys($location.search());
for (let i=0; i < queryParameters.length; i++) {
let key = queryParameters[i];
let parameter = _.find(parameters, (p) => p.name === key);
if (parameter) {
console.log("found parameter", parameter);
parameter.value = $location.search()[key];
}
}
}
// HACK: dirty status passed in the object itself, delete it
let isDirty = !!card.isDirty;
delete card.isDirty;
......
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