Skip to content

Commit

Permalink
Merge branch 'hotfix-4.1.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
hplahar committed Dec 10, 2014
2 parents 36e4262 + 1b8b2f6 commit 91b96ac
Show file tree
Hide file tree
Showing 16 changed files with 52 additions and 37 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>org.jbei</groupId>
<artifactId>ice</artifactId>
<packaging>war</packaging>
<version>4.1.5</version>
<version>4.1.6</version>
<name>ice</name>
<description>Inventory of Composable Elements (ICE) for Synthetic Biology</description>
<repositories>
Expand Down
11 changes: 3 additions & 8 deletions src/main/java/org/jbei/ice/lib/account/AccountController.java
Original file line number Diff line number Diff line change
Expand Up @@ -277,15 +277,10 @@ public Account getByEmail(String email) {
return dao.getByEmail(email);
}

public long getAccountId(String email) throws ControllerException {
Account account;
try {
account = dao.getByEmail(email);
} catch (DAOException e) {
throw new ControllerException(e);
}
public long getAccountId(String email) {
Account account = dao.getByEmail(email);
if (account == null)
throw new ControllerException("Could not retrieve account for " + email);
throw new IllegalArgumentException("No account found with email " + email);
return account.getId();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ public BulkUploadInfo updateStatus(String userId, long id, BulkUploadStatus stat
if (new BulkUploadController().approveBulkImport(account, id))
return upload.toDataTransferObject();
return null;

case BULK_EDIT:
upload.getContents().clear();
dao.delete(upload);
return upload.toDataTransferObject();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ public BulkUploadInfo create(String userId, BulkUploadInfo info) {
upload.setAccount(account);
upload.setCreationTime(new Date());
upload.setLastUpdateTime(upload.getCreationTime());
upload.setStatus(BulkUploadStatus.IN_PROGRESS);
if (info.getStatus() == BulkUploadStatus.BULK_EDIT)
upload.setStatus(BulkUploadStatus.BULK_EDIT);
else
upload.setStatus(BulkUploadStatus.IN_PROGRESS);

upload.setImportType(info.getType());
upload = dao.create(upload);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ public enum BulkUploadStatus implements IDataTransferModel {

APPROVED,
PENDING_APPROVAL,
BULK_EDIT,
IN_PROGRESS
}
9 changes: 6 additions & 3 deletions src/main/java/org/jbei/ice/lib/folder/FolderController.java
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public boolean removeFolderContents(String userId, long folderId, ArrayList<Long
/**
* Retrieves the folder specified in the parameter and contents
*
* @param userId unique identifier for user making request
* @param userId unique identifier for user making request. If null, folder must have public read privs
* @param folderId unique identifier for folder to be retrieved
* @param sort sort order for folder content retrieval
* @param asc sort order for folder content retrieval; ascending if true
Expand All @@ -213,8 +213,11 @@ public FolderDetails retrieveFolderContents(String userId, long folderId, Column
FolderDetails details = folder.toDataTransferObject();
long folderSize = dao.getFolderSize(folderId);
details.setCount(folderSize);
ArrayList<AccessPermission> permissions = getAndFilterFolderPermissions(userId, folder);
details.setAccessPermissions(permissions);

if (userId != null) {
ArrayList<AccessPermission> permissions = getAndFilterFolderPermissions(userId, folder);
details.setAccessPermissions(permissions);
}

details.setPublicReadAccess(permissionsController.isPublicVisible(folder));
Account owner = accountController.getByEmail(folder.getOwnerEmail());
Expand Down
Binary file removed src/main/webapp/img/sequence.gif
Binary file not shown.
2 changes: 1 addition & 1 deletion src/main/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
<a href="http://public-registry.jbei.org/manual">Help</a>
</td>
<td align="left" style="vertical-align: top;">
<div>&nbsp; | &nbsp; v4.1.5</div>
<div>&nbsp; | &nbsp; v4.1.6</div>
</td>
</tr>
</table>
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/scripts/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ iceControllers.controller('ActionMenuController', function ($scope, $window, $ro
}

// first create bulk upload
upload.create({name:"Bulk Edit", type:type, entryList:selectedEntries}, function (result) {
upload.create({name:"Bulk Edit", type:type, status:'BULK_EDIT', entryList:selectedEntries}, function (result) {
console.log(result);
$location.path("/upload/" + result.id);
}, function (error) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/scripts/entry/entryService.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ angular.module('ice.entry.service', [])
},

canDelete:function () {
return ($rootScope.user.isAdmin || canDelete) && selectedSearchResultsCount > 0;
return (($rootScope.user && $rootScope.user.isAdmin) || canDelete) && selectedSearchResultsCount > 0;
},

// resets all selected and send notifications
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/scripts/search/search-results.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ <h4 ng-if="isWebSearch()">
popover-placement="right">{{result.entryInfo.partId}}</a>
</td>
<td>{{result.entryInfo.name}}</td>
<td title="{{result.entryInfo.shortDescription}}">
<td tooltip="{{result.entryInfo.shortDescription}}">
<div style="width: 400px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis">
{{result.entryInfo.shortDescription}}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/scripts/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ iceServices.factory('Authentication',
},

// todo : use a parameter in isSessionValid to check
isAdmin:function (User) {
isAdmin:function () {
this.isSessionValid().then(function (result) {
if (!result || !result.data || !result.data.isAdmin) {
$location.path("/folders/personal");
Expand Down
36 changes: 20 additions & 16 deletions src/main/webapp/scripts/upload/import.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,28 @@ <h4>
</h4>
</td>
<td style="padding-left: 40px">
<span class="opacity_hover edit_icon font-90em" ng-click="fileUploadModal()">
<i style="font-size: 14px; color: #555" class="fa fa-cloud-upload"></i> File Upload
</span>
<span ng-if="!bulkUpload||bulkUpload.status!='BULK_EDIT'">
<span class="opacity_hover edit_icon font-90em" ng-click="fileUploadModal()">
<i style="font-size: 14px; color: #555" class="fa fa-cloud-upload"></i> File Upload
</span>

<span style="font-weight: normal; color: #ccc">&nbsp;|&nbsp;</span>
<span style="font-weight: normal; color: #ccc">&nbsp;|&nbsp;</span>

<div class="dropdown display-inline">
<span class="opacity_hover edit_icon font-90em dropdown-toggle">
<i style="font-size: 14px; color: #555" class="fa fa-link"></i> Link To
<span class="caret"></span>
<div class="dropdown display-inline">
<span class="opacity_hover edit_icon font-90em dropdown-toggle">
<i style="font-size: 14px; color: #555" class="fa fa-link"></i> Link To
<span class="caret"></span>
</span>
<ul class="dropdown-menu">
<li class="cursor_pointer font-80em"><a ng-click="addExisting=true">Existing
Entry</a>
</li>
<li class="cursor_pointer font-80em" ng-repeat="option in linkOptions">
<a ng-click="addNewPartLink(option.type)"><i>New {{option.display}}</i></a>
</li>
</ul>
</div>
</span>
<ul class="dropdown-menu">
<li class="cursor_pointer font-80em"><a ng-click="addExisting=true">Existing Entry</a>
</li>
<li class="cursor_pointer font-80em" ng-repeat="option in linkOptions">
<a ng-click="addNewPartLink(option.type)"><i>New {{option.display}}</i></a>
</li>
</ul>
</div>
</td>
</tr>
</table>
Expand All @@ -58,6 +61,7 @@ <h4>
ng-click="submitImportForApproval()">
<span ng-if="bulkUpload.status==undefined || bulkUpload.status=='IN_PROGRESS'">Submit</span>
<span ng-if="bulkUpload.status=='PENDING_APPROVAL'">Approve</span>
<span ng-if="bulkUpload.status=='BULK_EDIT'">Done</span>
</button>
<button ng-if="bulkUpload.status==undefined || bulkUpload.status=='IN_PROGRESS'"
type="button" class="btn btn-xs btn-default" ng-click="confirmResetFormModal()">
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/scripts/upload/uploadController.js
Original file line number Diff line number Diff line change
Expand Up @@ -591,10 +591,10 @@ angular.module('ice.upload.controller', [])
var requiresApproval = $scope.bulkUpload.status && $scope.bulkUpload.status == 'PENDING_APPROVAL';

// validate the contents;
var tmp = {id:$scope.bulkUpload.id};
var tmp = {id:$scope.bulkUpload.id, status:$scope.bulkUpload.status};
if (requiresApproval)
tmp.status = 'APPROVED';
else
else if ($scope.bulkUpload.status != "BULK_EDIT")
tmp.status = 'PENDING_APPROVAL';
$scope.requestError = undefined;

Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/views/folder/folder-contents.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ <h4>
<div title="{{entry.name}}" class="ellipsis" style="width: 150px">{{entry.name}}</div>
</td>
<td>
<div title="{{entry.shortDescription}}"
<div tooltip="{{entry.shortDescription}}"
style="width: 500px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
{{entry.shortDescription}}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ public void testCreateNewFolder() throws Exception {

@Test
public void testRetrieveFolderContents() throws Exception {
// test with null id
controller.retrieveFolderContents(null, 0, ColumnField.PART_ID, false, 0, 10);

Account account = AccountCreator.createTestAccount("testRetrieveFolderContents", false);
String userId = account.getEmail();

Expand Down

0 comments on commit 91b96ac

Please sign in to comment.