[Pkg-owncloud-commits] [owncloud] 13/457: include base dn test in functionality test
David Prévot
taffit at moszumanska.debian.org
Sun Jun 28 20:05:16 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch stable8
in repository owncloud.
commit 2bf92e0a43c6acdf863cb0092d3d3fb738a23080
Author: Arthur Schiwon <blizzz at owncloud.com>
Date: Wed May 13 16:21:50 2015 +0200
include base dn test in functionality test
---
apps/user_ldap/js/wizard/view.js | 23 ++++++++++++++++++++++-
apps/user_ldap/js/wizard/wizardTabElementary.js | 9 +++++++--
2 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/apps/user_ldap/js/wizard/view.js b/apps/user_ldap/js/wizard/view.js
index 7743c27..7dedfab 100644
--- a/apps/user_ldap/js/wizard/view.js
+++ b/apps/user_ldap/js/wizard/view.js
@@ -168,6 +168,26 @@ OCA = OCA || {};
},
/**
+ * Base DN test results will arrive here
+ *
+ * @param {WizardTabElementary} view
+ * @param {FeaturePayload} payload
+ */
+ onDetectionTestCompleted: function(view, payload) {
+ if(payload.feature === 'TestBaseDN') {
+ if(payload.data.status === 'success') {
+ var objectsFound = parseInt(payload.data.changes.ldap_test_base, 10);
+ if(objectsFound > 0) {
+ view._updateStatusIndicator(view.STATUS_SUCCESS);
+ return;
+ }
+ }
+ view._updateStatusIndicator(view.STATUS_ERROR);
+ OC.Notification.showTemporary(t('user_ldap', 'The Base DN appears to be wrong'));
+ }
+ },
+
+ /**
* updates the status indicator based on the configuration test result
*
* @param {WizardView} [view]
@@ -176,7 +196,7 @@ OCA = OCA || {};
*/
onTestCompleted: function(view, result) {
if(result.isSuccess) {
- view._updateStatusIndicator(view.STATUS_SUCCESS);
+ view.configModel.requestWizard('ldap_test_base');
} else {
view._updateStatusIndicator(view.STATUS_ERROR);
}
@@ -272,6 +292,7 @@ OCA = OCA || {};
this.configModel.on('setRequested', this.onSetRequested, this);
this.configModel.on('setCompleted', this.onSetRequestDone, this);
this.configModel.on('configurationTested', this.onTestCompleted, this);
+ this.configModel.on('receivedLdapFeature', this.onDetectionTestCompleted, this);
},
/**
diff --git a/apps/user_ldap/js/wizard/wizardTabElementary.js b/apps/user_ldap/js/wizard/wizardTabElementary.js
index b8ab367..90c1a6c 100644
--- a/apps/user_ldap/js/wizard/wizardTabElementary.js
+++ b/apps/user_ldap/js/wizard/wizardTabElementary.js
@@ -17,6 +17,8 @@ OCA = OCA || {};
/** @property {number} */
_configChooserNextServerNumber: 1,
+ baseDNTestTriggered: false,
+
/**
* initializes the instance. Always call it after initialization.
*
@@ -192,8 +194,8 @@ OCA = OCA || {};
* @param {Object} configuration
*/
onConfigSwitch: function(view, configuration) {
+ this.baseDNTestTriggered = false;
view.disableElement(view.managedItems.ldap_port.$relatedElements);
-
view.onConfigLoaded(view, configuration);
},
@@ -255,7 +257,8 @@ OCA = OCA || {};
* @param {FeaturePayload} payload
*/
onTestResultReceived: function(view, payload) {
- if(payload.feature === 'TestBaseDN') {
+ if(view.baseDNTestTriggered && payload.feature === 'TestBaseDN') {
+ view.enableElement(view.managedItems.ldap_base.$testButton);
var message;
if(payload.data.status === 'success') {
var objectsFound = parseInt(payload.data.changes.ldap_test_base, 10);
@@ -303,7 +306,9 @@ OCA = OCA || {};
*/
onBaseDNTestButtonClick: function(event) {
event.preventDefault();
+ this.baseDNTestTriggered = true;
this.configModel.requestWizard('ldap_test_base');
+ this.disableElement(this.managedItems.ldap_base.$testButton);
},
/**
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list