]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6742 Stop displaying plugin actions for issues in the UI
authorStas Vilchik <vilchiks@gmail.com>
Fri, 25 Mar 2016 13:25:55 +0000 (14:25 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Fri, 25 Mar 2016 13:25:55 +0000 (14:25 +0100)
server/sonar-web/src/main/js/components/issue/issue-view.js
server/sonar-web/src/main/js/components/issue/templates/issue-more-actions.hbs [deleted file]
server/sonar-web/src/main/js/components/issue/templates/issue.hbs
server/sonar-web/src/main/js/components/issue/views/more-actions-view.js [deleted file]
server/sonar-web/src/main/js/helpers/handlebars/ifHasExtraActions.js [deleted file]
server/sonar-web/src/main/js/helpers/handlebars/pluginActions.js [deleted file]

index 081e80699f5bd2ba509d3f8d35f65c7bb34ac276..9a4fb2e7849825ac13839a2e624f6c9a4197a345 100644 (file)
@@ -30,7 +30,6 @@ 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 MoreActionsView from './views/more-actions-view';
 import TagsFormView from './views/tags-form-view';
 import Workspace from '../workspace/main';
 import Template from './templates/issue.hbs';
@@ -56,7 +55,6 @@ export default Marionette.ItemView.extend({
       'click .js-issue-assign-to-me': 'assignToMe',
       'click .js-issue-plan': 'plan',
       'click .js-issue-show-changelog': 'showChangeLog',
-      'click .js-issue-more': 'showMoreActions',
       'click .js-issue-rule': 'showRule',
       'click .js-issue-edit-tags': 'editTags',
       'click .js-issue-locations': 'showLocations'
@@ -241,18 +239,6 @@ export default Marionette.ItemView.extend({
     Workspace.openRule({ key: ruleKey });
   },
 
-  showMoreActions (e) {
-    e.stopPropagation();
-    $('body').click();
-    this.popup = new MoreActionsView({
-      triggerEl: $(e.currentTarget),
-      bottomRight: true,
-      model: this.model,
-      detailView: this
-    });
-    this.popup.render();
-  },
-
   action (action) {
     const that = this;
     this.disableControls();
diff --git a/server/sonar-web/src/main/js/components/issue/templates/issue-more-actions.hbs b/server/sonar-web/src/main/js/components/issue/templates/issue-more-actions.hbs
deleted file mode 100644 (file)
index f4e8422..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<ul class="menu">
-  {{#pluginActions actions}}
-    <li>
-      <a class="issue-action js-issue-action" href="#" data-action="{{this}}">{{t "issue.action" this "formlink"}}</a>
-    </li>
-  {{/pluginActions}}
-</ul>
-
-<div class="bubble-popup-arrow"></div>
index c8d76d6773430871ad85aab468f8dff25757607d..6ed51a13a82c7457e7d9229cf51141e05480e2da 100644 (file)
                   class="issue-meta-label">{{t 'issue.comment.formlink' }}</span></button>
             </li>
           {{/inArray}}
-
-          {{#ifHasExtraActions actions}}
-            <li class="issue-meta">
-              <button class="button-link issue-action issue-action-with-options js-issue-more">
-                <span class="issue-meta-label">{{t 'more'}}</span>&nbsp;<i class="icon-dropdown"></i>
-              </button>
-            </li>
-          {{/ifHasExtraActions}}
         </ul>
 
         {{#inArray actions "assign_to_me"}}
diff --git a/server/sonar-web/src/main/js/components/issue/views/more-actions-view.js b/server/sonar-web/src/main/js/components/issue/views/more-actions-view.js
deleted file mode 100644 (file)
index 9865c54..0000000
+++ /dev/null
@@ -1,38 +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 ActionOptionsView from '../../../components/common/action-options-view';
-import Template from '../templates/issue-more-actions.hbs';
-
-export default ActionOptionsView.extend({
-  template: Template,
-
-  selectOption (e) {
-    const action = $(e.currentTarget).data('action');
-    this.submit(action);
-    return ActionOptionsView.prototype.selectOption.apply(this, arguments);
-  },
-
-  submit (actionKey) {
-    return this.options.detailView.action(actionKey);
-  }
-});
-
-
diff --git a/server/sonar-web/src/main/js/helpers/handlebars/ifHasExtraActions.js b/server/sonar-web/src/main/js/helpers/handlebars/ifHasExtraActions.js
deleted file mode 100644 (file)
index ab47aaa..0000000
+++ /dev/null
@@ -1,31 +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 'underscore';
-
-const DEFAULT_ACTIONS = ['comment', 'assign', 'assign_to_me', 'plan', 'set_severity', 'set_tags', 'set_type'];
-
-module.exports = function (actions, options) {
-  const actionsLeft = _.difference(actions, DEFAULT_ACTIONS);
-  if (actionsLeft.length > 0) {
-    return options.fn(this);
-  } else {
-    return options.inverse(this);
-  }
-};
diff --git a/server/sonar-web/src/main/js/helpers/handlebars/pluginActions.js b/server/sonar-web/src/main/js/helpers/handlebars/pluginActions.js
deleted file mode 100644 (file)
index 995069d..0000000
+++ /dev/null
@@ -1,29 +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 'underscore';
-
-const DEFAULT_ACTIONS = ['comment', 'assign', 'assign_to_me', 'plan', 'set_severity', 'set_tags', 'set_type'];
-
-module.exports = function (actions, options) {
-  const pluginActions = _.difference(actions, DEFAULT_ACTIONS);
-  return pluginActions.reduce(function (prev, current) {
-    return prev + options.fn(current);
-  }, '');
-};