Skip to content

Commit

Permalink
Merge branch 'ui-rework-improvements-2' into 'main'
Browse files Browse the repository at this point in the history
Ui rework improvements 2

See merge request reportcreator/reportcreator!368
  • Loading branch information
MWedl committed Dec 13, 2023
2 parents 68f95d8 + 8347300 commit 09174e3
Show file tree
Hide file tree
Showing 44 changed files with 369 additions and 493 deletions.
Binary file removed api/fonts/exo_2/Exo2-Italic-VariableFont_wght.ttf
Binary file not shown.
Binary file removed api/fonts/exo_2/Exo2-VariableFont_wght.ttf
Binary file not shown.
93 changes: 0 additions & 93 deletions api/fonts/exo_2/OFL.txt

This file was deleted.

1 change: 0 additions & 1 deletion docs/docs/designer/design-guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ We provide a range of fonts ready to use. Following fonts are available:
* [STIX Two Text](https://fonts.google.com/specimen/STIX+Two+Text){target=_blank} - similar to Times New Roman
* [Arimo](https://fonts.google.com/specimen/Arimo){target=_blank} - similar to Verdana
* [Exo](https://fonts.google.com/specimen/Exo){target=_blank}
* [Exo 2](https://fonts.google.com/specimen/Exo+2){target=_blank}
* ~~[Lato](https://fonts.google.com/specimen/Lato){target=_blank}~~*
* ~~[Roboto](https://fonts.google.com/specimen/Roboto){target=_blank}~~*
* ~~[Tinos](https://fonts.google.com/specimen/Tinos){target=_blank}~~*
Expand Down
Binary file not shown.
Binary file not shown.
15 changes: 0 additions & 15 deletions frontend/src/assets/fonts/exo2/exo2.css

This file was deleted.

Binary file not shown.
Binary file not shown.
15 changes: 15 additions & 0 deletions frontend/src/assets/fonts/noto/noto.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@font-face {
font-family: 'Noto Sans';
font-style: normal;
font-weight: 100 900;
font-display: swap;
src: url('~/assets/fonts/noto/NotoSans-VariableFont_wdth,wght.woff2') format('woff2');
}

@font-face {
font-family: 'Noto Sans';
font-style: italic;
font-weight: 100 900;
font-display: swap;
src: url('~/assets/fonts/noto/NotoSans-Italic-VariableFont_wdth,wght.woff2') format('woff2');
}
2 changes: 1 addition & 1 deletion frontend/src/assets/global.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@use "@/assets/settings.scss" as settings;
@use "@/assets/vuetify.scss" as vuetify;
@import '~/assets/fonts/exo2/exo2.css';
@import '~/assets/fonts/noto/noto.css';


// Hide scrollbar when it is not needed
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/assets/settings.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Vuetify settings
$body-font-family: 'Exo 2', sans-serif;
$body-font-family: 'Noto Sans', sans-serif;

// Colors
$risk-color-info: #14AE92;
Expand Down
1 change: 1 addition & 0 deletions frontend/src/assets/vuetify.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
// Vuetify customizations
@forward 'vuetify/settings' with (
$body-font-family: settings.$body-font-family,
$list-item-icon-opacity: 1,
);
5 changes: 0 additions & 5 deletions frontend/src/components/EditToolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,4 @@ defineExpose({
}
}
.context-menu :deep() {
.v-list-item__prepend > .v-icon {
opacity: 1;
}
}
</style>
69 changes: 39 additions & 30 deletions frontend/src/components/ListView.vue
Original file line number Diff line number Diff line change
@@ -1,37 +1,42 @@
<template>
<v-container fluid class="pt-0">
<v-list v-if="items" class="pt-0 overflow-visible">
<div class="list-header pt-2 mb-4">
<h1>
<slot name="title" />
<full-height-page>
<v-container class="pt-0">
<v-list v-if="items" class="pt-0 overflow-visible">
<div class="list-header pt-2 mb-4">
<h1>
<slot name="title" />

<div v-if="$slots.actions" class="list-header-actions">
<slot name="actions" />
</div>
</h1>
<div v-if="$slots.actions" class="list-header-actions">
<slot name="actions" />
</div>
</h1>

<slot name="searchbar" :items="items">
<v-text-field
:model-value="items.search.value"
@update:model-value="updateSearch"
label="Search"
variant="underlined"
spellcheck="false"
hide-details="auto"
autofocus
class="mt-0 mb-2"
/>
</slot>
</div>
<slot name="searchbar" :items="items">
<v-text-field
:model-value="items.search.value"
@update:model-value="updateSearch"
label="Search"
variant="underlined"
spellcheck="false"
hide-details="auto"
autofocus
class="mt-0 mb-2"
/>
</slot>
<v-tabs v-if="$slots.tabs" height="30" selected-class="text-primary" class="list-header-tabs">
<slot name="tabs" />
</v-tabs>
</div>

<slot v-for="item in items.data.value" name="item" :item="item" />
<page-loader :items="items" class="mt-4" />
<v-list-item
v-if="items.data.value.length === 0 && !items.hasNextPage.value"
text="No data found"
/>
</v-list>
</v-container>
<slot v-for="item in items.data.value" name="item" :item="item" />
<page-loader :items="items" class="mt-4" />
<v-list-item
v-if="items.data.value.length === 0 && !items.hasNextPage.value"
text="No data found"
/>
</v-list>
</v-container>
</full-height-page>
</template>

<script setup lang="ts" generic="T">
Expand Down Expand Up @@ -86,4 +91,8 @@ defineExpose({
margin-left: 0.4rem;
}
}
.list-header-tabs:deep(.v-tab) {
text-transform: initial;
}
</style>
4 changes: 4 additions & 0 deletions frontend/src/components/LoginProviderForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
</slot>
</v-list>
</v-card-text>
<v-card-actions v-if="$slots.actions">
<v-spacer />
<slot name="actions" />
</v-card-actions>
</s-card>
</template>

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/ProInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ const apiSettings = useApiSettings();
}
.pro-badge {
color: rgb(var(--v-theme-primary));
font-weight: 800;
font-weight: 900;
}
</style>
11 changes: 0 additions & 11 deletions frontend/src/components/S/SubMenu.vue

This file was deleted.

8 changes: 6 additions & 2 deletions frontend/src/composables/auth.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { NavigateToOptions } from "nuxt/dist/app/composables/router";
import type { LocationQueryValue } from "#vue-router";
import { AuthProviderType } from "@/utils/types";
import type { AuthProvider, User } from "@/utils/types";
Expand Down Expand Up @@ -36,6 +37,9 @@ export const useAuthStore = defineStore('auth', {
this.authRedirect = redirect;
}
},
clearAuthRedirect() {
this.authRedirect = null;
}
},
persist: {
storage: persistedState.sessionStorage,
Expand Down Expand Up @@ -72,10 +76,10 @@ export function useAuth() {
return await navigateTo(redirect, { external });
}

async function redirectToReAuth() {
async function redirectToReAuth(options?: NavigateToOptions) {
const route = useRoute();
store.setAuthRedirect(route.fullPath);
return await navigateTo('/login/reauth/');
return await navigateTo('/login/reauth/', options);
}

async function logout() {
Expand Down
32 changes: 20 additions & 12 deletions frontend/src/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="height-fullscreen">
<nuxt-loading-indicator :height="2" :color="false" />
<v-app-bar absolute height="48" elevation="0" color="header" class="menu-appbar">
<v-app-bar-nav-icon v-if="auth.loggedIn.value" @click="navigationDrawerVisible = !navigationDrawerVisible" :ripple="false" color="logo">
<v-app-bar-nav-icon v-if="auth.loggedIn.value" @click="navigationDrawerVisible = !navigationDrawerVisible" :ripple="false">
<svg-logo />
</v-app-bar-nav-icon>
<div v-else class="menu-drawer-header">
Expand Down Expand Up @@ -43,10 +43,10 @@
<span class="license-text">{{ licenseText }}</span>
</div>
<v-list class="pt-0 menu-drawer-body">
<v-list-item to="/projects/" title="Projects" prepend-icon="mdi-file-document" />
<v-list-item to="/templates/" title="Templates" prepend-icon="mdi-view-compact" />
<v-list-item to="/designs/" title="Designs" prepend-icon="mdi-pencil-ruler" />
<v-list-item to="/notes/personal/" title="Notes" prepend-icon="mdi-notebook" />
<v-list-item to="/projects/" title="Projects" prepend-icon="mdi-file-document" :active="route.path.startsWith('/projects')" />
<v-list-item to="/templates/" title="Templates" prepend-icon="mdi-view-compact" :active="route.path.startsWith('/templates')" />
<v-list-item to="/designs/" title="Designs" prepend-icon="mdi-pencil-ruler" :active="route.path.startsWith('/designs')" />
<v-list-item to="/notes/personal/" title="Notes" prepend-icon="mdi-notebook" :active="route.path.startsWith('/notes')" />

<template v-if="auth.permissions.superuser || auth.permissions.user_manager || auth.permissions.view_license">
<v-list-item class="mt-6 pa-0" min-height="0">
Expand Down Expand Up @@ -74,7 +74,13 @@
</template>
</v-list-item>

<v-list-item to="/users/" title="Users" prepend-icon="mdi-account-multiple" :disabled="!auth.permissions.user_manager" />
<v-list-item
to="/users/"
title="Users"
prepend-icon="mdi-account-multiple"
:active="route.path.startsWith('/users') && !route.path.startsWith('/users/self')"
:disabled="!auth.permissions.user_manager"
/>
<license-info-menu-item />
</template>
</v-list>
Expand Down Expand Up @@ -167,8 +173,10 @@ head.hooks.hook('dom:beforeRender', syncBreadcrumbs);
fill: rgb(var(--v-theme-primary));
}
.v-breadcrumbs-item .v-icon {
font-size: 1.5em;
.v-breadcrumbs-item {
.v-icon {
font-size: 1.5em;
}
}
.menu-drawer:deep() {
Expand Down Expand Up @@ -212,8 +220,8 @@ head.hooks.hook('dom:beforeRender', syncBreadcrumbs);
align-items: center;
flex-grow: 0;
flex-shrink: 0;
padding-left: 1em;
padding-right: 1em;
padding-left: 0.75rem;
padding-right: 0.75rem;
cursor: pointer;
border-bottom-width: vuetify.$navigation-drawer-border-thin-width;
border-bottom-style: vuetify.$navigation-drawer-border-style;
Expand All @@ -240,8 +248,8 @@ head.hooks.hook('dom:beforeRender', syncBreadcrumbs);
height: 28px;
display: flex;
flex-direction: column-reverse;
font-weight: 800;
font-size: larger;
font-weight: 900;
font-size: 1.5rem;
line-height: 1;
color: rgb(var(--v-theme-logo));
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/designs/[projectTypeId]/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-container fluid class="pt-0">
<v-container class="pt-0">
<v-form ref="form">
<edit-toolbar v-bind="toolbarAttrs" :form="$refs.form">
<template #context-menu>
Expand Down
Loading

0 comments on commit 09174e3

Please sign in to comment.