Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring/filter technician UI query api #76

Merged
merged 17 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions workbench/frontend/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MonacoEditorModule } from 'ngx-monaco-editor';
import { ReactiveFormsModule } from '@angular/forms';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { FlexLayoutModule } from '@angular/flex-layout';
import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
Expand Down Expand Up @@ -65,7 +65,8 @@ import { PluginEditorComponent } from './common/components/plugin-editor/plugin-
ReactiveFormsModule,
MonacoEditorModule.forRoot(ngxMonacoEditorConfig),
FlexLayoutModule,
...MatModules
...MatModules,
FormsModule
],
providers: [
ConfigService,
Expand Down
58 changes: 43 additions & 15 deletions workbench/frontend/src/app/common/components/resource-query/resource-query.component.html
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,32 +1,60 @@
<h2>resources: {{ (resources$ | async)?.length }}</h2>
<div style="display: flex;">
<div style="width: 30%; margin-right: 24px;">
<h2>Resources: {{ (resources$ | async)?.length }}</h2>
<div style="display: inline-flex; flex-direction: row; align-items: center;">

<h3 *ngIf="(selectedSkills$ | async)?.length > 0" style="white-space: nowrap; font-weight: bold;">Selected Skills:</h3>

<mat-chip-list style="margin-left: 16px; margin-bottom: 20px;">
<mat-chip *ngFor="let skill of (selectedSkills$ | async)" [removable]="true" (removed)="removeSkill(skill)">
{{ skill }}
<mat-icon matChipRemove style="margin-left: 4px;">close</mat-icon>
</mat-chip>
</mat-chip-list>
</div>

<div style="display: flex;">
<div style="width: 30%;">
<mat-chip-list style="margin-bottom: 20px;">
<mat-chip *ngFor="let resource of (resources$ | async)" [removable]="true" (removed)="remove(resource)">
<mat-icon matChipRemove>delete</mat-icon>
<mat-chip style="white-space: nowrap;" *ngFor="let resource of (resources$ | async)" [removable]="true" (removed)="remove(resource)">
[{{ resource.id | slice:0:6 }}] {{ resource.firstName }} {{ resource.lastName }}
<mat-icon matChipRemove>close</mat-icon>
</mat-chip>
</mat-chip-list>
</div>
<div style="width: 70%;">

<button mat-raised-button (click)="doQuery()" color="primary" class="margin-10">run query</button>
query-templates:
<button mat-button (click)="applyTmpl('default')" class="margin-10">default</button>
<button mat-button (click)="applyTmpl('skill')" class="margin-10">by skill</button>
<button mat-button (click)="applyTmpl('region')" class="margin-10">by region</button>


<h2>Query Templates:</h2>

<div class="tab-container">
<button mat-button (click)="applyTmpl('default')" [ngClass]="{'selected': selectedTemplate === 'default'}"
class="margin-10">Default
</button>
<button mat-button (click)="applyTmpl('skill')" [ngClass]="{'selected': selectedTemplate === 'skill'}"
class="margin-10">By Skill
</button>
<button mat-button (click)="applyTmpl('region')" [ngClass]="{'selected': selectedTemplate === 'region'}"
class="margin-10">By Region
</button>
</div>

<div style="display: inline-flex; flex-wrap: wrap; margin-top: 16px;">
<div style="display: flex; flex-direction: row;">
<mat-checkbox style="margin-right: 16px;" [(ngModel)]="crowdChecked" (change)="switchCrowdInternal('CROWD')">Crowd</mat-checkbox>
<mat-checkbox [(ngModel)]="internalChecked" (change)="switchCrowdInternal('INTERNAL')">Internal</mat-checkbox>
</div>
</div>

<div style="height: 5px; margin-top: 15px;">
<mat-progress-bar *ngIf="(isLoading$ | async)" style="height: 5px;" mode="indeterminate"></mat-progress-bar>
</div>
<form [formGroup]="form">
<ngx-monaco-editor class="monaco-editor" [options]="editorOptions" (onInit)="onEditor($event)"
formControlName="query" style="min-height: 400px;">
formControlName="query" style="min-height: 400px;">
</ngx-monaco-editor>
</form>

<div style="display: flex; justify-content: right; align-items: start; margin-top: 15px;">
<button mat-raised-button (click)="doQuery()" style="" color="primary" class="margin-10">run query</button>
</div>


</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.selected {
background-color: #e0e0e0;
color: #333;
border-bottom: 3px solid #ccc;
}

.mat-button {
transition: background-color 0.3s;
}

.mat-button:not(.selected):hover {
background-color: #e0e0e0;
}

.selected:hover {
background-color: #e0e0e0;
}
Loading
Loading