Skip to content

Commit 8008375

Browse files
authored
Merge pull request #431 from medizininformatik-initiative/413-display-tree-icon-next-to-each-search-result
413 display tree icon next to each search result
2 parents f52ef1e + 556741a commit 8008375

File tree

7 files changed

+35
-8
lines changed

7 files changed

+35
-8
lines changed

src/app/layout/font-awesome-icons.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { faAngleDoubleRight, faExternalLinkAlt } from '@fortawesome/free-solid-svg-icons';
1+
import { faAngleDoubleRight, faExternalLinkAlt, faSitemap } from '@fortawesome/free-solid-svg-icons';
22
import { faAngleRight } from '@fortawesome/free-solid-svg-icons';
33
import { faArrowDown } from '@fortawesome/free-solid-svg-icons';
44
import { faArrowUp } from '@fortawesome/free-solid-svg-icons';
@@ -135,4 +135,5 @@ export const FONT_AWESOME_ICONS = [
135135
faInfo,
136136
faLink,
137137
faExternalLinkAlt,
138+
faSitemap,
138139
];

src/app/modules/feasibility-query/components/search/search.component.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ export class FeasibilityQuerySearchComponent implements OnInit, OnDestroy, After
4444

4545
elasticSearchEnabled = false;
4646

47+
listIetmDetailsSubscription: Subscription;
48+
4749
selectedDetails$: Observable<SearchTermDetails>;
4850

4951
searchFilters$: Observable<SearchFilter[]> = of([]);
@@ -93,6 +95,7 @@ export class FeasibilityQuerySearchComponent implements OnInit, OnDestroy, After
9395
this.subscription?.unsubscribe();
9496
this.searchSubscription?.unsubscribe();
9597
this.searchWithFilterSubscription?.unsubscribe();
98+
this.listIetmDetailsSubscription?.unsubscribe();
9699
}
97100

98101
/** Search Result Handling */
@@ -154,9 +157,14 @@ export class FeasibilityQuerySearchComponent implements OnInit, OnDestroy, After
154157

155158
public setClickedRow(row: InterfaceTableDataRow) {
156159
const originalEntry = row.originalEntry as CriteriaListEntry;
157-
this.searchTermDetailsService
158-
.getDetailsForListItem(originalEntry.getId())
159-
.subscribe(() => this.openSidenav());
160+
this.listIetmDetailsSubscription?.unsubscribe();
161+
if (this.isOpen) {
162+
this.closeSidenav();
163+
} else {
164+
this.listIetmDetailsSubscription = this.searchTermDetailsService
165+
.getDetailsForListItem(originalEntry.getId())
166+
.subscribe(() => this.openSidenav());
167+
}
160168
}
161169

162170
public getElasticSearchFilter(): void {

src/app/shared/components/table/table.component.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,21 @@
2323
<mat-checkbox
2424
*ngIf="row.hasCheckbox && row.checkboxColumnIndex === j"
2525
color="primary"
26+
matTooltip="{{ 'SHARED_COMPONENTS.TABLE.SELECT_CHECKBOX' | translate }}"
2627
disableRipple="true"
2728
[disabled]="!row.isDisabled"
2829
[checked]="row.isCheckboxSelected"
2930
(change)="onCheckboxSelect(row)"
3031
(click)="$event.stopPropagation()"
3132
></mat-checkbox>
33+
<fa-icon
34+
matTooltip="{{ 'SHARED_COMPONENTS.TABLE.ICON' | translate }}"
35+
*ngIf="row.treeIcon !== '' && row.treeIconColumnIndex === j"
36+
size="1x"
37+
icon="{{ row.treeIcon }}"
38+
></fa-icon>
3239
<div
40+
matTooltip="{{ cell | displayTranslation }}"
3341
[ngClass]="{
3442
'name-column': j === 0,
3543
'info-column': j > 0,

src/app/shared/components/table/table.component.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ table {
3030
}
3131

3232
.name-column {
33-
padding-left: 20px;
33+
padding-left: 10px;
3434
font-size: medium;
3535
}
3636

@@ -61,3 +61,7 @@ table {
6161
font-size: smaller;
6262
color: #6a7483;
6363
}
64+
.cursor-click {
65+
cursor: pointer;
66+
padding-left: 10px;
67+
}

src/app/shared/models/TableData/Adapter/CriteriaListEntryAdapter.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ export class CriteriaListEntryAdapter {
2121
listEntry.getContext(),
2222
],
2323
hasCheckbox: true,
24+
treeIcon: 'sitemap',
25+
treeIconColumnIndex: 0,
2426
isCheckboxSelected: false,
2527
isClickable: true,
2628
isDisabled: listEntry.getSelectable(),

src/assets/i18n/de.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,13 +353,15 @@
353353
},
354354
"TABLE": {
355355
"AVAILABILITY": "Verfügbarkeit",
356+
"SELECT_CHECKBOX": "Kriterium auswählen",
356357
"CONTEXT": "Kontext",
357358
"DISPLAY": "Anzeige",
358359
"NAME": "Name",
359360
"PATIENT_COUNT": "Anzahl der Patienten",
360361
"SITE": "Standort",
361362
"TERMCODE": "Termcode",
362-
"TERMINOLOGY_CODE": "Terminologie"
363+
"TERMINOLOGY_CODE": "Terminologie",
364+
"ICON": "Verwandte Kriterien anzeigen"
363365
}
364366
},
365367
"SHARED_FILTER": {
@@ -391,4 +393,4 @@
391393
"SEARCH": "Machbarkeitsabfrage - Suche"
392394
}
393395
}
394-
}
396+
}

src/assets/i18n/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,13 +352,15 @@
352352
},
353353
"TABLE": {
354354
"AVAILABILITY": "Availability",
355+
"SELECT_CHECKBOX": "Select Criteria",
355356
"CONTEXT": "Context",
356357
"DISPLAY": "Display",
357358
"NAME": "Name",
358359
"PATIENT_COUNT": "Number of patients",
359360
"SITE": "Location",
360361
"TERMCODE": "Term code",
361-
"TERMINOLOGY_CODE": "Terminology"
362+
"TERMINOLOGY_CODE": "Terminology",
363+
"ICON": "Show related criteria"
362364
}
363365
},
364366
"SHARED_FILTER": {

0 commit comments

Comments
 (0)