Skip to content

Commit 8b57097

Browse files
authored
Fix mouseover in collapsed summaries (#271)
1 parent 58776ed commit 8b57097

File tree

3 files changed

+14
-42
lines changed

3 files changed

+14
-42
lines changed

src/app/metadata/features/dataset-details-table/dataset-details-table.html

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
<mat-expansion-panel>
2-
<mat-expansion-panel-header
3-
matTooltip="Download the full metadata to view all properties"
4-
matTooltipPosition="above"
5-
matTooltipShowDelay="500"
6-
matTooltipPositionAtOrigin="true"
7-
[matTooltipDisabled]="tooltipDisabled()"
8-
(mouseenter)="startHoverHeader()"
9-
(mouseleave)="endHoverHeader()"
10-
>{{ header() }}</mat-expansion-panel-header
2+
<mat-expansion-panel-header>{{ header() }}</mat-expansion-panel-header
113
><ng-template matExpansionPanelContent
124
><div class="overflow-auto">
135
@if (data().length > 0 || filterValue()) {

src/app/metadata/features/dataset-details-table/dataset-details-table.ts

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import { MatInputModule } from '@angular/material/input';
2424
import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
2525
import { MatSort, MatSortModule } from '@angular/material/sort';
2626
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
27-
import { MatTooltip } from '@angular/material/tooltip';
2827
import {
2928
datasetDetailsTableColumns,
3029
dataSortingDataAccessor,
@@ -50,7 +49,6 @@ import { ParseBytes } from '@app/shared/pipes/parse-bytes-pipe';
5049
MatPaginatorModule,
5150
MatSortModule,
5251
WithCopyButton,
53-
MatTooltip,
5452
],
5553
templateUrl: './dataset-details-table.html',
5654
styleUrl: './dataset-details-table.scss',
@@ -71,11 +69,8 @@ export class DatasetDetailsTableComponent implements AfterViewInit {
7169
return `${header})`;
7270
});
7371

74-
protected tooltipDisabled = signal(false);
7572
protected filterValue = signal('');
7673

77-
#hoverHeaderTime: number = 0;
78-
7974
/**
8075
* Apply filter to the data source
8176
* @param event The input event
@@ -97,26 +92,6 @@ export class DatasetDetailsTableComponent implements AfterViewInit {
9792
this.dataSource.filter = '';
9893
}
9994

100-
/**
101-
* When entering the tooltip, memorize start time
102-
*/
103-
startHoverHeader(): void {
104-
this.#hoverHeaderTime = Date.now();
105-
}
106-
107-
/**
108-
* After leaving the tooltip, disable if it was shown long enough
109-
*/
110-
endHoverHeader(): void {
111-
if (Date.now() - this.#hoverHeaderTime < 1000) return;
112-
const key = `hint.${this.tableName()}.details.shown`;
113-
if (!sessionStorage.getItem(key)) {
114-
sessionStorage.setItem(key, 'true');
115-
this.tooltipDisabled.set(true);
116-
}
117-
this.#hoverHeaderTime = 0;
118-
}
119-
12095
protected numItems = computed(() => this.data().length);
12196

12297
protected columns = computed(() =>
@@ -164,8 +139,5 @@ export class DatasetDetailsTableComponent implements AfterViewInit {
164139
this.matPaginators.changes.subscribe(() => {
165140
if (this.paginator) this.dataSource.paginator = this.paginator;
166141
});
167-
168-
const key = `hint.${this.tableName()}.details.shown`;
169-
if (sessionStorage.getItem(key)) this.tooltipDisabled.set(true);
170142
}
171143
}

src/app/metadata/features/dataset-details/dataset-details.html

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,14 @@ <h2 class="flex items-center text-2xl sm:inline-flex">
101101
><mat-icon inline fontIcon="book_2"></mat-icon></span
102102
><span>Study</span>
103103
</h2>
104-
<p class="text-base"><strong>ID: </strong>
105-
<a routerLink="/study/{{ study().accession }}"
106-
data-umami-event="Dataset Details Study Accession Clicked">{{ study().accession }}</a></p>
104+
<p class="text-base"
105+
><strong>ID: </strong>
106+
<a
107+
routerLink="/study/{{ study().accession }}"
108+
data-umami-event="Dataset Details Study Accession Clicked"
109+
>{{ study().accession }}</a
110+
></p
111+
>
107112
@if (study().ega_accession) {
108113
<p class="text-base">
109114
<strong>EGA ID:</strong> {{ study().ega_accession }}
@@ -268,13 +273,16 @@ <h2 class="inline-flex items-center text-2xl">
268273
[text]="dap().policy_text"
269274
pClasses="text-base"
270275
label="Policy"
271-
/>
272-
</div></div
276+
/> </div></div
273277
></mat-tab>
274278
</mat-tab-group>
275279

276280
<hr class="mb-6" />
277281

282+
<h2 class="mb-4 text-base"
283+
>Content overview (download the full metadata to view all properties):</h2
284+
>
285+
278286
<div class="grid grid-cols-1 gap-2 overflow-x-auto *:min-w-128">
279287
<app-dataset-details-table
280288
tableName="experiments"

0 commit comments

Comments
 (0)