diff --git a/ambari-web/app/assets/test/tests.js b/ambari-web/app/assets/test/tests.js index def9cf27114..06f78d8feca 100644 --- a/ambari-web/app/assets/test/tests.js +++ b/ambari-web/app/assets/test/tests.js @@ -97,6 +97,13 @@ var files = [ 'test/controllers/main/admin/highAvailability/journalNode/step8_controller_test', 'test/controllers/main/admin/highAvailability/journalNode/wizard_controller_test', 'test/controllers/main/admin/highAvailability/rangerAdmin/step3_controller_test', + 'test/controllers/main/admin/mpack_upgrade_controller_test', + 'test/controllers/main/admin/mpackUpgrade/downloadOptions_controller_test', + 'test/controllers/main/admin/mpackUpgrade/selectUpgradeOptions_controller_test', + 'test/controllers/main/admin/mpackUpgrade/downloadMpacks_controller_test', + 'test/controllers/main/admin/mpackUpgrade/reviewConfigs_controller_test', + 'test/controllers/main/admin/mpackUpgrade/selectUpgradeType_controller_test', + 'test/controllers/main/admin/mpackUpgrade/upgradeSummary_controller_test', 'test/controllers/main/dashboard/config_history_controller_test', 'test/controllers/main/charts/heatmap_test', 'test/controllers/main/charts/heatmap_metrics/heatmap_metric_test', diff --git a/ambari-web/app/controllers.js b/ambari-web/app/controllers.js index cbe39ad1ebb..2598798bc94 100644 --- a/ambari-web/app/controllers.js +++ b/ambari-web/app/controllers.js @@ -101,6 +101,13 @@ require('controllers/main/admin/kerberos/step5_controller'); require('controllers/main/admin/kerberos/step6_controller'); require('controllers/main/admin/kerberos/step7_controller'); require('controllers/main/admin/kerberos/step8_controller'); +require('controllers/main/admin/mpack_upgrade_controller'); +require('controllers/main/admin/mpackUpgrade/downloadOptions_controller'); +require('controllers/main/admin/mpackUpgrade/downloadMpacks_controller'); +require('controllers/main/admin/mpackUpgrade/selectUpgradeOptions_controller'); +require('controllers/main/admin/mpackUpgrade/reviewConfigs_controller'); +require('controllers/main/admin/mpackUpgrade/selectUpgradeType_controller'); +require('controllers/main/admin/mpackUpgrade/upgradeSummary_controller'); require('controllers/main/alert_definitions_controller'); require('controllers/main/alerts/alert_definitions_actions_controller'); require('controllers/main/alerts/add_alert_definition/add_alert_definition_controller'); diff --git a/ambari-web/app/controllers/main/admin/mpackUpgrade/downloadMpacks_controller.js b/ambari-web/app/controllers/main/admin/mpackUpgrade/downloadMpacks_controller.js new file mode 100644 index 00000000000..84094dd38bf --- /dev/null +++ b/ambari-web/app/controllers/main/admin/mpackUpgrade/downloadMpacks_controller.js @@ -0,0 +1,32 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +App.CreateUpgradePlanWizardDownloadMpacksController = App.WizardStepController.extend({ + + name: 'createUpgradePlanWizardDownloadMpacksController', + + stepName: 'downloadMpacks', + + submit: function () { + if (App.get('router.nextBtnClickInProgress')) { + return; + } + App.router.send('next'); + } + +}); \ No newline at end of file diff --git a/ambari-web/app/controllers/main/admin/mpackUpgrade/downloadOptions_controller.js b/ambari-web/app/controllers/main/admin/mpackUpgrade/downloadOptions_controller.js new file mode 100644 index 00000000000..1649e676b96 --- /dev/null +++ b/ambari-web/app/controllers/main/admin/mpackUpgrade/downloadOptions_controller.js @@ -0,0 +1,32 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +App.CreateUpgradePlanWizardDownloadOptionsController = App.WizardStepController.extend({ + + name: 'createUpgradePlanWizardDownloadOptionsController', + + stepName: 'downloadOptions', + + submit: function () { + if (App.get('router.nextBtnClickInProgress')) { + return; + } + App.router.send('next'); + } + +}); \ No newline at end of file diff --git a/ambari-web/app/controllers/main/admin/mpackUpgrade/reviewConfigs_controller.js b/ambari-web/app/controllers/main/admin/mpackUpgrade/reviewConfigs_controller.js new file mode 100644 index 00000000000..30e0891ddab --- /dev/null +++ b/ambari-web/app/controllers/main/admin/mpackUpgrade/reviewConfigs_controller.js @@ -0,0 +1,32 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +App.CreateUpgradePlanWizardReviewConfigsController = App.WizardStepController.extend({ + + name: 'createUpgradePlanWizardReviewConfigsController', + + stepName: 'reviewConfigs', + + submit: function () { + if (App.get('router.nextBtnClickInProgress')) { + return; + } + App.router.send('next'); + } + +}); \ No newline at end of file diff --git a/ambari-web/app/controllers/main/admin/mpackUpgrade/selectUpgradeOptions_controller.js b/ambari-web/app/controllers/main/admin/mpackUpgrade/selectUpgradeOptions_controller.js new file mode 100644 index 00000000000..90c09fd006d --- /dev/null +++ b/ambari-web/app/controllers/main/admin/mpackUpgrade/selectUpgradeOptions_controller.js @@ -0,0 +1,32 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +App.CreateUpgradePlanWizardSelectUpgradeOptionsController = App.WizardStepController.extend({ + + name: 'createUpgradePlanWizardSelectUpgradeOptionsController', + + stepName: 'selectUpgradeOptions', + + submit: function () { + if (App.get('router.nextBtnClickInProgress')) { + return; + } + App.router.send('next'); + } + +}); \ No newline at end of file diff --git a/ambari-web/app/controllers/main/admin/mpackUpgrade/selectUpgradeType_controller.js b/ambari-web/app/controllers/main/admin/mpackUpgrade/selectUpgradeType_controller.js new file mode 100644 index 00000000000..01390d86a5d --- /dev/null +++ b/ambari-web/app/controllers/main/admin/mpackUpgrade/selectUpgradeType_controller.js @@ -0,0 +1,32 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +App.CreateUpgradePlanWizardSelectUpgradeTypeController = App.WizardStepController.extend({ + + name: 'createUpgradePlanWizardSelectUpgradeTypeController', + + stepName: 'selectUpgradeType', + + submit: function () { + if (App.get('router.nextBtnClickInProgress')) { + return; + } + App.router.send('next'); + } + +}); \ No newline at end of file diff --git a/ambari-web/app/controllers/main/admin/mpackUpgrade/upgradeSummary_controller.js b/ambari-web/app/controllers/main/admin/mpackUpgrade/upgradeSummary_controller.js new file mode 100644 index 00000000000..c6987377a03 --- /dev/null +++ b/ambari-web/app/controllers/main/admin/mpackUpgrade/upgradeSummary_controller.js @@ -0,0 +1,32 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +App.CreateUpgradePlanWizardUpgradeSummaryController = App.WizardStepController.extend({ + + name: 'createUpgradePlanWizardUpgradeSummaryController', + + stepName: 'upgradeSummary', + + submit: function () { + if (App.get('router.nextBtnClickInProgress')) { + return; + } + App.router.send('next'); + } + +}); \ No newline at end of file diff --git a/ambari-web/app/controllers/main/admin/mpack_upgrade_controller.js b/ambari-web/app/controllers/main/admin/mpack_upgrade_controller.js new file mode 100644 index 00000000000..9c245a1ebf8 --- /dev/null +++ b/ambari-web/app/controllers/main/admin/mpack_upgrade_controller.js @@ -0,0 +1,176 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +var App = require('app'); + +App.CreateUpgradePlanWizardController = App.WizardController.extend({ + + name: 'createUpgradePlanWizardController', + + totalSteps: 6, + + currentStep: '0', + + steps: [ + "downloadOptions", + "selectUpgradeOptions", + "downloadMpacks", + "reviewConfigs", + "selectUpgradeType", + "upgradeSummary" + ], + + displayName: Em.I18n.t('admin.createUpgradePlan.wizard.header'), + + hideBackButton: false, + + //Add shared properties for the steps + content: Em.Object.create({ + controllerName: 'createUpgradePlanWizardController', + }), + + setCurrentStep: function (currentStep, completed) { + this._super(currentStep, completed); + App.clusterStatus.setClusterStatus({ + clusterName: this.get('content.cluster.name'), + clusterState: 'CREATE_UPGRADE_PLAN', + wizardControllerName: 'createUpgradePlanWizardController', + localdb: App.db.data + }); + }, + + //Define type and callback as per each step + loadMap: { + 'downloadOptions': [ + { + type: 'sync', + callback: function () { + + } + } + ], + 'selectUpgradeOptions': [ + { + type: 'sync', + callback: function () { + + } + } + ], + 'downloadMpacks': [ + { + type: 'sync', + callback: function () { + + } + } + ], + 'reviewConfigs': [ + { + type: 'sync', + callback: function () { + + } + } + ], + 'selectUpgradeType': [ + { + type: 'sync', + callback: function () { + + } + } + ], + 'upgradeSummary': [ + { + type: 'sync', + callback: function () { + + } + } + ] + }, + + + gotoDownloadOptions: function () { + this.gotoStep('downloadOptions'); + }, + + gotoSelectUpgradeOptions: function () { + this.gotoStep('selectUpgradeOptions'); + }, + + gotoDownloadMpacks: function () { + this.gotoStep('downloadMpacks'); + }, + + gotoReviewConfigs: function () { + this.gotoStep('reviewConfigs'); + }, + + gotoSelectUpgradeType: function () { + this.gotoStep('selectUpgradeType'); + }, + + gotoUpgradeSummary: function () { + this.gotoStep('upgradeSummary'); + }, + + isDownloadOptions: function () { + return this.get('currentStep') == this.getStepIndex('downloadOptions'); + }.property('currentStep'), + + isSelectUpgradeOptions: function () { + return this.get('currentStep') == this.getStepIndex('selectUpgradeOptions'); + }.property('currentStep'), + + isDownloadMpacks: function () { + return this.get('currentStep') == this.getStepIndex('downloadMpacks'); + }.property('currentStep'), + + isReviewConfigs: function () { + return this.get('currentStep') == this.getStepIndex('reviewConfigs'); + }.property('currentStep'), + + isSelectUpgradeType: function () { + return this.get('currentStep') == this.getStepIndex('selectUpgradeType'); + }.property('currentStep'), + + isSUpgradeSummary: function () { + return this.get('currentStep') == this.getStepIndex('upgradeSummary'); + }.property('currentStep'), + + + setStepsEnable: function () { + + for (var i = 0; i < this.get('steps').length; i++) { + var currentStep = this.get('currentStep'); + var step = this.get('isStepDisabled').findProperty('step', i); + var stepValue = i <= currentStep && App.get('router.clusterController.isLoaded') ? false : true; + step.set('value', stepValue); + } + }.observes('currentStep', 'App.router.clusterController.isLoaded'), + + finish: function () { + App.db.data.Installer = {}; + this.resetDbNamespace(); + App.router.get('updateController').updateAll(); + } + +}); \ No newline at end of file diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index d55cb4697e6..1488fc4fa7e 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -2036,6 +2036,15 @@ Em.I18n.translations = { 'admin.stackUpgrade.dialog.notActive': "Waiting to execute the next task...", 'admin.stackUpgrade.dialog.prepareUpgrade.header': "Preparing the Upgrade...", 'admin.stackUpgrade.dialog.skipped.failures':'There were automatically skipped failed steps. Please resolve each failure before continuing with the upgrade.', + + 'admin.createUpgradePlan.wizard.header': 'Create Upgrade Plan', + 'admin.createUpgradePlan.wizard.downloadOptions.header': 'Download Options', + 'admin.createUpgradePlan.wizard.selectUpgradeOptions.header': 'Select Upgrade Options', + 'admin.createUpgradePlan.wizard.downloadMpacks.header': 'Download Mpacks', + 'admin.createUpgradePlan.wizard.reviewConfigs.header': 'Review Configs', + 'admin.createUpgradePlan.wizard.selectUpgradeType.header': 'Select Upgrade Type', + 'admin.createUpgradePlan.wizard.upgradeSummary.header': 'Upgrade Summary', + 'services.service.start':'Start', 'services.service.stop':'Stop', 'services.service.metrics':'Metrics', diff --git a/ambari-web/app/mixins/wizard/wizard_menu_view.js b/ambari-web/app/mixins/wizard/wizard_menu_view.js index e4f46454b1c..52a34dd736c 100644 --- a/ambari-web/app/mixins/wizard/wizard_menu_view.js +++ b/ambari-web/app/mixins/wizard/wizard_menu_view.js @@ -65,6 +65,11 @@ App.WizardMenuMixin = Em.Mixin.create({ isStep8Disabled: isStepDisabled("step8"), isStep9Disabled: isStepDisabled("step9"), isStep10Disabled: isStepDisabled("step10"), + isDownloadOptionsDisabled: isStepDisabled("downloadOptions"), + isSelectUpgradeOptionsDisabled: isStepDisabled('selectUpgradeOptions'), + isReviewConfigsDisabled: isStepDisabled('reviewConfigs'), + isSelectUpgradeTypeDisabled: isStepDisabled('selectUpgradeType'), + isUpgradeSummaryDisabled: isStepDisabled('upgradeSummary'), isStep0Completed: isStepCompleted("step0"), isStep1Completed: isStepCompleted("step1"), @@ -82,6 +87,11 @@ App.WizardMenuMixin = Em.Mixin.create({ isStep7Completed: isStepCompleted("step7"), isStep8Completed: isStepCompleted("step8"), isStep9Completed: isStepCompleted("step9"), - isStep10Completed: isStepCompleted("step10") + isStep10Completed: isStepCompleted("step10"), + isDownloadOptionsCompleted: isStepCompleted("downloadOptions"), + isSelectUpgradeOptionsCompleted: isStepCompleted("selectUpgradeOptions"), + isReviewConfigsCompleted: isStepCompleted("reviewConfigs"), + isSelectUpgradeTypeCompleted: isStepCompleted("selectUpgradeType"), + isUpgradeSummaryCompleted: isStepCompleted("upgradeSummary") }); diff --git a/ambari-web/app/router.js b/ambari-web/app/router.js index 844b7507764..fc754b77a39 100644 --- a/ambari-web/app/router.js +++ b/ambari-web/app/router.js @@ -55,6 +55,17 @@ App.WizardRoute = Em.Route.extend({ gotoVerifyProducts: Em.Router.transitionTo('verifyProducts'), + gotoDownloadOptions: Em.Router.transitionTo('downloadOptions'), + + gotoSelectUpgradeOptions: Em.Router.transitionTo('selectUpgradeOptions'), + + gotoReviewConfigs: Em.Router.transitionTo('reviewConfigs'), + + gotoSelectUpgradeType: Em.Router.transitionTo('selectUpgradeType'), + + gotoUpgradeSummary: Em.Router.transitionTo('upgradeSummary'), + + isRoutable: function() { return typeof this.get('route') === 'string' && App.router.get('loggedIn'); }.property('App.router.loggedIn') diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js index c0a4e192029..20074cec096 100644 --- a/ambari-web/app/routes/main.js +++ b/ambari-web/app/routes/main.js @@ -717,7 +717,9 @@ module.exports = Em.Route.extend(App.RouterRedirections, { if(!isDisabled){ router.transitionTo(event.context.url); } - } + }, + + createUpgradePlan: require('routes/mpack_upgrade_routes') }), diff --git a/ambari-web/app/routes/mpack_upgrade_routes.js b/ambari-web/app/routes/mpack_upgrade_routes.js new file mode 100644 index 00000000000..ad55e3cf34b --- /dev/null +++ b/ambari-web/app/routes/mpack_upgrade_routes.js @@ -0,0 +1,225 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +var App = require('app'); + +module.exports = App.WizardRoute.extend(App.RouterRedirections,{ + route: '/createUpgradePlan', + + breadcrumbs: { + label: Em.I18n.t('admin.createUpgradePlan.wizard.header') + }, + + enter: function (router) { + var createUpgradePlanWizardController = router.get('createUpgradePlanWizardController'); + createUpgradePlanWizardController.dataLoading().done(function () { + App.router.get('updateController').set('isWorking', false); + var popup = App.ModalPopup.show({ + classNames: ['wizard-modal-wrapper'], + modalDialogClasses: ['modal-xlg'], + header: Em.I18n.t('admin.createUpgradePlan.wizard.header'), + bodyClass: App.CreateUpgradePlanWizardView.extend({ + controller: createUpgradePlanWizardController + }), + primary: Em.I18n.t('form.cancel'), + showFooter: false, + secondary: null, + //construct cases where close button needs to be hidden. Make it observable on wizard steps + //default --- this.set('showCloseButton', true); + hideCloseButton: function () { + this.set('showCloseButton', true); + }, + //call any cleanup functions here before resetOnClose + onClose: function () { + var controller = App.router.get('createUpgradePlanWizardController'); + controller.resetOnClose(controller, 'main.admin.serviceGroups'); + }, + didInsertElement: function () { + this._super(); + this.fitHeight(); + } + }); + createUpgradePlanWizardController.set('popup', popup); + var currentClusterStatus = App.clusterStatus.get('value'); + if (currentClusterStatus) { + switch (currentClusterStatus.clusterState) { + case 'CREATE_UPGRADE_PLAN' : + createUpgradePlanWizardController.setCurrentStep(currentClusterStatus.localdb.CreateUpgradePlanWizard.currentStep); + break; + default: + var currStep = App.router.get('createUpgradePlanWizardController.currentStep'); + createUpgradePlanWizardController.setCurrentStep(currStep); + break; + } + } + Em.run.next(function () { + App.router.get('wizardWatcherController').setUser(createUpgradePlanWizardController.get('name')); + router.transitionTo(createUpgradePlanWizardController.get('currentStepName')); + }); + }); + }, + + downloadOptions: App.StepRoute.extend({ + route: '/downloadOptions', + connectOutlets: function (router) { + var controller = router.get('createUpgradePlanWizardController'), + createUpgradePlanWizardDownloadOptionsController = router.get('createUpgradePlanWizardDownloadOptionsController'); + controller.dataLoading().done(function () { + controller.setCurrentStep('downloadOptions'); + controller.loadAllPriorSteps().done(function () { + controller.connectOutlet('createUpgradePlanWizardDownloadOptions', controller.get('content')); + }); + }) + }, + unroutePath: function () { + return false; + }, + //call any functions that load data required for the next step + next: function (router) { + var controller = router.get('createUpgradePlanWizardController'); + router.transitionTo('selectUpgradeOptions'); + } + }), + + selectUpgradeOptions: App.StepRoute.extend({ + route: '/selectUpgradeOptions', + connectOutlets: function (router) { + var controller = router.get('createUpgradePlanWizardController'), + createUpgradePlanWizardselectUpgradeOptionsController = router.get('createUpgradePlanWizardselectUpgradeOptionsController'); + controller.dataLoading().done(function () { + controller.setCurrentStep('selectUpgradeOptions'); + controller.loadAllPriorSteps().done(function () { + controller.connectOutlet('createUpgradePlanWizardSelectUpgradeOptions', controller.get('content')); + }); + }) + }, + unroutePath: function () { + return false; + }, + //call any functions that load data required for the next step + back: function (router) { + var controller = router.get('createUpgradePlanWizardController'); + router.transitionTo('downloadOptions'); + }, + next: function (router) { + var controller = router.get('createUpgradePlanWizardController'); + router.transitionTo('downloadMpacks'); + } + }), + + downloadMpacks: App.StepRoute.extend({ + route: '/downloadMpacks', + connectOutlets: function (router) { + var controller = router.get('createUpgradePlanWizardController'), + createUpgradePlanWizardDownloadMpacksController = router.get('createUpgradePlanWizardDownloadMpacksController'); + controller.dataLoading().done(function () { + controller.setCurrentStep('downloadMpacks'); + controller.loadAllPriorSteps().done(function () { + controller.connectOutlet('createUpgradePlanWizardDownloadMpacks', controller.get('content')); + }); + }) + }, + unroutePath: function () { + return false; + }, + back: function (router) { + var controller = router.get('createUpgradePlanWizardController'); + router.transitionTo('selectUpgradeOptions'); + }, + //call any functions that load data required for the next step + next: function (router) { + var controller = router.get('createUpgradePlanWizardController'); + router.transitionTo('reviewConfigs'); + } + }), + + reviewConfigs: App.StepRoute.extend({ + route: '/reviewConfigs', + connectOutlets: function (router) { + var controller = router.get('createUpgradePlanWizardController'), + createUpgradePlanWizardReviewConfigsController = router.get('createUpgradePlanWizardReviewConfigsController'); + controller.dataLoading().done(function () { + controller.setCurrentStep('reviewConfigs'); + controller.loadAllPriorSteps().done(function () { + controller.connectOutlet('createUpgradePlanWizardReviewConfigs', controller.get('content')); + }); + }) + }, + unroutePath: function () { + return false; + }, + back: function (router) { + var controller = router.get('createUpgradePlanWizardController'); + router.transitionTo('downloadMpacks'); + }, + //call any functions that load data required for the next step + next: function (router) { + var controller = router.get('createUpgradePlanWizardController'); + router.transitionTo('selectUpgradeType'); + } + }), + + selectUpgradeType: App.StepRoute.extend({ + route: '/selectUpgradeType', + connectOutlets: function (router) { + var controller = router.get('createUpgradePlanWizardController'), + createUpgradePlanWizardselectUpgradeTypeController = router.get('createUpgradePlanWizardSelectUpgradeTypeController'); + controller.dataLoading().done(function () { + controller.setCurrentStep('selectUpgradeType'); + controller.loadAllPriorSteps().done(function () { + controller.connectOutlet('createUpgradePlanWizardSelectUpgradeType', controller.get('content')); + }); + }) + }, + unroutePath: function () { + return false; + }, + back: function (router) { + var controller = router.get('createUpgradePlanWizardController'); + router.transitionTo('reviewConfigs'); + }, + //call any functions that load data required for the next step + next: function (router) { + var controller = router.get('createUpgradePlanWizardController'); + router.transitionTo('upgradeSummary'); + } + }), + + upgradeSummary: App.StepRoute.extend({ + route: '/upgradeSummary', + connectOutlets: function (router) { + var controller = router.get('createUpgradePlanWizardController'), + createUpgradePlanWizardUpgradeSummaryController = router.get('createUpgradePlanWizardUpgradeSummaryController'); + controller.dataLoading().done(function () { + controller.setCurrentStep('upgradeSummary'); + controller.loadAllPriorSteps().done(function () { + controller.connectOutlet('createUpgradePlanWizardUpgradeSummary', controller.get('content')); + }); + }) + }, + unroutePath: function () { + return false; + }, + //call any functions that load data required for the next step + complete: function (router, context) { + var controller = router.get('createUpgradePlanWizardController'); + controller.resetOnClose(controller, 'main.admin.serviceGroups'); + } + }), + +}); diff --git a/ambari-web/app/templates/main/admin/mpackUpgrade/downloadMpacks.hbs b/ambari-web/app/templates/main/admin/mpackUpgrade/downloadMpacks.hbs new file mode 100644 index 00000000000..f335fa50ce9 --- /dev/null +++ b/ambari-web/app/templates/main/admin/mpackUpgrade/downloadMpacks.hbs @@ -0,0 +1,41 @@ +{{! +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +}} + +