Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update/Borealis (master) #1293

Merged
merged 7 commits into from
Dec 9, 2024
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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@vitejs/plugin-react": "^4.2.1",
"@vitejs/plugin-react-swc": "^3.5.0",
"autosuggest-highlight": "^3.3.4",
"borealis-ui": "^0.1.13",
"borealis-ui": "^0.4.0",
"browser-detect": "^0.2.28",
"buffer": "^6.0.3",
"chart.js": "^4.4.1",
Expand Down
5 changes: 3 additions & 2 deletions src/components/app/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const MyAppMain = () => {
const provider = getProvider();
const { setUser, setConfiguration, user, configuration } = useALContext();
const { setReady: setAppLayoutReady } = useAppLayout();
const { setReady: setBorealisReady } = useBorealis();
const { setReady: setBorealisReady, setCustomIconify } = useBorealis();
const { setItems } = useAppSwitcher();
const { bootstrap } = useMyAPI();

Expand All @@ -55,9 +55,10 @@ const MyAppMain = () => {
}
};

const setReady = (layout: boolean, borealis: boolean) => {
const setReady = (layout: boolean, borealis: boolean, iconifyUrl: string = null) => {
setAppLayoutReady(layout);
setBorealisReady(borealis);
setCustomIconify(iconifyUrl);
};

useEffect(() => {
Expand Down
8 changes: 6 additions & 2 deletions src/components/hooks/useMyAPI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type BootstrapProps = {
setConfiguration: (cfg: Configuration) => void;
setLoginParams: (params: LoginParamsProps) => void;
setUser: (user: WhoAmIProps) => void;
setReady: (layout: boolean, borealis: boolean) => void;
setReady: (layout: boolean, borealis: boolean, iconifyUrl: string) => void;
retryAfter?: number;
};

Expand Down Expand Up @@ -155,7 +155,11 @@ const useMyAPI = (): UseMyAPIReturn => {
setUser(user);

// Mark the interface ready
setReady(true, user.configuration.ui.api_proxies.includes('borealis'));
setReady(
true,
'borealis' in user.configuration.ui.api_proxies,
user.configuration?.ui?.api_proxies?.borealis?.custom_iconify || null
);

// Render appropriate page
if (!user.agrees_with_tos && user.configuration.ui.tos) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/models/base/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ export type UI = {
allow_zip_downloads: boolean;

/** Proxy requests to the configured API target and add headers */
api_proxies: string[];
api_proxies: { [proxy: string]: any };

/** Hogwarts App data */
apps: AppSwitcherItem[];
Expand Down
2 changes: 1 addition & 1 deletion src/components/visual/ActionMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ const WrappedActionMenu: React.FC<TagProps> = ({
state.mouseY !== null && state.mouseX !== null ? { top: state.mouseY, left: state.mouseX } : undefined
}
>
{currentUserConfig.ui.api_proxies.includes('borealis') &&
{'borealis' in currentUserConfig.ui.api_proxies &&
type in BOREALIS_TYPE_MAP &&
value !== null &&
setBorealisDetails && (
Expand Down
2 changes: 1 addition & 1 deletion src/components/visual/ActionableCustomChip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const WrappedActionableCustomChip: React.FC<ActionableCustomChipProps> = ({
classification={classification}
/>
)}
{configuration.ui.api_proxies.includes('borealis') && data_type in BOREALIS_TYPE_MAP && label !== null ? (
{'borealis' in configuration.ui.api_proxies && data_type in BOREALIS_TYPE_MAP && label !== null ? (
<EnrichmentCustomChip
dataType={BOREALIS_TYPE_MAP[data_type]}
dataValue={label}
Expand Down
2 changes: 1 addition & 1 deletion src/components/visual/Tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const WrappedTag: React.FC<TagProps> = ({
setBorealisDetails={setShowBorealisDetails}
/>
)}
{configuration.ui.api_proxies.includes('borealis') && type in BOREALIS_TYPE_MAP && value !== null ? (
{'borealis' in configuration.ui.api_proxies && type in BOREALIS_TYPE_MAP && value !== null ? (
<EnrichmentCustomChip
dataType={BOREALIS_TYPE_MAP[type]}
dataValue={value}
Expand Down