File tree Expand file tree Collapse file tree 4 files changed +186
-143
lines changed
plugins/alerts/frontend/public Expand file tree Collapse file tree 4 files changed +186
-143
lines changed Original file line number Diff line number Diff line change 11## Version 25.03.X
22Fixes:
33- [ events] Correctly navigate to event groupmin events menu
4+ - [ alerts] Add alert interval validation in the frontend
45
56Enterprise Fixes:
67- [ concurrent_users] Fix email check for alert
Original file line number Diff line number Diff line change 77 countlyCommon,
88 app,
99 countlyAuth,
10+ countlyPlugins,
1011 CV,
1112 groupsModel,
1213 _,
14+ VeeValidate,
1315 */
1416( function ( ) {
1517 var ALERTS_FEATURE_NAME = "alerts" ;
1618
19+ VeeValidate . extend ( 'alert_interval' , function ( inpValue , args ) {
20+ var min = parseInt ( args [ 0 ] || 0 , 10 ) ;
21+ var max = parseInt ( args [ 1 ] || 60 , 10 ) ;
22+ var valid = parseInt ( inpValue , 10 ) >= min && inpValue <= max ;
23+
24+ if ( valid ) {
25+ return {
26+ valid : valid ,
27+ } ;
28+ }
29+
30+ return 'Alert interval has to be between ' + min + ' and ' + max ;
31+ } ) ;
32+
1733 var AlertDrawer = countlyVue . views . BaseView . extend ( {
1834 template : "#alert-drawer" ,
1935 mixins : [
418434 ) ;
419435 }
420436 return this . emailOptions ;
421- }
437+ } ,
438+ alertIntervalValidationRules : function ( ) {
439+ var rule = 'required' ;
440+
441+ if ( this . $refs . drawerData . editedObject . alertDataType === 'onlineUsers' ) {
442+ var concurrentUserConfig = countlyPlugins . getConfigsData ( ) . concurrent_users || { } ;
443+ var concurrentAlertIntervalMin = concurrentUserConfig . alert_interval || 3 ;
444+ var concurrentAlertIntervalMax = Math . min ( concurrentAlertIntervalMin + 60 , 90 ) ;
445+
446+ rule += '|alert_interval:' + concurrentAlertIntervalMin + ',' + concurrentAlertIntervalMax ;
447+ }
448+
449+ return rule ;
450+ } ,
422451 } ,
423452 props : {
424453 placeholder : { type : String , default : "Select" } ,
Original file line number Diff line number Diff line change 143143 .alert-drawer-trigger-input {
144144 width : 48px ;
145145 }
146+
147+ .is-error {
148+ .alert-drawer-trigger-input {
149+ background-color : #FBECE5 !important ;
150+ }
151+ }
146152
147153 .no-spinner ::-webkit-inner-spin-button ,
148154 .no-spinner ::-webkit-outer-spin-button {
335341 border-radius : 4px ;
336342 background-position : center ;
337343 display : inline-block ;
338- }
344+ }
You can’t perform that action at this time.
0 commit comments