Skip to content

Commit

Permalink
Menu improvements. (#23)
Browse files Browse the repository at this point in the history
* Menu improvements.

* Updated snapshots.

---------

Co-authored-by: weskubo-cgi <[email protected]>
  • Loading branch information
weskubo-cgi and weskubo-cgi authored Oct 23, 2023
1 parent e660aa5 commit 0361a6a
Show file tree
Hide file tree
Showing 17 changed files with 285 additions and 163 deletions.
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"dependencies": {
"@bcgov/bc-sans": "^2.0.0",
"@js-joda/core": "^5.5.3",
"@vueuse/core": "^10.5.0",
"axios": "^1.4.0",
"http-status-codes": "^2.2.0",
"lodash": "^4.17.21",
Expand Down
49 changes: 25 additions & 24 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@
<template>
<v-app id="app">
<div class="header">
<TheHeader />
<TheHeader @menu-toggled="handleMenuToggled" />
<TheSnackBar />
<TheNavBar v-if="pageTitle && isAuthenticated && showNavBar" :title="pageTitle" />
<TheEnvBar />
</div>

<v-main class="align-start">
<TheModalIdle v-if="isAuthenticated" class="align-start px-8 mb-0" />
<TheMenu v-if="isAuthenticated" />
<v-navigation-drawer class="site-menu" :width="200" :model-value="showMenu" :scrim="false">
<TheMenu />
</v-navigation-drawer>
<router-view class="align-start px-8 mb-0" />
</v-main>
<TheFooter />
Expand All @@ -27,7 +30,6 @@ import TheNavBar from '@/components/TheNavBar.vue'
import TheSnackBar from '@/components/TheSnackBar.vue'
import { useAppStore } from '@/stores/app'
import { useAuthStore } from '@/stores/auth'
import HttpStatus from 'http-status-codes'

export default {
name: 'App',
Expand All @@ -40,15 +42,20 @@ export default {
TheFooter,
TheMenu,
},

data() {
return {
showMenu: true,
showToTopBtn: false,
deactivateMultipleDraggableDialog: null,
}
},
computed: {
...mapState(useAuthStore, ['jwtToken', 'isAuthenticated', 'userInfo', 'isAuthorizedWebsocketUser']),
...mapState(useAppStore, ['pageTitle', 'showNavBar']),
mobile() {
return this.$vuetify.display.mobile
},
},
watch: {
/*
Expand All @@ -59,6 +66,10 @@ export default {
isAuthorizedWebsocketUser() {
this.handleWebSocket()
},
mobile() {
// Reset the menu state on mobile change
this.showMenu = false
},
},
mounted() {
this.handleWebSocket()
Expand All @@ -85,6 +96,9 @@ export default {
methods: {
...mapActions(useAppStore, ['getConfig']),
...mapActions(useAuthStore, ['getJwtToken']),
handleMenuToggled() {
this.showMenu = !this.showMenu
},
handleWebSocket() {
if (this.isAuthenticated && this.isAuthorizedWebsocketUser) {
this.$webSocketsConnect()
Expand All @@ -105,6 +119,14 @@ export default {
</script>

<style>
.site-menu {
margin-top: 2px;
}

.envBanner {
font-size: 0.8rem;
}

.header {
/* background-color: #036;
border-bottom: 2px solid #fcba19;
Expand All @@ -127,11 +149,6 @@ export default {
#toTopBtn:hover {
opacity: 1;
}

html {
font-family: 'BCSans', Verdana, Arial, sans-serif !important;
}

.v-alert.bootstrap-success {
color: #234720 !important;
background-color: #d9e7d8 !important;
Expand Down Expand Up @@ -164,26 +181,10 @@ html {
height: 100%;
}

a {
color: #1976d2;
}

a:hover {
cursor: pointer;
}

.envBanner {
font-size: 0.8rem;
}

.theme--light.application {
background: #f1f1f1;
}

h1 {
font-size: 1.25rem;
}

.v-toolbar__title {
font-size: 1rem;
}
Expand Down
83 changes: 83 additions & 0 deletions frontend/src/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,86 @@ input[type='number'] {
background-position: 100% 0;
}
}

#toTopBtn {
opacity: 0.5;
}

#toTopBtn:hover {
opacity: 1;
}
.v-alert.bootstrap-success {
color: #234720 !important;
background-color: #d9e7d8 !important;
border-color: #accbaa !important;
}

.v-alert.bootstrap-info {
color: #4e6478;
background-color: #eaf2fa !important;
border-color: #b8d4ee !important;
}

.v-alert.bootstrap-warning {
color: #81692c;
background-color: #fef4dd !important;
border-color: #fbdb8b !important;
}

.v-alert.bootstrap-error {
color: #712024;
background-color: #f7d8da !important;
border-color: #eeaaad !important;
}

.v-alert .v-icon {
padding-left: 0;
}

.full-height {
height: 100%;
}

.theme--light.application {
background: #f1f1f1;
}

.v-toolbar__title {
font-size: 1rem;
}

.v-btn {
text-transform: none !important;
}

.v-alert .v-icon {
padding-left: 0;
}

.v-alert.bootstrap-success {
color: #234720;
background-color: #d9e7d8 !important;
border-color: #accbaa !important;
}

.v-alert.bootstrap-info {
color: #4e6478;
background-color: #eaf2fa !important;
border-color: #b8d4ee !important;
}

.v-alert.bootstrap-warning {
color: #81692c;
background-color: #fef4dd !important;
border-color: #fbdb8b !important;
}

.v-alert.bootstrap-error {
color: #712024;
background-color: #f7d8da !important;
border-color: #eeaaad !important;
}

.theme--light.v-btn.v-btn--disabled:not(.v-btn--text):not(.v-btn--outlined) {
background-color: rgba(0, 0, 0, 0.12) !important;
}
26 changes: 26 additions & 0 deletions frontend/src/assets/css/reset.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
html {
font-family: 'BCSans', Verdana, Arial, sans-serif !important;
}

h1 {
font-size: 1.25rem;
}
a {
color: #1976d2;
}

a:hover {
cursor: pointer;
}

/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}

/* Firefox */
input[type='number'] {
-moz-appearance: textfield;
}
2 changes: 1 addition & 1 deletion frontend/src/components/TheEnvBar.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-app-bar class="env-bar" v-if="bannerColor !== ''" :color="bannerColor" height="20" style="margin-top: 2px; position: relative">
<v-app-bar class="env-bar" v-if="bannerColor !== ''" :color="bannerColor" height="20">
<div>
<h3 class="envBanner">{{ bannerEnvironment }} Environment</h3>
</div>
Expand Down
16 changes: 8 additions & 8 deletions frontend/src/components/TheFooter.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<template>
<v-footer color="#003366" dark absolute height="20px">
<v-footer color="#003366" dark absolute height="20px" style="z-index: 1006">
<v-row no-gutters>
<v-col class="d-flex justify-center">
<v-btn id="footer-home" variant="text" color="white" href="https://www.gov.bc.ca/"> Home </v-btn>
<v-btn id="footer-about" variant="text" color="white" href="https://www2.gov.bc.ca/gov/content/about-gov-bc-ca"> About gov.bc.ca </v-btn>
<v-btn id="footer-disclaimer" variant="text" color="white" href="http://gov.bc.ca/disclaimer"> Disclaimer </v-btn>
<v-btn id="footer-privacy" variant="text" color="white" href="http://gov.bc.ca/privacy"> Privacy </v-btn>
<v-btn id="footer-accessibility" variant="text" color="white" href="http://gov.bc.ca/webaccessibility"> Accessibility </v-btn>
<v-btn id="footer-copyright" variant="text" color="white" href="http://gov.bc.ca/copyright"> Copyright </v-btn>
<v-btn id="footer-contact" variant="text" color="white" href="https://www2.gov.bc.ca/gov/content/home/contact-us"> Contact Us </v-btn>
<v-btn id="footer-home" variant="text" color="white" href="https://www.gov.bc.ca/">Home</v-btn>
<v-btn id="footer-about" variant="text" color="white" href="https://www2.gov.bc.ca/gov/content/about-gov-bc-ca">About gov.bc.ca</v-btn>
<v-btn id="footer-disclaimer" variant="text" color="white" href="http://gov.bc.ca/disclaimer">Disclaimer</v-btn>
<v-btn id="footer-privacy" variant="text" color="white" href="http://gov.bc.ca/privacy">Privacy</v-btn>
<v-btn id="footer-accessibility" variant="text" color="white" href="http://gov.bc.ca/webaccessibility">Accessibility</v-btn>
<v-btn id="footer-copyright" variant="text" color="white" href="http://gov.bc.ca/copyright">Copyright</v-btn>
<v-btn id="footer-contact" variant="text" color="white" href="https://www2.gov.bc.ca/gov/content/home/contact-us">Contact Us</v-btn>
</v-col>
</v-row>
</v-footer>
Expand Down
20 changes: 6 additions & 14 deletions frontend/src/components/TheHeader.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<v-app-bar absolute color="rgb(0, 51, 102)" class="pl-10 pr-10 sysBar" style="z-index: 1002">
<v-app-bar-nav-icon variant="text" class="d-md-none" @click="$emit('menuToggled')" />
<!-- Navbar content -->
<v-container class="ma-0" :class="{ sizingForIconXLScreen: xl }" style="width: 100%" :fluid="true">
<v-row class="justify-space-between">
Expand Down Expand Up @@ -29,10 +30,8 @@
</v-chip>
</template>
<v-list dark style="background-color: #003366; color: white">
<v-list-item compact :to="{ name: 'home' }" id="home_button" title="Home" />
<v-list-item v-if="isMinistryUser" compact id="impersonate_button" :to="paths.ROOT.IMPERSONATE"
title="Impersonate" />
<v-list-item compact id="logout_button" :href="authRoutes.LOGOUT" title="Log Out" />
<v-list-item id="impersonate_button" v-if="isMinistryUser" :to="{ name: 'impersonate' }" title="Impersonate" />
<v-list-item id="logout_button" :href="authRoutes.LOGOUT" title="Log Out" />
</v-list>
</v-menu>
</div>
Expand All @@ -43,16 +42,16 @@

<script>
import { mapState } from 'pinia'
import { AuthRoutes, PATHS } from '@/utils/constants'
import { AuthRoutes } from '@/utils/constants'
import { useAuthStore } from '@/stores/auth'
export default {
data() {
return {
authRoutes: AuthRoutes,
paths: PATHS,
}
},
emits: ['menuToggled'],
computed: {
...mapState(useAuthStore, ['userInfo', 'isAuthenticated', 'isMinistryUser']),
dataReady: function () {
Expand All @@ -75,17 +74,10 @@ export default {
return this.$vuetify.display.xs
},
},
methods: {
goToImpersonatePage() {
// jstorey PATHS.ROOT.IMPERSONATE
this.$router.push('/impersonate')
},
}
}
</script>

<style>
<style scoped>
.gov-header .v-icon {
padding-left: 10px;
}
Expand Down
Loading

0 comments on commit 0361a6a

Please sign in to comment.