Skip to content

Commit

Permalink
Implement branch changing
Browse files Browse the repository at this point in the history
  • Loading branch information
vicr123 committed Jul 26, 2024
1 parent fd5b9d4 commit b5245bc
Show file tree
Hide file tree
Showing 25 changed files with 278 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
"ENABLE_TWO_FACTOR_AUTHENTICATION": "Включи 2-во фаркурно удостоверяване",
"ERROR": "Грешка",
"ERROR_BAD_TOKEN_REQUEST_TYPE": "Този метод за влизане не е наличен за този потребител.",
"ERROR_BRANCH_NOT_FOUND": "",
"ERROR_DIRTY_WORKING_TREE": "",
"ERROR_GENERIC": "",
"ERROR_INVALID_BASE_FILE_TEXT": "",
Expand Down Expand Up @@ -239,6 +240,7 @@
"PREFERRED_NAME": "",
"PRINT_BACKUP_CODES": "",
"PROJECTS": "Проекти",
"PROJECT_CHANGE_BRANCH": "",
"PROJECT_DELETE": "Изтриване на проекта",
"PROJECT_DELETE_CONFIRM_PROMPT": "",
"PROJECT_DELETE_PROMPT": "",
Expand All @@ -249,6 +251,7 @@
"PROJECT_MAINTAINERS_PROMPT": "",
"PROJECT_MAINTAINER_REMOVE": "",
"PROJECT_NAME": "Име на проекта",
"PROJECT_SOURCE_REPOSITORY": "",
"PROMOTE": "",
"PROMOTE_NO_USER_PROMPT": "",
"PROMOTE_PROMPT_1": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
"ENABLE_TWO_FACTOR_AUTHENTICATION": "",
"ERROR": "",
"ERROR_BAD_TOKEN_REQUEST_TYPE": "",
"ERROR_BRANCH_NOT_FOUND": "",
"ERROR_DIRTY_WORKING_TREE": "",
"ERROR_GENERIC": "",
"ERROR_INVALID_BASE_FILE_TEXT": "",
Expand Down Expand Up @@ -236,6 +237,7 @@
"PREFERRED_NAME": "",
"PRINT_BACKUP_CODES": "",
"PROJECTS": "",
"PROJECT_CHANGE_BRANCH": "",
"PROJECT_DELETE": "",
"PROJECT_DELETE_CONFIRM_PROMPT": "",
"PROJECT_DELETE_PROMPT": "",
Expand All @@ -246,6 +248,7 @@
"PROJECT_MAINTAINERS_PROMPT": "",
"PROJECT_MAINTAINER_REMOVE": "",
"PROJECT_NAME": "",
"PROJECT_SOURCE_REPOSITORY": "",
"PROMOTE": "",
"PROMOTE_NO_USER_PROMPT": "",
"PROMOTE_PROMPT_1": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
"ENABLE_TWO_FACTOR_AUTHENTICATION": "Slå tofaktorgodkendelse til",
"ERROR": "Fejl",
"ERROR_BAD_TOKEN_REQUEST_TYPE": "Den login-metode er ikke tilgængelig for denne bruger.",
"ERROR_BRANCH_NOT_FOUND": "",
"ERROR_DIRTY_WORKING_TREE": "Ucommittede ændringer eksisterer i repositoriet. Commit eller smid ændringerne ud først.",
"ERROR_GENERIC": "Beklager, der var en fejl.",
"ERROR_INVALID_BASE_FILE_TEXT": "Den specificerede hovedfil i .parlance.json-filen er ugyldig",
Expand Down Expand Up @@ -235,6 +236,7 @@
"PREFERRED_NAME": "",
"PRINT_BACKUP_CODES": "",
"PROJECTS": "",
"PROJECT_CHANGE_BRANCH": "",
"PROJECT_DELETE": "",
"PROJECT_DELETE_CONFIRM_PROMPT": "",
"PROJECT_DELETE_PROMPT": "",
Expand All @@ -245,6 +247,7 @@
"PROJECT_MAINTAINERS_PROMPT": "",
"PROJECT_MAINTAINER_REMOVE": "",
"PROJECT_NAME": "",
"PROJECT_SOURCE_REPOSITORY": "",
"PROMOTE": "",
"PROMOTE_NO_USER_PROMPT": "",
"PROMOTE_PROMPT_1": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
"ENABLE_TWO_FACTOR_AUTHENTICATION": "Aktiviere Zwei Faktor Authentifizierung",
"ERROR": "Fehler",
"ERROR_BAD_TOKEN_REQUEST_TYPE": "Diese Login Methode ist für den User nicht verfügbar",
"ERROR_BRANCH_NOT_FOUND": "",
"ERROR_DIRTY_WORKING_TREE": "Es existieren nicht committete Änderungen im Repository. Committe sie oder verwerfe die Änderungen.",
"ERROR_GENERIC": "Tut uns leid, aber es ist uns ein Fehler unterlaufen.",
"ERROR_INVALID_BASE_FILE_TEXT": "Die spezifizierte Basisdatei in der .parlance.json ist ungültig",
Expand Down Expand Up @@ -236,6 +237,7 @@
"PREFERRED_NAME": "",
"PRINT_BACKUP_CODES": "Backup-Codes ausdrucken",
"PROJECTS": "Projekte",
"PROJECT_CHANGE_BRANCH": "",
"PROJECT_DELETE": "Projekt löschen",
"PROJECT_DELETE_CONFIRM_PROMPT": "Wenn du {{project}} löschst, wird es auf Parlance nicht verfügbar sein, bis du es wieder hinzufügst.",
"PROJECT_DELETE_PROMPT": "Wenn du {{project}} nicht mehr brauchst, kannst du es hier löschen.",
Expand All @@ -246,6 +248,7 @@
"PROJECT_MAINTAINERS_PROMPT": "",
"PROJECT_MAINTAINER_REMOVE": "",
"PROJECT_NAME": "Projekt Name",
"PROJECT_SOURCE_REPOSITORY": "",
"PROMOTE": "Hochstufen",
"PROMOTE_NO_USER_PROMPT": "Gib bitten einen Benutzer ein, der Hochgestuft werden soll.",
"PROMOTE_PROMPT_1": "Wenn {{user}} hochgestuft wird, wird er vollen Zugriff auf den Parlance Server kriegen. Er kann dich auch runterstufen.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
"ENABLE_TWO_FACTOR_AUTHENTICATION": "Enable Two Factor Authentication",
"ERROR": "Error",
"ERROR_BAD_TOKEN_REQUEST_TYPE": "That login method is not available for this user.",
"ERROR_BRANCH_NOT_FOUND": "The branch {{branch}} was not found.",
"ERROR_DIRTY_WORKING_TREE": "Uncommitted changes exist in the repository. Commit or discard the changes first.",
"ERROR_GENERIC": "Sorry, there was an issue.",
"ERROR_INVALID_BASE_FILE_TEXT": "The specified base file in the .parlance.json file is invalid",
Expand Down Expand Up @@ -245,6 +246,7 @@
"PREFERRED_NAME": "Preferred Name",
"PRINT_BACKUP_CODES": "Print Backup Codes",
"PROJECTS": "Projects",
"PROJECT_CHANGE_BRANCH": "Change Branch",
"PROJECT_DELETE": "Delete Project",
"PROJECT_DELETE_CONFIRM_PROMPT": "Deleting {{project}} will make it unavailable within Parlance until you add it again.",
"PROJECT_DELETE_PROMPT": "If you don't need {{project}} any more, you can delete it here.",
Expand All @@ -255,6 +257,7 @@
"PROJECT_MAINTAINERS_PROMPT": "Project Maintainers have permissions to manage the project. They will be able to control the Git repository and will be notified when a source string is flagged for review.",
"PROJECT_MAINTAINER_REMOVE": "Remove as Project Maintainer",
"PROJECT_NAME": "Project Name",
"PROJECT_SOURCE_REPOSITORY": "Source Repository",
"PROMOTE": "Promote",
"PROMOTE_NO_USER_PROMPT": "Please enter a user to promote.",
"PROMOTE_PROMPT_1": "Promoting {{user}} to a superuser will allow them to have full control of the Parlance server, including being able to remove you as a superuser.",
Expand All @@ -268,9 +271,6 @@
"RELOAD": "Reload",
"RESET_PASSWORD": "Reset Password",
"RESET_PASSWORD_PROMPT": "You need to reset your password.",
"SIGNALR_CONNECTED": "Connected",
"SIGNALR_CONNECTING": "Connecting",
"SIGNALR_DISCONNECTED": "Disconnected",
"SEARCH": "Search",
"SEARCH_GLOSSARY": "Search Glossary",
"SECURITY_KEY_ADD": "Register New Passkey",
Expand Down Expand Up @@ -322,6 +322,9 @@
"SERVER_SSH_KEY_INVALID_PROMPT": "In order to access repositories over SSH, generate an SSH key and provide the repository host with the generated key.",
"SERVER_SSH_KEY_VALID_PROMPT": "Parlance will present servers with this SSH key when accessing repositories over SSH. In order to ensure Parlance has access to remote repositories, you will need to provide the repository host with this key.",
"SHOW_PLACEHOLDERS": "Show Placeholders",
"SIGNALR_CONNECTED": "Connected",
"SIGNALR_CONNECTING": "Connecting",
"SIGNALR_DISCONNECTED": "Disconnected",
"SSH": "SSH",
"SSH_KEYS": "SSH Keys",
"START_NEW_TRANSLATION": "Start New Translation",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
"ENABLE_TWO_FACTOR_AUTHENTICATION": "",
"ERROR": "",
"ERROR_BAD_TOKEN_REQUEST_TYPE": "",
"ERROR_BRANCH_NOT_FOUND": "",
"ERROR_DIRTY_WORKING_TREE": "",
"ERROR_GENERIC": "",
"ERROR_INVALID_BASE_FILE_TEXT": "",
Expand Down Expand Up @@ -235,6 +236,7 @@
"PREFERRED_NAME": "",
"PRINT_BACKUP_CODES": "",
"PROJECTS": "",
"PROJECT_CHANGE_BRANCH": "",
"PROJECT_DELETE": "",
"PROJECT_DELETE_CONFIRM_PROMPT": "",
"PROJECT_DELETE_PROMPT": "",
Expand All @@ -245,6 +247,7 @@
"PROJECT_MAINTAINERS_PROMPT": "",
"PROJECT_MAINTAINER_REMOVE": "",
"PROJECT_NAME": "",
"PROJECT_SOURCE_REPOSITORY": "",
"PROMOTE": "",
"PROMOTE_NO_USER_PROMPT": "",
"PROMOTE_PROMPT_1": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
"ENABLE_TWO_FACTOR_AUTHENTICATION": "",
"ERROR": "Erreur",
"ERROR_BAD_TOKEN_REQUEST_TYPE": "",
"ERROR_BRANCH_NOT_FOUND": "",
"ERROR_DIRTY_WORKING_TREE": "",
"ERROR_GENERIC": "",
"ERROR_INVALID_BASE_FILE_TEXT": "",
Expand Down Expand Up @@ -237,6 +238,7 @@
"PREFERRED_NAME": "",
"PRINT_BACKUP_CODES": "",
"PROJECTS": "",
"PROJECT_CHANGE_BRANCH": "",
"PROJECT_DELETE": "",
"PROJECT_DELETE_CONFIRM_PROMPT": "",
"PROJECT_DELETE_PROMPT": "",
Expand All @@ -247,6 +249,7 @@
"PROJECT_MAINTAINERS_PROMPT": "",
"PROJECT_MAINTAINER_REMOVE": "",
"PROJECT_NAME": "",
"PROJECT_SOURCE_REPOSITORY": "",
"PROMOTE": "",
"PROMOTE_NO_USER_PROMPT": "",
"PROMOTE_PROMPT_1": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
"ENABLE_TWO_FACTOR_AUTHENTICATION": "הפעל אימות דו-גורמי",
"ERROR": "שגיאה",
"ERROR_BAD_TOKEN_REQUEST_TYPE": "שיטת התחברות זו אינה זמינה עבור משתמש זה.",
"ERROR_BRANCH_NOT_FOUND": "",
"ERROR_DIRTY_WORKING_TREE": "ישנם קיימים שינויים שלא בוצעו כקומיטים במאגר. בצע קומיט או מחוק את שינוייך קודם.",
"ERROR_GENERIC": "מצטערים, קרתה בעיה.",
"ERROR_INVALID_BASE_FILE_TEXT": "קובץ הבסיס שצוין ב-.parlance.json אינו חוקי",
Expand Down Expand Up @@ -241,6 +242,7 @@
"PREFERRED_NAME": "שם מועדף",
"PRINT_BACKUP_CODES": "הדפס קודי גיבוי",
"PROJECTS": "פרוייקטים",
"PROJECT_CHANGE_BRANCH": "",
"PROJECT_DELETE": "מחק פרוייקט",
"PROJECT_DELETE_CONFIRM_PROMPT": "הסרת {{project}} יעשה אותו לא זמין ב-Parlance עד שתוסיף אותו שוב.",
"PROJECT_DELETE_PROMPT": "אם אינך זקוק ל-{{project}} יותר, אתה יכול להסיר אותו פה.",
Expand All @@ -251,6 +253,7 @@
"PROJECT_MAINTAINERS_PROMPT": "למנהלי פרויקטים יש רשות לנהל את הפרויקט. הם יכולים לשלוט על מאגר ה-Git והם יקבלו הודעה כאשר מחרוזת מקור מסומנת לבדיקה.",
"PROJECT_MAINTAINER_REMOVE": "הסר כמנהל פרויקט",
"PROJECT_NAME": "שם פרוייקט",
"PROJECT_SOURCE_REPOSITORY": "",
"PROMOTE": "קדם",
"PROMOTE_NO_USER_PROMPT": "הזן את שם המשתמש של השמתמש כדי לקדם אותו.",
"PROMOTE_PROMPT_1": "קידום {{user}} למשתמש-על יאפשר להם לקבל שליטה מלאה על שרת ה-Parlance, כולל האפשרות להסיר אותך כמשתמש-על.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
"ENABLE_TWO_FACTOR_AUTHENTICATION": "Tweefactorauthenticatie aanzetten",
"ERROR": "Fout",
"ERROR_BAD_TOKEN_REQUEST_TYPE": "DIe loginmethode is niet beschikbaar voor deze gebruiker.",
"ERROR_BRANCH_NOT_FOUND": "",
"ERROR_DIRTY_WORKING_TREE": "Er zijn nog niet gecommitte wijzigingen in deze repository. Commit de wijzigingen of gooi ze weg.",
"ERROR_GENERIC": "Sorry, er ging iets mis.",
"ERROR_INVALID_BASE_FILE_TEXT": "Het gespecificeerde basisbestand in het .parlance.json-bestand is ongeldig",
Expand Down Expand Up @@ -237,6 +238,7 @@
"PREFERRED_NAME": "Voorkeursnaam",
"PRINT_BACKUP_CODES": "Backup-codes Afdrukken",
"PROJECTS": "Projecten",
"PROJECT_CHANGE_BRANCH": "",
"PROJECT_DELETE": "Project Verwijderen",
"PROJECT_DELETE_CONFIRM_PROMPT": "Door {{project}} te verwijderen wordt het onbeschikbaar in Parlance totdat je het weer toevoegt.",
"PROJECT_DELETE_PROMPT": "Als je {{project}} niet meer nodig hebt, kun je het hier verwijderen.",
Expand All @@ -247,6 +249,7 @@
"PROJECT_MAINTAINERS_PROMPT": "Project Maintainers hebben rechten om het project te beheren. Ze hebben controle over de Git-repository en krijgen bericht als er een bronstring wordt gemarkeerd voor een review.",
"PROJECT_MAINTAINER_REMOVE": "Verwijderen als Project Maintainer",
"PROJECT_NAME": "Projectnaam",
"PROJECT_SOURCE_REPOSITORY": "",
"PROMOTE": "Promoveren",
"PROMOTE_NO_USER_PROMPT": "Vul een gebruiker in om te promoveren.",
"PROMOTE_PROMPT_1": "Door {{user}} te promoveren naar een supergebruiker krijgt diegene volledige controle over de Parlance-server, inclusief de mogelijkheid om jou te degraderen als supergebruiker.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
"ENABLE_TWO_FACTOR_AUTHENTICATION": "Habilitar autenticação em dois fatores",
"ERROR": "Erro",
"ERROR_BAD_TOKEN_REQUEST_TYPE": "Esse método de log-in não está disponível para esse usuário.",
"ERROR_BRANCH_NOT_FOUND": "",
"ERROR_DIRTY_WORKING_TREE": "Mudanças que não sofreram commit existem no repositório. Faça commit ou descarte as mudanças primeiro.",
"ERROR_GENERIC": "Desculpa, houve um problema.",
"ERROR_INVALID_BASE_FILE_TEXT": "O arquivo de base especificado no arquivo .parlance.json é invalido",
Expand Down Expand Up @@ -236,6 +237,7 @@
"PREFERRED_NAME": "Nome preferencial",
"PRINT_BACKUP_CODES": "Imprimir códigos de reserva",
"PROJECTS": "Projetos",
"PROJECT_CHANGE_BRANCH": "",
"PROJECT_DELETE": "Deletar projeto",
"PROJECT_DELETE_CONFIRM_PROMPT": "Deletar {{project}} o tornará indispónivel em Parlance até que você o adicione novamente.",
"PROJECT_DELETE_PROMPT": "Se você não precisa mais de {{project}}, você pode deletá-lo aqui.",
Expand All @@ -246,6 +248,7 @@
"PROJECT_MAINTAINERS_PROMPT": "",
"PROJECT_MAINTAINER_REMOVE": "",
"PROJECT_NAME": "Nome do projeto",
"PROJECT_SOURCE_REPOSITORY": "",
"PROMOTE": "Promover",
"PROMOTE_NO_USER_PROMPT": "Escolha um usuário para promover.",
"PROMOTE_PROMPT_1": "Promover {{user}} para um superuser permitirá que tenham controle total do servidor do Parlance, inclusive remover o seu superuser.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
"ENABLE_TWO_FACTOR_AUTHENTICATION": "Activează autentificarea prin doi pași",
"ERROR": "Eroare",
"ERROR_BAD_TOKEN_REQUEST_TYPE": "Metoda asta de autentificare nu-i disponibilă pentru utilizatorul acesta.",
"ERROR_BRANCH_NOT_FOUND": "",
"ERROR_DIRTY_WORKING_TREE": "Schimbări necomise există în repozitoriu. Comite sau revocă schimbările mai întâi.",
"ERROR_GENERIC": "Scuze, a apărut o problemă.",
"ERROR_INVALID_BASE_FILE_TEXT": "Fișierul de bază specificat în .parlance.json este invalid",
Expand Down Expand Up @@ -238,6 +239,7 @@
"PREFERRED_NAME": "Nume preferat",
"PRINT_BACKUP_CODES": "Printează codurile de backup",
"PROJECTS": "Proiecte",
"PROJECT_CHANGE_BRANCH": "",
"PROJECT_DELETE": "Șterge proiectul",
"PROJECT_DELETE_CONFIRM_PROMPT": "Ștergerea proiectului {{project}} îl va face indisponibil din Parlance până la readăugarea acestuia.",
"PROJECT_DELETE_PROMPT": "Dacă nu mai ai nevoie de proiectul {{project}}, îl poți șterge de-aici.",
Expand All @@ -248,6 +250,7 @@
"PROJECT_MAINTAINERS_PROMPT": "Întreținătorilor de proiect le este permis să gestioneze proiectul. Ei pot controla repozitoriul Git și vor fi notificați când un șir de sursă este marcat pentru revizuire.",
"PROJECT_MAINTAINER_REMOVE": "Elimină întreținătorul de proiect",
"PROJECT_NAME": "Nume proiect",
"PROJECT_SOURCE_REPOSITORY": "",
"PROMOTE": "Promovare",
"PROMOTE_NO_USER_PROMPT": "Introdu un nume de utilizator pentru a-l promova.",
"PROMOTE_PROMPT_1": "Promovarea utilizatorului {{user}} la gradul de superutilizator îi va oferi control deplin al serverului Parlance, inclusiv abilitatea de a te retrograda pe tine de la gradul de superutilizator.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
"ENABLE_TWO_FACTOR_AUTHENTICATION": "",
"ERROR": "",
"ERROR_BAD_TOKEN_REQUEST_TYPE": "",
"ERROR_BRANCH_NOT_FOUND": "",
"ERROR_DIRTY_WORKING_TREE": "",
"ERROR_GENERIC": "",
"ERROR_INVALID_BASE_FILE_TEXT": "",
Expand Down Expand Up @@ -236,6 +237,7 @@
"PREFERRED_NAME": "",
"PRINT_BACKUP_CODES": "",
"PROJECTS": "",
"PROJECT_CHANGE_BRANCH": "",
"PROJECT_DELETE": "",
"PROJECT_DELETE_CONFIRM_PROMPT": "",
"PROJECT_DELETE_PROMPT": "",
Expand All @@ -246,6 +248,7 @@
"PROJECT_MAINTAINERS_PROMPT": "",
"PROJECT_MAINTAINER_REMOVE": "",
"PROJECT_NAME": "",
"PROJECT_SOURCE_REPOSITORY": "",
"PROMOTE": "",
"PROMOTE_NO_USER_PROMPT": "",
"PROMOTE_PROMPT_1": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
"ENABLE_TWO_FACTOR_AUTHENTICATION": "Bật Xác Minh Hai Bước",
"ERROR": "Lỗi",
"ERROR_BAD_TOKEN_REQUEST_TYPE": "Không thể đăng nhập theo cách đó cho người dùng này.",
"ERROR_BRANCH_NOT_FOUND": "",
"ERROR_DIRTY_WORKING_TREE": "Có thay đổi chưa được vào lần chuyển giao. Vui lòng tạo lần chuyển giao hoặc bỏ các thay đổi trước.",
"ERROR_GENERIC": "Rất tiếc, đã xảy ra lỗi.",
"ERROR_INVALID_BASE_FILE_TEXT": "Tệp cơ sở chỉ định trong tệp .parlance.json không hợp lệ",
Expand Down Expand Up @@ -237,6 +238,7 @@
"PREFERRED_NAME": "Tên ưu tiên",
"PRINT_BACKUP_CODES": "In mã dự phòng",
"PROJECTS": "Dự án",
"PROJECT_CHANGE_BRANCH": "",
"PROJECT_DELETE": "Xóa dự án",
"PROJECT_DELETE_CONFIRM_PROMPT": "Xóa {{project}} sẽ làm cho nó không được khả dụng trong Parlance cho đến khi bạn thêm lại.",
"PROJECT_DELETE_PROMPT": "Nếu bạn không cần {{project}} nữa, bạn có thể xóa nó tại đây",
Expand All @@ -247,6 +249,7 @@
"PROJECT_MAINTAINERS_PROMPT": "",
"PROJECT_MAINTAINER_REMOVE": "Xóa tư cách Người bảo trì dự án",
"PROJECT_NAME": "Tên dự án",
"PROJECT_SOURCE_REPOSITORY": "",
"PROMOTE": "Thăng cấp",
"PROMOTE_NO_USER_PROMPT": "Vui lòng điền vào một người dùng để thăng cấp.",
"PROMOTE_PROMPT_1": "Việc thăng cấp {{user}} cho người dùng quản trị sẽ cho phép họ có toàn quyền kiểm soát máy chủ Parlance, bao gồm việc có thể xuống cấp bạn khỏi người dùng quản trị.",
Expand Down
20 changes: 13 additions & 7 deletions Parlance.ClientApp/src/components/modals/ErrorModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useTranslation } from "react-i18next";
import Modal from "../Modal";
import { VerticalLayout } from "../Layouts";
import { ReactElement, ReactNode, useEffect, useState } from "react";
import { ParlanceError } from "@/interfaces/error";

interface ErrorModalProps {
error: any;
Expand All @@ -27,15 +28,13 @@ export default function ErrorModal({
try {
if (!error) return;

let json = await error.json();
let jsonError = json.error;

if (specialRenderings && specialRenderings[jsonError]) {
setSpecialRendering(specialRenderings[jsonError]);
let json = (await error.json()) as ParlanceError;
if (specialRenderings && specialRenderings[json.error]) {
setSpecialRendering(specialRenderings[json.error]);
return;
}

switch (jsonError) {
switch (json.error) {
case "UnknownUser":
setMessage(t("ERROR_UNKNOWN_USER"));
return;
Expand Down Expand Up @@ -69,12 +68,19 @@ export default function ErrorModal({
case "BadTokenRequestType":
setMessage(t("ERROR_BAD_TOKEN_REQUEST_TYPE"));
return;
case "BranchNotFound":
setMessage(
t("ERROR_BRANCH_NOT_FOUND", {
branch: json.extraData.branch,
}),
);
return;
}
} catch {}
})();
}, [error]);

if (specialRendering) return <>specialRendering</>;
if (specialRendering) return <>{specialRendering}</>;

return (
<Modal
Expand Down
Loading

0 comments on commit b5245bc

Please sign in to comment.