aboutsummaryrefslogtreecommitdiffstats
path: root/3rd_party/static/onap-ui/components/results/resultsController.js
diff options
context:
space:
mode:
Diffstat (limited to '3rd_party/static/onap-ui/components/results/resultsController.js')
-rw-r--r--3rd_party/static/onap-ui/components/results/resultsController.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/3rd_party/static/onap-ui/components/results/resultsController.js b/3rd_party/static/onap-ui/components/results/resultsController.js
index 5983dd8..e8187f3 100644
--- a/3rd_party/static/onap-ui/components/results/resultsController.js
+++ b/3rd_party/static/onap-ui/components/results/resultsController.js
@@ -552,6 +552,7 @@
var start = $filter('date')(ctrl.startDate, 'yyyy-MM-dd');
var end = $filter('date')(ctrl.endDate, 'yyyy-MM-dd');
+ ctrl.PageName = null;
content_url += '?page=' + ctrl.currentPage;
content_url += '&per_page=' + ctrl.itemsPerPage;
if (start) {
@@ -562,6 +563,7 @@
}
if (ctrl.isUserResults) {
content_url += '&signed';
+ ctrl.PageName = 'MyResults';
} else {
content_url += '&status={"$ne":"private"}&review';
}
@@ -572,6 +574,25 @@
ctrl.totalItems = ctrl.data.pagination.total_pages * ctrl.itemsPerPage;
ctrl.currentPage = ctrl.data.pagination.current_page;
ctrl.numPages = ctrl.data.pagination.total_pages;
+ if (ctrl.PageName === 'MyResults') {
+ for (var i=0; i<data.tests.length; i++) {
+ if (data.tests[i].owner !== ctrl.currentUser) {
+ var sharing = false;
+ if (data.tests[i].shared !== null){
+ for (var j=0; j<data.tests[i].shared.length; j++) {
+ if (data.tests[i].shared[j] === ctrl.currentUser){
+ sharing = true;
+ }
+ }
+ }
+ if (sharing == false){
+ data.tests.splice(i,1);
+ i = i - 1;
+ }
+ }
+ }
+ ctrl.data = data;
+ }
}).error(function (error) {
ctrl.data = null;
ctrl.totalItems = 0;