Skip to content
Snippets Groups Projects
Commit e6b94d0d authored by Andrew Kapuscinski's avatar Andrew Kapuscinski
Browse files

Fix pause capability with minor bug fix to filters

parent 63c678ae
No related branches found
No related tags found
1 merge request!833Fix pause capability with minor bug fix to filters
Pipeline #4558 passed
Pipeline: workspaces

#4559

    ......@@ -151,6 +151,13 @@ export class ActiveCapabilityRequestsComponent implements OnInit {
    };
    this.capabilitiesService.getEnabledCapabilities().subscribe(enabledCapabilitiesObserver);
    this.pollingDataUpdaterService
    .getDataPoller$(this.dataRetriever.getCapabilityUrl(this.capabilityName)).pipe(
    takeUntil(this.subscribeFlag),
    repeatWhen(() => this.subscribeFlag)
    )
    .subscribe(this.capabilityObserver);
    const qaStaffObserver = {
    next: (req) => {
    // this'll distinguish DA and AOD in this.qaStaff
    ......
    ......@@ -11,16 +11,16 @@
    <div class="bg-light p-2">
    <p>DA staff</p>
    <div *ngFor="let da of daStaff" class="form-check">
    <input class="form-check-input" type="checkbox" [id]="da.user_name" [value]="da.user_name" (change)="addFilter(da.user_name, 'assigned_da', $event.target.checked)" [checked]="da.isChecked"/>
    <label class="form-check-label" [for]="da.user_name">{{da.user_name}}</label>
    <input class="form-check-input" type="checkbox" [id]="'da-' + da.user_name" [value]="da.user_name" (change)="addFilter(da.user_name, 'assigned_da', $event.target.checked)" [checked]="da.isChecked"/>
    <label class="form-check-label" [for]="'da-' + da.user_name">{{da.user_name}}</label>
    </div>
    </div>
    <div class="bg-light p-2">
    <p>AOD staff</p>
    <div *ngFor="let aod of aodStaff" class="form-check">
    <input class="form-check-input" type="checkbox" [id]="aod.user_name" [value]="aod.user_name" (change)="addFilter(aod.user_name, 'assigned_aod', $event.target.checked)" [checked]="aod.isChecked"/>
    <label class="form-check-label" [for]="aod.user_name">{{aod.user_name}}</label>
    <input class="form-check-input" type="checkbox" [id]="'aod-' + aod.user_name" [value]="aod.user_name" (change)="addFilter(aod.user_name, 'assigned_aod', $event.target.checked)" [checked]="aod.isChecked"/>
    <label class="form-check-label" [for]="'aod-' + aod.user_name">{{aod.user_name}}</label>
    </div>
    </div>
    ......
    ......@@ -211,11 +211,10 @@ def pause_capability(request: Request) -> Response:
    if not request.capability_info.lookup_capability(capability_name):
    # Capability with given name does not exist
    does_not_exist_msg = f"Capability {capability_name} does not exist. Cannot enable."
    return Response(body={"result": does_not_exist_msg}, status_code=http.HTTPStatus.PRECONDITION_FAILED)
    request.capability_info.pause_capability(capability_name)
    found_message = f"Auto-calibration paused for {capability_name}"
    return Response(body={"result": found_message}, status_code=http.HTTPStatus.OK)
    return HTTPPreconditionFailed(detail=does_not_exist_msg)
    else:
    request.capability_info.pause_capability(capability_name)
    return Response(status_code=http.HTTPStatus.OK)
    @view_config(route_name="unpause_capability", renderer="json")
    ......@@ -232,12 +231,11 @@ def unpause_capability(request: Request) -> Response:
    if not request.capability_info.lookup_capability(capability_name):
    # Capability with given name does not exist
    does_not_exist_msg = f"Capability {capability_name} does not exist. Cannot enable."
    return Response(body={"result": does_not_exist_msg}, status_code=http.HTTPStatus.PRECONDITION_FAILED)
    request.capability_info.unpause_capability(capability_name)
    request.capability_queue_restarter.restart_capability_queue()
    restarted_message = f"Auto-calibration resumed for {capability_name}"
    return Response(body={"result": restarted_message}, status_code=http.HTTPStatus.OK)
    return HTTPPreconditionFailed(detail=does_not_exist_msg)
    else:
    request.capability_info.unpause_capability(capability_name)
    request.capability_queue_restarter.restart_capability_queue()
    return Response(status_code=http.HTTPStatus.OK)
    @view_config(route_name="retrieve_available_qa_staff_in_group", renderer="json")
    ......
    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