diff options
author | Panagiotis Karalis <pkaralis@intracom-telecom.com> | 2019-04-18 18:48:22 +0300 |
---|---|---|
committer | Panagiotis Karalis <pkaralis@intracom-telecom.com> | 2019-04-24 17:04:43 +0300 |
commit | da620c17769c0357e4a9137eedbb7cf044cc38d4 (patch) | |
tree | e2008953fa3637cd9da96fece5c2165e703436df /3rd_party/static/onap-ui/components/results | |
parent | 6ade07b42e9ef39dafda4504bc61eb4661b10cde (diff) |
Bug fix for ONAP/OVP portals
During portal review, some errors have been noticed and fixed.
- 'no role', In the 'My Results' page are displayed also results
from other users.
- 'user,reviewer' role, In the 'My Results' page are appeared all
results and not only for the current user.
- 'administrator' role, The applications are not appeared in the
application page
- 'reviewer' role, Reviewers cannot submit votes and after few
seconds a 'time out' is received.
Change-Id: Ia9bc3c4fdcac1b37ac03adff64ff689ca2428c0f
Signed-off-by: Panagiotis Karalis <pkaralis@intracom-telecom.com>
Diffstat (limited to '3rd_party/static/onap-ui/components/results')
-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; |