diff options
author | Panagiotis Karalis <pkaralis@intracom-telecom.com> | 2019-05-03 08:04:06 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2019-05-03 08:04:06 +0000 |
commit | 92becdc69c08beb4fd72bf8fa832fb7953412472 (patch) | |
tree | 927a4af64348aa989f1904a067358559868235eb /3rd_party/static/onap-ui/components/results/resultsController.js | |
parent | 95c53f27c194dbab6b609fc0d3b903811e392068 (diff) | |
parent | da620c17769c0357e4a9137eedbb7cf044cc38d4 (diff) |
Merge "Bug fix for ONAP/OVP portals"
Diffstat (limited to '3rd_party/static/onap-ui/components/results/resultsController.js')
-rw-r--r-- | 3rd_party/static/onap-ui/components/results/resultsController.js | 21 |
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; |