@@ -17,6 +17,8 @@ import {
17
17
systemNotificationTemplates ,
18
18
updateNotificationTemplateMethod ,
19
19
} from "api/queries/notifications" ;
20
+ import type { DeploymentValues } from "api/typesGenerated" ;
21
+ import { Alert } from "components/Alert/Alert" ;
20
22
import { displaySuccess } from "components/GlobalSnackbar/utils" ;
21
23
import { Loader } from "components/Loader/Loader" ;
22
24
import { Stack } from "components/Stack/Stack" ;
@@ -149,13 +151,14 @@ export const NotificationsPage: FC = () => {
149
151
{ ready ? (
150
152
tab === "events" ? (
151
153
< EventsView
154
+ templatesByGroup = { templatesByGroup . data }
155
+ deploymentValues = { deploymentValues . config }
152
156
defaultMethod = { castNotificationMethod (
153
157
dispatchMethods . data . default ,
154
158
) }
155
159
availableMethods = { dispatchMethods . data . available . map (
156
160
castNotificationMethod ,
157
161
) }
158
- templatesByGroup = { templatesByGroup . data }
159
162
/>
160
163
) : (
161
164
< OptionsTable
@@ -177,15 +180,33 @@ type EventsViewProps = {
177
180
defaultMethod : NotificationMethod ;
178
181
availableMethods : NotificationMethod [ ] ;
179
182
templatesByGroup : ReturnType < typeof selectTemplatesByGroup > ;
183
+ deploymentValues : DeploymentValues ;
180
184
} ;
181
185
182
186
const EventsView : FC < EventsViewProps > = ( {
183
187
defaultMethod,
184
188
availableMethods,
185
189
templatesByGroup,
190
+ deploymentValues,
186
191
} ) => {
187
192
return (
188
193
< Stack spacing = { 3 } >
194
+ { availableMethods . includes ( "smtp" ) &&
195
+ deploymentValues . notifications ?. webhook . endpoint === "" && (
196
+ < Alert severity = "warning" >
197
+ Webhook notifications are enabled, but no endpoint has been
198
+ configured.
199
+ </ Alert >
200
+ ) }
201
+
202
+ { availableMethods . includes ( "smtp" ) &&
203
+ deploymentValues . notifications ?. email . smarthost === "" && (
204
+ < Alert severity = "warning" >
205
+ SMTP notifications are enabled, but no smart host has been
206
+ configured.
207
+ </ Alert >
208
+ ) }
209
+
189
210
{ Object . entries ( templatesByGroup ) . map ( ( [ group , templates ] ) => (
190
211
< Card
191
212
key = { group }
0 commit comments