Skip to content

Commit 847dd0e

Browse files
committed
#4032 simplified modal notif + added popup visual
1 parent 2e5f292 commit 847dd0e

2 files changed

Lines changed: 20 additions & 11 deletions

File tree

src/frontend/src/pages/CalendarPage/Components/EventModal.tsx

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,30 +1160,36 @@ const EventModal: React.FC<BaseEventModalProps> = ({
11601160
{/* Notification Section */}
11611161
{selectedEventType && (
11621162
<Box sx={{ display: 'flex', alignItems: 'center', gap: 2 }}>
1163-
<NotificationsIcon
1164-
sx={{ color: selectedEventType.sendSlackNotifications ? 'text.secondary' : 'text.disabled' }}
1165-
/>
1163+
<NotificationsIcon sx={{ color: 'text.secondary' }} />
11661164
<Tooltip
11671165
arrow
11681166
placement="right"
11691167
title={
11701168
!selectedEventType.sendSlackNotifications
11711169
? 'Slack notifications are disabled for this event type.'
1172-
: !selectedTeams.length && !workPackageIds.length
1173-
? ''
1174-
: 'Slack notifications will be sent for this event.'
1170+
: selectedTeams.length || workPackageIds.length
1171+
? 'Slack notifications will be sent for this event.'
1172+
: ''
11751173
}
11761174
>
11771175
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1, cursor: 'default' }}>
1178-
<NERSwitch checked={selectedEventType.sendSlackNotifications} disabled />
1179-
{selectedEventType.sendSlackNotifications && !selectedTeams.length && !workPackageIds.length ? (
1176+
<Typography variant="body2" color={'text.disabled'} fontWeight={500}>
1177+
{selectedEventType.sendSlackNotifications ? 'On' : 'Off'}
1178+
</Typography>
1179+
{selectedEventType.sendSlackNotifications && !selectedTeams.length && !workPackageIds.length && (
11801180
<Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}>
11811181
<WarningAmberIcon sx={{ color: 'error.main', fontSize: 18 }} />
11821182
<Typography variant="body2" color="error.main">
1183-
Add a team or work package to send notifications
1183+
Add{' '}
1184+
{selectedEventType.teams && selectedEventType.workPackage
1185+
? 'a team or work package'
1186+
: selectedEventType.teams
1187+
? 'a team'
1188+
: 'a work package'}{' '}
1189+
to send notifications
11841190
</Typography>
11851191
</Box>
1186-
) : null}
1192+
)}
11871193
</Box>
11881194
</Tooltip>
11891195
</Box>

src/frontend/src/pages/CalendarPage/EventClickPopup.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import EditEventModal from './Components/EditEventModal';
3939
import DeleteSeriesConfirmationModal from './Components/DeleteSeriesConfirmationModal';
4040
import { useToast } from '../../hooks/toasts.hooks';
4141
import NERDeleteModal from '../../components/NERDeleteModal';
42-
42+
import NotificationsIcon from '@mui/icons-material/Notifications';
4343
import { getPendingReason } from '../../utils/calendar.utils';
4444

4545
export const getStatusIcon = (status: string, isLarge?: boolean) => {
@@ -436,6 +436,9 @@ export const EventClickContent: React.FC<EventClickContentProps> = ({
436436
<Typography variant="body2" sx={{ flex: 1 }}>
437437
<b>Status:</b> {event.status}
438438
</Typography>
439+
{specificEventType?.sendSlackNotifications && (event.teams.length > 0 || event.workPackages.length > 0) && (
440+
<NotificationsIcon sx={{ color: 'white', fontSize: 18, mt: '3px', flexShrink: 0 }} />
441+
)}
439442
</Stack>
440443
)}
441444

0 commit comments

Comments
 (0)