Skip to content

Commit

Permalink
moved the search component
Browse files Browse the repository at this point in the history
  • Loading branch information
Davo00 committed Nov 29, 2023
1 parent dfb5447 commit 7e5145e
Showing 1 changed file with 36 additions and 37 deletions.
73 changes: 36 additions & 37 deletions workbench/frontend/src/app/slot-booking/slot-booking.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<mat-expansion-panel #request_response class="margin-10">
<mat-expansion-panel #request_response class="margin-10" [expanded]="true">
<mat-expansion-panel-header>
<mat-panel-title>
Slot Search Request / Response
Expand Down Expand Up @@ -80,6 +80,41 @@
<div style="width: 40%; margin-right: 10px;">
<h2>Request</h2>


<div [formGroup]="requestOptions" style="margin-top: 15px; display: flex;">
<mat-slide-toggle formControlName="filterBasedToggle" (change)="onFilterBasedToggleChange($event);" class="margin-10">Filter Based</mat-slide-toggle>
</div>

<div class="checkbox-container" style="display: flex; flex-direction: row;">
<mat-checkbox [disabled]="!filterBased" style="margin-left: 10px;" [(ngModel)]="internalChecked" (change)="onCheckboxChange()">Internal</mat-checkbox>
<mat-checkbox [disabled]="!filterBased" style="margin-left: 16px;" [(ngModel)]="crowdChecked" (change)="onCheckboxChange()">Crowd</mat-checkbox>
<mat-checkbox [disabled]="!filterBased" style="margin-left: 16px;" [(ngModel)]="skillsChecked" (change)="onCheckboxChange()">Use mandatory skills</mat-checkbox>
</div>

<button mat-raised-button [disabled]="!(isLoggedIn$ | async) || (isLoading$ | async)"
(click)="request_response.open(); doRequest();" color="primary" class="margin-10">
<mat-icon>search</mat-icon>
Search for slots
</button>

using
<mat-chip>/api/v3/job-slots/actions/search</mat-chip>
Search Job Slot API see

<a target="_blank" style="margin-top: 15px;"
href="https://eu.coresystems.net/optimization/api/v1/swagger-ui/#/Search%20Job%20Slot/post_api_v3_job_slots_actions_search">
documentation
</a>

<div [formGroup]="requestOptions" style="margin-top: 15px; display: none;">
<mat-slide-toggle formControlName="refresh">auto refresh</mat-slide-toggle>
</div>

<div *ngIf="response$ && (response$ | async)" style="margin-top: 8px; margin-left: 10px;">
Timing: {{ (response$ | async).time | number }} ms for {{ (response$ | async).grouped.length }} slots with
{{ (response$ | async).results.length }} matches
</div>

<mat-expansion-panel #request_payload style="margin: 10px;">
<mat-expansion-panel-header>Full JSON Request</mat-expansion-panel-header>
<pre *ngIf="requestPayload$">{{ requestPayload$ | async | json }}</pre>
Expand All @@ -103,43 +138,7 @@ <h2>Response</h2>

</mat-expansion-panel>

<mat-card class="margin-10">

<div [formGroup]="requestOptions" style="margin-top: 15px; display: flex;">
<mat-slide-toggle formControlName="filterBasedToggle" (change)="onFilterBasedToggleChange($event);" class="margin-10">Filter Based</mat-slide-toggle>
</div>

<div class="checkbox-container" style="display: flex; flex-direction: row;">
<mat-checkbox [disabled]="!filterBased" style="margin-left: 10px;" [(ngModel)]="internalChecked" (change)="onCheckboxChange()">Internal</mat-checkbox>
<mat-checkbox [disabled]="!filterBased" style="margin-left: 16px;" [(ngModel)]="crowdChecked" (change)="onCheckboxChange()">Crowd</mat-checkbox>
<mat-checkbox [disabled]="!filterBased" style="margin-left: 16px;" [(ngModel)]="skillsChecked" (change)="onCheckboxChange()">Use mandatory skills</mat-checkbox>
</div>

<button mat-raised-button [disabled]="!(isLoggedIn$ | async) || (isLoading$ | async)"
(click)="request_response.open(); doRequest();" color="primary" class="margin-10">
<mat-icon>search</mat-icon>
Search for slots
</button>

using
<mat-chip>/api/v3/job-slots/actions/search</mat-chip>
Search Job Slot API see

<a target="_blank" style="margin-top: 15px;"
href="https://eu.coresystems.net/optimization/api/v1/swagger-ui/#/Search%20Job%20Slot/post_api_v3_job_slots_actions_search">
documentation
</a>

<div [formGroup]="requestOptions" style="margin-top: 15px; display: none;">
<mat-slide-toggle formControlName="refresh">auto refresh</mat-slide-toggle>
</div>

<div *ngIf="response$ && (response$ | async)" style="margin-top: 8px; margin-left: 10px;">
Timing: {{ (response$ | async).time | number }} ms for {{ (response$ | async).grouped.length }} slots with
{{ (response$ | async).results.length }} matches
</div>

</mat-card>

<h2 class="margin-10">Slot Search Options:</h2>

Expand Down

0 comments on commit 7e5145e

Please sign in to comment.