reassign_master_routes.js 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. module.exports = Em.Route.extend({
  19. route: '/services/reassign',
  20. enter: function (router) {
  21. console.log('in /service/reassign:enter');
  22. Em.run.next(function () {
  23. var reassignMasterController = router.get('reassignMasterController');
  24. App.router.get('updateController').set('isWorking', false);
  25. App.ModalPopup.show({
  26. classNames: ['full-width-modal'],
  27. header:Em.I18n.t('services.reassign.header'),
  28. bodyClass: App.ReassignMasterView.extend({
  29. controller: reassignMasterController
  30. }),
  31. primary:Em.I18n.t('form.cancel'),
  32. showFooter: false,
  33. secondary: null,
  34. onPrimary:function () {
  35. this.hide();
  36. App.router.get('updateController').set('isWorking', true);
  37. App.router.transitionTo('main.services');
  38. },
  39. onClose: function() {
  40. this.hide();
  41. App.router.get('updateController').set('isWorking', true);
  42. App.router.transitionTo('main.services')
  43. },
  44. didInsertElement: function(){
  45. this.fitHeight();
  46. }
  47. });
  48. router.transitionTo('step' + reassignMasterController.get('currentStep'));
  49. });
  50. },
  51. step1: Em.Route.extend({
  52. route: '/step1',
  53. connectOutlets: function (router) {
  54. console.log('in reassignMaster.step1:connectOutlets');
  55. var controller = router.get('reassignMasterController');
  56. controller.setCurrentStep('1');
  57. controller.dataLoading().done(function () {
  58. controller.loadAllPriorSteps();
  59. controller.connectOutlet('wizardStep11');
  60. })
  61. },
  62. next: function (router) {
  63. //router.transitionTo('step2');
  64. }
  65. }),
  66. gotoStep1: Em.Router.transitionTo('step1'),
  67. gotoStep2: Em.Router.transitionTo('step2'),
  68. gotoStep3: Em.Router.transitionTo('step3'),
  69. gotoStep4: Em.Router.transitionTo('step4'),
  70. gotoStep5: Em.Router.transitionTo('step5'),
  71. gotoStep6: Em.Router.transitionTo('step6'),
  72. backToServices: function (router) {
  73. App.router.get('updateController').set('isWorking', true);
  74. router.transitionTo('services');
  75. }
  76. });