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

bugifx: Update SelectAccountIAMRole component #757

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
16 changes: 11 additions & 5 deletions src/react/ui-elements/SelectAccountIAMRole.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -289,10 +291,14 @@ export const _SelectAccountIAMRole = (props: SelectAccountIAMRoleProps) => {
}
};

export const SelectAccountIAMRole = (props: SelectAccountIAMRoleProps) => {
export default function SelectAccountIAMRole(props: SelectAccountIAMRoleProps) {
return (
<InternalProvider defaultValue={props.defaultValue}>
<_SelectAccountIAMRole {...props} />
</InternalProvider>
<ConfigProvider>
<AuthProvider>
Comment on lines +306 to +307
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should put these import in the InternalProvider component

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 8ded7cb
Bring this providers seems to break tests and the implementation of the component

<InternalProvider defaultValue={props.defaultValue}>
<_SelectAccountIAMRole {...props} />
</InternalProvider>
</AuthProvider>
</ConfigProvider>
);
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Loading