@frigear-nu/shifts 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -2
- package/dist/module.d.mts +716 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +272 -0
- package/dist/runtime/access.d.ts +2 -0
- package/dist/runtime/access.js +84 -0
- package/dist/runtime/app/components/ShiftBroadcastSlideover.d.vue.ts +19 -0
- package/dist/runtime/app/components/ShiftBroadcastSlideover.vue +142 -0
- package/dist/runtime/app/components/ShiftBroadcastSlideover.vue.d.ts +19 -0
- package/dist/runtime/app/components/ShiftBroadcastsCard.d.vue.ts +9 -0
- package/dist/runtime/app/components/ShiftBroadcastsCard.vue +74 -0
- package/dist/runtime/app/components/ShiftBroadcastsCard.vue.d.ts +9 -0
- package/dist/runtime/app/components/ShiftBulkSlideover.d.vue.ts +15 -0
- package/dist/runtime/app/components/ShiftBulkSlideover.vue +185 -0
- package/dist/runtime/app/components/ShiftBulkSlideover.vue.d.ts +15 -0
- package/dist/runtime/app/components/ShiftCheckInCard.d.vue.ts +13 -0
- package/dist/runtime/app/components/ShiftCheckInCard.vue +238 -0
- package/dist/runtime/app/components/ShiftCheckInCard.vue.d.ts +13 -0
- package/dist/runtime/app/components/ShiftCopySlideover.d.vue.ts +11 -0
- package/dist/runtime/app/components/ShiftCopySlideover.vue +71 -0
- package/dist/runtime/app/components/ShiftCopySlideover.vue.d.ts +11 -0
- package/dist/runtime/app/components/ShiftDayView.d.vue.ts +16 -0
- package/dist/runtime/app/components/ShiftDayView.vue +124 -0
- package/dist/runtime/app/components/ShiftDayView.vue.d.ts +16 -0
- package/dist/runtime/app/components/ShiftFeedSlideover.d.vue.ts +7 -0
- package/dist/runtime/app/components/ShiftFeedSlideover.vue +172 -0
- package/dist/runtime/app/components/ShiftFeedSlideover.vue.d.ts +7 -0
- package/dist/runtime/app/components/ShiftNowCard.d.vue.ts +6 -0
- package/dist/runtime/app/components/ShiftNowCard.vue +83 -0
- package/dist/runtime/app/components/ShiftNowCard.vue.d.ts +6 -0
- package/dist/runtime/app/components/ShiftPassFullscreen.d.vue.ts +13 -0
- package/dist/runtime/app/components/ShiftPassFullscreen.vue +79 -0
- package/dist/runtime/app/components/ShiftPassFullscreen.vue.d.ts +13 -0
- package/dist/runtime/app/components/ShiftPerkSlideover.d.vue.ts +14 -0
- package/dist/runtime/app/components/ShiftPerkSlideover.vue +103 -0
- package/dist/runtime/app/components/ShiftPerkSlideover.vue.d.ts +14 -0
- package/dist/runtime/app/components/ShiftPerksCard.d.vue.ts +8 -0
- package/dist/runtime/app/components/ShiftPerksCard.vue +66 -0
- package/dist/runtime/app/components/ShiftPerksCard.vue.d.ts +8 -0
- package/dist/runtime/app/components/ShiftQrScanner.d.vue.ts +10 -0
- package/dist/runtime/app/components/ShiftQrScanner.vue +44 -0
- package/dist/runtime/app/components/ShiftQrScanner.vue.d.ts +10 -0
- package/dist/runtime/app/components/ShiftRoleSlideover.d.vue.ts +15 -0
- package/dist/runtime/app/components/ShiftRoleSlideover.vue +88 -0
- package/dist/runtime/app/components/ShiftRoleSlideover.vue.d.ts +15 -0
- package/dist/runtime/app/components/ShiftScheduleSettingsFields.d.vue.ts +11 -0
- package/dist/runtime/app/components/ShiftScheduleSettingsFields.vue +61 -0
- package/dist/runtime/app/components/ShiftScheduleSettingsFields.vue.d.ts +11 -0
- package/dist/runtime/app/components/ShiftScheduleSlideover.d.vue.ts +12 -0
- package/dist/runtime/app/components/ShiftScheduleSlideover.vue +129 -0
- package/dist/runtime/app/components/ShiftScheduleSlideover.vue.d.ts +12 -0
- package/dist/runtime/app/components/ShiftSlideover.d.vue.ts +13 -0
- package/dist/runtime/app/components/ShiftSlideover.vue +353 -0
- package/dist/runtime/app/components/ShiftSlideover.vue.d.ts +13 -0
- package/dist/runtime/app/components/ShiftStationSlideover.d.vue.ts +15 -0
- package/dist/runtime/app/components/ShiftStationSlideover.vue +92 -0
- package/dist/runtime/app/components/ShiftStationSlideover.vue.d.ts +15 -0
- package/dist/runtime/app/composables/index.d.ts +6 -0
- package/dist/runtime/app/composables/index.js +5 -0
- package/dist/runtime/app/composables/useShiftsActions.d.ts +61 -0
- package/dist/runtime/app/composables/useShiftsActions.js +224 -0
- package/dist/runtime/app/composables/useShiftsFormat.d.ts +12 -0
- package/dist/runtime/app/composables/useShiftsFormat.js +14 -0
- package/dist/runtime/app/composables/useShiftsLinks.d.ts +12 -0
- package/dist/runtime/app/composables/useShiftsLinks.js +6 -0
- package/dist/runtime/app/composables/useShiftsTranslate.d.ts +5 -0
- package/dist/runtime/app/composables/useShiftsTranslate.js +12 -0
- package/dist/runtime/app/composables/useShiftsVenueFeatures.d.ts +17 -0
- package/dist/runtime/app/composables/useShiftsVenueFeatures.js +18 -0
- package/dist/runtime/app/dashboard/NextShift.d.vue.ts +3 -0
- package/dist/runtime/app/dashboard/NextShift.vue +69 -0
- package/dist/runtime/app/dashboard/NextShift.vue.d.ts +3 -0
- package/dist/runtime/app/dashboard/OpenSwaps.d.vue.ts +3 -0
- package/dist/runtime/app/dashboard/OpenSwaps.vue +69 -0
- package/dist/runtime/app/dashboard/OpenSwaps.vue.d.ts +3 -0
- package/dist/runtime/app/dashboard/TeamOnNow.d.vue.ts +3 -0
- package/dist/runtime/app/dashboard/TeamOnNow.vue +72 -0
- package/dist/runtime/app/dashboard/TeamOnNow.vue.d.ts +3 -0
- package/dist/runtime/app/pages/check-in.d.vue.ts +3 -0
- package/dist/runtime/app/pages/check-in.vue +93 -0
- package/dist/runtime/app/pages/check-in.vue.d.ts +3 -0
- package/dist/runtime/app/pages/lead.d.vue.ts +3 -0
- package/dist/runtime/app/pages/lead.vue +300 -0
- package/dist/runtime/app/pages/lead.vue.d.ts +3 -0
- package/dist/runtime/app/pages/shift.d.vue.ts +3 -0
- package/dist/runtime/app/pages/shift.vue +482 -0
- package/dist/runtime/app/pages/shift.vue.d.ts +3 -0
- package/dist/runtime/app/pages/shifts.d.vue.ts +3 -0
- package/dist/runtime/app/pages/shifts.vue +21 -0
- package/dist/runtime/app/pages/shifts.vue.d.ts +3 -0
- package/dist/runtime/app/pages/station.d.vue.ts +3 -0
- package/dist/runtime/app/pages/station.vue +104 -0
- package/dist/runtime/app/pages/station.vue.d.ts +3 -0
- package/dist/runtime/app/pages/swaps.d.vue.ts +3 -0
- package/dist/runtime/app/pages/swaps.vue +32 -0
- package/dist/runtime/app/pages/swaps.vue.d.ts +3 -0
- package/dist/runtime/app/tabs/HomeShifts.d.vue.ts +6 -0
- package/dist/runtime/app/tabs/HomeShifts.vue +194 -0
- package/dist/runtime/app/tabs/HomeShifts.vue.d.ts +6 -0
- package/dist/runtime/app/tabs/HomeSwaps.d.vue.ts +3 -0
- package/dist/runtime/app/tabs/HomeSwaps.vue +188 -0
- package/dist/runtime/app/tabs/HomeSwaps.vue.d.ts +3 -0
- package/dist/runtime/app/tabs/Shifts.d.vue.ts +9 -0
- package/dist/runtime/app/tabs/Shifts.vue +487 -0
- package/dist/runtime/app/tabs/Shifts.vue.d.ts +9 -0
- package/dist/runtime/app/utils/admin-shifts.d.ts +42 -0
- package/dist/runtime/app/utils/admin-shifts.js +36 -0
- package/dist/runtime/dashboard.d.ts +8 -0
- package/dist/runtime/dashboard.js +30 -0
- package/dist/runtime/emails/shifts-broadcast.d.vue.ts +8 -0
- package/dist/runtime/emails/shifts-broadcast.vue +24 -0
- package/dist/runtime/emails/shifts-broadcast.vue.d.ts +8 -0
- package/dist/runtime/emails/shifts-reminder.d.vue.ts +12 -0
- package/dist/runtime/emails/shifts-reminder.vue +34 -0
- package/dist/runtime/emails/shifts-reminder.vue.d.ts +12 -0
- package/dist/runtime/emails/shifts-swap-accepted.d.vue.ts +11 -0
- package/dist/runtime/emails/shifts-swap-accepted.vue +32 -0
- package/dist/runtime/emails/shifts-swap-accepted.vue.d.ts +11 -0
- package/dist/runtime/emails/shifts-swap-completed.d.vue.ts +11 -0
- package/dist/runtime/emails/shifts-swap-completed.vue +32 -0
- package/dist/runtime/emails/shifts-swap-completed.vue.d.ts +11 -0
- package/dist/runtime/emails/shifts-swap-offered.d.vue.ts +11 -0
- package/dist/runtime/emails/shifts-swap-offered.vue +32 -0
- package/dist/runtime/emails/shifts-swap-offered.vue.d.ts +11 -0
- package/dist/runtime/emails/shifts-swap-pending.d.vue.ts +11 -0
- package/dist/runtime/emails/shifts-swap-pending.vue +32 -0
- package/dist/runtime/emails/shifts-swap-pending.vue.d.ts +11 -0
- package/dist/runtime/emails/shifts-swap-proposed.d.vue.ts +11 -0
- package/dist/runtime/emails/shifts-swap-proposed.vue +32 -0
- package/dist/runtime/emails/shifts-swap-proposed.vue.d.ts +11 -0
- package/dist/runtime/emails/shifts-swap-rejected.d.vue.ts +11 -0
- package/dist/runtime/emails/shifts-swap-rejected.vue +32 -0
- package/dist/runtime/emails/shifts-swap-rejected.vue.d.ts +11 -0
- package/dist/runtime/i18n/lang/da.json +627 -0
- package/dist/runtime/i18n/lang/en.json +627 -0
- package/dist/runtime/notifications.d.ts +9 -0
- package/dist/runtime/notifications.js +36 -0
- package/dist/runtime/server/db/schema.postgresql.d.ts +2151 -0
- package/dist/runtime/server/db/schema.postgresql.js +228 -0
- package/dist/runtime/server/db/schema.sqlite.d.ts +2263 -0
- package/dist/runtime/server/db/schema.sqlite.js +228 -0
- package/dist/runtime/server/digest-email.d.ts +17 -0
- package/dist/runtime/server/digest-email.js +42 -0
- package/dist/runtime/server/plugins/station-key.d.ts +2 -0
- package/dist/runtime/server/plugins/station-key.js +5 -0
- package/dist/runtime/server/plugins/teams.d.ts +2 -0
- package/dist/runtime/server/plugins/teams.js +19 -0
- package/dist/runtime/server/policies.d.ts +2 -0
- package/dist/runtime/server/policies.js +41 -0
- package/dist/runtime/server/reminder-email.d.ts +67 -0
- package/dist/runtime/server/reminder-email.js +109 -0
- package/dist/runtime/server/routes/admin/assignment.delete.d.ts +2 -0
- package/dist/runtime/server/routes/admin/assignment.delete.js +10 -0
- package/dist/runtime/server/routes/admin/assignments.post.d.ts +2 -0
- package/dist/runtime/server/routes/admin/assignments.post.js +11 -0
- package/dist/runtime/server/routes/admin/broadcasts.get.d.ts +2 -0
- package/dist/runtime/server/routes/admin/broadcasts.get.js +8 -0
- package/dist/runtime/server/routes/admin/broadcasts.post.d.ts +2 -0
- package/dist/runtime/server/routes/admin/broadcasts.post.js +9 -0
- package/dist/runtime/server/routes/admin/candidates.get.d.ts +2 -0
- package/dist/runtime/server/routes/admin/candidates.get.js +10 -0
- package/dist/runtime/server/routes/admin/operation-teams.get.d.ts +2 -0
- package/dist/runtime/server/routes/admin/operation-teams.get.js +9 -0
- package/dist/runtime/server/routes/admin/perk.delete.d.ts +2 -0
- package/dist/runtime/server/routes/admin/perk.delete.js +10 -0
- package/dist/runtime/server/routes/admin/perk.patch.d.ts +2 -0
- package/dist/runtime/server/routes/admin/perk.patch.js +10 -0
- package/dist/runtime/server/routes/admin/perks.get.d.ts +2 -0
- package/dist/runtime/server/routes/admin/perks.get.js +9 -0
- package/dist/runtime/server/routes/admin/perks.post.d.ts +2 -0
- package/dist/runtime/server/routes/admin/perks.post.js +10 -0
- package/dist/runtime/server/routes/admin/role.delete.d.ts +2 -0
- package/dist/runtime/server/routes/admin/role.delete.js +11 -0
- package/dist/runtime/server/routes/admin/role.patch.d.ts +2 -0
- package/dist/runtime/server/routes/admin/role.patch.js +11 -0
- package/dist/runtime/server/routes/admin/roles.get.d.ts +2 -0
- package/dist/runtime/server/routes/admin/roles.get.js +9 -0
- package/dist/runtime/server/routes/admin/roles.post.d.ts +2 -0
- package/dist/runtime/server/routes/admin/roles.post.js +10 -0
- package/dist/runtime/server/routes/admin/schedule-copy.post.d.ts +2 -0
- package/dist/runtime/server/routes/admin/schedule-copy.post.js +12 -0
- package/dist/runtime/server/routes/admin/schedule-publish.post.d.ts +2 -0
- package/dist/runtime/server/routes/admin/schedule-publish.post.js +9 -0
- package/dist/runtime/server/routes/admin/schedule.delete.d.ts +2 -0
- package/dist/runtime/server/routes/admin/schedule.delete.js +10 -0
- package/dist/runtime/server/routes/admin/schedule.get.d.ts +2 -0
- package/dist/runtime/server/routes/admin/schedule.get.js +9 -0
- package/dist/runtime/server/routes/admin/schedule.patch.d.ts +2 -0
- package/dist/runtime/server/routes/admin/schedule.patch.js +10 -0
- package/dist/runtime/server/routes/admin/schedules.get.d.ts +2 -0
- package/dist/runtime/server/routes/admin/schedules.get.js +10 -0
- package/dist/runtime/server/routes/admin/schedules.post.d.ts +2 -0
- package/dist/runtime/server/routes/admin/schedules.post.js +9 -0
- package/dist/runtime/server/routes/admin/shift.delete.d.ts +2 -0
- package/dist/runtime/server/routes/admin/shift.delete.js +10 -0
- package/dist/runtime/server/routes/admin/shift.patch.d.ts +2 -0
- package/dist/runtime/server/routes/admin/shift.patch.js +10 -0
- package/dist/runtime/server/routes/admin/shifts-bulk.post.d.ts +2 -0
- package/dist/runtime/server/routes/admin/shifts-bulk.post.js +10 -0
- package/dist/runtime/server/routes/admin/shifts.get.d.ts +2 -0
- package/dist/runtime/server/routes/admin/shifts.get.js +10 -0
- package/dist/runtime/server/routes/admin/station.delete.d.ts +2 -0
- package/dist/runtime/server/routes/admin/station.delete.js +11 -0
- package/dist/runtime/server/routes/admin/station.patch.d.ts +2 -0
- package/dist/runtime/server/routes/admin/station.patch.js +11 -0
- package/dist/runtime/server/routes/admin/stations.get.d.ts +2 -0
- package/dist/runtime/server/routes/admin/stations.get.js +9 -0
- package/dist/runtime/server/routes/admin/stations.post.d.ts +2 -0
- package/dist/runtime/server/routes/admin/stations.post.js +10 -0
- package/dist/runtime/server/routes/admin/swap-cancel.post.d.ts +2 -0
- package/dist/runtime/server/routes/admin/swap-cancel.post.js +10 -0
- package/dist/runtime/server/routes/admin/swaps.get.d.ts +2 -0
- package/dist/runtime/server/routes/admin/swaps.get.js +10 -0
- package/dist/runtime/server/routes/feed/feed.get.d.ts +2 -0
- package/dist/runtime/server/routes/feed/feed.get.js +9 -0
- package/dist/runtime/server/routes/lead/attended.post.d.ts +2 -0
- package/dist/runtime/server/routes/lead/attended.post.js +11 -0
- package/dist/runtime/server/routes/lead/broadcast.post.d.ts +2 -0
- package/dist/runtime/server/routes/lead/broadcast.post.js +12 -0
- package/dist/runtime/server/routes/lead/check-in.post.d.ts +2 -0
- package/dist/runtime/server/routes/lead/check-in.post.js +9 -0
- package/dist/runtime/server/routes/lead/exceptions.get.d.ts +2 -0
- package/dist/runtime/server/routes/lead/exceptions.get.js +8 -0
- package/dist/runtime/server/routes/lead/no-show.post.d.ts +2 -0
- package/dist/runtime/server/routes/lead/no-show.post.js +11 -0
- package/dist/runtime/server/routes/lead/now.get.d.ts +2 -0
- package/dist/runtime/server/routes/lead/now.get.js +9 -0
- package/dist/runtime/server/routes/lead/on-duty.get.d.ts +2 -0
- package/dist/runtime/server/routes/lead/on-duty.get.js +10 -0
- package/dist/runtime/server/routes/lead/stations.get.d.ts +2 -0
- package/dist/runtime/server/routes/lead/stations.get.js +8 -0
- package/dist/runtime/server/routes/lead/team-shifts.get.d.ts +2 -0
- package/dist/runtime/server/routes/lead/team-shifts.get.js +9 -0
- package/dist/runtime/server/routes/lead/team-swaps.get.d.ts +2 -0
- package/dist/runtime/server/routes/lead/team-swaps.get.js +9 -0
- package/dist/runtime/server/routes/me/check-in.post.d.ts +2 -0
- package/dist/runtime/server/routes/me/check-in.post.js +11 -0
- package/dist/runtime/server/routes/me/earned-perk-claim.post.d.ts +2 -0
- package/dist/runtime/server/routes/me/earned-perk-claim.post.js +10 -0
- package/dist/runtime/server/routes/me/earned-perks.get.d.ts +2 -0
- package/dist/runtime/server/routes/me/earned-perks.get.js +9 -0
- package/dist/runtime/server/routes/me/feed-token.delete.d.ts +2 -0
- package/dist/runtime/server/routes/me/feed-token.delete.js +7 -0
- package/dist/runtime/server/routes/me/feed-token.get.d.ts +2 -0
- package/dist/runtime/server/routes/me/feed-token.get.js +6 -0
- package/dist/runtime/server/routes/me/feed-token.post.d.ts +2 -0
- package/dist/runtime/server/routes/me/feed-token.post.js +7 -0
- package/dist/runtime/server/routes/me/leads.get.d.ts +2 -0
- package/dist/runtime/server/routes/me/leads.get.js +5 -0
- package/dist/runtime/server/routes/me/now.get.d.ts +2 -0
- package/dist/runtime/server/routes/me/now.get.js +5 -0
- package/dist/runtime/server/routes/me/pass.get.d.ts +2 -0
- package/dist/runtime/server/routes/me/pass.get.js +11 -0
- package/dist/runtime/server/routes/me/settle.post.d.ts +2 -0
- package/dist/runtime/server/routes/me/settle.post.js +14 -0
- package/dist/runtime/server/routes/me/shift.get.d.ts +2 -0
- package/dist/runtime/server/routes/me/shift.get.js +10 -0
- package/dist/runtime/server/routes/me/shifts.get.d.ts +2 -0
- package/dist/runtime/server/routes/me/shifts.get.js +6 -0
- package/dist/runtime/server/routes/me/swap.delete.d.ts +2 -0
- package/dist/runtime/server/routes/me/swap.delete.js +11 -0
- package/dist/runtime/server/routes/me/swap.post.d.ts +2 -0
- package/dist/runtime/server/routes/me/swap.post.js +11 -0
- package/dist/runtime/server/routes/stations/token.get.d.ts +2 -0
- package/dist/runtime/server/routes/stations/token.get.js +12 -0
- package/dist/runtime/server/routes/swaps/approve.post.d.ts +2 -0
- package/dist/runtime/server/routes/swaps/approve.post.js +9 -0
- package/dist/runtime/server/routes/swaps/list.get.d.ts +2 -0
- package/dist/runtime/server/routes/swaps/list.get.js +5 -0
- package/dist/runtime/server/routes/swaps/offer-accept.post.d.ts +2 -0
- package/dist/runtime/server/routes/swaps/offer-accept.post.js +9 -0
- package/dist/runtime/server/routes/swaps/offer-reject.post.d.ts +2 -0
- package/dist/runtime/server/routes/swaps/offer-reject.post.js +9 -0
- package/dist/runtime/server/routes/swaps/offer.delete.d.ts +2 -0
- package/dist/runtime/server/routes/swaps/offer.delete.js +11 -0
- package/dist/runtime/server/routes/swaps/offer.post.d.ts +2 -0
- package/dist/runtime/server/routes/swaps/offer.post.js +11 -0
- package/dist/runtime/server/routes/swaps/reject.post.d.ts +2 -0
- package/dist/runtime/server/routes/swaps/reject.post.js +9 -0
- package/dist/runtime/server/swap-email.d.ts +28 -0
- package/dist/runtime/server/swap-email.js +49 -0
- package/dist/runtime/server/tasks/close-shifts.d.ts +2 -0
- package/dist/runtime/server/tasks/close-shifts.js +9 -0
- package/dist/runtime/server/tasks/send-reminders.d.ts +2 -0
- package/dist/runtime/server/tasks/send-reminders.js +9 -0
- package/dist/runtime/server/utils/shifts-admin.d.ts +67 -0
- package/dist/runtime/server/utils/shifts-admin.js +312 -0
- package/dist/runtime/server/utils/shifts-assign.d.ts +89 -0
- package/dist/runtime/server/utils/shifts-assign.js +264 -0
- package/dist/runtime/server/utils/shifts-automation.d.ts +37 -0
- package/dist/runtime/server/utils/shifts-automation.js +171 -0
- package/dist/runtime/server/utils/shifts-broadcasts.d.ts +38 -0
- package/dist/runtime/server/utils/shifts-broadcasts.js +113 -0
- package/dist/runtime/server/utils/shifts-core.d.ts +78 -0
- package/dist/runtime/server/utils/shifts-core.js +142 -0
- package/dist/runtime/server/utils/shifts-dto.d.ts +32 -0
- package/dist/runtime/server/utils/shifts-dto.js +127 -0
- package/dist/runtime/server/utils/shifts-emails.d.ts +16 -0
- package/dist/runtime/server/utils/shifts-emails.js +44 -0
- package/dist/runtime/server/utils/shifts-exceptions.d.ts +7 -0
- package/dist/runtime/server/utils/shifts-exceptions.js +32 -0
- package/dist/runtime/server/utils/shifts-feed.d.ts +16 -0
- package/dist/runtime/server/utils/shifts-feed.js +73 -0
- package/dist/runtime/server/utils/shifts-notify.d.ts +40 -0
- package/dist/runtime/server/utils/shifts-notify.js +22 -0
- package/dist/runtime/server/utils/shifts-on-duty.d.ts +12 -0
- package/dist/runtime/server/utils/shifts-on-duty.js +37 -0
- package/dist/runtime/server/utils/shifts-perks.d.ts +46 -0
- package/dist/runtime/server/utils/shifts-perks.js +183 -0
- package/dist/runtime/server/utils/shifts-reminders.d.ts +30 -0
- package/dist/runtime/server/utils/shifts-reminders.js +102 -0
- package/dist/runtime/server/utils/shifts-schemas.d.ts +318 -0
- package/dist/runtime/server/utils/shifts-schemas.js +177 -0
- package/dist/runtime/server/utils/shifts-station-key.d.ts +7 -0
- package/dist/runtime/server/utils/shifts-station-key.js +22 -0
- package/dist/runtime/server/utils/shifts-stations.d.ts +28 -0
- package/dist/runtime/server/utils/shifts-stations.js +109 -0
- package/dist/runtime/server/utils/shifts-swaps.d.ts +114 -0
- package/dist/runtime/server/utils/shifts-swaps.js +559 -0
- package/dist/runtime/server/utils/shifts-views.d.ts +62 -0
- package/dist/runtime/server/utils/shifts-views.js +212 -0
- package/dist/runtime/utils/api.d.ts +108 -0
- package/dist/runtime/utils/api.js +111 -0
- package/dist/runtime/utils/checkin.d.ts +59 -0
- package/dist/runtime/utils/checkin.js +57 -0
- package/dist/runtime/utils/guards.d.ts +21 -0
- package/dist/runtime/utils/guards.js +36 -0
- package/dist/runtime/utils/ics.d.ts +32 -0
- package/dist/runtime/utils/ics.js +56 -0
- package/dist/runtime/utils/index.d.ts +16 -0
- package/dist/runtime/utils/index.js +15 -0
- package/dist/runtime/utils/links.d.ts +44 -0
- package/dist/runtime/utils/links.js +21 -0
- package/dist/runtime/utils/reminders.d.ts +27 -0
- package/dist/runtime/utils/reminders.js +28 -0
- package/dist/runtime/utils/settings.d.ts +28 -0
- package/dist/runtime/utils/settings.js +18 -0
- package/dist/runtime/utils/station-key.d.ts +9 -0
- package/dist/runtime/utils/station-key.js +12 -0
- package/dist/runtime/utils/status.d.ts +23 -0
- package/dist/runtime/utils/status.js +46 -0
- package/dist/runtime/utils/time.d.ts +22 -0
- package/dist/runtime/utils/time.js +14 -0
- package/dist/types.d.mts +5 -0
- package/package.json +131 -3
package/dist/module.json
ADDED
package/dist/module.mjs
ADDED
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { defineNuxtModule, createResolver, hasNuxtModule, addServerImportsDir, addServerPlugin, addImports, addComponentsDir } from '@nuxt/kit';
|
|
2
|
+
import { registerModule, registerTailwindSource, registerLocales, resolveDashboardHubPath, isPathUnder, resolvePagePath, registerDatabaseTable, addModuleRoutes, inlineModuleRuntime, addModulePages, addPageRedirects } from '@frigear-nu/module-kit/utils';
|
|
3
|
+
import { extendMaps, defineMapLayer } from '@frigear-nu/maps/utils';
|
|
4
|
+
import { OPERATIONS_VENUE_SURFACE } from '@frigear-nu/operations/utils';
|
|
5
|
+
import { registerAccess, addPolicies } from '@frigear-nu/auth/utils';
|
|
6
|
+
import { shiftsAccess, perksAccess } from '../dist/runtime/access.js';
|
|
7
|
+
import { SHIFTS_DEFAULT_PAGES, SHIFTS_HOME_TAB, shiftsSwapsPath, shiftsMinePath } from '../dist/runtime/utils/links.js';
|
|
8
|
+
import { resolveCrewHomePath } from '@frigear-nu/crew/utils';
|
|
9
|
+
import { isValidTimeZone } from '@frigear-nu/module-kit/time';
|
|
10
|
+
import { normalizeReminderBatch, normalizeReminderOffsets } from '../dist/runtime/utils/reminders.js';
|
|
11
|
+
import { SHIFTS_DASHBOARD, shiftsDashboardItems } from '../dist/runtime/dashboard.js';
|
|
12
|
+
import { extendNotificationTopics } from '@frigear-nu/notify/utils';
|
|
13
|
+
import { shiftsNotificationTopics } from '../dist/runtime/notifications.js';
|
|
14
|
+
import { normalizeAutomationBatch } from '../dist/runtime/utils/checkin.js';
|
|
15
|
+
import { assertShiftsStationKey } from '../dist/runtime/utils/station-key.js';
|
|
16
|
+
|
|
17
|
+
const MODULE_NAME = "@frigear-nu/shifts";
|
|
18
|
+
const module$1 = defineNuxtModule({
|
|
19
|
+
meta: { name: MODULE_NAME, configKey: "shifts" },
|
|
20
|
+
defaults: {
|
|
21
|
+
settings: { pages: {} },
|
|
22
|
+
checkInOpensMinutes: 60
|
|
23
|
+
},
|
|
24
|
+
moduleDependencies: {
|
|
25
|
+
"@nuxthub/core": { version: ">=0.10" },
|
|
26
|
+
"@frigear-nu/module-kit": { version: ">=0.0.1" },
|
|
27
|
+
"@frigear-nu/auth": { version: ">=0.0.1" },
|
|
28
|
+
// People on shifts are users: names, emails and phone numbers come from the `users` table.
|
|
29
|
+
"@frigear-nu/users": { version: ">=0.0.1" },
|
|
30
|
+
"@frigear-nu/ui": { version: ">=0.0.1" },
|
|
31
|
+
// Schedules hang off operations; shifts belong to an operation's teams; approved crew are the people on them.
|
|
32
|
+
"@frigear-nu/operations": { version: ">=0.0.0" },
|
|
33
|
+
"@frigear-nu/teams": { version: ">=0.0.0" },
|
|
34
|
+
"@frigear-nu/crew": { version: ">=0.0.0" },
|
|
35
|
+
// Reminders, swaps, broadcasts and the digest go through notify's `notifyUser` (email, push, SMS by the person's choice).
|
|
36
|
+
"@frigear-nu/notify": { version: ">=0.0.1" },
|
|
37
|
+
"@frigear-nu/menu": { version: ">=0.0.1", optional: true },
|
|
38
|
+
"@frigear-nu/widget": { version: ">=0.0.0", optional: true },
|
|
39
|
+
// Items on the `crew.home` dashboard.
|
|
40
|
+
"@frigear-nu/dashboard": { version: ">=0.0.0", optional: true },
|
|
41
|
+
// Provides the admin route and shell the operation page lives in.
|
|
42
|
+
"@frigear-nu/admin": { version: ">=0.0.0", optional: true },
|
|
43
|
+
"@frigear-nu/mobile": { version: ">=0.0.0", optional: true },
|
|
44
|
+
// Renders the `shifts-swap-*`, `shifts-reminder` and `shifts-broadcast` emails from the templates this module ships.
|
|
45
|
+
"@frigear-nu/email-templates": { version: ">=0.0.1", optional: true },
|
|
46
|
+
// The `shifts.on-duty` live layer on the venue layouts of operations (installed with operations already).
|
|
47
|
+
"@frigear-nu/maps": { version: ">=0.0.0" }
|
|
48
|
+
},
|
|
49
|
+
async setup(options, nuxt) {
|
|
50
|
+
registerModule(MODULE_NAME, nuxt);
|
|
51
|
+
const resolver = createResolver(import.meta.url);
|
|
52
|
+
registerAccess(nuxt, shiftsAccess, { from: MODULE_NAME });
|
|
53
|
+
registerAccess(nuxt, perksAccess, { from: MODULE_NAME });
|
|
54
|
+
addPolicies(nuxt, { path: resolver.resolve("./runtime/server/policies") });
|
|
55
|
+
registerTailwindSource(nuxt, resolver.resolve("./runtime/app"));
|
|
56
|
+
registerLocales(nuxt, resolver.resolve("./runtime/i18n/lang"));
|
|
57
|
+
const settings = options.settings ?? {};
|
|
58
|
+
const timeZone = options.timeZone || "";
|
|
59
|
+
if (timeZone && !isValidTimeZone(timeZone)) throw new Error(`[shifts] \`timeZone\` "${timeZone}" is not a time zone this runtime knows.`);
|
|
60
|
+
const checkInOpensMinutes = Math.max(0, Math.round(options.checkInOpensMinutes ?? 60));
|
|
61
|
+
const hub = resolveDashboardHubPath(nuxt, { dependency: true });
|
|
62
|
+
const crewHome = resolveCrewHomePath(nuxt.options.crew?.settings?.pages?.home, hub);
|
|
63
|
+
const tabsOnly = !!(crewHome && hub && isPathUnder(crewHome, hub)) && !hasNuxtModule("@frigear-nu/mobile");
|
|
64
|
+
const shiftsSetting = settings.pages?.shifts ?? true;
|
|
65
|
+
const swapsSetting = settings.pages?.swaps ?? true;
|
|
66
|
+
const shiftsPath = tabsOnly && typeof shiftsSetting !== "string" ? void 0 : resolvePagePath(shiftsSetting, SHIFTS_DEFAULT_PAGES.shifts);
|
|
67
|
+
const shiftPath = resolvePagePath(settings.pages?.shift ?? true, SHIFTS_DEFAULT_PAGES.shift);
|
|
68
|
+
const swapsPath = tabsOnly && typeof swapsSetting !== "string" ? void 0 : resolvePagePath(swapsSetting, SHIFTS_DEFAULT_PAGES.swaps);
|
|
69
|
+
const checkInPath = resolvePagePath(settings.pages?.checkIn ?? true, SHIFTS_DEFAULT_PAGES.checkIn);
|
|
70
|
+
const leadPath = resolvePagePath(settings.pages?.lead ?? true, SHIFTS_DEFAULT_PAGES.lead);
|
|
71
|
+
const stationPath = resolvePagePath(settings.pages?.station ?? true, SHIFTS_DEFAULT_PAGES.station);
|
|
72
|
+
nuxt.options.runtimeConfig.public.shifts = {
|
|
73
|
+
pages: { shifts: shiftsPath, shift: shiftPath, swaps: swapsPath, checkIn: checkInPath, lead: leadPath, station: stationPath, home: crewHome },
|
|
74
|
+
timeZone,
|
|
75
|
+
checkInOpensMinutes
|
|
76
|
+
};
|
|
77
|
+
const runtime = nuxt.options.runtimeConfig;
|
|
78
|
+
const reminders = { offsets: normalizeReminderOffsets(options.reminders?.offsets), sms: options.reminders?.sms === true, batchSize: normalizeReminderBatch(options.reminders?.batchSize) };
|
|
79
|
+
const automation = { batchSize: normalizeAutomationBatch(options.automation?.batchSize) };
|
|
80
|
+
runtime.shifts = { stationKey: "", ...runtime.shifts, timeZone, checkInOpensMinutes, reminders, automation };
|
|
81
|
+
assertShiftsStationKey(runtime.shifts.stationKey);
|
|
82
|
+
registerDatabaseTable(nuxt, {
|
|
83
|
+
resolver,
|
|
84
|
+
schema: (dialect) => `./runtime/server/db/schema.${dialect}`
|
|
85
|
+
});
|
|
86
|
+
addModuleRoutes(resolver, [
|
|
87
|
+
{ method: "get", path: "me", file: "me/shifts.get" },
|
|
88
|
+
// Static, so it wins over `me/:assignmentId`.
|
|
89
|
+
{ method: "get", path: "me/leads", file: "me/leads.get" },
|
|
90
|
+
{ method: "get", path: "me/now", file: "me/now.get" },
|
|
91
|
+
{ method: "get", path: "me/earned-perks", file: "me/earned-perks.get" },
|
|
92
|
+
{ method: "post", path: "me/earned-perks/:earnedPerkId/claim", file: "me/earned-perk-claim.post" },
|
|
93
|
+
{ method: "get", path: "me/feed-token", file: "me/feed-token.get" },
|
|
94
|
+
{ method: "post", path: "me/feed-token", file: "me/feed-token.post" },
|
|
95
|
+
{ method: "delete", path: "me/feed-token", file: "me/feed-token.delete" },
|
|
96
|
+
{ method: "get", path: "me/:assignmentId", file: "me/shift.get" },
|
|
97
|
+
{ method: "get", path: "me/:assignmentId/pass", file: "me/pass.get" },
|
|
98
|
+
{ method: "post", path: "me/:assignmentId/settle", file: "me/settle.post" },
|
|
99
|
+
{ method: "post", path: "me/:assignmentId/check-in", file: "me/check-in.post" },
|
|
100
|
+
{ method: "post", path: "me/:assignmentId/swap", file: "me/swap.post" },
|
|
101
|
+
{ method: "delete", path: "me/:assignmentId/swap", file: "me/swap.delete" },
|
|
102
|
+
// The calendar feed: public, the secret in the path is the credential (`feed/<token>`, `.ics` suffix stripped by the handler).
|
|
103
|
+
{ method: "get", path: "feed/:token", file: "feed/feed.get" },
|
|
104
|
+
{ method: "get", path: "swaps", file: "swaps/list.get" },
|
|
105
|
+
{ method: "post", path: "swaps/:swapId/offers", file: "swaps/offer.post" },
|
|
106
|
+
{ method: "delete", path: "swaps/:swapId/offers/:offerId", file: "swaps/offer.delete" },
|
|
107
|
+
{ method: "post", path: "swaps/:swapId/offers/:offerId/accept", file: "swaps/offer-accept.post" },
|
|
108
|
+
{ method: "post", path: "swaps/:swapId/offers/:offerId/reject", file: "swaps/offer-reject.post" },
|
|
109
|
+
{ method: "post", path: "swaps/:swapId/approve", file: "swaps/approve.post" },
|
|
110
|
+
{ method: "post", path: "swaps/:swapId/reject", file: "swaps/reject.post" },
|
|
111
|
+
{ method: "post", path: "teams/:teamId/check-in", file: "lead/check-in.post" },
|
|
112
|
+
{ method: "get", path: "teams/:teamId/shifts", file: "lead/team-shifts.get" },
|
|
113
|
+
{ method: "get", path: "teams/:teamId/swaps", file: "lead/team-swaps.get" },
|
|
114
|
+
{ method: "post", path: "teams/:teamId/broadcasts", file: "lead/broadcast.post" },
|
|
115
|
+
{ method: "get", path: "teams/:teamId/exceptions", file: "lead/exceptions.get" },
|
|
116
|
+
{ method: "get", path: "teams/:teamId/stations", file: "lead/stations.get" },
|
|
117
|
+
{ method: "get", path: "stations/:stationId/token", file: "stations/token.get" },
|
|
118
|
+
{ method: "post", path: "assignments/:assignmentId/attended", file: "lead/attended.post" },
|
|
119
|
+
{ method: "post", path: "assignments/:assignmentId/no-show", file: "lead/no-show.post" },
|
|
120
|
+
{ method: "get", path: "operations/:operationId/now", file: "lead/now.get" },
|
|
121
|
+
{ method: "get", path: "operations/:operationId/on-duty", file: "lead/on-duty.get" }
|
|
122
|
+
], { base: "/api/shifts" });
|
|
123
|
+
addModuleRoutes(resolver, [
|
|
124
|
+
{ method: "get", path: "schedules", file: "admin/schedules.get" },
|
|
125
|
+
{ method: "post", path: "schedules", file: "admin/schedules.post" },
|
|
126
|
+
{ method: "get", path: "schedules/:scheduleId", file: "admin/schedule.get" },
|
|
127
|
+
{ method: "patch", path: "schedules/:scheduleId", file: "admin/schedule.patch" },
|
|
128
|
+
{ method: "delete", path: "schedules/:scheduleId", file: "admin/schedule.delete" },
|
|
129
|
+
{ method: "post", path: "schedules/:scheduleId/publish", file: "admin/schedule-publish.post" },
|
|
130
|
+
{ method: "post", path: "schedules/:scheduleId/copy-from", file: "admin/schedule-copy.post" },
|
|
131
|
+
{ method: "get", path: "schedules/:scheduleId/roles", file: "admin/roles.get" },
|
|
132
|
+
{ method: "post", path: "schedules/:scheduleId/roles", file: "admin/roles.post" },
|
|
133
|
+
{ method: "get", path: "schedules/:scheduleId/stations", file: "admin/stations.get" },
|
|
134
|
+
{ method: "post", path: "schedules/:scheduleId/stations", file: "admin/stations.post" },
|
|
135
|
+
{ method: "patch", path: "stations/:stationId", file: "admin/station.patch" },
|
|
136
|
+
{ method: "delete", path: "stations/:stationId", file: "admin/station.delete" },
|
|
137
|
+
{ method: "get", path: "schedules/:scheduleId/shifts", file: "admin/shifts.get" },
|
|
138
|
+
{ method: "post", path: "schedules/:scheduleId/shifts/bulk", file: "admin/shifts-bulk.post" },
|
|
139
|
+
{ method: "patch", path: "roles/:roleId", file: "admin/role.patch" },
|
|
140
|
+
{ method: "delete", path: "roles/:roleId", file: "admin/role.delete" },
|
|
141
|
+
{ method: "delete", path: "assignments/:assignmentId", file: "admin/assignment.delete" },
|
|
142
|
+
{ method: "get", path: "swaps", file: "admin/swaps.get" },
|
|
143
|
+
{ method: "post", path: "swaps/:swapId/cancel", file: "admin/swap-cancel.post" },
|
|
144
|
+
{ method: "get", path: "operations/:operationId/teams", file: "admin/operation-teams.get" },
|
|
145
|
+
{ method: "get", path: "broadcasts", file: "admin/broadcasts.get" },
|
|
146
|
+
{ method: "post", path: "broadcasts", file: "admin/broadcasts.post" },
|
|
147
|
+
{ method: "get", path: "operations/:operationId/perks", file: "admin/perks.get" },
|
|
148
|
+
{ method: "post", path: "operations/:operationId/perks", file: "admin/perks.post" },
|
|
149
|
+
{ method: "patch", path: "perks/:perkId", file: "admin/perk.patch" },
|
|
150
|
+
{ method: "delete", path: "perks/:perkId", file: "admin/perk.delete" },
|
|
151
|
+
// A shift is the module's main resource: `/api/admin/shifts/:shiftId`. The static segments above win over it.
|
|
152
|
+
{ method: "patch", path: ":shiftId", file: "admin/shift.patch" },
|
|
153
|
+
{ method: "delete", path: ":shiftId", file: "admin/shift.delete" },
|
|
154
|
+
{ method: "post", path: ":shiftId/assignments", file: "admin/assignments.post" },
|
|
155
|
+
{ method: "get", path: ":shiftId/candidates", file: "admin/candidates.get" }
|
|
156
|
+
], { base: "/api/admin/shifts" });
|
|
157
|
+
addServerImportsDir(resolver.resolve("./runtime/server/utils"));
|
|
158
|
+
inlineModuleRuntime(nuxt, resolver);
|
|
159
|
+
addServerPlugin(resolver.resolve("./runtime/server/plugins/teams"));
|
|
160
|
+
addServerPlugin(resolver.resolve("./runtime/server/plugins/station-key"));
|
|
161
|
+
nuxt.hook("notify:email:templates", (sources) => sources.push({ dir: resolver.resolve("./runtime/emails") }));
|
|
162
|
+
const tasks = [
|
|
163
|
+
{
|
|
164
|
+
name: "shifts:send-reminders",
|
|
165
|
+
handler: "./runtime/server/tasks/send-reminders",
|
|
166
|
+
description: "Email (and optionally text) people before their shifts start.",
|
|
167
|
+
cron: options.reminders?.cron === void 0 ? "*/10 * * * *" : options.reminders.cron
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: "shifts:close-shifts",
|
|
171
|
+
handler: "./runtime/server/tasks/close-shifts",
|
|
172
|
+
description: "Give out the perks of ended shifts, mark auto no-shows and send the leads their digest.",
|
|
173
|
+
cron: options.automation?.cron === void 0 ? "*/5 * * * *" : options.automation.cron
|
|
174
|
+
}
|
|
175
|
+
];
|
|
176
|
+
nuxt.hook("nitro:config", (nitroConfig) => {
|
|
177
|
+
nitroConfig.experimental ||= {};
|
|
178
|
+
nitroConfig.experimental.tasks = true;
|
|
179
|
+
nitroConfig.tasks ||= {};
|
|
180
|
+
nitroConfig.scheduledTasks ||= {};
|
|
181
|
+
for (const task of tasks) {
|
|
182
|
+
nitroConfig.tasks[task.name] = { handler: resolver.resolve(task.handler), description: task.description };
|
|
183
|
+
if (!task.cron) continue;
|
|
184
|
+
const existing = nitroConfig.scheduledTasks[task.cron];
|
|
185
|
+
nitroConfig.scheduledTasks[task.cron] = [...Array.isArray(existing) ? existing : existing ? [existing] : [], task.name];
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
const crons = tasks.map((task) => task.cron).filter((cron) => !!cron);
|
|
189
|
+
if (crons.length) {
|
|
190
|
+
nuxt.hook("nitro:init", (nitro) => {
|
|
191
|
+
if (!nitro.options.preset.startsWith("cloudflare")) return;
|
|
192
|
+
const wrangler = (nitro.options.cloudflare ||= {}).wrangler ||= {};
|
|
193
|
+
wrangler.triggers = { ...wrangler.triggers, crons: [.../* @__PURE__ */ new Set([...wrangler.triggers?.crons ?? [], ...crons])] };
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
addImports([
|
|
197
|
+
{ name: "useShiftsLinks", from: resolver.resolve("./runtime/app/composables/useShiftsLinks") },
|
|
198
|
+
{ name: "useShiftsTranslate", from: resolver.resolve("./runtime/app/composables/useShiftsTranslate") },
|
|
199
|
+
{ name: "useShiftsFormat", from: resolver.resolve("./runtime/app/composables/useShiftsFormat") },
|
|
200
|
+
{ name: "useShiftsActions", from: resolver.resolve("./runtime/app/composables/useShiftsActions") },
|
|
201
|
+
{ name: "useShiftsVenueFeatures", from: resolver.resolve("./runtime/app/composables/useShiftsVenueFeatures") },
|
|
202
|
+
{ name: "SHIFTS_NO_FEATURE", from: resolver.resolve("./runtime/app/composables/useShiftsVenueFeatures") }
|
|
203
|
+
]);
|
|
204
|
+
addComponentsDir({ path: resolver.resolve("./runtime/app/components") });
|
|
205
|
+
addModulePages(MODULE_NAME, resolver, [
|
|
206
|
+
{ name: "shifts-mine", path: shiftsPath, file: "./runtime/app/pages/shifts.vue" },
|
|
207
|
+
// The swaps page before the detail page: `/shifts/swaps` is not an assignment id.
|
|
208
|
+
{ name: "shifts-swaps", path: swapsPath, file: "./runtime/app/pages/swaps.vue" },
|
|
209
|
+
{ name: "shifts-check-in", path: checkInPath, file: "./runtime/app/pages/check-in.vue" },
|
|
210
|
+
{ name: "shifts-lead", path: leadPath, file: "./runtime/app/pages/lead.vue" },
|
|
211
|
+
// Before the detail page: `/shifts/station/:stationId` has two segments after `/shifts`.
|
|
212
|
+
{ name: "shifts-station", path: stationPath, file: "./runtime/app/pages/station.vue" },
|
|
213
|
+
{ name: "shifts-shift", path: shiftPath, file: "./runtime/app/pages/shift.vue" }
|
|
214
|
+
]);
|
|
215
|
+
extendMaps(nuxt, {
|
|
216
|
+
layers: [defineMapLayer({
|
|
217
|
+
id: "shifts.on-duty",
|
|
218
|
+
label: { da: "P\xE5 vagt nu", en: "On duty now" },
|
|
219
|
+
appliesTo: OPERATIONS_VENUE_SURFACE,
|
|
220
|
+
endpoint: "/api/shifts/operations/:operationId/on-duty",
|
|
221
|
+
permission: shiftsAccess.permissions.read,
|
|
222
|
+
refreshInterval: 120
|
|
223
|
+
})]
|
|
224
|
+
});
|
|
225
|
+
if (settings.operationsTab !== false && hasNuxtModule("@frigear-nu/widget") && hasNuxtModule("@frigear-nu/admin")) {
|
|
226
|
+
const { extendTabs } = await import('@frigear-nu/widget/utils');
|
|
227
|
+
extendTabs(nuxt, "admin.operations", {
|
|
228
|
+
id: "shifts",
|
|
229
|
+
component: resolver.resolve("./runtime/app/tabs/Shifts.vue"),
|
|
230
|
+
order: 30,
|
|
231
|
+
label: "Shifts",
|
|
232
|
+
labelKey: "shifts.admin.tabs.shifts",
|
|
233
|
+
icon: "i-lucide-calendar-clock",
|
|
234
|
+
permission: shiftsAccess.permissions.manage
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
if (crewHome && hasNuxtModule("@frigear-nu/widget")) {
|
|
238
|
+
const { extendTabs } = await import('@frigear-nu/widget/utils');
|
|
239
|
+
extendTabs(nuxt, "crew.dashboard", [
|
|
240
|
+
...shiftsSetting === false ? [] : [{ id: SHIFTS_HOME_TAB.shifts, component: resolver.resolve("./runtime/app/tabs/HomeShifts.vue"), order: 20, label: "My shifts", labelKey: "shifts.home.tabs.shifts", icon: "i-lucide-calendar-clock", permission: shiftsAccess.permissions.read }],
|
|
241
|
+
...swapsSetting === false ? [] : [{ id: SHIFTS_HOME_TAB.swaps, component: resolver.resolve("./runtime/app/tabs/HomeSwaps.vue"), order: 30, label: "Swaps", labelKey: "shifts.home.tabs.swaps", icon: "i-lucide-arrow-left-right", permission: shiftsAccess.permissions.swap }]
|
|
242
|
+
]);
|
|
243
|
+
}
|
|
244
|
+
if (tabsOnly && crewHome) {
|
|
245
|
+
const pages = { home: crewHome };
|
|
246
|
+
addPageRedirects(nuxt, {
|
|
247
|
+
...shiftsSetting === true ? { [SHIFTS_DEFAULT_PAGES.shifts]: shiftsMinePath(pages) } : {},
|
|
248
|
+
...swapsSetting === true ? { [SHIFTS_DEFAULT_PAGES.swaps]: shiftsSwapsPath(pages) } : {}
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
if (shiftsPath && hasNuxtModule("@frigear-nu/mobile")) {
|
|
252
|
+
const { extendMobileTabs } = await import('@frigear-nu/mobile/utils');
|
|
253
|
+
extendMobileTabs(nuxt, {
|
|
254
|
+
id: "shifts",
|
|
255
|
+
to: shiftsPath,
|
|
256
|
+
label: "Shifts",
|
|
257
|
+
labelKey: "shifts.mobile.tab",
|
|
258
|
+
icon: "i-lucide-calendar-clock",
|
|
259
|
+
sfSymbol: "calendar",
|
|
260
|
+
sfSymbolActive: "calendar.circle.fill",
|
|
261
|
+
requiresAuth: true
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
extendNotificationTopics(nuxt, shiftsNotificationTopics);
|
|
265
|
+
if (hasNuxtModule("@frigear-nu/dashboard")) {
|
|
266
|
+
const { extendDashboard } = await import('@frigear-nu/dashboard/utils');
|
|
267
|
+
extendDashboard(nuxt, SHIFTS_DASHBOARD, shiftsDashboardItems((path) => resolver.resolve(path)));
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
export { module$1 as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const shiftsAccess: import("@frigear-nu/auth/access").Access<"shifts", "read" | "swap" | "lead" | "attend" | "feed" | "broadcast" | "manage" | "pii", "shifts", never>;
|
|
2
|
+
export declare const perksAccess: import("@frigear-nu/auth/access").Access<"perks", "perks:read" | "perks:claim", "perks", never>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { defineAccess } from "@frigear-nu/auth/access";
|
|
2
|
+
export const shiftsAccess = defineAccess("shifts", {
|
|
3
|
+
permissions: {
|
|
4
|
+
// Held by everyone, narrowed by the policy: your own shifts, the operations you take part in, the teams you lead, staff.
|
|
5
|
+
read: {
|
|
6
|
+
label: "Read shifts",
|
|
7
|
+
description: "See your own shifts, and who is on shift now in the operations you work at.",
|
|
8
|
+
implicit: true
|
|
9
|
+
},
|
|
10
|
+
// Held by everyone, narrowed by the policy to the person's own assignments.
|
|
11
|
+
swap: {
|
|
12
|
+
label: "Swap shifts",
|
|
13
|
+
description: "Offer your own shifts for a swap, and offer to take other people's.",
|
|
14
|
+
implicit: true
|
|
15
|
+
},
|
|
16
|
+
// Held by everyone, narrowed by the policy to the leads of the record's team (lead role and up) and staff.
|
|
17
|
+
lead: {
|
|
18
|
+
label: "Lead shifts",
|
|
19
|
+
description: "Check people in, mark attendance and approve swaps on the teams you lead.",
|
|
20
|
+
implicit: true
|
|
21
|
+
},
|
|
22
|
+
// Held by everyone, narrowed by the policy to the person's own assignments: checking in at a station or by location.
|
|
23
|
+
attend: {
|
|
24
|
+
label: "Check in on your shifts",
|
|
25
|
+
description: "Check in on your own shifts by scanning a station's code or by your location.",
|
|
26
|
+
implicit: true
|
|
27
|
+
},
|
|
28
|
+
// Held by everyone, but only through a signed-in session: the calendar feed URL is a secret that shows your shifts to
|
|
29
|
+
// whoever holds it, so a token (or an OAuth client) cannot mint or revoke one.
|
|
30
|
+
feed: {
|
|
31
|
+
label: "Subscribe to your shifts in a calendar",
|
|
32
|
+
description: "Create and revoke the secret calendar feed (iCal) of your own shifts.",
|
|
33
|
+
implicit: true,
|
|
34
|
+
sessionOnly: true
|
|
35
|
+
},
|
|
36
|
+
// Messages people by email and SMS; leads send to their own team through `shifts:lead` instead.
|
|
37
|
+
broadcast: {
|
|
38
|
+
label: "Message shift teams",
|
|
39
|
+
description: "Send an email (and an SMS, on purpose) to the members of an operation's teams or the people on a shift.",
|
|
40
|
+
grantTo: ["admin"]
|
|
41
|
+
},
|
|
42
|
+
manage: {
|
|
43
|
+
label: "Manage shifts",
|
|
44
|
+
description: "Create and publish schedules, create shifts in bulk, assign people and handle every swap.",
|
|
45
|
+
grantTo: ["admin"]
|
|
46
|
+
},
|
|
47
|
+
// Sensitive (`:pii`): never covered by `shifts:*` or `*`, only granted by name.
|
|
48
|
+
pii: {
|
|
49
|
+
label: "See the contact details of people on shift",
|
|
50
|
+
description: "See the email address and phone number of the people on a shift.",
|
|
51
|
+
grantTo: ["admin"]
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
scopes: {
|
|
55
|
+
shifts: {
|
|
56
|
+
label: "Shifts",
|
|
57
|
+
description: "See your own shifts.",
|
|
58
|
+
icon: "i-lucide-calendar-clock",
|
|
59
|
+
permissions: ["shifts:read"]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
export const perksAccess = defineAccess("perks", {
|
|
64
|
+
permissions: {
|
|
65
|
+
"perks:read": {
|
|
66
|
+
label: "Read your perks",
|
|
67
|
+
description: "See the perks you earned on your shifts.",
|
|
68
|
+
implicit: true
|
|
69
|
+
},
|
|
70
|
+
"perks:claim": {
|
|
71
|
+
label: "Claim your perks",
|
|
72
|
+
description: "Mark the perks you earned as claimed, so an app can hand them out.",
|
|
73
|
+
implicit: true
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
scopes: {
|
|
77
|
+
perks: {
|
|
78
|
+
label: "Perks",
|
|
79
|
+
description: "See and claim the perks you earned on your shifts.",
|
|
80
|
+
icon: "i-lucide-ticket",
|
|
81
|
+
permissions: ["perks:read", "perks:claim"]
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ShiftsLadder, ShiftsTeamOption } from '../utils/admin-shifts.js';
|
|
2
|
+
import type { ShiftBroadcastResultDto } from '../../../types.js';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
/** Staff: the operation to message. */
|
|
5
|
+
operationId?: string;
|
|
6
|
+
/** A lead: the team to message. */
|
|
7
|
+
teamId?: string;
|
|
8
|
+
/** The name of the team a lead messages. */
|
|
9
|
+
teamName?: string;
|
|
10
|
+
teams?: ShiftsTeamOption[];
|
|
11
|
+
ladders?: ShiftsLadder[];
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
+
close: (sent: false | ShiftBroadcastResultDto) => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
onClose?: ((sent: false | ShiftBroadcastResultDto) => any) | undefined;
|
|
17
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const _default: typeof __VLS_export;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { shiftsRoleOptions } from "../utils/admin-shifts";
|
|
4
|
+
import { shiftsApi } from "../../utils/api";
|
|
5
|
+
import { $fetch, computed, reactive, useAction, useModuleT, useShiftsTranslate, useToast } from "#imports";
|
|
6
|
+
defineOptions({ name: "ShiftBroadcastSlideover" });
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
operationId: { type: String, required: false },
|
|
9
|
+
teamId: { type: String, required: false },
|
|
10
|
+
teamName: { type: String, required: false },
|
|
11
|
+
teams: { type: Array, required: false },
|
|
12
|
+
ladders: { type: Array, required: false }
|
|
13
|
+
});
|
|
14
|
+
const emit = defineEmits(["close"]);
|
|
15
|
+
const t = useModuleT("shifts");
|
|
16
|
+
const tr = useShiftsTranslate();
|
|
17
|
+
const { busy, run } = useAction();
|
|
18
|
+
const ALL = "__all__";
|
|
19
|
+
const ANY = "__any__";
|
|
20
|
+
const filled = (value) => !!value && (typeof value === "string" ? !!value.trim() : Object.values(value).some((text) => text?.trim()));
|
|
21
|
+
const schema = z.object({
|
|
22
|
+
teamId: z.string(),
|
|
23
|
+
teamRole: z.string(),
|
|
24
|
+
subject: z.custom(filled, t("broadcast.subjectRequired", "Give the message a subject.")),
|
|
25
|
+
message: z.custom(filled, t("broadcast.messageRequired", "Write the message.")),
|
|
26
|
+
sms: z.boolean()
|
|
27
|
+
});
|
|
28
|
+
const state = reactive({ teamId: ALL, teamRole: ANY, subject: "", message: "", sms: false });
|
|
29
|
+
const teamOptions = computed(() => [{ label: t("admin.allTeams", "All teams"), value: ALL }, ...(props.teams ?? []).map((team) => ({ label: tr(team.name), value: team.id }))]);
|
|
30
|
+
const kind = computed(() => props.teams?.find((team) => team.id === state.teamId)?.kind);
|
|
31
|
+
const roleOptions = computed(() => [{ label: t("broadcast.anyRole", "Everyone on the team"), value: ANY }, ...shiftsRoleOptions(props.ladders, kind.value, tr)]);
|
|
32
|
+
const audienceHelp = computed(() => props.teamId ? t("broadcast.leadAudience", "Everyone on {team}.", { team: props.teamName ?? "" }) : t("broadcast.audienceHelp", "The active members of the operation's teams. At most 500 people at once."));
|
|
33
|
+
async function send(event) {
|
|
34
|
+
const { data } = event;
|
|
35
|
+
const channels = data.sms ? ["email", "sms"] : ["email"];
|
|
36
|
+
const body = props.teamId ? { audience: {}, channels, subject: data.subject, message: data.message } : {
|
|
37
|
+
operationId: props.operationId,
|
|
38
|
+
audience: { ...data.teamId === ALL ? {} : { teamId: data.teamId }, ...data.teamId !== ALL && data.teamRole !== ANY ? { teamRole: data.teamRole } : {} },
|
|
39
|
+
channels,
|
|
40
|
+
subject: data.subject,
|
|
41
|
+
message: data.message
|
|
42
|
+
};
|
|
43
|
+
const sent = await run(
|
|
44
|
+
() => $fetch(props.teamId ? shiftsApi.teams.broadcasts(props.teamId) : shiftsApi.admin.broadcasts, { method: "POST", body }),
|
|
45
|
+
{ error: t("broadcast.failed", "Could not send the message") }
|
|
46
|
+
);
|
|
47
|
+
if (sent) {
|
|
48
|
+
notifySent(sent);
|
|
49
|
+
emit("close", sent);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const toast = useToast();
|
|
53
|
+
function notifySent(sent) {
|
|
54
|
+
toast.add({
|
|
55
|
+
title: sent.delivery === "queued" ? t("broadcast.queued", "Sending to {count} people", { count: sent.recipientCount }) : t("broadcast.sent", "Sent to {count} people", { count: sent.recipientCount }),
|
|
56
|
+
description: sent.delivery === "queued" ? t("broadcast.queuedDetail", "The messages go out in the background.") : sent.sent.sms ? t("broadcast.sentDetail", "{email} emails and {sms} texts.", { email: sent.sent.email, sms: sent.sent.sms }) : t("broadcast.sentEmails", "{email} emails.", { email: sent.sent.email }),
|
|
57
|
+
color: "success"
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
<template>
|
|
63
|
+
<FormSlideover
|
|
64
|
+
form-id="shift-broadcast-form"
|
|
65
|
+
:title="teamId ? t('broadcast.leadTitle', 'Message {team}', { team: teamName ?? '' }) : t('broadcast.title', 'Message teams')"
|
|
66
|
+
:description="audienceHelp"
|
|
67
|
+
:submit-label="t('broadcast.submit', 'Send message')"
|
|
68
|
+
:loading="busy"
|
|
69
|
+
@close="emit('close', false)"
|
|
70
|
+
>
|
|
71
|
+
<UForm
|
|
72
|
+
id="shift-broadcast-form"
|
|
73
|
+
:schema="schema"
|
|
74
|
+
:state="state"
|
|
75
|
+
class="flex flex-col gap-4"
|
|
76
|
+
@submit="send"
|
|
77
|
+
>
|
|
78
|
+
<template v-if="!teamId">
|
|
79
|
+
<UFormField
|
|
80
|
+
name="teamId"
|
|
81
|
+
:label="t('admin.team', 'Team')"
|
|
82
|
+
>
|
|
83
|
+
<USelect
|
|
84
|
+
v-model="state.teamId"
|
|
85
|
+
:items="teamOptions"
|
|
86
|
+
class="w-full"
|
|
87
|
+
/>
|
|
88
|
+
</UFormField>
|
|
89
|
+
<UFormField
|
|
90
|
+
v-if="state.teamId !== ALL"
|
|
91
|
+
name="teamRole"
|
|
92
|
+
:label="t('broadcast.role', 'Role')"
|
|
93
|
+
:description="t('broadcast.roleHelp', 'This role and everyone above it on the team\'s ladder.')"
|
|
94
|
+
>
|
|
95
|
+
<USelect
|
|
96
|
+
v-model="state.teamRole"
|
|
97
|
+
:items="roleOptions"
|
|
98
|
+
class="w-full"
|
|
99
|
+
/>
|
|
100
|
+
</UFormField>
|
|
101
|
+
</template>
|
|
102
|
+
<UFormField
|
|
103
|
+
name="subject"
|
|
104
|
+
:label="t('broadcast.subject', 'Subject')"
|
|
105
|
+
required
|
|
106
|
+
>
|
|
107
|
+
<TranslatedInput
|
|
108
|
+
v-model="state.subject"
|
|
109
|
+
class="w-full"
|
|
110
|
+
/>
|
|
111
|
+
</UFormField>
|
|
112
|
+
<UFormField
|
|
113
|
+
name="message"
|
|
114
|
+
:label="t('broadcast.message', 'Message')"
|
|
115
|
+
:description="t('broadcast.messageHelp', 'Each person gets the text in their own language when you write it in several.')"
|
|
116
|
+
required
|
|
117
|
+
>
|
|
118
|
+
<TranslatedInput
|
|
119
|
+
v-model="state.message"
|
|
120
|
+
multiline
|
|
121
|
+
:preview="false"
|
|
122
|
+
:rows="5"
|
|
123
|
+
class="w-full"
|
|
124
|
+
/>
|
|
125
|
+
</UFormField>
|
|
126
|
+
<UFormField
|
|
127
|
+
name="sms"
|
|
128
|
+
:label="t('broadcast.sms', 'Also send a text message')"
|
|
129
|
+
>
|
|
130
|
+
<USwitch v-model="state.sms" />
|
|
131
|
+
</UFormField>
|
|
132
|
+
<UAlert
|
|
133
|
+
v-if="state.sms"
|
|
134
|
+
color="warning"
|
|
135
|
+
variant="subtle"
|
|
136
|
+
icon="i-lucide-coins"
|
|
137
|
+
:title="t('broadcast.smsCost', 'Texts cost money')"
|
|
138
|
+
:description="t('broadcast.smsWarning', 'Everyone with a phone number gets a text as well as the email. Use it when people need to know right now.')"
|
|
139
|
+
/>
|
|
140
|
+
</UForm>
|
|
141
|
+
</FormSlideover>
|
|
142
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ShiftsLadder, ShiftsTeamOption } from '../utils/admin-shifts.js';
|
|
2
|
+
import type { ShiftBroadcastResultDto } from '../../../types.js';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
/** Staff: the operation to message. */
|
|
5
|
+
operationId?: string;
|
|
6
|
+
/** A lead: the team to message. */
|
|
7
|
+
teamId?: string;
|
|
8
|
+
/** The name of the team a lead messages. */
|
|
9
|
+
teamName?: string;
|
|
10
|
+
teams?: ShiftsTeamOption[];
|
|
11
|
+
ladders?: ShiftsLadder[];
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
+
close: (sent: false | ShiftBroadcastResultDto) => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
onClose?: ((sent: false | ShiftBroadcastResultDto) => any) | undefined;
|
|
17
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const _default: typeof __VLS_export;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ShiftsLadder, ShiftsTeamOption } from '../utils/admin-shifts.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
operationId: string;
|
|
4
|
+
teams: ShiftsTeamOption[];
|
|
5
|
+
ladders: ShiftsLadder[];
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { shiftsRoleLabel } from "../utils/admin-shifts";
|
|
3
|
+
import { shiftsApi } from "../../utils/api";
|
|
4
|
+
import { computed, h, resolveComponent, tableUi, useFetch, useModuleT, useShiftsActions, useShiftsFormat, useShiftsTranslate } from "#imports";
|
|
5
|
+
defineOptions({ name: "ShiftBroadcastsCard" });
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
operationId: { type: String, required: true },
|
|
8
|
+
teams: { type: Array, required: true },
|
|
9
|
+
ladders: { type: Array, required: true }
|
|
10
|
+
});
|
|
11
|
+
const t = useModuleT("shifts");
|
|
12
|
+
const tr = useShiftsTranslate();
|
|
13
|
+
const format = useShiftsFormat();
|
|
14
|
+
const actions = useShiftsActions();
|
|
15
|
+
const { data: broadcasts, status, error, refresh } = await useFetch(shiftsApi.admin.broadcasts, {
|
|
16
|
+
query: computed(() => ({ operationId: props.operationId })),
|
|
17
|
+
key: computed(() => `shifts:broadcasts:${props.operationId}`),
|
|
18
|
+
default: () => []
|
|
19
|
+
});
|
|
20
|
+
const allowed = computed(() => error.value?.statusCode !== 403);
|
|
21
|
+
async function send() {
|
|
22
|
+
if (await actions.broadcast(props.operationId, { teams: props.teams, ladders: props.ladders })) await refresh();
|
|
23
|
+
}
|
|
24
|
+
const StatusBadge = resolveComponent("StatusBadge");
|
|
25
|
+
const audience = (item) => {
|
|
26
|
+
if (item.shiftId) return t("broadcast.audienceShift", "People on a shift");
|
|
27
|
+
const team = item.teamId ? props.teams.find((candidate) => candidate.id === item.teamId) : void 0;
|
|
28
|
+
const base = team ? tr(team.name) : t("admin.allTeams", "All teams");
|
|
29
|
+
return item.teamRole ? `${base} \xB7 ${shiftsRoleLabel(props.ladders, team?.kind, item.teamRole, tr)}+` : base;
|
|
30
|
+
};
|
|
31
|
+
const columns = computed(() => [
|
|
32
|
+
{ accessorKey: "createdAt", header: t("broadcast.when", "Sent"), cell: ({ row }) => h("span", { class: "tabular-nums" }, format.dateTime(row.original.createdAt)) },
|
|
33
|
+
{ accessorKey: "subject", header: t("broadcast.subject", "Subject"), cell: ({ row }) => h("span", { class: "text-highlighted font-medium" }, tr(row.original.subject)) },
|
|
34
|
+
{ id: "audience", header: t("broadcast.audience", "To"), cell: ({ row }) => audience(row.original) },
|
|
35
|
+
{ accessorKey: "recipientCount", header: t("broadcast.recipients", "People"), cell: ({ row }) => String(row.original.recipientCount) },
|
|
36
|
+
{
|
|
37
|
+
id: "channels",
|
|
38
|
+
header: t("broadcast.channels", "Sent by"),
|
|
39
|
+
cell: ({ row }) => h("div", { class: "flex gap-1" }, row.original.channels.map((channel) => h(StatusBadge, { key: channel, status: channel, label: channel === "sms" ? t("broadcast.channelSms", "Text") : t("broadcast.channelEmail", "Email"), colors: { email: "neutral", sms: "warning" } })))
|
|
40
|
+
}
|
|
41
|
+
]);
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<template>
|
|
45
|
+
<TableCard
|
|
46
|
+
v-if="allowed"
|
|
47
|
+
:title="t('broadcast.cardTitle', 'Messages')"
|
|
48
|
+
:description="t('broadcast.cardDescription', 'Emails to the people on the operation\'s teams. A text message is sent only when you ask for it.')"
|
|
49
|
+
:loading="status === 'pending' && !broadcasts.length"
|
|
50
|
+
>
|
|
51
|
+
<template #actions>
|
|
52
|
+
<UButton
|
|
53
|
+
icon="i-lucide-send"
|
|
54
|
+
:label="t('broadcast.title', 'Message teams')"
|
|
55
|
+
:disabled="!teams.length"
|
|
56
|
+
@click="send"
|
|
57
|
+
/>
|
|
58
|
+
</template>
|
|
59
|
+
<UTable
|
|
60
|
+
:data="broadcasts"
|
|
61
|
+
:columns="columns"
|
|
62
|
+
:ui="tableUi()"
|
|
63
|
+
>
|
|
64
|
+
<template #empty>
|
|
65
|
+
<UEmpty
|
|
66
|
+
icon="i-lucide-megaphone"
|
|
67
|
+
:title="t('broadcast.empty', 'No messages sent yet')"
|
|
68
|
+
:description="t('broadcast.emptyDescription', 'Message a team, or the people with a role and up on it.')"
|
|
69
|
+
:actions="[{ label: t('broadcast.title', 'Message teams'), icon: 'i-lucide-send', onClick: send }]"
|
|
70
|
+
/>
|
|
71
|
+
</template>
|
|
72
|
+
</UTable>
|
|
73
|
+
</TableCard>
|
|
74
|
+
</template>
|