diff options
author | Angel Avila | 2015-08-11 21:14:28 -0400 |
---|---|---|
committer | Angel Avila | 2015-09-11 21:03:05 -0400 |
commit | bf0053b95f0ade97a381ab41868a4404145fd107 (patch) | |
tree | 9b4b47abe7c90ed469fc3f46cc4bfc59f9eaf071 /plugins/org.eclipse.osee.web.ui | |
parent | 37c7112b8c3e5c3621197205a5a61066977b9896 (diff) | |
download | org.eclipse.osee-bf0053b95f0ade97a381ab41868a4404145fd107.tar.gz org.eclipse.osee-bf0053b95f0ade97a381ab41868a4404145fd107.tar.xz org.eclipse.osee-bf0053b95f0ade97a381ab41868a4404145fd107.zip |
feature[ats_ATS216255]: Create Coverage Import Adapter for Dispo
Change-Id: I67f91a40f4cdcd5094056e3d8da3607dedf59927
Diffstat (limited to 'plugins/org.eclipse.osee.web.ui')
6 files changed, 137 insertions, 13 deletions
diff --git a/plugins/org.eclipse.osee.web.ui/src/dispo/js/adminController.js b/plugins/org.eclipse.osee.web.ui/src/dispo/js/adminController.js index 5eceaf326c8..239125ec4fc 100644 --- a/plugins/org.eclipse.osee.web.ui/src/dispo/js/adminController.js +++ b/plugins/org.eclipse.osee.web.ui/src/dispo/js/adminController.js @@ -1,5 +1,5 @@ - app.controller('adminController', ['$scope', '$rootScope', '$modal', 'Program', 'Set', 'Report', 'CopySet', - function($scope, $rootScope, $modal, Program, Set, Report, CopySet) { + app.controller('adminController', ['$scope', '$rootScope', '$modal', 'Program', 'Set', 'Report', 'CopySet', 'CopySetCoverage', + function($scope, $rootScope, $modal, Program, Set, Report, CopySet, CopySetCoverage) { $scope.readOnly = true; $scope.programSelection = null; $scope.modalShown = false; @@ -277,6 +277,20 @@ return modalInstance; } + $scope.copySetCoverage = function(inputs) { + var copySetOp = new CopySetCoverage; + + copySetOp.$save({ + programId: $scope.programSelection, + destinationSet: inputs.destinationSet, + sourceBranch: inputs.sourceBranch, + sourcePackage: inputs.sourcePackage, + }, function(data) { + var reportUrl = data.operationStatus; + window.open(reportUrl); + console.log(data); + }); + } // Create Set Modal $scope.createNewSetModal = function() { @@ -356,6 +370,44 @@ $modalInstance.dismiss('cancel'); }; }; + + + // Copy Coverage Modal + $scope.openCopyCoverageModal = function() { + var modalInstance = $modal.open({ + templateUrl: 'copySetCoverage.html', + controller: CopyCoverageModalCtrl, + size: 'md', + windowClass: 'copyCoverageModal', + resolve: { + sets: function() { + return $scope.sets; + } + } + }); + + modalInstance.result.then(function(inputs) { + $scope.copySetCoverage(inputs); + }); + } + + + var CopyCoverageModalCtrl = function($scope, $modalInstance, sets) { + $scope.setsLocal = angular.copy(sets); + + $scope.ok = function() { + var inputs = {}; + inputs.destinationSet = this.destinationSet; + inputs.sourceBranch = this.sourceBranch; + inputs.sourcePackage = this.sourcePackage; + + $modalInstance.close(inputs); + }; + + $scope.cancel = function() { + $modalInstance.dismiss('cancel'); + }; + }; } ]);
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.web.ui/src/dispo/js/dispoApp.js b/plugins/org.eclipse.osee.web.ui/src/dispo/js/dispoApp.js index c8a4b9cf9e3..631cc8387fe 100644 --- a/plugins/org.eclipse.osee.web.ui/src/dispo/js/dispoApp.js +++ b/plugins/org.eclipse.osee.web.ui/src/dispo/js/dispoApp.js @@ -90,6 +90,15 @@ app.provider('CopySet', function() { ]; }); +app.provider('CopySetCoverage', function() { + this.$get = ['$resource', + function($resource) { + var CopySetCoverage = $resource('/dispo/program/:programId/admin/copyCoverage', {}, {}); + return CopySetCoverage; + } + ]; +}); + app.provider('Set', function() { this.$get = ['$resource', function($resource) { diff --git a/plugins/org.eclipse.osee.web.ui/src/dispo/js/userController.js b/plugins/org.eclipse.osee.web.ui/src/dispo/js/userController.js index 9fe767fdcd6..00037c80f3f 100644 --- a/plugins/org.eclipse.osee.web.ui/src/dispo/js/userController.js +++ b/plugins/org.eclipse.osee.web.ui/src/dispo/js/userController.js @@ -10,7 +10,8 @@ app.controller('userController', [ 'SetSearch', 'SourceFile', 'ColumnFactory', - function($scope, $modal, $rootScope, $cookieStore, Program, Set, Item, Annotation, SetSearch, SourceFile, ColumnFactory) { + 'Config', + function($scope, $modal, $rootScope, $cookieStore, Program, Set, Item, Annotation, SetSearch, SourceFile, ColumnFactory, Config) { $scope.unselectingItem = false; $scope.editItems = false; $scope.selectedItems = []; @@ -19,7 +20,8 @@ app.controller('userController', [ $scope.lastFocused = null; $scope.isMulitEditRequest = false; $scope.loading = false; - $scope.isSearchView = false; + $scope.isSearchView = false; + $rootScope.cachedName = $cookieStore.get("name"); $scope.getDispoType = function() { if($rootScope.type == 'codeCoverage') { @@ -74,6 +76,14 @@ app.controller('userController', [ loadingModal.close(); alert(data.statusText); }); + + // Try to get custom config + Config.get({ + programId: $scope.programSelection, + type: $rootScope.type + }, function(data) { + $scope.coverageResolutionTypes = data.validResolutions; + }); }; $scope.updateSet = function updateSet() { @@ -85,7 +95,8 @@ app.controller('userController', [ } else { Item.query({ programId: $scope.programSelection, - setId: $scope.setSelection + setId: $scope.setSelection, + isDetailed: $rootScope.type == 'codeCoverage' }, function(data) { loadingModal.close(); $scope.items = data; @@ -305,7 +316,7 @@ app.controller('userController', [ } $scope.getResolutionTypes = function getResolutionTypes() { - if($scope.dispoType == 'codeCoverage') { + if($scope.type == 'codeCoverage') { return $scope.coverageResolutionTypes; } else { return $scope.testResolutionTypes; @@ -319,7 +330,7 @@ app.controller('userController', [ itemId: $scope.selectedItem.guid, annotationId: annotation.guid, userName: $rootScope.cachedName, - }, function() { + }, function(data) { var index = $scope.annotations.indexOf(annotation); if (index > -1) { $scope.annotations.splice(index, 1); @@ -376,7 +387,7 @@ app.controller('userController', [ $scope.getInvalidLocRefs = function getInvalidLocRefs(annotation) { if(annotation.isConnected != null) { - return !annotation.isConnected && annotation.locationRefs != null; + return !annotation.isConnected && !annotation.isDefault && annotation.locationRefs != null; } else { return false; } @@ -502,6 +513,7 @@ app.controller('userController', [ programId: $scope.programSelection, setId: $scope.setSelection, value: value, + isDetailed: $rootScope.type == 'codeCoverage', }, function(data) { if($scope.isSearchView) { $scope.items = data; @@ -528,6 +540,17 @@ app.controller('userController', [ }); } + $scope.getText = function(annotation) { + if(annotation.customerNotes == "") { + var discrepancies = $scope.selectedItem.discrepancies; + var covered = annotation.idsOfCoveredDiscrepancies[0] + + return discrepancies[covered].text; + } else { + return annotation.customerNotes; + } + } + $scope.emptyItems = [{"name": "NONE FOUND"}] diff --git a/plugins/org.eclipse.osee.web.ui/src/dispo/views/admin.html b/plugins/org.eclipse.osee.web.ui/src/dispo/views/admin.html index 4e3232f990a..47446c9fb1d 100644 --- a/plugins/org.eclipse.osee.web.ui/src/dispo/views/admin.html +++ b/plugins/org.eclipse.osee.web.ui/src/dispo/views/admin.html @@ -28,6 +28,12 @@ </div> </div> + <div ng-show="false" class="row" id=setCopyRow> + <div class="col-sm-10 col-sm-offset-2" id=setCopyCoverageContainer> + <button ng-click="openCopyCoverageModal()" ng-show="sets.length > 0" class="btn btn-primary active" id=generateReportBtn>Import From Coverage</button> + </div> + </div> + </div> <div class="col-md-6 col-md-offset-1"> <div class="row"> @@ -97,6 +103,32 @@ </div> </script> + + <script type="text/ng-template" id="copySetCoverage.html"> + <div class="modal-header"> + <h3 class="modal-title">Copy From Coverage</h3> + </div> + <div class="modal-body" overflow: auto;"> + <div class="form-group"> + Select Destination Set + <select class="form-control" ng-model="destinationSet" ng-options="obj.guid as obj.name for obj in setsLocal"> + </select> + </div> + <div class="form-group"> + Enter Source Branch + <input class="form-control" ng-model="sourceBranch" placeholder="Enter Branch Uuid"></input> + </div> + <div class="form-group"> + Enter Coverage Package id + <input class="form-control" ng-model="sourcePackage" placeholder="Enter Coverage Package Uuid"></input> + </div> + </div> + <div class="modal-footer"> + <button class="btn btn-primary" ng-click="ok()">OK</button> + <button class="btn btn-warning" ng-click="cancel()">Cancel</button> + </div> + + </script> <script type="text/ng-template" id="loadingModal.html"> <div id="loadingModal" class="alert alert-info"> diff --git a/plugins/org.eclipse.osee.web.ui/src/dispo/views/user.html b/plugins/org.eclipse.osee.web.ui/src/dispo/views/user.html index 6491fcb53f3..62dfd4dc484 100644 --- a/plugins/org.eclipse.osee.web.ui/src/dispo/views/user.html +++ b/plugins/org.eclipse.osee.web.ui/src/dispo/views/user.html @@ -46,7 +46,8 @@ <th>{{ annotationHeaders.resolutionType }}</th> <th>{{ annotationHeaders.resolution }}</th> <th>Developer Notes</th> - <th>Customer Notes</th> + <th ng-show="type != 'codeCoverage'"Customer Notes</th> + <th ng-show="type == 'codeCoverage'">Text</th> <th width="50px;">Delete</th> <tr ng-repeat="annotation in annotations"> <td> @@ -61,8 +62,11 @@ <td> <textarea ng-class="{annotationInput: true, details: annotation.showDeets}" ng-disabled="annotation.guid == null" ng-model="annotation.developerNotes" type=text ng-model-onblur ng-change="editAnnotation(annotation)" ng-dblclick="toggleDetails(annotation)"></textarea> </td> - <td> - <textarea ng-class="{annotationInput: true, details: annotation.showDeets}" ng-disabled="annotation.guid == null" ng-model="annotation.customerNotes" type=text ng-model-onblur ng-change="editAnnotation(annotation)" ng-dblclick="toggleDetails(annotation)"></textarea> + <td ng-show="type != 'codeCoverage'"> + <textarea ng-class="{annotationInput: true, details: annotation.showDeets}" ng-disabled="annotation.guid == null || type == 'codeCoverage'" ng-model="annotation.customerNotes" type=text ng-model-onblur ng-change="editAnnotation(annotation)" ng-dblclick="toggleDetails(annotation)"></textarea> + </td> + <td ng-show="type == 'codeCoverage'"> + <textarea ng-class="{annotationInput: true, details: annotation.showDeets}" ng-disabled="true" type=text ng-dblclick="getText(annotation)">{{ getText(annotation) }}</textarea> </td> <td> <button ng-class="{annotationDelete: true, details: annotation.showDeets}" ng-disabled="annotation.guid == null || isDefaultResolution(annotation);" ng-click="deleteAnnotation(annotation)">X</button> diff --git a/plugins/org.eclipse.osee.web.ui/src/libs/js/oseeAuth/oseeAuth.js b/plugins/org.eclipse.osee.web.ui/src/libs/js/oseeAuth/oseeAuth.js index 7a2dd7c0a24..11d17e4ade6 100644 --- a/plugins/org.eclipse.osee.web.ui/src/libs/js/oseeAuth/oseeAuth.js +++ b/plugins/org.eclipse.osee.web.ui/src/libs/js/oseeAuth/oseeAuth.js @@ -17,7 +17,8 @@ directives.directive('osee', [ 'Endpoint', '$localStorage', '$sessionStorage', - function($rootScope, $compile, $http, $location, $templateCache, AccessToken, Profile, Endpoint, $localStorage, $sessionStorage) { + '$cookieStore', + function($rootScope, $compile, $http, $location, $templateCache, AccessToken, Profile, Endpoint, $localStorage, $sessionStorage, $cookieStore) { var definition = { restrict : 'E', replace : true, @@ -145,6 +146,7 @@ directives.directive('osee', [ scope.$on("oauth:authorized", function(event, token) { Profile.find(scope.profileUri).success(function(response) { scope.profile = response; + $cookieStore.put("name", scope.profile.name); }); if($localStorage.continueTo) { // Change the state to the continueTo we caught when User first tried to get into page @@ -154,11 +156,13 @@ directives.directive('osee', [ }) scope.$on("oauth:logout", function() { scope.profile = scope.anonymousUser; - var fr = AccessToken.destroy(); + $cookieStore.put("name", scope.profile.name); + AccessToken.destroy(); $location.path("/"); }) scope.$on("oauth:denied", function(event, token) { scope.profile = scope.anonymousUser; + $cookieStore.put("name", scope.profile.name); AccessToken.destroy(); }); |