@@ -64,7 +64,8 @@ const title = computed(() => {
6464 if (props .notification .category === " new_shared_item" ) {
6565 return ` ${sharedItemType .value } shared with you by ${props .notification .content .owner_name } ` ;
6666 } else if (props .notification .category === " tool_request" ) {
67- return ` Tool Request: ${props .notification .content .tool_name } ` ;
67+ const names = props .notification .content .tool_names ;
68+ return names .length === 1 ? ` Tool Request: ${names [0 ]} ` : ` Tool Request: ${names .length } tools ` ;
6869 } else {
6970 return props .notification .content .subject ;
7071 }
@@ -153,80 +154,104 @@ function markNotificationAsSeen() {
153154 </script >
154155
155156<template >
156- <GCard
157- v-if =" props.notification"
158- :id =" props.notification.id"
159- :title =" title"
160- :primary-actions =" primaryActions"
161- :title-size =" 'sm'"
162- :title-icon =" titleIcon"
163- :selected =" props.selected"
164- :selectable =" props.selectable"
165- :update-time =" props.notification.publication_time ?? props.notification.create_time"
166- :update-time-icon =" faClock"
167- :update-time-title =" `Sent ${props.notification.publication_time ? 'on' : 'at'}`"
168- :content-class =" [props.unreadBorder && !props.notification.seen_time ? 'border-dark unread-notification' : '']"
169- @select =" emit('select', [props.notification])" >
170- <template v-slot :description >
171- <template v-if =" props .notification .category === ' new_shared_item' " >
172- <span >The user</span >{{ " " }}<b >{{ props.notification.content.owner_name }}</b
173- >{{ " " }}<span >shared </span >
174- <BLink
175- v-g-tooltip.bottom
176- :title =" `View ${props.notification.content.item_type} in new tab`"
177- class =" text-primary"
178- :href =" absPath(props.notification.content.slug)"
179- target =" _blank"
180- @click =" markNotificationAsSeen()" >
181- {{ props.notification.content.item_name }}
182- <FontAwesomeIcon :icon =" faExternalLinkAlt" fixed-width size =" sm" />
183- </BLink >
184- <em >{{ props.notification.content.item_type }}</em
185- >{{ " " }}<span > with you.</span >
157+ <div v-if =" props.notification" :id =" `notification-card-${props.notification.id}`" >
158+ <GCard
159+ :id =" props.notification.id"
160+ :title =" title"
161+ :primary-actions =" primaryActions"
162+ :title-size =" 'sm'"
163+ :title-icon =" titleIcon"
164+ :selected =" props.selected"
165+ :selectable =" props.selectable"
166+ :update-time =" props.notification.publication_time ?? props.notification.create_time"
167+ :update-time-icon =" faClock"
168+ :update-time-title =" `Sent ${props.notification.publication_time ? 'on' : 'at'}`"
169+ :content-class =" [
170+ props.unreadBorder && !props.notification.seen_time ? 'border-dark unread-notification' : '',
171+ ]"
172+ @select =" emit('select', [props.notification])" >
173+ <template v-slot :description >
174+ <template v-if =" props .notification .category === ' new_shared_item' " >
175+ <span >The user</span >{{ " " }}<b >{{ props.notification.content.owner_name }}</b
176+ >{{ " " }}<span >shared </span >
177+ <BLink
178+ v-g-tooltip.bottom
179+ :title =" `View ${props.notification.content.item_type} in new tab`"
180+ class =" text-primary"
181+ :href =" absPath(props.notification.content.slug)"
182+ target =" _blank"
183+ @click =" markNotificationAsSeen()" >
184+ {{ props.notification.content.item_name }}
185+ <FontAwesomeIcon :icon =" faExternalLinkAlt" fixed-width size =" sm" />
186+ </BLink >
187+ <em >{{ props.notification.content.item_type }}</em
188+ >{{ " " }}<span > with you.</span >
189+ </template >
190+ <template v-else-if =" props .notification .category === ' tool_request' " >
191+ <dl class =" mb-0" >
192+ <template v-if =" props .notification .content .tool_names .length > 1 " >
193+ <dt >Tools</dt >
194+ <dd >
195+ <ul class =" mb-0 pl-3" >
196+ <li v-for =" name in props.notification.content.tool_names" :key =" name" >
197+ {{ name }}
198+ </li >
199+ </ul >
200+ </dd >
201+ </template >
202+ <template v-else >
203+ <dt >Tool</dt >
204+ <dd >{{ props.notification.content.tool_names[0] }}</dd >
205+ </template >
206+ <template v-if =" props .notification .content .description " >
207+ <dt >Description</dt >
208+ <dd >{{ props.notification.content.description }}</dd >
209+ </template >
210+ <template v-if =" props .notification .content .tool_url " >
211+ <dt >URL</dt >
212+ <dd >
213+ <span class =" text-break" >{{ props.notification.content.tool_url }}</span >
214+ </dd >
215+ </template >
216+ <template v-if =" props .notification .content .scientific_domain " >
217+ <dt >Scientific domain</dt >
218+ <dd >{{ props.notification.content.scientific_domain }}</dd >
219+ </template >
220+ <template v-if =" props .notification .content .requested_version " >
221+ <dt >Version</dt >
222+ <dd >{{ props.notification.content.requested_version }}</dd >
223+ </template >
224+ <template v-if =" props .notification .content .workflow_id " >
225+ <dt >Workflow</dt >
226+ <dd >
227+ <RouterLink :to =" `/workflows/run?id=${props.notification.content.workflow_id}`" >
228+ {{ props.notification.content.workflow_id }}
229+ </RouterLink >
230+ </dd >
231+ </template >
232+ <template v-if =" props .notification .content .additional_remarks " >
233+ <dt >Additional remarks</dt >
234+ <dd >{{ props.notification.content.additional_remarks }}</dd >
235+ </template >
236+ <template v-if =" props .notification .content .requester_email " >
237+ <dt >Requested by</dt >
238+ <dd >
239+ <BLink :href =" `mailto:${props.notification.content.requester_email}`" >
240+ {{ props.notification.content.requester_email }}
241+ </BLink >
242+ </dd >
243+ </template >
244+ </dl >
245+ </template >
246+ <template v-else >
247+ <span
248+ class =" notification-message"
249+ @click =" handleMessageClick"
250+ v-html =" renderMarkdown(props.notification.content.message)" />
251+ </template >
186252 </template >
187- <template v-else-if =" props .notification .category === ' tool_request' " >
188- <dl class =" mb-0" >
189- <template v-if =" props .notification .content .description " >
190- <dt >Description</dt >
191- <dd >{{ props.notification.content.description }}</dd >
192- </template >
193- <template v-if =" props .notification .content .tool_url " >
194- <dt >URL</dt >
195- <dd >
196- <span class =" text-break" >{{ props.notification.content.tool_url }}</span >
197- </dd >
198- </template >
199- <template v-if =" props .notification .content .scientific_domain " >
200- <dt >Scientific domain</dt >
201- <dd >{{ props.notification.content.scientific_domain }}</dd >
202- </template >
203- <template v-if =" props .notification .content .requested_version " >
204- <dt >Version</dt >
205- <dd >{{ props.notification.content.requested_version }}</dd >
206- </template >
207- <dt >Requested by</dt >
208- <dd >
209- <span v-if =" props.notification.content.requester_name" >
210- {{ props.notification.content.requester_name }}
211- <span v-if =" props.notification.content.requester_affiliation" >
212- ({{ props.notification.content.requester_affiliation }})
213- </span >
214- &mdash ;
215- </span >
216- <BLink :href =" `mailto:${props.notification.content.requester_email}`" >
217- {{ props.notification.content.requester_email }}
218- </BLink >
219- </dd >
220- </dl >
221- </template >
222- <template v-else >
223- <span
224- class =" notification-message"
225- @click =" handleMessageClick"
226- v-html =" renderMarkdown(props.notification.content.message)" />
227- </template >
228- </template >
229- </GCard >
253+ </GCard >
254+ </div >
230255</template >
231256
232257<style lang="scss">
0 commit comments