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/testapi-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/testapi-ui/components/results')
-rw-r--r-- | 3rd_party/static/testapi-ui/components/results/resultsController.js | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/3rd_party/static/testapi-ui/components/results/resultsController.js b/3rd_party/static/testapi-ui/components/results/resultsController.js index f752412..482d3a9 100644 --- a/3rd_party/static/testapi-ui/components/results/resultsController.js +++ b/3rd_party/static/testapi-ui/components/results/resultsController.js @@ -148,7 +148,7 @@ } // Should only be on user-results-page if authenticated. - if (ctrl.isUserResults && !$scope.auth.isAuthenticated) { + if (!ctrl.isUserResults && !ctrl.isReviewer) { $state.go('home'); } @@ -579,6 +579,7 @@ var content_url = testapiApiUrl + '/tests'; 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) { @@ -590,6 +591,7 @@ } if (ctrl.isUserResults) { content_url += '&signed'; + ctrl.PageName = 'MyResults'; } else { content_url += '&status={"$ne":"private"}&review'; } @@ -600,6 +602,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; |