Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TECH-2249] Catch all error screen #20

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions client/src/assets/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,12 @@ export const en = {
"Please follow instructions in the VoteHub app to restart the ballot check again.",
button: "OK",
},
general_error: {
title: "Votehub app stopped responding",
description:
"Please check the Votehub app and start the Ballot Check again",
button: "OK",
},
},
timedown: {
title: "The passkey will expire in %{timeLeft}",
Expand Down
6 changes: 6 additions & 0 deletions client/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import HelpView from "../views/HelpView.vue";
import AboutView from "../views/AboutView.vue";
import BallotVerifierFound from "@/views/BallotVerifierFound.vue";
import SessionTimeout from "@/views/SessionTimeout.vue";
import ErrorScreen from "@/views/ErorrScreen.vue";

const router = createRouter({
history: createWebHistory(),
Expand Down Expand Up @@ -72,6 +73,11 @@ const router = createRouter({
path: "/:locale/:electionSlug/session_expired",
component: SessionTimeout,
},
{
name: "ErrorScreen",
path: "/:locale/:electionSlug/error",
component: ErrorScreen,
},
],
});

Expand Down
67 changes: 67 additions & 0 deletions client/src/views/ErorrScreen.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<script setup lang="ts">
import router from "../router";
</script>

<template>
<main class="ErrorScreen">
<AVCard class="ErrorScreen__Card">
<AVIcon icon="triangle-exclamation" class="ErrorScreen__Icon" />
<h2>{{ $t(`views.general_error.title`) }}</h2>
<p>{{ $t("views.general_error.description") }}</p>
<AVButton
type="neutral"
:label="$t('views.general_error.button')"
class="ErrorScreen__Button"
@click="router.push({ name: 'Welcome' })"
/>
</AVCard>
</main>
</template>

<style type="text/css">
.ErrorScreen__Card {
margin-top: 6rem;
padding: 4rem !important;
gap: 2rem;
text-align: center;
position: relative;
height: fit-content;
}

.ErrorScreen__Card::before {
content: "";
background-color: var(--semantic-warning-1);
height: 0.5rem;
width: calc(100% + 2px);
top: -0.5rem;
left: -1px;
position: absolute;
}

.ErrorScreen__Icon {
color: var(--slate-600);
height: 50px;
width: 50px;
align-self: center;
}

.ErrorScreen h2 {
margin: 0;
font-size: 26px;
font-weight: 600;
color: var(--slate-700);
}

.ErrorScreen p {
margin: 0;
max-width: 28rem;
align-self: center;
}

.ErrorScreen__Button {
margin-top: 1rem;
align-self: center;
width: 24rem;
max-width: 100%;
}
</style>
1 change: 1 addition & 0 deletions client/src/views/SessionTimeout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@ import router from "../router";
margin-top: 1rem;
align-self: center;
width: 24rem;
max-width: 100%;
}
</style>