Skip to content

Commit

Permalink
Jkmarx/details owner name bug (#1839)
Browse files Browse the repository at this point in the history
* Enable pinning of select and input group columns.

* Add highlights and keep icon blue.

* Show template and input file.

* Add basic functionality for reindexing.

* Add depthNames data and replace types.

* Add library which was accidently deleted. (#1821)

* Reindex node set collection.

* Fix width of popover to prevent arrow jump.

* Update selection obj.

* Refactor collection to own methods.

* Fix bug.

* Fix pair checkbox.

* Add comments

* Remove unused method.

* Add comments.

* Remove comment.

* Fix color issue associate on deselecting a node.

* Fix bug with popover and missing nav.

* Hide remove button for 1 depth tools.

* Adjust text.

* Fix unit test.

* Adjust placement of table config.

* Add error check and update html.

* Remove console.

* Remove typo.
  • Loading branch information
jkmarx committed Jun 27, 2017
1 parent c03328b commit 085e076
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 16 deletions.
27 changes: 14 additions & 13 deletions refinery/ui/source/js/commons/services/users.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

function userFactory ($q, $resource, settings) {
function userFactory ($q, $resource, _, settings) {
var userService = {};
var userResource = $resource(
settings.appRoot + settings.refineryApi + '/users/:uuid/',
Expand Down Expand Up @@ -45,17 +45,18 @@ function userFactory ($q, $resource, settings) {
userService.get = function (uuid) {
if (store[uuid] === undefined) {
return getUserData(uuid).then(function (data) {
store[uuid] = {
affiliation: data.affiliation,
email: data.user.email,
firstName: data.user.first_name,
fullName: (data.user.first_name + ' ' + data.user.last_name).trim(),
lastName: data.user.last_name,
userId: data.user.id,
userName: data.user.username,
userProfileUuid: data.uuid
};

if (_.has(data, 'user')) {
store[uuid] = {
affiliation: data.affiliation,
email: data.user.email,
firstName: data.user.first_name,
fullName: (data.user.first_name + ' ' + data.user.last_name).trim(),
lastName: data.user.last_name,
userId: data.user.id,
userName: data.user.username,
userProfileUuid: data.uuid
};
}
return store[uuid];
});
}
Expand All @@ -67,4 +68,4 @@ function userFactory ($q, $resource, settings) {

angular
.module('refineryApp')
.factory('userService', ['$q', '$resource', 'settings', userFactory]);
.factory('userService', ['$q', '$resource', '_', 'settings', userFactory]);
8 changes: 5 additions & 3 deletions refinery/ui/source/js/data-set-about/ctrls/sharing-ctrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ function AboutSharingCtrl (
$scope,
$location,
$window,
$log
$log,
_
) {
var vm = this;
vm.dataSetSharing = dataSetAboutFactory.dataSetSharing;
Expand All @@ -29,9 +30,9 @@ function AboutSharingCtrl (

vm.refreshOwnerName = function (userUuid) {
userService.get(userUuid).then(function (response) {
if (response.fullName) {
if (_.has(response, 'fullName') && response.fullName) {
vm.ownerName = response.fullName;
} else {
} else if (_.has(response, 'userName') && response.userName) {
vm.ownerName = response.userName;
}
});
Expand All @@ -51,6 +52,7 @@ angular
'$location',
'$window',
'$log',
'_',
AboutSharingCtrl
]);

3 changes: 3 additions & 0 deletions refinery/ui/source/js/data-set-about/partials/sharing.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ <h4>Owner</h4>
{{ ASCtrl.ownerName }}
</a>
</span>
<span ng-if="!ASCtrl.dataSetSharing.is_owner && !ASCtrl.ownerName">
<em>Owner's information not available.</em>
</span>
</p>

<div ng-if="ASCtrl.groupList.length > 0">
Expand Down

0 comments on commit 085e076

Please sign in to comment.