Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Display of API Documents #500

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ function Documents(props) {
const promisedApi = restApi.getDocumentsByAPIId(apiId);
promisedApi
.then((response) => {
const overviewDoc = response.body.list.filter((item) => item.otherTypeName !== '_overview');
const overviewDoc = response.body.list.filter((item) => item.otherTypeName !== 'overview');
if (api.type === 'HTTP') {
const swaggerDoc = { documentId: 'default', name: 'Default', type: '' };
overviewDoc.unshift(swaggerDoc);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ function View(props) {
};
return (
<>
{(doc.summary && doc.otherTypeName !== '_overview') && (
{(doc.summary && doc.otherTypeName !== 'overview') && (
<Typography variant='body1' className={classes.docSummary}>
{doc.summary}
</Typography>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ function Overview() {
const restApi = new API();
return restApi.getDocumentsByAPIId(api.id)
.then((response) => {
const overviewDoc = response.body.list.filter((item) => item.otherTypeName === '_overview');
const overviewDoc = response.body.list.filter((item) => item.otherTypeName === 'overview');
if (overviewDoc.length > 0) {
// We can override the UI with this content
setOverviewDocOverride(overviewDoc[0]); // Only one doc we can render
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class Listing extends React.Component {
const apiProduct = new APIProduct();
const docs = apiProduct.getDocuments(api.id);
docs.then((response) => {
const documentList = response.body.list.filter((item) => item.otherTypeName !== '_overview');
const documentList = response.body.list.filter((item) => item.otherTypeName !== 'overview');
documentList.sort(getSortOrder('name'));
this.setState({ docs: documentList });
}).catch((errorResponse) => {
Expand All @@ -184,7 +184,7 @@ class Listing extends React.Component {
const newApi = new API();
const docs = newApi.getDocuments(api.id);
docs.then((response) => {
const documentList = response.body.list.filter((item) => item.otherTypeName !== '_overview');
const documentList = response.body.list.filter((item) => item.otherTypeName !== 'overview');
documentList.sort(getSortOrder('name'));
this.setState({ docs: documentList });
}).catch((errorResponse) => {
Expand Down Expand Up @@ -610,4 +610,4 @@ Listing.propTypes = {
}).isRequired,
};

export default injectIntl(withAPI(withStyles(styles)(Listing)));
export default injectIntl(withAPI(withStyles(styles)(Listing)));