-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathProjectOverviewPage.tsx
More file actions
135 lines (128 loc) · 4.41 KB
/
ProjectOverviewPage.tsx
File metadata and controls
135 lines (128 loc) · 4.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
import React, { useContext } from "react";
import {
EuiPageTemplate,
EuiText,
EuiFlexGroup,
EuiFlexItem,
EuiTitle,
EuiSpacer,
EuiSkeletonText,
EuiEmptyPrompt,
EuiFieldSearch,
} from "@elastic/eui";
import { useDocumentTitle } from "../hooks/useDocumentTitle";
import ObjectsCountStats from "../components/ObjectsCountStats";
import ExplorePanel from "../components/ExplorePanel";
import useLoadRegistry from "../queries/useLoadRegistry";
import RegistryPathContext from "../contexts/RegistryPathContext";
import RegistryVisualizationTab from "../components/RegistryVisualizationTab";
import RegistrySearch from "../components/RegistrySearch";
import { useParams } from "react-router-dom";
const ProjectOverviewPage = () => {
useDocumentTitle("Feast Home");
const registryUrl = useContext(RegistryPathContext);
const { isLoading, isSuccess, isError, data } = useLoadRegistry(registryUrl);
const { projectName } = useParams<{ projectName: string }>();
const categories = [
{
name: "Data Sources",
data: data?.objects.dataSources || [],
getLink: (item: any) => `/p/${projectName}/data-source/${item.name}`,
},
{
name: "Entities",
data: data?.objects.entities || [],
getLink: (item: any) => `/p/${projectName}/entity/${item.name}`,
},
{
name: "Features",
data: data?.allFeatures || [],
getLink: (item: any) => {
const featureView = item?.featureView;
return featureView
? `/p/${projectName}/feature-view/${featureView}/feature/${item.name}`
: "#";
},
},
{
name: "Feature Views",
data: data?.mergedFVList || [],
getLink: (item: any) => `/p/${projectName}/feature-view/${item.name}`,
},
{
name: "Feature Services",
data: data?.objects.featureServices || [],
getLink: (item: any) => {
const serviceName = item?.name || item?.spec?.name;
return serviceName
? `/p/${projectName}/feature-service/${serviceName}`
: "#";
},
},
];
return (
<EuiPageTemplate panelled>
<EuiPageTemplate.Section>
<EuiTitle size="l">
<h1>
{isLoading && <EuiSkeletonText lines={1} />}
{isSuccess && data?.project && `Project: ${data.project}`}
</h1>
</EuiTitle>
<EuiSpacer />
<EuiFlexGroup>
<EuiFlexItem grow={2}>
{isLoading && <EuiSkeletonText lines={4} />}
{isError && (
<EuiEmptyPrompt
iconType="alert"
color="danger"
title={<h2>Error Loading Project Configs</h2>}
body={
<p>
There was an error loading the Project Configurations.
Please check that <code>feature_store.yaml</code> file is
available and well-formed.
</p>
}
/>
)}
{isSuccess &&
(data?.description ? (
<EuiText>
<pre>{data.description}</pre>
</EuiText>
) : (
<EuiText>
<p>
Welcome to your new Feast project. In this UI, you can see
Data Sources, Entities, Features, Feature Views, and Feature
Services registered in Feast.
</p>
<p>
It looks like this project already has some objects
registered. If you are new to this project, we suggest
starting by exploring the Feature Services, as they
represent the collection of Feature Views serving a
particular model.
</p>
<p>
<strong>Note</strong>: We encourage you to replace this
welcome message with more suitable content for your team.
You can do so by specifying a{" "}
<code>project_description</code> in your{" "}
<code>feature_store.yaml</code> file.
</p>
</EuiText>
))}
<ObjectsCountStats />
</EuiFlexItem>
<EuiFlexItem grow={1}>
<ExplorePanel />
</EuiFlexItem>
</EuiFlexGroup>
</EuiPageTemplate.Section>
</EuiPageTemplate>
);
};
export default ProjectOverviewPage;