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
2 changes: 1 addition & 1 deletion docs/reference/alpha-web-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ The advantage of importing Feast UI as a module is in the ease of customization.

##### Fetching the Project List

You can use `projectListPromise` to provide a promise that overrides where the Feast UI fetches the project list from.
By default, the Feast UI fetches the project list from the app root path. You can use `projectListPromise` to provide a promise that overrides where it's fetched from.

```jsx
<FeastUI
Expand Down
2 changes: 1 addition & 1 deletion ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ The advantage of importing Feast UI as a module is in the ease of customization.

##### Fetching the Project List

You can use `projectListPromise` to provide a promise that overrides where the Feast UI fetches the project list from.
By default, the Feast UI fetches the project list from the app root path. You can use `projectListPromise` to provide a promise that overrides where it's fetched from.

```jsx
<FeastUI
Expand Down
2 changes: 1 addition & 1 deletion ui/src/FeastUI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const FeastUI = ({ reactQueryClient, feastUIConfigs }: FeastUIProps) => {
>
<QueryClientProvider client={queryClient}>
<QueryParamProvider adapter={ReactRouter6Adapter}>
<FeastUISansProviders feastUIConfigs={feastUIConfigs} />
<FeastUISansProviders basename={basename} feastUIConfigs={feastUIConfigs} />
</QueryParamProvider>
</QueryClientProvider>
</BrowserRouter>
Expand Down
8 changes: 5 additions & 3 deletions ui/src/FeastUISansProviders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ interface FeastUIConfigs {
projectListPromise?: Promise<any>;
}

const defaultProjectListPromise = () => {
return fetch("/projects-list.json", {
const defaultProjectListPromise = (basename: string) => {
return fetch(`${basename}/projects-list.json`, {
headers: {
"Content-Type": "application/json",
},
Expand All @@ -51,8 +51,10 @@ const defaultProjectListPromise = () => {
};

const FeastUISansProviders = ({
basename = "",
feastUIConfigs,
}: {
basename?: string;
feastUIConfigs?: FeastUIConfigs;
}) => {
const projectListContext: ProjectsListContextInterface =
Expand All @@ -61,7 +63,7 @@ const FeastUISansProviders = ({
projectsListPromise: feastUIConfigs?.projectListPromise,
isCustom: true,
}
: { projectsListPromise: defaultProjectListPromise(), isCustom: false };
: { projectsListPromise: defaultProjectListPromise(basename), isCustom: false };

return (
<EuiProvider colorMode="light">
Expand Down
11 changes: 1 addition & 10 deletions ui/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,7 @@ root.render(
<React.StrictMode>
<FeastUI
reactQueryClient={queryClient}
feastUIConfigs={{
tabsRegistry: tabsRegistry,
projectListPromise: fetch((process.env.PUBLIC_URL || "") + "/projects-list.json", {
headers: {
"Content-Type": "application/json",
},
}).then((res) => {
return res.json();
})
}}
feastUIConfigs={{ tabsRegistry }}
/>
</React.StrictMode>
);
Loading