From a7fbd0596d337b2aa2a2540355866efbbc3a17ad Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Mon, 16 Nov 2015 17:20:29 +0100 Subject: [PATCH] SONAR-6907 Provide a visual feedback after restoring built-in quality profiles --- .../restore-built-in-profiles-view.js | 11 +++++++---- .../quality-profiles-restore-built-in-profiles.hbs | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/restore-built-in-profiles-view.js b/server/sonar-web/src/main/js/apps/quality-profiles/restore-built-in-profiles-view.js index e23638f8f5b..935f862bd07 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/restore-built-in-profiles-view.js +++ b/server/sonar-web/src/main/js/apps/quality-profiles/restore-built-in-profiles-view.js @@ -23,9 +23,9 @@ export default ModalFormView.extend({ sendRequest: function () { var that = this, url = baseUrl + '/api/qualityprofiles/restore_built_in', - options = { - language: this.$('#restore-built-in-profiles-language').val() - }; + lang = this.$('#restore-built-in-profiles-language').val(), + langName = _.findWhere(this.options.languages, { key: lang }).name, + options = { language: lang }; return $.ajax({ type: 'POST', url: url, @@ -37,7 +37,10 @@ export default ModalFormView.extend({ }).done(function () { that.collection.fetch({ reset: true }); that.collection.trigger('destroy'); - that.destroy(); + that.$('#restore-built-in-profiles-form-success') + .text(window.tp('quality_profiles.restore_built_in_profiles_success_message', langName)) + .removeClass('hidden'); + that.enableForm(); }).fail(function (jqXHR) { that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings); that.enableForm(); diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/templates/quality-profiles-restore-built-in-profiles.hbs b/server/sonar-web/src/main/js/apps/quality-profiles/templates/quality-profiles-restore-built-in-profiles.hbs index 0cf1d7248ab..9df1cc04587 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/templates/quality-profiles-restore-built-in-profiles.hbs +++ b/server/sonar-web/src/main/js/apps/quality-profiles/templates/quality-profiles-restore-built-in-profiles.hbs @@ -4,6 +4,7 @@