You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by mi...@apache.org on 2024/08/05 03:27:39 UTC
(incubator-devlake) branch fix-7388 created (now 8fde6d91d)
This is an automated email from the ASF dual-hosted git repository.
mintsweet pushed a change to branch fix-7388
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
at 8fde6d91d fix: not set page and pageSize for pipelines
This branch includes the following new commits:
new 8fde6d91d fix: not set page and pageSize for pipelines
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(incubator-devlake) 01/01: fix: not set page and pageSize for pipelines
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
mintsweet pushed a commit to branch fix-7388
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit 8fde6d91d12a9d06ed7b01df60db6640e62055c4
Author: mintsweet <0x...@gmail.com>
AuthorDate: Mon Aug 5 15:27:26 2024 +1200
fix: not set page and pageSize for pipelines
---
config-ui/src/api/pipeline/index.ts | 3 ++-
config-ui/src/routes/pipeline/components/table.tsx | 8 ++------
config-ui/src/routes/pipeline/pipelines.tsx | 5 +----
3 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/config-ui/src/api/pipeline/index.ts b/config-ui/src/api/pipeline/index.ts
index 0fe0f8a79..ad06d28b3 100644
--- a/config-ui/src/api/pipeline/index.ts
+++ b/config-ui/src/api/pipeline/index.ts
@@ -21,7 +21,8 @@ import { request } from '@/utils';
import { SubTasksRes } from './types';
-export const list = (): Promise<{ count: number; pipelines: IPipeline[] }> => request('/pipelines');
+export const list = (params: Pagination): Promise<{ count: number; pipelines: IPipeline[] }> =>
+ request('/pipelines', { data: params });
export const get = (id: ID) => request(`/pipelines/${id}`);
diff --git a/config-ui/src/routes/pipeline/components/table.tsx b/config-ui/src/routes/pipeline/components/table.tsx
index 2dfb6fb4f..d63ddd6ce 100644
--- a/config-ui/src/routes/pipeline/components/table.tsx
+++ b/config-ui/src/routes/pipeline/components/table.tsx
@@ -41,14 +41,9 @@ interface Props {
pageSize: number;
onChange: (page: number) => void;
};
- noData?: {
- text?: React.ReactNode;
- btnText?: string;
- onCreate?: () => void;
- };
}
-export const PipelineTable = ({ dataSource, pagination, noData }: Props) => {
+export const PipelineTable = ({ loading, dataSource, pagination }: Props) => {
const [JSON, setJSON] = useState<any>(null);
const [id, setId] = useState<ID | null>(null);
@@ -72,6 +67,7 @@ export const PipelineTable = ({ dataSource, pagination, noData }: Props) => {
<Table
rowKey="id"
size="middle"
+ loading={loading}
columns={[
{
title: 'ID',
diff --git a/config-ui/src/routes/pipeline/pipelines.tsx b/config-ui/src/routes/pipeline/pipelines.tsx
index 69c09cab1..4f15b8fbe 100644
--- a/config-ui/src/routes/pipeline/pipelines.tsx
+++ b/config-ui/src/routes/pipeline/pipelines.tsx
@@ -28,7 +28,7 @@ export const Pipelines = () => {
const [page, setPage] = useState(1);
const [pageSize] = useState(20);
- const { ready, data } = useRefreshData(() => API.pipeline.list());
+ const { ready, data } = useRefreshData(() => API.pipeline.list({ page, pageSize }), [page, pageSize]);
const [dataSource, total] = useMemo(() => [(data?.pipelines ?? []).map((it) => it), data?.count ?? 0], [data]);
@@ -48,9 +48,6 @@ export const Pipelines = () => {
pageSize,
onChange: setPage,
}}
- noData={{
- text: 'Add new projects to see engineering metrics based on projects.',
- }}
/>
</PageHeader>
);