diff options
2 files changed, 6 insertions, 2 deletions
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/templates/quality-profiles-change-profile-parent.hbs b/server/sonar-web/src/main/js/apps/quality-profiles/templates/quality-profiles-change-profile-parent.hbs index 9cbb1778a7f..94c7e29c60a 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/templates/quality-profiles-change-profile-parent.hbs +++ b/server/sonar-web/src/main/js/apps/quality-profiles/templates/quality-profiles-change-profile-parent.hbs @@ -7,7 +7,7 @@ <div class="modal-field"> <label for="change-profile-parent">Parent: <em class="mandatory">*</em></label> <select id="change-profile-parent" name="parentKey"> - <option value="">{{t 'none'}}</option> + <option value="#none">{{t 'none'}}</option> {{#each profiles}} <option value="{{key}}">{{name}}</option> {{/each}} diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/views/ChangeParentView.js b/server/sonar-web/src/main/js/apps/quality-profiles/views/ChangeParentView.js index 6b405179e44..58efc08c47d 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/views/ChangeParentView.js +++ b/server/sonar-web/src/main/js/apps/quality-profiles/views/ChangeParentView.js @@ -27,6 +27,7 @@ export default ModalFormView.extend({ onRender () { ModalFormView.prototype.onRender.apply(this, arguments); this.$('select').select2({ + allowClear: false, width: '250px', minimumResultsForSearch: 50 }); @@ -39,7 +40,10 @@ export default ModalFormView.extend({ }, sendRequest () { - const parent = this.$('#change-profile-parent').val(); + let parent = this.$('#change-profile-parent').val(); + if (parent === '#none') { + parent = ''; + } changeProfileParent(this.options.profile.key, parent) .then(() => { this.destroy(); |