Skip to content
This repository was archived by the owner on May 10, 2024. It is now read-only.

Commit 3a905a7

Browse files
committed
refactor: navbar links
1 parent 8b2ad11 commit 3a905a7

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

docs/report-asw/report.tex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,6 +1078,8 @@ \subsection{API Testing}
10781078

10791079
\section{Deployment}
10801080

1081+
\todo{Add file secrets for mailer}
1082+
10811083
\subsection{Prerequisites}
10821084

10831085
\begin{itemize}

frontend/src/components/NavbarComponent.vue

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
<script setup lang="ts">
2-
import { library } from "@fortawesome/fontawesome-svg-core";
3-
import { faEnvelope, faBars, faUser, faRightToBracket, faRightFromBracket, faEnvelopeOpen, faEnvelopeOpenText } from "@fortawesome/free-solid-svg-icons";
4-
import { useAuthStore } from "@/stores/auth";
5-
import { useNotificationsStore } from '@/stores/notificationsStore'
2+
import {library} from "@fortawesome/fontawesome-svg-core";
3+
import {
4+
faBars,
5+
faEnvelope,
6+
faEnvelopeOpen,
7+
faEnvelopeOpenText,
8+
faRightFromBracket,
9+
faRightToBracket,
10+
faUser
11+
} from "@fortawesome/free-solid-svg-icons";
12+
import {useAuthStore} from "@/stores/auth";
13+
import {useNotificationsStore} from '@/stores/notificationsStore'
614
import {Role} from "@/commons/utils";
715
816
const authStore = useAuthStore();
@@ -35,15 +43,12 @@ library.add(faEnvelope, faEnvelopeOpen, faEnvelopeOpenText, faBars, faUser, faRi
3543
</a>
3644
<div class="collapse navbar-collapse" id="navbarNav">
3745
<ul class="navbar-nav mx-auto">
38-
<li class="nav-item">
46+
<li class="nav-item" v-if="authStore.isLogged && authStore.userRole == Role.User">
3947
<a class="nav-link active" aria-current="page" href="/">Home</a>
4048
</li>
4149
<li v-if="authStore.isLogged" class="nav-item">
4250
<a class="nav-link" href="/dashboard">Dashboard</a>
4351
</li>
44-
<li v-if="authStore.isLogged" class="nav-item">
45-
<a class="nav-link" href="/elections">Elections</a>
46-
</li>
4752
<li v-if="authStore.isLogged && authStore.userRole === Role.Admin" class="nav-item">
4853
<a class="nav-link" href="/elections/create">Create election</a>
4954
</li>

0 commit comments

Comments
 (0)