Skip to content

Commit

Permalink
Merge pull request #100 from e-ucm/userFilter
Browse files Browse the repository at this point in the history
Fixed user filter
  • Loading branch information
Dan Cristian, Rotaru committed Oct 29, 2018
2 parents b611267 + eb4f8fa commit 6f1f9da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
17 changes: 7 additions & 10 deletions app/public/js/controllers/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,22 +172,22 @@ angular.module('activityApp', ['myApp', 'ngStorage', 'services'])
var filter = {};

if (userName) {
filter.name = userName;
filter['out.name'] = userName;
} else if ($scope.player) {
filter.name = $scope.player.name;
filter['out.name'] = $scope.player.name;
}

if (attempt) {
filter.session = attempt;
filter['out.session'] = attempt;
} else if ($scope.attempt) {
filter.session = $scope.attempt.number;
filter['out.session'] = $scope.attempt.number;
}

if (filter.length > 0) {
if (Object.keys(filter).length > 0 ) {
var props = [];
for (var key in filter) {
if (filter.hasOwnProperty(key)) {
props.push(key + ': ' + filter[key]);
props.push(key + ':' + filter[key]);
}
}
url += '&_a=(filters:!(),options:(darkTheme:!f),query:(query_string:(analyze_wildcard:!t,query:\'' + props.join(',') + '\')))';
Expand All @@ -196,7 +196,6 @@ angular.module('activityApp', ['myApp', 'ngStorage', 'services'])
if (url.startsWith('localhost')) {
url = 'http://' + url;
}

return $sce.trustAsResourceUrl(url);
};

Expand Down Expand Up @@ -245,7 +244,7 @@ angular.module('activityApp', ['myApp', 'ngStorage', 'services'])
$scope.viewPlayer = function (result) {
$scope.player = result;
$scope.attempt = null;
$scope.iframeDashboardUrl = dashboardLink();
$scope.iframeDashboardUrl = dashboardLink(result.name);
};

$scope.viewAttempt = function (gameplay, attempt) {
Expand Down Expand Up @@ -315,7 +314,6 @@ angular.module('activityApp', ['myApp', 'ngStorage', 'services'])
$scope.myFile = undefined;
$scope.uploadTracesFile = function () {
if ($scope.myFile) {
console.log('upload 3 ' + $scope.myFile);
upload($scope.myFile);
}
};
Expand Down Expand Up @@ -522,7 +520,6 @@ angular.module('activityApp', ['myApp', 'ngStorage', 'services'])
if ($scope.activity._id === activity._id) {
$scope.activity = activity;
updateOfflineTraces();
console.log('Activity updated');
}
});

Expand Down
2 changes: 0 additions & 2 deletions app/public/js/controllers/devVisualizator.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ angular.module('devVisualizatorApp', ['ngStorage', 'services'])
function ($scope, $location, $http, $window, $localStorage, Games, Versions, Role, CONSTANTS, $sce, QueryParams) {
$scope.$storage = $localStorage;

console.log('isDeveloper');
$scope.isDeveloper = function () {
console.log('isDeveloper');
return Role.isDeveloper();
};

Expand Down

0 comments on commit 6f1f9da

Please sign in to comment.