Further Fixes over Recent Activity model
This commit is contained in:
parent
2fb270d66c
commit
150667350c
|
@ -19,7 +19,7 @@ public abstract class RecentActivityModel<T> {
|
|||
private Date finalizedAt;
|
||||
private Date publishedAt;
|
||||
private String profile;
|
||||
private RecentActivityType type;
|
||||
private int type;
|
||||
private List<UserInfoListingModel> users;
|
||||
private Boolean isPublic;
|
||||
|
||||
|
@ -127,11 +127,11 @@ public abstract class RecentActivityModel<T> {
|
|||
this.profile = profile;
|
||||
}
|
||||
|
||||
public RecentActivityType getType() {
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(RecentActivityType type) {
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
|
@ -154,7 +154,7 @@ public abstract class RecentActivityModel<T> {
|
|||
public abstract RecentActivityModel fromEntity(T entity);
|
||||
|
||||
public enum RecentActivityType {
|
||||
DMP(1), DATASET(2);
|
||||
DMP(2), DATASET(1);
|
||||
|
||||
private final int index;
|
||||
|
||||
|
@ -168,9 +168,9 @@ public abstract class RecentActivityModel<T> {
|
|||
|
||||
public static RecentActivityType fromIndex(int index) {
|
||||
switch (index) {
|
||||
case 1:
|
||||
return DMP;
|
||||
case 2:
|
||||
return DMP;
|
||||
case 1:
|
||||
return DATASET;
|
||||
default:
|
||||
throw new IllegalArgumentException("Recent Activity Type : \"" + index + "\" is not supported.");
|
||||
|
|
|
@ -58,6 +58,7 @@ public class RecentDatasetModel extends RecentActivityModel<Dataset> {
|
|||
|
||||
@Override
|
||||
public RecentActivityModel fromEntity(Dataset entity) {
|
||||
this.setType(RecentActivityType.DATASET.getIndex());
|
||||
this.setId(entity.getId().toString());
|
||||
this.setTitle(entity.getLabel());
|
||||
this.setDescription(entity.getDescription());
|
||||
|
@ -82,7 +83,7 @@ public class RecentDatasetModel extends RecentActivityModel<Dataset> {
|
|||
}
|
||||
|
||||
public RecentDatasetModel fromDmpEntity(Dataset entity) {
|
||||
this.setType(RecentActivityType.DATASET);
|
||||
this.setType(RecentActivityType.DATASET.getIndex());
|
||||
this.setId(entity.getId().toString());
|
||||
this.setTitle(entity.getLabel());
|
||||
this.setDescription(entity.getDescription());
|
||||
|
|
|
@ -72,7 +72,7 @@ public class RecentDmpModel extends RecentActivityModel<DMP> {
|
|||
@Override
|
||||
@Transactional
|
||||
public RecentActivityModel fromEntity(DMP entity) {
|
||||
this.setType(RecentActivityType.DMP);
|
||||
this.setType(RecentActivityType.DMP.getIndex());
|
||||
this.setId(entity.getId().toString());
|
||||
this.setTitle(entity.getLabel());
|
||||
this.setDescription(entity.getDescription());
|
||||
|
|
|
@ -5,7 +5,7 @@ import eu.eudat.criteria.RecentActivityCriteria;
|
|||
public class RecentActivityTableRequest {
|
||||
private RecentActivityCriteria criteria;
|
||||
private int offset;
|
||||
private int size;
|
||||
private int length;
|
||||
|
||||
public int getOffset() {
|
||||
return offset;
|
||||
|
@ -15,12 +15,12 @@ public class RecentActivityTableRequest {
|
|||
this.offset = offset;
|
||||
}
|
||||
|
||||
public int getSize() {
|
||||
return size;
|
||||
public int getLength() {
|
||||
return length;
|
||||
}
|
||||
|
||||
public void setSize(int size) {
|
||||
this.size = size;
|
||||
public void setLength(int length) {
|
||||
this.length = length;
|
||||
}
|
||||
|
||||
public RecentActivityCriteria getCriteria() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<div *ngIf="allRecentActivities != null">
|
||||
<div *ngFor="let activity of allRecentActivities">
|
||||
<div *ngIf="activity && activity.type === recentActivityTypeEnum.Dmp">
|
||||
<div *ngIf="activity && activity.type === recentActivityTypeEnum.Dmp.valueOf()">
|
||||
<div class="dmp-card">
|
||||
<div [routerLink]="['../plans/overview/' + activity.id]" class="pointer">
|
||||
<div class="d-flex flex-direction-row">
|
||||
|
@ -68,7 +68,7 @@
|
|||
</mat-menu>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="activity && activity.type === recentActivityTypeEnum.Dataset">
|
||||
<div *ngIf="activity && activity.type === recentActivityTypeEnum.Dataset.valueOf()">
|
||||
<div class="dataset-card">
|
||||
<div>
|
||||
<!-- <div [routerLink]="['../datasets/overview/' + activity.id]"> -->
|
||||
|
|
Loading…
Reference in New Issue