sudoModal.tsx 470 B

12345678910111213141516
  1. import ModalStore from 'sentry/stores/modalStore';
  2. type OpenSudoModalOptions = {
  3. isSuperuser?: boolean;
  4. needsReload?: boolean;
  5. onClose?: () => void;
  6. retryRequest?: () => Promise<any>;
  7. sudo?: boolean;
  8. };
  9. export async function openSudo({onClose, ...args}: OpenSudoModalOptions = {}) {
  10. const mod = await import('sentry/components/modals/sudoModal');
  11. const {default: Modal} = mod;
  12. ModalStore.openModal(deps => <Modal {...deps} {...args} />, {onClose});
  13. }