Skip to content
Snippets Groups Projects
Commit 44511616 authored by Nathan Bockisch's avatar Nathan Bockisch
Browse files

Merge branch 'ws-1944-ngas-download-filter' into 'main'

WS-1944: Added filter for NGAS download status

See merge request !1453
parents 0d246f42 c0b4fe94
No related branches found
No related tags found
1 merge request!1453WS-1944: Added filter for NGAS download status
Pipeline #11679 passed
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<br /> <br />
<div> <div>
<app-filter-menu *ngIf="showFilterMenu" [state]="statesToFilter" [exec_status]="execStatusToFilter" [stage1QaStaff]="qaStaff['Stage 1']" [stage2QaStaff]="qaStaff['Stage 2']" [srdpStatus]="srdpOptions" [filters]="filters" (filterMenuEventEmitter)="emitFilterEvent($event)"></app-filter-menu> <app-filter-menu *ngIf="showFilterMenu" [state]="statesToFilter" [exec_status]="execStatusToFilter" [downloadStatus]="downloadStatusToFilter" [stage1QaStaff]="qaStaff['Stage 1']" [stage2QaStaff]="qaStaff['Stage 2']" [srdpStatus]="srdpOptions" [filters]="filters" (filterMenuEventEmitter)="emitFilterEvent($event)"></app-filter-menu>
<mat-paginator #requestPaginator <mat-paginator #requestPaginator
[length]="(sortedActiveRequests$ | async)?.length" [length]="(sortedActiveRequests$ | async)?.length"
[pageSize]="pageSize" [pageSize]="pageSize"
......
...@@ -89,6 +89,7 @@ export class ActiveCapabilityRequestsComponent implements OnInit, OnDestroy { ...@@ -89,6 +89,7 @@ export class ActiveCapabilityRequestsComponent implements OnInit, OnDestroy {
// Filter sets // Filter sets
public statesSet = new Set<string>(); public statesSet = new Set<string>();
public execStatusSet = new Set<string>(); public execStatusSet = new Set<string>();
public downloadStatusSet = new Set<string>();
public stage1QaSet = new Set<string>(); public stage1QaSet = new Set<string>();
public stage2QaSet = new Set<string>(); public stage2QaSet = new Set<string>();
public srdpSet = new Set<string>(); public srdpSet = new Set<string>();
...@@ -121,6 +122,12 @@ export class ActiveCapabilityRequestsComponent implements OnInit, OnDestroy { ...@@ -121,6 +122,12 @@ export class ActiveCapabilityRequestsComponent implements OnInit, OnDestroy {
{ name: "Cancelled", filter_val: "Cancelled" }, { name: "Cancelled", filter_val: "Cancelled" },
{ name: "Complete", filter_val: "Complete" }, { name: "Complete", filter_val: "Complete" },
]; ];
public downloadStatusToFilter = [
{ name: "No Versions", filter_val: "" },
{ name: "Not Started", filter_val: "Not started" },
{ name: "In Progress", filter_val: "In Progress" },
{ name: "Complete", filter_val: "Complete" },
];
public srdpOptions = [{ name: "true" }, { name: "false" }]; public srdpOptions = [{ name: "true" }, { name: "false" }];
public obsDateOptions = [{ obs_min: "" }, { obs_max: "" }]; public obsDateOptions = [{ obs_min: "" }, { obs_max: "" }];
...@@ -299,6 +306,7 @@ export class ActiveCapabilityRequestsComponent implements OnInit, OnDestroy { ...@@ -299,6 +306,7 @@ export class ActiveCapabilityRequestsComponent implements OnInit, OnDestroy {
this.availableFilters = { this.availableFilters = {
state: this.statesToFilter, state: this.statesToFilter,
exec_status: this.execStatusToFilter, exec_status: this.execStatusToFilter,
download_status: this.downloadStatusToFilter,
is_srdp: this.srdpOptions, is_srdp: this.srdpOptions,
obs_min: this.obsDateOptions, obs_min: this.obsDateOptions,
obs_max: this.obsDateOptions, obs_max: this.obsDateOptions,
...@@ -358,6 +366,7 @@ export class ActiveCapabilityRequestsComponent implements OnInit, OnDestroy { ...@@ -358,6 +366,7 @@ export class ActiveCapabilityRequestsComponent implements OnInit, OnDestroy {
this.filters.hasOwnProperty("is_srdp") || this.filters.hasOwnProperty("is_srdp") ||
this.filters.hasOwnProperty("obs_min") || this.filters.hasOwnProperty("obs_min") ||
this.filters.hasOwnProperty("obs_max") || this.filters.hasOwnProperty("obs_max") ||
this.filters.hasOwnProperty("download_status") ||
this.filters.hasOwnProperty("exec_status"))) { this.filters.hasOwnProperty("exec_status"))) {
// SRDP filter // SRDP filter
if (this.filters.hasOwnProperty("is_srdp")) { if (this.filters.hasOwnProperty("is_srdp")) {
...@@ -400,6 +409,12 @@ export class ActiveCapabilityRequestsComponent implements OnInit, OnDestroy { ...@@ -400,6 +409,12 @@ export class ActiveCapabilityRequestsComponent implements OnInit, OnDestroy {
}); });
return filteredDates; return filteredDates;
} }
// NGAS Download Status filter
else if (this.filters.hasOwnProperty("download_status")) {
return activeRequests.filter(r => {
return this.filters.download_status.includes(this.getFetchStatus(r));
});
}
// Execution Status filter // Execution Status filter
else if (this.filters.hasOwnProperty("exec_status")) { else if (this.filters.hasOwnProperty("exec_status")) {
return activeRequests.filter(r => { return activeRequests.filter(r => {
...@@ -636,6 +651,8 @@ export class ActiveCapabilityRequestsComponent implements OnInit, OnDestroy { ...@@ -636,6 +651,8 @@ export class ActiveCapabilityRequestsComponent implements OnInit, OnDestroy {
return this.statesSet; return this.statesSet;
case "exec_status": case "exec_status":
return this.execStatusSet; return this.execStatusSet;
case "download_status":
return this.downloadStatusSet;
case "stage_1_reviewer": case "stage_1_reviewer":
return this.stage1QaSet; return this.stage1QaSet;
case "stage_2_reviewer": case "stage_2_reviewer":
......
...@@ -16,6 +16,14 @@ ...@@ -16,6 +16,14 @@
</div> </div>
</div> </div>
<div class="bg-light p-2">
<p>NGAS Download Status</p>
<div *ngFor="let s of downloadStatus" class="form-check">
<input class="form-check-input" type="checkbox" [id]="s.name" [value]="s.filter_val" (change)="addFilter(s.filter_val, 'download_status', $event.target.checked)" [checked]="s.isChecked" />
<label class="form-check-label" [for]="s.name">{{s.name}}</label>
</div>
</div>
<div class="bg-light p-2"> <div class="bg-light p-2">
<p>Stage 1 QA Staff</p> <p>Stage 1 QA Staff</p>
<div *ngFor="let reviewer of stage1QaStaff" class="form-check"> <div *ngFor="let reviewer of stage1QaStaff" class="form-check">
......
...@@ -35,6 +35,7 @@ export interface Filter { ...@@ -35,6 +35,7 @@ export interface Filter {
export class FilterMenuComponent implements OnInit { export class FilterMenuComponent implements OnInit {
@Input() state: any; @Input() state: any;
@Input() exec_status: any; @Input() exec_status: any;
@Input() downloadStatus: any;
@Input() stage1QaStaff: any; @Input() stage1QaStaff: any;
@Input() stage2QaStaff: any; @Input() stage2QaStaff: any;
@Input() srdpStatus: any; @Input() srdpStatus: any;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment