diff options
author | Angel Avila | 2017-07-19 19:22:01 +0000 |
---|---|---|
committer | Angel Avila | 2017-07-21 17:51:09 +0000 |
commit | 0bc74c21baf55377ab148ab5c503bbd3f7dbd308 (patch) | |
tree | 65cc0e22d30db52ab61648277f79735703355d43 /plugins/org.eclipse.osee.web.ui | |
parent | 16050dc3323cfcaa6f2013ca8deb882e444d019b (diff) | |
download | org.eclipse.osee-0bc74c21baf55377ab148ab5c503bbd3f7dbd308.tar.gz org.eclipse.osee-0bc74c21baf55377ab148ab5c503bbd3f7dbd308.tar.xz org.eclipse.osee-0bc74c21baf55377ab148ab5c503bbd3f7dbd308.zip |
refinement: Refine Valdity checks for resolution and resolution type
Change-Id: Ifb0fde07163be5358a3a162b6d80dbeca4e30944
Diffstat (limited to 'plugins/org.eclipse.osee.web.ui')
4 files changed, 42 insertions, 18 deletions
diff --git a/plugins/org.eclipse.osee.web.ui/src/dispo/css/user.css b/plugins/org.eclipse.osee.web.ui/src/dispo/css/user.css index e74ec03d7f6..2ac0cd385f1 100644 --- a/plugins/org.eclipse.osee.web.ui/src/dispo/css/user.css +++ b/plugins/org.eclipse.osee.web.ui/src/dispo/css/user.css @@ -324,8 +324,10 @@ input.cellInput:focus{ background-color: #7eff39;' } -.coverage-invalid { +.causing-invalid { border: 2px dashed #ff8a8a; } - +.resolution-invalid { + border: 2px dashed #ff8a8a; +} diff --git a/plugins/org.eclipse.osee.web.ui/src/dispo/js/ColumnFactory.js b/plugins/org.eclipse.osee.web.ui/src/dispo/js/ColumnFactory.js index aa75f402b61..43bfc993e58 100644 --- a/plugins/org.eclipse.osee.web.ui/src/dispo/js/ColumnFactory.js +++ b/plugins/org.eclipse.osee.web.ui/src/dispo/js/ColumnFactory.js @@ -362,8 +362,8 @@ app.factory('ColumnFactory', function() { } ]; var textCoverageTmpl = '<div class="ui-grid-cell-contents" title="TOOLTIP">{{ grid.appScope.getTextCoverage(row.entity) }}</div>'; - var resolutionTmpl = '<div class="ui-grid-cell-contents placeholder" ng-class="{\'placeholder-parent\': !row.entity.isLeaf, \'complete-parent\': row.entity.isAllComplete, \'none-complete-parent\': row.entity.isNoneComplete, \'some-complete-parent\': row.entity.isSomeComplete, \'almost-complete-parent\': row.entity.isAlmostComplete, \'coverage-invalid\': grid.appScope.isCausingInvalid(row.entity)}" title="TOOLTIP">{{ grid.appScope.getTextResolution(row.entity) }}</div>'; - var origSubCellTmpl = '<div class="ui-grid-cell-contents" ng-class="{\'placeholder-parent\': true}" title="TOOLTIP">{{ grid.appScope.getTextResolutionType(row.entity) }}</div>'; + var resolutionCoverageTmpl = '<div class="ui-grid-cell-contents placeholder" ng-class="{\'placeholder-parent\': !row.entity.isLeaf, \'complete-parent\': row.entity.isAllComplete, \'none-complete-parent\': row.entity.isNoneComplete, \'some-complete-parent\': row.entity.isSomeComplete, \'almost-complete-parent\': row.entity.isAlmostComplete, \'causing-invalid\': grid.appScope.isCausingInvalid(row.entity)}" title="TOOLTIP">{{ grid.appScope.getTextResolution(row.entity) }}</div>'; + var resolutionTypeTmpl = '<div class="ui-grid-cell-contents" ng-class="{\'placeholder-parent\': true}" title="TOOLTIP">{{ grid.appScope.getTextResolutionType(row.entity) }}</div>'; var subGridOrigTmpl = '<div ng-class="{\'ui-grid-cell-contents\': true, annotationInput: true, invalid: grid.appScope.getInvalidLocRefs(row.entity), details: annotation.showDeets}" title="TOOLTIP">{{row.entity.locationRefs}}</div>'; var codeTemplate = '<div class="method-number">{{ grid.appScope.selectedItem.methodNumber }}</div>'; @@ -391,7 +391,7 @@ app.factory('ColumnFactory', function() { displayName: 'Resolution Type', editableCellTemplate: '/dispo/views/dropdown.html', width: '7%', - cellTemplate: origSubCellTmpl, + cellTemplate: resolutionTypeTmpl, editDropdownIdLabel: 'text', cellEditableCondition: function($scope) { return $scope.row.entity.isLeaf && !$scope.row.entity.isDefault; @@ -400,7 +400,7 @@ app.factory('ColumnFactory', function() { field: 'resolution', displayName: 'Resolution', width: '15%', - cellTemplate: resolutionTmpl, + cellTemplate: resolutionCoverageTmpl, cellEditableCondition: function($scope) { return $scope.row.entity.isLeaf && !$scope.row.entity.isDefault } @@ -418,7 +418,8 @@ app.factory('ColumnFactory', function() { enableCellEdit: false, } ]; - + var resolutionTmpl = '<div class="ui-grid-cell-contents placeholder" ng-class="{\'causing-invalid\': grid.appScope.isCausingInvalid(row.entity)}" title="TOOLTIP">{{ grid.appScope.getTextResolution(row.entity) }}</div>'; + var subGridColumnsTestScript = [{ field: 'locationRefs', displayName: 'Test Point(s)', @@ -436,6 +437,7 @@ app.factory('ColumnFactory', function() { }, { field: 'resolution', displayName: 'PCR', + cellTemplate: resolutionTmpl, cellEditableCondition: function($scope) { return $scope.row.entity.guid != null; } diff --git a/plugins/org.eclipse.osee.web.ui/src/dispo/js/CoverageFactory.js b/plugins/org.eclipse.osee.web.ui/src/dispo/js/CoverageFactory.js index a1486b561dc..32be4f5ced4 100644 --- a/plugins/org.eclipse.osee.web.ui/src/dispo/js/CoverageFactory.js +++ b/plugins/org.eclipse.osee.web.ui/src/dispo/js/CoverageFactory.js @@ -9,6 +9,18 @@ app.factory('CoverageFactory', function() { } } + CoverageFactory.getTextResolution = function(annotation) { + if (annotation.isLeaf) { + return annotation.resolution; + } else { + if(annotation.isTopLevel) { + return annotation.percentCompleteStr; + } else { + return annotation.childMetadata.completeCount + " / " + annotation.childMetadata.totalCount; + } + } + } + CoverageFactory.setTextForNonDefaultAnnotations = function(annotations, discrepancies) { for(var i = 0; i < annotations.length; i++) { if(!annotations[i].isDefault) { 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 f4504af46c7..ec57da1fc16 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 @@ -74,7 +74,11 @@ app.controller('userController', [ }); if(!$scope.isCoverage) { - $scope.validResolutions = [{ + $scope.validResolutions = [ + { + text: "", + value: "" + },{ text: "Code", value: "CODE" }, { @@ -300,15 +304,11 @@ app.controller('userController', [ } $scope.getTextResolution = function(annotation) { - if (annotation.isLeaf) { - return annotation.resolution; - } else { - if(annotation.isTopLevel) { - return annotation.percentCompleteStr; - } else { - return annotation.childMetadata.completeCount + " / " + annotation.childMetadata.totalCount; - } - } + if($scope.isCoverage) { + return CoverageFactory.getTextResolution(annotation); + } else { + return annotation.resolution; + } } $scope.getTextCoverage = function(annotation) { @@ -536,6 +536,7 @@ app.controller('userController', [ itemId: $scope.selectedItem.guid, annotationId: annotation.guid }, function(data) { + // These two fields are updated on the server when editing an Annotation thus we need to update our copy of them annotation.isConnected = data.isConnected; annotation.isResolutionValid = data.isResolutionValid; CoverageFactory.updatePercent(colDef, oldValue, annotation); @@ -692,7 +693,14 @@ app.controller('userController', [ } $scope.isCausingInvalid = function(annotation) { - return annotation.isLeaf && annotation.resolutionType != "" && annotation.resolution == ""; + if($scope.isCoverage) { + // Right now an invalid resolution is pretty straight forward and it's the same for coverage and test script dispo + // If Resolution is valid but resolutionType is not then return true + // In future, there might be more complicated reasons for invalid so putting a placeholder condition now + return annotation.isLeaf && annotation.resolutionType != "" && annotation.resolution == ""; + } else { + return annotation.resolutionType != "" && annotation.resolution == ""; + } } // MODALS ------------------------------------------------------------------------------------------------- |