Skip to content

Commit

Permalink
SbcCC Version Updates + Lien/Locked Updates (#1645)
Browse files Browse the repository at this point in the history
* Authentication Flow updates

* minor syntax fix and error handling

* Remove extra console

* RL Collateral Selector fix
  • Loading branch information
cameron-eyds authored Dec 6, 2023
1 parent adcee50 commit d63a2eb
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 73 deletions.
48 changes: 16 additions & 32 deletions ppr-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ppr-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
"@vuelidate/core": "^2.0.3",
"@vuelidate/validators": "^2.0.4",
"@vuepic/vue-datepicker": "^7.2.2",
"axios": "^0.21.1",
"axios": "^0.26.1",
"flush-promises": "^1.0.2",
"http-status-codes": "^2.1.4",
"material-design-icons": "^3.0.1",
"moment": "^2.29.1",
"moment-timezone": "^0.5.34",
"pinia": "^2.1.3",
"sbc-common-components": "^4.0.1",
"sbc-common-components": "4.0.2",
"vue": "^2.0.0 || >=3.3.4",
"vue-pdf-embed": "1.1.6",
"vue-plugin-helper-decorator": "^0.0.12",
Expand Down
6 changes: 2 additions & 4 deletions ppr-ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export default defineComponent({
// When we are authenticated, allow time for session storage propagation from auth, then initialize application
// (since we won't get the event from Signin component)
if (isAuthenticated.value) {
setTimeout(() => { onProfileReady(true) }, 3000)
setTimeout(() => { onProfileReady(true) }, 1000)
}
}
})
Expand Down Expand Up @@ -613,9 +613,7 @@ export default defineComponent({
const proceedAfterError = (proceed: boolean): void => {
localState.errorDisplay = false
// Navigate to Registries dashboard in the event of a login or access error.
if (localState.errorOptions === loginError || localState.errorOptions === authPprError ||
localState.errorOptions === authAssetsError
) {
if ([loginError.title, authPprError.title, authAssetsError.title].includes(localState.errorOptions.title)) {
navigateTo(localState.registryUrl)
}
// for now just refresh app
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,14 @@
v-model="currentVehicle.type"
class="vehicle-type-select"
:items="vehicleTypesNoMH"
itemTitle="text"
variant="filled"
label="Vehicle Type"
:errorMessages="
errors.type.message ? errors.type.message : ''
"
@update:model-value="resetSerialError()"
>
<template #item="{item, props}">
<v-list-item
v-bind="props"
class="list-item"
>
{{ item.text }}
</v-list-item>
</template>
</v-select>
/>
</v-col>
<v-col v-else>
<v-select
Expand Down
20 changes: 10 additions & 10 deletions ppr-ui/src/components/tables/common/TableRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -520,10 +520,10 @@
content-class="left-tooltip pa-5"
transition="fade-transition"
>
<template #activator="{ on }">
<template #activator="{ props }">
<span
class="disabled-text"
v-on="on"
v-bind="props"
>
<img
alt="exemption-icon"
Expand Down Expand Up @@ -748,14 +748,14 @@ export default defineComponent({
return (isRoleQualifiedSupplier.value || isRoleStaffReg.value || isRoleStaff.value) &&
!isRoleStaffSbc.value && !isRoleStaffBcol.value
}),
hasLienForQS: computed(() =>
isRoleQualifiedSupplier.value &&
localState.item.lienRegistrationType &&
localState.item.lienRegistrationType !== APIRegistrationTypes.SECURITY_AGREEMENT
),
hasLockedForQS: computed(() =>
hasLockedState(localState.item) && isRoleQualifiedSupplier.value
)
hasLienForQS: computed(() => {
return isRoleQualifiedSupplier.value &&
localState.item.lienRegistrationType &&
localState.item.lienRegistrationType !== APIRegistrationTypes.SECURITY_AGREEMENT
}),
hasLockedForQS: computed(() => {
return hasLockedState(localState.item) && isRoleQualifiedSupplier.value
})
})
const hasRequiredTransfer = (item: MhRegistrationSummaryIF) => {
Expand Down
25 changes: 14 additions & 11 deletions ppr-ui/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,33 +48,36 @@ async function start () {
}

// configure KeyCloak Service
console.info('Starting Keycloak service...') // eslint-disable-line no-console
await syncSession()

// start Vue application
console.info('Starting app...')
app.use(Vuelidate)
app.use(router)
app.use(pinia)
app.use(vuetify)
app.mount('#app')
}

async function syncSession () {
console.info('Starting Keycloak service...')
const keycloakConfig: any = {
url: `${window.keycloakAuthUrl}`,
realm: `${window.keycloakRealm}`,
clientId: `${window.keycloakClientId}`
}

await KeycloakService.setKeycloakConfigUrl(keycloakConfig)

// Auto authenticate user only if they are not trying a login or logout
if (!isSigningIn() && !isSigningOut()) {
console.log('inside initalize token')
// Initialize token service which will do a check-sso to initiate session
await KeycloakService.initializeToken(null).then(() => { }).catch(err => {
console.log(err)
if (err?.message !== 'NOT_AUTHENTICATED') {
throw err
}
})
}

// start Vue application
console.info('Starting app...')
app.use(Vuelidate)
app.use(router)
app.use(pinia)
app.use(vuetify)
app.mount('#app')
}

// execution and error handling
Expand Down
1 change: 0 additions & 1 deletion ppr-ui/src/views/auth/Signin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<script lang="ts">
import { defineComponent, reactive, toRefs } from 'vue'
import { useRoute, useRouter } from 'vue-router'
// Common Component
import SbcSignin from 'sbc-common-components/src/components/SbcSignin.vue'
import { useNavigation } from '@/composables'
Expand Down
1 change: 0 additions & 1 deletion ppr-ui/src/views/auth/Signout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

<script lang="ts">
import { computed, defineComponent, reactive, toRefs } from 'vue'
// Common Component
import SbcSignout from 'sbc-common-components/src/components/SbcSignout.vue'
export default defineComponent({
Expand Down
2 changes: 1 addition & 1 deletion ppr-ui/src/views/renew/RenewRegistration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
>
<v-progress-circular
color="primary"
size="50"
size="30"
indeterminate
/>
</v-overlay>
Expand Down
2 changes: 1 addition & 1 deletion ppr-ui/src/views/userAccess/UserAccess.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
>
<v-progress-circular
color="primary"
size="50"
size="30"
indeterminate
/>
</v-overlay>
Expand Down

0 comments on commit d63a2eb

Please sign in to comment.