aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2014-05-06 15:56:10 +0200
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2014-05-06 15:56:16 +0200
commit769198ce18f482f5f7cbf6e1c646817027368a77 (patch)
tree097c834ccf34d29910294ee4dd6f4a97980043ba
parent0a5ca7fbc6f56fa5342f32ce762eaa29dcce61c4 (diff)
downloadsonarqube-769198ce18f482f5f7cbf6e1c646817027368a77.tar.gz
sonarqube-769198ce18f482f5f7cbf6e1c646817027368a77.zip
SONAR-5250 Keep order when toggling internals, highlight internals
-rw-r--r--sonar-server/src/main/coffee/api-documentation/app.coffee1
-rw-r--r--sonar-server/src/main/coffee/api-documentation/collections/web-services.coffee5
-rw-r--r--sonar-server/src/main/coffee/api-documentation/layout.coffee2
-rw-r--r--sonar-server/src/main/coffee/api-documentation/models/web-service.coffee5
-rw-r--r--sonar-server/src/main/hbs/api-documentation/api-documentation-action.hbs2
-rw-r--r--sonar-server/src/main/hbs/api-documentation/api-documentation-web-service.hbs1
-rw-r--r--sonar-server/src/main/less/api-documentation.less6
7 files changed, 15 insertions, 7 deletions
diff --git a/sonar-server/src/main/coffee/api-documentation/app.coffee b/sonar-server/src/main/coffee/api-documentation/app.coffee
index e362c7b78b6..1fe33d8a18a 100644
--- a/sonar-server/src/main/coffee/api-documentation/app.coffee
+++ b/sonar-server/src/main/coffee/api-documentation/app.coffee
@@ -50,7 +50,6 @@ requirejs [
App.apiDocumentationListView = new ApiDocumentationListView
collection: App.webServices
app: App
- App.layout.resultsRegion.reset()
App.layout.resultsRegion.show App.apiDocumentationListView
if (Backbone.history.fragment)
App.router.show Backbone.history.fragment, trigger: true
diff --git a/sonar-server/src/main/coffee/api-documentation/collections/web-services.coffee b/sonar-server/src/main/coffee/api-documentation/collections/web-services.coffee
index 1f1e5ca4cc7..5e2c9ab78f2 100644
--- a/sonar-server/src/main/coffee/api-documentation/collections/web-services.coffee
+++ b/sonar-server/src/main/coffee/api-documentation/collections/web-services.coffee
@@ -8,6 +8,7 @@ define [
class WebServices extends Backbone.Collection
model: WebService
+ comparator: 'path'
initialize: ->
@includeInternals = false
@@ -19,12 +20,10 @@ define [
r.webServices.map (webService) ->
_.extend webService
- comparator: (item) -> item.get('path')
-
toggleInternals: ->
if @includeInternals
@includeInternals = false
else
@includeInternals = true
- @.fetch()
+ @fetch()
diff --git a/sonar-server/src/main/coffee/api-documentation/layout.coffee b/sonar-server/src/main/coffee/api-documentation/layout.coffee
index 4df933b7da6..72ecacf7bed 100644
--- a/sonar-server/src/main/coffee/api-documentation/layout.coffee
+++ b/sonar-server/src/main/coffee/api-documentation/layout.coffee
@@ -22,4 +22,4 @@ define [
initialize: (app) ->
@app = app.app
- @.listenTo(@app.webServices, "change", @app.refresh)
+ @listenTo(@app.webServices, 'sync', @app.refresh)
diff --git a/sonar-server/src/main/coffee/api-documentation/models/web-service.coffee b/sonar-server/src/main/coffee/api-documentation/models/web-service.coffee
index dcdcd2e2de6..6555dc08dad 100644
--- a/sonar-server/src/main/coffee/api-documentation/models/web-service.coffee
+++ b/sonar-server/src/main/coffee/api-documentation/models/web-service.coffee
@@ -5,4 +5,7 @@ define [
) ->
class WebService extends Backbone.Model
- idAttribute: 'path'
+ idAttribute: 'path'
+
+ initialize: (options) ->
+ @set 'internal', _.every options.actions, (action) -> action.internal
diff --git a/sonar-server/src/main/hbs/api-documentation/api-documentation-action.hbs b/sonar-server/src/main/hbs/api-documentation/api-documentation-action.hbs
index 0fa9d3d0f3f..369a3e7bb41 100644
--- a/sonar-server/src/main/hbs/api-documentation/api-documentation-action.hbs
+++ b/sonar-server/src/main/hbs/api-documentation/api-documentation-action.hbs
@@ -4,7 +4,7 @@
</h3>
<span class="subtitle">
{{#if since}}Since {{since}}{{#if internal}} -{{/if}}{{/if}}
- {{#if internal}}For internal use only{{/if}}
+ {{#if internal}}<span class="internal">For internal use only</span>{{/if}}
</span>
<p>{{{description}}}</p>
{{#if params}}
diff --git a/sonar-server/src/main/hbs/api-documentation/api-documentation-web-service.hbs b/sonar-server/src/main/hbs/api-documentation/api-documentation-web-service.hbs
index 2c4da7f5fc9..14a4b65daf5 100644
--- a/sonar-server/src/main/hbs/api-documentation/api-documentation-web-service.hbs
+++ b/sonar-server/src/main/hbs/api-documentation/api-documentation-web-service.hbs
@@ -1,4 +1,5 @@
<div class="line line-small">
<h1>{{path}}</h1>
<span class="subtitle">{{{description}}}</span>
+ {{#if internal}}<span class="subtitle internal">internal</span>{{/if}}
</div>
diff --git a/sonar-server/src/main/less/api-documentation.less b/sonar-server/src/main/less/api-documentation.less
index 8ca4c3b4747..bbd786a60c0 100644
--- a/sonar-server/src/main/less/api-documentation.less
+++ b/sonar-server/src/main/less/api-documentation.less
@@ -44,6 +44,12 @@
.navigator-details { margin-left: 0; }
+ .internal {
+ color: @navigatorBarBackground;
+ background-color: rgb(127, 127, 127);
+ border-radius: 2px;
+ padding: 1px 5px;
+ }
}