From ccf27f3735a75ba49f909c36bfecc7a13871887b Mon Sep 17 00:00:00 2001 From: Herman Liang Date: Fri, 1 Jul 2016 20:18:40 +0800 Subject: [PATCH 1/2] bug fixes: target table parser in Push Notification Details --- src/dashboard/Push/PushDetails.react.js | 12 +++++++++++- src/lib/PushUtils.js | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/dashboard/Push/PushDetails.react.js b/src/dashboard/Push/PushDetails.react.js index 7eddc13c14..02cfa26862 100644 --- a/src/dashboard/Push/PushDetails.react.js +++ b/src/dashboard/Push/PushDetails.react.js @@ -552,7 +552,17 @@ export default class PushDetails extends DashboardView { } renderTargetTable() { - return getTargetTable(this.state.pushDetails.get('query'), this.props.schema, tableStyles); + let classes = this.props.schema.data.get('classes'); + let schema = {}; + if(classes){ + let installations = classes.get('_Installation'); + if(typeof(installations) !== 'undefined'){ + installations.forEach((type, col) => { + schema[col] = type; + }); + } + } + return getTargetTable(this.state.pushDetails.get('query'), schema, tableStyles); } renderStatusTable() { diff --git a/src/lib/PushUtils.js b/src/lib/PushUtils.js index 43fefe8060..bc521e3650 100644 --- a/src/lib/PushUtils.js +++ b/src/lib/PushUtils.js @@ -190,6 +190,8 @@ export function formatConstraint(key, constraints, schema) { break; } } + } else if(constraints.constructor === Boolean) { + rows.push([[key, 'is', constraints ? 'true' : 'false']]); } else { rows.push([[key, 'is', constraints]]); } From 3b9ff1cf0a40244391b86098e7c3271adf315903 Mon Sep 17 00:00:00 2001 From: Herman Liang Date: Sat, 2 Jul 2016 19:10:24 +0800 Subject: [PATCH 2/2] fill missing assignment --- src/lib/PushUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/PushUtils.js b/src/lib/PushUtils.js index bc521e3650..c0078deef8 100644 --- a/src/lib/PushUtils.js +++ b/src/lib/PushUtils.js @@ -134,7 +134,7 @@ let formatConstraintComponent = (key, operation, value, schema) => { if(!value.constructor === Array) { res = [key, `constraint is malformed (${operation} operator requires an array)`, '']; } else if (!schema[key]) { - ['', `Cannot perform operation on non-existent column ${key}`, '']; + res = ['', `Cannot perform operation on non-existent column ${key}`, '']; } else if (schema[key]['type'] === 'Array'){ let isAll = operation === '$all'; res = [key,