]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8376 Do not display issue filters and drop management page
authorStas Vilchik <vilchiks@gmail.com>
Tue, 8 Nov 2016 15:27:54 +0000 (16:27 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Wed, 9 Nov 2016 15:32:17 +0000 (16:32 +0100)
23 files changed:
it/it-tests/src/test/java/it/Category2Suite.java
it/it-tests/src/test/java/it/issue/IssuesPageTest.java [deleted file]
server/sonar-web/src/main/js/apps/component-issues/app.js
server/sonar-web/src/main/js/apps/issues/app.js
server/sonar-web/src/main/js/apps/issues/controller.js
server/sonar-web/src/main/js/apps/issues/filters-view.js [deleted file]
server/sonar-web/src/main/js/apps/issues/layout.js
server/sonar-web/src/main/js/apps/issues/models/filter.js [deleted file]
server/sonar-web/src/main/js/apps/issues/models/filters.js [deleted file]
server/sonar-web/src/main/js/apps/issues/router.js
server/sonar-web/src/main/js/apps/issues/templates/_issues-filter-name.hbs [deleted file]
server/sonar-web/src/main/js/apps/issues/templates/issues-filters.hbs [deleted file]
server/sonar-web/src/main/js/apps/issues/templates/issues-layout.hbs
server/sonar-web/src/main/js/apps/issues/templates/issues-workspace-home.hbs [deleted file]
server/sonar-web/src/main/js/apps/issues/workspace-home-view.js [deleted file]
server/sonar-web/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb
server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_copy_form.html.erb [deleted file]
server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_edit_form.html.erb [deleted file]
server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_favourites.html.erb [deleted file]
server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_save_as_form.html.erb [deleted file]
server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_shared_form.html.erb [deleted file]
server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/manage.html.erb [deleted file]
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 442918c821fef08d4d2ae3c48d5b2388a6b8d718..9c925cf900b6664f71b0bcc6b6f01541801519e1 100644 (file)
@@ -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 (file)
index 5869553..0000000
+++ /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);
-  }
-}
index 7398ccf91054f15ab4fe46943933754f575a1725..a2f24c52aaf9c957cb18b17e2150a8d8c6cceb6f 100644 (file)
@@ -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 () {
index 447e12140f4ca3e4c6f7730a8874fcb93282c766..4c15e33a8c2b01a171990b66912a72acbde6a9b6 100644 (file)
@@ -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 () {
index 4437ebc1367d5d0650cf3ad8a609eece2615e09a..aa5d45d3d0015b2e362bab4d120069196152a4c3 100644 (file)
@@ -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 (file)
index 408d3e5..0000000
+++ /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
-    });
-  }
-});
-
index 5877ff500098b2c19c8c80c1e0163db79c503b7f..1b36f36c231fad113e15df95966aed201c8ef308 100644 (file)
@@ -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 (file)
index b09fdbf..0000000
+++ /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 (file)
index 530002d..0000000
+++ /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;
-  }
-});
-
index eb6c6c4284a6dbb6f1442f4dc7377d85bf47d3c4..1f296e72d736e18f418ab2553b15a27b94ac3e36 100644 (file)
@@ -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 (file)
index ced19a7..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-{{#if filter.name}}
-  {{filter.name}}
-  <span class="note nowrap">
-    {{#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}}
-  </span>
-{{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 (file)
index 74cd306..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-{{#unless state.isContext}}
-  <h1 class="page-title dropdown">
-    <a class="search-navigator-filters-show-list dropdown-toggle" data-toggle="dropdown">
-      <i class="icon-list"></i><span class="issues-filters-name">{{> "_issues-filter-name"}}</span>
-    </a>
-    <ul class="dropdown-menu">
-      {{#each items}}
-        {{#ifCanUseFilter query}}
-          <li>
-            <a class="search-navigator-filters-button search-navigator-filters-filter js-filter" data-id="{{id}}">
-              {{name}}
-            </a>
-          </li>
-        {{/ifCanUseFilter}}
-      {{/each}}
-      {{#if state.canManageFilters}}
-        <li class="divider"></li>
-        <li>
-          <a class="search-navigator-filters-manage" href="{{link "/issues/manage"}}">{{t "manage"}}</a>
-        </li>
-      {{/if}}
-    </ul>
-    {{#if filter.description}}
-      <div class="search-navigator-filters-description">{{filter.description}}</div>
-    {{/if}}
-  </h1>
-
-  <div class="page-actions">
-    <div class="button-group">
-      {{#if state.canManageFilters}}
-        {{#if filter.canModify}}
-          {{#if state.changed}}
-            <button class="js-filter-save" id="issues-filter-save">{{t "save"}}</button>
-          {{/if}}
-        {{/if}}
-
-        {{#unless filter.id}}
-          <button class="js-filter-save-as" id="issues-filter-save-as">{{t "save_as"}}</button>
-        {{/unless}}
-
-        {{#if filter.id}}
-          {{#unless state.changed}}
-            <button class="js-filter-copy" id="issues-filter-copy">{{t "copy"}}</button>
-          {{/unless}}
-        {{/if}}
-
-        {{#if filter.canModify}}
-          {{#if filter.id}}
-            <button class="js-filter-edit" id="issues-filter-edit">{{t "edit"}}</button>
-          {{/if}}
-        {{/if}}
-      {{/if}}
-    </div>
-  </div>
-{{/unless}}
index b84449ae5535f8c5f7cba28f8265cb71ebcff6ae..393845b0394e006243d4386a7bdf95f779e7c69b 100644 (file)
@@ -1,6 +1,8 @@
 <div class="issues search-navigator">
   <div class="search-navigator-side">
-    <div class="search-navigator-filters"></div>
+    <div class="search-navigator-filters">
+      <h1 class="page-title">{{t "issues"}}</h1>
+    </div>
     <div class="search-navigator-facets"></div>
   </div>
 
@@ -8,6 +10,5 @@
     <div class="search-navigator-workspace-header"></div>
     <div class="search-navigator-workspace-list"></div>
     <div class="issues-workspace-component-viewer"></div>
-    <div class="issues-workspace-home"></div>
   </div>
 </div>
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 (file)
index fe32b6b..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<div class="issues-workspace-home-inner">
-  <div>
-    <h2 class="big-spacer-bottom">Start From Filters:</h2>
-
-    <ul>
-      {{#each items}}
-        {{#ifCanUseFilter query}}
-          <li class="text-left spacer-bottom">
-            <i class="icon-favorite little-spacer-right" {{#unless favorite}}style="visibility: hidden;"{{/unless}}></i>
-
-            <a href="#id={{id}}">{{name}}</a>
-
-            {{#if shared}}
-              <span class="note nowrap">[{{t "issue_filter.shared"}}]</span>
-            {{/if}}
-          </li>
-        {{/ifCanUseFilter}}
-      {{/each}}
-    </ul>
-  </div>
-
-  <div class="big-spacer-top">
-    or make a
-    <a href="#resolved=false" class="button spacer-left">{{t 'issues.home.new_search'}}</a>
-  </div>
-</div>
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 (file)
index ae3c99a..0000000
+++ /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
-});
-
index 6570ff3b606cc433b651049b661e3617f9b18284..8303cd1c33c7ddd348ed1d2117f6ffa75d59cc42 100644 (file)
@@ -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=<name>[&parameters]
-  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=<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/<filter id>
-  def edit_form
-    require_parameters :id
-    @filter = find_filter(params[:id].to_i)
-    render :partial => 'issues/filter_edit_form'
-  end
-
-  # POST /issues/edit/<filter id>?name=<name>&description=<description>&shared=<true|false>
-  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/<filter id>
-  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/<filter id>?name=<copy name>&description=<copy 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/<filter id>
-  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/<filter id>
-  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 (file)
index ad34992..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<form id="copy-filter-form" method="post" action="<%= ApplicationController.root_context -%>/issues/copy">
-  <input type="hidden" name="id" value="<%= @filter.id -%>">
-  <fieldset>
-    <div class="modal-head">
-      <h2><%= message('issue_filter.copy_filter') -%></h2>
-    </div>
-    <%= render :partial => 'filter_shared_form' %>
-    <div class="modal-foot">
-      <input type="submit" value="<%= message('copy') -%>" id="copy-submit" class="issue-filter"/>
-      <a href="#" onclick="return closeModalWindow()" id="copy-cancel"><%= h message('cancel') -%></a>
-    </div>
-  </fieldset>
-</form>
-<script>
-  $j("#copy-filter-form").modalForm({
-    success: function (data) {
-      return onCopy(data);
-    }
-  });
-</script>
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 (file)
index 650e7e1..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<form id="edit-filter-form" method="post" action="<%= ApplicationController.root_context -%>/issues/edit">
-  <input type="hidden" name="id" value="<%= @filter.id -%>">
-  <fieldset>
-    <div class="modal-head">
-      <h2><%= message('issue_filter.edit_filter') -%></h2>
-    </div>
-    <%= render :partial => 'filter_shared_form', :locals => {:display_owner => true} %>
-    <div class="modal-foot">
-      <input type="submit" value="<%= message('save') -%>" id="save-submit" class="issue-filter"/>
-      <a href="#" onclick="return closeModalWindow()" id="save-cancel"><%= message('cancel') -%></a>
-    </div>
-  </fieldset>
-</form>
-<script>
-  $j("#edit-filter-form").modalForm({
-    success: function (data) {
-      return onEdit(data);
-    }
-  });
-</script>
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 (file)
index 4c1f601..0000000
+++ /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 (file)
index a771f24..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<form id="save-as-filter-form" method="post" action="<%= ApplicationController.root_context -%>/issues/save_as">
-  <input type="hidden" name="data" value="<%= u(@filter_query_serialized) -%>">
-  <fieldset>
-    <div class="modal-head">
-      <h2><%= message('issue_filter.save_filter') -%></h2>
-    </div>
-    <%= render :partial => 'filter_shared_form' %>
-    <div class="modal-foot">
-      <input type="submit" value="<%= message('save') -%>" id="save-as-submit" class="issue-filter"/>
-      <a href="#" onclick="return closeModalWindow()" id="save-as-cancel"><%= message('cancel') -%></a>
-    </div>
-  </fieldset>
-</form>
-<script>
-  $j("#save-as-filter-form").modalForm({
-    success: function (data) {
-      return onSaveAs(data);
-    }
-  });
-</script>
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 (file)
index b5e12b9..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<% if !local_assigns.has_key? :display_owner
-     display_owner = false
-   end %>
-<div class="modal-body">
-  <div class="modal-error"/>
-  <div class="modal-field">
-    <label for="name"><%= message('issue_filter.form.name') -%> <em class="mandatory">*</em></label>
-    <input id="name" name="name" type="text" size="50" maxlength="100" value="<%= h(@filter.name) if @filter -%>" autofocus="autofocus"/>
-  </div>
-  <div class="modal-field">
-    <label for="description"><%= message('issue_filter.form.description') -%></label>
-    <input id="description" name="description" type="text" size="50" maxlength="4000" value="<%= h(@filter.description) if @filter  -%>"/>
-  </div>
-  <% if display_owner && can_be_reassigned_by(current_user, @filter) %>
-    <% filter_owner = Api.users.findByLogin(@filter.userLogin) %>
-    <div class="modal-field">
-      <label for="user"><%= h message('issue_filter.form.owner') -%></label>
-      <%= user_select_tag('user', :html_id => 'select-filter-owner', :selected_user => filter_owner) -%>
-    </div>
-  <% else %>
-    <input id="user" name="user" type="hidden" value="<%= h(@filter.userLogin) if @filter -%>"/>
-  <% end %>
-  <% if Internal.issues.canUserShareIssueFilter() %>
-    <div class="modal-field">
-      <% if !@filter || @filter.userLogin.nil? || @filter.userLogin == current_user.login %>
-        <label for="shared"><%= message('issue_filter.form.share') -%></label>
-        <input id="shared" name="shared" type="checkbox" value="true" <%= 'checked' if (@filter && @filter.shared) -%>/>
-      <% else %>
-        <input id="shared" name="shared" type="hidden" value="<%= @filter.shared if @filter -%>"/>
-      <% end %>
-    </div>
-  <% end %>
-</div>
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/manage.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/manage.html.erb
deleted file mode 100644 (file)
index 6f069b6..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-<% content_for :script do %>
-  <script>
-    $j(document).ready(function () {
-      $j(".issue-filter-star").click(function () {
-        var filterId = $j(this).attr('filter-id');
-        var star = $j(this);
-        $j.ajax({
-          type: 'POST',
-          url: window.baseUrl + "/issues/toggle_fav",
-          data: {id: filterId},
-          success: function (data) {
-            if (data == 'true') {
-              star.removeClass('icon-not-favorite').addClass('icon-favorite');
-              star.attr('title', '<%= escape_javascript message('click_to_remove_from_favorites') -%>');
-            } else {
-              star.removeClass('icon-favorite').addClass('icon-not-favorite');
-              star.attr('title', '<%= escape_javascript message('click_to_add_to_favorites') -%>');
-            }
-            $j('#sidebar-favourites').load(baseUrl + '/issues/favourites');
-          }
-        });
-      });
-    });
-
-    function onSaveAs(data) {
-      window.location = window.baseUrl + '/issues/search#id=' + data;
-    }
-
-    function onCopy(data) {
-      window.location = window.baseUrl + '/issues/search#id=' + data;
-    }
-
-    function onEdit(data) {
-      window.location = window.baseUrl + '/issues/search#id=' + data;
-    }
-  </script>
-<% end %>
-<div>
-  <div class="page">
-    <h1><%= message 'issue_filter.manage.my_filters' -%></h1>
-    <table class="data marginbottom10" id="my-issue-filters">
-      <thead>
-      <tr>
-        <th class="thin"></th>
-        <th><%= message('issue_filter.form.name') -%></th>
-        <th><%= message('issue_filter.sharing') -%></th>
-        <th class="text-right"><%= message('operations') -%></th>
-      </tr>
-      </thead>
-      <tbody>
-      <% if @filters.empty? %>
-        <tr class="even">
-          <td colspan="4"><%= message('issue_filter.no_filters') -%></td>
-        </tr>
-      <% else %>
-        <% @filters.each do |filter| %>
-          <tr id="my-issue-filter-<%= filter.name.parameterize -%>" class="<%= cycle('even', 'odd', :name => 'my-filters') -%>">
-            <td>
-              <%= issue_filter_star(filter, @favourite_filter_ids.include?(filter.id)) -%>
-            </td>
-            <td>
-              <a href="<%= ApplicationController.root_context -%>/issues/search#id=<%= h filter.id -%>"><%= h filter.name -%></a>
-              <% if filter.description %>
-                <div class="note"><%= h filter.description -%></div>
-              <% end %>
-            </td>
-            <td>
-              <% if filter.shared %>
-                <%= message 'issue_filter.shared_with_all_users' -%>
-              <% else %>
-                <%= message 'issue_filter.private' -%>
-              <% end %>
-            </td>
-            <td class="thin nowrap text-right">
-              <a id="copy-<%= filter.name.parameterize -%>" href="<%= ApplicationController.root_context -%>/issues/copy_form/<%= filter.id -%>"
-                 class="link-action open-modal"><%= message('copy') -%></a>
-              &nbsp;
-              <a id="edit_<%= filter.name.parameterize -%>" href="<%= ApplicationController.root_context -%>/issues/edit_form/<%= filter.id -%>"
-                 class="link-action open-modal"><%= message('edit') -%></a>
-              &nbsp;
-              <%= link_to_action message('delete'), "#{ApplicationController.root_context}/issues/delete/#{filter.id}",
-                                 :class => 'link-action link-red',
-                                 :id => "delete_#{filter.name.parameterize}",
-                                 :confirm_button => message('delete'),
-                                 :confirm_title => 'issue_filter.delete_confirm_title',
-                                 :confirm_msg => 'issue_filter.are_you_sure_want_delete_filter_x',
-                                 :confirm_msg_params => [filter.name] -%>
-            </td>
-          </tr>
-        <% end %>
-      <% end %>
-      </tbody>
-    </table>
-
-    <br/>
-
-    <h1><%= message 'issue_filter.manage.shared_filters' -%></h1>
-    <table class="data" id="shared-filters">
-      <thead>
-      <tr>
-        <th class="thin"></th>
-        <th><%= message('issue_filter.form.name') -%></th>
-        <th><%= message('shared_by') -%></th>
-        <th class="text-right"><%= message('operations') -%></th>
-      </tr>
-      </thead>
-      <tbody>
-      <% if @shared_filters.empty? %>
-        <tr class="even">
-          <td colspan="4"><%= message('issue_filter.no_filters') -%></td>
-        </tr>
-      <% else %>
-        <% @shared_filters.each do |filter| %>
-          <tr id="shared-<%= filter.name.parameterize -%>" class="<%= cycle('even', 'odd', :name => 'shared-filters') -%>">
-            <td>
-              <%= issue_filter_star(filter, @favourite_filter_ids.include?(filter.id)) -%>
-            </td>
-            <td>
-              <a href="<%= ApplicationController.root_context -%>/issues/search#id=<%= h filter.id -%>|<%= h filter.data -%>"><%= h filter.name -%></a>
-              <% if filter.description %>
-                <div class="note"><%= h filter.description -%></div>
-              <% end %>
-            </td>
-            <td>
-              <%= filter.userLogin ? h(Api.users.findByLogin(filter.userLogin).name) : '[SonarQube]' -%>
-            </td>
-            <td class="thin nowrap text-right">
-              <a id="copy-<%= filter.name.parameterize -%>" href="<%= ApplicationController.root_context -%>/issues/copy_form/<%= filter.id -%>" class="link-action open-modal"><%= message('copy') -%></a>
-              <% if has_role?(:admin) %>
-                &nbsp;
-                <a id="edit_shared_<%= filter.name.parameterize -%>" href="<%= ApplicationController.root_context -%>/issues/edit_form/<%= filter.id -%>" class="link-action open-modal"><%= message('edit') -%></a>
-                &nbsp;
-                <%= link_to_action message('delete'), "#{ApplicationController.root_context}/issues/delete/#{filter.id}",
-                                   :class => 'link-action link-red',
-                                   :id => "delete_system_#{filter.name.parameterize}",
-                                   :confirm_button => message('delete'),
-                                   :confirm_title => 'issue_filter.delete_confirm_title',
-                                   :confirm_msg => 'issue_filter.are_you_sure_want_delete_filter_x',
-                                   :confirm_msg_params => [filter.name] -%>
-              <% end %>
-            </td>
-          </tr>
-        <% end %>
-      <% end %>
-      </tbody>
-    </table>
-
-  </div>
-</div>
index 17d218a079f92560aca3a52097922b2c7d9d2e0f..51ab6dc4f8b579a088b74b05dff3791191c9726d 100644 (file)
@@ -806,10 +806,6 @@ issue_filter.form.owner=Owner
 issue_filter.more_criteria=+ More Criteria
 issue_filter.favourite_filters=Favourite Filters
 issue_filter.manage.my_filters=My Issues Filters
-issue_filter.manage.shared_filters=Shared Issues Filters
-issue_filter.no_filters=No filters
-issue_filter.delete_confirm_title=Delete Filter
-issue_filter.are_you_sure_want_delete_filter_x=Are you sure that you want to delete the filter "{0}"?
 issue_filter.private=Private
 issue_filter.shared=Shared
 issue_filter.shared_with_all_users=Shared with all users