You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by at...@apache.org on 2018/05/11 12:29:06 UTC

[ambari] branch trunk updated: AMBARI-22952 UI Install is unable to work with 'Redhat Satellite/Spacewalk' as local repository

This is an automated email from the ASF dual-hosted git repository.

atkach pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new aef1c50  AMBARI-22952 UI Install is unable to work with 'Redhat Satellite/Spacewalk' as local repository
aef1c50 is described below

commit aef1c5029b5363fc1f369bfc0418f04f67071586
Author: Andrii Tkach <at...@apache.org>
AuthorDate: Fri May 11 12:18:35 2018 +0300

    AMBARI-22952 UI Install is unable to work with 'Redhat Satellite/Spacewalk' as local repository
---
 .../stackVersions/StackVersionsCreateCtrl.js       | 24 +++++++--
 .../stackVersions/StackVersionsEditCtrl.js         | 22 ++++++--
 .../ui/admin-web/app/scripts/i18n.config.js        |  8 +--
 .../ui/admin-web/app/scripts/services/Stack.js     |  1 +
 .../ui/admin-web/app/styles/stack-versions.css     |  6 +++
 .../app/views/stackVersions/stackVersionPage.html  | 32 +++++++++---
 .../app/mappers/repository_version_mapper.js       |  1 +
 ambari-web/app/mappers/stack_mapper.js             |  1 +
 ambari-web/app/messages.js                         |  6 +--
 ambari-web/app/models.js                           |  1 -
 ambari-web/app/models/repository.js                |  1 +
 ambari-web/app/models/stack_version/repository.js  | 38 --------------
 ambari-web/app/styles/wizard.less                  | 10 ++--
 ambari-web/app/templates/wizard/step1.hbs          | 15 +++---
 .../app/templates/wizard/step1/editable_repo.hbs   | 29 ++++++++++
 ambari-web/app/views/wizard/step1_view.js          | 61 +++++++++++++++++-----
 16 files changed, 170 insertions(+), 86 deletions(-)

diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
index a2c21c3..49e5bb0 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
@@ -215,6 +215,7 @@ angular.module('ambariAdminConsole')
             stackOs.selected = false;
             stackOs.repositories.forEach(function(repo) {
               repo.Repositories.initial_base_url = repo.Repositories.default_base_url;
+              repo.Repositories.initial_repo_id = repo.Repositories.repo_id;
             });
             $scope.osList.push(stackOs);
           }
@@ -292,7 +293,7 @@ angular.module('ambariAdminConsole')
         enabled = true
       }
     });
-    return !(enabled && $scope.validBaseUrlsExist());
+    return !($scope.useRedhatSatellite || (enabled && $scope.validBaseUrlsExist()));
   };
 
   $scope.defaulfOSRepos = {};
@@ -399,15 +400,28 @@ angular.module('ambariAdminConsole')
         }
       });
     }
+  };
+
+  $scope.useRedHatCheckbox = function() {
     if ($scope.useRedhatSatellite) {
       ConfirmationModal.show(
-          $t('common.important'),
-          {
-            "url": 'views/modals/BodyForUseRedhatSatellite.html'
-          }
+        $t('versions.useRedhatSatellite.title'),
+        {
+          "url": 'views/modals/BodyForUseRedhatSatellite.html'
+        }
       ).catch(function () {
         $scope.useRedhatSatellite = !$scope.useRedhatSatellite;
       });
+    } else {
+      if ($scope.osList) {
+        $scope.osList.forEach(function(os) {
+          if (os.repositories) {
+            os.repositories.forEach(function(repo) {
+              repo.isEditing = false;
+            })
+          }
+        });
+      }
     }
   };
 
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
index 2a1d244..7b10a1e 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
@@ -66,6 +66,7 @@ angular.module('ambariAdminConsole')
         $scope.defaulfOSRepos[os.OperatingSystems.os_type] = {};
         os.repositories.forEach(function(repo) {
           $scope.defaulfOSRepos[os.OperatingSystems.os_type][repo.Repositories.repo_id] = repo.Repositories.base_url;
+          repo.Repositories.initial_repo_id = repo.Repositories.repo_id;
         });
       });
       $scope.repoVersionFullName = response.repoVersionFullName;
@@ -331,15 +332,28 @@ angular.module('ambariAdminConsole')
         }
       });
     }
+  };
+
+  $scope.useRedHatCheckbox = function() {
     if ($scope.useRedhatSatellite) {
       ConfirmationModal.show(
-          $t('common.important'),
-          {
-            "url": 'views/modals/BodyForUseRedhatSatellite.html'
-          }
+        $t('versions.useRedhatSatellite.title'),
+        {
+          "url": 'views/modals/BodyForUseRedhatSatellite.html'
+        }
       ).catch(function () {
         $scope.useRedhatSatellite = !$scope.useRedhatSatellite;
       });
+    } else {
+      if ($scope.osList) {
+        $scope.osList.forEach(function(os) {
+          if (os.repositories) {
+            os.repositories.forEach(function(repo) {
+              repo.isEditing = false;
+            })
+          }
+        });
+      }
     }
   };
 
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
index 821a466..42da1dd 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
@@ -405,9 +405,9 @@ angular.module('ambariAdminConsole')
     'versions.repository.add': 'Add Repository',
 
     'versions.useRedhatSatellite.title': 'Use RedHat Satellite/Spacewalk',
-    'versions.useRedhatSatellite.warning': 'By selecting to <b>"Use RedHat Satellite/Spacewalk"</b> for the software repositories, ' +
-      'you are responsible for configuring the repository channel in Satellite/Spacewalk and confirming the repositories for the selected <b>stack version</b> are available on the hosts in the cluster. ' +
-      'Refer to the Ambari documentation for more information.',
+    'versions.useRedhatSatellite.warning': "In order for Ambari to install packages from the right repositories, " +
+    "it is recommended that you edit the names of the repo's for each operating system so they match the channel " +
+    "names in your RedHat Satellite/Spacewalk instance.",
     'versions.useRedhatSatellite.disabledMsg': 'Use of RedHat Satellite/Spacewalk is not available when using Public Repositories',
 
     'versions.changeBaseURLConfirmation.title': 'Confirm Base URL Change',
@@ -415,7 +415,7 @@ angular.module('ambariAdminConsole')
 
     'versions.alerts.baseURLs': 'Provide Base URLs for the Operating Systems you are configuring.',
     'versions.alerts.validationFailed': 'Some of the repositories failed validation. Make changes to the base url or skip validation if you are sure that urls are correct',
-    'versions.alerts.skipValidationWarning': '<b>Warning:</b> This is for advanced users only. Use this option if you want to skip validation for Repository Base URLs.',
+    'versions.alerts.skipValidationWarning': 'Warning: This is for advanced users only. Use this option if you want to skip validation for Repository Base URLs.',
     'versions.alerts.useRedhatSatelliteWarning': 'Disable distributed repositories and use RedHat Satellite/Spacewalk channels instead',
     'versions.alerts.filterListError': 'Fetch stack version filter list error',
     'versions.alerts.versionCreated': 'Created version <a href="#/stackVersions/{{stackName}}/{{versionName}}/edit">{{stackName}}-{{versionName}}</a>',
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
index c86ee29..238d82c 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
@@ -148,6 +148,7 @@ angular.module('ambariAdminConsole')
             versionObj.osList.forEach(function (os) {
               os.repositories.forEach(function(repo) {
                 repo.Repositories.initial_base_url = repo.Repositories.base_url;
+                repo.Repositories.initial_repo_id = repo.Repositories.repo_id;
               });
             });
             versions.push(versionObj);
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/styles/stack-versions.css b/ambari-admin/src/main/resources/ui/admin-web/app/styles/stack-versions.css
index b0381ac..72deeb4 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/styles/stack-versions.css
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/styles/stack-versions.css
@@ -66,3 +66,9 @@
 .verison-label-row.button-padding {
   padding: 4px;
 }
+
+.repo-name-label input {
+  width: calc(100% - 30px);
+  margin-right: 2px;
+  display: inline-block;
+}
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
index 1eb247c..6819024 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
@@ -177,14 +177,26 @@
                 </div>
                 <div class="col-sm-9">
                   <div class="form-group repo-name-url {{repository.Repositories.repo_name}}"
-                       ng-class="{'has-error': repository.hasError }" ng-repeat="repository in os.repositories">
-                    <div ng-if="showRepo(repository)">
-                      <span class="repo-name-label control-label col-sm-3">{{repository.Repositories.repo_id}}</span>
+                       ng-class="{'has-error': repository.hasError }"
+                       ng-repeat="repository in os.repositories"
+                       ng-if="showRepo(repository)">
+                      <span class="repo-name-label control-label col-sm-3">
+                        <span ng-if="!repository.isEditing">{{repository.Repositories.repo_id}}</span>
+                        <i class="fa fa-pencil cursor-pointer"
+                           ng-click="repository.isEditing = true"
+                           ng-show="useRedhatSatellite && !repository.isEditing"></i>
+                        <input type="text" class="form-control"
+                               ng-show="useRedhatSatellite && repository.isEditing"
+                               ng-model="repository.Repositories.repo_id">
+                        <i class="fa fa-undo orange-icon cursor-pointer"
+                          ng-show="repository.isEditing && (repository.Repositories.repo_id !== repository.Repositories.initial_repo_id)"
+                          ng-click="repository.Repositories.repo_id = repository.Repositories.initial_repo_id"></i>
+                      </span>
                       <div class="col-sm-7 repo-url">
                         <input type="text" class="form-control"
                                placeholder="{{(repository.Repositories.repo_name.indexOf('UTILS') < 0 )?('versions.repository.placeholder' | translate) : ''}}"
                                ng-model="repository.Repositories.base_url"
-                               ng-change="onRepoUrlChange(repository)" ng-disabled="useRedhatSatellite && os.OperatingSystems.os_type.indexOf('redhat') === -1">
+                               ng-change="onRepoUrlChange(repository)" ng-disabled="useRedhatSatellite">
                       </div>
                       <i class="fa fa-undo orange-icon cursor-pointer"
                          ng-if="selectedOption.index == 1 && repository.Repositories.base_url != repository.Repositories.initial_base_url
@@ -193,7 +205,6 @@
                          ng-click="undoChange(repository)"
                          tooltip-html-unsafe="{{'common.undo' | translate}}"
                          aria-hidden="true"></i>
-                    </div>
                   </div>
                 </div>
                 <div class="col-sm-1 remove-icon" ng-click="removeOS()" ng-class="{'disabled' : useRedhatSatellite}">
@@ -211,19 +222,24 @@
                 <label for="skip-validation">
                   <span ng-class="{'disabled' : useRedhatSatellite}">{{'versions.skipValidation' | translate}}</span>
                   <i class="fa fa-question-circle"
-                     tooltip-html-unsafe="{{'versions.alerts.skipValidationWarning' | translate}}" aria-hidden="true"></i>
+                     tooltip="{{'versions.alerts.skipValidationWarning' | translate}}"
+                     tooltip-placement="right"
+                     tooltip-trigger="mouseenter"
+                     aria-hidden="true"></i>
                 </label>
               </div>
             </div>
             <div class="col-sm-9">
               <div class="checkbox">
-                <input type="checkbox" id="use-redhat" ng-model="useRedhatSatellite" ng-change="clearErrors()"
+                <input type="checkbox" id="use-redhat" ng-model="useRedhatSatellite" ng-change="useRedHatCheckbox()"
                        ng-disabled="isPublicRepoSelected()">
                 <label for="use-redhat">
                   <span ng-class="{'disabled' : isPublicRepoSelected()}"
                         tooltip="{{(isPublicRepoSelected())? ('versions.useRedhatSatellite.disabledMsg' | translate) : ''}}">{{'versions.useRedhatSatellite.title' | translate}}</span>
                   <i class="fa fa-question-circle"
-                     tooltip-html-unsafe="{{'versions.alerts.useRedhatSatelliteWarning' | translate}}"
+                     tooltip="{{'versions.alerts.useRedhatSatelliteWarning' | translate}}"
+                     tooltip-placement="right"
+                     tooltip-trigger="mouseenter"
                      aria-hidden="true"></i>
                 </label>
               </div>
diff --git a/ambari-web/app/mappers/repository_version_mapper.js b/ambari-web/app/mappers/repository_version_mapper.js
index 8843dcd..bf643bd 100644
--- a/ambari-web/app/mappers/repository_version_mapper.js
+++ b/ambari-web/app/mappers/repository_version_mapper.js
@@ -71,6 +71,7 @@ App.repoVersionMapper = App.QuickDataMapper.create({
     mirrors_list : 'Repositories.mirrors_list',
     os_type : 'Repositories.os_type',
     repo_id : 'Repositories.repo_id',
+    original_repo_id : 'Repositories.repo_id',
     repo_name : 'Repositories.repo_name',
     stack_name : 'Repositories.stack_name',
     stack_version : 'Repositories.stack_version',
diff --git a/ambari-web/app/mappers/stack_mapper.js b/ambari-web/app/mappers/stack_mapper.js
index 323a033..b516b52 100644
--- a/ambari-web/app/mappers/stack_mapper.js
+++ b/ambari-web/app/mappers/stack_mapper.js
@@ -81,6 +81,7 @@ App.stackMapper = App.QuickDataMapper.create({
     latest_base_url: 'latest_base_url',
     mirrors_list: 'mirrors_list',
     os_type: 'os_type',
+    original_repo_id: 'repo_id',
     repo_id: 'repo_id',
     repo_name: 'repo_name',
     stack_name: 'stack_name',
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index f4bd399..69db174 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -675,9 +675,9 @@ Em.I18n.translations = {
   'installer.step1.advancedRepo.useRedhatSatellite.disabled.tooltip':'Use of RedHat Satellite/Spacewalk is not available when is using Public Repositories',
   'installer.step1.advancedRepo.skipValidation.message':'Skip Repository Base URL validation (Advanced)',
   'installer.step1.advancedRepo.useRedhatSatellite.message': 'Use RedHat Satellite/Spacewalk',
-  'installer.step1.advancedRepo.useRedhatSatellite.warning': 'By selecting to <b>“Use RedHat Satellite/Spacewalk”</b> for the software repositories, ' +
-    'you are responsible for configuring the repository channel in Satellite/Spacewalk and confirming the repositories for the selected <b>stack version</b> are available on the hosts in the cluster. ' +
-    'Refer to the Ambari documentation for more information.',
+  'installer.step1.advancedRepo.useRedhatSatellite.warning': "In order for Ambari to install packages from the right" +
+  " repositories, it is recommended that you edit the names of the repo's for each operating system so they match " +
+  "the channel names in your RedHat Satellite/Spacewalk instance.",
   'installer.step1.addOs.disabled.tooltip':'All Operating Systems have been added',
   'installer.step1.attentionNeeded':'<b>Attention:</b> Repository Base URLs of at least one OS are REQUIRED before you can proceed. Please make sure they are in correct format with its protocol.',
   'installer.step1.invalidURLAttention': '<b>Attention:</b> Please make sure all repository URLs are valid before proceeding.',
diff --git a/ambari-web/app/models.js b/ambari-web/app/models.js
index 7ebf9af..422e041 100644
--- a/ambari-web/app/models.js
+++ b/ambari-web/app/models.js
@@ -29,7 +29,6 @@ require('models/stack_version/version');
 require('models/stack_version/repository_version');
 require('models/stack_version/os');
 require('models/stack_version/service_simple');
-require('models/stack_version/repository');
 require('models/stack_version/stack_upgrade_history');
 require('models/operating_system');
 require('models/repository');
diff --git a/ambari-web/app/models/repository.js b/ambari-web/app/models/repository.js
index 9b3e56c..22c7690 100644
--- a/ambari-web/app/models/repository.js
+++ b/ambari-web/app/models/repository.js
@@ -23,6 +23,7 @@ var validator = require('utils/validator');
 App.Repository = DS.Model.extend({
   id:  DS.attr('string'), // This is ${osType}-${repoId}.
   repoId: DS.attr('string'),
+  originalRepoId: DS.attr('string'),
   osType: DS.attr('string'),
   baseUrl: DS.attr('string'),
   baseUrlInit: DS.attr('string'),
diff --git a/ambari-web/app/models/stack_version/repository.js b/ambari-web/app/models/stack_version/repository.js
deleted file mode 100644
index 6c93416..0000000
--- a/ambari-web/app/models/stack_version/repository.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * 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.Repository = DS.Model.extend({
-  id: DS.attr('string'),
-  baseUrl : DS.attr('string'),
-  defaultBaseUrl : DS.attr('string'),
-  latestBaseUrl : DS.attr('string'),
-  mirrorsList : DS.attr('array'),
-  osType : DS.attr('string'),
-  repoId : DS.attr('string'),
-  repoName : DS.attr('string'),
-  stackName : DS.attr('string'),
-  stackVersion : DS.attr('string'),
-  operatingSystem: DS.belongsTo('App.OS'),
-  tags: DS.attr('array')
-});
-
-App.Repository.FIXTURES = [];
-
-
diff --git a/ambari-web/app/styles/wizard.less b/ambari-web/app/styles/wizard.less
index 52695f5..d20adfd 100644
--- a/ambari-web/app/styles/wizard.less
+++ b/ambari-web/app/styles/wizard.less
@@ -112,6 +112,13 @@
     }
 
   }
+  .editable-repo {
+    input {
+      width: calc(~"100% - 20px");
+      margin-right: 2px;
+    }
+  }
+
   #confirm-hosts {
 
     .compact-panel-heading {
@@ -722,9 +729,6 @@
         padding-left: 0;
         margin-left: -5px;
       }
-      .use-redhat-checkbox i {
-        vertical-align: super;
-      }
       label {
         color: #666;
         &.disabled {
diff --git a/ambari-web/app/templates/wizard/step1.hbs b/ambari-web/app/templates/wizard/step1.hbs
index d3bf376..b2ce67b 100644
--- a/ambari-web/app/templates/wizard/step1.hbs
+++ b/ambari-web/app/templates/wizard/step1.hbs
@@ -154,13 +154,15 @@
                             {{#each repository in operatingSystem.repositories}}
                               {{#if repository.showRepo}}
                                 <tr {{QAAttr "{repository.repoName}"}}>
-                                  <td class="col-sm-3">{{repository.repoId}}</td>
+                                  <td class="col-sm-3">
+                                    {{view view.editableRepoView repositoryBinding="repository"}}
+                                  </td>
                                   <td class="col-sm-1">
                                     {{view view.popoverView repositoryBinding="repository" data-qaBinding="repository.validation"}}
                                   </td>
                                   <td class="col-sm-8">
                                     <div {{bindAttr class=":repo-url repository.invalidFormatError:has-error repository.invalidError:has-error"}}>
-                                      {{view Ember.TextField placeholderBinding="repository.placeholder" valueBinding="repository.baseUrl" disabledBinding="controller.selectedStack.useRedhatSatellite" classNames="form-control" data-qa="repo-url-input"}}
+                                      {{view view.repositoryTextField repositoryBinding="repository" disabledBinding="controller.selectedStack.useRedhatSatellite"}}
                                       {{#if controller.selectedStack.usePublicRepo}}
                                         <i {{bindAttr class="repository.undo::invisible :icon-undo"}}
                                           {{action "doRestoreDefaultValue" repository target="controller"}}
@@ -183,7 +185,7 @@
                           </table>
                         </td>
                         <td class="col-sm-1">
-                          <a class="action remove-icon"
+                          <a {{bindAttr class="controller.selectedStack.useRedhatSatellite:disabled :action :remove-icon"}}
                              href="#" {{action "removeOS" operatingSystem target="view"}} {{QAAttr "remove-icon"}}>
                             <span class="icon icon-minus"></span>
                             {{t common.remove}}
@@ -214,13 +216,12 @@
                 {{! Skip Repository Base URL validation END }}
 
                 {{! Use RedHat Satellite/Spacewalk }}
-                <div id="use-redhat" class="checkbox">
+                <div id="use-redhat">
                   {{#view view.redhatCheckBoxView
                   classNames="use-redhat-checkbox"
+                  labelTranslate="installer.step1.advancedRepo.useRedhatSatellite.message"
+                  labelClassNamesBinding="controller.selectedStack.usePublicRepo:disabled"
                   }}
-                    <label {{bindAttr for="view.checkboxId" class=":redhat-label :display-inline-block controller.selectedStack.usePublicRepo:disabled" data-original-title="view.parentView.redhatDisabledTooltip"}}>
-                      {{t installer.step1.advancedRepo.useRedhatSatellite.message}}
-                    </label>
                     <i class="glyphicon glyphicon-question-sign" rel="use-redhat-tooltip"
                        data-toggle="tooltip" {{translateAttr data-original-title="installer.step1.advancedRepo.useRedhatSatellite.tooltip"}}>
                     </i>
diff --git a/ambari-web/app/templates/wizard/step1/editable_repo.hbs b/ambari-web/app/templates/wizard/step1/editable_repo.hbs
new file mode 100644
index 0000000..8ec0598
--- /dev/null
+++ b/ambari-web/app/templates/wizard/step1/editable_repo.hbs
@@ -0,0 +1,29 @@
+{{!
+* 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.
+}}
+
+{{#if view.isEditing}}
+  {{view Em.TextField valueBinding="view.repository.repoId"}}
+{{else}}
+  {{view.repository.repoId}}
+{{/if}}
+{{#if view.showEditIcon}}
+  <i class="icon-pencil" {{action editRepoId target="view"}}></i>
+{{/if}}
+{{#if view.showRevertIcon}}
+  <i class="icon-undo" {{action revertToOriginal target="view"}}></i>
+{{/if}}
diff --git a/ambari-web/app/views/wizard/step1_view.js b/ambari-web/app/views/wizard/step1_view.js
index 4e37ba2..ba23c06 100644
--- a/ambari-web/app/views/wizard/step1_view.js
+++ b/ambari-web/app/views/wizard/step1_view.js
@@ -23,7 +23,7 @@ App.WizardStep1View = Em.View.extend({
 
   templateName: require('templates/wizard/step1'),
 
-  initView: function () {
+  didInsertElement: function () {
     if (this.get('controller.isLoadingComplete') && this.get('state') === 'inDOM') {
       Em.run.next(() => {
         $("[rel=skip-validation-tooltip]").tooltip({ placement: 'right'});
@@ -79,6 +79,44 @@ App.WizardStep1View = Em.View.extend({
     return this.get('controller').removeOS(...arguments);
   },
 
+  editableRepoView: Em.View.extend({
+    templateName: require('templates/wizard/step1/editable_repo'),
+    classNames: ['editable-repo'],
+    /**
+     * @type {boolean}
+     */
+    isEditing: false,
+
+    /**
+     * @type {?App.Repository}
+     */
+    repository: null,
+
+    /**
+     * @type {boolean}
+     */
+    showEditIcon: Em.computed.and('controller.selectedStack.useRedhatSatellite', '!isEditing'),
+
+    /**
+     * @type {boolean}
+     */
+    showRevertIcon: function() {
+      return this.get('isEditing') && (this.get('repository.repoId') !== this.get('repository.originalRepoId'));
+    }.property('isEditing', 'repository.repoId'),
+
+    didInsertElement: function() {
+      this.set('isEditing', false);
+    }.observes('controller.selectedStack.useRedhatSatellite'),
+
+    revertToOriginal: function() {
+      this.set('repository.repoId', this.get('repository.originalRepoId'))
+    },
+
+    editRepoId: function() {
+      this.set('isEditing', true);
+    }
+  }),
+
   /**
    * Disable submit button flag
    *
@@ -243,14 +281,15 @@ App.WizardStep1View = Em.View.extend({
     disabledBinding: 'controller.selectedStack.usePublicRepo',
     click: function () {
       if (!this.get('disabled')) {
-        this.toggleProperty('controller.selectedStack.useRedhatSatellite');
         if (this.get('controller.selectedStack.useRedhatSatellite')) {
-          App.ModalPopup.show({
-            header: Em.I18n.t('common.important'),
-            encodeBody: false,
-            secondary: false,
-            body: Em.I18n.t('installer.step1.advancedRepo.useRedhatSatellite.warning')
-          });
+          this.toggleProperty('controller.selectedStack.useRedhatSatellite');
+        } else {
+          App.showConfirmationPopup(
+            () => this.toggleProperty('controller.selectedStack.useRedhatSatellite'),
+            Em.I18n.t('installer.step1.advancedRepo.useRedhatSatellite.warning'),
+            Em.K,
+            Em.I18n.t('installer.step1.advancedRepo.useRedhatSatellite.message')
+          );
         }
       }
       return false;
@@ -260,11 +299,7 @@ App.WizardStep1View = Em.View.extend({
   repositoryTextField: Ember.TextField.extend({
     repository: null,
     placeholderBinding: "repository.placeholder",
-    valueBinding: "repository.baseUrl",
-    disabled: function() {
-      var isRedhat = this.get('parentView').isRedhat(this.get('repository'));
-      return this.get('controller.selectedStack.useRedhatSatellite') && !isRedhat;
-    }.property('controller.selectedStack.useRedhatSatellite')
+    valueBinding: "repository.baseUrl"
   }),
 
   /**

-- 
To stop receiving notification emails like this one, please contact
atkach@apache.org.