Skip to content

Commit c7439c1

Browse files
committed
Add toggle all on main page
1 parent f555292 commit c7439c1

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

OpenFlow/src/public/Controllers.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

OpenFlow/src/public/Main.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ <h1 translate lib="web">sitename</h1>
77
<div class="input-group-addon"><i class="fas fa-search"></i></div>
88
<input ng-model="ctrl.searchstring" ng-change="ctrl.Search()" class="form-control input-md"
99
ng-model-options="{debounce: 400}" />
10+
<input type="checkbox" class="form-control " ng-model="ctrl.showcompleted" ng-change="ctrl.Search()" />
1011
</div>
1112
</div>
1213
</div>

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.476
1+
0.0.477

0 commit comments

Comments
 (0)