Translating retry connection error message and fixing E2E tests

This commit is contained in:
David Négrier 2022-01-19 11:36:08 +01:00 committed by Alexis Faizeau
parent 51c3f1d972
commit 0be77164ec
7 changed files with 61 additions and 12 deletions

View file

@ -1,5 +1,6 @@
<script lang="ts">
import { errorStore, hasClosableMessagesInErrorStore } from "../../Stores/ErrorStore";
import { _ } from "../../Translator/Translator";
function close(): boolean {
errorStore.clearClosableMessages();
@ -8,7 +9,7 @@
</script>
<div class="error-div nes-container is-dark is-rounded" open>
<p class="nes-text is-error title">Error</p>
<p class="nes-text is-error title">{_("error.error")}</p>
<div class="body">
{#each $errorStore as error}
<p>{error.message}</p>

View file

@ -1,6 +1,7 @@
import axios from "axios";
import * as rax from "retry-axios";
import { errorStore } from "../Stores/ErrorStore";
import { _ } from "../Translator/Translator";
/**
* This instance of Axios will retry in case of an issue and display an error message as a HTML overlay.
@ -26,10 +27,13 @@ axiosWithRetry.defaults.raxConfig = {
console.log(err);
console.log(cfg);
console.log(`Retry attempt #${cfg?.currentRetryAttempt} on URL '${err.config.url}'`);
errorStore.addErrorMessage("Unable to connect to WorkAdventure. Are you connected to internet?", {
closable: false,
id: "axios_retry",
});
errorStore.addErrorMessage(
_("error.connection-retry.unable-to-connect-to-workAdventure-are-you-connected-to-internet"),
{
closable: false,
id: "axios_retry",
}
);
},
};

View file

@ -9,6 +9,10 @@
"title": "Connection rejected",
"sub-title": "You cannot join the World. Try again later {{error}}.",
"details": "If you want more information, you may contact administrator or contact us at: hello@workadventu.re"
}
},
"connection-retry": {
"unable-to-connect-to-workAdventure-are-you-connected-to-internet": "Unable to connect to WorkAdventure. Are you connected to internet?"
},
"error": "Error"
}
}
}

View file

@ -9,6 +9,10 @@
"title": "Connexion rejetée",
"sub-title": "Vous ne pouvez pas rejoindre le monde. Réessayer plus tard {{error}}.",
"details": "Si vous souhaitez obtenir de plus amples informations, vous pouvez contacter l'administrateur ou nous contacter à l'adresse suivante: hello@workadventu.re"
}
},
"connection-retry": {
"unable-to-connect-to-workAdventure-are-you-connected-to-internet": "Impossible de se connecter à WorkAdventure. Etes vous connecté à Internet?"
},
"error": "Erreur"
}
}
}