@@ -239,9 +239,10 @@ <h2>
239239
240240 } ,
241241 _isSubmitDisabled : function ( ) {
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- console . log ( this . detail . detail_type , this . $ . inputUrl . validate ( ) , ( this . detail . metric_reached > 0 || this . detail . metric_indirect > 0 || this . detail . metric_trained > 0 ) ) ;
244- return ( this . detail . detail_type && this . $ . inputUrl . validate ( ) && ( this . detail . metric_reached > 0 || this . detail . metric_indirect > 0 || this . detail . metric_trained > 0 ) ) ;
242+ return this . detail . detail_type && this . $ . inputUrl . validate ( ) && this . _metricExists ( ) ;
243+ } ,
244+ _metricExists : function ( ) {
245+ return [ this . detail . metric_reached , this . detail . metric_indirect , this . detail . metric_trained ] . some ( metric => metric > 0 ) ;
245246 } ,
246247 _initNewActivityDetailIfNeeded : function ( ) {
247248 if ( ! this . detail . url ) {
@@ -252,11 +253,10 @@ <h2>
252253 this . initial_detail_type = i ;
253254 }
254255 }
255- console . debug ( "[experts-activity-detail-create] _initNewActivityDetailIfNeeded " , { detail : this . detail , initial_detail_type : this . initial_detail_type } ) ;
256256 } ,
257257 _initNewActivityDetail : function ( ) {
258258 this . detail = {
259- 'detail_type' : '' ,
259+ 'detail_type' : 'Generic URL ' ,
260260 'url' : '' ,
261261 'metric_reached' : 0 ,
262262 'metric_indirect' : 0 ,
279279 if ( ! this . detail . metric_trained ) {
280280 this . detail . metric_trained = 0 ;
281281 }
282- console . debug ( "[experts-activity-detail-create] _submitActivityDetail " , this . detail ) ;
283282
284283 var request = this . $ . insertActivityDetail ;
285284 request . body = JSON . stringify ( this . detail ) ;
303302 this . close ( ) ;
304303 } ,
305304 _activityLinkSelected : function ( evt , obj ) {
306- console . debug ( "[experts-activity-create] _activityLinkSelected" , obj . item . dataLink ) ;
307305 this . _chosenActivityLink = obj . item . dataLink ;
308306 this . _activateMetrics = true ;
309307 } ,
0 commit comments