fix: updated components to follow the naming conventions
Signed-off-by: Talita Gregory Nunes Freire <talita.freire@dazn.com>
This commit is contained in:
@@ -16,10 +16,10 @@ Install the plugin by running the following command **from your Backstage root d
|
||||
|
||||
`yarn --cwd packages/app add @backstage/plugin-github-pull-requests-board`
|
||||
|
||||
The plugin exports the **TeamPullRequestsBoard** component which can be added to the Overview page of the team at `backstage/packages/app/src/components/catalog/EntityPage.tsx`
|
||||
The plugin exports the **EntityTeamPullRequestsCard** component which can be added to the Overview page of the team at `backstage/packages/app/src/components/catalog/EntityPage.tsx`
|
||||
|
||||
```javascript
|
||||
import { TeamPullRequestsBoard } from '@backstage/plugin-github-pull-requests-board';
|
||||
import { EntityTeamPullRequestsCard } from '@backstage/plugin-github-pull-requests-board';
|
||||
|
||||
const groupPage = (
|
||||
<EntityLayoutWrapper>
|
||||
@@ -39,7 +39,7 @@ const groupPage = (
|
||||
<EntityMembersListCard />
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<TeamPullRequestsBoard />
|
||||
<EntityTeamPullRequestsCard />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</EntityLayout.Route>
|
||||
@@ -47,10 +47,10 @@ const groupPage = (
|
||||
);
|
||||
```
|
||||
|
||||
Or you can also import the **TeamPullRequestsPage** component which can be used to add a new tab under the group page at `backstage/packages/app/src/components/catalog/EntityPage.tsx`
|
||||
Or you can also import the **EntityTeamPullRequestsContent** component which can be used to add a new tab under the group page at `backstage/packages/app/src/components/catalog/EntityPage.tsx`
|
||||
|
||||
```javascript
|
||||
import { TeamPullRequestsPage } from '@backstage/plugin-github-pull-requests-board';
|
||||
import { EntityTeamPullRequestsContent } from '@backstage/plugin-github-pull-requests-board';
|
||||
|
||||
const groupPage = (
|
||||
<EntityLayoutWrapper>
|
||||
@@ -72,7 +72,7 @@ const groupPage = (
|
||||
</Grid>
|
||||
</EntityLayout.Route>
|
||||
<EntityLayout.Route path="/pull-requests" title="Pull Requests">
|
||||
<TeamPullRequestsPage />
|
||||
<EntityTeamPullRequestsContent />
|
||||
</EntityLayout.Route>
|
||||
</EntityLayoutWrapper>;
|
||||
)
|
||||
|
||||
@@ -7,15 +7,15 @@
|
||||
|
||||
import { FunctionComponent } from 'react';
|
||||
|
||||
// Warning: (ae-missing-release-tag) "TeamPullRequestsBoard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
// Warning: (ae-missing-release-tag) "EntityTeamPullRequestsCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const TeamPullRequestsBoard: FunctionComponent<{}>;
|
||||
export const EntityTeamPullRequestsCard: FunctionComponent<{}>;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "TeamPullRequestsPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
// Warning: (ae-missing-release-tag) "EntityTeamPullRequestsContent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const TeamPullRequestsPage: FunctionComponent<{}>;
|
||||
export const EntityTeamPullRequestsContent: FunctionComponent<{}>;
|
||||
|
||||
// (No @packageDocumentation comment for this package)
|
||||
```
|
||||
|
||||
+2
-2
@@ -28,7 +28,7 @@ import { PRCardFormating } from '../../utils/types';
|
||||
import { DraftPrIcon } from '../icons/DraftPr';
|
||||
import { useUserRepositories } from '../../hooks/useUserRepositories';
|
||||
|
||||
const TeamPullRequestsBoard: FunctionComponent = () => {
|
||||
const EntityTeamPullRequestsCard: FunctionComponent = () => {
|
||||
const [infoCardFormat, setInfoCardFormat] = useState<PRCardFormating[]>([]);
|
||||
const { repositories } = useUserRepositories();
|
||||
const { loading, pullRequests, refreshPullRequests } =
|
||||
@@ -110,4 +110,4 @@ const TeamPullRequestsBoard: FunctionComponent = () => {
|
||||
return <InfoCard title={header}>{getContent()}</InfoCard>;
|
||||
};
|
||||
|
||||
export default TeamPullRequestsBoard;
|
||||
export default EntityTeamPullRequestsCard;
|
||||
+1
-1
@@ -13,4 +13,4 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
export { default as TeamPullRequestsBoard } from './TeamPullRequestsBoard';
|
||||
export { default as EntityTeamPullRequestsCard } from './EntityTeamPullRequestsCard';
|
||||
+7
-7
@@ -17,16 +17,16 @@ import React, { FunctionComponent, useState } from 'react';
|
||||
import { Grid, Typography } from '@material-ui/core';
|
||||
import { Progress, InfoCard } from '@backstage/core-components';
|
||||
|
||||
import { InfoCardHeader } from '../../components/InfoCardHeader';
|
||||
import { PullRequestBoardOptions } from '../../components/PullRequestBoardOptions';
|
||||
import { Wrapper } from '../../components/Wrapper';
|
||||
import { PullRequestCard } from '../../components/PullRequestCard';
|
||||
import { InfoCardHeader } from '../InfoCardHeader';
|
||||
import { PullRequestBoardOptions } from '../PullRequestBoardOptions';
|
||||
import { Wrapper } from '../Wrapper';
|
||||
import { PullRequestCard } from '../PullRequestCard';
|
||||
import { usePullRequestsByTeam } from '../../hooks/usePullRequestsByTeam';
|
||||
import { PRCardFormating } from '../../utils/types';
|
||||
import { DraftPrIcon } from '../../components/icons/DraftPr';
|
||||
import { DraftPrIcon } from '../icons/DraftPr';
|
||||
import { useUserRepositories } from '../../hooks/useUserRepositories';
|
||||
|
||||
const TeamPullRequestsPage: FunctionComponent = () => {
|
||||
const EntityTeamPullRequestsContent: FunctionComponent = () => {
|
||||
const [infoCardFormat, setInfoCardFormat] = useState<PRCardFormating[]>([]);
|
||||
const { repositories } = useUserRepositories();
|
||||
const { loading, pullRequests, refreshPullRequests } =
|
||||
@@ -100,4 +100,4 @@ const TeamPullRequestsPage: FunctionComponent = () => {
|
||||
return <InfoCard title={header}>{getContent()}</InfoCard>;
|
||||
};
|
||||
|
||||
export default TeamPullRequestsPage;
|
||||
export default EntityTeamPullRequestsContent;
|
||||
+1
-1
@@ -13,4 +13,4 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
export { default as TeamPullRequestsPage } from './TeamPullRequestsPage';
|
||||
export { default as EntityTeamPullRequestsContent } from './EntityTeamPullRequestsContent';
|
||||
@@ -13,4 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
export { TeamPullRequestsBoard, TeamPullRequestsPage } from './plugin';
|
||||
export {
|
||||
EntityTeamPullRequestsCard,
|
||||
EntityTeamPullRequestsContent,
|
||||
} from './plugin';
|
||||
|
||||
@@ -13,13 +13,16 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { TeamPullRequestsBoard, TeamPullRequestsPage } from './plugin';
|
||||
import {
|
||||
EntityTeamPullRequestsCard,
|
||||
EntityTeamPullRequestsContent,
|
||||
} from './plugin';
|
||||
|
||||
describe('github-pull-requests-board', () => {
|
||||
it('should export TeamPullRequestsBoard', () => {
|
||||
expect(TeamPullRequestsBoard).toBeDefined();
|
||||
it('should export EntityTeamPullRequestsCard', () => {
|
||||
expect(EntityTeamPullRequestsCard).toBeDefined();
|
||||
});
|
||||
it('should export TeamPullRequestsPage', () => {
|
||||
expect(TeamPullRequestsPage).toBeDefined();
|
||||
it('should export EntityTeamPullRequestsContent', () => {
|
||||
expect(EntityTeamPullRequestsContent).toBeDefined();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -27,25 +27,26 @@ const githubPullRequestsBoardPlugin = createPlugin({
|
||||
},
|
||||
});
|
||||
|
||||
export const TeamPullRequestsBoard = githubPullRequestsBoardPlugin.provide(
|
||||
export const EntityTeamPullRequestsCard = githubPullRequestsBoardPlugin.provide(
|
||||
createComponentExtension({
|
||||
name: 'TeamPullRequestsBoard',
|
||||
name: 'EntityTeamPullRequestsCard',
|
||||
component: {
|
||||
lazy: () =>
|
||||
import('./components/TeamPullRequestsBoard').then(
|
||||
m => m.TeamPullRequestsBoard,
|
||||
import('./components/EntityTeamPullRequestsCard').then(
|
||||
m => m.EntityTeamPullRequestsCard,
|
||||
),
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
export const TeamPullRequestsPage = githubPullRequestsBoardPlugin.provide(
|
||||
createRoutableExtension({
|
||||
name: 'PullRequestPage',
|
||||
component: () =>
|
||||
import('./components/TeamPullRequestsPage').then(
|
||||
m => m.TeamPullRequestsPage,
|
||||
),
|
||||
mountPoint: rootRouteRef,
|
||||
}),
|
||||
);
|
||||
export const EntityTeamPullRequestsContent =
|
||||
githubPullRequestsBoardPlugin.provide(
|
||||
createRoutableExtension({
|
||||
name: 'PullRequestPage',
|
||||
component: () =>
|
||||
import('./components/EntityTeamPullRequestsContent').then(
|
||||
m => m.EntityTeamPullRequestsContent,
|
||||
),
|
||||
mountPoint: rootRouteRef,
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user