Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
volar committed Jun 29, 2024
1 parent 8afac9c commit 1417c99
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 119 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"cy:open": "CYPRESS_CACHE_FOLDER='node_modules/.cache/Cypress' yarn cypress open -C cypress/config/cypress.config.ts"
},
"dependencies": {
"@anzusystems/common-admin": "1.47.0-beta.4",
"@anzusystems/common-admin": "1.47.0-beta.8",
"@mdi/font": "7.4.47",
"@vuelidate/core": "^2.0.3",
"@vuelidate/validators": "^2.0.4",
Expand All @@ -36,7 +36,7 @@
"sortablejs": "^1.15.2",
"universal-cookie": "^7.1.4",
"uuid": "^10.0.0",
"vue": "3.4.30",
"vue": "3.4.31",
"vue-i18n": "^9.13.1",
"vue-router": "^4.4.0",
"vuetify": "^3.6.10"
Expand All @@ -45,9 +45,9 @@
"@cypress/grep": "^4.0.2",
"@intlify/unplugin-vue-i18n": "^4.0.0",
"@rushstack/eslint-patch": "^1.10.3",
"@stylistic/eslint-plugin": "^2.2.2",
"@stylistic/eslint-plugin": "^2.3.0",
"@tsconfig/node18": "^18.2.4",
"@types/node": "^20.14.8",
"@types/node": "^20.14.9",
"@types/rusha": "^0.8.3",
"@types/sortablejs": "^1.15.8",
"@types/uuid": "^10.0.0",
Expand All @@ -73,7 +73,7 @@
"stylelint-config-recommended-vue": "^1.5.0",
"stylelint-config-standard-scss": "^13.1.0",
"typescript": "5.4.5",
"vite": "^5.3.1",
"vite": "^5.3.2",
"vite-plugin-vuetify": "^2.0.3",
"vue-tsc": "2.0.22"
}
Expand Down
1 change: 0 additions & 1 deletion src/components/system/sidebar/SidebarMain.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<script lang="ts" setup>
import { ROUTE } from '@/router/routes'
import { useI18n } from 'vue-i18n'
import { ACL } from '@/composables/auth/auth'
const { t } = useI18n()
Expand Down
4 changes: 2 additions & 2 deletions src/composables/system/appInitialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export async function createAppInitialize(
try {
const updateCurrentUserPromise = fetchCurrentUser(damClient)
const loadDamConfigPromise = loadDamPrvConfig()
await Promise.all([updateCurrentUserPromise, loadDamConfigPromise])
await Promise.allSettled([updateCurrentUserPromise, loadDamConfigPromise])
} catch (error) {
next({ name: ROUTE.SYSTEM.LOGIN })
return
Expand All @@ -45,7 +45,7 @@ export async function createAppInitialize(

const loadDamConfigExtSystemPromise = loadDamConfigExtSystem(currentExtSystemId.value)
const loadDamConfigAssetCustomFormElementsPromise = loadDamConfigAssetCustomFormElements(currentExtSystemId.value)
await Promise.all([loadDamConfigExtSystemPromise, loadDamConfigAssetCustomFormElementsPromise])
await Promise.allSettled([loadDamConfigExtSystemPromise, loadDamConfigAssetCustomFormElementsPromise])
initAppNotificationListeners()
} catch (error) {
next({ name: ROUTE.SYSTEM.LOGIN })
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ loadEnvConfig(() => {
.use(vuetify)
.use(router)
.use<PluginOptions<AclValue>>(AnzuSystemsCommonAdmin, {
currentUser: currentUser,
currentUser,
languages: {
available: AVAILABLE_LANGUAGES,
default: DEFAULT_LANGUAGE,
Expand Down
8 changes: 5 additions & 3 deletions src/router/checkAbility.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { NavigationGuardNext, RouteLocationNormalized } from 'vue-router'
import { isUndefined } from '@anzusystems/common-admin'
import { type AclValue, isArray, isUndefined } from '@anzusystems/common-admin'
import { useAuth } from '@/composables/auth/auth'

export const checkAbility = async (
Expand All @@ -8,8 +8,10 @@ export const checkAbility = async (
next: NavigationGuardNext
) => {
const { canForAll } = useAuth()

if (isUndefined(to.meta.requiredPermissions)) {
if (
isUndefined(to.meta.requiredPermissions) ||
(isArray<AclValue>(to.meta.requiredPermissions) && to.meta.requiredPermissions.length === 0)
) {
next()
} else if (canForAll(to.meta.requiredPermissions)) {
next()
Expand Down
Loading

0 comments on commit 1417c99

Please sign in to comment.