Skip to content

Commit 408bd9c

Browse files
jeriveadchia
authored andcommitted
Correctly display protobufjs enums
Signed-off-by: Danny Chiao <danny@tecton.ai>
1 parent 7208ed7 commit 408bd9c

File tree

10 files changed

+39
-11
lines changed

10 files changed

+39
-11
lines changed

ui/src/components/FeaturesInServiceDisplay.tsx

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,19 @@ interface FeatureViewsListInterace {
88
featureViews: feast.core.IFeatureViewProjection[];
99
}
1010

11+
interface IFeatureColumnInService {
12+
featureViewName: string;
13+
name: string;
14+
valueType: feast.types.ValueType.Enum;
15+
}
16+
1117
const FeaturesInServiceList = ({ featureViews }: FeatureViewsListInterace) => {
1218
const { projectName } = useParams();
19+
const items: IFeatureColumnInService[] = featureViews.flatMap(featureView => featureView.featureColumns!.map(featureColumn => ({
20+
featureViewName: featureView.featureViewName!,
21+
name: featureColumn.name!,
22+
valueType: featureColumn.valueType!,
23+
})));
1324

1425
const columns = [
1526
{
@@ -28,22 +39,25 @@ const FeaturesInServiceList = ({ featureViews }: FeatureViewsListInterace) => {
2839
},
2940
{
3041
name: "Feature Column",
31-
field: "featureColumn.name",
42+
field: "name",
3243
},
3344
{
3445
name: "Value Type",
3546
field: "valueType",
47+
render: (valueType: feast.types.ValueType.Enum) => {
48+
return feast.types.ValueType.Enum[valueType];
49+
},
3650
},
3751
];
3852

39-
const getRowProps = (item: feast.core.IFeatureViewProjection) => {
53+
const getRowProps = (item: IFeatureColumnInService) => {
4054
return {
4155
"data-test-subj": `row-${item.featureViewName}`,
4256
};
4357
};
4458

4559
return (
46-
<EuiBasicTable columns={columns} items={featureViews} rowProps={getRowProps} />
60+
<EuiBasicTable columns={columns} items={items} rowProps={getRowProps} />
4761
);
4862
};
4963

ui/src/components/FeaturesListDisplay.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ const FeaturesList = ({
3131
{
3232
name: "Value Type",
3333
field: "valueType",
34+
render: (valueType: feast.types.ValueType.Enum) => {
35+
return feast.types.ValueType.Enum[valueType];
36+
},
3437
},
3538
];
3639

ui/src/pages/data-sources/BatchSourcePropertiesView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const BatchSourcePropertiesView = (props: BatchSourcePropertiesViewProps) => {
2727
<EuiDescriptionListDescription>
2828
{batchSource.dataSourceClassType.split(".").at(-1)}
2929
</EuiDescriptionListDescription>
30-
) : batchSource.type ? (
30+
) : feast.core.DataSource.SourceType[batchSource.type!] ? (
3131
<EuiDescriptionListDescription>
3232
{batchSource.type}
3333
</EuiDescriptionListDescription>

ui/src/pages/data-sources/DataSourceOverviewTab.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import BatchSourcePropertiesView from "./BatchSourcePropertiesView";
1919
import FeatureViewEdgesList from "../entities/FeatureViewEdgesList";
2020
import RequestDataSourceSchemaTable from "./RequestDataSourceSchemaTable";
2121
import useLoadDataSource from "./useLoadDataSource";
22+
import { feast } from "../../protos";
2223

2324
const DataSourceOverviewTab = () => {
2425
let { dataSourceName } = useParams();
@@ -57,7 +58,7 @@ const DataSourceOverviewTab = () => {
5758
Source Type
5859
</EuiDescriptionListTitle>
5960
<EuiDescriptionListDescription>
60-
{data.type}
61+
{feast.core.DataSource.SourceType[data.type]}
6162
</EuiDescriptionListDescription>
6263
</EuiDescriptionList>
6364
</React.Fragment>

ui/src/pages/data-sources/DataSourcesListingTable.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ const DatasourcesListingTable = ({
3333
name: "Type",
3434
field: "type",
3535
sortable: true,
36+
render: (valueType: feast.types.ValueType.Enum) => {
37+
return feast.types.ValueType.Enum[valueType];
38+
},
3639
},
3740
];
3841

ui/src/pages/data-sources/RequestDataSourceSchemaTable.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ interface RequestDataSourceSchema {
1212
}
1313

1414
const RequestDataSourceSchemaTable = ({ fields }: RequestDataSourceSchema) => {
15-
console.log(fields);
1615
const columns = [
1716
{
1817
name: "Field",
@@ -21,6 +20,9 @@ const RequestDataSourceSchemaTable = ({ fields }: RequestDataSourceSchema) => {
2120
{
2221
name: "Value Type",
2322
field: "valueType",
23+
render: (valueType: feast.types.ValueType.Enum) => {
24+
return feast.types.ValueType.Enum[valueType];
25+
},
2426
},
2527
];
2628

ui/src/pages/entities/EntitiesListingTable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ const EntitiesListingTable = ({ entities }: EntitiesListingTableProps) => {
3333
name: "Type",
3434
field: "spec.valueType",
3535
sortable: true,
36-
render: (valueType: string) => {
37-
return valueType;
36+
render: (valueType: feast.types.ValueType.Enum) => {
37+
return feast.types.ValueType.Enum[valueType];
3838
},
3939
},
4040
{

ui/src/pages/entities/EntityOverviewTab.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import FeatureViewEdgesList from "./FeatureViewEdgesList";
2020
import useFeatureViewEdgesByEntity from "./useFeatureViewEdgesByEntity";
2121
import useLoadEntity from "./useLoadEntity";
2222
import { toDate } from "../../utils/timestamp";
23+
import { feast } from "../../protos";
2324

2425
const EntityOverviewTab = () => {
2526
let { entityName } = useParams();
@@ -63,7 +64,7 @@ const EntityOverviewTab = () => {
6364

6465
<EuiDescriptionListTitle>Value Type</EuiDescriptionListTitle>
6566
<EuiDescriptionListDescription>
66-
{data?.spec?.valueType}
67+
{feast.types.ValueType.Enum[data?.spec?.valueType!]}
6768
</EuiDescriptionListDescription>
6869
</EuiDescriptionList>
6970
</EuiPanel>

ui/src/pages/feature-views/components/FeatureViewProjectionDisplayPanel.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@ const FeatureViewProjectionDisplayPanel = (featureViewProjection: RequestDataDis
1313
const columns = [
1414
{
1515
name: "Column Name",
16-
field: "name",
16+
field: "name"
1717
},
1818
{
1919
name: "Type",
2020
field: "valueType",
21+
render: (valueType: any) => {
22+
return feast.types.ValueType.Enum[valueType];
23+
},
2124
},
2225
];
2326

ui/src/pages/features/FeatureOverviewTab.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import TagsDisplay from "../../components/TagsDisplay";
1616
import React from "react";
1717
import { useParams } from "react-router-dom";
1818
import useLoadFeature from "./useLoadFeature";
19+
import { feast } from "../../protos";
1920

2021
const FeatureOverviewTab = () => {
2122
let { projectName, FeatureViewName, FeatureName } = useParams();
@@ -51,7 +52,7 @@ const FeatureOverviewTab = () => {
5152

5253
<EuiDescriptionListTitle>Value Type</EuiDescriptionListTitle>
5354
<EuiDescriptionListDescription>
54-
{featureData?.valueType}
55+
{feast.types.ValueType.Enum[featureData?.valueType!]}
5556
</EuiDescriptionListDescription>
5657

5758
<EuiDescriptionListTitle>FeatureView</EuiDescriptionListTitle>

0 commit comments

Comments
 (0)