diff --git a/ui/CONTRIBUTING.md b/ui/CONTRIBUTING.md index de5cfc66eaa..970bd3676cd 100644 --- a/ui/CONTRIBUTING.md +++ b/ui/CONTRIBUTING.md @@ -52,7 +52,11 @@ There are very few tests for this UI. There is a smoke test that ensures pages c ## Yarn commands -If you would like to simply try things out and see how the UI works, you can simply run the code in this repo. First: +If you would like to simply try things out and see how the UI works, you can simply run the code in this repo. + +> **Note**: there is an `.npmrc` which is setup for automatic releases. You'll need to comment out the line in there and continue + +First: ### `yarn install` diff --git a/ui/src/custom-tabs/data-tab/DataQuery.tsx b/ui/src/custom-tabs/data-tab/DataQuery.tsx index f101c122e43..c79764ef999 100644 --- a/ui/src/custom-tabs/data-tab/DataQuery.tsx +++ b/ui/src/custom-tabs/data-tab/DataQuery.tsx @@ -1,9 +1,5 @@ import { useQuery } from "react-query"; -interface DataQueryInterface { - featureView: string | undefined; -} - const DataQuery = (featureView: string) => { const queryKey = `data-tab-namespace:${featureView}`; @@ -13,8 +9,7 @@ const DataQuery = (featureView: string) => { // Customizing the URL based on your needs const url = `/demo-custom-tabs/demo.json`; - return fetch(url) - .then((res) => res.json()) + return fetch(url).then((res) => res.json()); }, { enabled: !!featureView, // Only start the query when the variable is not undefined diff --git a/ui/src/custom-tabs/data-tab/DataTab.tsx b/ui/src/custom-tabs/data-tab/DataTab.tsx index 144083420a2..4592d197e2c 100644 --- a/ui/src/custom-tabs/data-tab/DataTab.tsx +++ b/ui/src/custom-tabs/data-tab/DataTab.tsx @@ -14,7 +14,6 @@ import { EuiTableRow, EuiTableRowCell, } from "@elastic/eui"; -import useLoadRegularFeatureView from "../../pages/feature-views/useLoadFeatureView"; import DataQuery from "./DataQuery"; const FeatureViewDataRow = z.object({ @@ -26,29 +25,25 @@ type FeatureViewDataRowType = z.infer; const LineHeightProp: React.CSSProperties = { lineHeight: 1, -} +}; -const EuiFeatureViewDataRow = ({name, value}: FeatureViewDataRowType) => { +const EuiFeatureViewDataRow = ({ name, value }: FeatureViewDataRowType) => { return ( - - {name} - + {name} -
-            {value}
-          
+
{value}
); -} +}; const FeatureViewDataTable = (data: any) => { var items: FeatureViewDataRowType[] = []; - for (let element in data.data){ + for (let element in data.data) { const row: FeatureViewDataRowType = { name: element, value: JSON.stringify(data.data[element], null, 2), @@ -60,48 +55,44 @@ const FeatureViewDataTable = (data: any) => { return ( - - Data Item Name - - - Data Item Value - + Data Item Name + Data Item Value {items.map((item) => { - return + return ; })} - ) -} + ); +}; const DataTab = () => { - const fName = "credit_history" + const fName = "credit_history"; const { isLoading, isError, isSuccess, data } = DataQuery(fName); const isEmpty = data === undefined; return ( - {isLoading && ( - - Loading - - )} - {isEmpty &&

No feature view with name: {fName}

} - {isError &&

Error loading feature view: {fName}

} - {isSuccess && data && ( - - - - - -

Properties

-
- - -
-
-
-
+ {isLoading && ( + + Loading + + )} + {isEmpty &&

No feature view with name: {fName}

} + {isError &&

Error loading feature view: {fName}

} + {isSuccess && data && ( + + + + + +

Properties

+
+ + +
+
+
+
)}
); diff --git a/ui/src/pages/feature-services/FeatureServiceListingTable.tsx b/ui/src/pages/feature-services/FeatureServiceListingTable.tsx index c6205b020a9..b865da6e23c 100644 --- a/ui/src/pages/feature-services/FeatureServiceListingTable.tsx +++ b/ui/src/pages/feature-services/FeatureServiceListingTable.tsx @@ -53,10 +53,10 @@ const FeatureServiceListingTable = ({ }, }, { - name: "Created at", - field: "meta.createdTimestamp", + name: "Last updated", + field: "meta.lastUpdatedTimestamp", render: (date: Date) => { - return date.toLocaleDateString("en-CA"); + return date ? date.toLocaleDateString("en-CA") : "n/a"; }, }, ]; diff --git a/ui/src/pages/feature-services/FeatureServiceOverviewTab.tsx b/ui/src/pages/feature-services/FeatureServiceOverviewTab.tsx index a3fc897325b..ea62b3b3a70 100644 --- a/ui/src/pages/feature-services/FeatureServiceOverviewTab.tsx +++ b/ui/src/pages/feature-services/FeatureServiceOverviewTab.tsx @@ -66,14 +66,20 @@ const FeatureServiceOverviewTab = () => { description="Feature Views" /> - - - + {data.meta.lastUpdatedTimestamp ? ( + + + + ) : ( + + No last updated timestamp specified on this feature service. + + )} diff --git a/ui/src/parsers/feastFeatureServices.ts b/ui/src/parsers/feastFeatureServices.ts index 96c03e38efe..6812b7e02cb 100644 --- a/ui/src/parsers/feastFeatureServices.ts +++ b/ui/src/parsers/feastFeatureServices.ts @@ -19,7 +19,8 @@ const FeastFeatureServiceSchema = z.object({ description: z.string().optional(), }), meta: z.object({ - createdTimestamp: z.string().transform((val) => new Date(val)), + createdTimestamp: z.string().transform((val) => new Date(val)).optional(), + lastUpdatedTimestamp: z.string().transform((val) => new Date(val)).optional(), }), }); diff --git a/ui/src/parsers/feastODFVS.ts b/ui/src/parsers/feastODFVS.ts index 8341438d50c..4d09cc72dfa 100644 --- a/ui/src/parsers/feastODFVS.ts +++ b/ui/src/parsers/feastODFVS.ts @@ -1,6 +1,5 @@ import { z } from "zod"; import { FeastFeatureColumnSchema } from "./feastFeatureViews"; -import { FEAST_FEATURE_VALUE_TYPES } from "./types"; const FeatureViewProjectionSchema = z.object({ featureViewProjection: z.object({