Merge branch 'master' into rugvip/test-port
This commit is contained in:
@@ -1,5 +1,16 @@
|
||||
# @backstage/plugin-jenkins
|
||||
|
||||
## 0.5.12
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- a125278b81: Refactor out the deprecated path and icon from RouteRefs
|
||||
- Updated dependencies
|
||||
- @backstage/catalog-model@0.9.7
|
||||
- @backstage/plugin-catalog-react@0.6.4
|
||||
- @backstage/core-components@0.7.4
|
||||
- @backstage/core-plugin-api@0.2.0
|
||||
|
||||
## 0.5.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/plugin-jenkins",
|
||||
"description": "A Backstage plugin that integrates towards Jenkins",
|
||||
"version": "0.5.11",
|
||||
"version": "0.5.12",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"license": "Apache-2.0",
|
||||
@@ -32,10 +32,10 @@
|
||||
"clean": "backstage-cli clean"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/catalog-model": "^0.9.5",
|
||||
"@backstage/core-components": "^0.7.3",
|
||||
"@backstage/core-plugin-api": "^0.1.13",
|
||||
"@backstage/plugin-catalog-react": "^0.6.1",
|
||||
"@backstage/catalog-model": "^0.9.7",
|
||||
"@backstage/core-components": "^0.7.4",
|
||||
"@backstage/core-plugin-api": "^0.2.0",
|
||||
"@backstage/plugin-catalog-react": "^0.6.4",
|
||||
"@backstage/theme": "^0.2.13",
|
||||
"@material-ui/core": "^4.12.2",
|
||||
"@material-ui/icons": "^4.9.1",
|
||||
@@ -48,10 +48,10 @@
|
||||
"react-use": "^17.2.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.8.2",
|
||||
"@backstage/core-app-api": "^0.1.20",
|
||||
"@backstage/dev-utils": "^0.2.12",
|
||||
"@backstage/test-utils": "^0.1.21",
|
||||
"@backstage/cli": "^0.9.0",
|
||||
"@backstage/core-app-api": "^0.1.22",
|
||||
"@backstage/dev-utils": "^0.2.13",
|
||||
"@backstage/test-utils": "^0.1.22",
|
||||
"@testing-library/jest-dom": "^5.10.1",
|
||||
"@testing-library/react": "^11.2.5",
|
||||
"@testing-library/user-event": "^13.1.8",
|
||||
|
||||
@@ -17,12 +17,13 @@ import React from 'react';
|
||||
import { Box, IconButton, Link, Typography, Tooltip } from '@material-ui/core';
|
||||
import RetryIcon from '@material-ui/icons/Replay';
|
||||
import JenkinsLogo from '../../../../assets/JenkinsLogo.svg';
|
||||
import { generatePath, Link as RouterLink } from 'react-router-dom';
|
||||
import { Link as RouterLink } from 'react-router-dom';
|
||||
import { JenkinsRunStatus } from '../Status';
|
||||
import { useBuilds } from '../../../useBuilds';
|
||||
import { buildRouteRef } from '../../../../plugin';
|
||||
import { Table, TableColumn } from '@backstage/core-components';
|
||||
import { Project } from '../../../../api/JenkinsApi';
|
||||
import { useRouteRef } from '@backstage/core-plugin-api';
|
||||
|
||||
const FailCount = ({ count }: { count: number }): JSX.Element | null => {
|
||||
if (count !== 0) {
|
||||
@@ -91,28 +92,33 @@ const generatedColumns: TableColumn[] = [
|
||||
field: 'fullName',
|
||||
highlight: true,
|
||||
render: (row: Partial<Project>) => {
|
||||
if (!row.fullName || !row.lastBuild?.number) {
|
||||
return (
|
||||
<>
|
||||
{row.fullName ||
|
||||
row.fullDisplayName ||
|
||||
row.displayName ||
|
||||
'Unknown'}
|
||||
</>
|
||||
);
|
||||
}
|
||||
const LinkWrapper = () => {
|
||||
const routeLink = useRouteRef(buildRouteRef);
|
||||
if (!row.fullName || !row.lastBuild?.number) {
|
||||
return (
|
||||
<>
|
||||
{row.fullName ||
|
||||
row.fullDisplayName ||
|
||||
row.displayName ||
|
||||
'Unknown'}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Link
|
||||
component={RouterLink}
|
||||
to={generatePath(buildRouteRef.path, {
|
||||
jobFullName: encodeURIComponent(row.fullName),
|
||||
buildNumber: String(row.lastBuild?.number),
|
||||
})}
|
||||
>
|
||||
{row.fullDisplayName}
|
||||
</Link>
|
||||
);
|
||||
return (
|
||||
<Link
|
||||
component={RouterLink}
|
||||
to={routeLink({
|
||||
jobFullName: encodeURIComponent(row.fullName),
|
||||
buildNumber: String(row.lastBuild?.number),
|
||||
})}
|
||||
>
|
||||
{row.fullDisplayName}
|
||||
</Link>
|
||||
);
|
||||
};
|
||||
|
||||
return <LinkWrapper />;
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ import { useEntity } from '@backstage/plugin-catalog-react';
|
||||
import React from 'react';
|
||||
import { Route, Routes } from 'react-router';
|
||||
import { JENKINS_ANNOTATION, LEGACY_JENKINS_ANNOTATION } from '../constants';
|
||||
import { buildRouteRef, rootRouteRef } from '../plugin';
|
||||
import { buildRouteRef } from '../plugin';
|
||||
import { CITable } from './BuildsPage/lib/CITable';
|
||||
import { DetailedViewPage } from './BuildWithStepsPage/';
|
||||
|
||||
@@ -41,7 +41,7 @@ export const Router = (_props: Props) => {
|
||||
|
||||
return (
|
||||
<Routes>
|
||||
<Route path={`/${rootRouteRef.path}`} element={<CITable />} />
|
||||
<Route path="/" element={<CITable />} />
|
||||
<Route path={`/${buildRouteRef.path}`} element={<DetailedViewPage />} />
|
||||
</Routes>
|
||||
);
|
||||
|
||||
@@ -20,20 +20,20 @@ import {
|
||||
createPlugin,
|
||||
createRoutableExtension,
|
||||
createRouteRef,
|
||||
createSubRouteRef,
|
||||
discoveryApiRef,
|
||||
identityApiRef,
|
||||
} from '@backstage/core-plugin-api';
|
||||
import { JenkinsClient, jenkinsApiRef } from './api';
|
||||
|
||||
export const rootRouteRef = createRouteRef({
|
||||
path: '',
|
||||
title: 'Jenkins',
|
||||
id: 'jenkins',
|
||||
});
|
||||
|
||||
export const buildRouteRef = createRouteRef({
|
||||
path: 'build/:jobFullName/:buildNumber',
|
||||
params: ['jobFullName', 'buildNumber'],
|
||||
title: 'Jenkins build',
|
||||
export const buildRouteRef = createSubRouteRef({
|
||||
id: 'jenkins/builds',
|
||||
path: '/builds/:jobFullName/:buildNumber',
|
||||
parent: rootRouteRef,
|
||||
});
|
||||
|
||||
export const jenkinsPlugin = createPlugin({
|
||||
|
||||
Reference in New Issue
Block a user