diff --git a/jestSetupAfterEnv.tsx b/jestSetupAfterEnv.tsx index efbcf789f..f02438faf 100644 --- a/jestSetupAfterEnv.tsx +++ b/jestSetupAfterEnv.tsx @@ -44,6 +44,7 @@ jest.mock('./src/react/next-architecture/ui/ConfigProvider', () => { navbarEndpoint: TEST_API_BASE_URL, navbarConfigUrl: TEST_API_BASE_URL, features: [], + basePath: '', }; }), useGrafanaURL: jest.fn(() => TEST_API_BASE_URL + '/grafana'), diff --git a/src/js/vault.ts b/src/js/vault.ts index 399268061..9a0e52d0f 100644 --- a/src/js/vault.ts +++ b/src/js/vault.ts @@ -1,6 +1,6 @@ // TODO: AccountSeeds should be returned by Vault API -export function getAccountSeeds() { - return fetch('/account-seeds.json', { +export function getAccountSeeds(basePath: string) { + return fetch(`${basePath}/account-seeds.json`, { headers: { 'Content-Type': 'application/json', Accept: 'application/json' }, }).then((res) => { if (!res.ok) { diff --git a/src/react/account/iamAttachment/AttachmentTabs.tsx b/src/react/account/iamAttachment/AttachmentTabs.tsx index 456851cd4..04ce33b03 100644 --- a/src/react/account/iamAttachment/AttachmentTabs.tsx +++ b/src/react/account/iamAttachment/AttachmentTabs.tsx @@ -27,6 +27,7 @@ import { EntityType, ResourceType, } from './AttachmentTypes'; +import { useConfig } from '../../next-architecture/ui/ConfigProvider'; type TableProxyProps< ENTITIES_API_RESPONSE extends { @@ -112,6 +113,7 @@ const AttachmentTabs = ({ const theme = useTheme(); const queryObject = Object.fromEntries(query.entries()); const IAMClient = useIAMClient(); + const { basePath } = useConfig(); const { accountName } = useParams<{ accountName: string }>(); const [attachmentOperations, setAttachmentOperations] = useReducer( ( @@ -137,7 +139,7 @@ const AttachmentTabs = ({ tabLineColor: backgroundLevel4, }; - const { data: accountSeeds } = useQuery(getAccountSeedsQuery()); + const { data: accountSeeds } = useQuery(getAccountSeedsQuery(basePath)); const policyRolePair = accountSeeds?.filter( (seed) => seed.permissionPolicy.policyName === resourceName, diff --git a/src/react/queries.ts b/src/react/queries.ts index 9f3ff59ef..c262f5e1f 100644 --- a/src/react/queries.ts +++ b/src/react/queries.ts @@ -218,9 +218,9 @@ export const getListPolicyVersionsQuery = ( }; }; -export const getAccountSeedsQuery = () => ({ +export const getAccountSeedsQuery = (basePath: string) => ({ queryKey: ['AccountSeeds'], - queryFn: getAccountSeeds, + queryFn: () => getAccountSeeds(basePath), }); interface GetObjectVersionProps { diff --git a/src/react/workflow/ReplicationForm.tsx b/src/react/workflow/ReplicationForm.tsx index fecdd8998..347f425e0 100644 --- a/src/react/workflow/ReplicationForm.tsx +++ b/src/react/workflow/ReplicationForm.tsx @@ -6,6 +6,7 @@ import { FieldError, ControllerRenderProps, } from 'react-hook-form'; +import { Link } from 'react-router-dom'; import { AddButton, SubButton } from '../ui-elements/EditableKeyValue'; import type { Locations, Replication } from '../../types/config'; import { @@ -13,7 +14,7 @@ import { FormGroup, FormSection, Icon, - Link, + Link as LinkStyle, spacing, Stack, Text, @@ -308,13 +309,14 @@ function ReplicationForm({ no Prefix filter), you need to edit the existing Workflow, you cannot create the new one. - Edit the workflow - + )}