Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
062289b
commit c5e2cf4
Showing
13 changed files
with
3,425 additions
and
18 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React, { useEffect } from "react"; | ||
import SwaggerUI from "swagger-ui"; | ||
import swaggerData from "../utils/swaggerData"; | ||
import 'swagger-ui/dist/swagger-ui.css'; | ||
|
||
const SwaggerUIComp = () => { | ||
|
||
useEffect(() => { | ||
SwaggerUI({ | ||
spec: swaggerData, | ||
dom_id: '#swagger' | ||
}); | ||
}, []); | ||
|
||
return <div id="swagger"></div> | ||
|
||
}; | ||
|
||
export default SwaggerUIComp; |
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
h3 { | ||
margin-top: 2.0rem; | ||
margin-bottom: 0.8rem; | ||
padding-left: 0; | ||
border-left: none; | ||
color: #3b4151; | ||
font-size: 1.75rem; | ||
margin: 0 0 5px; | ||
box-sizing: border-box; | ||
} | ||
.swagger-ui .info .title { | ||
color: #161616; | ||
font-family: "IBM Plex Sans"; | ||
font-size: 2rem; | ||
font-weight: 400; | ||
line-height: 1.25; | ||
letter-spacing: 0; | ||
} | ||
.swagger-ui .wrapper { | ||
box-sizing: border-box; | ||
margin: 0; | ||
max-width: 1460px; | ||
padding: 0; | ||
width: 100%; | ||
} | ||
.doc-title { | ||
display: flex; | ||
flex-flow: row nowrap; | ||
justify-content: left; | ||
align-items: baseline; | ||
} | ||
.doc-section-legend ul { | ||
margin-top: 2.0rem; | ||
margin-left: 10px; | ||
} | ||
.doc-tag { | ||
margin-bottom: 2.0rem; | ||
display: flex; | ||
flex-flow: column nowrap; | ||
justify-content: flex-start; | ||
align-content: flex-start; | ||
} | ||
.doc-tag-item { | ||
display: flex; | ||
flex-flow: row wrap; | ||
} | ||
.doc-tag-item > div { | ||
margin-left: -8px; | ||
padding: 0 8px 0 8px; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import React from "react"; | ||
import { Grid, Row, Column, Content, Tag } from "carbon-components-react"; | ||
import { SwaggerUIComp } from "../components"; | ||
import "./HqPageSwagger.css"; | ||
|
||
|
||
const HqPageSwagger = () => { | ||
|
||
const colors = [ | ||
{ | ||
color: "red", | ||
name: "has-blocker", | ||
desc: "Red contains a blocker. Supersedes active.", | ||
}, | ||
{ | ||
color: "blue", | ||
name: "has-active", | ||
desc: "Blue contains open active items (in progress or milestone ♦). Supersedes pending.", | ||
}, | ||
{ | ||
color: "teal", | ||
name: "has-pending", | ||
desc: "Teal contains open pending items (backlog, none in progress). Supersedes green.", | ||
}, | ||
{ | ||
color: "green", | ||
name: "has-closed", | ||
desc: "Green contains closed items (nothing currently open).", | ||
}, | ||
]; | ||
|
||
return ( | ||
<Grid> | ||
<Row> | ||
<Column> | ||
<Content className="doc-page-content"> | ||
<h1>Help</h1> | ||
<ul> | ||
<li>To scroll through the tag list when viewed from a desktop browser, | ||
use the arrow buttons or hold down Shift while scrolling the mouse wheel.</li> | ||
</ul> | ||
<h2 id="doc-legend">Tag color legend</h2> | ||
<div className="doc-section-legend"> | ||
<ul> | ||
{colors.map((c) => ( | ||
<li className="doc-tag" key={c.name}> | ||
<div className="doc-tag-item"> | ||
<Tag type={c.color} id={c.name} title={c.name}> | ||
<span>{c.name.replace('-', ' ')}</span> | ||
</Tag> | ||
</div> | ||
<div className="doc-tag-description">{c.desc}</div> | ||
</li> | ||
))} | ||
</ul> | ||
</div> | ||
<SwaggerUIComp/> | ||
</Content> | ||
</Column> | ||
</Row> | ||
</Grid> | ||
); | ||
}; | ||
|
||
export default HqPageSwagger; |
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,3 +1,4 @@ | ||
export { default as HqPageAll } from "./HqPageAll"; | ||
export { default as HqPageTag } from "./HqPageTag"; | ||
export { default as HqPageDoc } from "./HqPageDoc"; | ||
export { default as HqPageSwagger } from "./HqPageSwagger"; |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Creating the swagger doc | ||
|
||
Some utilities in this directory are for manual use to create the Swagger doc. | ||
The `serverApi.yml` file is the source of truth for the Swagger doc. | ||
|
||
To create examples to be added to `serverApi.yml`: | ||
|
||
1. Query the server API and copy the raw JSON (or HTML for `/ejs` endpoints) data. | ||
2. Paste that data as the value for `origdata` in the `stringify.js` file. | ||
3. Run `node stringify.js` to product the `strung.json file`. | ||
4. Edit `strung.json` content as needed and copy'n'paste the results into `serverApi.yml` | ||
where needed. | ||
|
||
When finished editing `serverApi.yml`, to prepare the content for inclusion into the app, | ||
run `python3 y2j.py`, which turns the YML into JSON and rewrites the `swaggerData.js` file, | ||
That file is used in the `SwaggerUIComp.js` component. |
Oops, something went wrong.