Skip to content

Commit 280671f

Browse files
committed
move over frontend placeholder
1 parent a1ce1a0 commit 280671f

File tree

12 files changed

+972
-140
lines changed

12 files changed

+972
-140
lines changed

frontend/src/actions/project.js

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
// import { V2 } from "../openapi";
2+
// import { handleErrors } from "./common";
3+
4+
export const RECEIVE_PROJECTS = "RECEIVE_PROJECTS";
5+
6+
export function fetchProjects(skip = 0, limit = 12) {
7+
return (dispatch) => {
8+
dispatch({
9+
type: RECEIVE_PROJECTS,
10+
projects: {
11+
metadata: {
12+
total_count: 3,
13+
skip: skip,
14+
limit: limit,
15+
},
16+
data: [
17+
{
18+
id: "60f9f8c8c23f5c45d8f0e0e2",
19+
name: "Sample Project",
20+
description: "A description of the sample project",
21+
created: "2024-07-29T12:00:00Z",
22+
modified: "2024-07-29T12:00:00Z",
23+
dataset_ids: [
24+
"669ea731d559628438e5785d",
25+
"669ea746d559628438e5788f",
26+
],
27+
folder_ids: ["66a085640c20e43f5c50b059"],
28+
file_ids: ["669fcf4c78f3222201e18a0f"],
29+
creator: {
30+
id: "60f9f8c8c23f5c45d8f0e0c6",
31+
first_name: "Chen",
32+
last_name: "Wang",
33+
34+
},
35+
},
36+
{
37+
id: "60f9f8c8c23f5c45d8f0e0d1",
38+
name: "Sample Project 2",
39+
description: "A description of the second sample project",
40+
created: "2024-07-28T12:00:00Z",
41+
modified: "2024-07-28T12:00:00Z",
42+
dataset_ids: ["669fcf3978f3222201e18a0d"],
43+
folder_ids: [
44+
"66a085640c20e43f5c50b059",
45+
"66a80284cf77abbb78b4435f",
46+
],
47+
file_ids: ["669ea735d559628438e57865", "669ea733d559628438e57862"],
48+
creator: {
49+
id: "669ea726d559628438e57841",
50+
first_name: "Chen",
51+
last_name: "Wang",
52+
53+
},
54+
},
55+
{
56+
id: "60f9f8c8c23f5c45d8f0e0e2",
57+
name: "Sample Project 3",
58+
description: "A description of the third sample project",
59+
created: "2024-07-27T12:00:00Z",
60+
modified: "2024-07-27T12:00:00Z",
61+
dataset_ids: [],
62+
folder_ids: ["66a80284cf77abbb78b4435f"],
63+
file_ids: [],
64+
creator: {
65+
id: "669ea726d559628438e57841",
66+
first_name: "Chen",
67+
last_name: "Wang",
68+
69+
},
70+
},
71+
],
72+
},
73+
receivedAt: Date.now(),
74+
});
75+
};
76+
}
77+
78+
export const RECEIVE_PROJECT = "RECEIVE_PROJECT";
79+
80+
export function fetchProject(id) {
81+
return (dispatch) => {
82+
dispatch({
83+
type: RECEIVE_PROJECT,
84+
project: {
85+
id: id,
86+
name: "Sample Project",
87+
description: "A description of the sample project",
88+
created: "2024-07-29T12:00:00Z",
89+
modified: "2024-07-29T12:00:00Z",
90+
dataset_ids: ["669ea731d559628438e5785d", "669ea746d559628438e5788f"],
91+
folder_ids: ["66a085640c20e43f5c50b059"],
92+
file_ids: ["669fcf4c78f3222201e18a0f"],
93+
creator: {
94+
id: "60f9f8c8c23f5c45d8f0e0c6",
95+
first_name: "Chen",
96+
last_name: "Wang",
97+
98+
},
99+
},
100+
receivedAt: Date.now(),
101+
});
102+
};
103+
}

frontend/src/app.config.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { V2 } from "./openapi";
2-
import { EventListenerJobStatus } from "./types/data";
1+
import {V2} from "./openapi";
2+
import {EventListenerJobStatus} from "./types/data";
33

44
interface Config {
55
appVersion: string;
@@ -26,6 +26,7 @@ interface Config {
2626
defaultFolderFilePerPage: number;
2727
defaultDatasetPerPage: number;
2828
defaultGroupPerPage: number;
29+
defaultProjectPerPage: number;
2930
defaultUserPerPage: number;
3031
defaultApikeyPerPage: number;
3132
defaultExtractors: number;
@@ -89,10 +90,11 @@ config["eventListenerJobStatus"]["resubmitted"] = "RESUBMITTED";
8990

9091
config["streamingBytes"] = 1024 * 10; // 10 MB?
9192
config["rawDataVisualizationThreshold"] = 1024 * 1024 * 10; // 10 MB
92-
93+
config["defaultProjectPerPage"] = 12;
9394
config["defaultDatasetPerPage"] = 12;
9495
config["defaultFolderFilePerPage"] = 5;
9596
config["defaultGroupPerPage"] = 5;
97+
9698
config["defaultUserPerPage"] = 5;
9799
config["defaultApikeyPerPage"] = 5;
98100
config["defaultExtractors"] = 5;

0 commit comments

Comments
 (0)