Skip to content

Commit

Permalink
Merge pull request #415 from khoa-nd/master
Browse files Browse the repository at this point in the history
Merged
  • Loading branch information
khoa-nd committed Sep 17, 2015
2 parents 0102ee7 + d75f259 commit 4ea3378
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
import org.dozer.Mapper;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.search.SearchType;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.FilterBuilders;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.index.query.QueryStringQueryBuilder;
import org.elasticsearch.index.query.*;
import org.elasticsearch.search.aggregations.Aggregations;
import org.elasticsearch.search.aggregations.metrics.sum.Sum;
import org.elasticsearch.search.aggregations.metrics.sum.SumBuilder;
Expand Down Expand Up @@ -420,9 +417,9 @@ public Collection<ChallengeDetailDto> findByOwnerAndCondition(String owner,
}

public List<ChallengeDetailDto> listChallenges(String ownerEmail) {
BoolQueryBuilder query = QueryBuilders.boolQuery().must(QueryBuilders.queryStringQuery(ownerEmail).defaultField("authorEmail"))
.mustNot(QueryBuilders.termQuery("expired", Boolean.TRUE));
Iterable<ChallengeEntity> challenges = challengeRepository.search(query);
MatchQueryBuilder authorEmailQuery = QueryBuilders.matchQuery("authorEmail", ownerEmail).minimumShouldMatch("100%");
TermQueryBuilder notExpiredQuery = QueryBuilders.termQuery("expired", Boolean.TRUE);
Iterable<ChallengeEntity> challenges = challengeRepository.search(QueryBuilders.boolQuery().must(authorEmailQuery).mustNot(notExpiredQuery));
ArrayList<ChallengeDetailDto> dtos = new ArrayList<>();
challenges.forEach(challengeEntity -> {
ChallengeDetailDto challengeDetailDto = dozerMapper.map(challengeEntity, ChallengeDetailDto.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
techlooper.controller('employerDashboardController', function ($scope, jsonValue, utils, apiService, $location, $filter) {
techlooper.controller('employerDashboardController', function ($scope, jsonValue, utils, apiService, $location, $filter, $rootScope) {

utils.sendNotification(jsonValue.notifications.loading, $(window).height());
var sortByStartDate = function (left, right) {
Expand Down Expand Up @@ -77,8 +77,9 @@ techlooper.controller('employerDashboardController', function ($scope, jsonValue
if (index < 0) {
return;
}
$scope.dashboardInfo.challenges.splice(index, 1);
if (!$scope.filterChallenges().length) $scope.changeChallengeStatus();
$scope.dashboardInfo.notStartedChallenges.splice(index, 1);
//data.closedChallenges = $filter("progress")(data.challenges, "challenges", jsonValue.status.closed);
if (!$scope.dashboardInfo.notStartedChallenges.length) $scope.changeChallengesByStatus();;
$scope.$apply();
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ techlooper.controller("jobListingController", function (apiService, $scope, vnwC

$scope.filterJob = function() {
var keyword = $scope.searchJob.keyword ? $scope.searchJob.keyword : "";
var locationId = $scope.searchJob.locationId && $scope.searchJob.locationId !== "0" ? $scope.searchJob.locationId : "";
var locationId = $scope.searchJob.locationId && $scope.searchJob.locationId !== "0"
&& $scope.searchJob.locationId !== "1"? $scope.searchJob.locationId : "";
var location = "";
if (locationId) {
location = vnwConfigService.getLocationText(locationId, "en");
Expand Down

0 comments on commit 4ea3378

Please sign in to comment.