Adds the missing information to User Dashboard (Ticket #83)
This commit is contained in:
parent
151656386a
commit
6b13f191b0
|
@ -274,7 +274,7 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
|
||||||
if (this.dynamicFields != null)
|
if (this.dynamicFields != null)
|
||||||
dataManagementPlanEntity.setDmpProperties(JSONObject.toJSONString(this.dynamicFields.stream().filter(item -> item.getValue() != null).collect(Collectors.toMap(DynamicFieldWithValue::getId, DynamicFieldWithValue::getValue))));
|
dataManagementPlanEntity.setDmpProperties(JSONObject.toJSONString(this.dynamicFields.stream().filter(item -> item.getValue() != null).collect(Collectors.toMap(DynamicFieldWithValue::getId, DynamicFieldWithValue::getValue))));
|
||||||
|
|
||||||
if (this.associatedUsers != null && !this.associatedUsers.isEmpty()) {
|
/*if (this.associatedUsers != null && !this.associatedUsers.isEmpty()) {
|
||||||
List<UserDMP> userDMPList = new LinkedList<>();
|
List<UserDMP> userDMPList = new LinkedList<>();
|
||||||
for(UserListingModel userListingModel: this.associatedUsers) {
|
for(UserListingModel userListingModel: this.associatedUsers) {
|
||||||
UserDMP userDMP = new UserDMP();
|
UserDMP userDMP = new UserDMP();
|
||||||
|
@ -282,7 +282,7 @@ public class DataManagementPlan implements DataModel<DMP, DataManagementPlan> {
|
||||||
userDMPList.add(userDMP);
|
userDMPList.add(userDMP);
|
||||||
}
|
}
|
||||||
dataManagementPlanEntity.setUsers((Set<UserDMP>) userDMPList);
|
dataManagementPlanEntity.setUsers((Set<UserDMP>) userDMPList);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
return dataManagementPlanEntity;
|
return dataManagementPlanEntity;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,38 +1,28 @@
|
||||||
package eu.eudat.models.data.userinfo;
|
package eu.eudat.models.data.userinfo;
|
||||||
|
|
||||||
import eu.eudat.data.entities.UserInfo;
|
import eu.eudat.data.entities.UserInfo;
|
||||||
|
import eu.eudat.data.entities.UserRole;
|
||||||
import eu.eudat.models.DataModel;
|
import eu.eudat.models.DataModel;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.UUID;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
public class UserListingModel implements DataModel<eu.eudat.data.entities.UserInfo, UserListingModel> {
|
public class UserListingModel implements DataModel<eu.eudat.data.entities.UserInfo, UserListingModel> {
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
private Short usertype;
|
private Short usertype;
|
||||||
|
|
||||||
private Boolean verified_email;
|
private Boolean verified_email;
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
private Date created;
|
private Date created;
|
||||||
|
|
||||||
private Date lastloggedin;
|
private Date lastloggedin;
|
||||||
|
|
||||||
private String additionalinfo;
|
private String additionalinfo;
|
||||||
|
|
||||||
private List<Integer> appRoles;
|
private List<Integer> appRoles;
|
||||||
|
|
||||||
public UUID getId() {
|
public UUID getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(UUID id) {
|
public void setId(UUID id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
@ -40,7 +30,6 @@ public class UserListingModel implements DataModel<eu.eudat.data.entities.UserIn
|
||||||
public String getEmail() {
|
public String getEmail() {
|
||||||
return email;
|
return email;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEmail(String email) {
|
public void setEmail(String email) {
|
||||||
this.email = email;
|
this.email = email;
|
||||||
}
|
}
|
||||||
|
@ -48,7 +37,6 @@ public class UserListingModel implements DataModel<eu.eudat.data.entities.UserIn
|
||||||
public Short getUsertype() {
|
public Short getUsertype() {
|
||||||
return usertype;
|
return usertype;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUsertype(Short usertype) {
|
public void setUsertype(Short usertype) {
|
||||||
this.usertype = usertype;
|
this.usertype = usertype;
|
||||||
}
|
}
|
||||||
|
@ -56,7 +44,6 @@ public class UserListingModel implements DataModel<eu.eudat.data.entities.UserIn
|
||||||
public Boolean getVerified_email() {
|
public Boolean getVerified_email() {
|
||||||
return verified_email;
|
return verified_email;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setVerified_email(Boolean verified_email) {
|
public void setVerified_email(Boolean verified_email) {
|
||||||
this.verified_email = verified_email;
|
this.verified_email = verified_email;
|
||||||
}
|
}
|
||||||
|
@ -64,7 +51,6 @@ public class UserListingModel implements DataModel<eu.eudat.data.entities.UserIn
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setName(String name) {
|
public void setName(String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
@ -72,7 +58,6 @@ public class UserListingModel implements DataModel<eu.eudat.data.entities.UserIn
|
||||||
public Date getCreated() {
|
public Date getCreated() {
|
||||||
return created;
|
return created;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreated(Date created) {
|
public void setCreated(Date created) {
|
||||||
this.created = created;
|
this.created = created;
|
||||||
}
|
}
|
||||||
|
@ -80,7 +65,6 @@ public class UserListingModel implements DataModel<eu.eudat.data.entities.UserIn
|
||||||
public Date getLastloggedin() {
|
public Date getLastloggedin() {
|
||||||
return lastloggedin;
|
return lastloggedin;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLastloggedin(Date lastloggedin) {
|
public void setLastloggedin(Date lastloggedin) {
|
||||||
this.lastloggedin = lastloggedin;
|
this.lastloggedin = lastloggedin;
|
||||||
}
|
}
|
||||||
|
@ -88,7 +72,6 @@ public class UserListingModel implements DataModel<eu.eudat.data.entities.UserIn
|
||||||
public String getAdditionalinfo() {
|
public String getAdditionalinfo() {
|
||||||
return additionalinfo;
|
return additionalinfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAdditionalinfo(String additionalinfo) {
|
public void setAdditionalinfo(String additionalinfo) {
|
||||||
this.additionalinfo = additionalinfo;
|
this.additionalinfo = additionalinfo;
|
||||||
}
|
}
|
||||||
|
@ -96,7 +79,6 @@ public class UserListingModel implements DataModel<eu.eudat.data.entities.UserIn
|
||||||
public List<Integer> getAppRoles() {
|
public List<Integer> getAppRoles() {
|
||||||
return appRoles;
|
return appRoles;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAppRoles(List<Integer> appRoles) {
|
public void setAppRoles(List<Integer> appRoles) {
|
||||||
this.appRoles = appRoles;
|
this.appRoles = appRoles;
|
||||||
}
|
}
|
||||||
|
@ -117,7 +99,17 @@ public class UserListingModel implements DataModel<eu.eudat.data.entities.UserIn
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UserInfo toDataModel() throws Exception {
|
public UserInfo toDataModel() throws Exception {
|
||||||
return null;
|
UserInfo userInfo = new UserInfo();
|
||||||
|
userInfo.setId(this.id);
|
||||||
|
userInfo.setEmail(this.email);
|
||||||
|
userInfo.setUsertype(this.usertype);
|
||||||
|
userInfo.setVerified_email(this.verified_email);
|
||||||
|
userInfo.setName(this.name);
|
||||||
|
userInfo.setCreated(this.created);
|
||||||
|
userInfo.setLastloggedin(this.lastloggedin);
|
||||||
|
userInfo.setAdditionalinfo(this.additionalinfo);
|
||||||
|
|
||||||
|
return userInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -29,11 +29,11 @@
|
||||||
<td>{{ activity.label }}</td>
|
<td>{{ activity.label }}</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="template-name">
|
<div class="template-name">
|
||||||
--
|
{{ dmpProfileDisplay(activity.profile) }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>{{ activity.project }}</td>
|
<td>{{ activity.project }}</td>
|
||||||
<td>Role Name</td>
|
<td>{{roleDisplay(activity.users)}}</td>
|
||||||
<td>{{ activity.organisations }}</td>
|
<td>{{ activity.organisations }}</td>
|
||||||
<td *ngIf="activity.status === 1">
|
<td *ngIf="activity.status === 1">
|
||||||
<div class="is-public">
|
<div class="is-public">
|
||||||
|
|
|
@ -7,6 +7,8 @@ import { DmpCriteria } from '../../../core/query/dmp/dmp-criteria';
|
||||||
import { DmpService } from '../../../core/services/dmp/dmp.service';
|
import { DmpService } from '../../../core/services/dmp/dmp.service';
|
||||||
import { RecentActivityType } from '../../../core/common/enum/recent-activity-type';
|
import { RecentActivityType } from '../../../core/common/enum/recent-activity-type';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
import { Principal } from '../../../core/model/auth/Principal';
|
||||||
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-recent-edited-activity',
|
selector: 'app-recent-edited-activity',
|
||||||
|
@ -21,7 +23,8 @@ export class RecentEditedActivityComponent implements OnInit {
|
||||||
private router: Router,
|
private router: Router,
|
||||||
public enumUtils: EnumUtils,
|
public enumUtils: EnumUtils,
|
||||||
private authentication: AuthService,
|
private authentication: AuthService,
|
||||||
private dmpService: DmpService
|
private dmpService: DmpService,
|
||||||
|
private language: TranslateService
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
@ -62,4 +65,34 @@ export class RecentEditedActivityComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
navigateToUrl() { }
|
navigateToUrl() { }
|
||||||
|
|
||||||
|
roleDisplay(value: any) {
|
||||||
|
const principal: Principal = this.authentication.current();
|
||||||
|
let role: number;
|
||||||
|
if (principal) {
|
||||||
|
value.forEach(element => {
|
||||||
|
if (principal.id === element.id) {
|
||||||
|
role = element.role;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (role === 0) {
|
||||||
|
return this.language.instant('DMP-LISTING.OWNER');
|
||||||
|
}
|
||||||
|
else if (role === 1) {
|
||||||
|
return this.language.instant('DMP-LISTING.MEMBER');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return this.language.instant('DMP-LISTING.OWNER');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dmpProfileDisplay(value: any) {
|
||||||
|
if (value != null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return "--";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue