Skip to content

Commit 0993e13

Browse files
Merge branch 'features/HPCDATAMGM-1889-version2' into releases/3.23.0
2 parents f8a3d69 + e9702f5 commit 0993e13

File tree

5 files changed

+10
-106
lines changed

5 files changed

+10
-106
lines changed

src/hpc-web/src/main/resources/static/css/style.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5223,3 +5223,8 @@ input:checked + .slider:before {
52235223
img.softlink {
52245224
margin-left: 3px;
52255225
}
5226+
5227+
/* Search result grid height */
5228+
.search-result-grid {
5229+
height: 550px;
5230+
}

src/hpc-web/src/main/resources/templates/collectionsearchresult.html

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@
132132
$scope.selectedRows = [];
133133
$scope.currentPage = currentPage;
134134
$scope.source = source;
135-
$scope.tableHeight = 'height: 600px';
136135

137136
$scope.selectAll = function() {
138137
$scope.gridApi.selection.selectAllRows();
@@ -142,38 +141,13 @@
142141
$scope.gridApi.treeBase.expandAllRows();
143142
};
144143

145-
function getTableHeight(totalPage, currentPage, pageSize, dataLen) {
146-
var rowHeight = 30; // row height
147-
var headerHeight = 60; // header height
148-
var footerHeight = 60; // bottom scroll bar height
149-
var totalH = 0;
150-
if (totalPage > 1) {
151-
if (currentPage < totalPage) {
152-
totalH = pageSize * rowHeight + headerHeight + footerHeight;
153-
} else {
154-
var lastPageSize = dataLen % pageSize;
155-
if (lastPageSize === 0) {
156-
totalH = pageSize * rowHeight + headerHeight + footerHeight;
157-
} else {
158-
totalH = lastPageSize * rowHeight + headerHeight + footerHeight;
159-
}
160-
}
161-
console.log(totalH);
162-
} else {
163-
totalH = dataLen * rowHeight + headerHeight + footerHeight;
164-
}
165-
return 'height: ' + (totalH) + 'px';
166-
}
167-
168-
169144
$scope.gridOptions1.onRegisterApi = function(gridApi) {
170145
//set gridApi on scope
171146
$scope.gridApi = gridApi;
172147
$scope.totalPages = totalPages;
173148
$scope.currentPage = currentPage;
174149
$scope.totalRows = totalRows;
175150
$scope.currentPageSize = currentPageSize;
176-
$scope.tableHeight = getTableHeight($scope.totalPage, $scope.currentPage, $scope.pageSize, $scope.gridOptions1.data.length);
177151

178152
$interval(function() {
179153
if(hpcSelectedDatafileList != null)
@@ -476,7 +450,7 @@ <h2 align="left">
476450
<div id="grid1" ui-grid="gridOptions1" ui-grid-exporter="true" ui-grid-cellNav="true"
477451
ui-grid-pagination="true" ui-grid-grouping="true"
478452
ui-grid-resize-columns="true" ui-grid-move-columns="true" ui-grid-selection="true"
479-
style="{{tableHeight}}"></div>
453+
class="search-result-grid"></div>
480454
</div>
481455
</div>
482456
</div>

src/hpc-web/src/main/resources/templates/collectionsearchresultdetail.html

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -182,34 +182,10 @@
182182
$scope.selectedRows = [];
183183
$scope.currentPage = currentPage;
184184
$scope.source = source;
185-
$scope.tableHeight = 'height: 600px';
186185

187186
$scope.selectAll = function() {
188187
$scope.gridApi.selection.selectAllRows();
189188
};
190-
191-
function getTableHeight(totalPage, currentPage, pageSize, dataLen) {
192-
var rowHeight = 30; // row height
193-
var headerHeight = 60; // header height
194-
var footerHeight = 60; // bottom scroll bar height
195-
var totalH = 0;
196-
if (totalPage > 1) {
197-
if (currentPage < totalPage) {
198-
totalH = pageSize * rowHeight + headerHeight + footerHeight;
199-
} else {
200-
var lastPageSize = dataLen % pageSize;
201-
if (lastPageSize === 0) {
202-
totalH = pageSize * rowHeight + headerHeight + footerHeight;
203-
} else {
204-
totalH = lastPageSize * rowHeight + headerHeight + footerHeight;
205-
}
206-
}
207-
console.log(totalH);
208-
} else {
209-
totalH = dataLen * rowHeight + headerHeight + footerHeight;
210-
}
211-
return 'height: ' + (totalH) + 'px';
212-
}
213189

214190
$scope.gridOptions1.onRegisterApi = function(gridApi) {
215191
//set gridApi on scope
@@ -218,8 +194,7 @@
218194
$scope.currentPage = currentPage;
219195
$scope.totalRows = totalRows;
220196
$scope.currentPageSize = currentPageSize;
221-
$scope.tableHeight = getTableHeight($scope.totalPage, $scope.currentPage, $scope.pageSize, $scope.gridOptions1.data.length);
222-
197+
223198
$interval(function() {
224199
if(hpcSelectedDatafileList != null)
225200
{
@@ -771,7 +746,7 @@ <h2 align="left">
771746
<div id="grid1" ui-grid="gridOptions1" ui-grid-exporter="true" ui-grid-cellNav="true"
772747
ui-grid-pagination="true" ui-grid-grouping="true"
773748
ui-grid-resize-columns="true" ui-grid-move-columns="true" ui-grid-selection="true"
774-
style="{{tableHeight}}"></div>
749+
class="search-result-grid"></div>
775750
</div>
776751
</div>
777752
</div>

src/hpc-web/src/main/resources/templates/dataobjectsearchresult.html

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@
147147
$scope.gridOptions1.data = results;
148148
$scope.selectedRows = [];
149149
$scope.source = source;
150-
$scope.tableHeight = 'height: 600px';
151150

152151
$scope.selectAll = function() {
153152
$scope.gridApi.selection.selectAllRows();
@@ -157,37 +156,13 @@
157156
$scope.gridApi.treeBase.expandAllRows();
158157
};
159158

160-
function getTableHeight(totalPage, currentPage, pageSize, dataLen) {
161-
var rowHeight = 30; // row height
162-
var headerHeight = 60; // header height
163-
var footerHeight = 60; // bottom scroll bar height
164-
var totalH = 0;
165-
if (totalPage > 1) {
166-
if (currentPage < totalPage) {
167-
totalH = pageSize * rowHeight + headerHeight + footerHeight;
168-
} else {
169-
var lastPageSize = dataLen % pageSize;
170-
if (lastPageSize === 0) {
171-
totalH = pageSize * rowHeight + headerHeight + footerHeight;
172-
} else {
173-
totalH = lastPageSize * rowHeight + headerHeight + footerHeight;
174-
}
175-
}
176-
console.log(totalH);
177-
} else {
178-
totalH = dataLen * rowHeight + headerHeight + footerHeight;
179-
}
180-
return 'height: ' + (totalH) + 'px';
181-
}
182-
183159
$scope.gridOptions1.onRegisterApi = function(gridApi) {
184160
//set gridApi on scope
185161
$scope.gridApi = gridApi;
186162
$scope.totalPages = totalPages;
187163
$scope.currentPage = currentPage;
188164
$scope.totalRows = totalRows;
189165
$scope.currentPageSize = currentPageSize;
190-
$scope.tableHeight = getTableHeight($scope.totalPage, $scope.currentPage, $scope.pageSize, $scope.gridOptions1.data.length);
191166

192167
$interval(function() {
193168
if(hpcSelectedDatafileList != null)
@@ -541,7 +516,7 @@ <h2 align="left">
541516
<div id="grid1" ui-grid="gridOptions1" ui-grid-exporter="true" ui-grid-cellNav="true"
542517
ui-grid-pagination="true" ui-grid-grouping="true"
543518
ui-grid-resize-columns="true" ui-grid-move-columns="true" ui-grid-selection="true"
544-
style="{{tableHeight}}"></div>
519+
class="search-result-grid"></div>
545520

546521
</div>
547522
</div>

src/hpc-web/src/main/resources/templates/dataobjectsearchresultdetail.html

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -209,43 +209,18 @@
209209
$scope.gridOptions1.data = results;
210210
$scope.selectedRows = [];
211211
$scope.source = source;
212-
$scope.tableHeight = 'height: 600px';
213212

214213
$scope.selectAll = function() {
215214
$scope.gridApi.selection.selectAllRows();
216215
};
217216

218-
function getTableHeight(totalPage, currentPage, pageSize, dataLen) {
219-
var rowHeight = 30; // row height
220-
var headerHeight = 60; // header height
221-
var footerHeight = 60; // bottom scroll bar height
222-
var totalH = 0;
223-
if (totalPage > 1) {
224-
if (currentPage < totalPage) {
225-
totalH = pageSize * rowHeight + headerHeight + footerHeight;
226-
} else {
227-
var lastPageSize = dataLen % pageSize;
228-
if (lastPageSize === 0) {
229-
totalH = pageSize * rowHeight + headerHeight + footerHeight;
230-
} else {
231-
totalH = lastPageSize * rowHeight + headerHeight + footerHeight;
232-
}
233-
}
234-
console.log(totalH);
235-
} else {
236-
totalH = dataLen * rowHeight + headerHeight + footerHeight;
237-
}
238-
return 'height: ' + (totalH) + 'px';
239-
}
240-
241217
$scope.gridOptions1.onRegisterApi = function(gridApi) {
242218
//set gridApi on scope
243219
$scope.gridApi = gridApi;
244220
$scope.totalPages = totalPages;
245221
$scope.currentPage = currentPage;
246222
$scope.totalRows = totalRows;
247223
$scope.currentPageSize = currentPageSize;
248-
$scope.tableHeight = getTableHeight($scope.totalPage, $scope.currentPage, $scope.pageSize, $scope.gridOptions1.data.length);
249224

250225
$interval(function() {
251226
if(hpcSelectedDatafileList != null)
@@ -836,7 +811,7 @@ <h2 align="left">
836811
<div id="grid1" ui-grid="gridOptions1" ui-grid-exporter="true" ui-grid-cellNav="true"
837812
ui-grid-pagination="true" ui-grid-grouping="true"
838813
ui-grid-resize-columns="true" ui-grid-move-columns="true" ui-grid-selection="true"
839-
style="{{tableHeight}}"></div>
814+
class="search-result-grid"></div>
840815

841816
</div>
842817
</div>

0 commit comments

Comments
 (0)