Only Dataset Description Templates listing will show non-finalized templates (ref #227)

This commit is contained in:
George Kalampokis 2020-01-20 18:11:35 +02:00
parent 95d713b213
commit cd1d81c3dd
4 changed files with 15 additions and 1 deletions

View File

@ -32,6 +32,7 @@ public class DatasetProfileCriteria extends Criteria<DatasetProfile> {
private List<UUID> groupIds; private List<UUID> groupIds;
private Short filter; private Short filter;
private UUID userId; private UUID userId;
private boolean finalized;
public boolean getAllVersions() { return allVersions; } public boolean getAllVersions() { return allVersions; }
public void setAllVersions(boolean allVersions) { this.allVersions = allVersions; } public void setAllVersions(boolean allVersions) { this.allVersions = allVersions; }
@ -52,4 +53,11 @@ public class DatasetProfileCriteria extends Criteria<DatasetProfile> {
public void setUserId(UUID userId) { public void setUserId(UUID userId) {
this.userId = userId; this.userId = userId;
} }
public boolean getFinalized() {
return finalized;
}
public void setFinalized(boolean finalized) {
this.finalized = finalized;
}
} }

View File

@ -52,7 +52,11 @@ public class DatasetProfileDaoImpl extends DatabaseAccess<DatasetProfile> implem
builder.notEqual(root.get("id"), criteria.getUserId()))); builder.notEqual(root.get("id"), criteria.getUserId())));
} }
} }
query.where(((builder, root) -> builder.notEqual(root.get("status"), DatasetProfile.Status.DELETED.getValue()))); if (criteria.getFinalized()) {
query.where(((builder, root) -> builder.equal(root.get("status"), DatasetProfile.Status.FINALIZED.getValue())));
} else {
query.where(((builder, root) -> builder.notEqual(root.get("status"), DatasetProfile.Status.DELETED.getValue())));
}
return query; return query;
} }

View File

@ -4,4 +4,5 @@ export class DatasetProfileCriteria extends BaseCriteria {
public id: String; public id: String;
public groupIds: string[]; public groupIds: string[];
public allVersions: boolean; public allVersions: boolean;
public finalized: boolean = true;
} }

View File

@ -148,6 +148,7 @@ export class DatasetDataSource extends DataSource<DatasetListingModel> {
if (this._sort.active) { fields = this._sort.direction === 'asc' ? ['+' + this._sort.active] : ['-' + this._sort.active]; } if (this._sort.active) { fields = this._sort.direction === 'asc' ? ['+' + this._sort.active] : ['-' + this._sort.active]; }
const request = new DataTableRequest<DatasetProfileCriteria>(startIndex, this._paginator.pageSize, { fields: fields }); const request = new DataTableRequest<DatasetProfileCriteria>(startIndex, this._paginator.pageSize, { fields: fields });
request.criteria = this._criteria.criteria; request.criteria = this._criteria.criteria;
request.criteria.finalized = false;
if (this.itemId) { if (this.itemId) {
request.criteria.groupIds = [this.itemId]; request.criteria.groupIds = [this.itemId];
request.criteria.allVersions = true; request.criteria.allVersions = true;