IMPROVE: Make edit columns adjust submissions as well
Dieser Commit ist enthalten in:
Ursprung
0bc151fc7b
Commit
280d2ffe54
1 geänderte Dateien mit 13 neuen und 9 gelöschten Zeilen
|
@ -31,16 +31,20 @@ export default Controller.extend({
|
||||||
|
|
||||||
@discourseComputed('submissions', 'fields.@each.enabled')
|
@discourseComputed('submissions', 'fields.@each.enabled')
|
||||||
displaySubmissions(submissions, fields) {
|
displaySubmissions(submissions, fields) {
|
||||||
return submissions.map(submission => {
|
let result = [];
|
||||||
let field = fields.find(f => Object.keys(submission).includes(f.id));
|
|
||||||
if (!field.enabled) {
|
submissions.forEach(submission => {
|
||||||
// insert field / submission deletion code here:
|
let sub = {};
|
||||||
console.log(field, "is not enabled for ", submission);
|
|
||||||
} else if (field.enabled) {
|
Object.keys(submission).forEach(fieldId => {
|
||||||
console.log(field, "is enabled for ", submission);
|
if (fields.some(f => f.id === fieldId && f.enabled)) {
|
||||||
|
sub[fieldId] = submission[fieldId];
|
||||||
}
|
}
|
||||||
return submission;
|
|
||||||
});
|
});
|
||||||
|
result.push(sub);
|
||||||
|
});
|
||||||
|
|
||||||
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
Laden …
In neuem Issue referenzieren