[FIX] Push settings enabled when push gateway is selected (#17582)

* Disable push settings if gateway is selected

* Use variable for enableQueries

Co-authored-by: Diego Sampaio <chinello@gmail.com>
pull/17600/head
Aaron Ogle 5 years ago committed by Diego Sampaio
parent 1bbe74d840
commit 1b9648fa2d
No known key found for this signature in database
GPG Key ID: E060152B30502562
  1. 28
      app/lib/server/startup/settings.js

@ -1166,6 +1166,16 @@ settings.addGroup('Meta', function() {
});
});
const pushEnabledWithoutGateway = [
{
_id: 'Push_enable',
value: true,
}, {
_id: 'Push_enable_gateway',
value: false,
},
];
settings.addGroup('Push', function() {
this.add('Push_enable', true, {
type: 'boolean',
@ -1200,15 +1210,7 @@ settings.addGroup('Push', function() {
type: 'boolean',
public: true,
alert: 'Push_Setting_Requires_Restart_Alert',
enableQuery: [
{
_id: 'Push_enable',
value: true,
}, {
_id: 'Push_enable_gateway',
value: false,
},
],
enableQuery: pushEnabledWithoutGateway,
});
this.add('Push_test_push', 'push_test', {
type: 'action',
@ -1221,39 +1223,47 @@ settings.addGroup('Push', function() {
this.section('Certificates_and_Keys', function() {
this.add('Push_apn_passphrase', '', {
type: 'string',
enableQuery: pushEnabledWithoutGateway,
secret: true,
});
this.add('Push_apn_key', '', {
type: 'string',
multiline: true,
enableQuery: pushEnabledWithoutGateway,
secret: true,
});
this.add('Push_apn_cert', '', {
type: 'string',
multiline: true,
enableQuery: pushEnabledWithoutGateway,
secret: true,
});
this.add('Push_apn_dev_passphrase', '', {
type: 'string',
enableQuery: pushEnabledWithoutGateway,
secret: true,
});
this.add('Push_apn_dev_key', '', {
type: 'string',
multiline: true,
enableQuery: pushEnabledWithoutGateway,
secret: true,
});
this.add('Push_apn_dev_cert', '', {
type: 'string',
multiline: true,
enableQuery: pushEnabledWithoutGateway,
secret: true,
});
this.add('Push_gcm_api_key', '', {
type: 'string',
enableQuery: pushEnabledWithoutGateway,
secret: true,
});
return this.add('Push_gcm_project_number', '', {
type: 'string',
public: true,
enableQuery: pushEnabledWithoutGateway,
secret: true,
});
});

Loading…
Cancel
Save