1919 *
2020 * @typedef Properties
2121 * @type {object }
22+ * @property {Boolean } smtp_configured
2223 * @property {String } event
2324 * @property {NotificationItem[] } items
2425 * @property {Permissions } permissions
@@ -39,8 +40,9 @@ import { Alert } from '../components/alert.js';
3940import { Textarea } from '../components/textarea.js' ;
4041import { Icon } from '../components/icon.js' ;
4142import { TruncatedText } from '../components/truncated_text.js' ;
42- import { Input } from "../components/input.js" ;
43- import { numberBetween } from "../form_validators.js" ;
43+ import { Input } from '../components/input.js' ;
44+ import { numberBetween } from '../form_validators.js' ;
45+ import { EmptyState , EMPTY_STATE_MESSAGE } from '../components/empty_state.js' ;
4446
4547const minHeight = 500 ;
4648const { div, span, b } = van . tags ;
@@ -49,6 +51,20 @@ const NotificationSettings = (/** @type Properties */ props) => {
4951 loadStylesheet ( 'notification-settings' , stylesheet ) ;
5052 window . testgen . isPage = true ;
5153
54+ if ( ! getValue ( props . smtp_configured ) ) {
55+ Streamlit . setFrameHeight ( 400 ) ;
56+ return EmptyState ( {
57+ label : 'Email server not configured.' ,
58+ message : EMPTY_STATE_MESSAGE . notifications ,
59+ class : 'notifications--empty' ,
60+ link : {
61+ label : 'View documentation' ,
62+ href : 'https://docs.datakitchen.io/articles/dataops-testgen-help/configure-email-server' ,
63+ open_new : true ,
64+ } ,
65+ } ) ;
66+ }
67+
5268 const nsItems = van . derive ( ( ) => {
5369 const items = getValue ( props . items ) ;
5470 Streamlit . setFrameHeight ( Math . max ( minHeight , 70 * items . length || 150 ) ) ;
@@ -329,6 +345,9 @@ const NotificationSettings = (/** @type Properties */ props) => {
329345
330346const stylesheet = new CSSStyleSheet ( ) ;
331347stylesheet . replace ( `
348+ .notifications--empty.tg-empty-state {
349+ margin-top: 0;
350+ }
332351.notifications--editing-row {
333352 background-color: var(--select-hover-background);
334353}
0 commit comments