Skip to content

Commit 30da3cd

Browse files
authored
Merge pull request #86 from zenml-io/pagination-integration
Pagination integration
2 parents c1024cc + 01b973e commit 30da3cd

File tree

68 files changed

+1370
-225
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1370
-225
lines changed

src/api/endpoints.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const endpoints = {
2222

2323
projects: {
2424
my: '/projects',
25-
stats: (project: string) => `/projects/${project}/statistics`
25+
stats: (project: string) => `/projects/${project}/statistics`,
2626
},
2727

2828
pipelines: {

src/api/fetchApi/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ export const fetchApiWithAuthRequest = ({
3333
url,
3434
data,
3535
method,
36+
params,
3637
authenticationToken,
3738
headers,
3839
}: {
3940
url: string;
41+
params?: any;
4042
data?: any;
4143
method: any;
4244
authenticationToken: string;
@@ -47,6 +49,7 @@ export const fetchApiWithAuthRequest = ({
4749
return axios({
4850
method: method || httpMethods.get,
4951
url,
52+
params,
5053
data,
5154
cancelToken: new CancelToken(function executor(c) {
5255
// An executor function receives a cancel function as a parameter

src/api/pipelines/getAllRunsByPipelineIdApi.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,19 @@ import { apiUrl } from '../apiUrl';
66
const getAllRunsByPipelineIdApi = ({
77
authenticationToken,
88
pipelineId,
9+
page,
10+
size,
11+
filtersParam,
912
}: {
1013
authenticationToken: string;
1114
pipelineId: TId;
15+
page: number;
16+
size: number;
17+
filtersParam?: any;
1218
}): Promise<TOrganization> =>
1319
fetchApiWithAuthRequest({
14-
url: apiUrl(endpoints.runs.pipeline.get(pipelineId)), // todo: get runs by pipeline id please update endpoint
20+
url: apiUrl(endpoints.runs.pipeline.get(pipelineId)),
21+
params: { page, size, ...filtersParam }, // todo: get runs by pipeline id please update endpoint
1522
method: httpMethods.get,
1623
authenticationToken,
1724
});

src/api/pipelines/getMyPipelinesApi.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,20 @@ import { apiUrl } from '../apiUrl';
66
const getMyPipelinesApi = ({
77
authenticationToken,
88
project,
9+
page,
10+
size,
11+
filtersParam,
912
}: {
13+
page: number;
14+
size: number;
15+
name?: string;
1016
authenticationToken: string;
1117
project: string;
18+
filtersParam?: object;
1219
}): Promise<TPipeline> =>
1320
fetchApiWithAuthRequest({
1421
url: apiUrl(endpoints.pipelines.my(project)),
22+
params: { page, size, ...filtersParam },
1523
method: httpMethods.get,
1624
authenticationToken,
1725
});

src/api/runs/getAllRunsApi.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,20 @@ import { apiUrl } from '../apiUrl';
55

66
const getAllRunsApi = ({
77
project,
8+
page,
9+
size,
10+
filtersParam,
811
authenticationToken,
912
}: {
10-
project: string;
13+
page: number;
14+
size: number;
1115
authenticationToken: string;
16+
project: string;
17+
filtersParam?: object;
1218
}): Promise<TOrganization> =>
1319
fetchApiWithAuthRequest({
1420
url: apiUrl(endpoints.runs.all(project)),
21+
params: { page, size, ...filtersParam },
1522
method: httpMethods.get,
1623
authenticationToken,
1724
});

src/api/stackComponents/getAllRunsByStackComponentIdApi.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,19 @@ import { apiUrl } from '../apiUrl';
66
const getAllRunsByStackComponentIdApi = ({
77
authenticationToken,
88
stackComponentId,
9+
page,
10+
size,
11+
filtersParam,
912
}: {
13+
page: number;
14+
size: number;
15+
filtersParam?: any;
1016
authenticationToken: string;
1117
stackComponentId: TId;
1218
}): Promise<TOrganization> =>
1319
fetchApiWithAuthRequest({
14-
url: apiUrl(endpoints.runs.stackComponent.get(stackComponentId)), // todo: get runs by pipeline id please update endpoint
20+
url: apiUrl(endpoints.runs.stackComponent.get(stackComponentId)),
21+
params: { page, size, ...filtersParam }, // todo: get runs by pipeline id please update endpoint
1522
method: httpMethods.get,
1623
authenticationToken,
1724
});

src/api/stackComponents/getStackComponentListApi.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,22 @@ import { apiUrl } from '../apiUrl';
55

66
const getMyStackComponentsApi = ({
77
authenticationToken,
8+
page,
9+
size,
810
type,
11+
filtersParam,
912
project,
1013
}: {
1114
project: string;
1215
authenticationToken: string;
1316
type: string;
17+
filtersParam?: object;
18+
page: number;
19+
size: number;
1420
}): Promise<TStack> =>
1521
fetchApiWithAuthRequest({
1622
url: apiUrl(endpoints.StackComponents.my(type, project)),
23+
params: { page, size, ...filtersParam },
1724
method: httpMethods.get,
1825
authenticationToken,
1926
});

src/api/stacks/getAllRunsByStackIdApi.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,19 @@ import { apiUrl } from '../apiUrl';
66
const getAllRunsByStackIdApi = ({
77
authenticationToken,
88
stackId,
9+
page,
10+
size,
11+
filtersParam,
912
}: {
13+
page: number;
14+
size: number;
15+
filtersParam?: any;
1016
authenticationToken: string;
1117
stackId: TId;
1218
}): Promise<TOrganization> =>
1319
fetchApiWithAuthRequest({
14-
url: apiUrl(endpoints.runs.stack.get(stackId)), // todo: get runs by pipeline id please update endpoint
20+
url: apiUrl(endpoints.runs.stack.get(stackId)),
21+
params: { page, size, ...filtersParam }, // todo: get runs by pipeline id please update endpoint
1522
method: httpMethods.get,
1623
authenticationToken,
1724
});

src/api/stacks/getMyStacksApi.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,20 @@ import { apiUrl } from '../apiUrl';
55

66
const getMyStacksApi = ({
77
project,
8+
page,
9+
size,
10+
filtersParam,
811
authenticationToken,
912
}: {
1013
project: string;
14+
page: number;
15+
size: number;
16+
filtersParam?: object;
1117
authenticationToken: string;
1218
}): Promise<TStack> =>
1319
fetchApiWithAuthRequest({
1420
url: apiUrl(endpoints.Stacks.my(project)),
21+
params: { page, size, ...filtersParam },
1522
method: httpMethods.get,
1623
authenticationToken,
1724
});

src/redux/actions/pipelines/getAllRunsByPipelineId.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ import getAllRunsByPipelineIdApi from '../../../api/pipelines/getAllRunsByPipeli
33

44
export const getAllRunsByPipelineId = ({
55
pipelineId,
6+
page,
7+
size,
8+
filtersParam,
69
onSuccess,
710
onFailure,
811
}: {
912
pipelineId: TId;
13+
page: number;
14+
size: number;
15+
filtersParam?: any;
1016
onSuccess?: () => void;
1117
onFailure?: () => void;
1218
}): TRequestAction => {
@@ -17,7 +23,7 @@ export const getAllRunsByPipelineId = ({
1723
isAuthenticated: true,
1824
failureActionType: pipelineActionTypes.getRunsByPipelineId.failure,
1925
successActionType: pipelineActionTypes.getRunsByPipelineId.success,
20-
params: { pipelineId },
26+
params: { pipelineId, page, size, filtersParam },
2127
onSuccess,
2228
onFailure,
2329
},

0 commit comments

Comments
 (0)