From 53de5363e1470a0e700ac1fa816d63b8d6dd3e4a Mon Sep 17 00:00:00 2001 From: Talita Gregory Nunes Freire Date: Fri, 27 May 2022 11:22:15 +0200 Subject: [PATCH] fix: updated components to follow the naming conventions Signed-off-by: Talita Gregory Nunes Freire --- plugins/github-pull-requests-board/README.md | 12 ++++---- .../github-pull-requests-board/api-report.md | 8 ++--- .../EntityTeamPullRequestsCard.tsx} | 4 +-- .../index.ts | 2 +- .../EntityTeamPullRequestsContent.tsx} | 14 ++++----- .../index.ts | 2 +- .../github-pull-requests-board/src/index.ts | 5 +++- .../src/plugin.test.ts | 13 +++++---- .../github-pull-requests-board/src/plugin.ts | 29 ++++++++++--------- 9 files changed, 48 insertions(+), 41 deletions(-) rename plugins/github-pull-requests-board/src/components/{TeamPullRequestsBoard/TeamPullRequestsBoard.tsx => EntityTeamPullRequestsCard/EntityTeamPullRequestsCard.tsx} (97%) rename plugins/github-pull-requests-board/src/components/{TeamPullRequestsBoard => EntityTeamPullRequestsCard}/index.ts (87%) rename plugins/github-pull-requests-board/src/components/{TeamPullRequestsPage/TeamPullRequestsPage.tsx => EntityTeamPullRequestsContent/EntityTeamPullRequestsContent.tsx} (88%) rename plugins/github-pull-requests-board/src/components/{TeamPullRequestsPage => EntityTeamPullRequestsContent}/index.ts (86%) diff --git a/plugins/github-pull-requests-board/README.md b/plugins/github-pull-requests-board/README.md index a49bcc02e0..c8b14fe581 100644 --- a/plugins/github-pull-requests-board/README.md +++ b/plugins/github-pull-requests-board/README.md @@ -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 = ( @@ -39,7 +39,7 @@ const groupPage = ( - + @@ -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 = ( @@ -72,7 +72,7 @@ const groupPage = ( - + ; ) diff --git a/plugins/github-pull-requests-board/api-report.md b/plugins/github-pull-requests-board/api-report.md index 8bded2d581..33814c76b4 100644 --- a/plugins/github-pull-requests-board/api-report.md +++ b/plugins/github-pull-requests-board/api-report.md @@ -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) ``` diff --git a/plugins/github-pull-requests-board/src/components/TeamPullRequestsBoard/TeamPullRequestsBoard.tsx b/plugins/github-pull-requests-board/src/components/EntityTeamPullRequestsCard/EntityTeamPullRequestsCard.tsx similarity index 97% rename from plugins/github-pull-requests-board/src/components/TeamPullRequestsBoard/TeamPullRequestsBoard.tsx rename to plugins/github-pull-requests-board/src/components/EntityTeamPullRequestsCard/EntityTeamPullRequestsCard.tsx index 8aee285d36..b19651536a 100644 --- a/plugins/github-pull-requests-board/src/components/TeamPullRequestsBoard/TeamPullRequestsBoard.tsx +++ b/plugins/github-pull-requests-board/src/components/EntityTeamPullRequestsCard/EntityTeamPullRequestsCard.tsx @@ -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([]); const { repositories } = useUserRepositories(); const { loading, pullRequests, refreshPullRequests } = @@ -110,4 +110,4 @@ const TeamPullRequestsBoard: FunctionComponent = () => { return {getContent()}; }; -export default TeamPullRequestsBoard; +export default EntityTeamPullRequestsCard; diff --git a/plugins/github-pull-requests-board/src/components/TeamPullRequestsBoard/index.ts b/plugins/github-pull-requests-board/src/components/EntityTeamPullRequestsCard/index.ts similarity index 87% rename from plugins/github-pull-requests-board/src/components/TeamPullRequestsBoard/index.ts rename to plugins/github-pull-requests-board/src/components/EntityTeamPullRequestsCard/index.ts index c8e25cfff8..bac16f1424 100644 --- a/plugins/github-pull-requests-board/src/components/TeamPullRequestsBoard/index.ts +++ b/plugins/github-pull-requests-board/src/components/EntityTeamPullRequestsCard/index.ts @@ -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'; diff --git a/plugins/github-pull-requests-board/src/components/TeamPullRequestsPage/TeamPullRequestsPage.tsx b/plugins/github-pull-requests-board/src/components/EntityTeamPullRequestsContent/EntityTeamPullRequestsContent.tsx similarity index 88% rename from plugins/github-pull-requests-board/src/components/TeamPullRequestsPage/TeamPullRequestsPage.tsx rename to plugins/github-pull-requests-board/src/components/EntityTeamPullRequestsContent/EntityTeamPullRequestsContent.tsx index 8761c55682..33980e2364 100644 --- a/plugins/github-pull-requests-board/src/components/TeamPullRequestsPage/TeamPullRequestsPage.tsx +++ b/plugins/github-pull-requests-board/src/components/EntityTeamPullRequestsContent/EntityTeamPullRequestsContent.tsx @@ -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([]); const { repositories } = useUserRepositories(); const { loading, pullRequests, refreshPullRequests } = @@ -100,4 +100,4 @@ const TeamPullRequestsPage: FunctionComponent = () => { return {getContent()}; }; -export default TeamPullRequestsPage; +export default EntityTeamPullRequestsContent; diff --git a/plugins/github-pull-requests-board/src/components/TeamPullRequestsPage/index.ts b/plugins/github-pull-requests-board/src/components/EntityTeamPullRequestsContent/index.ts similarity index 86% rename from plugins/github-pull-requests-board/src/components/TeamPullRequestsPage/index.ts rename to plugins/github-pull-requests-board/src/components/EntityTeamPullRequestsContent/index.ts index b2f3619eaf..c2be57464c 100644 --- a/plugins/github-pull-requests-board/src/components/TeamPullRequestsPage/index.ts +++ b/plugins/github-pull-requests-board/src/components/EntityTeamPullRequestsContent/index.ts @@ -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'; diff --git a/plugins/github-pull-requests-board/src/index.ts b/plugins/github-pull-requests-board/src/index.ts index 579b19b315..d9cffaa468 100644 --- a/plugins/github-pull-requests-board/src/index.ts +++ b/plugins/github-pull-requests-board/src/index.ts @@ -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'; diff --git a/plugins/github-pull-requests-board/src/plugin.test.ts b/plugins/github-pull-requests-board/src/plugin.test.ts index 0204620ba5..84f5d801e6 100644 --- a/plugins/github-pull-requests-board/src/plugin.test.ts +++ b/plugins/github-pull-requests-board/src/plugin.test.ts @@ -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(); }); }); diff --git a/plugins/github-pull-requests-board/src/plugin.ts b/plugins/github-pull-requests-board/src/plugin.ts index e302d138fb..c3ed426dec 100644 --- a/plugins/github-pull-requests-board/src/plugin.ts +++ b/plugins/github-pull-requests-board/src/plugin.ts @@ -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, + }), + );