Show status on dataset profile listing and filter them based on status (ref #265)
This commit is contained in:
parent
b539544075
commit
50c45b7271
|
@ -33,6 +33,7 @@ public class DatasetProfileCriteria extends Criteria<DatasetProfile> {
|
|||
private Short filter;
|
||||
private UUID userId;
|
||||
private boolean finalized;
|
||||
private Integer status;
|
||||
|
||||
public boolean getAllVersions() { return allVersions; }
|
||||
public void setAllVersions(boolean allVersions) { this.allVersions = allVersions; }
|
||||
|
@ -60,4 +61,12 @@ public class DatasetProfileCriteria extends Criteria<DatasetProfile> {
|
|||
public void setFinalized(boolean finalized) {
|
||||
this.finalized = finalized;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,6 +52,9 @@ public class DatasetProfileDaoImpl extends DatabaseAccess<DatasetProfile> implem
|
|||
builder.notEqual(root.get("id"), criteria.getUserId())));
|
||||
}
|
||||
}
|
||||
if (criteria.getStatus() != null) {
|
||||
query.where(((builder, root) -> builder.equal(root.get("status"), criteria.getStatus())));
|
||||
}
|
||||
if (criteria.getFinalized()) {
|
||||
query.where(((builder, root) -> builder.equal(root.get("status"), DatasetProfile.Status.FINALIZED.getValue())));
|
||||
} else {
|
||||
|
|
|
@ -27,6 +27,7 @@ import { DialodConfirmationUploadDatasetProfiles } from '@app/ui/admin/dataset-p
|
|||
import { DatasetProfileListingComponent } from '@app/ui/admin/dataset-profile/listing/dataset-profile-listing.component';
|
||||
import { CommonFormsModule } from '@common/forms/common-forms.module';
|
||||
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||
import { ParseStatus } from './listing/pipe/parse-status.pipe';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
@ -59,7 +60,8 @@ import { CommonUiModule } from '@common/ui/common-ui.module';
|
|||
DatasetProfileEditorInternalDmpEntitiesFieldComponent,
|
||||
DatasetProfileEditorResearchersAutoCompleteFieldComponent,
|
||||
DatasetProfileEditorDatasetsAutoCompleteFieldComponent,
|
||||
DatasetProfileEditorDmpsAutoCompleteFieldComponent
|
||||
DatasetProfileEditorDmpsAutoCompleteFieldComponent,
|
||||
ParseStatus
|
||||
],
|
||||
entryComponents: [
|
||||
DialodConfirmationUploadDatasetProfiles
|
||||
|
|
|
@ -5,6 +5,13 @@
|
|||
<input matInput placeholder=" {{'CRITERIA.DATASET-PROFILE.LIKE'| translate}}" name="datasetProfileLike"
|
||||
[(ngModel)]="criteria.like" (ngModelChange)="controlModified()">
|
||||
</mat-form-field>
|
||||
<mat-form-field class="col-md-6">
|
||||
<mat-select [(ngModel)]="criteria.status" (ngModelChange)="controlModified()" placeholder=" {{'CRITERIA.DATASET-PROFILE.STATUS' | translate}}">
|
||||
<mat-option [value]="null">{{'DATASET-PROFILE-STATUS.NONE' | translate}}</mat-option>
|
||||
<mat-option [value]="0">{{'DATASET-PROFILE-STATUS.DRAFT' | translate}}</mat-option>
|
||||
<mat-option [value]="1">{{'DATASET-PROFILE-STATUS.FINALIZED' | translate}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<div class="col"></div>
|
||||
<div class="col-auto">
|
||||
<!-- imgFileInput.click() && -->
|
||||
|
|
|
@ -27,6 +27,13 @@
|
|||
<mat-cell *matCellDef="let row">{{row.created | date:'shortDate'}}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Column Definition: Status -->
|
||||
<ng-container cdkColumnDef="status">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="status">{{'DATASET-PROFILE-LISTING.COLUMNS.STATUS' |
|
||||
translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">{{ (row.status | parseStatus) | translate}}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<!-- Column Definition: Submission Time -->
|
||||
<ng-container cdkColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef>{{'DATASET-PROFILE-LISTING.COLUMNS.ACTIONS' | translate}}
|
||||
|
|
|
@ -30,7 +30,7 @@ export class DatasetProfileListingComponent extends BaseComponent implements OnI
|
|||
|
||||
breadCrumbs: Observable<BreadcrumbItem[]>;
|
||||
dataSource: DatasetDataSource | null;
|
||||
displayedColumns: String[] = ['label', 'description', 'created', 'actions'];
|
||||
displayedColumns: String[] = ['label', 'description', 'created', 'status', 'actions'];
|
||||
pageEvent: PageEvent;
|
||||
titlePrefix: String;
|
||||
dmpId: String;
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
|
||||
@Pipe({
|
||||
name: 'parseStatus',
|
||||
pure: true
|
||||
})
|
||||
export class ParseStatus implements PipeTransform {
|
||||
transform(value: any, ...args: any[]) {
|
||||
return this.parseStatus(value);
|
||||
}
|
||||
|
||||
|
||||
parseStatus(status: number): string {
|
||||
return status != 0 ? 'DATASET-PROFILE-STATUS.FINALIZED' : 'DATASET-PROFILE-STATUS.DRAFT';
|
||||
}
|
||||
}
|
|
@ -765,7 +765,8 @@
|
|||
}
|
||||
},
|
||||
"DATASET-PROFILE": {
|
||||
"LIKE": "Search"
|
||||
"LIKE": "Search",
|
||||
"STATUS": "Status"
|
||||
},
|
||||
"DATA-SETS": {
|
||||
"PERIOD-FROM": "Start",
|
||||
|
@ -1261,5 +1262,10 @@
|
|||
}
|
||||
},
|
||||
"HINT": "(Suggested Default Name)"
|
||||
},
|
||||
"DATASET-PROFILE-STATUS": {
|
||||
"NONE": "None",
|
||||
"DRAFT": "Draft",
|
||||
"FINALIZED": "Finalized"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue