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");
|
||||
return ajax(`/g/${group.name}/reports/${params.query_id}`)
|
||||
.then(response => {
|
||||
const queryParamInfo = response.query.param_info;
|
||||
const queryParams = queryParamInfo.reduce((acc, param) => {
|
||||
acc[param.identifier] = param.default;
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
return {
|
||||
model: Object.assign({ params: {} }, response.query),
|
||||
model: Object.assign({ params: queryParams }, response.query),
|
||||
group
|
||||
};
|
||||
})
|
||||
|
|
|
@ -19,7 +19,11 @@
|
|||
{{#link-to 'group.reports.show' group.name query.id}}{{query.name}}{{/link-to}}
|
||||
</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>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
|
|
Loading…
Reference in New Issue