aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-07-18 17:08:56 +0200
committerStas Vilchik <vilchiks@gmail.com>2016-07-18 17:09:08 +0200
commitbd4a28b0f83d6af0889abc21de85037e2ba44646 (patch)
treecd2b66bdd0090c5071c81fe69a73ed2e1e31fd2a
parent5fddece10c608fa2acbe8d1de1d6c9fa2eab6e56 (diff)
downloadsonarqube-bd4a28b0f83d6af0889abc21de85037e2ba44646.tar.gz
sonarqube-bd4a28b0f83d6af0889abc21de85037e2ba44646.zip
remove empty option when changing profile parent
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/templates/quality-profiles-change-profile-parent.hbs2
-rw-r--r--server/sonar-web/src/main/js/apps/quality-profiles/views/ChangeParentView.js6
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();