Skip to content

Commit

Permalink
move over frontend placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
max-zilla committed Sep 6, 2024
1 parent a1ce1a0 commit 280671f
Show file tree
Hide file tree
Showing 12 changed files with 972 additions and 140 deletions.
103 changes: 103 additions & 0 deletions frontend/src/actions/project.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
// import { V2 } from "../openapi";
// import { handleErrors } from "./common";

export const RECEIVE_PROJECTS = "RECEIVE_PROJECTS";

export function fetchProjects(skip = 0, limit = 12) {
return (dispatch) => {
dispatch({
type: RECEIVE_PROJECTS,
projects: {
metadata: {
total_count: 3,
skip: skip,
limit: limit,
},
data: [
{
id: "60f9f8c8c23f5c45d8f0e0e2",
name: "Sample Project",
description: "A description of the sample project",
created: "2024-07-29T12:00:00Z",
modified: "2024-07-29T12:00:00Z",
dataset_ids: [
"669ea731d559628438e5785d",
"669ea746d559628438e5788f",
],
folder_ids: ["66a085640c20e43f5c50b059"],
file_ids: ["669fcf4c78f3222201e18a0f"],
creator: {
id: "60f9f8c8c23f5c45d8f0e0c6",
first_name: "Chen",
last_name: "Wang",
email: "[email protected]",
},
},
{
id: "60f9f8c8c23f5c45d8f0e0d1",
name: "Sample Project 2",
description: "A description of the second sample project",
created: "2024-07-28T12:00:00Z",
modified: "2024-07-28T12:00:00Z",
dataset_ids: ["669fcf3978f3222201e18a0d"],
folder_ids: [
"66a085640c20e43f5c50b059",
"66a80284cf77abbb78b4435f",
],
file_ids: ["669ea735d559628438e57865", "669ea733d559628438e57862"],
creator: {
id: "669ea726d559628438e57841",
first_name: "Chen",
last_name: "Wang",
email: "[email protected]",
},
},
{
id: "60f9f8c8c23f5c45d8f0e0e2",
name: "Sample Project 3",
description: "A description of the third sample project",
created: "2024-07-27T12:00:00Z",
modified: "2024-07-27T12:00:00Z",
dataset_ids: [],
folder_ids: ["66a80284cf77abbb78b4435f"],
file_ids: [],
creator: {
id: "669ea726d559628438e57841",
first_name: "Chen",
last_name: "Wang",
email: "[email protected]",
},
},
],
},
receivedAt: Date.now(),
});
};
}

export const RECEIVE_PROJECT = "RECEIVE_PROJECT";

export function fetchProject(id) {
return (dispatch) => {
dispatch({
type: RECEIVE_PROJECT,
project: {
id: id,
name: "Sample Project",
description: "A description of the sample project",
created: "2024-07-29T12:00:00Z",
modified: "2024-07-29T12:00:00Z",
dataset_ids: ["669ea731d559628438e5785d", "669ea746d559628438e5788f"],
folder_ids: ["66a085640c20e43f5c50b059"],
file_ids: ["669fcf4c78f3222201e18a0f"],
creator: {
id: "60f9f8c8c23f5c45d8f0e0c6",
first_name: "Chen",
last_name: "Wang",
email: "[email protected]",
},
},
receivedAt: Date.now(),
});
};
}
8 changes: 5 additions & 3 deletions frontend/src/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { V2 } from "./openapi";
import { EventListenerJobStatus } from "./types/data";
import {V2} from "./openapi";
import {EventListenerJobStatus} from "./types/data";

interface Config {
appVersion: string;
Expand All @@ -26,6 +26,7 @@ interface Config {
defaultFolderFilePerPage: number;
defaultDatasetPerPage: number;
defaultGroupPerPage: number;
defaultProjectPerPage: number;
defaultUserPerPage: number;
defaultApikeyPerPage: number;
defaultExtractors: number;
Expand Down Expand Up @@ -89,10 +90,11 @@ config["eventListenerJobStatus"]["resubmitted"] = "RESUBMITTED";

config["streamingBytes"] = 1024 * 10; // 10 MB?
config["rawDataVisualizationThreshold"] = 1024 * 1024 * 10; // 10 MB

config["defaultProjectPerPage"] = 12;
config["defaultDatasetPerPage"] = 12;
config["defaultFolderFilePerPage"] = 5;
config["defaultGroupPerPage"] = 5;

config["defaultUserPerPage"] = 5;
config["defaultApikeyPerPage"] = 5;
config["defaultExtractors"] = 5;
Expand Down
Loading

0 comments on commit 280671f

Please sign in to comment.