-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
🪟 🎉 Add optional invite user hint to connector create pages #15799
Conversation
Maybe add |
c7fc8e5
to
0975ec5
Compare
111f796
to
547a909
Compare
44fc8fd
to
449a769
Compare
bc2fa98
to
1ca13bf
Compare
1ca13bf
to
fb1c179
Compare
Rebased and ready for review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have not tested locally
toggleInviteUsersModalOpen: (open) => { | ||
toggleIsOpen(open); | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just export the setState function instead of wrapping it?
const mockUseExperiment = jest.fn<ReturnType<typeof useExperiment>, Parameters<typeof useExperiment>>(); | ||
jest.doMock("hooks/services/Experiment", () => ({ | ||
useExperiment: mockUseExperiment, | ||
})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've found a different pattern for this. You might find it a little nicer, but up to you!
onClick={() => { | ||
toggleInviteUsersModalOpen(); | ||
}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit:
onClick={() => { | |
toggleInviteUsersModalOpen(); | |
}} | |
onClick={toggleInviteUsersModalOpen} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, works well! Just left a few questions/stylistic comments. Only thing missing seems to be the launch darkly feature flags, unless I missed something.
airbyte-webapp/src/packages/cloud/views/users/InviteUsersHint/InviteUsersHint.tsx
Show resolved
Hide resolved
airbyte-webapp/src/packages/cloud/services/users/InviteUsersModalService.tsx
Outdated
Show resolved
Hide resolved
airbyte-webapp/src/packages/cloud/views/users/InviteUsersHint/InviteUsersHint.module.scss
Outdated
Show resolved
Hide resolved
airbyte-webapp/src/packages/cloud/views/users/InviteUsersHint/InviteUsersHint.test.tsx
Outdated
Show resolved
Hide resolved
airbyte-webapp/src/packages/cloud/views/users/InviteUsersHint/InviteUsersHint.test.tsx
Show resolved
Hide resolved
Move cloud settings paths to its own file
8edb341
to
28fd5f3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, looks good to me!
…q#15799) * Add InviteUsersModalService and migrate UserSettingsView to use it * Add InviteUsersHint component and show in create source/destination pages * Update InviteUsersHint to use Text component and spacing variables * Add experiments for showing invite user hint Move cloud settings paths to its own file * Update Invite hint to lazy load with suspense * Fix invite user modal experiment names and add unit test * Rename CloudInviteUsersHint component file * Add notification when users are invited * Fix copy and remove plural form of invite success dialog * Show invite users hint in connector create form page * Fix stylelint issue in InviteUsersHint * Fix access management path in InviteUsersHint * Fix button text in UserSettingsView * Fix linkToUsersPage type in experiments iface * Cleanup code * Cleanup scss path in InviteUsersHint.module * update InviteUsersHint layout to be consistent with or without button
What
Closes #15660
Adds the ability to invite users from the source or destinations create pages when running in cloud mode. It can be enabled from experiment flags and provides the option to show as a link to the page or a direct modal.
How
Updates the invite user modal to be invoked from a service.
The service is then used in invite hint component to invoke the modal.
The component is lazy loaded since it's only needed when running in cloud.
Recommended reading order
airbyte-webapp/src/packages/cloud/views/users/InviteUsersHint/InviteUsersHint.tsx
airbyte-webapp/src/components/CloudInviteUsersHint/OptionalInviteUsersHint.tsx
airbyte-webapp/src/pages/SourcePage/pages/CreateSourcePage/CreateSourcePage.tsx
airbyte-webapp/src/pages/DestinationPage/pages/CreateDestinationPage/CreateDestinationPage.tsx
Tests
TODO