feat: Created initial PullRequestsPage component.

Signed-off-by: Marley Powell <Marley.Powell@exclaimer.com>
This commit is contained in:
Marley Powell
2021-11-08 10:04:20 +00:00
parent 94d942a147
commit 0c97cb0eb4
4 changed files with 69 additions and 5 deletions
@@ -0,0 +1,28 @@
/*
* Copyright 2021 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Content, Header, Page } from '@backstage/core-components';
import React from 'react';
export const PullRequestsPage = () => {
return (
<Page themeId="tool">
<Header title="Azure Pull Requests" />
<Content />
</Page>
);
};
@@ -0,0 +1,17 @@
/*
* Copyright 2021 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { PullRequestsPage } from './PullRequestsPage';
+16 -3
View File
@@ -14,6 +14,10 @@
* limitations under the License.
*/
import {
azurePipelinesEntityContentRouteRef,
azurePrsRootRouteRef,
} from './routes';
import {
createApiFactory,
createPlugin,
@@ -26,7 +30,6 @@ import { AZURE_DEVOPS_ANNOTATION } from './constants';
import { AzureDevOpsClient } from './api/AzureDevOpsClient';
import { Entity } from '@backstage/catalog-model';
import { azureDevOpsApiRef } from './api/AzureDevOpsApi';
import { azureDevOpsRouteRef } from './routes';
export const isAzureDevOpsAvailable = (entity: Entity) =>
Boolean(entity.metadata.annotations?.[AZURE_DEVOPS_ANNOTATION]);
@@ -42,10 +45,20 @@ export const azureDevOpsPlugin = createPlugin({
}),
],
routes: {
entityContent: azureDevOpsRouteRef,
azurePrsRoot: azurePrsRootRouteRef,
azurePipelinesEntityContent: azurePipelinesEntityContentRouteRef,
},
});
export const AzurePullRequestsPage = azureDevOpsPlugin.provide(
createRoutableExtension({
name: 'AzurePullRequestsPage',
component: () =>
import('./components/PullRequestsPage').then(m => m.PullRequestsPage),
mountPoint: azurePrsRootRouteRef,
}),
);
export const EntityAzurePipelinesContent = azureDevOpsPlugin.provide(
createRoutableExtension({
name: 'EntityAzurePipelinesContent',
@@ -53,6 +66,6 @@ export const EntityAzurePipelinesContent = azureDevOpsPlugin.provide(
import('./components/EntityPageAzurePipelines').then(
m => m.EntityPageAzurePipelines,
),
mountPoint: azureDevOpsRouteRef,
mountPoint: azurePipelinesEntityContentRouteRef,
}),
);
+8 -2
View File
@@ -13,8 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { createRouteRef } from '@backstage/core-plugin-api';
export const azureDevOpsRouteRef = createRouteRef({
title: 'azure-devops',
export const azurePrsRootRouteRef = createRouteRef({
path: '',
title: 'Azure Pull Requests',
});
export const azurePipelinesEntityContentRouteRef = createRouteRef({
title: 'Azure Pipelines Entity Content',
});