Skip to content

Commit 2325d9e

Browse files
hermanliangdrew-gross
authored andcommitted
Bug fixes: target table parser in Push Notification Details (#442)
* bug fixes: target table parser in Push Notification Details * fill missing assignment
1 parent 3ae3f25 commit 2325d9e

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/dashboard/Push/PushDetails.react.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,17 @@ export default class PushDetails extends DashboardView {
552552
}
553553

554554
renderTargetTable() {
555-
return getTargetTable(this.state.pushDetails.get('query'), this.props.schema, tableStyles);
555+
let classes = this.props.schema.data.get('classes');
556+
let schema = {};
557+
if(classes){
558+
let installations = classes.get('_Installation');
559+
if(typeof(installations) !== 'undefined'){
560+
installations.forEach((type, col) => {
561+
schema[col] = type;
562+
});
563+
}
564+
}
565+
return getTargetTable(this.state.pushDetails.get('query'), schema, tableStyles);
556566
}
557567

558568
renderStatusTable() {

src/lib/PushUtils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ let formatConstraintComponent = (key, operation, value, schema) => {
134134
if(!value.constructor === Array) {
135135
res = [key, `constraint is malformed (${operation} operator requires an array)`, ''];
136136
} else if (!schema[key]) {
137-
['', `Cannot perform operation on non-existent column ${key}`, ''];
137+
res = ['', `Cannot perform operation on non-existent column ${key}`, ''];
138138
} else if (schema[key]['type'] === 'Array'){
139139
let isAll = operation === '$all';
140140
res = [key,
@@ -190,6 +190,8 @@ export function formatConstraint(key, constraints, schema) {
190190
break;
191191
}
192192
}
193+
} else if(constraints.constructor === Boolean) {
194+
rows.push([[key, 'is', constraints ? 'true' : 'false']]);
193195
} else {
194196
rows.push([[key, 'is', constraints]]);
195197
}

0 commit comments

Comments
 (0)