|
@@ -17,11 +17,12 @@
|
|
|
</v-badge>
|
|
</v-badge>
|
|
|
</v-btn>
|
|
</v-btn>
|
|
|
|
|
|
|
|
- <v-tooltip :activator="btn" location="bottom">
|
|
|
|
|
|
|
+ <v-tooltip v-if="btn !== null" :activator="btn" location="bottom">
|
|
|
<span>{{ $t('notification') }}</span>
|
|
<span>{{ $t('notification') }}</span>
|
|
|
</v-tooltip>
|
|
</v-tooltip>
|
|
|
|
|
|
|
|
<v-menu
|
|
<v-menu
|
|
|
|
|
+ v-if="btn !== null"
|
|
|
:activator="btn"
|
|
:activator="btn"
|
|
|
v-model="isOpen"
|
|
v-model="isOpen"
|
|
|
location="bottom left"
|
|
location="bottom left"
|
|
@@ -122,7 +123,6 @@ const query: ComputedRef<AnyJson> = computed(() => {
|
|
|
return { 'page': page.value }
|
|
return { 'page': page.value }
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-
|
|
|
|
|
let { data: collection, pending, refresh } = await fetchCollection(Notification, null, query)
|
|
let { data: collection, pending, refresh } = await fetchCollection(Notification, null, query)
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -143,10 +143,10 @@ const unreadNotification: ComputedRef<Array<Notification>> = computed(() => {
|
|
|
* Les metadata dépendront de la dernière valeur du GET lancé
|
|
* Les metadata dépendront de la dernière valeur du GET lancé
|
|
|
*/
|
|
*/
|
|
|
const pagination: ComputedRef<Pagination> = computed(() => {
|
|
const pagination: ComputedRef<Pagination> = computed(() => {
|
|
|
- return collection.value !== null ? collection.value.pagination : {}
|
|
|
|
|
|
|
+ return (!pending.value && collection.value !== null) ? collection.value.pagination : {}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-const notificationUrl = UrlUtils.join(runtimeConfig.baseUrlAdminLegacy, 'notifications/list/')
|
|
|
|
|
|
|
+const notificationUrl = UrlUtils.join(runtimeConfig.baseUrlAdminLegacy, '#/notifications/list/')
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* L'utilisateur a fait défiler le menu jusqu'à la dernière notification affichée
|
|
* L'utilisateur a fait défiler le menu jusqu'à la dernière notification affichée
|
|
@@ -224,7 +224,7 @@ const markNotificationAsRead = (notification: Notification) => {
|
|
|
throw new Error('Current access id is null')
|
|
throw new Error('Current access id is null')
|
|
|
}
|
|
}
|
|
|
const notificationUsers = em.newInstance(NotificationUsers, {
|
|
const notificationUsers = em.newInstance(NotificationUsers, {
|
|
|
- access:`/api/accesses/${accessProfileStore.id}`,
|
|
|
|
|
|
|
+ access:`/api/accesses/${accessProfileStore.switchId ?? accessProfileStore.id}`,
|
|
|
notification:`/api/notifications/${notification.id}`,
|
|
notification:`/api/notifications/${notification.id}`,
|
|
|
isRead: true
|
|
isRead: true
|
|
|
})
|
|
})
|
|
@@ -251,14 +251,21 @@ const download = (link: string) => {
|
|
|
if (accessProfileStore.id === null) {
|
|
if (accessProfileStore.id === null) {
|
|
|
throw new Error('Current access id is null')
|
|
throw new Error('Current access id is null')
|
|
|
}
|
|
}
|
|
|
- const url_parts: Array<string> = link.split('/api');
|
|
|
|
|
|
|
+ // TODO: passer cette logique dans un service ; tester ; voir si possible de réunir avec composables/utils/useDownloadFile.ts
|
|
|
|
|
+
|
|
|
|
|
+ const path: string = link.split('/api')[1];
|
|
|
|
|
|
|
|
- if(accessProfileStore.originalAccess)
|
|
|
|
|
- url_parts[0] = UrlUtils.join('api', String(accessProfileStore.originalAccess.id), String(accessProfileStore.id))
|
|
|
|
|
- else
|
|
|
|
|
- url_parts[0] = UrlUtils.join('api', String(accessProfileStore.id))
|
|
|
|
|
|
|
+ // En switch : https://api.test5.opentalent.fr/api/{accessId}/{switchId}/files/{fileId}/download
|
|
|
|
|
+ // Sans switch : https://local.api.opentalent.fr/api/{accessId}/files/{fileId}/download
|
|
|
|
|
+ const url = UrlUtils.join(
|
|
|
|
|
+ runtimeConfig.baseUrlLegacy,
|
|
|
|
|
+ 'api',
|
|
|
|
|
+ String(accessProfileStore.id),
|
|
|
|
|
+ String(accessProfileStore.switchId || ''),
|
|
|
|
|
+ path
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
- window.open(UrlUtils.join(runtimeConfig.baseUrlLegacy, url_parts.join('')));
|
|
|
|
|
|
|
+ window.open(url);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|