overleaf/services/web/frontend/stories/subscription/sso/disable-modal.stories.tsx
Davinder Singh 9563373466 Group SSO - Adding disable button functionality (#15052)
GitOrigin-RevId: 50024c6a8c6ce3fc64262f813bb31f3639746aae
2023-10-10 07:57:51 +00:00

37 lines
1 KiB
TypeScript

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