diff options
Diffstat (limited to 'testapi/opnfv_testapi/ui')
4 files changed, 16 insertions, 20 deletions
diff --git a/testapi/opnfv_testapi/ui/Gruntfile.js b/testapi/opnfv_testapi/ui/Gruntfile.js index 41a2ec5..805ad9f 100644 --- a/testapi/opnfv_testapi/ui/Gruntfile.js +++ b/testapi/opnfv_testapi/ui/Gruntfile.js @@ -123,7 +123,8 @@ module.exports = function (grunt) { '../tests/UI/e2e/resultsControllerSpec.js', '../tests/UI/e2e/scenariosControllerSpec.js', '../tests/UI/e2e/scenarioControllerSpec.js', - '../tests/UI/e2e/deployResultsControllerSpec.js' + '../tests/UI/e2e/deployResultsControllerSpec.js', + '../tests/UI/e2e/authenticateFalseSpec.js' ] } }, diff --git a/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenario.html b/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenario.html index 14ba42d..4f0a580 100644 --- a/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenario.html +++ b/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenario.html @@ -28,7 +28,7 @@ <p ng-if="!ctrl.collapeInstallers">Show</p> </a> </div> - <div class="col-md-1" style="padding:0px" ng-class="{'hidden' : !ctrl.buttonInstaller || !auth.isAuthenticated}"> + <div class="col-md-1" style="padding:0px" ng-class="{'hidden' : !ctrl.buttonInstaller || (!auth.isAuthenticated && authenticate)}"> <button type="button" class="btn btn-success btn-xs" ng-click="ctrl.openAddInstaller()" ><i class="fa fa-plus"></i>Add</button> </div> <div ng-class="{ 'hidden' : ! ctrl.collapeInstallers } "> @@ -43,7 +43,7 @@ <a ng-click="ctrl.expandInstaller(indexI)">{{installer.installer}}</a> </td> <td style="width:80%;border: none; padding: 0px;" ng-class="{'hidden' : !ctrl.buttonInstaller}"> - <button type="button" ng-class="{'hidden' : !auth.isAuthenticated}" class="btn btn-danger btn-xs" ng-click="ctrl.openDeleteInstallerModal(installer.installer)" ><i class="fa fa-minus"></i>Delete</button> + <button type="button" ng-class="{'hidden' : !auth.isAuthenticated && authenticate}" class="btn btn-danger btn-xs" ng-click="ctrl.openDeleteInstallerModal(installer.installer)" ><i class="fa fa-minus"></i>Delete</button> </td> </tr> <tr ng-class="{ 'hidden' : ! ctrl.collapeInstaller[indexI] }"> @@ -58,7 +58,7 @@ </a> </div> <div class="col-md-1" style="padding:0px" ng-class="{'hidden' : !ctrl.buttonVersion}"> - <button type="button" class="btn btn-success btn-xs" ng-class="{'hidden' : !auth.isAuthenticated}" ng-click="ctrl.openAddVersionModal(installer.installer)" ><i class="fa fa-plus"></i>Add</button> + <button type="button" class="btn btn-success btn-xs" ng-class="{'hidden' : !auth.isAuthenticated && authenticate}" ng-click="ctrl.openAddVersionModal(installer.installer)" ><i class="fa fa-plus"></i>Add</button> </div> <div ng-class="{ 'hidden' : ! ctrl.collapeVersions[indexI] } " class="col-md-12"> <div class="table-responsive"> @@ -72,7 +72,7 @@ <a ng-click="ctrl.expandVersion(indexI,indexV)">{{version.version}}</a> </td> <td style="width:80%;border: none; padding: 0px;" ng-class="{'hidden' : !ctrl.buttonVersion}"> - <button type="button" class="btn btn-danger btn-xs" ng-class="{'hidden' : !auth.isAuthenticated}" ng-click="ctrl.openDeleteVersionModal(version.version, installer.installer)" ><i class="fa fa-minus"></i>Delete</button> + <button type="button" class="btn btn-danger btn-xs" ng-class="{'hidden' : !auth.isAuthenticated && authenticate}" ng-click="ctrl.openDeleteVersionModal(version.version, installer.installer)" ><i class="fa fa-minus"></i>Delete</button> </td> </tr> <tr style="padding:9px" ng-class="{ 'hidden' : ! ctrl.collapeVersion[indexI][indexV] } "> @@ -93,7 +93,7 @@ </a> </div> <div class="col-md-1" style="padding:0px" ng-class="{'hidden' : !ctrl.buttonProject }"> - <button type="button" ng-class="{'hidden' : !auth.isAuthenticated}" class="btn btn-success btn-xs" ng-click="ctrl.openAddProjectModal(version.version,installer.installer)" ><i class="fa fa-plus"></i>Add</button> + <button type="button" ng-class="{'hidden' : !auth.isAuthenticated && authenticate}" class="btn btn-success btn-xs" ng-click="ctrl.openAddProjectModal(version.version,installer.installer)" ><i class="fa fa-plus"></i>Add</button> </div> <div ng-class="{ 'hidden' : ! ctrl.collapeProjects[indexI][indexV] } " class="col-md-12"> <div class="table-responsive"> @@ -107,7 +107,7 @@ <a ng-click="ctrl.expandProject(indexI, indexV, indexP)">{{project.project}}</a> </td> <td style="width:80%;border: none; padding: 0px;" ng-class="{'hidden' : !ctrl.buttonProject}"> - <button type="button" class="btn btn-danger btn-xs" ng-class="{'hidden' : !auth.isAuthenticated}" ng-click="ctrl.openDeleteProjectModal(project,version.version, installer.installer)" ><i class="fa fa-minus"></i>Delete</button> + <button type="button" class="btn btn-danger btn-xs" ng-class="{'hidden' : !auth.isAuthenticated && authenticate}" ng-click="ctrl.openDeleteProjectModal(project,version.version, installer.installer)" ><i class="fa fa-minus"></i>Delete</button> </td> </tr> <tr ng-class="{ 'hidden' : ! ctrl.collapeProject[indexI][indexV][indexP] }"> @@ -138,10 +138,6 @@ </td> </tr> </tbody> - <tr> - <button type="button" class="btn btn-success btn-xs" ng-click="ctrl.openAddTrustIndicatorModal(project.project,version.version,installer.installer)" ng-class="{ 'hidden' : !ctrl.collapeTrustIndicator[index] || !auth.isAuthenticated}"> - <i class="fa fa-plus"></i>Add</button> - </tr> </table> </td> </tr> @@ -173,9 +169,6 @@ </td> </tr> </tbody> - <tr> - <button type="button" class="btn btn-success btn-xs" ng-click="ctrl.openAddScoreModal(project.project,version.version,installer.installer)" ng-class="{ 'hidden' : !ctrl.collapeScore[index] || !auth.isAuthenticated}"><i class="fa fa-plus"></i>Add</button> - </tr> </table> </td> </tr> @@ -195,13 +188,13 @@ {{custom}} </td> <td width="90%" class="podsTableLeftTd"> - <button type="button" class="btn btn-danger btn-xs" ng-click="ctrl.openDeleteCustomModal(custom,project.project,version.version,installer.installer)" ng-class="{'hidden' : !auth.isAuthenticated}" ><i class="fa fa-minus"></i>Delete</button> + <button type="button" class="btn btn-danger btn-xs" ng-click="ctrl.openDeleteCustomModal(custom,project.project,version.version,installer.installer)" ng-class="{'hidden' : !auth.isAuthenticated && authenticate}" ><i class="fa fa-minus"></i>Delete</button> </td> </tr> <tr ng-repeat-end=> </tr> <tr> - <button type="button" class="btn btn-success btn-xs" ng-click="ctrl.openAddCustomModal(project.project,version.version,installer.installer)" ng-class="{ 'hidden' : !ctrl.collapeCustom[indexI][indexV][indexP] || !auth.isAuthenticated}"><i class="fa fa-plus"></i>Add</button> + <button type="button" class="btn btn-success btn-xs" ng-click="ctrl.openAddCustomModal(project.project,version.version,installer.installer)" ng-class="{ 'hidden' : !ctrl.collapeCustom[indexI][indexV][indexP] || (!auth.isAuthenticated && authenticate)}"><i class="fa fa-plus"></i>Add</button> </tr> </tbody> </table> diff --git a/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenarioController.js b/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenarioController.js index 51f4242..a0cd5eb 100644 --- a/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenarioController.js +++ b/testapi/opnfv_testapi/ui/components/scenarios/scenario/scenarioController.js @@ -21,7 +21,7 @@ ScenarioController.$inject = [ '$scope', '$http', '$filter', '$state', '$window', '$uibModal', 'testapiApiUrl','raiseAlert', - 'confirmModal' + 'confirmModal', 'authenticate' ]; /** @@ -30,7 +30,7 @@ * through Scenario declared in TestAPI. */ function ScenarioController($scope, $http, $filter, $state, $window, $uibModal, testapiApiUrl, - raiseAlert, confirmModal) { + raiseAlert, confirmModal, authenticate) { var ctrl = this; ctrl.name = $state.params['name']; ctrl.url = testapiApiUrl + '/scenarios?name=' + ctrl.name; diff --git a/testapi/opnfv_testapi/ui/config.json b/testapi/opnfv_testapi/ui/config.json index 26dfd08..63e1e97 100644 --- a/testapi/opnfv_testapi/ui/config.json +++ b/testapi/opnfv_testapi/ui/config.json @@ -1,2 +1,4 @@ -{"testapiApiUrl": "http://localhost:8000/api/v1", -"authenticate": true} +{ + "testapiApiUrl": "http://localhost:8000/api/v1", + "authenticate": true +}
\ No newline at end of file |