Skip to content

Commit

Permalink
Add conditional row limit notice to APIPage template (#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcgoodwin2112 authored Feb 4, 2025
1 parent e6bb223 commit 5872103
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@civicactions/cmsds-open-data-components",
"version": "3.6.1",
"version": "3.6.2",
"description": "Components for the open data catalog frontend using CMS Design System",
"main": "dist/main.js",
"source": "src/index.ts",
Expand Down
22 changes: 13 additions & 9 deletions src/templates/APIPage/APIPage.jsx
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;

0 comments on commit 5872103

Please sign in to comment.