|
@@ -81,12 +81,15 @@ import {AnyStore, ApiResponse, HydraMetadata} from "~/types/interfaces";
|
|
|
import {queryHelper} from "~/services/store/query";
|
|
import {queryHelper} from "~/services/store/query";
|
|
|
import {NotificationUsers} from "~/models/Core/NotificationUsers";
|
|
import {NotificationUsers} from "~/models/Core/NotificationUsers";
|
|
|
import {State} from "@vuex-orm/core";
|
|
import {State} from "@vuex-orm/core";
|
|
|
|
|
+import {$accessProfile} from "~/services/profile/accessProfile";
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
setup: function () {
|
|
setup: function () {
|
|
|
const {$dataProvider, $dataPersister, $config, app: { i18n }} = useContext()
|
|
const {$dataProvider, $dataPersister, $config, app: { i18n }} = useContext()
|
|
|
const store:AnyStore = useStore<State>()
|
|
const store:AnyStore = useStore<State>()
|
|
|
const profileAccess = store.state.profile.access
|
|
const profileAccess = store.state.profile.access
|
|
|
|
|
+ const currentAccessId = $accessProfile(store).getCurrentAccessId()
|
|
|
|
|
+
|
|
|
const loading: Ref<Boolean> = ref(true)
|
|
const loading: Ref<Boolean> = ref(true)
|
|
|
const isOpen: Ref<Boolean> = ref(false)
|
|
const isOpen: Ref<Boolean> = ref(false)
|
|
|
const page: Ref<number> = ref(1)
|
|
const page: Ref<number> = ref(1)
|
|
@@ -162,6 +165,11 @@ export default defineComponent({
|
|
|
return `${i18n.t('your_message')} ${notification.message?.about} ${i18n.t('has_been_sent')} `
|
|
return `${i18n.t('your_message')} ${notification.message?.about} ${i18n.t('has_been_sent')} `
|
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
|
|
+ case NOTIFICATION_TYPE.SYSTEM :
|
|
|
|
|
+ if(notification.message?.about)
|
|
|
|
|
+ return `${i18n.t(notification.message.about)}`
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
default:
|
|
default:
|
|
|
return i18n.t(notification.name)
|
|
return i18n.t(notification.name)
|
|
|
}
|
|
}
|
|
@@ -194,7 +202,7 @@ export default defineComponent({
|
|
|
const createNewNotificationUsers = (notification: Notification) =>{
|
|
const createNewNotificationUsers = (notification: Notification) =>{
|
|
|
const newNotificationUsers = repositoryHelper.persist(NotificationUsers, new NotificationUsers(
|
|
const newNotificationUsers = repositoryHelper.persist(NotificationUsers, new NotificationUsers(
|
|
|
{
|
|
{
|
|
|
- access:`/api/accesses/${profileAccess.id}`,
|
|
|
|
|
|
|
+ access:`/api/accesses/${currentAccessId}`,
|
|
|
notification:`/api/notifications/${notification.id}`,
|
|
notification:`/api/notifications/${notification.id}`,
|
|
|
isRead: true
|
|
isRead: true
|
|
|
}
|
|
}
|
|
@@ -215,9 +223,9 @@ export default defineComponent({
|
|
|
const download = (link: string) => {
|
|
const download = (link: string) => {
|
|
|
const url_parts: Array<string> = link.split('/api');
|
|
const url_parts: Array<string> = link.split('/api');
|
|
|
if(profileAccess.originalAccess)
|
|
if(profileAccess.originalAccess)
|
|
|
- url_parts[0] = `api/${profileAccess.originalAccess}/${profileAccess.id}`
|
|
|
|
|
|
|
+ url_parts[0] = `api/${profileAccess.originalAccess}/${currentAccessId}`
|
|
|
else
|
|
else
|
|
|
- url_parts[0] = `api/${profileAccess.id}`
|
|
|
|
|
|
|
+ url_parts[0] = `api/${currentAccessId}`
|
|
|
|
|
|
|
|
window.open(`${$config.baseURL_Legacy}/${url_parts.join('')}`);
|
|
window.open(`${$config.baseURL_Legacy}/${url_parts.join('')}`);
|
|
|
}
|
|
}
|