diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2014-07-22 14:09:09 +0200 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2014-07-22 14:09:09 +0200 |
commit | ce642c543ddc444ec030116e3bea959f5c11cc8a (patch) | |
tree | bb3a3561f660ec84bda84a43ae519598124de4c4 /server | |
parent | 40c6aeafd6ab0844ff2a9ecca4c123d71808ec90 (diff) | |
download | sonarqube-ce642c543ddc444ec030116e3bea959f5c11cc8a.tar.gz sonarqube-ce642c543ddc444ec030116e3bea959f5c11cc8a.zip |
SONAR-5466 Workspace should display the project as well as the module
Diffstat (limited to 'server')
-rw-r--r-- | server/sonar-web/src/main/coffee/component-viewer/main.coffee | 14 | ||||
-rw-r--r-- | server/sonar-web/src/main/hbs/component-viewer/cw-workspace.hbs | 14 |
2 files changed, 24 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/coffee/component-viewer/main.coffee b/server/sonar-web/src/main/coffee/component-viewer/main.coffee index 0aca76e4798..737b6bd417a 100644 --- a/server/sonar-web/src/main/coffee/component-viewer/main.coffee +++ b/server/sonar-web/src/main/coffee/component-viewer/main.coffee @@ -252,8 +252,7 @@ define [ component = @requestComponent key @currentIssue = null component.done => - @workspace.where(key: key).forEach (model) => - model.set 'component': @component.toJSON() + @updateWorkspaceComponents() @state.set 'removed', false source.always => if source.status == 403 @@ -280,6 +279,17 @@ define [ else @cannotOpen() + updateWorkspaceComponents: -> + @workspace.where(key: @component.get('key')).forEach (model) => + model.set 'component': @component.toJSON() + + @workspace.each (w) => + options = w.get('options') + _.where(options, key: @component.get('key')).forEach (model) => + model.component = @component.toJSON() + w.set 'options', options + + cannotOpen: -> @$el.html "<div class='message-error'>#{t 'component_viewer.cannot_show'}</div>" diff --git a/server/sonar-web/src/main/hbs/component-viewer/cw-workspace.hbs b/server/sonar-web/src/main/hbs/component-viewer/cw-workspace.hbs index 32d2e674e36..1c0137f9f12 100644 --- a/server/sonar-web/src/main/hbs/component-viewer/cw-workspace.hbs +++ b/server/sonar-web/src/main/hbs/component-viewer/cw-workspace.hbs @@ -16,6 +16,9 @@ <li class="component-viewer-workspace-item {{#if active}}active{{/if}}"> {{qualifierIcon component.q}} <a class="link-action" data-key="{{component.key}}">{{component.name}}</a> + <div class="text-ellipsis subtitle" title="{{component.projectName}} / {{component.subProjectName}}"> + {{component.projectName}} / {{component.subProjectName}} + </div> {{#if component.dir}} <div class="text-ellipsis subtitle">{{component.dir}}</div> {{/if}} @@ -25,11 +28,18 @@ {{#each options}} <li class="component-viewer-workspace-option text-ellipsis {{#if active}}active{{/if}}" title="{{name}}"> <a class="link-action" data-workspace-key="{{../component.key}}" data-key="{{key}}">{{name}}</a> - {{#if subname}}<div class="text-ellipsis subtitle" title="{{subname}}">{{subname}}</div>{{/if}} + {{#if component}} + <div class="text-ellipsis subtitle" title="{{component.projectName}} / {{component.subProjectName}}"> + {{component.projectName}} / {{component.subProjectName}} + </div> + {{/if}} + {{#if subname}} + <div class="text-ellipsis subtitle" title="{{subname}}">{{subname}}</div> + {{/if}} </li> {{/each}} </ul> {{/if}} </li> {{/eachReverse}} -</ul>
\ No newline at end of file +</ul> |