Skip to content

Commit 4b562ff

Browse files
committed
fix: call signal inputs in templates after @input→input() migration
После миграции @input → input()/model() в ряде шаблонов сигналы использовались без вызова (). Сигнал — это функция: без () он всегда truthy / возвращает арность вместо значения, поэтому: - булевы условия инвертировались (!isXxxDirty всегда false, кнопки не дизейблились; [class.*--error]="error" висел всегда), - @for (x of items; …) итерировал функцию, - интерполяции/стили рендерили саму функцию (size + 'px', program.name). strictTemplates это не ловил: контексты class/style-байндингов, интерполяции и @if/@for проверяются нестрого. Проставлен вызов () в: avatar, skills-basket, user-type-card, header, project-navigation, project-direction-card, carousel, program-sidebar-card, new-project, write-task, profile-{experience,skills,achievements,education}-step.
1 parent e804d79 commit 4b562ff

14 files changed

Lines changed: 24 additions & 24 deletions

File tree

projects/social_platform/src/app/ui/pages/courses/lesson/shared/write-task/write-task.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
</div>
6969
</div>
7070

71-
@if (type() === "text-file" && !disabled) {
71+
@if (type() === "text-file" && !disabled()) {
7272
<div class="write-task__files">
7373
<app-upload-file [resetAfterUpload]="true" (uploaded)="onFileUploaded($event)">
7474
<div emptyPlaceholder class="write-task__upload">

projects/social_platform/src/app/ui/pages/feed/new-project/new-project.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div class="card__info">
1313
<div class="card__info--main">
1414
<p class="text-body-12">
15-
{{ feedItem.name | truncate: 30 }}
15+
{{ feedItem().name | truncate: 30 }}
1616
</p>
1717
<!-- <p class="text-body-10">{{ feedItem.datetimeCreated | dayjs: "format":"DD MM YY" }}</p> -->
1818
</div>

projects/social_platform/src/app/ui/pages/office/program-sidebar-card/program-sidebar-card.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
</div>
1818

1919
<p class="text-body-10 program__title">
20-
{{ program.name | truncate: 30 }}
20+
{{ program().name | truncate: 30 }}
2121
</p>
2222
</div>

projects/social_platform/src/app/ui/pages/onboarding/stage-three/user-type-card/user-type-card.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<!-- @format -->
22

3-
<li class="item" [class.item--active]="isActive">
3+
<li class="item" [class.item--active]="isActive()">
44
<div class="item__head">
5-
<div class="item__checkbox checkbox" [class.checkbox--active]="isActive"></div>
5+
<div class="item__checkbox checkbox" [class.checkbox--active]="isActive()"></div>
66
<div class="item__title"><ng-content select="[title]"></ng-content></div>
77
</div>
88
<div class="item__text text-body-12">

projects/social_platform/src/app/ui/pages/profile/edit/components/profile-achievements-step/profile-achievements-step.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@
9090
customTypographyClass="text-body-12"
9191
size="big"
9292
appearance="outline"
93-
[disabled]="showAchievementsFields() && !isAchievementsDirty"
93+
[disabled]="showAchievementsFields() && !isAchievementsDirty()"
9494
[ngStyle]="{
95-
opacity: showAchievementsFields() && !isAchievementsDirty ? '0.6' : '1',
96-
cursor: showAchievementsFields() && !isAchievementsDirty ? 'not-allowed' : 'pointer',
95+
opacity: showAchievementsFields() && !isAchievementsDirty() ? '0.6' : '1',
96+
cursor: showAchievementsFields() && !isAchievementsDirty() ? 'not-allowed' : 'pointer',
9797
}"
9898
(click)="addAchievement()"
9999
>

projects/social_platform/src/app/ui/pages/profile/edit/components/profile-education-step/profile-education-step.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@
134134
customTypographyClass="text-body-12"
135135
size="big"
136136
appearance="outline"
137-
[disabled]="showEducationFields() && !isEducationDirty"
137+
[disabled]="showEducationFields() && !isEducationDirty()"
138138
[ngStyle]="{
139-
opacity: showEducationFields() && !isEducationDirty ? '0.6' : '1',
140-
cursor: showEducationFields() && !isEducationDirty ? 'not-allowed' : 'pointer',
139+
opacity: showEducationFields() && !isEducationDirty() ? '0.6' : '1',
140+
cursor: showEducationFields() && !isEducationDirty() ? 'not-allowed' : 'pointer',
141141
}"
142142
class="profile__add-education"
143143
(click)="addEducation()"

projects/social_platform/src/app/ui/pages/profile/edit/components/profile-experience-step/profile-experience-step.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@
118118
customTypographyClass="text-body-12"
119119
size="big"
120120
appearance="outline"
121-
[disabled]="showWorkFields() && !isWorkDirty"
121+
[disabled]="showWorkFields() && !isWorkDirty()"
122122
[ngStyle]="{
123-
opacity: showWorkFields() && !isWorkDirty ? '0.6' : '1',
124-
cursor: showWorkFields() && !isWorkDirty ? 'not-allowed' : 'pointer',
123+
opacity: showWorkFields() && !isWorkDirty() ? '0.6' : '1',
124+
cursor: showWorkFields() && !isWorkDirty() ? 'not-allowed' : 'pointer',
125125
}"
126126
class="profile__add-education"
127127
(click)="addWork()"

projects/social_platform/src/app/ui/pages/profile/edit/components/profile-skills-step/profile-skills-step.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@
8787
appearance="outline"
8888
[disabled]="
8989
showLanguageFields() &&
90-
!isLanguageDirty &&
90+
!isLanguageDirty() &&
9191
(languageItems().length === 4 || userLanguages.length === 4)
9292
"
9393
[ngStyle]="{
94-
opacity: showLanguageFields() && !isLanguageDirty ? '0.6' : '1',
95-
cursor: showLanguageFields() && !isLanguageDirty ? 'not-allowed' : 'pointer',
94+
opacity: showLanguageFields() && !isLanguageDirty() ? '0.6' : '1',
95+
cursor: showLanguageFields() && !isLanguageDirty() ? 'not-allowed' : 'pointer',
9696
}"
9797
(click)="addLanguage()"
9898
>

projects/social_platform/src/app/ui/widgets/header/header.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<div class="header__notifications notifications">
2020
<h3 class="text-bold-body-16 notifications__title">Уведомления</h3>
2121
<ul class="notifications__invites">
22-
@for (invite of invites; track invite.id) {
22+
@for (invite of invites(); track invite.id) {
2323
<li class="notifications__invite">
2424
<app-invite-manage-card
2525
[invite]="invite"

projects/social_platform/src/app/ui/widgets/news-card/carousel/carousel.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
@if (images().length) {
44
<div class="carousel">
5-
@if (images.length !== 1) {
5+
@if (images().length !== 1) {
66
<div class="carousel__indexes">
77
<span>{{ currentIndex + 1 }} / {{ images().length }}</span>
88
</div>

0 commit comments

Comments
 (0)