Skip to content

Commit 0016364

Browse files
committed
fix(profile): fix skills selection & fix specs postion
1 parent 402956c commit 0016364

6 files changed

Lines changed: 23 additions & 3 deletions

File tree

projects/social_platform/src/app/ui/pages/profile/edit/edit.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ <h4 class="text-heading-4">более специальностей</h4>
169169
[options]="specsGroup.specializations"
170170
[hasOpenGroups]="hasOpenSpecializationsGroups()"
171171
[disabled]="isSpecializationGroupDisabled(specsGroup.name)"
172+
[selectedName]="selectedSpecialityName()"
172173
(groupToggled)="onSpecializationsGroupToggled($event, specsGroup.name)"
173174
(selectOption)="onSelectSpec($event)"
174175
></app-specializations-group>

projects/social_platform/src/app/ui/pages/profile/edit/edit.component.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import { SearchesService } from "@api/searches/searches.service";
4545
import { EditStep } from "@core/lib/models/edit-step";
4646
import { GetSpecializationsNestedUseCase } from "@api/specializations/use-cases/get-specializations-nested.use-case";
4747
import { map } from "rxjs";
48+
import { toSignal } from "@angular/core/rxjs-interop";
4849
import { ProfileEditAchievementsInfoService } from "@api/profile/facades/edit/profile-edit-achievements-info.service";
4950

5051
/** Многошаговая форма редактирования профиля пользователя. */
@@ -100,6 +101,11 @@ export class ProfileEditComponent implements OnInit, AfterViewInit {
100101

101102
protected readonly profileForm = this.profileFormService.getForm();
102103

104+
protected readonly selectedSpecialityName = toSignal(
105+
this.profileFormService.getForm().get("speciality")!.valueChanges,
106+
{ initialValue: this.profileFormService.getForm().get("speciality")!.value as string | null },
107+
);
108+
103109
ngOnInit(): void {
104110
this.profileEditInfoService.initializationEditInfo();
105111
}

projects/social_platform/src/app/ui/widgets/skills-group/skills-group.component.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
min-height: 32px;
77

88
.heading {
9-
position: relative;
109
display: flex;
1110
align-items: center;
1211
justify-content: space-between;
@@ -58,7 +57,7 @@
5857

5958
&--open {
6059
position: absolute;
61-
top: 0%;
60+
top: 3%;
6261
right: 0%;
6362
width: 40%;
6463
}

projects/social_platform/src/app/ui/widgets/specializations-group/specializations-group.component.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@
1919
@if (contentVisible()) {
2020
<div class="content" [class.content--open]="hasOpenGroups()">
2121
@for (opt of options(); track opt.id) {
22-
<div class="content__option" [class.content__option--disabled]="disabled()">
22+
<div
23+
class="content__option"
24+
[class.content__option--disabled]="disabled()"
25+
[class.content__option--selected]="selectedName() === opt.name"
26+
>
2327
<label class="text-body-12" (click)="onSelectOption(opt)">{{ opt.name }}</label>
2428
</div>
2529
}

projects/social_platform/src/app/ui/widgets/specializations-group/specializations-group.component.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,15 @@
7979
background-color: var(--light-gray);
8080
}
8181

82+
&--selected {
83+
background-color: var(--light-gray);
84+
85+
label {
86+
color: var(--accent);
87+
font-weight: 600;
88+
}
89+
}
90+
8291
&--disabled {
8392
pointer-events: none;
8493
cursor: not-allowed;

projects/social_platform/src/app/ui/widgets/specializations-group/specializations-group.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export class SpecializationsGroupComponent {
1818
readonly options = input.required<Specialization[]>();
1919
readonly hasOpenGroups = input<boolean>(false);
2020
readonly disabled = input<boolean>(false);
21+
readonly selectedName = input<string | null>(null);
2122

2223
readonly selectOption = output<Specialization>();
2324
readonly groupToggled = output<boolean>();

0 commit comments

Comments
 (0)