Skip to content

Commit a379977

Browse files
authored
Merge pull request #160 from SafeExamBrowser/Remove-Home-And-Breadcrumb
Remove home and breadcrumb
2 parents e641689 + efd0075 commit a379977

13 files changed

Lines changed: 81 additions & 183 deletions

File tree

client/src/components/layout/container/ContainerLayout.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
:style="{ minHeight: 0 }"
1818
>
1919
<ContainerSidePanel
20-
:home-route="homeRoute"
2120
:is-navigation-overview-route="isNavigationOverviewRoute"
2221
:links="mainNavigationLinks"
2322
:navigation-overview-route="navigationOverviewRoute"

client/src/components/layout/container/ContainerSidePanel.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
data-testid="layout-navOverview-toggle"
1616
:icon="isNavigationOverviewRoute ? 'mdi-close' : 'mdi-menu'"
1717
size="large"
18-
:to="
19-
isNavigationOverviewRoute ? homeRoute : navigationOverviewRoute
20-
"
18+
:to="navigationOverviewRoute"
2119
:variant="isNavigationOverviewRoute ? 'flat' : 'text'"
2220
/>
2321

@@ -57,7 +55,6 @@ defineProps<{
5755
links: BaseNavigationLink[];
5856
isNavigationOverviewRoute: boolean;
5957
navigationOverviewRoute: RouteLocationAsRelative;
60-
homeRoute: RouteLocationAsRelative;
6158
ability: AbilityLike;
6259
}>();
6360

client/src/components/layout/container/navigationLinks.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,6 @@ export function buildBaseNavigationLinks(
1717
i18n: I18nLike,
1818
): BaseNavigationLink[] {
1919
const result: BaseNavigationLink[] = [];
20-
if (ability.canView(GUIComponent.Home)) {
21-
result.push({
22-
title: i18n.t("titles.home"),
23-
route: typedTo({ name: "/(app)/" }),
24-
icon: "mdi-home",
25-
testId: "layout-home-button",
26-
});
27-
}
2820

2921
if (ability.canView(GUIComponent.Exams)) {
3022
result.push({

client/src/components/widgets/AddButton.vue

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
@click="handleClick"
1010
>
1111
<div class="d-flex align-center ga-2 pr-4 pl-2">
12-
<v-icon size="25">mdi-plus</v-icon>
12+
<v-icon size="25">{{ icon }}</v-icon>
1313

1414
<span class="text-title-medium" style="letter-spacing: normal">
15-
{{ $t("general.addButton") }}
15+
{{ label ?? $t("general.addButton") }}
1616
</span>
1717
</div>
1818
</v-btn>
@@ -24,10 +24,20 @@ import { useRouter } from "vue-router";
2424
import type { RouteLocationAsRelative } from "vue-router";
2525
2626
const router = useRouter();
27-
const props = defineProps<{
28-
route?: RouteLocationAsRelative;
29-
dataTestId?: string;
30-
}>();
27+
const props = withDefaults(
28+
defineProps<{
29+
route?: RouteLocationAsRelative;
30+
dataTestId?: string;
31+
label?: string;
32+
icon?: string;
33+
}>(),
34+
{
35+
route: undefined,
36+
dataTestId: undefined,
37+
label: undefined,
38+
icon: "mdi-plus",
39+
},
40+
);
3141
3242
const emit = defineEmits<{
3343
(e: "click", event: MouseEvent): void;

client/src/components/widgets/breadCrumb/BreadCrumb.vue

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,13 @@
33
aria-label="Breadcrumb"
44
class="d-flex align-center flex-wrap ga-2 pl-5 text-body-medium"
55
>
6-
<v-hover v-slot="{ isHovering, props: hoverProps }">
7-
<RouterLink
8-
v-bind="hoverProps"
9-
:to="{ name: '/(app)/' }"
10-
:aria-label="$t('titles.home')"
11-
class="d-inline-flex align-center text-decoration-none"
12-
:class="isHovering ? 'text-primary' : 'text-medium-emphasis'"
13-
>
14-
<v-icon icon="mdi-home-outline" size="20" />
15-
</RouterLink>
16-
</v-hover>
17-
186
<template
197
v-for="(item, index) in items"
208
:key="`${item.label}-${index}`"
219
>
22-
<span aria-hidden="true" class="text-disabled">›</span>
10+
<span v-if="index > 0" aria-hidden="true" class="text-disabled">
11+
12+
</span>
2313

2414
<v-hover
2515
v-if="item.link"

client/src/components/widgets/homePageWidgets/HomePageInfo.vue

Lines changed: 0 additions & 29 deletions
This file was deleted.

client/src/components/widgets/homePageWidgets/HomePageMain.vue

Lines changed: 0 additions & 91 deletions
This file was deleted.

client/src/i18n/locales/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"general": {
4343
"loadingText": "Loading... Please wait",
4444
"addButton": "Add",
45+
"prepareButton": "Prepare",
4546
"cancelButton": "Cancel",
4647
"backButton": "Back",
4748
"nextButton": "Next",
@@ -2063,7 +2064,6 @@
20632064
}
20642065
},
20652066
"titles": {
2066-
"home": "Home",
20672067
"navigationOverview": "Navigation Overview",
20682068
"exams": "Exams",
20692069
"examsOverview": "Exams Overview",

client/src/pages/(app)/exam-template/index.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
:data-test-id="dataTestId"
1010
:panel-left-collapsed="!filtersOpen"
1111
>
12+
<template #ActionButton>
13+
<AddButton
14+
:route="{ name: '/(app)/exam-template/create/' }"
15+
:data-test-id="dataTestId"
16+
/>
17+
</template>
18+
1219
<template #PanelLeft>
1320
<SearchBar
1421
v-model="list.searchInputValue"
@@ -73,6 +80,7 @@
7380

7481
<script setup lang="ts">
7582
import BasicPage from "@/components/layout/pages/BasicPage.vue";
83+
import AddButton from "@/components/widgets/AddButton.vue";
7684
import SearchBar from "@/components/widgets/searches/SearchBar.vue";
7785
import EntityTable from "@/components/widgets/entity-table/EntityTable.vue";
7886
import FilterControlsRow from "@/components/widgets/filters/FilterControlsRow.vue";

client/src/pages/(app)/exam/index.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
:data-test-id="dataTestId"
66
:panel-left-collapsed="!filtersOpen"
77
>
8+
<template #ActionButton>
9+
<AddButton
10+
:route="{ name: '/(app)/exam/create/' }"
11+
:label="$t('general.prepareButton')"
12+
icon="mdi-clipboard-edit-outline"
13+
:data-test-id="dataTestId"
14+
/>
15+
</template>
16+
817
<template #PanelLeft>
918
<SearchBar
1019
v-model="list.searchInputValue"
@@ -65,6 +74,7 @@
6574

6675
<script setup lang="ts">
6776
import BasicPage from "@/components/layout/pages/BasicPage.vue";
77+
import AddButton from "@/components/widgets/AddButton.vue";
6878
import SearchBar from "@/components/widgets/searches/SearchBar.vue";
6979
import EntityTable from "@/components/widgets/entity-table/EntityTable.vue";
7080
import EnumChip from "@/components/widgets/EnumChip.vue";

0 commit comments

Comments
 (0)