changes according to feedback
Signed-off-by: Abhay-soni-developer <abhaysoni.developer@gmail.com>
This commit is contained in:
@@ -90,9 +90,9 @@ const generatedColumns: TableColumn[] = [
|
||||
<div style={{ width: '98px' }}>
|
||||
{row?.url && (
|
||||
<Tooltip title="View build">
|
||||
<IconButton href={row.url} target="_blank">
|
||||
<Link component={IconButton} to={row.url}>
|
||||
<VisibilityIcon />
|
||||
</IconButton>
|
||||
</Link>
|
||||
</Tooltip>
|
||||
)}
|
||||
</div>
|
||||
@@ -109,7 +109,6 @@ type Props = {
|
||||
jobRuns?: Job;
|
||||
page: number;
|
||||
onChangePage: (page: number) => void;
|
||||
total: number;
|
||||
pageSize: number;
|
||||
onChangePageSize: (pageSize: number) => void;
|
||||
};
|
||||
@@ -121,7 +120,6 @@ export const JobRunsTableView = ({
|
||||
jobRuns,
|
||||
onChangePage,
|
||||
onChangePageSize,
|
||||
total,
|
||||
}: Props) => {
|
||||
const builds = jobRuns?.builds.slice(
|
||||
page * pageSize,
|
||||
@@ -150,7 +148,7 @@ export const JobRunsTableView = ({
|
||||
<Table
|
||||
isLoading={loading}
|
||||
options={{ paging: true, pageSize, padding: 'dense' }}
|
||||
totalCount={total}
|
||||
totalCount={jobRuns?.builds.length || 0}
|
||||
page={page}
|
||||
data={builds ?? []}
|
||||
onPageChange={onChangePage}
|
||||
|
||||
@@ -30,7 +30,6 @@ export function useJobRuns(jobFullName: string) {
|
||||
const api = useApi(jenkinsApiRef);
|
||||
const errorApi = useApi(errorApiRef);
|
||||
|
||||
const [total, setTotal] = useState(0);
|
||||
const [page, setPage] = useState(0);
|
||||
const [pageSize, setPageSize] = useState(5);
|
||||
|
||||
@@ -55,17 +54,12 @@ export function useJobRuns(jobFullName: string) {
|
||||
}
|
||||
}, [api, errorApi, entity]);
|
||||
|
||||
useEffect(() => {
|
||||
if (jobRuns) setTotal(jobRuns.builds.length);
|
||||
}, [jobRuns]);
|
||||
|
||||
return [
|
||||
{
|
||||
page,
|
||||
pageSize,
|
||||
loading,
|
||||
jobRuns,
|
||||
total,
|
||||
error,
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user