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;
IssueSearchTest.class,
IssueTrackingTest.class,
IssueWorkflowTest.class,
- IssuesPageTest.class,
NewIssuesMeasureTest.class,
// debt
MaintainabilityMeasureTest.class,
+++ /dev/null
-/*
- * 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);
- }
-}
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';
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();
});
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 () {
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 () {
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();
});
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 () {
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'];
}
if (firstPage) {
this.options.app.state.set({ selectedIndex: 0, page: 1 }, { silent: true });
- this.hideHomePage();
this.closeComponentViewer();
}
const data = this._issuesParameters();
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 });
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;
},
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'),
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();
}
});
+++ /dev/null
-/*
- * 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
- });
- }
-});
-
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 () {
if (this.scroll != null) {
$(window).scrollTop(this.scroll);
}
- },
-
- showHomePage () {
- this.$('.issues').addClass('issues-home-view');
- },
-
- hideHomePage () {
- this.$('.issues').removeClass('issues-home-view');
}
});
+++ /dev/null
-/*
- * 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;
- }
- }
-});
-
+++ /dev/null
-/*
- * 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;
- }
-});
-
':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));
}
});
+++ /dev/null
-{{#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}}
+++ /dev/null
-{{#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}}
<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>
<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>
+++ /dev/null
-<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>
+++ /dev/null
-/*
- * 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
-});
-
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'
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>[¶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=<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?
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')
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
+++ /dev/null
-<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>
+++ /dev/null
-<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>
+++ /dev/null
-<% if logged_in? %>
- {
- <% @favourite_filters.each do |filter| %>
- "<%= h filter.id -%>": "<%= escape_javascript filter.name -%>",
- <% end %>
- }
-<% else %>
- null
-<% end %>
+++ /dev/null
-<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>
+++ /dev/null
-<% 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>
+++ /dev/null
-<% 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>
-
- <a id="edit_<%= filter.name.parameterize -%>" href="<%= ApplicationController.root_context -%>/issues/edit_form/<%= filter.id -%>"
- class="link-action open-modal"><%= message('edit') -%></a>
-
- <%= 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) %>
-
- <a id="edit_shared_<%= filter.name.parameterize -%>" href="<%= ApplicationController.root_context -%>/issues/edit_form/<%= filter.id -%>" class="link-action open-modal"><%= message('edit') -%></a>
-
- <%= 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>
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