Skip to content
Snippets Groups Projects
Commit 309dba466f96 authored by Arnaud Vergnet's avatar Arnaud Vergnet :sun_with_face:
Browse files

chore(frontend): remove unused debug data

parent be40852bc861
No related branches found
No related tags found
1 merge request!14feat(frontend): finish connecting to backend
Pipeline #225434 passed
import { ImportProcess } from "@/components/ImportProcessTable";
import { DataService, Project, Recipe } from "@/types";
// TODO placeholder data, remove when we connect to backend.
export const PROJECTS: Array<Project> = [
{
eid: 1,
name: "Prod",
activated: true,
sparql_endpoint: "https://virtuoso.fr",
},
{
eid: 2,
name: "Pre Prod",
activated: false,
sparql_endpoint: "https://virtuoso.fr",
},
{
eid: 3,
name: "test (dryrun)",
activated: true,
sparql_endpoint: "https://virtuoso.fr",
},
];
export const DATA_SERVICES: Array<DataService> = [
{
eid: 1,
name: "Syracuse",
data_url: "https://syracuse.fr",
refresh_period: "weekly",
},
{
eid: 2,
name: "Syracuse Preprod",
data_url: "https://preprod.syracuse.fr",
refresh_period: "weekly",
},
{
eid: 3,
name: "ONB",
data_url: "https://onb.opera.fr",
refresh_period: "weekly",
},
];
export const RECIPES: Array<Recipe> = [
{
eid: 1,
name: "Syracuse",
process_type: "default",
},
{
eid: 2,
name: "Syracuse Preprod",
process_type: "default-dryrun",
},
{
eid: 3,
name: "ONB",
process_type: "default",
},
];
export const DATA_SERVICE: DataService = {
eid: 1,
name: "Syracuse",
data_url: "https://syracuse.fr",
refresh_period: "weekly",
};
export const PROJECT: Project = {
eid: 1,
name: "Prod",
activated: true,
sparql_endpoint: "https://virtuoso.fr",
};
export const IMPORT_PROCESSES: Array<ImportProcess> = [
{
eid: 5,
date: "09/01/2024 12:14",
recette: "IR1 (Syracuse)",
state: true,
project: "Prod",
},
{
eid: 6,
date: "09/01/2024 12:14",
recette: "IR2 (Syracuse)",
state: false,
project: "Prod",
},
];
import { useEffect, useState } from "react";
export function useLoad<T>(resolveData: T, showError?: boolean) {
const [data, setData] = useState<T | undefined>();
const [loading, setLoading] = useState<boolean>(true);
const [errors, setErrors] = useState<Record<string, string> | undefined>();
useEffect(() => {
setLoading(true);
setTimeout(() => {
setLoading(false);
if (showError) {
setErrors(undefined);
setData(undefined);
} else {
setData(resolveData);
setErrors(undefined);
}
}, 200);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return { data, loading, errors };
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment