api-report modified, scoped column type, exported ciTableColumns so we can easily reuse the columns

Signed-off-by: Abhay-soni-developer <abhaysoni.developer@gmail.com>
This commit is contained in:
Abhay-soni-developer
2023-09-20 17:09:30 +05:30
parent f9f3f1e629
commit 26abd48a5d
5 changed files with 15 additions and 8 deletions
+6 -1
View File
@@ -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<Project>[];
// @public (undocumented)
export const EntityJenkinsContent: (props: {
columns?: TableColumn<{}>[] | undefined;
columns?: TableColumn<Project>[] | undefined;
}) => JSX_2.Element;
// @public (undocumented)
@@ -82,7 +82,7 @@ const FailSkippedWidget = ({
return null;
};
const generatedColumns: TableColumn[] = [
export const ciTableColumns: TableColumn<Project>[] = [
{
title: 'Timestamp',
defaultSort: 'desc',
@@ -239,7 +239,7 @@ type Props = {
total: number;
pageSize: number;
onChangePageSize: (pageSize: number) => void;
columns: TableColumn[];
columns: TableColumn<Project>[];
};
export const CITableView = ({
@@ -281,13 +281,13 @@ export const CITableView = ({
<Typography variant="h6">Projects</Typography>
</Box>
}
columns={columns && columns.length !== 0 ? columns : generatedColumns}
columns={columns && columns.length !== 0 ? columns : ciTableColumns}
/>
);
};
type CITableProps = {
columns?: TableColumn[];
columns?: TableColumn<Project>[];
};
export const CITable = ({ columns }: CITableProps) => {
@@ -296,7 +296,7 @@ export const CITable = ({ columns }: CITableProps) => {
return (
<CITableView
{...tableProps}
columns={columns || ([] as TableColumn[])}
columns={columns || ([] as TableColumn<Project>[])}
retry={retry}
onChangePageSize={setPageSize}
onChangePage={setPage}
@@ -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';
+2 -1
View File
@@ -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<Project>[];
};
export const Router = (props: Props) => {
+1
View File
@@ -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';