Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngel Avila2017-07-07 23:43:19 +0000
committerMorgan Cook2017-07-08 15:25:40 +0000
commit6b7aba3d3f44f84675eee16dc9d5d9220b7618de (patch)
treece472d07d461760587ced9b178681306e844eac9 /plugins/org.eclipse.osee.web.ui
parentd58eaabd1fee00f69b5ba19376946949cbb14cd6 (diff)
downloadorg.eclipse.osee-6b7aba3d3f44f84675eee16dc9d5d9220b7618de.tar.gz
org.eclipse.osee-6b7aba3d3f44f84675eee16dc9d5d9220b7618de.tar.xz
org.eclipse.osee-6b7aba3d3f44f84675eee16dc9d5d9220b7618de.zip
feature[ats_TW1230]: Implement MCDC UI enhancments
Diffstat (limited to 'plugins/org.eclipse.osee.web.ui')
-rw-r--r--plugins/org.eclipse.osee.web.ui/src/dispo/css/user.css25
-rw-r--r--plugins/org.eclipse.osee.web.ui/src/dispo/css/userGrid.css14
-rw-r--r--plugins/org.eclipse.osee.web.ui/src/dispo/js/ColumnFactory.js197
-rw-r--r--plugins/org.eclipse.osee.web.ui/src/dispo/js/userController.js194
-rw-r--r--plugins/org.eclipse.osee.web.ui/src/dispo/views/user.html2
5 files changed, 344 insertions, 88 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 69a7d11be2..79951fd7ba 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
@@ -112,7 +112,7 @@
}
#subGrid div.ui-grid-cell-contents.invalid {
- border: 2px solid red;
+ background-color: #ff8a8a;
}
#subGrid .ui-grid-viewport.ng-isolate-scope {
@@ -298,5 +298,28 @@ input.cellInput:focus{
resize: both:
}
+.method-number {
+ background-color: rgb(157, 164, 171);
+ height: 100%;
+ border-bottom: solid 1px grey;
+}
+
+.placeholder-parent {
+ text-align: center;
+}
+.none-complete-parent {
+ background-color: red;'
+}
+.almost-complete-parent {
+ background-color: orange;'
+}
+
+.some-complete-parent {
+ background-color: yellow;'
+}
+
+.complete-parent {
+ background-color: #7eff39;'
+}
diff --git a/plugins/org.eclipse.osee.web.ui/src/dispo/css/userGrid.css b/plugins/org.eclipse.osee.web.ui/src/dispo/css/userGrid.css
index 61b664598f..a8e0598550 100644
--- a/plugins/org.eclipse.osee.web.ui/src/dispo/css/userGrid.css
+++ b/plugins/org.eclipse.osee.web.ui/src/dispo/css/userGrid.css
@@ -7,6 +7,20 @@
content: " ";
display: table;
}
+
+form.ng-pristine.ng-valid {
+ height: 30px;
+}
+input.ng-pristine.ng-untouched.ng-valid.ng-scope {
+ height: 30px;
+}
+
+input.ng-valid.ng-dirty.ng-valid-parse {
+ height: 30px;
+}
+
+
+
#ui-grid-twbs #ui-grid-twbs .form-horizontal .form-group:after,
#ui-grid-twbs #ui-grid-twbs .btn-toolbar:after,
#ui-grid-twbs #ui-grid-twbs .btn-group-vertical > .btn-group:after {
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 395c4131c5..b441bbc8ed 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
@@ -1,15 +1,34 @@
app.factory('ColumnFactory', function() {
var ColumnFactory = {};
+ this.selectedItem = { methodNumber: '0'}
ColumnFactory.getColumns = function(type, width) {
- return columnsCoverage;
+ if(type == 'testScript'){
+ return columnsTestScript;
+ } else {
+ return columnsCoverage;
+ }
+ }
+
+ ColumnFactory.setSelectedItem = function(item) {
+ this.selectedItem = item;
}
ColumnFactory.setResolutionTypeArray = function(type, array) {
if(type == 'testScript') {
- subGridColumnsTestScript[1].editDropdownOptionsArray = array;
+ for(var i = 0; i < subGridColumnsTestScript.length; i++) {
+ if(subGridColumnsTestScript[i].field == 'resolutionType') {
+ subGridColumnsTestScript[i].editDropdownOptionsArray = array;
+ return;
+ }
+ }
} else {
- subGridColumnsCoverage[1].editDropdownOptionsArray = array;
+ for(var i = 0; i < subGridColumnsCoverage.length; i++) {
+ if(subGridColumnsCoverage[i].field == 'resolutionType') {
+ subGridColumnsCoverage[i].editDropdownOptionsArray = array;
+ return;
+ }
+ }
}
}
@@ -159,7 +178,6 @@ app.factory('ColumnFactory', function() {
enableCellEdit: true
},{
field: 'lastUpdated',
- width: '10%',
displayName: 'Last Ran',
enableCellEdit: false,
filter: {
@@ -168,7 +186,6 @@ app.factory('ColumnFactory', function() {
sortingAlgorithm: dateSorting
}, {
field: 'category',
- width: '10%',
displayName: 'Category',
enableCellEdit: true,
visible: false,
@@ -177,69 +194,204 @@ app.factory('ColumnFactory', function() {
}
}, {
field: 'machine',
- width: '10%',
displayName: 'Station',
enableCellEdit: true,
visible: false,
filter: {
condition: usePureRegex
}
+ },{
+ field: 'creationDate',
+ displayName: 'Creation Date',
+ enableCellEdit: false,
+ visible: false,
+ filter: {
+ condition: usePureRegex
+ },
+ sortingAlgorithm: dateSorting
+ },{
+ field: 'version',
+ displayName: 'Version',
+ enableCellEdit: false,
+ visible: false,
+ filter: {
+ condition: usePureRegex
+ }
}, {
- field: 'elapsedTime',
- width: '10%',
- displayName: 'Elapsed Time',
+ field: 'methodNumber',
+ displayName: 'Method Number',
enableCellEdit: false,
visible: false,
filter: {
condition: usePureRegex
}
- },{
- field: 'creationDate',
- width: '10%',
- displayName: 'Creation Date',
+ }, {
+ field: 'fileNumber',
+ displayName: 'File Number',
enableCellEdit: false,
visible: false,
filter: {
condition: usePureRegex
+ }
+ } ];
+
+ var columnsTestScript = [{
+ field: 'name',
+ displayName: 'Name',
+ cellTemplate: origCellTmpl,
+ filter: {
+ condition: usePureRegex
+ }
+ }, {
+ field: 'status',
+ displayName: 'Status',
+ width: '6%',
+ filter: {
+ condition: usePureRegex
+ }
+ },
+ {
+ field: 'totalPoints',
+ displayName: 'Total',
+ width: '4%',
+ filter: {
+ condition: usePureRegex
+ }
+ },
+ {
+ field: 'failureCount',
+ displayName: 'Failure Count',
+ width: '4%',
+ filter: {
+ condition: usePureRegex
+ }
+ }, {
+ field: 'discrepanciesAsRanges',
+ displayName: 'Failed Points',
+ filter: {
+ condition: findPointInRanges
+ }
+ }, {
+ field: 'assignee',
+ displayName: 'Assignee',
+ width: '10%',
+ enableCellEdit: false,
+ cellTemplate: assigneeCellTmpl,
+ filter: {
+ condition: usePureRegex
+ }
+ } ,
+ {
+ field: 'team',
+ displayName: 'Team',
+ width: '5%',
+ enableCellEdit: true,
+ filter: {
+ condition: usePureRegex
+ }
+ }, {
+ field: 'itemNotes',
+ width: '10%',
+ displayName: 'Item Notes',
+ enableCellEdit: true,
+ filter: {
+ condition: usePureRegex
+ }
+ },{
+ field: 'needsRerun',
+ width: '4%',
+ displayName: 'Rerun?',
+ type: 'boolean',
+ filter: {
+ },
+ cellTemplate: chkBoxTemplate,
+ enableCellEdit: true
+ },{
+ field: 'lastUpdated',
+ displayName: 'Last Ran',
+ enableCellEdit: false,
+ filter: {
+ condition: usePureRegex
},
sortingAlgorithm: dateSorting
},{
field: 'aborted',
- width: '10%',
+ width: '4%',
displayName: 'Aborted',
enableCellEdit: false,
+ filter: {
+ condition: usePureRegex
+ },
+ }, {
+ field: 'category',
+ displayName: 'Category',
+ enableCellEdit: true,
visible: false,
filter: {
condition: usePureRegex
}
- }, {
+ }, {
+ field: 'machine',
+ displayName: 'Station',
+ enableCellEdit: true,
+ visible: false,
+ filter: {
+ condition: usePureRegex
+ }
+ },{
+ field: 'elapsedTime',
+ displayName: 'Elapsed Time',
+ enableCellEdit: false,
+ visible: false,
+ filter: {
+ condition: usePureRegex
+ },
+ sortingAlgorithm: dateSorting
+ },{
+ field: 'creationDate',
+ displayName: 'Creation Date',
+ enableCellEdit: false,
+ visible: false,
+ filter: {
+ condition: usePureRegex
+ },
+ sortingAlgorithm: dateSorting
+ },{
field: 'version',
- width: '10%',
displayName: 'Version',
enableCellEdit: false,
visible: false,
filter: {
condition: usePureRegex
}
- }
- ];
+ } ];
- var origSubCellTmpl = '<div class="ui-grid-cell-contents" title="TOOLTIP">{{ grid.appScope.getText2(row.entity) }}</div>';
+ var resolutionTmpl = '<div class="ui-grid-cell-contents placeholder" ng-class="{\'placeholder-parent\': !row.entity.isLeaf, \'complete-parent\': grid.appScope.isComplete(row.entity), \'none-complete-parent\': grid.appScope.isNoneComplete(row.entity), \'some-complete-parent\': grid.appScope.isSomeComplete(row.entity), \'almost-complete-parent\': grid.appScope.isAlmostComplete(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 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>';
var getInvalidRes = function getInvalidRes(annotation) {
return annotation.resolution != null && annotation.resolution != "" && !annotation.isResolutionValid;
}
- var subGridColumnsCoverage = [{
+ var subGridColumnsCoverage = [
+ {
+ field: 'blank',
+ displayName: 'Method',
+ cellTemplate: codeTemplate,
+ enableCellEdit: false,
+ width: '4%',
+ },
+ {
field: 'locationRefs',
displayName: 'Code Line',
enableCellEdit: false,
width: '5%',
},
{
- name: 'resolutionType',
+ field: 'resolutionType',
displayName: 'Resolution Type',
editableCellTemplate: '/dispo/views/dropdown.html',
width: '7%',
@@ -252,6 +404,7 @@ app.factory('ColumnFactory', function() {
field: 'resolution',
displayName: 'Resolution',
width: '15%',
+ cellTemplate: resolutionTmpl,
cellEditableCondition: function($scope) {
return $scope.row.entity.isLeaf && !$scope.row.entity.isDefault
}
@@ -276,7 +429,7 @@ app.factory('ColumnFactory', function() {
cellTemplate: subGridOrigTmpl
},
{
- name: 'resolutionType',
+ field: 'resolutionType',
displayName: 'PCR Type',
editableCellTemplate: '/dispo/views/dropdown.html',
editDropdownIdLabel: 'text',
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 abe7c06e4d..b93244e0d8 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
@@ -142,7 +142,7 @@ app.controller('userController', [
} else if (!bSplit[1].match("RESULT") && aSplit[1].match("RESULT")) {
return 1;
} else {
- return b.locationRefs.localeCompare(a.locationRefs);
+ return a.locationRefs.localeCompare(b.locationRefs);
}
} else {
return delta;
@@ -286,13 +286,56 @@ app.controller('userController', [
$scope.gridOptions.columnDefs = ColumnFactory.getColumns($scope.type, window.innerWidth);
- $scope.getText2 = function(annotation) {
- if (annotation.childrenComplete) {
- return "COMPLETE"
- } else {
+ $scope.getTextResolutionType = function(annotation) {
+ if (annotation.isLeaf) {
return annotation.resolutionType;
+ } else {
+ return "-----------------";
}
}
+
+ $scope.getTextResolution = function(annotation) {
+ if (annotation.isLeaf) {
+ return annotation.resolution;
+ } else {
+ if(annotation.isTopLevel) {
+ var str = [];
+ var pct = (annotation.childMetadata.runningCompleteCount / annotation.childMetadata.runningTotalCount);
+ pct = pct.toLocaleString("en", {style: "percent"});
+ str.push(annotation.childMetadata.runningCompleteCount, "/", annotation.childMetadata.runningTotalCount, " (", pct, ")");
+ return str.join("");
+ } else {
+ return annotation.childMetadata.completeCount + " / " + annotation.childMetadata.totalCount;
+ }
+ }
+ }
+
+ $scope.isComplete = function(annotation) {
+ if(annotation.isTopLevel) {
+ return annotation.childMetadata.runningCompleteCount == annotation.childMetadata.runningTotalCount;
+ }
+ }
+
+ $scope.isNoneComplete = function(annotation) {
+ if(annotation.isTopLevel) {
+ var pct = annotation.childMetadata.runningCompleteCount / annotation.childMetadata.runningTotalCount;
+ return pct <=.33;
+ }
+ }
+
+ $scope.isSomeComplete = function(annotation) {
+ if(annotation.isTopLevel) {
+ var pct = annotation.childMetadata.runningCompleteCount / annotation.childMetadata.runningTotalCount;
+ return .33 < pct && pct <=.5;
+ }
+ }
+
+ $scope.isAlmostComplete = function(annotation) {
+ if(annotation.isTopLevel) {
+ var pct = annotation.childMetadata.runningCompleteCount / annotation.childMetadata.runningTotalCount;
+ return .5 < pct && pct < 1;
+ }
+ }
$scope.subGridOptions = {
data: 'annotations',
@@ -344,7 +387,33 @@ app.controller('userController', [
$scope.subGridOptions.data = [];
$scope.subGridOptions.columnDefs = ColumnFactory.getSubGridColumns($rootScope.type);
+ $scope.getItemDetails = function(item, row) {
+ if (!$scope.isMultiEditView) {
+ $scope.selectedItem = item;
+ ColumnFactory.setSelectedItem(item);
+ Annotation.query({
+ programId: $scope.programSelection,
+ setId: $scope.setSelection,
+ itemId: item.guid
+ }, function(data) {
+ $scope.subGridOptions.data = [];
+ $scope.annotations = data;
+ if ($scope.isCoverage) {
+ $scope.annotations.sort(sortStuff);
+ $scope.annotations = $scope.treeAnnotations(data);
+ $scope.writeoutNode($scope.annotations, 0, $scope.subGridOptions.data);
+ } else {
+ var blankAnnotation = new Annotation();
+ $scope.annotations.push(blankAnnotation);
+ $scope.subGridOptions.data = $scope.annotations;
+ }
+
+ $scope.gridApi.selection.selectRow(row.entity, $scope.gridApi.grid);
+ });
+ }
+ }
+
$scope.treeAnnotations = function(annotations) {
var annotationsStack = annotations.slice();
var toReturn = [];
@@ -352,23 +421,29 @@ app.controller('userController', [
while (annotationsStack.length > 0) {
var annotation = annotationsStack[annotationsStack.length - 1] // peek
if (annotation.name.match(/\d+\.\w+\..+/gi)) {
- var annotationWithChildren = {};
+ var parentAnnotation = {};
annotation.id = annotation.guid;
var leadingLocRefs = annotation.locationRefs.split(".")[0];
- annotationWithChildren.locationRefs = leadingLocRefs;
- annotationWithChildren.id = annotation.guid;
- annotationWithChildren.guid = annotation.guid;
- annotationWithChildren.parentId = -1;
-
- var metaData = {};
- metaData.childrenComplete = true;
-
- var childrenStack = $scope.getAnnotationsStartsWith(annotationsStack, leadingLocRefs, true);
- var childrenAsTree = $scope.createTreeAnnotations(annotationsStack, annotationWithChildren, childrenStack, 1, metaData);
- annotationWithChildren.children = childrenAsTree;
- annotationWithChildren.$treeLevel = 0;
- annotationWithChildren.childrenComplete = metaData.childrenComplete;
- toReturn.push(annotationWithChildren);
+ parentAnnotation.locationRefs = leadingLocRefs;
+ parentAnnotation.id = annotation.guid;
+ parentAnnotation.guid = annotation.guid;
+ parentAnnotation.parentId = -1;
+
+ var metadata = {};
+ metadata.childrenComplete = true;
+ metadata.totalCount = 0;
+ metadata.completeCount = 0;
+ metadata.runningTotalCount = 0;
+ metadata.runningCompleteCount = 0;
+ parentAnnotation.isTopLevel = true;
+ parentAnnotation.childMetadata = metadata;
+
+ var childrenStack = $scope.getAnnotationsStartsWith(annotationsStack, leadingLocRefs, false, true);
+ var childrenAsTree = $scope.createTreeAnnotations(annotationsStack, parentAnnotation, childrenStack, 1, metadata);
+ parentAnnotation.children = childrenAsTree;
+ parentAnnotation.$treeLevel = 0;
+
+ toReturn.push(parentAnnotation);
} else {
annotationsStack.pop();
annotation.children = [];
@@ -383,37 +458,51 @@ app.controller('userController', [
}
- $scope.createTreeAnnotations = function(annotationsStack, parent, childrenStack, level, metaData) {
+ $scope.createTreeAnnotations = function(annotationsStack, parent, childrenStack, level, metadata) {
if (level >= 2) {
- var children = $scope.getAnnotationsStartsWith(childrenStack, parent.locationRefs, true);
+ metadata.childrenComplete = true;
+ metadata.totalCount = 0;
+ metadata.completeCount = 0;
+ var children = $scope.getAnnotationsStartsWith(childrenStack, parent.locationRefs, false, true);
for (var i = 0; i < children.length; i++) {
+ metadata.totalCount++;
children[i].$$treeLevel = level;
children[i].children = [];
children[i].parentId = parent.id;
children[i].isLeaf = true;
- if (children[i].resolution === "") {
- metaData.childrenComplete = false;
+ metadata.text = children[i].customerNotes;
+ children[i].customerNotes = '';
+ if ((children[i].resolution === "" || children[i].resolutionType === "") && !children[i].isDefault) {
+ metadata.allComplete = false;
+ } else {
+ metadata.completeCount++;
}
}
return children;
} else {
var toReturn = [];
while (childrenStack.length > 0) {
+ metadata.totalCount++;
var annotation = childrenStack[0]
var leadingLocRefs = $scope.createLocRef(annotation.locationRefs, level);
- var workingGen = {};
- workingGen.id = $scope.generateId();
- workingGen.parentId = parent.id;
- workingGen.locationRefs = leadingLocRefs;
- workingGen.$$treeLevel = level;
- var metaDataCur = {};
- metaDataCur.childrenComplete = true;
- workingGen.children = $scope.createTreeAnnotations(annotationsStack, workingGen, childrenStack, level + 1, metaDataCur);
- metaData.childrenComplete = metaData.childrenComplete && metaDataCur.childrenComplete;
- workingGen.childrenComplete = metaData.childrenComplete;
- toReturn.push(workingGen);
+ var self = {};
+ self.id = $scope.generateId();
+ self.parentId = parent.id;
+ self.locationRefs = leadingLocRefs;
+ self.$$treeLevel = level;
+ var childMetadata = {};
+ self.children = $scope.createTreeAnnotations(annotationsStack, self, childrenStack, level + 1, childMetadata);
+ self.childMetadata = childMetadata
+ metadata.childrenComplete = metadata.childrenComplete && childMetadata.childMetadata;
+ if(metadata.childrenComplete) {
+ metadata.completeCount++;
+ }
+ metadata.runningTotalCount += childMetadata.totalCount;
+ metadata.runningCompleteCount += childMetadata.completeCount;
+
+ toReturn.push(self);
}
return toReturn;
}
@@ -431,14 +520,17 @@ app.controller('userController', [
}
- $scope.getAnnotationsStartsWith = function(annotationsStack, startsWith, isPop) {
- var startsWithRegex = "^" + startsWith + "($|\\.)";
+ $scope.getAnnotationsStartsWith = function(annotationsStack, startsWith, isWholeString, isPop) {
+ var searchStr = startsWith;
+ if(!isWholeString) {
+ searchStr = startsWith + ".";
+ }
var annotationsStackOrig = annotationsStack.slice();
var toReturn = [];
var toDelete = [];
for (var i = 0; i < annotationsStack.length; i++) {
var annotation = annotationsStackOrig[i];
- if (annotation.locationRefs.match(startsWithRegex)) {
+ if ((!isWholeString && annotation.locationRefs.startsWith(searchStr)) || (isWholeString && annotation.locationRefs == searchStr)) {
toDelete.push(i);
toReturn.push(annotation);
}
@@ -451,32 +543,6 @@ app.controller('userController', [
return toReturn;
}
- $scope.getItemDetails = function(item, row) {
- if (!$scope.isMultiEditView) {
- $scope.selectedItem = item;
- Annotation.query({
- programId: $scope.programSelection,
- setId: $scope.setSelection,
- itemId: item.guid
- }, function(data) {
- $scope.subGridOptions.data = [];
- $scope.annotations = data;
- if ($scope.isCoverage) {
- $scope.annotations.sort(sortStuff);
- $scope.annotations = $scope.treeAnnotations(data);
- $scope.writeoutNode($scope.annotations, 0, $scope.subGridOptions.data);
- } else {
- var blankAnnotation = new Annotation();
- $scope.annotations.push(blankAnnotation);
- $scope.subGridOptions.data = $scope.annotations;
- }
-
- $scope.gridApi.selection.selectRow(row.entity, $scope.gridApi.grid);
- });
- }
-
- }
-
$scope.searchAnnotations = function() {
Item.get({
programId: $scope.programSelection,
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 ec674d2413..985c268260 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
@@ -48,7 +48,7 @@
<button ng-show="!isCoverage && selectedItem && selectedItem.failureCount > 1 " type="button" class="btn btn-primary" id="openSourceFileButton" ng-click="showAllFailuresModal()">Show All Failures</button>
</div>
</div>
- <div ng-show="annotations.length > 0" id="subGrid" class="subgrid grid" ui-grid="subGridOptions" ui-grid-edit ui-grid-nav ui-grid-resize-columns ui-grid-auto-resize ui-grid-tree-view></div>
+ <div ng-show="annotations.length > 0" id="subGrid" class="subgrid grid" ui-grid="subGridOptions" ui-grid-exporter ui-grid-edit ui-grid-nav ui-grid-resize-columns ui-grid-auto-resize ui-grid-tree-view></div>
</div>
</div>
</div>

Back to the top