]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7469 SONAR-7202 SONAR-7201 Remove action plan from the UI
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Thu, 24 Mar 2016 17:28:36 +0000 (18:28 +0100)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Fri, 25 Mar 2016 14:02:45 +0000 (15:02 +0100)
24 files changed:
server/sonar-web/src/main/js/apps/issues/controller.js
server/sonar-web/src/main/js/apps/issues/facets-view.js
server/sonar-web/src/main/js/apps/issues/facets/action-plan-facet.js [deleted file]
server/sonar-web/src/main/js/apps/issues/models/issues.js
server/sonar-web/src/main/js/apps/issues/models/state.js
server/sonar-web/src/main/js/apps/issues/templates/facets/issues-action-plan-facet.hbs [deleted file]
server/sonar-web/src/main/js/apps/issues/templates/issues-issue-filter-form.hbs
server/sonar-web/src/main/js/apps/issues/workspace-list-item-view.js
server/sonar-web/src/main/js/components/issue/collections/action-plans.js [deleted file]
server/sonar-web/src/main/js/components/issue/collections/issues.js
server/sonar-web/src/main/js/components/issue/issue-view.js
server/sonar-web/src/main/js/components/issue/models/issue.js
server/sonar-web/src/main/js/components/issue/templates/issue.hbs
server/sonar-web/src/main/js/components/issue/views/plan-form-view.js [deleted file]
server/sonar-web/src/main/js/components/source-viewer/main.js
server/sonar-web/src/main/js/main/nav/component/component-nav-menu.js
server/sonar-web/src/main/js/widgets/issue-filter/templates/widget-issue-filter-action-plans.hbs [deleted file]
server/sonar-web/src/main/js/widgets/issue-filter/widget.js
server/sonar-web/src/main/webapp/WEB-INF/app/controllers/action_plans_controller.rb [deleted file]
server/sonar-web/src/main/webapp/WEB-INF/app/views/action_plans/_create_form.html.erb [deleted file]
server/sonar-web/src/main/webapp/WEB-INF/app/views/action_plans/_edit_form.html.erb [deleted file]
server/sonar-web/src/main/webapp/WEB-INF/app/views/action_plans/_progress.html.erb [deleted file]
server/sonar-web/src/main/webapp/WEB-INF/app/views/action_plans/index.html.erb [deleted file]
server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_bulk_change_form.html.erb

index 07ead890dbd0be39aaa732d203cd765a54ef9224..bbca2009db9ee13c33c9451236cca7787029725c 100644 (file)
@@ -24,7 +24,7 @@ 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', 'actionPlans', 'languages'];
+const FACET_DATA_FIELDS = ['components', 'users', 'rules', 'languages'];
 
 export default Controller.extend({
   _facetsFromServer () {
index 6a27534a049f9736a782ec0f5280a35ecd2fdd40..ef1f4030170f9d2f187db1c227ad9ef7edb40e1c 100644 (file)
@@ -29,7 +29,6 @@ import RuleFacet from './facets/rule-facet';
 import TagFacet from './facets/tag-facet';
 import ResolutionFacet from './facets/resolution-facet';
 import CreationDateFacet from './facets/creation-date-facet';
-import ActionPlanFacet from './facets/action-plan-facet';
 import FileFacet from './facets/file-facet';
 import ReporterFacet from './facets/reporter-facet';
 import LanguageFacet from './facets/language-facet';
@@ -49,7 +48,6 @@ const viewsMapping = {
   moduleUuids: ModuleFacet,
   rules: RuleFacet,
   tags: TagFacet,
-  actionPlans: ActionPlanFacet,
   fileUuids: FileFacet,
   reporters: ReporterFacet,
   languages: LanguageFacet,
diff --git a/server/sonar-web/src/main/js/apps/issues/facets/action-plan-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/action-plan-facet.js
deleted file mode 100644 (file)
index 589329b..0000000
+++ /dev/null
@@ -1,85 +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 BaseFacet from './base-facet';
-import Template from '../templates/facets/issues-action-plan-facet.hbs';
-
-export default BaseFacet.extend({
-  template: Template,
-
-  onRender () {
-    BaseFacet.prototype.onRender.apply(this, arguments);
-    const value = this.options.app.state.get('query').planned;
-    if ((value != null) && (!value || value === 'false')) {
-      return this.$('.js-facet').filter('[data-unplanned]').addClass('active');
-    }
-  },
-
-  toggleFacet (e) {
-    const unplanned = $(e.currentTarget).is('[data-unplanned]');
-    $(e.currentTarget).toggleClass('active');
-    if (unplanned) {
-      const checked = $(e.currentTarget).is('.active');
-      const value = checked ? 'false' : null;
-      return this.options.app.state.updateFilter({
-        planned: value,
-        actionPlans: null
-      });
-    } else {
-      return this.options.app.state.updateFilter({
-        planned: null,
-        actionPlans: this.getValue()
-      });
-    }
-  },
-
-  getValuesWithLabels () {
-    const values = this.model.getValues();
-    const actionPlans = this.options.app.facets.actionPlans;
-    values.forEach(function (v) {
-      const key = v.val;
-      let label = null;
-      if (key) {
-        const actionPlan = _.findWhere(actionPlans, { key });
-        if (actionPlan != null) {
-          label = actionPlan.name;
-        }
-      }
-      v.label = label;
-    });
-    return values;
-  },
-
-  disable () {
-    return this.options.app.state.updateFilter({
-      planned: null,
-      actionPlans: null
-    });
-  },
-
-  serializeData () {
-    return _.extend(BaseFacet.prototype.serializeData.apply(this, arguments), {
-      values: this.getValuesWithLabels()
-    });
-  }
-});
-
-
index bf64834b6a71e4420e662247bdcfa86e8df9f8b6..6cf78fc7bf6ba524f26359fec3031d3365ee633d 100644 (file)
@@ -89,7 +89,6 @@ export default Backbone.Collection.extend({
       issue = that._injectRelational(issue, r.rules, 'rule', 'key');
       issue = that._injectRelational(issue, r.users, 'assignee', 'login');
       issue = that._injectRelational(issue, r.users, 'reporter', 'login');
-      issue = that._injectRelational(issue, r.actionPlans, 'actionPlan', 'key');
       issue = that._injectCommentsRelational(issue, r.users);
       issue = that._prepareClosed(issue);
       issue = that.ensureTextRange(issue);
index 26c08a44b5fbf1385b7444100f733c7048daa6a3..049f657f1211eeff5bb47b3438907abd834a5739 100644 (file)
@@ -44,15 +44,13 @@ export default State.extend({
       'assignees',
       'reporters',
       'authors',
-      'languages',
-      'actionPlans'
+      'languages'
     ],
     facetsFromServer: [
       'types',
       'severities',
       'statuses',
       'resolutions',
-      'actionPlans',
       'projectUuids',
       'directories',
       'rules',
@@ -68,7 +66,6 @@ export default State.extend({
     transform: {
       'resolved': 'resolutions',
       'assigned': 'assignees',
-      'planned': 'actionPlans',
       'createdBefore': 'createdAt',
       'createdAfter': 'createdAt',
       'createdInLast': 'createdAt'
diff --git a/server/sonar-web/src/main/js/apps/issues/templates/facets/issues-action-plan-facet.hbs b/server/sonar-web/src/main/js/apps/issues/templates/facets/issues-action-plan-facet.hbs
deleted file mode 100644 (file)
index 25dace0..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-{{> "_issues-facet-header"}}
-
-<div class="search-navigator-facet-list">
-  {{#each values}}
-    {{#eq val ""}}
-      {{! unplanned }}
-      <a class="facet search-navigator-facet js-facet" data-unplanned title="{{t "issue.unplanned"}}">
-        <span class="facet-name">{{t "issue.unplanned"}}</span>
-        <span class="facet-stat">
-          {{formatFacetValue count ../../state.facetMode}}
-        </span>
-      </a>
-    {{else}}
-      <a class="facet search-navigator-facet js-facet" data-value="{{val}}" title="{{label}}">
-        <span class="facet-name">{{label}}</span>
-        <span class="facet-stat">
-          {{formatFacetValue count ../../state.facetMode}}
-        </span>
-      </a>
-    {{/eq}}
-  {{/each}}
-</div>
index 1f37beb04ed065f5e6bbedc06f969b163f72ad34..58764e595435be04fb835cecc9d17038378c6a17 100644 (file)
     {{/if}}
   </li>
 
-  <li>
-    {{#if actionPlan}}
-      <a href="#" data-property="actionPlans" data-value="{{actionPlan}}">
-        {{t "issue.planned_for"}} {{actionPlanName}}
-      </a>
-    {{else}}
-      <a href="#" data-property="planned" data-value="false">
-        {{t "issue.unplanned"}}
-      </a>
-    {{/if}}
-  </li>
-
   <li class="divider"></li>
 
   <li>
index ff9a75d095ffa291249cb9238dc1de983fe9fc2a..eef64f22edd5fc28dc661f8fbbb5f6c90302d9b6 100644 (file)
@@ -29,9 +29,7 @@ const SHOULD_NULL = {
   resolutions: ['resolved'],
   resolved: ['resolutions'],
   assignees: ['assigned'],
-  assigned: ['assignees'],
-  actionPlans: ['planned'],
-  planned: ['actionPlans']
+  assigned: ['assignees']
 };
 
 export default IssueView.extend({
diff --git a/server/sonar-web/src/main/js/components/issue/collections/action-plans.js b/server/sonar-web/src/main/js/components/issue/collections/action-plans.js
deleted file mode 100644 (file)
index 5218f57..0000000
+++ /dev/null
@@ -1,32 +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.Collection.extend({
-  url () {
-    return '/api/action_plans/search';
-  },
-
-  parse (r) {
-    return r.actionPlans;
-  }
-});
-
-
index d8223896252f28db914d3a909a643fd52e03f5e4..f13415e83d177869dbf5285ed54d88364564a2e7 100644 (file)
@@ -96,7 +96,6 @@ export default Backbone.Collection.extend({
       issue = that._injectRelational(issue, r.rules, 'rule', 'key');
       issue = that._injectRelational(issue, r.users, 'assignee', 'login');
       issue = that._injectRelational(issue, r.users, 'reporter', 'login');
-      issue = that._injectRelational(issue, r.actionPlans, 'actionPlan', 'key');
       issue = that._injectCommentsRelational(issue, r.users);
       issue = that._prepareClosed(issue);
       issue = that.ensureTextRange(issue);
index 9a4fb2e7849825ac13839a2e624f6c9a4197a345..82594682e0f715b5ba91c08c173ea66f603f4d5a 100644 (file)
@@ -23,11 +23,9 @@ import Backbone from 'backbone';
 import Marionette from 'backbone.marionette';
 import ChangeLog from './models/changelog';
 import ChangeLogView from './views/changelog-view';
-import ActionPlans from './collections/action-plans';
 import TransitionsFormView from './views/transitions-form-view';
 import AssignFormView from './views/assign-form-view';
 import CommentFormView from './views/comment-form-view';
-import PlanFormView from './views/plan-form-view';
 import SetSeverityFormView from './views/set-severity-form-view';
 import SetTypeFormView from './views/set-type-form-view';
 import TagsFormView from './views/tags-form-view';
@@ -214,26 +212,6 @@ export default Marionette.ItemView.extend({
     view.destroy();
   },
 
-  plan (e) {
-    const that = this;
-    const t = $(e.currentTarget);
-    const actionPlans = new ActionPlans();
-    return actionPlans.fetch({
-      reset: true,
-      data: { project: this.model.get('project') }
-    }).done(function () {
-      e.stopPropagation();
-      $('body').click();
-      that.popup = new PlanFormView({
-        triggerEl: t,
-        bottom: true,
-        model: that.model,
-        collection: actionPlans
-      });
-      that.popup.render();
-    });
-  },
-
   showRule () {
     const ruleKey = this.model.get('rule');
     Workspace.openRule({ key: ruleKey });
index 637c78b49c0d2bb591b5a959aaeb5b1ac2af0bf0..7976ba534499abec2f65ae19d549b9ba53db8a84 100644 (file)
@@ -46,7 +46,6 @@ export default Backbone.Model.extend({
       issue = this._injectRelational(issue, r.rules, 'rule', 'key');
       issue = this._injectRelational(issue, r.users, 'assignee', 'login');
       issue = this._injectRelational(issue, r.users, 'reporter', 'login');
-      issue = this._injectRelational(issue, r.actionPlans, 'actionPlan', 'key');
       issue = this._injectCommentsRelational(issue, r.users);
       issue = this._prepareClosed(issue);
       issue = this.ensureTextRange(issue);
index 6ed51a13a82c7457e7d9229cf51141e05480e2da..eb469e40c5fc2d238b95c522bc39bde7f32acbea 100644 (file)
             {{/inArray}}
           </li>
 
-          <li class="issue-meta">
-            {{#inArray actions "plan"}}
-              <button class="button-link issue-action issue-action-with-options js-issue-plan">
-          <span
-              class="issue-meta-label">{{#if actionPlan}}{{default actionPlanName actionPlan}}{{else}}{{t 'issue.unplanned'}}{{/if}}</span>&nbsp;<i
-                  class="icon-dropdown"></i>
-              </button>
-            {{else}}
-              <span
-                  class="issue-meta-label">{{#if actionPlan}}{{default actionPlanName actionPlan}}{{else}}{{t 'issue.unplanned'}}{{/if}}</span>
-            {{/inArray}}
-          </li>
-
           {{#if debt}}
             <li class="issue-meta">
               <span class="issue-meta-label">
diff --git a/server/sonar-web/src/main/js/components/issue/views/plan-form-view.js b/server/sonar-web/src/main/js/components/issue/views/plan-form-view.js
deleted file mode 100644 (file)
index 19daabb..0000000
+++ /dev/null
@@ -1,57 +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 ActionOptionsView from '../../common/action-options-view';
-import Template from '../templates/issue-plan-form.hbs';
-import { translate } from '../../../helpers/l10n';
-
-export default ActionOptionsView.extend({
-  template: Template,
-
-  getActionPlan () {
-    return this.model.get('actionPlan') || '';
-  },
-
-  selectInitialOption () {
-    this.makeActive(this.getOptions().filter(`[data-value="${this.getActionPlan()}"]`));
-  },
-
-  selectOption (e) {
-    const actionPlan = $(e.currentTarget).data('value');
-    const actionPlanName = $(e.currentTarget).data('text');
-    this.submit(actionPlan, actionPlanName);
-    return ActionOptionsView.prototype.selectOption.apply(this, arguments);
-  },
-
-  submit (actionPlan) {
-    return this.model.plan(actionPlan);
-  },
-
-  getActionPlans () {
-    return [{ key: '', name: translate('issue.unplanned') }].concat(this.collection.toJSON());
-  },
-
-  serializeData () {
-    return _.extend(ActionOptionsView.prototype.serializeData.apply(this, arguments), {
-      items: this.getActionPlans()
-    });
-  }
-});
index 58db3aa9ea92672b1d459f8763af4aaf257e6dd1..85f628c27516e10a1bae8d4ccee2cf85fd627dfb 100644 (file)
@@ -284,8 +284,8 @@ export default Marionette.LayoutView.extend({
       data: {
         componentUuids: this.model.id,
         f: 'component,componentId,project,subProject,rule,status,resolution,author,reporter,assignee,debt,' +
-        'line,message,severity,actionPlan,creationDate,updateDate,closeDate,tags,comments,attr,actions,' +
-        'transitions,actionPlanName',
+        'line,message,severity,creationDate,updateDate,closeDate,tags,comments,attr,actions,' +
+        'transitions',
         additionalFields: '_all',
         resolved: false,
         s: 'FILE_LINE',
index eb7223ab3f37e4d0487fd7ab48ff1860f1168fec..bab9e9325e01e591982fba0b29efb43f8b65c974 100644 (file)
@@ -177,7 +177,6 @@ export default React.createClass({
 
   renderAdministration() {
     const shouldShowAdministration =
-        this.props.conf.showActionPlans ||
         this.props.conf.showBackgroundTasks ||
         this.props.conf.showDeletion ||
         this.props.conf.showHistory ||
@@ -206,7 +205,6 @@ export default React.createClass({
             {this.renderProfilesLink()}
             {this.renderQualityGatesLink()}
             {this.renderCustomMeasuresLink()}
-            {this.renderActionPlansLink()}
             {this.renderLinksLink()}
             {this.renderPermissionsLink()}
             {this.renderHistoryLink()}
@@ -251,14 +249,6 @@ export default React.createClass({
     return this.renderLink(url, translate('custom_measures.page'), '/custom_measures');
   },
 
-  renderActionPlansLink() {
-    if (!this.props.conf.showActionPlans) {
-      return null;
-    }
-    const url = `/action_plans?id=${encodeURIComponent(this.props.component.key)}`;
-    return this.renderLink(url, translate('action_plans.page'), '/action_plans');
-  },
-
   renderLinksLink() {
     if (!this.props.conf.showLinks) {
       return null;
diff --git a/server/sonar-web/src/main/js/widgets/issue-filter/templates/widget-issue-filter-action-plans.hbs b/server/sonar-web/src/main/js/widgets/issue-filter/templates/widget-issue-filter-action-plans.hbs
deleted file mode 100644 (file)
index b5c9328..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<table class="data zebra">
-  {{> '_widget-issue-filter-total'}}
-  {{#each items}}
-    <tr>
-      <td>
-        {{#eq val ''}}
-          <a href="{{issueFilterItemLink ../../parsedQuery 'planned' 'false' ../../displayMode}}">{{t 'issue.unplanned'}}</a>
-        {{else}}
-          <a href="{{issueFilterItemLink ../../parsedQuery 'actionPlans' val ../../displayMode}}">{{default label val}}</a>
-        {{/eq}}
-      </td>
-      <td class="text-right nowrap">
-        {{#notNull ../periodDate}}+{{/notNull}}{{issueFilterValue count ../displayMode}}
-      </td>
-      <td class="barchart">
-        <div class="barchart" style="width: 100%;">
-          <div style="width: {{percent count ../total}};"></div>
-        </div>
-      </td>
-    </tr>
-  {{/each}}
-</table>
-
-{{#if maxResultsReached}}
-  {{> '_widget-issue-filter-limit'}}
-{{/if}}
index 9aa78fa94bffec425ac465a652731631442b348e..82cae89822d75cb3e3f9a008b99cf4a4327c2ae3 100644 (file)
@@ -24,7 +24,6 @@ import Backbone from 'backbone';
 import Marionette from 'backbone.marionette';
 
 import Template from './templates/widget-issue-filter.hbs';
-import ActionPlansTemplate from './templates/widget-issue-filter-action-plans.hbs';
 import AssigneesTemplate from './templates/widget-issue-filter-assignees.hbs';
 import ResolutionsTemplate from './templates/widget-issue-filter-resolutions.hbs';
 import SeveritiesTemplate from './templates/widget-issue-filter-severities.hbs';
@@ -165,24 +164,6 @@ const byDistributionConf = {
       }
     }
   },
-  'actionPlans': {
-    template: ActionPlansTemplate,
-    label (item, r) {
-      if (_.isArray(r.actionPlans)) {
-        const actionPlan = _.findWhere(r.actionPlans, { key: item.val });
-        if (actionPlan != null) {
-          return actionPlan.name;
-        }
-      }
-    },
-    filter (item) {
-      if ('' + this.query.planned === 'false') {
-        return item.val === '';
-      } else {
-        return defaultFilter.call(this, item);
-      }
-    }
-  },
   'createdAt': {
     comparator (item) {
       return -moment(item.val).unix();
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/action_plans_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/action_plans_controller.rb
deleted file mode 100644 (file)
index cc19037..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-#
-# SonarQube, open source software quality management tool.
-# Copyright (C) 2008-2014 SonarSource
-# mailto:contact AT sonarsource DOT com
-#
-# SonarQube is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 3 of the License, or (at your option) any later version.
-#
-# SonarQube is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-#
-
-class ActionPlansController < ApplicationController
-
-  SECTION=Navigation::SECTION_RESOURCE
-  before_filter :load_resource
-
-  def index
-    load_action_plans()
-  end
-
-  def create_form
-    load_action_plans()
-    render :partial => 'action_plans/create_form'
-  end
-
-  def edit_form
-    @action_plan = find_by_key(params[:plan_key])
-    load_action_plans()
-    render :partial => 'action_plans/edit_form'
-  end
-
-  def edit
-    verify_post_request
-    options = {'project' => @resource.key, 'name' => params[:name], 'description' => params[:description], 'deadLine' => params[:deadline]}
-
-    action_plan_result = Internal.issues.updateActionPlan(params[:plan_key], options)
-
-    if action_plan_result.ok()
-      @action_plan = action_plan_result.get()
-      flash[:notice] = 'Successfully edited.'
-      render :text => 'ok', :status => 200
-    else
-      render :text => action_plan_result.errors().map{|error| error.text ? error.text : Api::Utils.message(error.l10nKey, :params => error.l10nParams)}.join('<br/>'),
-             :status => 400
-    end
-  end
-
-  def save
-    verify_post_request
-    options = {'project' => @resource.key, 'name' => params[:name], 'description' => params[:description], 'deadLine' => params[:deadline]}
-
-    action_plan_result = Internal.issues.createActionPlan(options)
-
-    if action_plan_result.ok()
-      @action_plan = action_plan_result.get()
-      flash[:notice] = 'Successfully created.'
-      render :text => 'ok', :status => 200
-    else
-      render :text => action_plan_result.errors().map{|error| error.text ? error.text : Api::Utils.message(error.l10nKey, :params => error.l10nParams)}.join('<br/>'),
-             :status => 400
-    end
-  end
-
-  def delete
-    verify_post_request
-    Internal.issues.deleteActionPlan(params[:plan_key])
-    flash[:notice] = 'Successfully deleted.'
-    redirect_to :action => 'index', :id => @resource.id
-  end
-
-  def change_status
-    verify_post_request
-    action_plan = find_by_key(params[:plan_key])
-    if action_plan
-      if action_plan.status == 'OPEN'
-        Internal.issues.closeActionPlan(params[:plan_key])
-      else
-        Internal.issues.openActionPlan(params[:plan_key])
-      end
-    end
-    redirect_to :action => 'index', :id => @resource.id
-  end
-
-  private
-
-  def load_resource
-    @resource=Project.by_key(params[:id])
-    return redirect_to(home_path) unless @resource
-    access_denied unless has_role?(:admin, @resource)
-    @snapshot=@resource.last_snapshot
-  end
-
-  def load_action_plans
-    action_plans = Internal.issues.findActionPlanStats(@resource.key)
-    @open_action_plans = action_plans.select {|plan| plan.isOpen()}
-    @closed_action_plans = action_plans.reject {|plan| plan.isOpen()}
-    users = Api.users.find('logins' => (@open_action_plans + @closed_action_plans).collect {|action_plan| action_plan.userLogin()}.join(","))
-    @users = Hash[users.collect { |user| [user.login(), user.name()] }]
-  end
-
-  def find_by_key(key)
-    Internal.issues.findActionPlan(key)
-  end
-
-end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/action_plans/_create_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/action_plans/_create_form.html.erb
deleted file mode 100644 (file)
index cb0b798..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<form action="<%= url_for :action => 'save' -%>" method="POST" id="create-action-plan-form">
-  <input type="hidden" name="id" value="<%= @resource.id -%>"/>
-  <input type="hidden" name="plan_key" value="<%= @action_plan.key() if @action_plan -%>"/>
-
-  <fieldset>
-      <div class="modal-head">
-          <h2><%=message('action_plans.create_form_title') -%></h2>
-      </div>
-      <div class="modal-body">
-          <div class="modal-error"></div>
-
-          <div class="modal-field">
-              <label for="user[login]"><%= message('action_plans.col.name') -%> <em class="mandatory">*</em></label>
-              <input type="text" name="name" id="name" value="<%= @action_plan ? @action_plan.name() : params[:name] -%>"/><br/>
-          </div>
-          <div class="modal-field">
-              <label for="user[login]"> <%= message('action_plans.col.due_for') -%> </label>
-              <input type="text" name="deadline" id="deadline" value="<%= @action_plan && @action_plan.deadLine() ? Api::Utils.format_date(@action_plan.deadLine()) : params[:deadline] -%>"/>
-              <br/>
-              <span class="note"><%= message('action_plans.date_format_help') -%></span>
-              <br/>
-          </div>
-          <div class="modal-field">
-              <label for="user[login]"><%= message('action_plans.col.description') -%> </label>
-              <textarea rows="5" cols="80" name="description" id="description" class="width100"><%= @action_plan ? @action_plan.description() : params['description'] -%></textarea>
-          </div>
-       </div>
-
-      <div class="modal-foot">
-          <input type="submit" value="<%= h(message('create')) -%>"/>
-          <%= link_to message('cancel'), { :controller => 'action_plans', :action => 'index', :id => @resource.id}, { :class => 'action' } %>
-      </div>
-  </fieldset>
-</form>
-
-<script>
-  $j("#create-action-plan-form").modalForm();
-  $j("[name=deadline]").datepicker({
-    dateFormat: 'yy-mm-dd',
-    changeMonth: true,
-    changeYear: true
-  });
-</script>
-
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/action_plans/_edit_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/action_plans/_edit_form.html.erb
deleted file mode 100644 (file)
index 0da20a1..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<form action="<%= url_for :action => 'edit' -%>" method="POST" id="edit-action-plan-form">
-    <input type="hidden" name="id" value="<%= @resource.id -%>"/>
-    <input type="hidden" name="plan_key" value="<%= @action_plan.key() if @action_plan -%>"/>
-
-    <fieldset>
-        <div class="modal-head">
-            <h2><%= message('action_plans.edit_action_plan') -%>: <%= @action_plan ? @action_plan.name() : params[:name] -%></h2>
-        </div>
-        <div class="modal-body">
-            <div class="modal-error"></div>
-
-            <div class="modal-field">
-                <label for="user[login]"><%= message('action_plans.col.name') -%> <em class="mandatory">*</em></label>
-                <input type="text" name="name" id="name" value="<%= @action_plan ? @action_plan.name() : params[:name] -%>"/><br/>
-            </div>
-            <div class="modal-field">
-                <label for="user[login]"> <%= message('action_plans.col.due_for') -%> </label>
-                <input type="text" name="deadline" id="deadline" value="<%= @action_plan && @action_plan.deadLine() ? Api::Utils.format_date(@action_plan.deadLine()) : params[:deadline] -%>"/>
-                <br/>
-                <span class="note"><%= message('action_plans.date_format_help') -%></span>
-                <br/>
-            </div>
-            <div class="modal-field">
-                <label for="user[login]"><%= message('action_plans.col.description') -%> </label>
-                <textarea rows="5" cols="80" name="description" id="description" class="width100"><%= @action_plan ? @action_plan.description() : params['description'] -%></textarea>
-            </div>
-        </div>
-
-        <div class="modal-foot">
-            <input type="submit" value="<%= h(message('save')) -%>"/>
-            <%= link_to message('cancel'), { :controller => 'action_plans', :action => 'index', :id => @resource.id}, { :class => 'action' } %>
-        </div>
-    </fieldset>
-</form>
-
-<script>
-  $j("#edit-action-plan-form").modalForm();
-  $j("[name=deadline]").datepicker({
-    dateFormat: 'yy-mm-dd',
-    changeMonth: true,
-    changeYear: true
-  });
-</script>
-
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/action_plans/_progress.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/action_plans/_progress.html.erb
deleted file mode 100644 (file)
index 209b774..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<%
-   unless action_plan.totalIssues()==0
-     project = @project
-     project = @resource if project.nil?
-     options = {:actionPlans => action_plan.key}
-
-     resolved_issues_link = action_plan.resolvedIssues().to_s
-     resolved_issues_link = link_to action_plan.resolvedIssues().to_s, url_for_component_issues(@project, options.merge(:resolved => 'true')) unless action_plan.resolvedIssues()==0
-     total_issues_link = link_to action_plan.totalIssues().to_s, url_for_component_issues(@project, options)
-
-     if action_plan.resolvedIssues() > 0
-       resolved_issues_url = url_for_component_issues(@project, options.merge({:resolved => 'true'}))
-       percent_resolved = (action_plan.resolvedIssues()*100 / action_plan.totalIssues()).to_i
-       tooltip_resolved = message('action_plans.resolved_issues_x_percent', :params => [percent_resolved.to_s, action_plan.resolvedIssues().to_s])
-     end
-
-     if action_plan.unresolvedIssues() > 0
-       unresolved_issues_url = url_for_component_issues(@project, options.merge({:resolved => 'false'}))
-       percent_open = (action_plan.unresolvedIssues()*100 / action_plan.totalIssues()).to_i
-       tooltip_open = message('action_plans.unresolved_issues_x_percent', :params => [percent_open.to_s, action_plan.unresolvedIssues().to_s])
-     end
-%>
-
-  <div class="progress">
-    <table>
-      <tbody>
-      <tr>
-        <% if action_plan.resolvedIssues() > 0 %>
-          <td class="resolved" style="width:<%= percent_resolved -%>%;">
-            <a href="<%= resolved_issues_url -%>" title="<%= resolved_issues_url -%>" alt="<%= tooltip_resolved -%>"></a>
-          </td>
-        <% end %>
-        <% if action_plan.unresolvedIssues() > 0 %>
-          <td class="open" style="width:<%= percent_open -%>%;">
-            <a href="<%= unresolved_issues_url -%>" title="<%= unresolved_issues_url -%>" alt="<%= tooltip_open -%>"></a>
-          </td>
-        <% end %>
-      </tr>
-      </tbody>
-    </table>
-    <div class="note"><%= message('action_plans.x_out_of_x_issues_solved', :params => [resolved_issues_link, total_issues_link]) -%></div>
-  </div>
-
-<% end %>
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/action_plans/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/action_plans/index.html.erb
deleted file mode 100644 (file)
index 6c384f3..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-<div class="page">
-  <header class="page-header">
-    <h1 class="page-title"><%= message('action_plans.page') -%></h1>
-    <% if is_admin?(@resource.id) %>
-      <div class="page-actions">
-        <a id="create-link-action_plans"
-           href="/action_plans/create_form/<%= h(@resource.id) -%>"
-           class="open-modal button"><%= message('action_plans.add_new_action_plan') -%></a>
-      </div>
-    <% end %>
-    <p class="page-description"><%= message('action_plans.page.description') -%></p>
-  </header>
-
-  <table width="100%" id="action-plans">
-    <tr>
-      <td valign="top">
-        <table class="width100 data sortable actionPlans" id="open-action-plans">
-          <thead>
-          <tr>
-            <th class="thin nowrap"><%= message('action_plans.col.status') -%></th>
-            <th class="thin nowrap"><%= message('action_plans.col.name') -%></th>
-            <th class="thin nowrap righticon sortfirstasc" style="text-align: right"><%= message('action_plans.col.due_for') -%></th>
-            <th class="nowrap text-center"><%= message('action_plans.col.progress') -%></th>
-            <th class="nowrap"><%= message('action_plans.col.description') -%></th>
-            <th class="nowrap"><%= message('action_plans.col.author') -%></th>
-            <th class="thin nowrap text-right"><%= message('action_plans.col.operations') -%></th>
-          </tr>
-          </thead>
-          <tbody>
-          <% if @open_action_plans.empty? %>
-            <td colspan="7" class="even"><%= message('action_plans.no_action_plan') -%></td>
-          <% end %>
-          <%
-             @open_action_plans.each do |plan|
-          %>
-            <tr class="<%= cycle('even', 'odd', :name => 'open_plans') -%>">
-              <td class="thin nowrap text-center">
-                <img src="/images/status/<%= plan.status() -%>.png" title="<%= message("action_plans.status.#{plan.status}") -%>"/></td>
-              <td class="thin nowrap"><%= h(plan.name()) -%></td>
-              <td class="thin nowrap <%= 'over-due' if plan.overDue() -%>" align="right"><%= format_date(plan.deadLine()) -%></td>
-              <% if plan.totalIssues()==0 %>
-                <td class="noprogress thin nowrap">
-                  <%= message('action_plans.no_issues_linked_to_action_plan') -%>
-                </td>
-              <% else %>
-                <td class="progress thin">
-                  <%= render :partial => 'progress', :locals => {:action_plan => plan} -%>
-                </td>
-              <% end %>
-              <td id="desc"><%= h(plan.description()) -%></td>
-              <td id="desc"><%= h(@users[plan.userLogin()]) -%></td>
-              <td class="thin nowrap text-right">
-                <%= link_to message('edit'), {:action => 'edit_form', :id => @resource.id, :plan_key => plan.key()}, :class => 'open-modal link-action' -%>
-                &nbsp;
-                <%
-                   close_confirmation_message = {}
-                   if plan.isOpen() && plan.unresolvedIssues() > 0
-                     close_confirmation_message = {:confirm => message('action_plans.confirm_close')}
-                   end
-                %>
-                <%= link_to message('close'),
-                            {:action => 'change_status', :id => @resource.id, :plan_key => plan.key()}, {:method => 'POST', :class => 'link-action'}.merge(close_confirmation_message) -%>
-                &nbsp;
-                <%= link_to_action message('delete'), "/action_plans/delete/#{h(@resource.id)}?plan_key=#{h(plan.key)}",
-                                     :class => 'link-action link-red',
-                                     :id => "delete_#{h(plan.key)}",
-                                     :confirm_button => message('delete'),
-                                     :confirm_title => message('action_plans.delete'),
-                                     :confirm_msg => message('action_plans.delete_message', :params => [h(plan.name)]),
-                                     :confirm_msg_params => ''
-                -%>
-              </td>
-            </tr>
-          <% end %>
-          </tbody>
-        </table>
-
-        <% unless @closed_action_plans.empty? %>
-          <br/><br/>
-
-          <h1><%= message('action_plans.closed_action_plan') -%></h1>
-
-          <table class="width100 data sortable actionPlans" id="closed-action-plans">
-            <thead>
-            <tr>
-              <th class="thin nowrap"><%= message('action_plans.col.status') -%></th>
-              <th class="thin nowrap"><%= message('action_plans.col.name') -%></th>
-              <th class="thin nowrap righticon sortfirstdesc" style="text-align: right"><%= message('action_plans.col.due_for') -%></th>
-              <th class="thin nowrap righticon" style="text-align: right"><%= message('action_plans.col.closed_on') -%></th>
-              <th class="nowrap text-center"><%= message('action_plans.col.progress') -%></th>
-              <th class="nowrap"><%= message('action_plans.col.description') -%></th>
-              <th class="nowrap"><%= message('action_plans.col.author') -%></th>
-              <th class="thin nowrap text-right"><%= message('action_plans.col.operations') -%></th>
-            </tr>
-            </thead>
-            <tbody>
-            <%
-               @closed_action_plans.each do |plan|
-            %>
-              <tr class="<%= cycle('even', 'odd', :name => 'closed_plans') -%>">
-                <td class="thin nowrap text-center"><img src="/images/status/<%= plan.status() -%>.png" title="<%= message("action_plans.status.#{plan.status}") -%>"/>
-                </td>
-                <td class="thin nowrap"><%= h(plan.name) -%></td>
-                <td class="thin nowrap <%= 'over-due' if plan.overDue() -%>" align="right"><%= format_date(plan.deadLine()) -%></td>
-                <td class="thin nowrap" align="right"><%= format_date(plan.updatedAt()) -%></td>
-                <% if plan.totalIssues()==0 %>
-                  <td class="noprogress thin nowrap">
-                    <%= message('action_plans.no_issues_linked_to_action_plan') -%>
-                  </td>
-                <% else %>
-                  <td class="progress thin">
-                    <%= render :partial => 'progress', :locals => {:action_plan => plan} -%>
-                  </td>
-                <% end %>
-                <td id="desc"><%= h(plan.description()) -%></td>
-                <td id="desc"><%= h(@users[plan.userLogin()]) -%></td>
-                <td class="thin nowrap text-right">
-                  <%= link_to message('action_plans.reopen'),
-                              {:action => 'change_status', :id => @resource.id, :plan_key => plan.key}, {:method => 'POST', :class => 'link-action'} -%>
-                  &nbsp;
-                    <%= link_to_action message('delete'), "/action_plans/delete/#{h(@resource.id)}?plan_key=#{h(plan.key)}",
-                                       :class => 'link-action link-red',
-                                       :id => "delete_#{h(plan.key)}",
-                                       :confirm_button => message('delete'),
-                                       :confirm_title => 'Delete action plan: '+ h(plan.name()),
-                                       :confirm_msg => message('action_plans.confirm_delete'),
-                                       :confirm_msg_params => ''
-                    -%>
-                </td>
-              </tr>
-            <% end %>
-            </tbody>
-          </table>
-        <% end %>
-      </td>
-    </tr>
-  </table>
-</div>
index bc9ed4193bbf216470a995ce15adca4497a9f026..81e331a02a32f5392060294dc6c84d49be935c2d 100644 (file)
@@ -6,7 +6,6 @@
    transitions_by_issues = {}
    unresolved_issues = 0
    unresolved_issues_user_can_admin = 0
-   at_least_one_issue_is_planned = false
    at_least_one_issue_is_assigned = false
    all_issues_are_assigned_to_current_user = true
    @issues.each do |issue|
@@ -20,7 +19,6 @@
      if Internal.issues.isUserIssueAdmin(issue.projectUuid)
        unresolved_issues_user_can_admin += 1 unless issue.resolution()
      end
-     at_least_one_issue_is_planned ||= issue.actionPlanKey()
      at_least_one_issue_is_assigned ||= issue.assignee()
      all_issues_are_assigned_to_current_user &&= issue.assignee() == current_user.login
    end
         -%>
         <span style="float:right" class="note">(<%= message('issue_bulk_change.x_issues', :params => unresolved_issues.to_s) -%>)</span>
       </div>
-      <%
-         if project_key
-           plans = Internal.issues.findOpenActionPlans(project_key)
-           # Display action plan combo box if there are some action plans defined on the project
-           unless plans.empty?
-             first_plan = plans[0]
-             options = plans.map { |plan|
-               label = plan.deadLine ? "#{h plan.name} (#{format_date(plan.deadLine)})" : h(plan.name)
-               [label, plan.key]
-             }
-             # SONAR-4728 Display 'Unplan' option only if at least one issue is planned
-             options.unshift([escape_javascript(message('issue.unplan.submit')), '']) if at_least_one_issue_is_planned
-             plan_options = options_for_select(options, first_plan.key)
-      %>
-        <div class="modal-field">
-          <label for="plan">
-            <%= message('issue.do_plan') -%>
-          </label>
-          <input id="plan-action" name="actions[]" type="checkbox" value="plan"/>
-          <%= dropdown_tag('plan.plan', plan_options, {:show_search_box => false}, {:id => 'plan'}) -%>
-          <span style="float:right" class="note">(<%= message('issue_bulk_change.x_issues', :params => unresolved_issues.to_s) -%>)</span>
-        </div>
-        <% end %>
-      <% end %>
 
       <%
         type_options = [
         <input id="remove_tags" name="remove_tags.tags" type="text"/>
         <span style="float:right" class="note">(<%= message('issue_bulk_change.x_issues', :params => unresolved_issues.to_s) -%>)</span>
       </div>
-
       <% end %>
 
       <% if transitions_by_issues.size > 0 %>
    * Attach some events on select boxes to automatically select associate check box when selecting an option
    */
   $j('#assignee').click(function() { check('assign-action'); });
-  $j('#plan').click(function() { check('plan-action'); });
   $j('#severity').click(function() { check('set-severity-action'); });
   $j('#type').click(function() { check('set-type-action'); });
   $j('#add_tags').select2({tags: [ '<%= @tags.join("', '") -%>' ], width: '250px' });