Skip to content

Commit bc32072

Browse files
committed
Updating HPO single column dialog
1 parent 87733b5 commit bc32072

File tree

5 files changed

+64
-21
lines changed

5 files changed

+64
-21
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "phenoboard",
3-
"version": "0.5.105",
3+
"version": "0.5.106",
44
"scripts": {
55
"ng": "ng",
66
"start": "nx serve phenoboard --port 1420",

src-tauri/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "phenoboard"
3-
version = "0.5.105"
3+
version = "0.5.106"
44
description = "Curate cohorts of GA4GH Phenopackets"
55
authors = ["Peter N Robinson"]
66
edition = "2021"
@@ -25,7 +25,7 @@ ontolius = "0.7.2"
2525
reqwest = { version = "0.13.2", features = ["json", "blocking"] }
2626
rfd = { version = "0.16.0", default-features = false}
2727
fenominal = { git = 'https://github.com/P2GX/fenominal.git', tag = '0.1.18' }
28-
ga4ghphetools = { git = 'https://github.com/P2GX/ga4ghphetools.git', tag = '0.5.24' }
28+
ga4ghphetools = { git = 'https://github.com/P2GX/ga4ghphetools.git', tag = '0.5.27' }
2929
#ga4ghphetools = { path = "../../ga4ghphetools" }
3030
serde = { version = "1.0.219", features = ["derive"] }
3131
serde_json = "1.0.148"

src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "phenoboard",
4-
"version": "0.5.105",
4+
"version": "0.5.106",
55
"identifier": "org.p2gx.phenoboard",
66
"build": {
77
"beforeDevCommand": "npx nx serve phenoboard --configuration=development --no-cloud",
Lines changed: 58 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,69 @@
11
import { Component, inject } from '@angular/core';
2-
import { MatDialogRef, MatDialogContent, MatDialogModule, MAT_DIALOG_DATA } from '@angular/material/dialog';
2+
import { MatDialogRef, MatDialogContent, MatDialogModule, MAT_DIALOG_DATA, MatDialogActions } from '@angular/material/dialog';
3+
import { MatButtonModule } from '@angular/material/button';
4+
import { MatIconModule } from '@angular/material/icon';
35
import { HpoAutocompleteComponent } from './hpoautocomplete.component';
46
import { HpoTermDuplet } from '../models/hpo_term_dto';
57
import { HpoMatch } from '../models/hpo_mapping_result';
68

7-
/** A wrapper that allows the autocomplete to be used as a modal dialog */
9+
/** A wrapper that allows the autocomplete to be used as a modal dialog with a modern UI */
810
@Component({
911
selector: 'app-hpo-dialog-wrapper',
1012
standalone: true,
11-
imports: [HpoAutocompleteComponent, MatDialogContent, MatDialogModule],
13+
imports: [
14+
HpoAutocompleteComponent,
15+
MatDialogContent,
16+
MatDialogModule,
17+
MatDialogActions,
18+
MatButtonModule,
19+
MatIconModule
20+
],
1221
template: `
13-
<h2 mat-dialog-title>{{data.title}}</h2>
14-
<p class="text-sm text-gray-500 italic">Select HPO term</p>
15-
<mat-dialog-content>
16-
<app-hpoautocomplete
17-
[inputString]="data.bestMatch.label"
18-
(selected)="onSelected($event)">
19-
</app-hpoautocomplete>
20-
</mat-dialog-content>
21-
<mat-dialog-actions>
22-
<button mat-button (click)="dialogRef.close()" class="btn-outline-cancel">Cancel</button>
23-
</mat-dialog-actions>
24-
`
22+
<div class="flex flex-col max-w-[500px]">
23+
<div class="px-6 py-4 border-b border-slate-100 bg-slate-50/50">
24+
<h2 class="text-xl font-semibold text-slate-800 m-0 flex items-center gap-2">
25+
<mat-icon class="text-blue-600">manage_search</mat-icon>
26+
{{data.title}}
27+
</h2>
28+
<p class="text-xs text-slate-500 mt-1 uppercase tracking-tight font-medium">
29+
Confirm or refine the Phenotype Term
30+
</p>
31+
</div>
32+
33+
<mat-dialog-content class="!m-0 !p-6 overflow-visible">
34+
<div class="space-y-4">
35+
<div class="p-4 bg-white border border-slate-200 rounded-xl shadow-sm transition-all focus-within:ring-2 focus-within:ring-blue-100">
36+
<app-hpoautocomplete
37+
[inputString]="data.bestMatch.label"
38+
(selected)="onSelected($event)">
39+
</app-hpoautocomplete>
40+
</div>
41+
42+
<div class="flex items-center gap-2 px-1">
43+
<mat-icon class="text-slate-400 !w-4 !h-4 !text-[16px]">help_outline</mat-icon>
44+
<span class="text-[11px] text-slate-400 italic">
45+
Results are pulled directly from the Human Phenotype Ontology.
46+
</span>
47+
</div>
48+
</div>
49+
</mat-dialog-content>
50+
51+
<mat-dialog-actions align="end" class="!px-6 !pb-6 !pt-2">
52+
<button
53+
mat-button
54+
(click)="dialogRef.close()"
55+
class="!text-slate-500 hover:!bg-slate-100 !px-4 !rounded-lg">
56+
Cancel
57+
</button>
58+
</mat-dialog-actions>
59+
</div>
60+
`,
61+
styles: [`
62+
/* Crucial: prevents the autocomplete dropdown from being hidden by the dialog's scroll container */
63+
:host ::ng-deep .mat-mdc-dialog-content {
64+
overflow: visible !important;
65+
}
66+
`]
2567
})
2668
export class HpoDialogWrapperComponent {
2769
public dialogRef = inject(MatDialogRef<HpoDialogWrapperComponent>);
@@ -34,4 +76,4 @@ export class HpoDialogWrapperComponent {
3476
};
3577
this.dialogRef.close(duplet);
3678
}
37-
}
79+
}

src/app/hpoautocomplete/hpoautocomplete.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ export class HpoAutocompleteComponent {
7575
effect(() => {
7676
const val = this.inputString();
7777
if (val) {
78-
this.control.setValue(val, {emitEvent: false});
78+
this.control.setValue(val, {emitEvent: true});
79+
setTimeout(() => this.inputElement()?.focus(), 0);
7980
this.inputElement()?.select();
8081
}
8182
});

0 commit comments

Comments
 (0)