Fix minor issue with DMP criteria
This commit is contained in:
parent
9b837a27a8
commit
cd5295437b
|
@ -52,13 +52,12 @@ public class DMPDaoImpl extends DatabaseAccess<DMP> implements DMPDao {
|
||||||
query.where((builder, root) -> root.get("groupId").in(criteria.getGroupIds()));
|
query.where((builder, root) -> root.get("groupId").in(criteria.getGroupIds()));
|
||||||
if (criteria.getStatus() != null) {
|
if (criteria.getStatus() != null) {
|
||||||
if (criteria.getStatus() == DMP.DMPStatus.FINALISED.getValue()) {
|
if (criteria.getStatus() == DMP.DMPStatus.FINALISED.getValue()) {
|
||||||
query.where((builder, root) -> builder.and(builder.equal(root.get("status"), DMP.DMPStatus.FINALISED.getValue()), builder.notEqual(root.get("isPublic"), true)));
|
query.where((builder, root) -> builder.equal(root.get("status"), DMP.DMPStatus.FINALISED.getValue()));
|
||||||
} else if (criteria.getStatus() == DMP.DMPStatus.ACTIVE.getValue()) {
|
} else if (criteria.getStatus() == DMP.DMPStatus.ACTIVE.getValue()) {
|
||||||
query.where((builder, root) -> builder.equal(root.get("status"), DMP.DMPStatus.ACTIVE.getValue()));
|
query.where((builder, root) -> builder.equal(root.get("status"), DMP.DMPStatus.ACTIVE.getValue()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (criteria.getIsPublic())
|
query.where(((builder, root) -> builder.equal(root.get("isPublic"), criteria.getIsPublic())));
|
||||||
query.where(((builder, root) -> builder.equal(root.get("isPublic"), true)));
|
|
||||||
/*if (criteria.getRole() != null) {
|
/*if (criteria.getRole() != null) {
|
||||||
if (criteria.getRole().equals(UserDMP.UserDMPRoles.OWNER.getValue())) {
|
if (criteria.getRole().equals(UserDMP.UserDMPRoles.OWNER.getValue())) {
|
||||||
query.where((builder, root) -> builder.equal(root.join("users", JoinType.LEFT).get("role"), UserDMP.UserDMPRoles.OWNER.getValue()));
|
query.where((builder, root) -> builder.equal(root.join("users", JoinType.LEFT).get("role"), UserDMP.UserDMPRoles.OWNER.getValue()));
|
||||||
|
|
|
@ -392,16 +392,22 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread
|
||||||
}
|
}
|
||||||
|
|
||||||
setPublicCriteria(formGroup?: FormGroup): void {
|
setPublicCriteria(formGroup?: FormGroup): void {
|
||||||
if (formGroup && formGroup.get('status').value == 2) {
|
if (!isNullOrUndefined(formGroup)) {
|
||||||
|
if (formGroup.get('status').value == 2) {
|
||||||
|
this.criteria.status = 1;
|
||||||
this.criteria.isPublic = true;
|
this.criteria.isPublic = true;
|
||||||
|
} else {
|
||||||
|
this.criteria.isPublic = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.criteria.onlyPublic = this.isPublic;
|
this.criteria.onlyPublic = this.isPublic;
|
||||||
if (this.isPublic) {
|
if (this.isPublic) {
|
||||||
this.criteria.isPublic = true;
|
this.criteria.isPublic = true;
|
||||||
} else {
|
|
||||||
this.criteria.isPublic = false;
|
|
||||||
}
|
}
|
||||||
|
// } else {
|
||||||
|
// this.criteria.isPublic = false;
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
hasScrollbar(): boolean {
|
hasScrollbar(): boolean {
|
||||||
|
|
Loading…
Reference in New Issue