Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ui/src/FeastUI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ const defaultQueryClient = new QueryClient();

const FeastUI = ({ reactQueryClient, feastUIConfigs }: FeastUIProps) => {
const queryClient = reactQueryClient || defaultQueryClient;
const basename = process.env.PUBLIC_URL ?? '';

return (
// Disable v7_relativeSplatPath: custom tab routes don't currently work with it
<BrowserRouter future={{ v7_relativeSplatPath: false, v7_startTransition: true }}>
<BrowserRouter
basename={basename}
future={{ v7_relativeSplatPath: false, v7_startTransition: true }}
>
<QueryClientProvider client={queryClient}>
<QueryParamProvider adapter={ReactRouter6Adapter}>
<FeastUISansProviders feastUIConfigs={feastUIConfigs} />
Expand Down
6 changes: 2 additions & 4 deletions ui/src/FeastUISansProviders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ const FeastUISansProviders = ({
isCustom: true,
}
: { projectsListPromise: defaultProjectListPromise(), isCustom: false };

const BASE_URL = process.env.PUBLIC_URL || ""

return (
<EuiProvider colorMode="light">
Expand All @@ -76,9 +74,9 @@ const FeastUISansProviders = ({
>
<ProjectListContext.Provider value={projectListContext}>
<Routes>
<Route path={BASE_URL + "/"} element={<Layout />}>
<Route path="/" element={<Layout />}>
<Route index element={<RootProjectSelectionPage />} />
<Route path={BASE_URL + "/p/:projectName/*"} element={<NoProjectGuard />}>
<Route path="/p/:projectName/*" element={<NoProjectGuard />}>
<Route index element={<ProjectOverviewPage />} />
<Route path="data-source/" element={<DatasourceIndex />} />
<Route
Expand Down
4 changes: 1 addition & 3 deletions ui/src/components/FeaturesInServiceDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ const FeaturesInServiceList = ({ featureViews }: FeatureViewsListInterace) => {
field: "featureViewName",
render: (name: string) => {
return (
<EuiCustomLink
to={`${process.env.PUBLIC_URL || ""}/p/${projectName}/feature-view/${name}`}
>
<EuiCustomLink to={`/p/${projectName}/feature-view/${name}`}>
{name}
</EuiCustomLink>
);
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/FeaturesListDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const FeaturesList = ({
field: "name",
render: (item: string) => (
<EuiCustomLink
to={`${process.env.PUBLIC_URL || ""}/p/${projectName}/feature-view/${featureViewName}/feature/${item}`}
to={`/p/${projectName}/feature-view/${featureViewName}/feature/${item}`}
>
{item}
</EuiCustomLink>
Expand Down
8 changes: 4 additions & 4 deletions ui/src/components/ObjectsCountStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const ObjectsCountStats = () => {
<EuiFlexItem>
<EuiStat
style={statStyle}
onClick={() => navigate(`${process.env.PUBLIC_URL || ""}/p/${projectName}/feature-service`)}
onClick={() => navigate(`/p/${projectName}/feature-service`)}
description="Feature Services→"
title={data.featureServices}
reverse
Expand All @@ -65,7 +65,7 @@ const ObjectsCountStats = () => {
<EuiStat
style={statStyle}
description="Feature Views→"
onClick={() => navigate(`${process.env.PUBLIC_URL || ""}/p/${projectName}/feature-view`)}
onClick={() => navigate(`/p/${projectName}/feature-view`)}
title={data.featureViews}
reverse
/>
Expand All @@ -74,7 +74,7 @@ const ObjectsCountStats = () => {
<EuiStat
style={statStyle}
description="Entities→"
onClick={() => navigate(`${process.env.PUBLIC_URL || ""}/p/${projectName}/entity`)}
onClick={() => navigate(`/p/${projectName}/entity`)}
title={data.entities}
reverse
/>
Expand All @@ -83,7 +83,7 @@ const ObjectsCountStats = () => {
<EuiStat
style={statStyle}
description="Data Sources→"
onClick={() => navigate(`${process.env.PUBLIC_URL || ""}/p/${projectName}/data-source`)}
onClick={() => navigate(`/p/${projectName}/data-source`)}
title={data.dataSources}
reverse
/>
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/ProjectSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const ProjectSelector = () => {

const basicSelectId = useGeneratedHtmlId({ prefix: "basicSelect" });
const onChange = (e: React.ChangeEvent<HTMLSelectElement>) => {
navigate(`${process.env.PUBLIC_URL || ""}/p/${e.target.value}`);
navigate(`/p/${e.target.value}`);
};

return (
Expand Down
6 changes: 3 additions & 3 deletions ui/src/pages/RootProjectSelectionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ const RootProjectSelectionPage = () => {
useEffect(() => {
if (data && data.default) {
// If a default is set, redirect there.
navigate(`${process.env.PUBLIC_URL || ""}/p/${data.default}`);
navigate(`/p/${data.default}`);
}

if (data && data.projects.length === 1) {
// If there is only one project, redirect there.
navigate(`${process.env.PUBLIC_URL || ""}/p/${data.projects[0].id}`);
navigate(`/p/${data.projects[0].id}`);
}
}, [data, navigate]);

Expand All @@ -38,7 +38,7 @@ const RootProjectSelectionPage = () => {
title={`${item.name}`}
description={item?.description || ""}
onClick={() => {
navigate(`${process.env.PUBLIC_URL || ""}/p/${item.id}`);
navigate(`/p/${item.id}`);
}}
/>
</EuiFlexItem>
Expand Down
2 changes: 1 addition & 1 deletion ui/src/pages/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const SideNav = () => {
: ""
}`;

const baseUrl = `${process.env.PUBLIC_URL || ""}/p/${projectName}`;
const baseUrl = `/p/${projectName}`;

const sideNav: React.ComponentProps<typeof EuiSideNav>['items'] = [
{
Expand Down
4 changes: 1 addition & 3 deletions ui/src/pages/data-sources/DataSourcesListingTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ const DatasourcesListingTable = ({
sortable: true,
render: (name: string) => {
return (
<EuiCustomLink
to={`${process.env.PUBLIC_URL || ""}/p/${projectName}/data-source/${name}`}
>
<EuiCustomLink to={`/p/${projectName}/data-source/${name}`}>
{name}
</EuiCustomLink>
);
Expand Down
4 changes: 1 addition & 3 deletions ui/src/pages/entities/EntitiesListingTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ const EntitiesListingTable = ({ entities }: EntitiesListingTableProps) => {
sortable: true,
render: (name: string) => {
return (
<EuiCustomLink
to={`${process.env.PUBLIC_URL || ""}/p/${projectName}/entity/${name}`}
>
<EuiCustomLink to={`/p/${projectName}/entity/${name}`}>
{name}
</EuiCustomLink>
);
Expand Down
4 changes: 1 addition & 3 deletions ui/src/pages/entities/FeatureViewEdgesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ const FeatureViewEdgesList = ({ fvNames }: FeatureViewEdgesListInterace) => {
field: "",
render: ({ name }: { name: string }) => {
return (
<EuiCustomLink
to={`${process.env.PUBLIC_URL || ""}/p/${projectName}/feature-view/${name}`}
>
<EuiCustomLink to={`/p/${projectName}/feature-view/${name}`}>
{name}
</EuiCustomLink>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ const FeatureServiceListingTable = ({
field: "spec.name",
render: (name: string) => {
return (
<EuiCustomLink
to={`${process.env.PUBLIC_URL || ""}/p/${projectName}/feature-service/${name}`}
>
<EuiCustomLink to={`/p/${projectName}/feature-service/${name}`}>
{name}
</EuiCustomLink>
);
Expand Down
4 changes: 2 additions & 2 deletions ui/src/pages/feature-services/FeatureServiceOverviewTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const FeatureServiceOverviewTab = () => {
tags={data.spec.tags}
createLink={(key, value) => {
return (
`${process.env.PUBLIC_URL || ""}/p/${projectName}/feature-service?` +
`/p/${projectName}/feature-service?` +
encodeSearchQueryString(`${key}:${value}`)
);
}}
Expand All @@ -133,7 +133,7 @@ const FeatureServiceOverviewTab = () => {
color="primary"
onClick={() => {
navigate(
`${process.env.PUBLIC_URL || ""}/p/${projectName}/entity/${entity.name}`
`/p/${projectName}/entity/${entity.name}`
);
}}
onClickAriaLabel={entity.name}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ const ConsumingFeatureServicesList = ({
field: "",
render: ({ name }: { name: string }) => {
return (
<EuiCustomLink
to={`${process.env.PUBLIC_URL || ""}/p/${projectName}/feature-service/${name}`}
>
<EuiCustomLink to={`/p/${projectName}/feature-service/${name}`}>
{name}
</EuiCustomLink>
);
Expand Down
4 changes: 1 addition & 3 deletions ui/src/pages/feature-views/FeatureViewListingTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ const FeatureViewListingTable = ({
sortable: true,
render: (name: string, item: genericFVType) => {
return (
<EuiCustomLink
to={`${process.env.PUBLIC_URL || ""}/p/${projectName}/feature-view/${name}`}
>
<EuiCustomLink to={`/p/${projectName}/feature-view/${name}`}>
{name} {(item.type === "ondemand" && <EuiBadge>ondemand</EuiBadge>) || (item.type === "stream" && <EuiBadge>stream</EuiBadge>)}
</EuiCustomLink>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const RegularFeatureViewOverviewTab = ({
<EuiBadge
color="primary"
onClick={() => {
navigate(`${process.env.PUBLIC_URL || ""}/p/${projectName}/entity/${entity}`);
navigate(`/p/${projectName}/entity/${entity}`);
}}
onClickAriaLabel={entity}
data-test-sub="testExample1"
Expand Down Expand Up @@ -134,7 +134,7 @@ const RegularFeatureViewOverviewTab = ({
tags={data.spec.tags}
createLink={(key, value) => {
return (
`${process.env.PUBLIC_URL || ""}/p/${projectName}/feature-view?` +
`/p/${projectName}/feature-view?` +
encodeSearchQueryString(`${key}:${value}`)
);
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const StreamFeatureViewOverviewTab = ({
</EuiText>
<EuiTitle size="s">
<EuiCustomLink
to={`${process.env.PUBLIC_URL || ""}/p/${projectName}/data-source/${inputGroup?.name}`}
to={`/p/${projectName}/data-source/${inputGroup?.name}`}
>
{inputGroup?.name}
</EuiCustomLink>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const FeatureViewProjectionDisplayPanel = (featureViewProjection: RequestDataDis
<EuiSpacer size="xs" />
<EuiTitle size="s">
<EuiCustomLink
to={`${process.env.PUBLIC_URL || ""}/p/${projectName}/feature-view/${featureViewProjection.featureViewName}`}
to={`/p/${projectName}/feature-view/${featureViewProjection.featureViewName}`}
>
{featureViewProjection?.featureViewName}
</EuiCustomLink>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const RequestDataDisplayPanel = ({
<EuiSpacer size="xs" />
<EuiTitle size="s">
<EuiCustomLink
to={`${process.env.PUBLIC_URL || ""}/p/${projectName}/data-source/${requestDataSource?.name}`}
to={`/p/${projectName}/data-source/${requestDataSource?.name}`}
>
{requestDataSource?.name}
</EuiCustomLink>
Expand Down
2 changes: 1 addition & 1 deletion ui/src/pages/features/FeatureOverviewTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const FeatureOverviewTab = () => {
<EuiDescriptionListTitle>FeatureView</EuiDescriptionListTitle>
<EuiDescriptionListDescription>
<EuiCustomLink
to={`${process.env.PUBLIC_URL || ""}/p/${projectName}/feature-view/${FeatureViewName}`}
to={`/p/${projectName}/feature-view/${FeatureViewName}`}
>
{FeatureViewName}
</EuiCustomLink>
Expand Down
4 changes: 1 addition & 3 deletions ui/src/pages/saved-data-sets/DatasetsListingTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ const DatasetsListingTable = ({ datasets }: DatasetsListingTableProps) => {
sortable: true,
render: (name: string) => {
return (
<EuiCustomLink
to={`${process.env.PUBLIC_URL || ""}/p/${projectName}/data-set/${name}`}
>
<EuiCustomLink to={`/p/${projectName}/data-set/${name}`}>
{name}
</EuiCustomLink>
);
Expand Down