Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Danny Chiao <[email protected]>
  • Loading branch information
adchia committed May 11, 2022
1 parent 3bbc8c3 commit c05bc8c
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 6 deletions.
27 changes: 26 additions & 1 deletion ui/src/components/TagsDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,36 @@ import EuiCustomLink from "./EuiCustomLink";
interface TagsDisplayProps {
createLink?: (key: string, value: string) => string;
tags: Record<string, string>;
owner?: string;
description?: string;
}

const TagsDisplay = ({ tags, createLink }: TagsDisplayProps) => {
const TagsDisplay = ({
tags,
createLink,
owner,
description,
}: TagsDisplayProps) => {
return (
<EuiDescriptionList textStyle="reverse">
{owner ? (
<React.Fragment key={"owner"}>
<EuiDescriptionListTitle>owner</EuiDescriptionListTitle>
<EuiDescriptionListDescription>{owner}</EuiDescriptionListDescription>
</React.Fragment>
) : (
""
)}
{description ? (
<React.Fragment key={"description"}>
<EuiDescriptionListTitle>description</EuiDescriptionListTitle>
<EuiDescriptionListDescription>
{description}
</EuiDescriptionListDescription>
</React.Fragment>
) : (
""
)}
{Object.entries(tags).map(([key, value]) => {
return (
<React.Fragment key={key}>
Expand Down
9 changes: 8 additions & 1 deletion ui/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,15 @@ ReactDOM.render(
reactQueryClient={queryClient}
feastUIConfigs={{
tabsRegistry: tabsRegistry,
projectListPromise: fetch("http://0.0.0.0:8888/projects-list", {
headers: {
"Content-Type": "application/json",
},
}).then((res) => {
return res.json();
})
}}
/>
</React.StrictMode>,
document.getElementById("root")
);
);
18 changes: 18 additions & 0 deletions ui/src/pages/data-sources/BatchSourcePropertiesView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import {
interface BatchSourcePropertiesViewProps {
batchSource: {
type?: string | undefined;
owner?: string | undefined;
description?: string | undefined;
dataSourceClassType?: string | undefined;
fileOptions?:
| {
Expand Down Expand Up @@ -57,6 +59,22 @@ const BatchSourcePropertiesView = (props: BatchSourcePropertiesViewProps) => {
</React.Fragment>
)}

{batchSource.owner && (
<React.Fragment>
<EuiDescriptionListTitle>Owner</EuiDescriptionListTitle>
<EuiDescriptionListDescription>
{batchSource.owner}
</EuiDescriptionListDescription>
</React.Fragment>
)}
{batchSource.description && (
<React.Fragment>
<EuiDescriptionListTitle>Description</EuiDescriptionListTitle>
<EuiDescriptionListDescription>
{batchSource.description}
</EuiDescriptionListDescription>
</React.Fragment>
)}
{batchSource.fileOptions && (
<React.Fragment>
<EuiDescriptionListTitle>File URL</EuiDescriptionListTitle>
Expand Down
3 changes: 1 addition & 2 deletions ui/src/pages/data-sources/DataSourceOverviewTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const DataSourceOverviewTab = () => {
const { isLoading, isSuccess, isError, data, consumingFeatureViews } =
useLoadDataSource(dsName);
const isEmpty = data === undefined;
console.log(consumingFeatureViews);

return (
<React.Fragment>
Expand All @@ -51,7 +50,7 @@ const DataSourceOverviewTab = () => {
<EuiHorizontalRule margin="xs" />
{data.fileOptions || data.bigqueryOptions ? (
<BatchSourcePropertiesView batchSource={data} />
) : data.requestDataOptions ? (
) : data.type ? (
<React.Fragment>
<EuiDescriptionList>
<EuiDescriptionListTitle>
Expand Down
4 changes: 3 additions & 1 deletion ui/src/pages/feature-views/RegularFeatureViewOverviewTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const RegularFeatureViewOverviewTab = ({
features={data.spec.features}
/>
) : (
<EuiText>No Tags specified on this feature view.</EuiText>
<EuiText>No features specified on this feature view.</EuiText>
)}
</EuiPanel>
</EuiFlexItem>
Expand Down Expand Up @@ -135,6 +135,8 @@ const RegularFeatureViewOverviewTab = ({
encodeSearchQueryString(`${key}:${value}`)
);
}}
owner={data.spec.owner}
description={data.spec.description}
/>
) : (
<EuiText>No Tags specified on this feature view.</EuiText>
Expand Down
3 changes: 2 additions & 1 deletion ui/src/parsers/feastDatasources.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { z } from "zod";
import { FEAST_FEATURE_VALUE_TYPES } from "./types";
import { FeastFeatureColumnSchema } from "./feastFeatureViews";

const FeastDatasourceSchema = z.object({
Expand All @@ -10,6 +9,8 @@ const FeastDatasourceSchema = z.object({
uri: z.string().optional(),
}).optional(),
name: z.string(),
description: z.string().optional(),
owner: z.string().optional(),
meta: z.object({
latestEventTimestamp: z.string().transform((val) => new Date(val)),
earliestEventTimestamp: z.string().transform((val) => new Date(val)),
Expand Down
4 changes: 4 additions & 0 deletions ui/src/parsers/feastFeatureViews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const FeastBatchSourceSchema = z.object({
uri: z.string().optional(),
}).optional(),
name: z.string().optional(),
description: z.string().optional(),
owner: z.string().optional(),
meta: z.object({
earliestEventTimestamp: z.string().transform((val) => new Date(val)),
latestEventTimestamp: z.string().transform((val) => new Date(val)),
Expand All @@ -31,12 +33,14 @@ const FeastBatchSourceSchema = z.object({

const FeastFeatureViewSchema = z.object({
spec: z.object({
description: z.string().optional(),
name: z.string(),
entities: z.array(z.string()),
features: z.array(FeastFeatureColumnSchema),
ttl: z.string().transform((val) => parseInt(val)),
batchSource: FeastBatchSourceSchema,
online: z.boolean(),
owner: z.string().optional(),
tags: z.record(z.string()).optional(),
}),
meta: z.object({
Expand Down

0 comments on commit c05bc8c

Please sign in to comment.