aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2014-11-06 17:23:15 +0100
committerStas Vilchik <vilchiks@gmail.com>2014-11-06 17:23:21 +0100
commit877b98ee775fbccbb857b3ca190b7b9d17e870ee (patch)
tree17d1259e61cfe058b90d96befe18b8f4fcad4953
parent15c34a1fbcb4f42b45ba82ccb9090235c2bf7164 (diff)
downloadsonarqube-877b98ee775fbccbb857b3ca190b7b9d17e870ee.tar.gz
sonarqube-877b98ee775fbccbb857b3ca190b7b9d17e870ee.zip
SONAR-5718 Fix issues shortcuts
-rw-r--r--server/sonar-web/src/main/coffee/issues/app.coffee3
-rw-r--r--server/sonar-web/src/main/coffee/issues/component-viewer/main.coffee29
-rw-r--r--server/sonar-web/src/main/coffee/issues/workspace-list-view.coffee19
-rw-r--r--server/sonar-web/src/main/hbs/issues/issues-issue.hbs7
4 files changed, 44 insertions, 14 deletions
diff --git a/server/sonar-web/src/main/coffee/issues/app.coffee b/server/sonar-web/src/main/coffee/issues/app.coffee
index 03c43575288..df46abb2aa4 100644
--- a/server/sonar-web/src/main/coffee/issues/app.coffee
+++ b/server/sonar-web/src/main/coffee/issues/app.coffee
@@ -111,7 +111,8 @@ requirejs [
App.addInitializer ->
@helpView = new HelpView app: @
$(window).on 'keypress', (e) =>
- @helpView.render() if e.keyCode == 63
+ code = e.keyCode || e.which
+ @helpView.render() if code == 63
App.addInitializer ->
diff --git a/server/sonar-web/src/main/coffee/issues/component-viewer/main.coffee b/server/sonar-web/src/main/coffee/issues/component-viewer/main.coffee
index 0420dbabacf..211fa09d17b 100644
--- a/server/sonar-web/src/main/coffee/issues/component-viewer/main.coffee
+++ b/server/sonar-web/src/main/coffee/issues/component-viewer/main.coffee
@@ -48,10 +48,30 @@ define [
bindShortcuts: ->
+ doTransition = (transition) =>
+ selectedIssueView = @getSelectedIssueEl()
+ return unless selectedIssueView
+ selectedIssueView.find("[data-transition=#{transition}]").click()
+
+ doAction = (action) =>
+ selectedIssueView = @getSelectedIssueEl()
+ return unless selectedIssueView
+ selectedIssueView.find("#issue-#{action}").click()
+
key 'left', 'componentViewer', =>
@options.app.controller.closeComponentViewer()
false
+ key 'c', 'componentViewer', -> doTransition 'confirm'
+ key 'u', 'componentViewer', -> doTransition 'unconfirm'
+ key 'r', 'componentViewer', -> doTransition 'resolve'
+ key 'r', 'componentViewer', -> doTransition 'reopen'
+ key 'f', 'componentViewer', -> doTransition 'falsepositive'
+ key 'a', 'componentViewer', -> doAction 'assign'
+ key 'm', 'componentViewer', -> doAction 'assign-to-me'
+ key 'p', 'componentViewer', -> doAction 'plan'
+ key 'i', 'componentViewer', -> doAction 'set-severity'
+
bindScrollEvents: ->
$(window).on 'scroll.issues-component-viewer', (=> @onScroll())
@@ -141,6 +161,15 @@ define [
@options.app.controller.showComponentViewer selectedIssue
+ getSelectedIssueEl: ->
+ selected = @options.app.state.get 'selectedIndex'
+ return null unless selected?
+ selectedIssue = @options.app.issues.at selected
+ return null unless selectedIssue?
+ selectedIssueView = @$("[data-issue-key='#{selectedIssue.get('key')}']")
+ if selectedIssueView.length > 0 then selectedIssueView else null
+
+
scrollToIssue: (key) ->
el = @$("[data-issue-key='#{key}']")
if el.length > 0
diff --git a/server/sonar-web/src/main/coffee/issues/workspace-list-view.coffee b/server/sonar-web/src/main/coffee/issues/workspace-list-view.coffee
index 0e9e600efa8..03b59ab3423 100644
--- a/server/sonar-web/src/main/coffee/issues/workspace-list-view.coffee
+++ b/server/sonar-web/src/main/coffee/issues/workspace-list-view.coffee
@@ -77,16 +77,15 @@ define [
@options.app.controller.showComponentViewer selectedIssue
return false
- key 'c', -> doTransition 'confirm'
- key 'u', -> doTransition 'unconfirm'
- key 'r', -> doTransition 'resolve'
- key 'r', -> doTransition 'reopen'
- key 'f', -> doTransition 'falsepositive'
-
- key 'a', -> doAction 'assign'
- key 'm', -> doAction 'assign-to-me'
- key 'p', -> doAction 'plan'
- key 'i', -> doAction 'set-severity'
+ key 'c', 'list', -> doTransition 'confirm'
+ key 'u', 'list', -> doTransition 'unconfirm'
+ key 'r', 'list', -> doTransition 'resolve'
+ key 'r', 'list', -> doTransition 'reopen'
+ key 'f', 'list', -> doTransition 'falsepositive'
+ key 'a', 'list', -> doAction 'assign'
+ key 'm', 'list', -> doAction 'assign-to-me'
+ key 'p', 'list', -> doAction 'plan'
+ key 'i', 'list', -> doAction 'set-severity'
loadMore: ->
diff --git a/server/sonar-web/src/main/hbs/issues/issues-issue.hbs b/server/sonar-web/src/main/hbs/issues/issues-issue.hbs
index f83e692f16c..599c5fce8bb 100644
--- a/server/sonar-web/src/main/hbs/issues/issues-issue.hbs
+++ b/server/sonar-web/src/main/hbs/issues/issues-issue.hbs
@@ -36,6 +36,9 @@
<li>
{{#if assigneeName}}
<a id="issue-assign" class="link-action">{{t 'assigned_to'}}</a> {{assigneeName}}
+ {{#inArray actions "assign_to_me"}}
+ <a id="issue-assign-to-me" class="link-action hidden">{{t 'issue.assign.to_me' }}</a>
+ {{/inArray}}
{{else}}
<a id="issue-assign" class="link-action">{{t 'issue.assign.formlink' }}</a>
{{#inArray actions "assign_to_me"}}
@@ -98,9 +101,7 @@
{{#if reporterName}}<li>{{t 'reporter'}}: {{reporterName}}</li>{{/if}}
{{#if author}}<li>{{t 'author'}}: {{author}}</li>{{/if}}
- {{#if creationDate}}
- <li class="first-letter-uppercase" title="{{t 'issue.creation_date'}}: {{dt creationDate}}">{{fromNow creationDate}}</li>
- {{/if}}
+
</ul>
<div class="code-issue-form" style="display: none;"></div>