From b929bdc91ede52f35e1b8845225fd4afbb48fd4c Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Tue, 8 Nov 2016 16:27:54 +0100 Subject: [PATCH] SONAR-8376 Do not display issue filters and drop management page --- .../src/test/java/it/Category2Suite.java | 2 - .../test/java/it/issue/IssuesPageTest.java | 41 ----- .../src/main/js/apps/component-issues/app.js | 10 +- .../sonar-web/src/main/js/apps/issues/app.js | 17 +- .../src/main/js/apps/issues/controller.js | 62 +------- .../src/main/js/apps/issues/filters-view.js | 110 ------------- .../src/main/js/apps/issues/layout.js | 11 +- .../src/main/js/apps/issues/models/filter.js | 35 ---- .../src/main/js/apps/issues/models/filters.js | 34 ---- .../src/main/js/apps/issues/router.js | 27 +--- .../issues/templates/_issues-filter-name.hbs | 18 --- .../apps/issues/templates/issues-filters.hbs | 55 ------- .../apps/issues/templates/issues-layout.hbs | 5 +- .../templates/issues-workspace-home.hbs | 26 --- .../js/apps/issues/workspace-home-view.js | 26 --- .../app/controllers/issues_controller.rb | 117 -------------- .../views/issues/_filter_copy_form.html.erb | 20 --- .../views/issues/_filter_edit_form.html.erb | 20 --- .../views/issues/_filter_favourites.html.erb | 9 -- .../issues/_filter_save_as_form.html.erb | 20 --- .../views/issues/_filter_shared_form.html.erb | 33 ---- .../WEB-INF/app/views/issues/manage.html.erb | 149 ------------------ .../resources/org/sonar/l10n/core.properties | 4 - 23 files changed, 13 insertions(+), 838 deletions(-) delete mode 100644 it/it-tests/src/test/java/it/issue/IssuesPageTest.java delete mode 100644 server/sonar-web/src/main/js/apps/issues/filters-view.js delete mode 100644 server/sonar-web/src/main/js/apps/issues/models/filter.js delete mode 100644 server/sonar-web/src/main/js/apps/issues/models/filters.js delete mode 100644 server/sonar-web/src/main/js/apps/issues/templates/_issues-filter-name.hbs delete mode 100644 server/sonar-web/src/main/js/apps/issues/templates/issues-filters.hbs delete mode 100644 server/sonar-web/src/main/js/apps/issues/templates/issues-workspace-home.hbs delete mode 100644 server/sonar-web/src/main/js/apps/issues/workspace-home-view.js delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_copy_form.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_edit_form.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_favourites.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_save_as_form.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_shared_form.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/manage.html.erb diff --git a/it/it-tests/src/test/java/it/Category2Suite.java b/it/it-tests/src/test/java/it/Category2Suite.java index 442918c821f..9c925cf900b 100644 --- a/it/it-tests/src/test/java/it/Category2Suite.java +++ b/it/it-tests/src/test/java/it/Category2Suite.java @@ -36,7 +36,6 @@ import it.issue.IssuePurgeTest; import it.issue.IssueSearchTest; import it.issue.IssueTrackingTest; import it.issue.IssueWorkflowTest; -import it.issue.IssuesPageTest; import it.issue.NewIssuesMeasureTest; import it.qualityModel.MaintainabilityMeasureTest; import it.qualityModel.MaintainabilityRatingMeasureTest; @@ -84,7 +83,6 @@ import static util.ItUtils.xooPlugin; IssueSearchTest.class, IssueTrackingTest.class, IssueWorkflowTest.class, - IssuesPageTest.class, NewIssuesMeasureTest.class, // debt MaintainabilityMeasureTest.class, diff --git a/it/it-tests/src/test/java/it/issue/IssuesPageTest.java b/it/it-tests/src/test/java/it/issue/IssuesPageTest.java deleted file mode 100644 index 5869553c56d..00000000000 --- a/it/it-tests/src/test/java/it/issue/IssuesPageTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program 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. - * - * This program 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. - */ -package it.issue; - -import com.sonar.orchestrator.Orchestrator; -import com.sonar.orchestrator.selenium.Selenese; -import it.Category2Suite; -import org.junit.ClassRule; -import org.junit.Test; -import util.selenium.SeleneseTest; - -public class IssuesPageTest { - - @ClassRule - public static Orchestrator orchestrator = Category2Suite.ORCHESTRATOR; - - @Test - public void save_new_issue_filter() throws Exception { - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("save_new_issue_filter", - "/issue/IssuesPageTest/save_new_issue_filter.html" - ).build(); - new SeleneseTest(selenese).runOn(orchestrator); - } -} diff --git a/server/sonar-web/src/main/js/apps/component-issues/app.js b/server/sonar-web/src/main/js/apps/component-issues/app.js index 7398ccf9105..a2f24c52aaf 100644 --- a/server/sonar-web/src/main/js/apps/component-issues/app.js +++ b/server/sonar-web/src/main/js/apps/component-issues/app.js @@ -25,7 +25,6 @@ import State from '../issues/models/state'; import Layout from '../issues/layout'; import Issues from '../issues/models/issues'; import Facets from '../../components/navigator/models/facets'; -import Filters from '../issues/models/filters'; import Controller from '../issues/controller'; import Router from '../issues/router'; import WorkspaceListView from '../issues/workspace-list-view'; @@ -47,7 +46,6 @@ const init = function () { this.updateContextFacets(); this.list = new Issues(); this.facets = new Facets(); - this.filters = new Filters(); this.layout = new Layout({ app: this, el: options.el }); this.layout.render(); @@ -74,11 +72,9 @@ const init = function () { }); this.layout.facetsRegion.show(this.facetsView); - this.controller.fetchFilters().done(function () { - key.setScope('list'); - App.router = new Router({ app: App }); - Backbone.history.start(); - }); + key.setScope('list'); + App.router = new Router({ app: App }); + Backbone.history.start(); }; App.getContextQuery = function () { diff --git a/server/sonar-web/src/main/js/apps/issues/app.js b/server/sonar-web/src/main/js/apps/issues/app.js index 447e12140f4..4c15e33a8c2 100644 --- a/server/sonar-web/src/main/js/apps/issues/app.js +++ b/server/sonar-web/src/main/js/apps/issues/app.js @@ -24,13 +24,11 @@ import State from './models/state'; import Layout from './layout'; import Issues from './models/issues'; import Facets from '../../components/navigator/models/facets'; -import Filters from './models/filters'; import Controller from './controller'; import Router from './router'; import WorkspaceListView from './workspace-list-view'; import WorkspaceHeaderView from './workspace-header-view'; import FacetsView from './facets-view'; -import FiltersView from './filters-view'; const App = new Marionette.Application(); const init = function () { @@ -39,7 +37,6 @@ const init = function () { this.state = new State(); this.list = new Issues(); this.facets = new Facets(); - this.filters = new Filters(); this.layout = new Layout({ app: this, el: options.el }); this.layout.render(); @@ -66,17 +63,9 @@ const init = function () { }); this.layout.facetsRegion.show(this.facetsView); - this.filtersView = new FiltersView({ - app: this, - collection: this.filters - }); - this.layout.filtersRegion.show(this.filtersView); - - this.controller.fetchFilters().done(function () { - key.setScope('list'); - App.router = new Router({ app: App }); - Backbone.history.start(); - }); + key.setScope('list'); + App.router = new Router({ app: App }); + Backbone.history.start(); }; App.on('start', function () { diff --git a/server/sonar-web/src/main/js/apps/issues/controller.js b/server/sonar-web/src/main/js/apps/issues/controller.js index 4437ebc1367..aa5d45d3d00 100644 --- a/server/sonar-web/src/main/js/apps/issues/controller.js +++ b/server/sonar-web/src/main/js/apps/issues/controller.js @@ -22,7 +22,6 @@ import _ from 'underscore'; import Backbone from 'backbone'; import Controller from '../../components/navigator/controller'; import ComponentViewer from './component-viewer/main'; -import HomeView from './workspace-home-view'; const FACET_DATA_FIELDS = ['components', 'users', 'rules', 'languages']; @@ -62,7 +61,6 @@ export default Controller.extend({ } if (firstPage) { this.options.app.state.set({ selectedIndex: 0, page: 1 }, { silent: true }); - this.hideHomePage(); this.closeComponentViewer(); } const data = this._issuesParameters(); @@ -111,18 +109,6 @@ export default Controller.extend({ return (query.issues != null) && this.options.app.list.length === 1; }, - fetchFilters () { - const that = this; - return $.when( - that.options.app.filters.fetch({ reset: true }), - $.get(window.baseUrl + '/api/issue_filters/app', function (r) { - that.options.app.state.set({ - canBulkChange: r.canBulkChange, - canManageFilters: r.canManageFilters - }); - })); - }, - _mergeCollections (a, b) { const collection = new Backbone.Collection(a); collection.add(b, { merge: true }); @@ -175,21 +161,11 @@ export default Controller.extend({ return this.options.app.state.setQuery({ resolved: 'false' }); }, - applyFilter (filter, ignoreQuery) { - if (ignoreQuery == null) { - ignoreQuery = false; - } - if (!ignoreQuery) { - const filterQuery = this.parseQuery(filter.get('query')); - this.options.app.state.setQuery(filterQuery); - } - return this.options.app.state.set({ filter, changed: false }); - }, - parseQuery () { const q = Controller.prototype.parseQuery.apply(this, arguments); delete q.asc; delete q.s; + delete q.id; return q; }, @@ -211,19 +187,6 @@ export default Controller.extend({ return route.join(separator); }, - getRoute () { - const filter = this.options.app.state.get('filter'); - let query = Controller.prototype.getRoute.apply(this, arguments); - if (filter != null) { - if (this.options.app.state.get('changed') && query.length > 0) { - query = 'id=' + filter.id + '|' + query; - } else { - query = 'id=' + filter.id; - } - } - return query; - }, - _prepareComponent (issue) { return { key: issue.get('component'), @@ -255,29 +218,6 @@ export default Controller.extend({ this.options.app.layout.hideComponentViewer(); this.options.app.issuesView.bindScrollEvents(); return this.options.app.issuesView.scrollTo(); - }, - - showHomePage () { - this.options.app.state.set({ query: { resolved: 'false' } }, { silent: true }); - this.fetchList(); - this.options.app.layout.workspaceComponentViewerRegion.reset(); - key.setScope('home'); - this.options.app.issuesView.unbindScrollEvents(); - this.options.app.homeView = new HomeView({ - app: this.options.app, - collection: this.options.app.filters - }); - this.options.app.layout.workspaceHomeRegion.show(this.options.app.homeView); - return this.options.app.layout.showHomePage(); - }, - - hideHomePage () { - this.options.app.layout.workspaceComponentViewerRegion.reset(); - this.options.app.layout.workspaceHomeRegion.reset(); - key.setScope('list'); - this.options.app.layout.hideHomePage(); - this.options.app.issuesView.bindScrollEvents(); - return this.options.app.issuesView.scrollTo(); } }); diff --git a/server/sonar-web/src/main/js/apps/issues/filters-view.js b/server/sonar-web/src/main/js/apps/issues/filters-view.js deleted file mode 100644 index 408d3e5d521..00000000000 --- a/server/sonar-web/src/main/js/apps/issues/filters-view.js +++ /dev/null @@ -1,110 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program 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. - * - * This program 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. - */ -import $ from 'jquery'; -import _ from 'underscore'; -import Marionette from 'backbone.marionette'; -import Template from './templates/issues-filters.hbs'; - -export default Marionette.ItemView.extend({ - template: Template, - - events: { - 'click .js-toggle-filters': 'toggleFilters', - 'click .js-filter': 'applyFilter', - 'click .js-filter-save-as': 'saveAs', - 'click .js-filter-save': 'save', - 'click .js-filter-copy': 'copy', - 'click .js-filter-edit': 'edit' - }, - - initialize (options) { - const that = this; - this.listenTo(options.app.state, 'change:filter', this.render); - this.listenTo(options.app.state, 'change:changed', this.render); - this.listenTo(options.app.state, 'change:canManageFilters', this.render); - this.listenTo(options.app.filters, 'reset', this.render); - window.onSaveAs = window.onCopy = window.onEdit = function (id) { - $('#modal').dialog('close'); - return that.options.app.controller.fetchFilters().done(function () { - const filter = that.collection.get(id); - return filter.fetch().done(function () { - return that.options.app.controller.applyFilter(filter); - }); - }); - }; - }, - - onRender () { - this.$el.toggleClass('search-navigator-filters-selected', this.options.app.state.has('filter')); - }, - - toggleFilters (e) { - const that = this; - e.stopPropagation(); - this.$('.search-navigator-filters-list').toggle(); - return $('body').on('click.issues-filters', function () { - $('body').off('click.issues-filters'); - return that.$('.search-navigator-filters-list').hide(); - }); - }, - - applyFilter (e) { - const that = this; - const id = $(e.currentTarget).data('id'); - const filter = this.collection.get(id); - return that.options.app.controller.applyFilter(filter); - - }, - - saveAs () { - const query = this.options.app.controller.getQuery('&'); - const url = window.baseUrl + '/issues/save_as_form?' + query; - window.openModalWindow(url, {}); - }, - - save () { - const that = this; - const query = this.options.app.controller.getQuery('&'); - const url = window.baseUrl + '/issues/save/' + (this.options.app.state.get('filter').id) + '?' + query; - return $.post(url).done(function () { - return that.options.app.state.set({ changed: false }); - }); - }, - - copy () { - const url = window.baseUrl + '/issues/copy_form/' + (this.options.app.state.get('filter').id); - window.openModalWindow(url, {}); - }, - - edit () { - const url = window.baseUrl + '/issues/edit_form/' + (this.options.app.state.get('filter').id); - window.openModalWindow(url, {}); - }, - - serializeData () { - const filter = this.options.app.state.get('filter'); - return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), { - state: this.options.app.state.toJSON(), - filter: filter != null ? filter.toJSON() : null, - currentUser: window.SS.user - }); - } -}); - diff --git a/server/sonar-web/src/main/js/apps/issues/layout.js b/server/sonar-web/src/main/js/apps/issues/layout.js index 5877ff50009..1b36f36c231 100644 --- a/server/sonar-web/src/main/js/apps/issues/layout.js +++ b/server/sonar-web/src/main/js/apps/issues/layout.js @@ -30,8 +30,7 @@ export default Marionette.LayoutView.extend({ facetsRegion: '.search-navigator-facets', workspaceHeaderRegion: '.search-navigator-workspace-header', workspaceListRegion: '.search-navigator-workspace-list', - workspaceComponentViewerRegion: '.issues-workspace-component-viewer', - workspaceHomeRegion: '.issues-workspace-home' + workspaceComponentViewerRegion: '.issues-workspace-component-viewer' }, onRender () { @@ -60,14 +59,6 @@ export default Marionette.LayoutView.extend({ if (this.scroll != null) { $(window).scrollTop(this.scroll); } - }, - - showHomePage () { - this.$('.issues').addClass('issues-home-view'); - }, - - hideHomePage () { - this.$('.issues').removeClass('issues-home-view'); } }); diff --git a/server/sonar-web/src/main/js/apps/issues/models/filter.js b/server/sonar-web/src/main/js/apps/issues/models/filter.js deleted file mode 100644 index b09fdbf61b0..00000000000 --- a/server/sonar-web/src/main/js/apps/issues/models/filter.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program 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. - * - * This program 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. - */ -import Backbone from 'backbone'; - -export default Backbone.Model.extend({ - url () { - return window.baseUrl + '/api/issue_filters/show?id=' + this.id; - }, - - parse (r) { - if (r.filter != null) { - return r.filter; - } else { - return r; - } - } -}); - diff --git a/server/sonar-web/src/main/js/apps/issues/models/filters.js b/server/sonar-web/src/main/js/apps/issues/models/filters.js deleted file mode 100644 index 530002d8954..00000000000 --- a/server/sonar-web/src/main/js/apps/issues/models/filters.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program 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. - * - * This program 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. - */ -import Backbone from 'backbone'; -import Filter from './filter'; - -export default Backbone.Collection.extend({ - model: Filter, - - url () { - return window.baseUrl + '/api/issue_filters/search'; - }, - - parse (r) { - return r.issueFilters; - } -}); - diff --git a/server/sonar-web/src/main/js/apps/issues/router.js b/server/sonar-web/src/main/js/apps/issues/router.js index eb6c6c4284a..1f296e72d73 100644 --- a/server/sonar-web/src/main/js/apps/issues/router.js +++ b/server/sonar-web/src/main/js/apps/issues/router.js @@ -25,35 +25,12 @@ export default Router.extend({ ':query': 'index' }, - initialize (options) { - Router.prototype.initialize.apply(this, arguments); - this.listenTo(options.app.state, 'change:filter', this.updateRoute); - }, - home () { - if (this.options.app.state.get('isContext')) { - return this.navigate('resolved=false', { trigger: true, replace: true }); - } else { - return this.options.app.controller.showHomePage(); - } + return this.navigate('resolved=false', { trigger: true, replace: true }); }, index (query) { - const that = this; - query = this.options.app.controller.parseQuery(query); - if (query.id != null) { - const filter = this.options.app.filters.get(query.id); - delete query.id; - if (Object.keys(query).length > 0) { - that.options.app.controller.applyFilter(filter, true); - that.options.app.state.setQuery(query); - that.options.app.state.set({ changed: true }); - } else { - that.options.app.controller.applyFilter(filter); - } - } else { - this.options.app.state.setQuery(query); - } + this.options.app.state.setQuery(this.options.app.controller.parseQuery(query)); } }); diff --git a/server/sonar-web/src/main/js/apps/issues/templates/_issues-filter-name.hbs b/server/sonar-web/src/main/js/apps/issues/templates/_issues-filter-name.hbs deleted file mode 100644 index ced19a7a44e..00000000000 --- a/server/sonar-web/src/main/js/apps/issues/templates/_issues-filter-name.hbs +++ /dev/null @@ -1,18 +0,0 @@ -{{#if filter.name}} - {{filter.name}} - - {{#unless filter.shared}} - [{{t "issue_filter.private"}}] - {{else}} - {{#eq filter.user currentUser}} - [{{t "issue_filter.shared_with_all_users"}}] - {{else}} - {{#if filter.user}} - [{{t "issue_filter.shared"}}] - {{/if}} - {{/eq}} - {{/unless}} - -{{else}} - {{t "issues"}} -{{/if}} diff --git a/server/sonar-web/src/main/js/apps/issues/templates/issues-filters.hbs b/server/sonar-web/src/main/js/apps/issues/templates/issues-filters.hbs deleted file mode 100644 index 74cd306ce3e..00000000000 --- a/server/sonar-web/src/main/js/apps/issues/templates/issues-filters.hbs +++ /dev/null @@ -1,55 +0,0 @@ -{{#unless state.isContext}} -

- - {{> "_issues-filter-name"}} - - - {{#if filter.description}} -
{{filter.description}}
- {{/if}} -

- -
-
- {{#if state.canManageFilters}} - {{#if filter.canModify}} - {{#if state.changed}} - - {{/if}} - {{/if}} - - {{#unless filter.id}} - - {{/unless}} - - {{#if filter.id}} - {{#unless state.changed}} - - {{/unless}} - {{/if}} - - {{#if filter.canModify}} - {{#if filter.id}} - - {{/if}} - {{/if}} - {{/if}} -
-
-{{/unless}} diff --git a/server/sonar-web/src/main/js/apps/issues/templates/issues-layout.hbs b/server/sonar-web/src/main/js/apps/issues/templates/issues-layout.hbs index b84449ae553..393845b0394 100644 --- a/server/sonar-web/src/main/js/apps/issues/templates/issues-layout.hbs +++ b/server/sonar-web/src/main/js/apps/issues/templates/issues-layout.hbs @@ -1,6 +1,8 @@
-
+
+

{{t "issues"}}

+
@@ -8,6 +10,5 @@
-
diff --git a/server/sonar-web/src/main/js/apps/issues/templates/issues-workspace-home.hbs b/server/sonar-web/src/main/js/apps/issues/templates/issues-workspace-home.hbs deleted file mode 100644 index fe32b6b8b21..00000000000 --- a/server/sonar-web/src/main/js/apps/issues/templates/issues-workspace-home.hbs +++ /dev/null @@ -1,26 +0,0 @@ -
-
-

Start From Filters:

- -
    - {{#each items}} - {{#ifCanUseFilter query}} -
  • - - - {{name}} - - {{#if shared}} - [{{t "issue_filter.shared"}}] - {{/if}} -
  • - {{/ifCanUseFilter}} - {{/each}} -
-
- - -
diff --git a/server/sonar-web/src/main/js/apps/issues/workspace-home-view.js b/server/sonar-web/src/main/js/apps/issues/workspace-home-view.js deleted file mode 100644 index ae3c99ad5c8..00000000000 --- a/server/sonar-web/src/main/js/apps/issues/workspace-home-view.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program 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. - * - * This program 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. - */ -import Marionette from 'backbone.marionette'; -import Template from './templates/issues-workspace-home.hbs'; - -export default Marionette.ItemView.extend({ - template: Template -}); - diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb index 6570ff3b606..8303cd1c33c 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb @@ -23,11 +23,6 @@ class IssuesController < ApplicationController SECTION=Navigation::SECTION_ISSUES - before_filter :init_options - before_filter :load_fav_filters, :only => [:index, :search, :search2, :filter, :manage, :favourites, :toggle_fav] - - PAGE_SIZE = 100 - # GET /issues/index def index redirect_to :action => 'search' @@ -43,93 +38,6 @@ class IssuesController < ApplicationController redirect_to :action => 'search', :anchor => 'issues=' + params[:id] end - # GET /issues/manage - def manage - @issues_query = Internal.issues.emptyIssueQuery() - @filters = Internal.issues.findIssueFiltersForCurrentUser() - @shared_filters = Internal.issues.findSharedFiltersForCurrentUser() - @favourite_filter_ids = @favourite_filters.map { |filter| filter.id } - end - - # GET /issues/save_as_form?[&criteria] - def save_as_form - @filter_query_serialized = Internal.issues.serializeFilterQuery(criteria_params) - render :partial => 'issues/filter_save_as_form' - end - - # POST /issues/save_as?name=[¶meters] - def save_as - verify_post_request - options = {'name' => params[:name], 'description' => params[:description], 'data' => URI.unescape(params[:data]), 'shared' => params[:shared]=='true'} - @filter = Internal.issues.createIssueFilter(options) - render :text => @filter.id.to_s, :status => 200 - end - - # POST /issues/save?id=&[criteria] - def save - verify_post_request - require_parameters :id - - @filter = Internal.issues.updateIssueFilterQuery(params[:id].to_i, criteria_params) - render :text => @filter.id.to_s, :status => 200 - end - - # GET /issues/edit_form/ - def edit_form - require_parameters :id - @filter = find_filter(params[:id].to_i) - render :partial => 'issues/filter_edit_form' - end - - # POST /issues/edit/?name=&description=&shared= - def edit - verify_post_request - - existing_filter = find_filter(params[:id].to_i) - options = {'id' => params[:id].to_s, 'name' => params[:name], 'description' => params[:description], - 'data' => existing_filter.data, 'shared' => params[:shared]=='true', 'user' => params[:user]} - @filter = Internal.issues.updateIssueFilter(options) - render :text => @filter.id.to_s, :status => 200 - end - - # GET /issues/copy_form/ - def copy_form - require_parameters :id - @filter = find_filter(params[:id].to_i) - @filter.setUserLogin(nil) - @filter.setShared(false) - render :partial => 'issues/filter_copy_form' - end - - # POST /issues/copy/?name=&description= - def copy - verify_post_request - - options = {'name' => params[:name], 'description' => params[:description], 'shared' => params[:shared]=='true'} - @filter = Internal.issues.copyIssueFilter(params[:id].to_i, options) - render :text => @filter.id.to_s, :status => 200 - end - - # POST /issues/delete/ - def delete - verify_post_request - require_parameters :id - Internal.issues.deleteIssueFilter(params[:id].to_i) - redirect_to :action => 'manage' - end - - # GET /issues/favourites - def favourites - verify_ajax_request - render :partial => 'issues/filter_favourites' - end - - # POST /issues/toggle_fav/ - def toggle_fav - require_parameters :id - render :text => Internal.issues.toggleFavouriteIssueFilter(params[:id].to_i), :status => 200 - end - # GET /issues/bulk_change_form?[&criteria] def bulk_change_form access_denied unless logged_in? @@ -159,19 +67,6 @@ class IssuesController < ApplicationController private - def init_options - @options_for_statuses = Internal.issues.listStatus().map { |s| [message('issue.status.' + s), s] } - @options_for_resolutions = Internal.issues.listResolutions().map { |s| [message('issue.resolution.' + s), s] } - end - - def load_fav_filters - @favourite_filters = Internal.issues.findFavouriteIssueFiltersForCurrentUser() if logged_in? - end - - def find_filter(id) - Internal.issues.findIssueFilter(id) - end - def criteria_params new_params = params.clone new_params.delete('controller') @@ -179,16 +74,4 @@ class IssuesController < ApplicationController new_params end - def init_params - params['pageSize'] = PAGE_SIZE unless request.xhr? - end - - def issues_query_params_sanitized - Internal.issues.sanitizeFilterQuery(params).to_hash - end - - def issues_query_params_from_filter(filter) - Internal.issues.deserializeFilterQuery(filter).to_hash - end - end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_copy_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_copy_form.html.erb deleted file mode 100644 index ad34992b288..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_copy_form.html.erb +++ /dev/null @@ -1,20 +0,0 @@ -
- -
- - <%= render :partial => 'filter_shared_form' %> - -
-
- diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_edit_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_edit_form.html.erb deleted file mode 100644 index 650e7e19993..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_edit_form.html.erb +++ /dev/null @@ -1,20 +0,0 @@ -
- -
- - <%= render :partial => 'filter_shared_form', :locals => {:display_owner => true} %> - -
-
- diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_favourites.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_favourites.html.erb deleted file mode 100644 index 4c1f60180b8..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_favourites.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -<% if logged_in? %> - { - <% @favourite_filters.each do |filter| %> - "<%= h filter.id -%>": "<%= escape_javascript filter.name -%>", - <% end %> - } -<% else %> - null -<% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_save_as_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_save_as_form.html.erb deleted file mode 100644 index a771f24bd01..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_save_as_form.html.erb +++ /dev/null @@ -1,20 +0,0 @@ -
- -
- - <%= render :partial => 'filter_shared_form' %> - -
-
- diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_shared_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_shared_form.html.erb deleted file mode 100644 index b5e12b9d3aa..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_shared_form.html.erb +++ /dev/null @@ -1,33 +0,0 @@ -<% if !local_assigns.has_key? :display_owner - display_owner = false - end %> -