fix(github integration): handle request failed gracefully with option to close tab (#7387)

Signed-off-by: Dakshesh Jain <dakshesh.jain14@gmail.com>
This commit is contained in:
Dakshesh Jain 2024-12-09 12:16:12 +05:30 committed by GitHub
parent e41a6fee14
commit b7c0701b5f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 22 additions and 1 deletions

View File

@ -72,6 +72,8 @@
"AuthenticatedWithGithubRequired": "Please authorize Github application to act on behind you to perform actions",
"Processing": "Processing authentication/installation",
"AutoClose": "Processing complete, Tab will be auto-closed in {time} seconds.",
"RequestFailed": "Request failed. Please close the tab and try again.",
"CloseTab": "Close Tab",
"PleaseRetry": "Please retry authentication",
"Updated": "Updated",
"LinkToProject": "Connect to {title}",

View File

@ -72,6 +72,8 @@
"AuthenticatedWithGithubRequired": "Por favor, autorize a aplicação do Github a agir em seu nome para realizar ações",
"Processing": "Processando autenticação/instalação",
"AutoClose": "Processamento concluído, a guia será fechada automaticamente em {time} segundos.",
"RequestFailed": "Solicitação falhou. Por favor, feche a aba e tente novamente.",
"CloseTab": "Fechar aba",
"PleaseRetry": "Por favor, tente novamente a autenticação",
"Updated": "Atualizado",
"LinkToProject": "Conectar ao {title}",

View File

@ -72,6 +72,8 @@
"AuthenticatedWithGithubRequired": "Пожалуйста авторизуйте Github приложение для действий от вашего имени",
"Processing": "Происходит авторизация/установка",
"AutoClose": "Процесс завершен, Вкладка будет автоматически закрыта через {time} секунд.",
"RequestFailed": "Запрос не выполнен. Пожалуйста, закройте вкладку и попробуйте снова.",
"CloseTab": "Закрыть вкладку",
"PleaseRetry": "Пожалуйста повторите авторизацию",
"Updated": "Обновлено",
"LinkToProject": "Подключить к {title}",

View File

@ -72,6 +72,8 @@
"AuthenticatedWithGithubRequired": "Por favor, autoriza la aplicación de Github para actuar en tu nombre y realizar acciones",
"Processing": "Procesando autenticación/instalación",
"AutoClose": "Procesamiento completo, la pestaña se cerrará automáticamente en {time} segundos.",
"RequestFailed": "Solicitud fallida. Por favor, cierre la pestaña e intente nuevamente.",
"CloseTab": "Cerrar pestaña",
"PleaseRetry": "Por favor, vuelve a intentar la autenticación",
"Updated": "Actualizado",
"LinkToProject": "Conectar a {title}",

View File

@ -5,7 +5,7 @@
-->
<script lang="ts">
import { Account, Ref } from '@hcengineering/core'
import ui, { Label, Location, Spinner, location } from '@hcengineering/ui'
import ui, { Label, Location, Spinner, Button, location } from '@hcengineering/ui'
import { onDestroy } from 'svelte'
import github from '../plugin'
import { sendGHServiceRequest } from './utils'
@ -111,6 +111,17 @@
</div>
{:then}
<Label label={github.string.AutoClose} params={{ time: autoClose }} />
{:catch}
<div class="flex flex-col flex-center flex-gap-4">
<Label label={github.string.RequestFailed} />
<Button
label={github.string.CloseTab}
kind="primary"
on:click={() => {
window.close()
}}
/>
</div>
{/await}
</div>
{/if}

View File

@ -66,6 +66,8 @@ export default mergeIds(githubId, github, {
Processing: '' as IntlString,
AutoClose: '' as IntlString,
RequestFailed: '' as IntlString,
CloseTab: '' as IntlString,
PleaseRetry: '' as IntlString,
Updated: '' as IntlString,
LinkToProject: '' as IntlString,