Skip to content

Commit

Permalink
Merge branch 'bugfix/ZKUI-406-fix-prefix-issue' into tmp/octopus/w/2.…
Browse files Browse the repository at this point in the history
…2/bugfix/ZKUI-406-fix-prefix-issue
  • Loading branch information
bert-e committed Oct 25, 2023
2 parents 0f69c3f + 859e7cf commit 5974cb9
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
1 change: 1 addition & 0 deletions jestSetupAfterEnv.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
4 changes: 2 additions & 2 deletions src/js/vault.ts
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
4 changes: 3 additions & 1 deletion src/react/account/iamAttachment/AttachmentTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
EntityType,
ResourceType,
} from './AttachmentTypes';
import { useConfig } from '../../next-architecture/ui/ConfigProvider';

type TableProxyProps<
ENTITIES_API_RESPONSE extends {
Expand Down Expand Up @@ -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(
(
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/react/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ export const getListPolicyVersionsQuery = (
};
};

export const getAccountSeedsQuery = () => ({
export const getAccountSeedsQuery = (basePath: string) => ({
queryKey: ['AccountSeeds'],
queryFn: getAccountSeeds,
queryFn: () => getAccountSeeds(basePath),
});

interface GetObjectVersionProps {
Expand Down
10 changes: 6 additions & 4 deletions src/react/workflow/ReplicationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ 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 {
Banner,
FormGroup,
FormSection,
Icon,
Link,
Link as LinkStyle,
spacing,
Stack,
Text,
Expand Down Expand Up @@ -308,13 +309,14 @@ function ReplicationForm({
no Prefix filter), you need to edit the existing Workflow, you
cannot create the new one.
</Text>
<Link
href={`/accounts/${account!.Name}/workflows/replication-${
<LinkStyle
as={Link}
to={`/accounts/${account!.Name}/workflows/replication-${
parentReplicationStream.streamId
}`}
>
Edit the workflow
</Link>
</LinkStyle>
</Stack>
</Banner>
)}
Expand Down

0 comments on commit 5974cb9

Please sign in to comment.