Skip to content

Commit

Permalink
minor cleanup in prep for consolidation across projects (#4)
Browse files Browse the repository at this point in the history
* minor cleanup in prep for consolidation across projects

Signed-off-by: Kial Jinnah <kialj876@gmail.com>

* PR review update

Signed-off-by: Kial Jinnah <kialj876@gmail.com>

* system banner tweak

Signed-off-by: Kial Jinnah <kialj876@gmail.com>

---------

Signed-off-by: Kial Jinnah <kialj876@gmail.com>
  • Loading branch information
kialj876 authored Jun 5, 2024
1 parent 140ca89 commit 6a5817e
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 17 deletions.
3 changes: 2 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ export default defineNuxtConfig({
appEnv: `${process.env.VUE_APP_POD_NAMESPACE || 'unknown'}`,
requireLogin: true,
version: process.env.npm_package_version || '',
appName: process.env.npm_package_name || ''
appName: process.env.npm_package_name || '',
appNameDisplay: 'BCROS Business Dashboard'
}
}
})
2 changes: 0 additions & 2 deletions src/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ export default defineAppConfig({
}
},
alert: {
// NB: gap classes are applied to the div underneath the wrapper
gap: 'max-w-[1360px] p-4 mx-auto',
inner: 'pt-2',
color: {
yellow: {
Expand Down
2 changes: 1 addition & 1 deletion src/app/router.options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default <RouterConfig> {
path: '/:identifier',
component: () => import('~/pages/dashboard.vue').then(r => r.default || r),
meta: {
layout: 'default',
layout: 'business',
title: 'Business Dashboard',
breadcrumbs: [getBcrosHomeCrumb, getRegistryDashCrumb, getBusinessDashCrumb]
}
Expand Down
6 changes: 5 additions & 1 deletion src/assets/styles/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
@apply bg-gray-100 text-gray-700 min-h-[100vh] flex flex-col;
}

.app-inner-container {
@apply max-w-[1360px] w-[100vw] mx-auto px-4;
}

.app-body {
@apply grow relative max-w-[1360px] w-[100vw] mx-auto my-0 px-4 py-0;
@apply grow relative;
}
2 changes: 1 addition & 1 deletion src/components/bcros/Breadcrumb.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="bg-blue-350" data-cy="bcros-breadcrumb">
<div class="flex flex-wrap divide-x divide-white mx-auto py-[7px] px-4 h-[45px] w-full max-w-[1360px] text-white">
<div class="flex flex-wrap divide-x divide-white py-[7px] h-[45px] text-white app-inner-container">
<UButton
class="mr-3 mt-[1px] px-1 h-[28px] w-[28px] rounded-full"
color="white"
Expand Down
2 changes: 1 addition & 1 deletion src/components/bcros/BusinessDetails.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div id="bcros-business-details" class="bg-white h-[150px]" data-cy="business-details">
<div class="grid grid-cols-2 m-auto px-4 pt-5 w-full max-w-[1360px] text-bcGovGray-900">
<div class="grid grid-cols-2 pt-5 text-bcGovGray-900 app-inner-container">
<div class="col-auto" data-cy="business-details-name">
<h2 class="font-bold text-xl">
{{ currentBusinessName }}
Expand Down
5 changes: 3 additions & 2 deletions src/components/bcros/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class="flex items-center h-[56px] border-t-2 border-yellow-400 bg-bcGovColor-darkBlue text-sm"
data-cy="bcros-footer"
>
<div class="m-auto px-4 h-[30.5px] w-full max-w-[1360px]">
<div class="h-[30.5px] w-full app-inner-container">
<nav class="flex flex-grow">
<ul class="p-0 -ml-2 list-none">
<li v-for="link in links" :key="link.text" class="inline-block mr-2 pr-2 border-r last:mr-0 last:border-r-0">
Expand Down Expand Up @@ -36,7 +36,8 @@
</template>

<script setup lang="ts">
defineProps<{ aboutText: string }>()
const aboutText = useRuntimeConfig().public.appNameDisplay +
` v${useRuntimeConfig().public.version}`
const links = [
{ text: 'Home', href: '/', newTab: false },
Expand Down
4 changes: 2 additions & 2 deletions src/components/bcros/SystemBanner.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<template>
<UAlert
v-show="!!message && !close"
class="border-b-2 border-yellow-400"
class="border-b-2 border-yellow-400 py-0"
color="yellow"
:description="message"
variant="solid"
:close-button="{ class: 'pr-2 text-gray-900' }"
:ui="{ rounded: 'rounded-none', padding: 'p-0' }"
:ui="{ rounded: 'rounded-none', padding: 'p-0', gap: 'app-inner-container py-2' }"
@close="close = true"
>
<template #icon>
Expand Down
2 changes: 1 addition & 1 deletion src/components/bcros/header/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
>
<div
id="bcros-main-header__container"
class="flex flex-wrap content-center m-auto px-4 h-[68px] w-full max-w-[1360px]"
class="flex flex-wrap content-center h-[68px] app-inner-container"
>
<nav id="bcros-main-header__container__actions" class="flex flex-wrap content-center h-[50px] w-full">
<a id="bcros-main-header__container__actions__home-redirect" class="flex" @click="goToBcrosHome()">
Expand Down
30 changes: 30 additions & 0 deletions src/layouts/business.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<template>
<div class="app-container" data-cy="default-layout">
<bcros-header />
<bcros-system-banner
class="justify-center"
:message="systemMessage"
/>
<bcros-breadcrumb v-if="crumbConstructors.length > 0" :crumb-constructors="crumbConstructors" />
<bcros-business-details />
<div class="app-inner-container app-body">
<slot />
</div>
<bcros-footer />
</div>
</template>

<script setup lang="ts">
const route = useRoute()
const crumbConstructors = computed(() => (route?.meta?.breadcrumbs || []) as (() => BreadcrumbI)[])
const systemMessage = ref('')
onMounted(async () => {
await useBcrosLaunchdarkly().ldClient.waitUntilReady()
systemMessage.value = useBcrosLaunchdarkly().getStoredFlag('banner-text')
})
</script>

<style scoped>
</style>
7 changes: 2 additions & 5 deletions src/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
:message="systemMessage"
/>
<bcros-breadcrumb v-if="crumbConstructors.length > 0" :crumb-constructors="crumbConstructors" />
<bcros-business-details />
<div class="app-body">
<div class="app-inner-container app-body">
<slot />
</div>
<bcros-footer :about-text="'BCROS Business Dashboard UI v' + version" />
<bcros-footer />
</div>
</template>

Expand All @@ -23,8 +22,6 @@ onMounted(async () => {
await useBcrosLaunchdarkly().ldClient.waitUntilReady()
systemMessage.value = useBcrosLaunchdarkly().getStoredFlag('banner-text')
})
const version = useRuntimeConfig().public.version
</script>

<style scoped>
Expand Down

0 comments on commit 6a5817e

Please sign in to comment.