Skip to content

Commit

Permalink
Merge pull request #62 from diggyk/master
Browse files Browse the repository at this point in the history
Modify the default search behavior
  • Loading branch information
leojli committed Oct 2, 2015
2 parents 5a0b778 + c7b660b commit 7bb2583
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
11 changes: 6 additions & 5 deletions db/bootstrap.sql
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ UNLOCK TABLES;

LOCK TABLES `fates` WRITE;

INSERT INTO `fates` (`id`, `creation_type_id`, `completion_type_id`, `follows_id`, `description`)
INSERT INTO `fates` (`id`, `creation_type_id`, `completion_type_id`, `follows_id`, `for_creator`, `for_owner`, `description`)
VALUES
(1,1,2,NULL, 'A system that needs a reboot can be cleared by rebooting the machine.'),
(2,3,4,NULL, 'System must be released using "cloudbox release" so maintenance can be carried out.'),
(3,4,5,2, 'Maintenance must be performed on a system that is prepped.'),
(4,1,4,NULL, 'A system that needs a reboot can be released instead.');
(1, 1, 2, NULL, 0, 1, 'A system that needs a reboot can be cleared by rebooting the machine.'),
(2, 3, 4, NULL, 0, 1, 'System must be released using \"cloudbox release\" so maintenance can be carried out.'),
(3, 4, 5, 2, 1, 0, 'Maintenance must be performed on a system that is prepped.'),
(4, 1, 4, NULL, 0, 1, 'A system that needs a reboot can also just be released.');


UNLOCK TABLES;
2 changes: 1 addition & 1 deletion hermes/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.4.10"
__version__ = "0.4.11"
27 changes: 13 additions & 14 deletions hermes/webapp/src/js/controllers/laborStatusCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,33 +42,28 @@
allowInvalid: true
};


if ($routeParams.byQuery) {
vm.queryInput = $routeParams.byQuery;
}

// if user passed a filter-by-owner query param, that takes precedence.
// otherwise, the default is to use the authenticate user
// if user passed a filter-by-owner query param, use it
if ($routeParams.byOwner) {
vm.hostOwnerInput = $routeParams.byOwner;
getOpenLabors("owner");
} else {
}

// if the user went straight to this page without any params, lets
// modify the search to only show their labors
if ($location.path() == "/v1/labors/" && Object.keys($routeParams).length == 0) {
hermesService.getCurrentUser().then(function(user){
if (user) {
vm.hostOwnerInput = user;
}
getOpenLabors();
});
} else {
getOpenLabors();
}

hermesService.getCurrentUser().then(function(user){
if (user) {
vm.user = user;
} else {
vm.errorMessage = "Cannot create a new quest if not authenticated.";
}
});

hermesService.getAllEventTypes().then(function(types) {
var allTypes = [null];
vm.allTypes = allTypes.concat(types);
Expand Down Expand Up @@ -98,7 +93,7 @@
}

function limitValues() {
return ['10', '20', '50', '100'];
return ['10', '20', '50', '100', 'ALL'];
}

function pageSetting(page) {
Expand Down Expand Up @@ -203,11 +198,15 @@
if (vm.hostOwnerInput) {
options['filterByOwner'] = vm.hostOwnerInput;
$location.search('byOwner', vm.hostOwnerInput, false);
} else {
$location.search('byOwner', null, false);
}

if (vm.queryInput) {
options['filterByQuery'] = vm.queryInput;
$location.search('byQuery', vm.queryInput, false);
} else {
$location.search('byQuery', null, false);
}

if (vm.filterEventType) {
Expand Down
2 changes: 1 addition & 1 deletion hermes/webapp/src/js/controllers/questStatusCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
}

function limitValues() {
return ['10', '20', '50', '100'];
return ['10', '20', '50', '100', 'ALL'];
}

function pageSetting(page) {
Expand Down
2 changes: 1 addition & 1 deletion hermes/webapp/src/templates/laborList.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="col-md-3 labor-left-panel">
<div class="labor-left-panel-filter">
<div>
<label for="ownerFilter">Filter by owner:</label>
<label for="ownerFilter">Filter by username:</label>
</div>
<div class="row">
<div class="col-md-10">
Expand Down
2 changes: 1 addition & 1 deletion hermes/webapp/src/templates/questStatus.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<button class="big-wide-button be-positive" style="margin-bottom: 10px;" ng-click="qc.goToCreatePage()">Create Quest</button>
</div>
<div>
<label for="creatorFilter">Filter by Creator</label>
<label for="creatorFilter">Filter by creator's username:</label>
</div>
<div class="row">
<div class="col-md-10">
Expand Down

0 comments on commit 7bb2583

Please sign in to comment.