Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngel Avila2014-12-05 03:03:24 +0000
committerAngel Avila2014-12-05 03:03:24 +0000
commite50271907ca889870a01f1c0ccf6a030a0b1ca35 (patch)
tree70557079b81966ea594faed9966692c011a62961 /plugins
parentda3e7e89217e0a4846a03d91402a149f1d59bbf3 (diff)
downloadorg.eclipse.osee-e50271907ca889870a01f1c0ccf6a030a0b1ca35.tar.gz
org.eclipse.osee-e50271907ca889870a01f1c0ccf6a030a0b1ca35.tar.xz
org.eclipse.osee-e50271907ca889870a01f1c0ccf6a030a0b1ca35.zip
feature: Add filter by column to Dispo
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/web/js/userController.js99
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/web/templates/nameFilterTmpl.html12
2 files changed, 88 insertions, 23 deletions
diff --git a/plugins/org.eclipse.osee.disposition.rest/web/js/userController.js b/plugins/org.eclipse.osee.disposition.rest/web/js/userController.js
index 5520908fb5f..51fa785847a 100644
--- a/plugins/org.eclipse.osee.disposition.rest/web/js/userController.js
+++ b/plugins/org.eclipse.osee.disposition.rest/web/js/userController.js
@@ -173,28 +173,35 @@ app.controller('userController', [
$scope.smallColumns = [{
field: 'name',
displayName: 'Name',
- cellTemplate: origCellTmpl
+ cellTemplate: origCellTmpl,
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
}, {
field: 'status',
displayName: 'Status',
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
}, {
field: 'totalPoints',
displayName: 'Total',
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
}, {
field: 'failureCount',
displayName: 'Failure Count',
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
}, {
field: 'discrepanciesAsRanges',
displayName: 'Failed Points',
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
}, {
field: 'assignee',
displayName: 'Assignee',
enableCellEdit: false,
- cellTemplate: assigneeCellTmpl
+ cellTemplate: assigneeCellTmpl,
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
}, {
field: 'itemNotes',
displayName: 'Script Notes',
- cellTemplate: cellEditNotes
+ cellTemplate: cellEditableTemplate,
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
},{
field: 'needsRerun',
displayName: 'Rerun?',
@@ -205,67 +212,81 @@ app.controller('userController', [
field: 'lastUpdated',
displayName: 'Last Ran',
enableCellEdit: false,
- visible: false
+ visible: false,
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
}, {
field: 'category',
displayName: 'Category',
enableCellEdit: true,
- visible: false
+ visible: false,
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
}, {
field: 'machine',
displayName: 'Station',
enableCellEdit: true,
- visible: false
+ visible: false,
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
}, {
field: 'elapsedTime',
displayName: 'Elapsed Time',
enableCellEdit: false,
- visible: false
+ visible: false,
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
},{
field: 'creationDate',
displayName: 'Creation Date',
enableCellEdit: false,
- visible: false
+ visible: false,
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
},{
field: 'aborted',
displayName: 'Aborted',
enableCellEdit: false,
- visible: false
+ visible: false,
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
}, {
field: 'version',
displayName: 'Version',
enableCellEdit: false,
- visible: false
+ visible: false,
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
}];
$scope.wideColumns = [{
field: 'name',
displayName: 'Name',
width: 350,
- cellTemplate: origCellTmpl
+ cellTemplate: origCellTmpl,
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
}, {
field: 'status',
displayName: 'Status',
- width: 100
+ width: 100,
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
}, {
field: 'totalPoints',
displayName: 'Total',
- width: 100
+ width: 100,
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
}, {
field: 'failureCount',
displayName: 'Failure Count',
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
}, {
field: 'discrepanciesAsRanges',
displayName: 'Failed Points',
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
}, {
field: 'assignee',
displayName: 'Assignee',
enableCellEdit: false,
- cellTemplate: assigneeCellTmpl
+ cellTemplate: assigneeCellTmpl,
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
}, {
field: 'itemNotes',
displayName: 'Script Notes',
- cellTemplate: cellEditNotes
+ cellTemplate: cellEditableTemplate,
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
},{
field: 'needsRerun',
displayName: 'Rerun?',
@@ -277,37 +298,44 @@ app.controller('userController', [
field: 'lastUpdated',
displayName: 'Last Ran',
enableCellEdit: false,
- visible: false
+ visible: false,
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
}, {
field: 'category',
displayName: 'Category',
enableCellEdit: true,
- visible: false
+ visible: false,
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
}, {
field: 'machine',
displayName: 'Station',
enableCellEdit: true,
- visible: false
+ visible: false,
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
}, {
field: 'elapsedTime',
displayName: 'Elapsed Time',
enableCellEdit: false,
- visible: false
+ visible: false,
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
},{
field: 'creationDate',
displayName: 'Creation Date',
enableCellEdit: false,
- visible: false
+ visible: false,
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
},{
field: 'aborted',
displayName: 'Aborted',
enableCellEdit: false,
- visible: false
+ visible: false,
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
}, {
field: 'version',
displayName: 'Version',
enableCellEdit: false,
- visible: false
+ visible: false,
+ headerCellTemplate: 'templates/nameFilterTmpl.html'
}];
if(window.innerWidth < 1000) {
@@ -316,6 +344,29 @@ app.controller('userController', [
$scope.columns = $scope.wideColumns;
}
+
+ var filterBarPlugin = {
+ init: function(scope, grid) {
+ filterBarPlugin.scope = scope;
+ filterBarPlugin.grid = grid;
+ $scope.$watch(function() {
+ var searchQuery = "";
+ angular.forEach(filterBarPlugin.scope.columns, function(col) {
+ if (col.visible && col.filterText) {
+ var filterText = (col.filterText.indexOf('*') == 0 ? col.filterText.replace('*', '') : "^" + col.filterText) + ";";
+ searchQuery += col.displayName + ": " + filterText;
+ }
+ });
+ return searchQuery;
+ }, function(searchQuery) {
+ filterBarPlugin.scope.$parent.filterText = searchQuery;
+ filterBarPlugin.grid.searchProvider.evalFilter();
+ });
+ },
+ scope: undefined,
+ grid: undefined,
+ };
+
$scope.gridOptions = {
data: 'items',
enableHighlighting: true,
@@ -329,7 +380,9 @@ app.controller('userController', [
showFilter: true,
noTabInterference: true,
tabIndex: 0,
- columnDefs: 'columns'
+ columnDefs: 'columns',
+ plugins: [filterBarPlugin],
+ headerRowHeight: 60 // give room for filter bar
};
diff --git a/plugins/org.eclipse.osee.disposition.rest/web/templates/nameFilterTmpl.html b/plugins/org.eclipse.osee.disposition.rest/web/templates/nameFilterTmpl.html
new file mode 100644
index 00000000000..8c6c4a8e665
--- /dev/null
+++ b/plugins/org.eclipse.osee.disposition.rest/web/templates/nameFilterTmpl.html
@@ -0,0 +1,12 @@
+<div class="ngHeaderSortColumn {{col.headerClass}}" ng-style="{'cursor': col.cursor}" ng-class="{ 'ngSorted': !noSortVisible }">
+ <div ng-click="col.sort($event)"ng-class="'colt' + col.index" class="ngHeaderText">{{col.displayName}}</div>
+ <div class="ngSortButtonDown" ng-show="col.showSortButtonDown()"></div>
+ <div class="ngSortButtonUp" ng-show="col.showSortButtonUp()"></div>
+ <div class="ngSortPriority">{{col.sortPriority}}</div>
+ <div ng-class="{ ngPinnedIcon: col.pinned, ngUnPinnedIcon: !col.pinned }" ng-click="togglePin(col)" ng-show="col.pinnable"></div>
+</div>
+
+<input type="text" ng-click="stopClickProp($event)" placeholder="Filter..." ng-model="col.filterText" style="position: absolute; width: 100%; top: 30px; bottom: 30px; left: 0; bottom:0;"/>
+<div ng-show="col.resizable" class="ngHeaderGrip" ng-click="col.gripClick($event)" ng-mousedown="col.gripOnMouseDown($event)"></div>
+
+

Back to the top