Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/app/plugins/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,11 @@
"cancel_invitation": "هل أنت متأكد أنك تريد إلغاء {email} من المتعاونين؟",
"change_role": "هل أنت متأكد أنك تريد تغيير دور {email} من {old} إلى {new}؟",
"message_title_hint": "اكتب عنوانًا لرسالتك",
"message_content_hint": "اكتب محتوى رسالتك"
"message_content_hint": "اكتب محتوى رسالتك",
"invite_message": "لقد تمت دعوتك للتعاون في '{testTitle}'",
"message_sent_success": "تم إرسال الرسالة بنجاح",
"message_sent_error": "فشل في إرسال الرسالة",
"user_not_registered": "هذا المستخدم لم يقبل الدعوة بعد أو غير مسجل."
}
},
"UserTestTable": {
Expand Down Expand Up @@ -1241,7 +1245,7 @@
"showFilters": "عرض الفلاتر",
"hideFilters": "إخفاء الفلاتر",
"sessionDate": "تاريخ الجلسة",
"selectRange": "اختر النطاق",
"selectRange": "تحديد النطاق",
"statusLabel": "الحالة",
"ownership": "الملكية",
"evaluator": "المقيم",
Expand Down
10 changes: 7 additions & 3 deletions src/app/plugins/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,11 @@
"cancel_invitation": "Sind Sie sicher, dass Sie {email} aus den Mitarbeitern stornieren möchten?",
"change_role": "Sind Sie sicher, dass Sie die Rolle von {email} von {old} zu {new} ändern möchten?",
"message_title_hint": "Geben Sie einen Titel für Ihre Nachricht ein",
"message_content_hint": "Geben Sie den Inhalt Ihrer Nachricht ein"
"message_content_hint": "Geben Sie den Inhalt Ihrer Nachricht ein",
"invite_message": "Sie wurden eingeladen, an '{testTitle}' mitzuarbeiten",
"message_sent_success": "Nachricht erfolgreich gesendet",
"message_sent_error": "Nachricht konnte nicht gesendet werden",
"user_not_registered": "Dieser Benutzer hat die Einladung noch nicht angenommen oder ist nicht registriert."
}
},
"UserTestTable": {
Expand Down Expand Up @@ -1244,13 +1248,13 @@
"sessionDate": "Sitzungsdatum",
"selectRange": "Bereich auswählen",
"statusLabel": "Status",
"ownership": "Eigentum",
"ownership": "Besitz",
"evaluator": "Bewerter",
"noActiveSessions": "Sie haben keine aktiven Sitzungen",
"filters": {
"allStatuses": "Alle Status",
"today": "Heute",
"upcoming": "Bevorstehend",
"upcoming": "Demnächst",
"completed": "Abgeschlossen",
"allStudies": "Alle Studien",
"myStudies": "Meine Studien",
Expand Down
6 changes: 5 additions & 1 deletion src/app/plugins/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,11 @@
"cancel_invitation": "Are you sure you want to cancel {email} from the cooperators?",
"change_role": "Are you sure you want to change {email}'s role from {old} to {new}?",
"message_title_hint": "Type a title for your message",
"message_content_hint": "Type the content of your message"
"message_content_hint": "Type the content of your message",
"invite_message": "You have been invited to collaborate on '{testTitle}'",
"message_sent_success": "Message sent successfully",
"message_sent_error": "Failed to send message",
"user_not_registered": "This user has not accepted the invitation yet or is not registered."
}
},
"UserTestTable": {
Expand Down
10 changes: 7 additions & 3 deletions src/app/plugins/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,11 @@
"cancel_invitation": "¿Estás seguro de que deseas cancelar la invitación de {email}?",
"change_role": "¿Estás seguro de que deseas cambiar el rol de {email} de {old} a {new}?",
"message_title_hint": "Escribe un título para tu mensaje",
"message_content_hint": "Escribe el contenido de tu mensaje"
"message_content_hint": "Escribe el contenido de tu mensaje",
"invite_message": "Has sido invitado a colaborar en '{testTitle}'",
"message_sent_success": "Mensaje enviado con éxito",
"message_sent_error": "Error al enviar el mensaje",
"user_not_registered": "Este usuario aún no ha aceptado la invitación o no está registrado."
}
},
"UserTestTable": {
Expand Down Expand Up @@ -1249,11 +1253,11 @@
"filters": {
"allStatuses": "Todos los estados",
"today": "Hoy",
"upcoming": "Próximas",
"upcoming": "Próximamente",
"completed": "Completado",
"allStudies": "Todos los estudios",
"myStudies": "Mis estudios",
"whereICollaborate": "Donده colaboro"
"whereICollaborate": "Donde colaboro"
}
},
"templates": {
Expand Down
6 changes: 5 additions & 1 deletion src/app/plugins/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,11 @@
"cancel_invitation": "Êtes-vous sûr de vouloir annuler {email} des collaborateurs ?",
"change_role": "Êtes-vous sûr de vouloir changer le rôle de {email} de {old} à {new} ?",
"message_title_hint": "Tapez un titre pour votre message",
"message_content_hint": "Tapez le contenu de votre message"
"message_content_hint": "Tapez le contenu de votre message",
"invite_message": "Vous avez été invité à collaborer sur '{testTitle}'",
"message_sent_success": "Message envoyé avec succès",
"message_sent_error": "Échec de l'envoi du message",
"user_not_registered": "Cet utilisateur n'a pas encore accepté l'invitation ou n'est pas enregistré."
}
},
"UserTestTable": {
Expand Down
16 changes: 10 additions & 6 deletions src/app/plugins/locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,11 @@
"cancel_invitation": "क्या आप वाकई {email} का आमंत्रण रद्द करना चाहते हैं?",
"change_role": "क्या आप वाकई {email} की भूमिका {old} से {new} में बदलना चाहते हैं?",
"message_title_hint": "संदेश का शीर्षक दर्ज करें",
"message_content_hint": "संदेश की सामग्री दर्ज करें"
"message_content_hint": "संदेश की सामग्री दर्ज करें",
"invite_message": "आपको '{testTitle}' पर सहयोग के लिए आमंत्रित किया गया है",
"message_sent_success": "संदेश सफलतापूर्वक भेजा गया",
"message_sent_error": "संदेश भेजने में विफल",
"user_not_registered": "इस उपयोगकर्ता ने अभी तक आमंत्रण स्वीकार नहीं किया है या वह पंजीकृत नहीं है।"
}
},
"UserTestTable": {
Expand Down Expand Up @@ -1237,20 +1241,20 @@
},
"sessions": {
"searchPlaceholder": "सत्र खोजें...",
"reset": "रीसेट",
"reset": "रीसेट करें",
"showFilters": "फ़िल्टर दिखाएं",
"hideFilters": "फ़िल्टर छिपाएं",
"sessionDate": "सत्र तिथि",
"selectRange": "सीमा चुनें",
"sessionDate": "सत्र की तारीख",
"selectRange": "श्रेणी चुनें",
"statusLabel": "स्थिति",
"ownership": "स्वामित्व",
"evaluator": "मूल्यांकनकर्ता",
"noActiveSessions": "आपके पास कोई सक्रिय सत्र नहीं है",
"filters": {
"allStatuses": "सभी स्थितियाँ",
"allStatuses": "सभी स्थितियां",
"today": "आज",
"upcoming": "आगामी",
"completed": "पूर्ण",
"completed": "पूरा हुआ",
"allStudies": "सभी अध्ययन",
"myStudies": "मेरे अध्ययन",
"whereICollaborate": "जहाँ मैं सहयोग करता हूँ"
Expand Down
16 changes: 10 additions & 6 deletions src/app/plugins/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,11 @@
"cancel_invitation": "{email}の招待を取り消してもよろしいですか?",
"change_role": "{email}の役割を{old}から{new}に変更してもよろしいですか?",
"message_title_hint": "メッセージのタイトルを入力",
"message_content_hint": "メッセージの内容を入力"
"message_content_hint": "メッセージの内容を入力",
"invite_message": "'{testTitle}' への共同作業に招待されました",
"message_sent_success": "メッセージが正常に送信されました",
"message_sent_error": "メッセージの送信に失敗しました",
"user_not_registered": "このユーザーはまだ招待を承諾していないか、登録されていません。"
}
},
"UserTestTable": {
Expand Down Expand Up @@ -1245,15 +1249,15 @@
"statusLabel": "ステータス",
"ownership": "所有権",
"evaluator": "評価者",
"noActiveSessions": "アクティブなセッションがありません",
"noActiveSessions": "アクティブなセッションはありません",
"filters": {
"allStatuses": "すべてのステータス",
"today": "今日",
"upcoming": "今後",
"upcoming": "今後の予定",
"completed": "完了",
"allStudies": "すべての研究",
"myStudies": "私の研究",
"whereICollaborate": "コラボレーション中"
"allStudies": "すべてのスタディ",
"myStudies": "マイスタディ",
"whereICollaborate": "共同作業中"
}
},
"templates": {
Expand Down
10 changes: 7 additions & 3 deletions src/app/plugins/locales/pt_br.json
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,11 @@
"cancel_invitation": "Tem certeza de que deseja cancelar o convite de {email}?",
"change_role": "Tem certeza de que deseja alterar a função de {email} de {old} para {new}?",
"message_title_hint": "Digite um título para sua mensagem",
"message_content_hint": "Digite o conteúdo da sua mensagem"
"message_content_hint": "Digite o conteúdo da sua mensagem",
"invite_message": "Você foi convidado para colaborar em '{testTitle}'",
"message_sent_success": "Mensagem enviada com sucesso",
"message_sent_error": "Falha ao enviar a mensagem",
"user_not_registered": "Este usuário ainda não aceitou o convite ou não está registrado."
}
},
"UserTestTable": {
Expand Down Expand Up @@ -1249,11 +1253,11 @@
"filters": {
"allStatuses": "Todos os status",
"today": "Hoje",
"upcoming": "Próximas",
"upcoming": "Em breve",
"completed": "Concluído",
"allStudies": "Todos os estudos",
"myStudies": "Meus estudos",
"whereICollaborate": "Onde eu colaboro"
"whereICollaborate": "Onde colaboro"
}
},
"templates": {
Expand Down
8 changes: 6 additions & 2 deletions src/app/plugins/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,11 @@
"cancel_invitation": "Вы уверены, что хотите отменить {email} из сотрудников?",
"change_role": "Вы уверены, что хотите изменить роль {email} с {old} на {new}?",
"message_title_hint": "Введите заголовок для вашего сообщения",
"message_content_hint": "Введите содержание вашего сообщения"
"message_content_hint": "Введите содержание вашего сообщения",
"invite_message": "Вы приглашены для сотрудничества над '{testTitle}'",
"message_sent_success": "Сообщение успешно отправлено",
"message_sent_error": "Не удалось отправить сообщение",
"user_not_registered": "Этот пользователь еще не принял приглашение или не зарегистрирован."
}
},
"UserTestTable": {
Expand Down Expand Up @@ -1250,7 +1254,7 @@
"allStatuses": "Все статусы",
"today": "Сегодня",
"upcoming": "Предстоящие",
"completed": "Завершенный",
"completed": "Завершено",
"allStudies": "Все исследования",
"myStudies": "Мои исследования",
"whereICollaborate": "Где я сотрудничаю"
Expand Down
8 changes: 6 additions & 2 deletions src/app/plugins/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,11 @@
"cancel_invitation": "您确定要取消 {email} 的合作者邀请吗?",
"change_role": "您确定要将 {email} 的角色从 {old} 更改为 {new} 吗?",
"message_title_hint": "输入您的消息标题",
"message_content_hint": "输入您的消息内容"
"message_content_hint": "输入您的消息内容",
"invite_message": "您已被邀请参与 '{testTitle}' 的协作",
"message_sent_success": "消息发送成功",
"message_sent_error": "消息发送失败",
"user_not_registered": "该用户尚未接受邀请或未注册。"
}
},
"UserTestTable": {
Expand Down Expand Up @@ -1245,7 +1249,7 @@
"statusLabel": "状态",
"ownership": "所有权",
"evaluator": "评估者",
"noActiveSessions": "您没有活跃的会话",
"noActiveSessions": "您没有活动的会话",
"filters": {
"allStatuses": "所有状态",
"today": "今天",
Expand Down
43 changes: 22 additions & 21 deletions src/features/navigation/components/NotificationButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,38 +145,39 @@ const showAcceptDialog = () => {

/* actions */
const goToNotificationRedirect = async (notification) => {
const accepted = await showAcceptDialog()

if (!accepted) {
await store.dispatch('markNotificationAsRead', {
notification,
user: user.value,
})
return
}

if (notification.testId) {
const study = await new StudyController().getStudy({
id: notification.testId,
})
await store.dispatch('acceptStudyCollaboration', {
test: study,
cooperator: user.value,
})
// Only show dialog for Collaboration type invitations
if (notification.type === 'Collaboration') {
const accepted = await showAcceptDialog()

if (!accepted) {
await store.dispatch('markNotificationAsRead', {
notification,
user: user.value,
})
return
}

if (notification.testId) {
const study = await new StudyController().getStudy({
id: notification.testId,
})
await store.dispatch('acceptStudyCollaboration', {
test: study,
cooperator: user.value,
})
}
}

await store.dispatch('markNotificationAsRead', {
notification,
user: user.value,
})

if (notification.redirectsTo) {
if (notification.redirectsTo && notification.redirectsTo !== '/') {
globalThis.open(
globalThis.location.origin + notification.redirectsTo,
'_blank',
)
} else {
goToNotificationPage()
}

menuOpen.value = false
Expand Down
14 changes: 7 additions & 7 deletions src/features/notifications/components/NotificationItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,17 @@
<!-- Content -->
<div class="content">
<div class="title-row">
<div class="text-h6">
{{ notification.title || 'Notification' }}
<span v-if="notification.type" class="type-badge">
{{ notification.type }}
</span>
<div class="text-subtitle-1 font-weight-medium">
{{ notification.title || (notification.titleTemplate ? $t(notification.titleTemplate, notification.titleParams || {}) : 'Notification') }}
</div>

<span class="time">
{{ relativeTime(notification.createdDate) }}
</span>
</div>

<div class="description">
{{ notification.description }}
<div class="description line-clamp-2">
{{ notification.description || (notification.descriptionTemplate ? $t(notification.descriptionTemplate, notification.descriptionParams || {}) : '') }}
</div>

<div class="meta">
Expand All @@ -58,6 +55,7 @@
</template>

<script setup>
import { useI18n } from 'vue-i18n'
import { METHOD_DEFINITIONS } from '@/shared/constants/methodDefinitions.js'

const props = defineProps({
Expand All @@ -68,9 +66,11 @@ const props = defineProps({
})

const emit = defineEmits(['go-to-redirect', 'mark-as-read'])
const { t } = useI18n()

const onClick = () => emit('go-to-redirect', props.notification)


const getTestIcon = (type) =>
METHOD_DEFINITIONS?.[type]?.icon || 'mdi-bell-outline'

Expand Down
Loading