11/**
22 * @import { MonitorSummary } from '/app/static/js/components/monitor_anomalies_summary.js';
33 * @import { CronSample, FilterOption, ProjectSummary } from '../types.js';
4- *
4+ *
55 * @typedef Schedule
66 * @type {object }
77 * @property {boolean } active
88 * @property {string } cron_tz
99 * @property {CronSample } cron_sample
10- *
10+ *
1111 * @typedef Monitor
1212 * @type {object }
1313 * @property {string } table_group_id
3636 * @property {number? } column_adds
3737 * @property {number? } column_drops
3838 * @property {number? } column_mods
39- *
39+ *
4040 * @typedef MonitorList
4141 * @type {object }
4242 * @property {Monitor[] } items
4343 * @property {number } current_page
4444 * @property {number } items_per_page
4545 * @property {number } total_count
46- *
46+ *
4747 * @typedef MonitorListFilters
4848 * @type {object }
4949 * @property {string? } table_group_id
5050 * @property {string? } table_name_filter
5151 * @property {string? } anomaly_type_filter
52- *
52+ *
5353 * @typedef MonitorListSort
5454 * @type {object }
5555 * @property {string? } sort_field
5656 * @property {('asc'|'desc')? } sort_order
57- *
57+ *
5858 * @typedef Permissions
5959 * @type {object }
6060 * @property {boolean } can_edit
@@ -213,17 +213,17 @@ const MonitorsDashboard = (/** @type Properties */ props) => {
213213 class : 'flex-row fx-gap-1 schema-changes' ,
214214 onclick : ( ) => {
215215 const summary = getValue ( props . summary ) ;
216- emit ( 'OpenSchemaChanges' , { payload : {
216+ emit ( 'OpenSchemaChanges' , { payload : {
217217 table_name : monitor . table_name ,
218218 start_time : summary ?. lookback_start ,
219219 end_time : summary ?. lookback_end ,
220220 } } ) ;
221221 } ,
222222 } ,
223- monitor . table_state === 'added'
223+ monitor . table_state === 'added'
224224 ? Icon ( { size : 20 , classes : 'schema-icon' , filled : true } , 'add_box' )
225225 : null ,
226- monitor . table_state === 'dropped'
226+ monitor . table_state === 'dropped'
227227 ? Icon ( { size : 20 , classes : 'schema-icon' , filled : true } , 'indeterminate_check_box' )
228228 : null ,
229229 monitor . column_adds ? div (
@@ -245,7 +245,7 @@ const MonitorsDashboard = (/** @type Properties */ props) => {
245245 {
246246 text : div (
247247 { class : 'flex-column fx-align-flex-start' } ,
248- monitor . table_state === 'added'
248+ monitor . table_state === 'added'
249249 ? span ( { class : 'mb-1' , style : 'font-size: 14px;' } , 'Table added.' )
250250 : null ,
251251 monitor . table_state === 'dropped'
@@ -329,7 +329,7 @@ const MonitorsDashboard = (/** @type Properties */ props) => {
329329 tooltipPosition : 'bottom-left' ,
330330 color : 'basic' ,
331331 type : 'stroked' ,
332- style : 'background: var(--button-generic-background-color);' ,
332+ style : 'background: var(--button-generic-background-color);' ,
333333 onclick : ( ) => emit ( 'EditNotifications' , { } ) ,
334334 } ) ,
335335 Button ( {
@@ -338,7 +338,7 @@ const MonitorsDashboard = (/** @type Properties */ props) => {
338338 tooltipPosition : 'bottom-left' ,
339339 color : 'basic' ,
340340 type : 'stroked' ,
341- style : 'background: var(--button-generic-background-color);' ,
341+ style : 'background: var(--button-generic-background-color);' ,
342342 onclick : ( ) => emit ( 'EditMonitorSettings' , { } ) ,
343343 } ) ,
344344 Button ( {
@@ -517,14 +517,14 @@ const MonitorsDashboard = (/** @type Properties */ props) => {
517517 result : van . derive ( ( ) => getValue ( props . notifications_dialog ) ?. result ) ,
518518 onClose : ( ) => emit ( 'NotificationsDialogClosed' , { } ) ,
519519 } ) ,
520- EditMonitorSettings ( { emit,
520+ EditMonitorSettings ( { emit,
521521 table_group : van . derive ( ( ) => getValue ( props . edit_monitor_settings_dialog ) ?. table_group ) ,
522522 schedule : van . derive ( ( ) => getValue ( props . edit_monitor_settings_dialog ) ?. schedule ) ,
523523 monitor_suite : van . derive ( ( ) => getValue ( props . edit_monitor_settings_dialog ) ?. monitor_suite ) ,
524524 cron_sample : van . derive ( ( ) => getValue ( props . edit_monitor_settings_dialog ) ?. cron_sample ) ,
525525 dialog : van . derive ( ( ) => getValue ( props . edit_monitor_settings_dialog ) ?. dialog ) ,
526526 } ) ,
527- TableMonitoringTrend ( { emit,
527+ TableMonitoringTrend ( { emit,
528528 freshness_events : van . derive ( ( ) => getValue ( props . trends_dialog ) ?. freshness_events ?? [ ] ) ,
529529 volume_events : van . derive ( ( ) => getValue ( props . trends_dialog ) ?. volume_events ?? [ ] ) ,
530530 schema_events : van . derive ( ( ) => getValue ( props . trends_dialog ) ?. schema_events ?? [ ] ) ,
@@ -534,14 +534,14 @@ const MonitorsDashboard = (/** @type Properties */ props) => {
534534 extended_history : van . derive ( ( ) => getValue ( props . trends_dialog ) ?. extended_history ) ,
535535 dialog : van . derive ( ( ) => getValue ( props . trends_dialog ) ?. dialog ) ,
536536 } ) ,
537- EditTableMonitors ( { emit,
537+ EditTableMonitors ( { emit,
538538 table_name : van . derive ( ( ) => getValue ( props . edit_table_monitors_dialog ) ?. table_name ) ,
539539 definitions : van . derive ( ( ) => getValue ( props . edit_table_monitors_dialog ) ?. definitions ?? [ ] ) ,
540540 metric_test_type : van . derive ( ( ) => getValue ( props . edit_table_monitors_dialog ) ?. metric_test_type ) ,
541541 result : van . derive ( ( ) => getValue ( props . edit_table_monitors_dialog ) ?. result ) ,
542542 dialog : van . derive ( ( ) => getValue ( props . edit_table_monitors_dialog ) ?. dialog ) ,
543543 } ) ,
544- SchemaChangesDialog ( { emit,
544+ SchemaChangesDialog ( { emit,
545545 window_start : van . derive ( ( ) => getValue ( props . schema_changes_dialog ) ?. window_start ) ,
546546 window_end : van . derive ( ( ) => getValue ( props . schema_changes_dialog ) ?. window_end ) ,
547547 data_structure_logs : van . derive ( ( ) => getValue ( props . schema_changes_dialog ) ?. data_structure_logs ) ,
@@ -568,9 +568,6 @@ const AnomalyTag = (anomalies, errorMessage = null, isTraining = false, isPendin
568568
569569 const hasErrors = ! ! errorMessage ;
570570 const content = van . derive ( ( ) => {
571- if ( anomalies > 0 ) {
572- return span ( anomalies ) ;
573- }
574571 if ( hasErrors ) {
575572 return withTooltip (
576573 i ( { class : 'material-symbols-rounded' } , 'warning' ) ,
@@ -584,6 +581,9 @@ const AnomalyTag = (anomalies, errorMessage = null, isTraining = false, isPendin
584581 } ,
585582 ) ;
586583 }
584+ if ( anomalies > 0 ) {
585+ return span ( anomalies ) ;
586+ }
587587 if ( isTraining ) {
588588 return withTooltip (
589589 i ( { class : 'material-symbols-rounded' } , 'more_horiz' ) ,
@@ -597,7 +597,7 @@ const AnomalyTag = (anomalies, errorMessage = null, isTraining = false, isPendin
597597 { class : `anomaly-tag-wrapper flex-row p-1 ${ onClick ? 'clickable' : '' } ` , onclick : onClick } ,
598598 div (
599599 {
600- class : `anomaly-tag ${ anomalies > 0 ? 'has-anomalies ' : '' } ${ hasErrors ? 'has-errors ' : '' } ${ isTraining ? 'is-training' : '' } ` ,
600+ class : `anomaly-tag ${ hasErrors ? 'has-errors ' : anomalies > 0 ? 'has-anomalies ' : '' } ${ isTraining ? 'is-training' : '' } ` ,
601601 } ,
602602 content ,
603603 ) ,
@@ -646,8 +646,8 @@ const ConditionalEmptyState = (projectSummary, userCanEdit, emit) => {
646646 } ,
647647 } ;
648648 }
649-
650- return EmptyState ( { emit,
649+
650+ return EmptyState ( { emit,
651651 icon : 'apps_outage' ,
652652 ...args ,
653653 } ) ;
0 commit comments