aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2014-11-06 12:24:44 +0100
committerStas Vilchik <vilchiks@gmail.com>2014-11-06 12:24:52 +0100
commit6deae83daebb117e8ae49b58c72fb0ce8d0043b7 (patch)
tree56d52e5f48b6f0bb2996175b38dc8302c7d8c54c /server/sonar-web/src
parentb7e3c205a224d06c418f1975693df36867684091 (diff)
downloadsonarqube-6deae83daebb117e8ae49b58c72fb0ce8d0043b7.tar.gz
sonarqube-6deae83daebb117e8ae49b58c72fb0ce8d0043b7.zip
SONAR-5718 Add module criteria, update widgets
Diffstat (limited to 'server/sonar-web/src')
-rw-r--r--server/sonar-web/src/main/coffee/issues/controller.coffee4
-rw-r--r--server/sonar-web/src/main/coffee/issues/facets-view.coffee3
-rw-r--r--server/sonar-web/src/main/coffee/issues/facets/module-facet.coffee39
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/views/action_plans/_progress.html.erb7
4 files changed, 50 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/coffee/issues/controller.coffee b/server/sonar-web/src/main/coffee/issues/controller.coffee
index d98bda0b9dc..e7855174cc7 100644
--- a/server/sonar-web/src/main/coffee/issues/controller.coffee
+++ b/server/sonar-web/src/main/coffee/issues/controller.coffee
@@ -13,8 +13,8 @@ define [
$ = jQuery
EXTRA_FIELDS = 'actions,transitions,assigneeName,reporterName,actionPlanName'
PAGE_SIZE = 50
- ALL_FACETS = ['severities', 'statuses', 'resolutions', 'projectUuids', 'assignees', 'reporters', 'rules',
- 'languages', 'actionPlans', 'componentUuids', 'creationDate']
+ ALL_FACETS = ['severities', 'statuses', 'resolutions', 'projectUuids', 'componentRootUuids', 'componentUuids', 'assignees', 'reporters', 'rules',
+ 'languages', 'actionPlans', 'creationDate']
FACET_DATA_FIELDS = ['components', 'projects', 'users', 'rules', 'actionPlans', 'languages']
FACETS_FROM_SERVER = ['severities', 'statuses', 'resolutions', 'actionPlans', 'projectUuids', 'rules',
'assignees', 'reporters', 'componentUuids', 'languages']
diff --git a/server/sonar-web/src/main/coffee/issues/facets-view.coffee b/server/sonar-web/src/main/coffee/issues/facets-view.coffee
index 6ffd106f947..9ebd69988de 100644
--- a/server/sonar-web/src/main/coffee/issues/facets-view.coffee
+++ b/server/sonar-web/src/main/coffee/issues/facets-view.coffee
@@ -5,6 +5,7 @@ define [
'issues/facets/severity-facet'
'issues/facets/status-facet'
'issues/facets/project-facet'
+ 'issues/facets/module-facet'
'issues/facets/assignee-facet'
'issues/facets/rule-facet'
'issues/facets/resolution-facet'
@@ -19,6 +20,7 @@ define [
SeverityFacet
StatusFacet
ProjectFacet
+ ModuleFacet
AssigneeFacet
RuleFacet
ResolutionFacet
@@ -41,6 +43,7 @@ define [
when 'resolutions' then ResolutionFacet
when 'creationDate' then CreationDateFacet
when 'projectUuids' then ProjectFacet
+ when 'componentRootUuids' then ModuleFacet
when 'rules' then RuleFacet
when 'actionPlans' then ActionPlanFacet
when 'componentUuids' then ComponentFacet
diff --git a/server/sonar-web/src/main/coffee/issues/facets/module-facet.coffee b/server/sonar-web/src/main/coffee/issues/facets/module-facet.coffee
new file mode 100644
index 00000000000..66d1a9ea1e8
--- /dev/null
+++ b/server/sonar-web/src/main/coffee/issues/facets/module-facet.coffee
@@ -0,0 +1,39 @@
+define [
+ 'issues/facets/custom-values-facet'
+], (
+ CustomValuesFacet
+) ->
+
+
+ class extends CustomValuesFacet
+
+ getUrl: ->
+ "#{baseUrl}/api/resources/search?f=s2&q=BRC&display_uuid=true"
+
+
+ getValues: ->
+ componentRoots = @options.app.state.get('query').componentRootUuids
+ componentRoots = '' unless typeof componentRoots == typeof ''
+ if componentRoots.length > 0
+ componentRoots = componentRoots.split ','
+ componentRoots.map (c) ->
+ { val: c, count: null }
+ else []
+
+
+ getValuesWithLabels: ->
+ values = @getValues()
+ components = @options.app.facets.components
+ values.forEach (v) =>
+ uuid = v.val
+ label = uuid
+ if uuid
+ component = _.findWhere components, uuid: uuid
+ label = component.longName if component?
+ v.label = label
+ values
+
+
+ serializeData: ->
+ _.extend super,
+ values: @getValuesWithLabels()
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
index 590e0a24ece..1df18ad0fdc 100644
--- 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
@@ -2,7 +2,12 @@
unless action_plan.totalIssues()==0
project = @project
project = @resource if project.nil?
- options = {:actionPlans => action_plan.key, :componentRoots => u(project.key)}
+ options = {:actionPlans => action_plan.key}
+ if @project.qualifier == 'TRK'
+ options['projectUuids'] = @project.uuid
+ else
+ options['componentRootUuids'] = @project.uuid
+ end
resolved_issues_link = action_plan.resolvedIssues().to_s
resolved_issues_link = link_to action_plan.resolvedIssues().to_s, url_for_issues(options.merge(:resolved => 'true')) unless action_plan.resolvedIssues()==0