Skip to content

Commit

Permalink
add search field to choose template dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
infacc committed Aug 3, 2023
1 parent 6c47894 commit 29a6db9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/app/components/experiment/experiment.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export class ExperimentComponent implements OnInit, OnDestroy {

showSelectDefaultTemplateDialog() {
const dialogRef = this.dialog.open(ChooseTemplateDialog, {
minWidth: "20rem", maxWidth: "40rem", width: "60%", maxHeight: "95%",
minWidth: "20rem", maxWidth: "40rem", width: "20%", maxHeight: "95%",
data: this.uiTemplate
});
dialogRef.afterClosed().subscribe(templateId => {
Expand Down
17 changes: 12 additions & 5 deletions src/app/dialogs/choose-template/choose-template.component.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
<h1 mat-dialog-title>Select a default template:</h1>
<h1 mat-dialog-title>Select Default Template</h1>
<div mat-dialog-content>
<div class="template-list">
<qhana-growing-list [rels]="['ui-template', 'collection']" [newItemRels]="['ui-template']"
<mat-form-field class="full-width" color="primary">
<mat-label>Search templates</mat-label>
<input matInput placeholder="search" autocomplete="off" #searchInput>
<mat-icon matSuffix>search</mat-icon>
</mat-form-field>
<div class="template-list mat-elevation-z2">
<qhana-growing-list [rels]="['ui-template', 'collection']" [newItemRels]="['ui-template']" [search]="searchInput.value"
[highlighted]="highlightedTemplateSet" [highlightByKey]="'uiTemplateId'" (clickItem)="selectTemplate($event)">
</qhana-growing-list>
</div>
<span class="t-title">Selected Template: {{template?.name ?? 'All Plugins'}}</span><br>
<span><i>{{template?.description ?? 'This template contains all plugins that are available in Qhana.'}}</i></span>
<div class="selected-template">
<span class="t-title">Selected Template: {{template?.name ?? 'All Plugins'}}</span><br>
<span><i>{{template?.description ?? 'This template contains all plugins that are available in Qhana.'}}</i></span>
</div>
</div>
<div class="dialog-actions" mat-dialog-actions>
<button mat-button [mat-dialog-close]="'all-plugins'">Unset</button>
Expand Down
11 changes: 9 additions & 2 deletions src/app/dialogs/choose-template/choose-template.component.sass
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
.template-list
max-height: 33rem
max-height: 14rem
overflow-y: auto
border-radius: 0.25rem

.dialog-actions
justify-content: flex-end
justify-content: flex-end

.selected-template
padding-top: 1rem

.full-width
width: 100%

0 comments on commit 29a6db9

Please sign in to comment.