@@ -238,9 +238,10 @@ <h2>
238238
239239 } ,
240240 _isSubmitDisabled : function ( ) {
241- console . log ( this . detail . detail_type && this . $ . inputUrl . validate ( ) && ( this . detail . metric_reached > 0 || this . detail . metric_indirect > 0 || this . detail . metric_trained > 0 ) ) ;
242- console . log ( this . detail . detail_type , this . $ . inputUrl . validate ( ) , ( this . detail . metric_reached > 0 || this . detail . metric_indirect > 0 || this . detail . metric_trained > 0 ) ) ;
243- return ( this . detail . detail_type && this . $ . inputUrl . validate ( ) && ( this . detail . metric_reached > 0 || this . detail . metric_indirect > 0 || this . detail . metric_trained > 0 ) ) ;
241+ return this . detail . detail_type && this . $ . inputUrl . validate ( ) && this . _metricExists ( ) ;
242+ } ,
243+ _metricExists : function ( ) {
244+ return [ this . detail . metric_reached , this . detail . metric_indirect , this . detail . metric_trained ] . some ( metric => metric > 0 ) ;
244245 } ,
245246 _initNewActivityDetailIfNeeded : function ( ) {
246247 if ( ! this . detail . url ) {
@@ -251,11 +252,10 @@ <h2>
251252 this . initial_detail_type = i ;
252253 }
253254 }
254- console . debug ( "[experts-activity-detail-create] _initNewActivityDetailIfNeeded " , { detail : this . detail , initial_detail_type : this . initial_detail_type } ) ;
255255 } ,
256256 _initNewActivityDetail : function ( ) {
257257 this . detail = {
258- 'detail_type' : '' ,
258+ 'detail_type' : 'Generic URL ' ,
259259 'url' : '' ,
260260 'metric_reached' : 0 ,
261261 'metric_indirect' : 0 ,
278278 if ( ! this . detail . metric_trained ) {
279279 this . detail . metric_trained = 0 ;
280280 }
281- console . debug ( "[experts-activity-detail-create] _submitActivityDetail " , this . detail ) ;
282281
283282 var request = this . $ . insertActivityDetail ;
284283 request . body = JSON . stringify ( this . detail ) ;
302301 this . close ( ) ;
303302 } ,
304303 _activityLinkSelected : function ( evt , obj ) {
305- console . debug ( "[experts-activity-create] _activityLinkSelected" , obj . item . dataLink ) ;
306304 this . _chosenActivityLink = obj . item . dataLink ;
307305 this . _activateMetrics = true ;
308306 } ,
0 commit comments