Skip to content

Commit 305994c

Browse files
committed
fix(tooltip): use unique 'hint-experts' key for program rating hint
Even with isolated DI instances, using the same 'base' key as the analytics button (DeatilComponent) could still conflict. Replace with a dedicated TooltipKey so the hint tooltip state is never reachable from any other component regardless of DI scope. - Add 'hint-experts' to TooltipKey union - Replace 'base' with 'hint-experts' in list.component.html and openHintModal
1 parent 93f594e commit 305994c

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

projects/social_platform/src/app/api/tooltip/tooltip-info.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ export type TooltipKey =
1616
| "auth"
1717
| "lib"
1818
| "login"
19-
| "team";
19+
| "team"
20+
| "hint-experts";
2021

2122
/** Реестр состояния тултипов по ключу: show/hide/toggle. */
2223
@Injectable()

projects/social_platform/src/app/ui/pages/program/detail/list/list.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,11 @@
180180
<app-tooltip
181181
color="grey"
182182
iconSize="40"
183-
(show)="tooltipInfoService.show('base')"
183+
(show)="tooltipInfoService.show('hint-experts')"
184184
></app-tooltip>
185185

186-
@if (tooltipInfoService.isVisible('base')) {
187-
<div class="tooltip__wrapper" (mouseleave)="tooltipInfoService.hide('base')">
186+
@if (tooltipInfoService.isVisible('hint-experts')) {
187+
<div class="tooltip__wrapper" (mouseleave)="tooltipInfoService.hide('hint-experts')">
188188
<p class="tooltip__text text-body-10">
189189
Нажмите, чтобы открыть подсказку и узнать больше о процессе оценивания проектов
190190
</p>

projects/social_platform/src/app/ui/pages/program/detail/list/list.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export class ProgramListComponent implements OnInit, AfterViewInit {
154154

155155
openHintModal(event: Event): void {
156156
event.preventDefault();
157-
this.tooltipInfoService.toggleTooltip("base");
157+
this.tooltipInfoService.toggleTooltip("hint-experts");
158158
this.programDetailListUIInfoService.applyHintModalOpen();
159159
}
160160

0 commit comments

Comments
 (0)