diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2016-10-28 09:51:45 +0200 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2016-10-28 09:51:45 +0200 |
commit | 1b93884d1526403aa591ee2c197930e1bc28fee1 (patch) | |
tree | 1e4dd0e96c2cf48651d789cf6a85d50bd62136a9 /server/sonar-web/src/main/js/apps/web-api/components | |
parent | ca8082ba03d4149d4111eae7b9955cc83782707e (diff) | |
download | sonarqube-1b93884d1526403aa591ee2c197930e1bc28fee1.tar.gz sonarqube-1b93884d1526403aa591ee2c197930e1bc28fee1.zip |
SONAR-8291 display internal WS parameters only if asked
Diffstat (limited to 'server/sonar-web/src/main/js/apps/web-api/components')
3 files changed, 11 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/apps/web-api/components/Action.js b/server/sonar-web/src/main/js/apps/web-api/components/Action.js index ad1d6912038..2c3cc0dcfa2 100644 --- a/server/sonar-web/src/main/js/apps/web-api/components/Action.js +++ b/server/sonar-web/src/main/js/apps/web-api/components/Action.js @@ -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> diff --git a/server/sonar-web/src/main/js/apps/web-api/components/Domain.js b/server/sonar-web/src/main/js/apps/web-api/components/Domain.js index df212f6df13..6fd54950711 100644 --- a/server/sonar-web/src/main/js/apps/web-api/components/Domain.js +++ b/server/sonar-web/src/main/js/apps/web-api/components/Domain.js @@ -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> diff --git a/server/sonar-web/src/main/js/apps/web-api/components/Params.js b/server/sonar-web/src/main/js/apps/web-api/components/Params.js index 7c1fb97086e..68649ad2a8b 100644 --- a/server/sonar-web/src/main/js/apps/web-api/components/Params.js +++ b/server/sonar-web/src/main/js/apps/web-api/components/Params.js @@ -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> |