You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2012/06/17 03:29:50 UTC
svn commit: r1351033 - in /incubator/ambari/trunk/hmc/js/test: ./
initializeClusterTest.js
Author: yusaku
Date: Sun Jun 17 01:29:49 2012
New Revision: 1351033
URL: http://svn.apache.org/viewvc?rev=1351033&view=rev
Log:
AMBARI-550. Add support to jump to a specified state in the wizard for development purposes (Contributed by yusaku)
Added:
incubator/ambari/trunk/hmc/js/test/
incubator/ambari/trunk/hmc/js/test/initializeClusterTest.js
Added: incubator/ambari/trunk/hmc/js/test/initializeClusterTest.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/hmc/js/test/initializeClusterTest.js?rev=1351033&view=auto
==============================================================================
--- incubator/ambari/trunk/hmc/js/test/initializeClusterTest.js (added)
+++ incubator/ambari/trunk/hmc/js/test/initializeClusterTest.js Sun Jun 17 01:29:49 2012
@@ -0,0 +1,46 @@
+// This is to aid development by jumping to a specified stage on page load
+// so that the developer does not have to run through each page to see code
+// changes made to the stage (assuming the developer has already run the wizard
+// up to that stage and all the necessary data are in the database).
+// This is a stop-gap measure until we implement actual state/history management
+// so that a browser refresh reloads the current stage, rather than forcing
+// the user back to the first stage.
+(function() {
+ var clusterName = 'test';
+ //var stage ='createCluster';
+ //var stage = 'selectServices';
+ var stage = 'configureServices';
+ Y.one("#createClusterCoreDivId").hide();
+
+ var hitCurrentStage = false;
+
+ Y.all('#installationWizardProgressBarListId li').each(function(tab) {
+ if (tab.get('id') === (stage + 'StageId')) {
+ hitCurrentStage = true;
+ tab.set('className', 'installationWizardCurrentStage');
+ } else if (!hitCurrentStage) {
+ tab.set('className', 'installationWizardVisitedStage');
+ }
+ });
+
+ switch (stage) {
+ case 'createCluster':
+ globalYui.one("#createClusterCoreDivId").show();
+ break;
+ case 'selectServices':
+ renderSelectServicesBlock({ "clusterName": clusterName, "txnId":1 });
+ break;
+ case 'assignMasters':
+ // TODO
+ break;
+ case 'selectMountPoints':
+ // TODO
+ renderConfigureCluster({ "clusterName": clusterName});
+ break;
+ case 'configureServices':
+ renderOptionsPage({ "clusterName": clusterName});
+ break;
+ default:
+ break;
+ }
+})();