From 26abd48a5d992df4b49f6e01480763a4b6d13076 Mon Sep 17 00:00:00 2001 From: Abhay-soni-developer Date: Wed, 20 Sep 2023 17:09:30 +0530 Subject: [PATCH] api-report modified, scoped column type, exported ciTableColumns so we can easily reuse the columns Signed-off-by: Abhay-soni-developer --- plugins/jenkins/api-report.md | 7 ++++++- .../src/components/BuildsPage/lib/CITable/CITable.tsx | 10 +++++----- .../src/components/BuildsPage/lib/CITable/index.ts | 2 +- plugins/jenkins/src/components/Router.tsx | 3 ++- plugins/jenkins/src/index.ts | 1 + 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/plugins/jenkins/api-report.md b/plugins/jenkins/api-report.md index 215abf5f48..ca6feac780 100644 --- a/plugins/jenkins/api-report.md +++ b/plugins/jenkins/api-report.md @@ -17,9 +17,14 @@ import { default as React_2 } from 'react'; import { RouteRef } from '@backstage/core-plugin-api'; import { TableColumn } from '@backstage/core-components'; +// Warning: (ae-missing-release-tag) "ciTableColumns" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const ciTableColumns: TableColumn[]; + // @public (undocumented) export const EntityJenkinsContent: (props: { - columns?: TableColumn<{}>[] | undefined; + columns?: TableColumn[] | undefined; }) => JSX_2.Element; // @public (undocumented) diff --git a/plugins/jenkins/src/components/BuildsPage/lib/CITable/CITable.tsx b/plugins/jenkins/src/components/BuildsPage/lib/CITable/CITable.tsx index b0474b73da..2c3660c239 100644 --- a/plugins/jenkins/src/components/BuildsPage/lib/CITable/CITable.tsx +++ b/plugins/jenkins/src/components/BuildsPage/lib/CITable/CITable.tsx @@ -82,7 +82,7 @@ const FailSkippedWidget = ({ return null; }; -const generatedColumns: TableColumn[] = [ +export const ciTableColumns: TableColumn[] = [ { title: 'Timestamp', defaultSort: 'desc', @@ -239,7 +239,7 @@ type Props = { total: number; pageSize: number; onChangePageSize: (pageSize: number) => void; - columns: TableColumn[]; + columns: TableColumn[]; }; export const CITableView = ({ @@ -281,13 +281,13 @@ export const CITableView = ({ Projects } - columns={columns && columns.length !== 0 ? columns : generatedColumns} + columns={columns && columns.length !== 0 ? columns : ciTableColumns} /> ); }; type CITableProps = { - columns?: TableColumn[]; + columns?: TableColumn[]; }; export const CITable = ({ columns }: CITableProps) => { @@ -296,7 +296,7 @@ export const CITable = ({ columns }: CITableProps) => { return ( [])} retry={retry} onChangePageSize={setPageSize} onChangePage={setPage} diff --git a/plugins/jenkins/src/components/BuildsPage/lib/CITable/index.ts b/plugins/jenkins/src/components/BuildsPage/lib/CITable/index.ts index 3be4dae9ce..b5a7ac6337 100644 --- a/plugins/jenkins/src/components/BuildsPage/lib/CITable/index.ts +++ b/plugins/jenkins/src/components/BuildsPage/lib/CITable/index.ts @@ -13,4 +13,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export { CITable } from './CITable'; +export { CITable, ciTableColumns } from './CITable'; diff --git a/plugins/jenkins/src/components/Router.tsx b/plugins/jenkins/src/components/Router.tsx index d4325b2542..58dd93b550 100644 --- a/plugins/jenkins/src/components/Router.tsx +++ b/plugins/jenkins/src/components/Router.tsx @@ -26,6 +26,7 @@ import { JENKINS_ANNOTATION, LEGACY_JENKINS_ANNOTATION } from '../constants'; import { buildRouteRef } from '../plugin'; import { CITable } from './BuildsPage/lib/CITable'; import { DetailedViewPage } from './BuildWithStepsPage/'; +import { Project } from '../api'; /** @public */ export const isJenkinsAvailable = (entity: Entity) => @@ -33,7 +34,7 @@ export const isJenkinsAvailable = (entity: Entity) => Boolean(entity.metadata.annotations?.[LEGACY_JENKINS_ANNOTATION]); type Props = { - columns?: TableColumn[]; + columns?: TableColumn[]; }; export const Router = (props: Props) => { diff --git a/plugins/jenkins/src/index.ts b/plugins/jenkins/src/index.ts index 7562026bdc..3a17a879be 100644 --- a/plugins/jenkins/src/index.ts +++ b/plugins/jenkins/src/index.ts @@ -34,3 +34,4 @@ export { } from './components/Router'; export { JENKINS_ANNOTATION, LEGACY_JENKINS_ANNOTATION } from './constants'; export * from './api'; +export { ciTableColumns } from './components/BuildsPage/lib/CITable';