Skip to content

Commit

Permalink
Rename instances of metadata to data
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Kim <danielk@twitter.com>
  • Loading branch information
Daniel Kim committed Jul 1, 2022
1 parent 9b34987 commit 6be62fb
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useQuery } from "react-query";

interface MetadataQueryInterface {
interface DataQueryInterface {
featureView: string | undefined;
}

const MetadataQuery = (featureView: string) => {
const queryKey = `metadata-tab-namespace:${featureView}`;
const DataQuery = (featureView: string) => {
const queryKey = `data-tab-namespace:${featureView}`;

return useQuery<any>(
queryKey,
Expand All @@ -22,4 +22,4 @@ const MetadataQuery = (featureView: string) => {
);
};

export default MetadataQuery;
export default DataQuery;
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ import {
EuiTableRowCell,
} from "@elastic/eui";
import useLoadRegularFeatureView from "../../pages/feature-views/useLoadFeatureView";
import MetadataQuery from "./MetadataQuery";
import DataQuery from "./DataQuery";

const FeatureViewMetadataRow = z.object({
const FeatureViewDataRow = z.object({
name: z.string(),
value: z.string(),
});

type FeatureViewMetadataRowType = z.infer<typeof FeatureViewMetadataRow>;
type FeatureViewDataRowType = z.infer<typeof FeatureViewDataRow>;

const LineHeightProp: React.CSSProperties = {
lineHeight: 1,
}

const EuiFeatureViewMetadataRow = ({name, value}: FeatureViewMetadataRowType) => {
const EuiFeatureViewDataRow = ({name, value}: FeatureViewDataRowType) => {
return (
<EuiTableRow>
<EuiTableRowCell>
Expand All @@ -45,11 +45,11 @@ const EuiFeatureViewMetadataRow = ({name, value}: FeatureViewMetadataRowType) =>
);
}

const FeatureViewMetadataTable = (data: any) => {
var items: FeatureViewMetadataRowType[] = [];
const FeatureViewDataTable = (data: any) => {
var items: FeatureViewDataRowType[] = [];

for (let element in data.data){
const row: FeatureViewMetadataRowType = {
const row: FeatureViewDataRowType = {
name: element,
value: JSON.stringify(data.data[element], null, 2),
};
Expand All @@ -61,22 +61,22 @@ const FeatureViewMetadataTable = (data: any) => {
<EuiTable>
<EuiTableHeader>
<EuiTableHeaderCell>
Metadata Item Name
Data Item Name
</EuiTableHeaderCell>
<EuiTableHeaderCell>
Metadata Item Value
Data Item Value
</EuiTableHeaderCell>
</EuiTableHeader>
{items.map((item) => {
return <EuiFeatureViewMetadataRow name={item.name} value={item.value} />
return <EuiFeatureViewDataRow name={item.name} value={item.value} />
})}
</EuiTable>
)
}

const MetadataTab = () => {
const DataTab = () => {
const fName = "credit_history"
const { isLoading, isError, isSuccess, data } = MetadataQuery(fName);
const { isLoading, isError, isSuccess, data } = DataQuery(fName);
const isEmpty = data === undefined;

return (
Expand All @@ -97,7 +97,7 @@ const MetadataTab = () => {
<h3>Properties</h3>
</EuiTitle>
<EuiHorizontalRule margin="xs" />
<FeatureViewMetadataTable data={data} />
<FeatureViewDataTable data={data} />
</EuiPanel>
</EuiFlexItem>
</EuiFlexGroup>
Expand All @@ -107,4 +107,4 @@ const MetadataTab = () => {
);
};

export default MetadataTab;
export default DataTab;
8 changes: 4 additions & 4 deletions ui/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import FeastUI from "./FeastUI";
// 3. Register the tab in the appropriate array below. Each entry
// is a record with three keys: label, path, and Component.
// Import your component and pass it as Component
import MetadataTab from "./custom-tabs/metadata-tab/MetadataTab";
import DataTab from "./custom-tabs/data-tab/DataTab";
import RFVDemoCustomTab from "./custom-tabs/reguar-fv-demo-tab/DemoCustomTab";
import ODFVDemoCustomTab from "./custom-tabs/ondemand-fv-demo-tab/DemoCustomTab";
import FSDemoCustomTab from "./custom-tabs/feature-service-demo-tab/DemoCustomTab";
Expand All @@ -33,9 +33,9 @@ const tabsRegistry = {
Component: RFVDemoCustomTab,
},
{
label: "Metadata Tab Demo", // Navigation Label for the tab
path: "metadata-tab", // Subpath for the tab
Component: MetadataTab,
label: "Data Tab Demo", // Navigation Label for the tab
path: "data-tab", // Subpath for the tab
Component: DataTab,
},
],
OnDemandFeatureViewCustomTabs: [
Expand Down
2 changes: 1 addition & 1 deletion ui/src/queries/useLoadFeatureViewSummaryStatistics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const useLoadFeatureViewSummaryStatistics = (featureViewName: string) => {
const { projectName } = useParams();

const queryKey = `featureViewSummaryStatistics:${featureViewName}`;
const url = `/metadata/${projectName}/featureView/${featureViewName}.json`;
const url = `/data/${projectName}/featureView/${featureViewName}.json`;

return useQuery(
queryKey,
Expand Down

0 comments on commit 6be62fb

Please sign in to comment.