+
+
+
+
+
+
+
+
+
{t('git_integration')}
+
+
+
+ ,
+ ]}
+ />
+
+
+
+ {t('your_git_access_tokens')}
+
+
+
+ {t('your_git_access_info')}
+
+
+
+ {tokenCount > 0 ? (
+ <>
+ - {t('your_git_access_info_bullet_1')}
+ - {t('your_git_access_info_bullet_2')}
+ >
+ ) : (
+ <>
+ -
+ ]}
+ />
+
+ - {t('your_git_access_info_bullet_4')}
+ - {t('your_git_access_info_bullet_5')}
+ >
+ )}
+
+
+
+
+ {isError && (
+
+
+
+ )}
+
+
+
+ {tokenCount === 0 && (
+
+
+ {t('generate_token')}
+
+
+ )}
+
+ {showExposeTokenModal && secretToken && (
+
{
+ setShowExposeTokenModal(false)
+ setSecretToken(null)
+ }}
+ />
+ )}
+
+ )
+}
diff --git a/services/web/modules/git-bridge/frontend/js/widget/components/modals/delete-token-modal.tsx b/services/web/modules/git-bridge/frontend/js/widget/components/modals/delete-token-modal.tsx
new file mode 100644
index 0000000000..b530d1083b
--- /dev/null
+++ b/services/web/modules/git-bridge/frontend/js/widget/components/modals/delete-token-modal.tsx
@@ -0,0 +1,80 @@
+import { useTranslation } from 'react-i18next'
+import { deleteJSON } from '@/infrastructure/fetch-json'
+import {
+ OLModal,
+ OLModalHeader,
+ OLModalTitle,
+ OLModalBody,
+ OLModalFooter,
+} from '@/shared/components/ol/ol-modal'
+import Notification from '@/shared/components/notification'
+import OLButton from '@/shared/components/ol/ol-button'
+import useAsync from '@/shared/hooks/use-async'
+import { debugConsole } from '@/utils/debugging'
+
+type Props = {
+ show: boolean
+ handleHide: () => void
+ tokenId: string
+ onDeleted: (id: string) => void
+}
+
+export default function DeleteTokenModal({
+ show,
+ handleHide,
+ tokenId,
+ onDeleted,
+}: Props) {
+ const { t } = useTranslation()
+
+ const { isLoading, isError, runAsync, reset } = useAsync()
+
+ const handleClose = () => {
+ reset()
+ handleHide()
+ }
+
+ const handleDelete = () => {
+ runAsync(
+ deleteJSON(`/git-bridge/personal-access-tokens/${tokenId}`, {
+ body: { _csrf: window.csrfToken },
+ })
+ )
+ .then(() => {
+ onDeleted(tokenId)
+ handleClose()
+ })
+ .catch(debugConsole.error)
+ }
+
+ return (
+