Skip to content

Commit aaecd43

Browse files
committed
fixing parent-child menu location
1 parent feda175 commit aaecd43

File tree

7 files changed

+29
-8
lines changed

7 files changed

+29
-8
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.95",
3+
"version": "0.5.96",
44
"scripts": {
55
"ng": "ng",
66
"start": "nx serve phenoboard --port 1420",

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "phenoboard"
3-
version = "0.5.95"
3+
version = "0.5.96"
44
description = "Curate cohorts of GA4GH Phenopackets"
55
authors = ["Peter N Robinson"]
66
edition = "2021"

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.95",
4+
"version": "0.5.96",
55
"identifier": "org.p2gx.phenoboard",
66
"build": {
77
"beforeDevCommand": "npx nx serve phenoboard --configuration=development --no-cloud",

src/app/hpopolishing/hpopolishing.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@
6767

6868
<div class="mt-4 p-2 border rounded bg-gray-50 flex flex-col h-[70vh]">
6969
<strong class="mb.1">Annotated Terms: n={{ getFenominalAnnotations().length }}</strong>
70-
<!-- text-annotations.component.html -->
71-
<div class="flex-1 overflow-y-auto border border-gray-300 rounded">
72-
<table class="table-auto w-full border-collapse text-xs leading-tight">
70+
<!-- text-annotations.component.htmloverflow-y-auto -->
71+
<div class="flex-1 border border-gray-300 rounded">
72+
<table #annotationTable class="table-auto w-full border-collapse text-xs leading-tight">
7373
<thead class="bg-gray-100 sticky top-0 z-10">
7474
<tr>
7575
<th class="border px-1 py-[1px]">Term ID</th>

src/app/hpopolishing/hpopolishing.component.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { HpoAnnotationDto, ParentChildDto, TextAnnotationDto, textAnnotationToHpoAnnotation, to_annotation_dto } from '../models/text_annotation_dto';
22
import { AgeInputService } from '../services/age_service';
33
import { CommonModule } from '@angular/common';
4-
import { Component, Input, Output, EventEmitter, OnInit, inject, signal } from '@angular/core';
4+
import { Component, Input, Output, EventEmitter, OnInit, inject, signal, ElementRef, ViewChild, HostListener } from '@angular/core';
55
import { FormsModule } from '@angular/forms';
66
import { openUrl } from '@tauri-apps/plugin-opener';
77
import { ConfigService } from '../services/config.service';
@@ -30,6 +30,7 @@ export class HpoPolishingComponent implements OnInit {
3030
private configService = inject(ConfigService);
3131
private dialog = inject(MatDialog);
3232
private notificationService = inject(NotificationService);
33+
@ViewChild('annotationTable') annotationTable!: ElementRef;
3334

3435
availableOnsetTerms = this.ageService.selectedTerms;
3536
hpoAnnotations = signal<HpoAnnotationDto[]>([]);
@@ -120,6 +121,14 @@ export class HpoPolishingComponent implements OnInit {
120121
}
121122
}
122123

124+
@HostListener('document:mousedown', ['$event']) // mousedown is often more reliable than click
125+
onGlobalClick(event: MouseEvent): void {
126+
const clickedInside = this.annotationTable.nativeElement.contains(event.target);
127+
if (!clickedInside) {
128+
this.showDropdownMap = {};
129+
}
130+
}
131+
123132
/** This is used in the GUI to replace a term by a parent or child term. */
124133
replaceTerm(annotation: HpoAnnotationDto, replacement: HpoAnnotationDto) {
125134
this.hpoAnnotations.update(current => {

src/app/pttemplate/pttemplate.component.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,9 @@
426426
(click)="focusOnSingleRow()">Focus on row</li>
427427
<li class="px-3 py-1 cursor-pointer hover:bg-gray-100"
428428
(click)="focusOnPmid(contextRowPmid)">Focus on PMID: {{ contextRowPmid ?? 'N/A' }}</li>
429+
<li class="px-3 py-1 cursor-pointer hover:bg-gray-100 text-blue-600 flex justify-between items-center"
430+
(click)="openPmidInBrowser(contextRowPmid)"> Open PMID in Browser<span class="text-xs"></span>
431+
</li>
429432
<li class="px-3 py-1 cursor-pointer hover:bg-gray-100"
430433
(click)="showAllRows()">Show all rows</li>
431434
<li class="px-3 py-1 cursor-pointer hover:bg-gray-100"

src/app/pttemplate/pttemplate.component.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { MatButtonToggleModule } from '@angular/material/button-toggle';
2121
import { CohortSummaryComponent } from "../cohortsummary/cohortsummary.component";
2222
import { ConfirmDialogComponent } from '../addcase/confirmdialog.component';
2323
import { HelpButtonComponent } from "../util/helpbutton/help-button.component";
24-
import { rxResource } from '@angular/core/rxjs-interop';
24+
import { openUrl } from '@tauri-apps/plugin-opener';
2525
import { CohortMetadataComponent } from "../util/cohortmetadata/cohort-metadata.component";
2626

2727
interface Option { label: string; value: string };
@@ -1054,4 +1054,13 @@ visibleColumnMask = computed<Uint8Array>(() => {
10541054
});
10551055
}
10561056

1057+
async openPmidInBrowser(pmid: string | null) {
1058+
if (!pmid) return;
1059+
const cleanId = pmid.replace(/pmid:/i, '').trim();
1060+
if (cleanId) {
1061+
const url = `https://pubmed.ncbi.nlm.nih.gov/${cleanId}/`;
1062+
await openUrl(url);
1063+
}
1064+
}
1065+
10571066
}

0 commit comments

Comments
 (0)