From: Stas Vilchik Date: Mon, 20 Apr 2015 14:03:31 +0000 (+0200) Subject: drop unused js code X-Git-Tag: 5.2-RC1~2170 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9f71c4524a534a1e3307d8863b5874d10fc71a00;p=sonarqube.git drop unused js code --- diff --git a/server/sonar-web/src/main/coffee/drilldown/conf.coffee b/server/sonar-web/src/main/coffee/drilldown/conf.coffee deleted file mode 100644 index 9c903652f61..00000000000 --- a/server/sonar-web/src/main/coffee/drilldown/conf.coffee +++ /dev/null @@ -1,109 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2014 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -define - # Coverage - - # UT - 'coverage': { tab: 'coverage', item: '.js-filter-lines-to-cover' } - 'lines_to_cover': { tab: 'coverage', item: '.js-filter-lines-to-cover' } - 'uncovered_lines': { tab: 'coverage', item: '.js-filter-uncovered-lines' } - 'line_coverage': { tab: 'coverage', item: '.js-filter-lines-to-cover' } - 'conditions_to_cover': { tab: 'coverage', item: '.js-filter-branches-to-cover' } - 'uncovered_conditions': { tab: 'coverage', item: '.js-filter-uncovered-branches' } - 'branch_coverage': { tab: 'coverage', item: '.js-filter-branches-to-cover' } - 'new_coverage': { tab: 'coverage', item: '.js-filter-lines-to-cover' } - 'new_uncovered_lines': { tab: 'coverage', item: '.js-filter-uncovered-lines' } - 'new_line_coverage': { tab: 'coverage', item: '.js-filter-lines-to-cover' } - 'new_lines_to_cover': { tab: 'coverage', item: '.js-filter-lines-to-cover' } - 'new_branch_coverage': { tab: 'coverage', item: '.js-filter-branches-to-cover' } - 'new_conditions_to_cover': { tab: 'coverage', item: '.js-filter-branches-to-cover' } - 'new_uncovered_conditions': { tab: 'coverage', item: '.js-filter-uncovered-branches' } - - # IT - 'it_coverage': { tab: 'coverage', item: '.js-filter-lines-to-cover-it' } - 'it_lines_to_cover': { tab: 'coverage', item: '.js-filter-lines-to-cover-it' } - 'it_uncovered_lines': { tab: 'coverage', item: '.js-filter-uncovered-lines-it' } - 'it_line_coverage': { tab: 'coverage', item: '.js-filter-lines-to-cover-it' } - 'it_conditions_to_cover': { tab: 'coverage', item: '.js-filter-branches-to-cover-it' } - 'it_uncovered_conditions': { tab: 'coverage', item: '.js-filter-uncovered-branches-it' } - 'it_branch_coverage': { tab: 'coverage', item: '.js-filter-branches-to-cover-it' } - 'new_it_coverage': { tab: 'coverage', item: '.js-filter-lines-to-cover-it' } - 'new_it_uncovered_lines': { tab: 'coverage', item: '.js-filter-uncovered-lines-it' } - 'new_it_line_coverage': { tab: 'coverage', item: '.js-filter-lines-to-cover-it' } - 'new_it_lines_to_cover': { tab: 'coverage', item: '.js-filter-lines-to-cover-it' } - 'new_it_branch_coverage': { tab: 'coverage', item: '.js-filter-branches-to-cover-it' } - 'new_it_conditions_to_cover': { tab: 'coverage', item: '.js-filter-branches-to-cover-it' } - 'new_it_uncovered_conditions': { tab: 'coverage', item: '.js-filter-uncovered-branches-it' } - - # Overall - 'overall_coverage': { tab: 'coverage', item: '.js-filter-lines-to-cover-overall' } - 'overall_lines_to_cover': { tab: 'coverage', item: '.js-filter-lines-to-cover-overall' } - 'overall_uncovered_lines': { tab: 'coverage', item: '.js-filter-uncovered-lines-overall' } - 'overall_line_coverage': { tab: 'coverage', item: '.js-filter-lines-to-cover-overall' } - 'overall_conditions_to_cover': { tab: 'coverage', item: '.js-filter-branches-to-cover-overall' } - 'overall_uncovered_conditions': { tab: 'coverage', item: '.js-filter-uncovered-branches-overall' } - 'overall_branch_coverage': { tab: 'coverage', item: '.js-filter-branches-to-cover-overall' } - 'new_overall_coverage': { tab: 'coverage', item: '.js-filter-lines-to-cover-overall' } - 'new_overall_uncovered_lines': { tab: 'coverage', item: '.js-filter-uncovered-lines-overall' } - 'new_overall_line_coverage': { tab: 'coverage', item: '.js-filter-lines-to-cover-overall' } - 'new_overall_lines_to_cover': { tab: 'coverage', item: '.js-filter-lines-to-cover-overall' } - 'new_overall_branch_coverage': { tab: 'coverage', item: '.js-filter-branches-to-cover-overall' } - 'new_overall_conditions_to_cover': { tab: 'coverage', item: '.js-filter-branches-to-cover-overall' } - 'new_overall_uncovered_conditions': { tab: 'coverage', item: '.js-filter-uncovered-branches-overall' } - - - # Issues - 'violations': { tab: 'issues', item: '.js-filter-unresolved-issues' } - 'blocker_violations': { tab: 'issues', item: '.js-filter-BLOCKER-issues' } - 'critical_violations': { tab: 'issues', item: '.js-filter-CRITICAL-issues' } - 'major_violations': { tab: 'issues', item: '.js-filter-MAJOR-issues' } - 'minor_violations': { tab: 'issues', item: '.js-filter-MINOR-issues' } - 'info_violations': { tab: 'issues', item: '.js-filter-INFO-issues' } - 'new_violations': { tab: 'issues', item: '.js-filter-unresolved-issues' } - 'new_blocker_violations': { tab: 'issues', item: '.js-filter-BLOCKER-issues' } - 'new_critical_violations': { tab: 'issues', item: '.js-filter-CRITICAL-issues' } - 'new_major_violations': { tab: 'issues', item: '.js-filter-MAJOR-issues' } - 'new_minor_violations': { tab: 'issues', item: '.js-filter-MINOR-issues' } - 'new_info_violations': { tab: 'issues', item: '.js-filter-INFO-issues' } - 'false_positive_issues': { tab: 'issues', item: '.js-filter-false-positive-issues' } - 'sqale_index': { tab: 'issues', item: '.js-filter-unresolved-issues' } - 'sqale_debt_ratio': { tab: 'issues', item: '.js-filter-unresolved-issues' } - 'sqale_rating': { tab: 'issues', item: '.js-filter-unresolved-issues' } - 'new_technical_debt': { tab: 'issues', item: '.js-filter-unresolved-issues' } - 'open_issues': { tab: 'issues', item: '.js-filter-open-issues' } - 'reopened_issues': { tab: 'issues', item: '.js-filter-open-issues' } - 'confirmed_issues': { tab: 'issues', item: '.js-filter-unresolved-issues' } - - - # Duplications - 'duplicated_lines': { tab: 'duplications', item: '.js-filter-duplications' } - 'duplicated_blocks': { tab: 'duplications', item: '.js-filter-duplications' } - 'duplicated_files': { tab: 'duplications', item: '.js-filter-duplications' } - 'duplicated_lines_density': { tab: 'duplications', item: '.js-filter-duplications' } - - - # Tests - 'tests': { tab: 'tests', item: null } - 'test_success_density': { tab: 'tests', item: null } - 'skipped_tests': { tab: 'tests', item: null } - 'test_failures': { tab: 'tests', item: null } - 'test_errors': { tab: 'tests', item: null } - 'test_execution_time': { tab: 'tests', item: null } diff --git a/server/sonar-web/src/main/js/navigator/filters/action-plan-filters.js b/server/sonar-web/src/main/js/navigator/filters/action-plan-filters.js deleted file mode 100644 index b393cf421ef..00000000000 --- a/server/sonar-web/src/main/js/navigator/filters/action-plan-filters.js +++ /dev/null @@ -1,131 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * SonarQube is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -define([ - 'navigator/filters/base-filters', - 'navigator/filters/choice-filters' -], function (BaseFilters, ChoiceFilters) { - - return ChoiceFilters.ChoiceFilterView.extend({ - - initialize: function() { - ChoiceFilters.ChoiceFilterView.prototype.initialize.apply(this, arguments); - this.projectFilter = this.model.get('projectFilter'); - this.listenTo(this.projectFilter, 'change:value', this.onChangeProjectFilter); - this.onChangeProjectFilter(); - }, - - - onChangeProjectFilter: function() { - var that = this; - _.each(that.model.get('choices'), function(v, k) { - that.choices.add(new Backbone.Model({ id: k, text: v })); - }); - - var projects = this.projectFilter.get('value'); - if (_.isArray(projects) && projects.length === 1) { - return this.fetchActionPlans(projects[0]); - } else { - return this.makeInactive(); - } - }, - - - showDetails: function() { - if (!this.$el.is('.navigator-filter-inactive')) { - ChoiceFilters.ChoiceFilterView.prototype.showDetails.apply(this, arguments); - } - }, - - - makeActive: function() { - this.model.set({ - inactive: false, - title: '' - }); - this.model.trigger('change:enabled'); - this.$el.removeClass('navigator-filter-inactive').prop('title', ''); - }, - - - makeInactive: function() { - this.model.set({ - inactive: true, - title: window.SS.phrases.actionPlanNotAvailable - }); - this.model.trigger('change:enabled'); - this.choices.reset([]); - this.detailsView.updateLists(); - this.detailsView.updateValue(); - this.$el.addClass('navigator-filter-inactive') - .prop('title', window.SS.phrases.actionPlanNotAvailable); - }, - - - fetchActionPlans: function(project) { - var that = this; - return jQuery.ajax({ - url: baseUrl + '/api/action_plans/search', - type: 'GET', - data: { project: project } - }).done(function(r) { - var nonClosedActionPlans = - _.sortBy(_.reject(r.actionPlans, function(plan) { - return plan.status === 'CLOSED'; - }), 'name'); - - that.choices.reset(nonClosedActionPlans.map(function(plan) { - return { - id: plan.key, - text: plan.name, - category: plan.fDeadLine - }; - })); - _.each(that.model.get('choices'), function(v, k) { - that.choices.add(new Backbone.Model({ id: k, text: v })); - }); - var value = that.model.get('value'); - _.each(value, function(v) { - var cModel = that.choices.findWhere({ id: v }); - cModel.set('checked', true); - }); - that.detailsView.updateValue(); - that.render(); - - that.makeActive(); - }); - }, - - - restore: function(value) { - if (_.isString(value)) { - value = value.split(','); - } - - if (this.choices && value.length > 0) { - this.model.set({ value: value, enabled: true }); - this.onChangeProjectFilter(); - } else { - this.clear(); - } - } - - }); - -}); diff --git a/server/sonar-web/src/main/js/navigator/filters/context-filters.js b/server/sonar-web/src/main/js/navigator/filters/context-filters.js deleted file mode 100644 index d4a49a2d7b2..00000000000 --- a/server/sonar-web/src/main/js/navigator/filters/context-filters.js +++ /dev/null @@ -1,85 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * SonarQube is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -define(function () { - - return Backbone.View.extend({ - - initialize: function() { - this.model.view = this; - }, - - - render: function() { - this.$el.hide(); - }, - - - renderBase: function() {}, - renderInput: function() {}, - focus: function() {}, - showDetails: function() {}, - registerShowedDetails: function() {}, - hideDetails: function() {}, - isActive: function() {}, - renderValue: function() {}, - isDefaultValue: function() {}, - - - restoreFromQuery: function(q) { - var param = _.findWhere(q, { key: this.model.get('property') }); - if (param && param.value) { - this.restore(param.value); - } else { - this.clear(); - } - }, - - - restore: function(value) { - this.model.set({ value: value }); - }, - - - clear: function() { - this.model.unset('value'); - }, - - - disable: function(e) { - e.stopPropagation(); - this.hideDetails(); - this.options.filterBarView.hideDetails(); - this.model.set({ - enabled: false, - value: null - }); - }, - - - formatValue: function() { - var q = {}; - if (this.model.has('property') && this.model.has('value') && this.model.get('value')) { - q[this.model.get('property')] = this.model.get('value'); - } - return q; - } - }); - -}); diff --git a/server/sonar-web/src/main/js/navigator/filters/read-only-filters.js b/server/sonar-web/src/main/js/navigator/filters/read-only-filters.js deleted file mode 100644 index ef90d689de9..00000000000 --- a/server/sonar-web/src/main/js/navigator/filters/read-only-filters.js +++ /dev/null @@ -1,44 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * SonarQube is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -define(['navigator/filters/base-filters'], function (BaseFilters) { - - return BaseFilters.BaseFilterView.extend({ - className: 'navigator-filter navigator-filter-read-only', - - - events: { - 'click .navigator-filter-disable': 'disable' - }, - - - isDefaultValue: function() { - return false; - }, - - - renderValue: function() { - var value = this.model.get('value'), - format = this.model.get('format'); - return value ? (format ? format(value) : value) : ''; - } - - }); - -}); diff --git a/server/sonar-web/src/main/js/navigator/filters/rule-filters.js b/server/sonar-web/src/main/js/navigator/filters/rule-filters.js deleted file mode 100644 index 3cc58ffb93f..00000000000 --- a/server/sonar-web/src/main/js/navigator/filters/rule-filters.js +++ /dev/null @@ -1,85 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * SonarQube is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -define([ - 'navigator/filters/base-filters', - 'navigator/filters/ajax-select-filters' -], function (BaseFilters, AjaxSelectFilters) { - - var RuleSuggestions = AjaxSelectFilters.Suggestions.extend({ - - url: function() { - return baseUrl + '/api/rules/search'; - }, - - - fetch: function(options) { - options.data.f = 'name,lang'; - return AjaxSelectFilters.Suggestions.prototype.fetch.call(this, options); - }, - - - parse: function(r) { - this.more = r.p * r.ps < r.total; - return r.rules.map(function(rule) { - return { id: rule.key, text: rule.name, category: rule.lang }; - }); - } - - }); - - - - var RuleDetailsFilterView = AjaxSelectFilters.AjaxSelectDetailsFilterView.extend({ - searchKey: 'q' - }); - - - return AjaxSelectFilters.AjaxSelectFilterView.extend({ - - initialize: function() { - AjaxSelectFilters.AjaxSelectFilterView.prototype.initialize.call(this, { - detailsView: RuleDetailsFilterView - }); - - this.choices = new RuleSuggestions(); - }, - - - createRequest: function(v) { - var that = this; - return jQuery - .ajax({ - url: baseUrl + '/api/rules/show', - type: 'GET', - data: { key: v } - }) - .done(function (r) { - that.choices.add(new Backbone.Model({ - id: r.rule.key, - text: r.rule.name, - category: r.rule.language, - checked: true - })); - }); - } - - }); - -});