From 1ba391b75588cbd5626e215fa0ab4500d1ea4a66 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Herv=C3=A9=20Dombya?=
<135591453+hervedombya@users.noreply.github.com>
Date: Thu, 27 Jun 2024 11:09:37 +0200
Subject: [PATCH 1/3] bugifx: Update SelectAccountIAMRole component to use
ConfigProvider and AuthProvider
---
src/react/ui-elements/SelectAccountIAMRole.tsx | 16 +++++++++++-----
.../__tests__/SelectAccountIAMRole.test.tsx | 3 +--
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/src/react/ui-elements/SelectAccountIAMRole.tsx b/src/react/ui-elements/SelectAccountIAMRole.tsx
index d41e04047..d274512e6 100644
--- a/src/react/ui-elements/SelectAccountIAMRole.tsx
+++ b/src/react/ui-elements/SelectAccountIAMRole.tsx
@@ -21,6 +21,8 @@ import {
import { AccountsLocationsEndpointsAdapterProvider } from '../next-architecture/ui/AccountsLocationsEndpointsAdapterProvider';
import { getListRolesQuery } from '../queries';
import { regexArn } from '../utils/hooks';
+import { AuthProvider } from '../next-architecture/ui/AuthProvider';
+import { ConfigProvider } from '../next-architecture/ui/ConfigProvider';
class NoOpMetricsAdapter implements IMetricsAdapter {
async listBucketsLatestUsedCapacity(
@@ -289,10 +291,14 @@ export const _SelectAccountIAMRole = (props: SelectAccountIAMRoleProps) => {
}
};
-export const SelectAccountIAMRole = (props: SelectAccountIAMRoleProps) => {
+export default function SelectAccountIAMRole(props: SelectAccountIAMRoleProps) {
return (
-
- <_SelectAccountIAMRole {...props} />
-
+
+
+
+ <_SelectAccountIAMRole {...props} />
+
+
+
);
-};
+}
diff --git a/src/react/ui-elements/__tests__/SelectAccountIAMRole.test.tsx b/src/react/ui-elements/__tests__/SelectAccountIAMRole.test.tsx
index aed481d40..7eb0aa51f 100644
--- a/src/react/ui-elements/__tests__/SelectAccountIAMRole.test.tsx
+++ b/src/react/ui-elements/__tests__/SelectAccountIAMRole.test.tsx
@@ -3,8 +3,7 @@ import { rest } from 'msw';
import { setupServer } from 'msw/node';
import { QueryClient, QueryClientProvider } from 'react-query';
import { TEST_API_BASE_URL } from '../../../react/utils/testUtil';
-import {
- SelectAccountIAMRole,
+import SelectAccountIAMRole, {
extractAccountIdFromARN,
} from '../SelectAccountIAMRole';
From 8ded7cb86bd1a25d575d57b3b1b96f5032f5155d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Herv=C3=A9=20Dombya?=
<135591453+hervedombya@users.noreply.github.com>
Date: Thu, 27 Jun 2024 16:41:15 +0200
Subject: [PATCH 2/3] refactor: Update SelectAccountIAMRole component to use
SelectAccountIAMRoleInternal
---
src/react/ui-elements/SelectAccountIAMRole.tsx | 14 +++++++++++---
.../__tests__/SelectAccountIAMRole.test.tsx | 3 ++-
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/src/react/ui-elements/SelectAccountIAMRole.tsx b/src/react/ui-elements/SelectAccountIAMRole.tsx
index d274512e6..7bd335070 100644
--- a/src/react/ui-elements/SelectAccountIAMRole.tsx
+++ b/src/react/ui-elements/SelectAccountIAMRole.tsx
@@ -291,13 +291,21 @@ export const _SelectAccountIAMRole = (props: SelectAccountIAMRoleProps) => {
}
};
+export const SelectAccountIAMRoleInternal = (
+ props: SelectAccountIAMRoleProps,
+) => {
+ return (
+
+ <_SelectAccountIAMRole {...props} />
+
+ );
+};
+
export default function SelectAccountIAMRole(props: SelectAccountIAMRoleProps) {
return (
-
- <_SelectAccountIAMRole {...props} />
-
+
);
diff --git a/src/react/ui-elements/__tests__/SelectAccountIAMRole.test.tsx b/src/react/ui-elements/__tests__/SelectAccountIAMRole.test.tsx
index 7eb0aa51f..cb11ae4b9 100644
--- a/src/react/ui-elements/__tests__/SelectAccountIAMRole.test.tsx
+++ b/src/react/ui-elements/__tests__/SelectAccountIAMRole.test.tsx
@@ -3,7 +3,8 @@ import { rest } from 'msw';
import { setupServer } from 'msw/node';
import { QueryClient, QueryClientProvider } from 'react-query';
import { TEST_API_BASE_URL } from '../../../react/utils/testUtil';
-import SelectAccountIAMRole, {
+import {
+ SelectAccountIAMRoleInternal as SelectAccountIAMRole,
extractAccountIdFromARN,
} from '../SelectAccountIAMRole';
From 5bcebc225f10261382b9e711c13bd77887570925 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Herv=C3=A9=20Dombya?=
<135591453+hervedombya@users.noreply.github.com>
Date: Thu, 27 Jun 2024 16:56:08 +0200
Subject: [PATCH 3/3] test: Increase timeout for waitFor in
ReplicationForm.test.tsx
---
src/react/workflow/__tests__/ReplicationForm.test.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/react/workflow/__tests__/ReplicationForm.test.tsx b/src/react/workflow/__tests__/ReplicationForm.test.tsx
index cf5a7f13f..116c21cff 100644
--- a/src/react/workflow/__tests__/ReplicationForm.test.tsx
+++ b/src/react/workflow/__tests__/ReplicationForm.test.tsx
@@ -202,6 +202,6 @@ describe('ReplicationForm', () => {
//V
await waitFor(()=>{
expect(screen.queryByRole('status')).not.toBeInTheDocument();
- }, {timeout: 2000})
+ }, {timeout: 8000})
});
});