]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8291 display internal WS parameters only if asked
authorStas Vilchik <vilchiks@gmail.com>
Fri, 28 Oct 2016 07:51:45 +0000 (09:51 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Fri, 28 Oct 2016 07:51:45 +0000 (09:51 +0200)
server/sonar-web/src/main/js/apps/web-api/components/Action.js
server/sonar-web/src/main/js/apps/web-api/components/Domain.js
server/sonar-web/src/main/js/apps/web-api/components/Params.js

index ad1d69120382e3142fbc54118e50bf5c85eec3c4..2c3cc0dcfa202070d29b2e09f92c756be04e839d 100644 (file)
@@ -28,6 +28,10 @@ import InternalBadge from './InternalBadge';
 import { TooltipsContainer } from '../../../components/mixins/tooltips-mixin';
 
 export default class Action extends React.Component {
+  static propTypes = {
+    showInternal: React.PropTypes.bool
+  };
+
   state = {
     showParams: false,
     showResponse: false
@@ -111,7 +115,7 @@ export default class Action extends React.Component {
               </ul>
           )}
 
-          {showParams && action.params && <Params params={action.params}/>}
+          {showParams && action.params && <Params params={action.params} showInternal={this.props.showInternal}/>}
 
           {showResponse && action.hasResponseExample && <ResponseExample domain={domain} action={action}/>}
         </div>
index df212f6df13616ff9de7c74b42253132380a348b..6fd5495071162a387c5538f410f4fceb2ed2f386 100644 (file)
@@ -58,7 +58,8 @@ export default function Domain ({ domain, showInternal, showOnlyDeprecated, sear
                   key={getActionKey(domain.path, action.key)}
                   action={action}
                   domain={domain}
-                  location={location}/>
+                  location={location}
+                  showInternal={showInternal}/>
           ))}
         </div>
       </div>
index 7c1fb97086e2ef64478b735ad92fbfd71f1384ef..68649ad2a8bfaee95fd959aca46b618ef8f16219 100644 (file)
@@ -22,12 +22,14 @@ import React from 'react';
 import InternalBadge from './InternalBadge';
 import DeprecatedBadge from './DeprecatedBadge';
 
-export default function Params ({ params }) {
+export default function Params ({ params, showInternal }) {
+  const displayedParameters = showInternal ? params : params.filter(p => !p.internal);
+
   return (
       <div className="web-api-params">
         <table>
           <tbody>
-            {params.map(param => (
+            {displayedParameters.map(param => (
                 <tr key={param.key}>
                   <td style={{ width: 180 }}>
                     <code>{param.key}</code>