diff --git a/package.json b/package.json index fefece3c..21e7a372 100644 --- a/package.json +++ b/package.json @@ -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.8", + "@anzusystems/common-admin": "1.47.0-beta.9", "@mdi/font": "7.4.47", "@vuelidate/core": "^2.0.3", "@vuelidate/validators": "^2.0.4", @@ -65,7 +65,7 @@ "eslint-plugin-cypress": "^3.3.0", "eslint-plugin-vue": "^9.26.0", "npm-run-all": "^4.1.5", - "postcss": "^8.4.38", + "postcss": "^8.4.39", "postcss-html": "^1.7.0", "prettier": "^3.3.2", "sass": "^1.77.6", @@ -75,6 +75,6 @@ "typescript": "5.4.5", "vite": "^5.3.2", "vite-plugin-vuetify": "^2.0.3", - "vue-tsc": "2.0.22" + "vue-tsc": "2.0.24" } } diff --git a/src/composables/auth/auth.ts b/src/composables/auth/auth.ts index 98bf44ad..a793bf13 100644 --- a/src/composables/auth/auth.ts +++ b/src/composables/auth/auth.ts @@ -1,4 +1,5 @@ import { defineAuth } from '@anzusystems/common-admin' +import { SYSTEM_CORE_DAM } from '@/model/systems' export const ACL = { DAM_ASSET_CREATE: 'dam_asset_create', @@ -103,7 +104,7 @@ export type AclKey = keyof typeof ACL export type AclValue = (typeof ACL)[AclKey] export function useAuth() { - const { can, canForAll, canForSome, useCurrentUser } = defineAuth('dam') + const { can, canForAll, canForSome, useCurrentUser } = defineAuth(SYSTEM_CORE_DAM) return { useCurrentUser, diff --git a/src/composables/system/appNotificationListeners.ts b/src/composables/system/appNotificationListeners.ts index 5e50c83a..3bfc862a 100644 --- a/src/composables/system/appNotificationListeners.ts +++ b/src/composables/system/appNotificationListeners.ts @@ -4,10 +4,11 @@ import { DamDistributionStatus, DamNotificationName, initDamNotifications, - updateDamCurrentUser, useDamNotifications, } from '@anzusystems/common-admin' import { damClient } from '@/services/api/clients/damClient' +import { useAuth } from '@/composables/auth/auth' +import { SYSTEM_CORE_DAM } from '@/model/systems' export const initAppNotificationListeners = () => { const { openConnection } = initDamNotifications() @@ -46,9 +47,12 @@ export const initAppNotificationListeners = () => { case DamNotificationName.DistributionAuthorized: distributionListStore.authorizationMessage(event.data.distributionService, event.data.success) break - case DamNotificationName.UserUpdated: - updateDamCurrentUser(damClient) + case DamNotificationName.UserUpdated: { + const { useCurrentUser } = useAuth() + const { fetchCurrentUser } = useCurrentUser(SYSTEM_CORE_DAM) + fetchCurrentUser(damClient) break + } } }) } diff --git a/src/main.ts b/src/main.ts index fea88b48..ff4c2e3f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -10,27 +10,17 @@ import { envConfig, loadEnvConfig } from '@/services/EnvConfigService' import { initErrorHandler } from '@/services/ErrorHandlerApiService' import { createPinia } from 'pinia' import { createApp } from 'vue' -import { - AnzuSystemsCommonAdmin, - i18n, - type LanguageCode, - loadCommonFonts, - type PluginOptions, -} from '@anzusystems/common-admin' +import { AnzuSystemsCommonAdmin, i18n, type LanguageCode, loadCommonFonts } from '@anzusystems/common-admin' import '@anzusystems/common-admin/styles' import { damClient } from '@/services/api/clients/damClient' import dayjs from 'dayjs' import Duration from 'dayjs/plugin/duration' -import { type AclValue, useAuth } from '@/composables/auth/auth' export const DEFAULT_LANGUAGE: LanguageCode = 'sk' export const AVAILABLE_LANGUAGES: Array = ['en', 'sk'] dayjs.extend(Duration) -const { useCurrentUser } = useAuth() -const { currentUser } = useCurrentUser('dam') - loadCommonFonts() loadEnvConfig(() => { @@ -39,8 +29,7 @@ loadEnvConfig(() => { .use(createPinia()) .use(vuetify) .use(router) - .use>(AnzuSystemsCommonAdmin, { - currentUser, + .use(AnzuSystemsCommonAdmin, { languages: { available: AVAILABLE_LANGUAGES, default: DEFAULT_LANGUAGE, diff --git a/src/views/system/settings/SettingsView.vue b/src/views/system/settings/SettingsView.vue index 3cf97be3..1a719cef 100644 --- a/src/views/system/settings/SettingsView.vue +++ b/src/views/system/settings/SettingsView.vue @@ -10,6 +10,7 @@ import { import { useI18n } from 'vue-i18n' import { inject } from 'vue' import ActionbarWrapper from '@/components/wrappers/ActionbarWrapper.vue' +import { SYSTEM_CORE_DAM } from '@/model/systems' const { t } = useI18n() const configAvailableLanguages = inject(AvailableLanguagesSymbol, []) @@ -46,7 +47,10 @@ const afterLanguageChange = async (language: LanguageCode) => { {{ t('system.settings.locale') }} - + =5.0.0" bin: - vue-tsc: bin/vue-tsc.js - checksum: 10/4dd23da9d10d071b149600646e32f8cb5c8e38be417e3993b877ec8802b669f164558317f1992c9596a376dd9315cedd12fcd132b5513a2f937becdc3404dd26 + vue-tsc: ./bin/vue-tsc.js + checksum: 10/bbc0bc187db09b14e6a7f705abe533e8d8177068c497aab24ae8bdf542bdb3ea26ab4dc8165fec7c7d88649c3bd1f5c44c322b0ad3a4b953bfb3c666f527b06c languageName: node linkType: hard