Skip to content

Commit 69512d9

Browse files
committed
EIWFY23Q4-1 Add Connect Confluence/Jira example schemas
1 parent 8bf0f0a commit 69512d9

File tree

4 files changed

+30
-12
lines changed

4 files changed

+30
-12
lines changed

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ node_modules
55
/dist
66
/src/schema.ts
77
*.zip
8-
/packaged.template
8+
/packaged.template
9+
10+
# Editors
11+
.idea

src/SchemaApp.tsx

+8-10
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { linkToRoot } from './route-path';
1111
import { ContentPropsWithClose, PrimaryDropdown } from './PrimaryDropdown';
1212
import { Docs } from './Docs';
1313
import { getRecentlyViewedLinks, RecentlyViewedLink } from './recently-viewed';
14+
import { exampleSchemas } from "./example-schemas";
1415

1516
const JsonSchemaHome = () => (
1617
<ProductHome icon={AtlassianIcon} logo={AtlassianLogo} siteTitle="JSON Schema Viewer" />
@@ -54,16 +55,13 @@ const RecentlyViewedMenu: React.FC<RecentlyViewedMenuProps> = (props) => {
5455

5556
const ExampleMenu: React.FC<ContentPropsWithClose> = (props) => (
5657
<PopupMenuGroup>
57-
<Section title="Schema examples">
58-
<NavigationButtonItem onClick={props.closePopup} exampleUrl="https://unpkg.com/@forge/manifest@latest/out/schema/manifest-schema.json">Atlassian Forge</NavigationButtonItem>
59-
<NavigationButtonItem onClick={props.closePopup} exampleUrl="https://raw.githubusercontent.com/OAI/OpenAPI-Specification/3.0.3/schemas/v3.0/schema.json">OpenAPI (v3)</NavigationButtonItem>
60-
<NavigationButtonItem onClick={props.closePopup} exampleUrl="https://json.schemastore.org/swagger-2.0">Swagger (v2)</NavigationButtonItem>
61-
<NavigationButtonItem onClick={props.closePopup} exampleUrl="https://json.schemastore.org/package">package.json</NavigationButtonItem>
62-
</Section>
63-
<Section title="JSON Schema Meta Schemas">
64-
<NavigationButtonItem onClick={props.closePopup} exampleUrl="https://json-schema.org/draft-07/schema">Draft-07</NavigationButtonItem>
65-
<NavigationButtonItem onClick={props.closePopup} exampleUrl="https://json-schema.org/draft-04/schema">Draft-04</NavigationButtonItem>
66-
</Section>
58+
{Array.from(Object.entries(exampleSchemas)).map(([title, links]) => (
59+
<Section title={title}>
60+
{Array.from(Object.entries(links)).map(([linkTitle, url]) => (
61+
<NavigationButtonItem onClick={props.closePopup} exampleUrl={url}>{linkTitle}</NavigationButtonItem>
62+
))}
63+
</Section>
64+
))}
6765
<Section title="Schema repositories">
6866
<NewTabLinkItem href="https://www.schemastore.org/" onClick={props.closePopup}>Schemastore Repository</NewTabLinkItem>
6967
</Section>

src/example-schemas.ts

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
type ExampleSchemaSection = Record<string, string>
2+
export const exampleSchemas: Record<string, ExampleSchemaSection> = {
3+
"Atlassian schema examples": {
4+
"Atlassian Forge": "https://unpkg.com/@forge/manifest@latest/out/schema/manifest-schema.json",
5+
"Atlassian Connect - Confluence": "https://bitbucket.org/atlassian/connect-schemas/raw/master/confluence-global-schema.json",
6+
"Atlassian Connect - Jira": "https://bitbucket.org/atlassian/connect-schemas/raw/master/jira-global-schema.json"
7+
},
8+
"Schema examples": {
9+
"OpenAPI (v3)": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/3.0.3/schemas/v3.0/schema.json",
10+
"Swagger (v2)": "https://json.schemastore.org/swagger-2.0",
11+
"NPM (package.json)": "https://json.schemastore.org/package"
12+
},
13+
"JSON Schema Meta Schemas": {
14+
"Draft-07": "https://json-schema.org/draft-07/schema",
15+
"Draft-04": "https://json-schema.org/draft-04/schema"
16+
}
17+
}

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// "incremental": true, /* Enable incremental compilation */
77
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
88
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
9-
// "lib": [], /* Specify library files to be included in the compilation. */
9+
"lib": ["es2017"], /* Specify library files to be included in the compilation. */
1010
// "allowJs": true, /* Allow javascript files to be compiled. */
1111
// "checkJs": true, /* Report errors in .js files. */
1212
"jsx": "react", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */

0 commit comments

Comments
 (0)