-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: improve filter editor usability
- Loading branch information
Showing
4 changed files
with
59 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 41 additions & 36 deletions
77
src/app/components-small/plugin-filter-editor/plugin-filter-editor.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,57 @@ | ||
<div class="filter-editor mat-elevation-z0"> | ||
<h3 class="editor-description">Filter Editor</h3> | ||
<qhana-plugin-filter-node *ngIf="filterObject" [filterObject]="filterObject" (childChange)="updateFilter($event)"></qhana-plugin-filter-node> | ||
<details> | ||
<summary>Filter String Info</summary> | ||
|
||
<i>Enter a filter string as JSON object. Filter strings have the following keys:</i> | ||
<dl> | ||
<dt>name</dt> <dd>Represents the name of a plugin.</dd> | ||
<dt>tag</dt> <dd>Allows filtering elements by their assigned tags.</dd> | ||
<dt>version</dt> <dd>Uses PEP 440 version specifier to filter elements based on specific versions or version ranges.</dd> | ||
<dt>not</dt> <dd>Specifies a filter string to exclude certain elements.</dd> | ||
<dt>and</dt> <dd>Includes multiple filter strings, with elements passing all conditions included in the filtered results (intersection).</dd> | ||
<dt>or</dt> <dd>Includes multiple filter strings, with elements meeting at least one condition included in the filtered results (union).</dd> | ||
</dl> | ||
<mat-divider></mat-divider> | ||
<p>Examples:</p> | ||
<mat-slide-toggle [(ngModel)]="showEditor"> | ||
Editor Mode {{ showEditor ? '(UI)' : '(JSON)' }} | ||
</mat-slide-toggle> | ||
<qhana-plugin-filter-node *ngIf="filterObject && showEditor" [filterObject]="filterObject" (childChange)="updateFilter($event)"></qhana-plugin-filter-node> | ||
<ng-container *ngIf="!showEditor"> | ||
<mat-form-field class="form-field"> | ||
<textarea class="filter-example" matInput disabled rows="3"> | ||
<mat-label>Filter String:</mat-label> | ||
<textarea matInput [formControl]="filterControl" cdkTextareaAutosize #autosize="cdkTextareaAutosize" | ||
cdkAutosizeMinRows="1" cdkAutosizeMaxRows="20" (input)="updateFilterEditor()"> | ||
</textarea> | ||
<button mat-raised-button class="copy-button" type="button" (click)="copyFilterString()"> | ||
<mat-icon>content_copy</mat-icon> | ||
</button> | ||
</mat-form-field> | ||
<details> | ||
<summary>Filter String Info</summary> | ||
|
||
<i>Enter a filter string as JSON object. Filter strings have the following keys:</i> | ||
<dl> | ||
<dt>name</dt> <dd>Represents the name of a plugin.</dd> | ||
<dt>tag</dt> <dd>Allows filtering elements by their assigned tags.</dd> | ||
<dt>version</dt> <dd>Uses PEP 440 version specifier to filter elements based on specific versions or version ranges.</dd> | ||
<dt>not</dt> <dd>Specifies a filter string to exclude certain elements.</dd> | ||
<dt>and</dt> <dd>Includes multiple filter strings, with elements passing all conditions included in the filtered results (intersection).</dd> | ||
<dt>or</dt> <dd>Includes multiple filter strings, with elements meeting at least one condition included in the filtered results (union).</dd> | ||
</dl> | ||
<mat-divider></mat-divider> | ||
<p>Examples:</p> | ||
<mat-form-field class="form-field"> | ||
<textarea class="filter-example" matInput disabled rows="3"> | ||
{ | ||
"name": "hello-world" | ||
} | ||
</textarea> | ||
</mat-form-field> | ||
<mat-form-field class="form-field"> | ||
<textarea class="filter-example" matInput disabled rows="3"> | ||
</textarea> | ||
</mat-form-field> | ||
<mat-form-field class="form-field"> | ||
<textarea class="filter-example" matInput disabled rows="3"> | ||
{ | ||
"not": { "name": "hello-world" } | ||
} | ||
</textarea> | ||
</mat-form-field> | ||
<mat-form-field class="form-field"> | ||
<textarea class="filter-example" matInput disabled rows="6"> | ||
</textarea> | ||
</mat-form-field> | ||
<mat-form-field class="form-field"> | ||
<textarea class="filter-example" matInput disabled rows="6"> | ||
{ | ||
"and": [ | ||
{ "tag": "data-loading" }, | ||
{ "version": ">=0.2.0" } | ||
] | ||
} | ||
</textarea> | ||
</mat-form-field> | ||
</details> | ||
<mat-form-field class="form-field"> | ||
<mat-label>Filter String:</mat-label> | ||
<textarea matInput [formControl]="filterControl" cdkTextareaAutosize #autosize="cdkTextareaAutosize" | ||
cdkAutosizeMinRows="1" cdkAutosizeMaxRows="20" (input)="updateFilterEditor()"> | ||
</textarea> | ||
<button mat-raised-button class="copy-button" type="button" (click)="copyFilterString()"> | ||
<mat-icon>content_copy</mat-icon> | ||
</button> | ||
</mat-form-field> | ||
</textarea> | ||
</mat-form-field> | ||
</details> | ||
</ng-container> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters