@@ -393,6 +393,7 @@ module openflow {
393393 }
394394
395395 export class MainCtrl extends entitiesCtrl < openflow . Base > {
396+ public showcompleted : boolean = false ;
396397 constructor (
397398 public $scope : ng . IScope ,
398399 public $location : ng . ILocationService ,
@@ -407,14 +408,23 @@ module openflow {
407408 this . collection = "workflow_instances"
408409 // this.basequery = { state: { $ne: "completed" }, $and: [{ form: { $exists: true } }, { form: { "$ne": "none" } }] };
409410 // this.basequery = { state: { $ne: "completed" }, form: { $exists: true } };
410- WebSocketClient . onSignedin ( ( _user : TokenUser ) => {
411+ this . preloadData = ( ) => {
411412 var user = this . WebSocketClient . user ;
412413 var ors : any [ ] = [ ] ;
413414 ors . push ( { targetid : user . _id } ) ;
414415 this . WebSocketClient . user . roles . forEach ( role => {
415416 ors . push ( { targetid : role . _id } ) ;
416417 } ) ;
417- this . basequery = { state : { $ne : "completed" } , form : { $exists : true } , $or : ors } ;
418+ this . basequery = { } ;
419+ this . basequery = { $or : ors } ;
420+ if ( ! this . showcompleted ) {
421+ this . basequery . state = { $ne : "completed" } ;
422+ this . basequery . form = { $exists : true } ;
423+ // this.basequery.$or = ors;
424+ } else {
425+ }
426+ } ;
427+ WebSocketClient . onSignedin ( ( _user : TokenUser ) => {
418428 this . loadData ( ) ;
419429 } ) ;
420430
0 commit comments