]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5250 Keep order when toggling internals, highlight internals
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Tue, 6 May 2014 13:56:10 +0000 (15:56 +0200)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Tue, 6 May 2014 13:56:16 +0000 (15:56 +0200)
sonar-server/src/main/coffee/api-documentation/app.coffee
sonar-server/src/main/coffee/api-documentation/collections/web-services.coffee
sonar-server/src/main/coffee/api-documentation/layout.coffee
sonar-server/src/main/coffee/api-documentation/models/web-service.coffee
sonar-server/src/main/hbs/api-documentation/api-documentation-action.hbs
sonar-server/src/main/hbs/api-documentation/api-documentation-web-service.hbs
sonar-server/src/main/less/api-documentation.less

index e362c7b78b63a162d681a4153cfc2899a0f6425e..1fe33d8a18aaca5c1ffa1a4c26123ffa16914550 100644 (file)
@@ -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
index 1f1e5ca4cc7cd8416b0f8e9082d4fe9bb4ec2ded..5e2c9ab78f2023e20a51039cab036fc2ff09ae77 100644 (file)
@@ -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()
index 4df933b7da63690f778f0b8fdd847292925a8d79..72ecacf7bed9736c11da80f067bfafa5f9c68ad8 100644 (file)
@@ -22,4 +22,4 @@ define [
 
     initialize: (app) ->
       @app = app.app
-      @.listenTo(@app.webServices, "change", @app.refresh)
+      @listenTo(@app.webServices, 'sync', @app.refresh)
index dcdcd2e2de6a6e2176714ebc6f97f9cbaf9c2916..6555dc08dad4320283c19235553b4b3a716c25f4 100644 (file)
@@ -5,4 +5,7 @@ define [
 ) ->
 
   class WebService extends Backbone.Model
-       idAttribute: 'path'
+    idAttribute: 'path'
+
+    initialize: (options) ->
+      @set 'internal', _.every options.actions, (action) -> action.internal
index 0fa9d3d0f3f9a30b97c0bc7ca0c661dd28bd7415..369a3e7bb4184eeeb559e0c65225e6bf2d744d72 100644 (file)
@@ -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}}
index 2c4da7f5fc9476891297796734cf99e4fc12377e..14a4b65daf52917d8c4e87402e5442cbcf4d2c4e 100644 (file)
@@ -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>
index 8ca4c3b474769e41a11ad31e3614ad623347edb0..bbd786a60c0b946b8e141eb93a345c3993cc5082 100644 (file)
 
   .navigator-details { margin-left: 0; }
 
+  .internal {
+    color: @navigatorBarBackground;
+    background-color: rgb(127, 127, 127);
+    border-radius: 2px;
+    padding: 1px 5px;
+  }
 }