-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add conditional row limit notice to APIPage template (#274)
- Loading branch information
1 parent
e6bb223
commit 5872103
Showing
2 changed files
with
14 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,29 @@ | ||
import React from 'react'; | ||
import qs from 'qs'; | ||
import SwaggerUI from 'swagger-ui-react'; | ||
import ApiRowLimitNotice from '../../components/ApiRowLimitNotice'; | ||
import 'swagger-ui-react/swagger-ui.css'; | ||
import './swagger-ui-overrides.scss'; | ||
|
||
const APIPage = ({ hideAuth = true, additionalParams, rootUrl }) => { | ||
const APIPage = ({ hideAuth = true, additionalParams, rootUrl, showRowLimitNotice = false }) => { | ||
const hasACA = additionalParams && additionalParams.ACA ? true : false; | ||
let params = { | ||
authentication: hideAuth ? false : undefined, | ||
ACA: hasACA ? additionalParams.ACA : undefined, | ||
redirect: hasACA ? false : undefined, | ||
}; | ||
return ( | ||
<section className="ds-l-container"> | ||
<SwaggerUI | ||
url={`${rootUrl}${qs.stringify(params, { addQueryPrefix: true })}`} | ||
docExpansion={'list'} | ||
defaultModelsExpandDepth={-1} | ||
/> | ||
</section> | ||
) | ||
<> | ||
{showRowLimitNotice && <ApiRowLimitNotice />} | ||
<section className="ds-l-container"> | ||
<SwaggerUI | ||
url={`${rootUrl}${qs.stringify(params, { addQueryPrefix: true })}`} | ||
docExpansion={'list'} | ||
defaultModelsExpandDepth={-1} | ||
/> | ||
</section> | ||
</> | ||
); | ||
}; | ||
|
||
export default APIPage; |