Skip to content

Commit

Permalink
Merge pull request #1 from turb0c0w/sam/scaffold
Browse files Browse the repository at this point in the history
Sam/scaffold
  • Loading branch information
turb0c0w authored Apr 24, 2024
2 parents c90c34d + 2b12abb commit 3f15c79
Show file tree
Hide file tree
Showing 257 changed files with 132 additions and 22,663 deletions.
File renamed without changes.
3 changes: 0 additions & 3 deletions strr-web/strr-layouts/app.vue → strr-web/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,3 @@
</NuxtLayout>
</div>
</template>

<script setup lang="ts">
</script>
6 changes: 6 additions & 0 deletions strr-web/assets/styles/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,10 @@ body {
font-size: 1rem;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
position: relative;
}

html, body {
overflow-x: hidden;
overflow-y: hidden;
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template>
<footer
id="bcros-main-footer"
class="flex items-center h-[56px] border-t-2 border-bcGovColor-navDivider bg-bcGovColor-footer text-sm"
class="flex flex-initial items-center border-t-2 border-bcGovColor-navDivider bg-bcGovColor-footer text-sm"
data-cy="footer"
>
<div class="m-auto px-4 h-[30.5px] w-full max-w-[1360px]">
<div class="m-auto px-4 w-full max-w-[1360px]">
<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 All @@ -13,7 +13,9 @@
:href="link.href"
:target="link.newTab ? '_blank' : '_self'"
>
{{ link.text }}

<!-- {{ t('header.buttons.createAccount') }} -->
{{ t(`footer.link.${link.text}`) }}
</a>
</li>
</ul>
Expand All @@ -40,12 +42,14 @@
<script setup lang="ts">
defineProps<{appVersion: string}>()
const t = useNuxtApp().$i18n.t
const links = [
{ text: 'Home', href: '/', newTab: false },
{ text: 'Disclaimer', href: 'https://www2.gov.bc.ca/gov/content/home/disclaimer', newTab: true },
{ text: 'Privacy', href: 'https://www2.gov.bc.ca/gov/content/home/privacy', newTab: true },
{ text: 'Accessibility', href: 'https://www2.gov.bc.ca/gov/content/home/accessibility', newTab: true },
{ text: 'Copyright', href: 'https://www2.gov.bc.ca/gov/content/home/copyright', newTab: true }
{ text: 'home', href: '/', newTab: false },
{ text: 'disclaimer', href: 'https://www2.gov.bc.ca/gov/content/home/disclaimer', newTab: true },
{ text: 'privacy', href: 'https://www2.gov.bc.ca/gov/content/home/privacy', newTab: true },
{ text: 'accessibility', href: 'https://www2.gov.bc.ca/gov/content/home/accessibility', newTab: true },
{ text: 'copyright', href: 'https://www2.gov.bc.ca/gov/content/home/copyright', newTab: true }
]
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@

<script setup lang="ts">
import { storeToRefs } from 'pinia'
import { useBcrosNavigate } from '~/composables/useBcrosNavigate'
import { useBcrosAccount } from '~/stores/account'
import { useBcrosKeycloak } from '../stores/keycloak';
import { useBcrosAuth } from '../composables/useBcrosAuth';
const props = defineProps<{ personMode?: boolean }>()
Expand All @@ -80,7 +84,7 @@ const {
goToTransactions
} = useBcrosNavigate()
// account / user
const account = useBcrosAccount()
const account = useBcrosAccount();
const { currentAccount, currentAccountName, userFullName, userAccounts } = storeToRefs(account)
// kc / auth
const keycloak = useBcrosKeycloak()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,29 @@ export const useBcrosAuth = () => {
/** Setup keycloak / user auth pieces */
async function setupAuth (kcConfig: KeycloakConfig, currentAccountId?: string) {
if (!keycloak.kc.authenticated) {
console.info('Initializing auth setup...')
console.info('Initializing auth setup...') // eslint-disable-line no-console
// initialize keycloak with user token
console.info('Initializing Keycloak...')
console.info('Initializing Keycloak...') // eslint-disable-line no-console
try {
await keycloak.initKeyCloak(kcConfig)
if (keycloak.kc.authenticated) {
// successfully initialized so setup other pieces
keycloak.syncSessionStorage()
keycloak.scheduleRefreshToken()
// set user info
console.info('Setting user name...')
console.info('Setting user name...') // eslint-disable-line no-console
await account.setUserName()
// set account info
console.info('Setting user account information...')
console.info('Setting user account information...') // eslint-disable-line no-console
await account.setAccountInfo(currentAccountId)
// check account status
console.info('Checking account status...')
console.info('Checking account status...') // eslint-disable-line no-console
// verify account status
verifyAccountStatus()
console.info('Auth setup complete.')
console.info('Auth setup complete.') // eslint-disable-line no-console
}
} catch (error) {
console.warn('Keycloak initialization failed:', error)
console.warn('Keycloak initialization failed:', error) // eslint-disable-line no-console
}
}
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
36 changes: 36 additions & 0 deletions strr-web/devops/vaults.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Base Path Openshift: /bor Firebase: /
VUE_APP_PATH="/"

# vaults canadapost
VUE_APP_ADDRESS_COMPLETE_KEY="op://canadapost/$APP_ENV/address-key/ADDRESS_COMPLETE_KEY"

# vaults btr
VUE_APP_POD_NAMESPACE="op://btr/$APP_ENV/shared/BTR_POD_NAMESPACE"

# vaults web-url
VUE_APP_DASHBOARD_URL="op://web-url/$APP_ENV/business/DASHBOARD_URL"
VUE_APP_REGISTRY_URL="op://web-url/$APP_ENV/registry/REGISTRY_URL"
VUE_APP_REGISTRY_HOME_URL="op://web-url/$APP_ENV/registry/REGISTRY_HOME_URL"
VUE_APP_AUTH_WEB_URL="op://web-url/$APP_ENV/auth-web/AUTH_WEB_URL"

# vaults API
VUE_APP_PAY_API_URL="op://API/$APP_ENV/pay-api/PAY_API_URL"
VUE_APP_PAY_API_VERSION="op://API/$APP_ENV/pay-api/PAY_API_VERSION"
VUE_APP_AUTH_API_URL="op://API/$APP_ENV/auth-api/AUTH_API_URL"
VUE_APP_AUTH_API_VERSION="op://API/$APP_ENV/auth-api/AUTH_API_VERSION"
VUE_APP_LEGAL_API_URL="op://API/$APP_ENV/legal-api/LEGAL_API_URL"
VUE_APP_LEGAL_API_VERSION_2="op://API/$APP_ENV/legal-api/LEGAL_API_VERSION_2"
VUE_APP_STATUS_API_URL="op://API/$APP_ENV/status-api/STATUS_API_URL"
VUE_APP_STATUS_API_VERSION="op://API/$APP_ENV/status-api/STATUS_API_VERSION"
VUE_APP_BTR_API_URL="op://API/$APP_ENV/btr-api/BTR_API_URL"

# vaults launchdarkly
VUE_APP_LD_CLIENT_ID="op://launchdarkly/$APP_ENV/btr/BTR_LD_CLIENT_ID"

# vaults keycloak
VUE_APP_KEYCLOAK_AUTH_URL="op://keycloak/$APP_ENV/base/KEYCLOAK_AUTH_BASE_URL"
VUE_APP_KEYCLOAK_REALM="op://keycloak/$APP_ENV/base/KEYCLOAK_REALMNAME"
VUE_APP_KEYCLOAK_CLIENTID="op://keycloak/$APP_ENV/btr-web/UI_KEYCLOAK_RESOURCE_NAME"

# vaults sentry
VUE_APP_SENTRY_DSN="op://sentry/$APP_ENV/btr-web/SENTRY_DSN"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions strr-web/lang/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"header" :{
"title": "STRR",
"buttons": {
"createAccount": "Create Account"
}
},
"footer": {
"link": {
"home": "Home",
"disclaimer": "Disclaimer",
"privacy": "Privacy",
"accessibility": "Accessibility",
"copyright": "Copyright"
}
}
}
18 changes: 18 additions & 0 deletions strr-web/lang/test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"header" :{
"title": "***",
"buttons": {
"createAccount": "***"
}
},
"footer": {
"link": {
"home": "***",
"disclaimer": "***",
"privacy": "***",
"accessibility": "***",
"copyright": "***"
}
}
}

8 changes: 8 additions & 0 deletions strr-web/layouts/default.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<template>
<div data-cy="default-layout">
<div class="flex justify-between flex-col h-screen">
<Header></Header>
<Footer></Footer>
</div>
</div>
</template>
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ export default defineNuxtConfig({
includeWorkspace: true
},
devtools: { enabled: true },
app: {
head: {
meta: [
{ name: 'viewport', content: 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, initial-scale=1' }
]
}
},
modules: [
'@nuxt/ui',
'@nuxtjs/eslint-module',
Expand Down Expand Up @@ -50,17 +57,17 @@ export default defineNuxtConfig({
ldClientId: process.env.VUE_APP_LD_CLIENT_ID || '',
legalApiURL: `${process.env.VUE_APP_LEGAL_API_URL || ''}${process.env.VUE_APP_LEGAL_API_VERSION_2 || ''}`,
payApiURL: `${process.env.VUE_APP_PAY_API_URL || ''}${process.env.VUE_APP_PAY_API_VERSION || ''}`,
btrApiURL: `${process.env.VUE_APP_STRR_API_URL || ''}${process.env.VUE_APP_STRR_API_VERSION || ''}`,
btrApiURL: `${process.env.VUE_APP_BTR_API_URL || ''}${process.env.VUE_APP_BTR_API_VERSION || ''}`,
registryHomeURL: process.env.VUE_APP_REGISTRY_HOME_URL || '',
appEnv: `${process.env.VUE_APP_POD_NAMESPACE || 'unknown'}`
}
},
css: ['~/../assets/scss/global.scss'],
css: ['~/./assets/scss/global.scss'],
vite: {
css: {
preprocessorOptions: {
scss: {
additionalData: '@use "../assets/styles/theme.scss" as *;'
additionalData: '@use "./assets/styles/theme.scss" as *;'
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions strr-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
"@vueuse/core": "^10.9.0",
"axios": "^1.6.7",
"http-status-codes": "^2.3.0",
<<<<<<< HEAD
"keycloak-js": "^24.0.3",
=======
>>>>>>> main
"launchdarkly-vue-client-sdk": "^2.0.5",
"moment": "^2.30.1",
"uuid": "^9.0.1",
Expand Down
6 changes: 6 additions & 0 deletions strr-web/pages/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<template>
<div data-cy="test-page">
<h1>Page content</h1>
<Button>Login</Button>
</div>
</template>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ export const useBcrosKeycloak = defineStore('bcros/keycloak', () => {
) {
setTimeout(() => {
if (kc.value?.isTokenExpired(minValidity)) {
console.info('Token set to expire soon. Refreshing token...')
console.info('Token set to expire soon. Refreshing token...') // eslint-disable-line no-console
kc.value?.updateToken(minValidity)
syncSessionStorage()
console.info('Token updated.')
console.info('Token updated.') // eslint-disable-line no-console
scheduleRefreshToken(timeout, minValidity)
}
}, timeout)
Expand Down
File renamed without changes.
20 changes: 0 additions & 20 deletions strr-web/strr-common-components/.env.example

This file was deleted.

24 changes: 0 additions & 24 deletions strr-web/strr-common-components/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion strr-web/strr-common-components/.npmrc

This file was deleted.

40 changes: 0 additions & 40 deletions strr-web/strr-common-components/README.md

This file was deleted.

5 changes: 0 additions & 5 deletions strr-web/strr-common-components/app.vue

This file was deleted.

Loading

0 comments on commit 3f15c79

Please sign in to comment.