FIX: missing default params group reports (#50)
This commit is contained in:
parent
0dcaa990b4
commit
f04422244d
|
@ -8,8 +8,14 @@ export default DiscourseRoute.extend({
|
||||||
const group = this.modelFor("group");
|
const group = this.modelFor("group");
|
||||||
return ajax(`/g/${group.name}/reports/${params.query_id}`)
|
return ajax(`/g/${group.name}/reports/${params.query_id}`)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
|
const queryParamInfo = response.query.param_info;
|
||||||
|
const queryParams = queryParamInfo.reduce((acc, param) => {
|
||||||
|
acc[param.identifier] = param.default;
|
||||||
|
return acc;
|
||||||
|
}, {});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
model: Object.assign({ params: {} }, response.query),
|
model: Object.assign({ params: queryParams }, response.query),
|
||||||
group
|
group
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
|
@ -19,7 +19,11 @@
|
||||||
{{#link-to 'group.reports.show' group.name query.id}}{{query.name}}{{/link-to}}
|
{{#link-to 'group.reports.show' group.name query.id}}{{query.name}}{{/link-to}}
|
||||||
</td>
|
</td>
|
||||||
<td>{{query.description}}</td>
|
<td>{{query.description}}</td>
|
||||||
<td>{{bound-date query.last_run_at}}</td>
|
<td>
|
||||||
|
{{#if query.last_run_at}}
|
||||||
|
{{bound-date query.last_run_at}}
|
||||||
|
{{/if}}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
Loading…
Reference in New Issue