overleaf/services/web/frontend/stories/subscription/sso/enable-modal.stories.tsx
Miguel Serrano d94eaa19cc Merge pull request #14587 from overleaf/mf-enable-sso-managed-users
[web] Enable SSO switch on Group Settings

GitOrigin-RevId: 591881eb4e6bad912de026f7a687f3b020712c2d
2023-10-02 08:04:18 +00:00

37 lines
1 KiB
TypeScript

import SSOEnableModal, {
type SSOEnableModalProps,
} from '../../../../modules/managed-users/frontend/js/components/modals/sso-enable-modal'
import useFetchMock from '../../hooks/use-fetch-mock'
import { useMeta } from '../../hooks/use-meta'
export const EnableSSOModalDefault = (args: SSOEnableModalProps) => {
useMeta({ 'ol-groupId': '123' })
useFetchMock(fetchMock => {
fetchMock.post('express:/manage/groups/:id/settings/enableSSO', 200, {
delay: 500,
})
})
return <SSOEnableModal {...args} />
}
export const EnableSSOModalError = (args: SSOEnableModalProps) => {
useMeta({ 'ol-groupId': '123' })
useFetchMock(fetchMock => {
fetchMock.post('express:/manage/groups/:id/settings/enableSSO', 500, {
delay: 500,
})
})
return <SSOEnableModal {...args} />
}
export default {
title: 'Subscription / SSO / Enable Modal',
component: SSOEnableModal,
args: {
show: true,
},
argTypes: {
handleHide: { action: 'close modal' },
onEnableSSO: { action: 'callback' },
},
}