-
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.
Update package versions and dependencies
- Loading branch information
1 parent
8d4309d
commit 2ba152b
Showing
32 changed files
with
14,083 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,8 @@ yarn-error.log | |
.pnp.js | ||
|
||
# Build output | ||
/dist/ | ||
dist/ | ||
dist-types/ | ||
/build/ | ||
/out/ | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": "@backstage/cli/config/tsconfig.json", | ||
"include": [ | ||
"src" | ||
], | ||
"exclude": ["node_modules"], | ||
"compilerOptions": { | ||
"outDir": "dist-types", | ||
"rootDir": "." | ||
} | ||
} |
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,4 @@ | ||
* | ||
!dist/**/** | ||
!NOTICE | ||
!config.d.ts |
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,11 @@ | ||
declare module '*.svg' { | ||
import React = require('react'); | ||
export const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>; | ||
const src: string; | ||
export default src; | ||
} | ||
|
||
declare module '*.png' { | ||
const value: any; | ||
export = value; | ||
} |
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
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
27 changes: 27 additions & 0 deletions
27
packages/postman/src/components/MainComponent/MainComponent.test.tsx
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,27 @@ | ||
import React from 'react'; | ||
import { MainComponent } from './MainComponent'; | ||
import { rest } from 'msw'; | ||
import { setupServer } from 'msw/node'; | ||
import { screen } from '@testing-library/react'; | ||
import { | ||
setupRequestMockHandlers, | ||
renderInTestApp, | ||
} from "@backstage/test-utils"; | ||
|
||
describe('MainComponent', () => { | ||
const server = setupServer(); | ||
// Enable sane handlers for network requests | ||
setupRequestMockHandlers(server); | ||
|
||
// setup mock response | ||
beforeEach(() => { | ||
server.use( | ||
rest.get('/*', (_, res, ctx) => res(ctx.status(200), ctx.json({}))), | ||
); | ||
}); | ||
|
||
it('should render', async () => { | ||
await renderInTestApp(<MainComponent />); | ||
expect(screen.getByText('Welcome to postman!')).toBeInTheDocument(); | ||
}); | ||
}); |
66 changes: 66 additions & 0 deletions
66
packages/postman/src/components/MainComponent/MainComponent.tsx
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,66 @@ | ||
import React from 'react'; | ||
import { Grid } from '@material-ui/core'; | ||
import { | ||
InfoCard, | ||
Header, | ||
Page, | ||
Content, | ||
ContentHeader, | ||
HeaderLabel, | ||
MarkdownContent, | ||
} from '@backstage/core-components'; | ||
|
||
import APIView from './../../examples/images/api.png'; | ||
import MonitorView from './../../examples/images/monitor.png'; | ||
import CollectionView from './../../examples/images/collections.png'; | ||
|
||
const ReadMe = ` | ||
This plugin offers several views which you can use to display published API information stored in Postman, show collections with a *Run In Postman* button and allows you to view your Postman monitor results on the API page. | ||
## API View | ||
Displays your published Postman API data in Backstage, allowing you to access both the API information and the published API collections. | ||
![Postman API View](${APIView}) | ||
Refer to the [Postman API Metadata](https://github.com/postman-solutions-eng/backstage-demo/tree/main/plugins/postman#apis) to see the parameters needed to display this view. | ||
## Collections View | ||
Displays the collection(s) of a given API stored in Postman. This view includes a *Run in Postman* button, which is activated based on the collection ID(s) or tag defined in the 'entities.yaml' file. | ||
![Postman Collection View](${CollectionView}) | ||
Refer to the [Postman Collections Metadata](https://github.com/postman-solutions-eng/backstage-demo/tree/main/plugins/postman#collections-use-collection-tag-or-ids) to see the parameters needed to display this view. | ||
### Monitor View | ||
Shows the health of your API as determined by the monitor in Postman. The monitor can be displayed using either its 'name' or 'id'. | ||
![Postman Monitor View](${MonitorView}) | ||
For more details, refer to [this section](https://github.com/postman-solutions-eng/backstage-demo/tree/main/plugins/postman#monitors-use-monitor-id-or-name). | ||
## Coming soon | ||
A *Governance Checks* view will be added in future versions of this plugin. | ||
`; | ||
|
||
export const MainComponent = () => ( | ||
<Page themeId="tool"> | ||
<Header title="Welcome to the Postman plugin page!" subtitle="A backstage plugin designed to demonstrate how Postman can be integrated in Bacjstage to manage APIs and streamline development workflows."> | ||
<HeaderLabel label="Owner" value="Postman Solutions" /> | ||
<HeaderLabel label="Lifecycle" value="Production" /> | ||
</Header> | ||
<Content> | ||
<ContentHeader title="Postman" /> | ||
<Grid container spacing={3} direction="column"> | ||
<Grid item> | ||
<InfoCard title="Plugin Views"> | ||
<MarkdownContent content={ReadMe} /> | ||
</InfoCard> | ||
</Grid> | ||
</Grid> | ||
</Content> | ||
</Page> | ||
); |
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 @@ | ||
export { MainComponent } from './MainComponent'; |
Oops, something went wrong.