Skip to content

Commit ecd1810

Browse files
committed
fix icons in profile & language issues with adding
1 parent ca47da5 commit ecd1810

11 files changed

Lines changed: 119 additions & 86 deletions

File tree

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/** @format */
22

33
export const filterExperience = [
4-
{ label: "без опыта", value: "no_experience" },
5-
{ label: "до 1 года", value: "up_to_a_year" },
6-
{ label: "от 1 года до 3 лет", value: "from_one_to_three_years" },
7-
{ label: "от 3 лет и более", value: "from_three_years" },
4+
{ label: "Без опыта", value: "no_experience" },
5+
{ label: "До 1 года", value: "up_to_a_year" },
6+
{ label: "От 1 года до 3 лет", value: "from_one_to_three_years" },
7+
{ label: "От 3 лет и более", value: "from_three_years" },
88
];
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @format */
22

33
export const filterWorkFormat = [
4-
{ label: "удаленная работа", value: "remote" },
5-
{ label: "работа в офисе", value: "office" },
6-
{ label: "смешанный формат", value: "hybrid" },
4+
{ label: "Удаленная работа", value: "remote" },
5+
{ label: "Работа в офисе", value: "office" },
6+
{ label: "Смешанный формат", value: "hybrid" },
77
];
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/** @format */
22

33
export const filterWorkSchedule = [
4-
{ label: "полный рабочий день", value: "full_time" },
5-
{ label: "сменный график", value: "shift_work" },
6-
{ label: "гибкий график", value: "flexible_schedule" },
7-
{ label: "частичная занятость", value: "part_time" },
8-
{ label: "стажировка", value: "internship" },
4+
{ label: "Полный рабочий день", value: "full_time" },
5+
{ label: "Сменный график", value: "shift_work" },
6+
{ label: "Гибкий график", value: "flexible_schedule" },
7+
{ label: "Частичная занятость", value: "part_time" },
8+
{ label: "Стажировка", value: "internship" },
99
];

projects/core/src/consts/list-years.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,6 @@ export const yearList = [
164164
{
165165
value: 2025,
166166
id: 25,
167-
label: "н.в",
167+
label: "настоящее время",
168168
},
169169
];

projects/social_platform/src/app/office/profile/detail/profile-detail.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ <h2 class="info__name">{{ user.firstName }} {{ user.lastName }}</h2>
115115
@if (user.progress !== 100) {
116116
<i
117117
appIcon
118-
icon="color-error"
118+
icon="accent-error"
119119
appSquare="16"
120120
(mouseenter)="showTooltip()"
121121
(mouseleave)="hideTooltip()"

projects/social_platform/src/app/office/profile/edit/edit.component.html

Lines changed: 44 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,10 @@
302302

303303
@if (profileForm.get("organizationName"); as organizationName) {
304304
<fieldset>
305-
<label for="organizationName" class="field-label">Названия учереждения</label>
305+
<label for="organizationName" class="field-label">Название учереждения</label>
306306
<app-input
307307
[error]="organizationName | controlError"
308-
placeholder="вуз / колледж / школа"
308+
placeholder="Вуз / Колледж / Школа"
309309
formControlName="organizationName"
310310
></app-input>
311311
@if (organizationName | controlError: "required") {
@@ -672,45 +672,50 @@
672672
</div>
673673

674674
<div class="profile__right">
675-
<div class="profile__language">
676-
<div class="education__years">
677-
@if (profileForm.get("language"); as language) {
678-
<fieldset class="years__right">
679-
<label for="languageName" class="field-label">Язык</label>
680-
<app-select
681-
[selectedId]="selectedLanguageId()"
682-
formControlName="language"
683-
placeholder="Английский"
684-
[options]="languageList"
685-
>
686-
<i appIcon icon="arrow-no-body" appSquare="32" class="arrow-list__end"></i>
687-
</app-select>
675+
<div class="profile__language--wrapper">
676+
<div class="profile__language">
677+
<div class="education__years">
678+
@if (profileForm.get("language"); as language) {
679+
<fieldset class="years__right">
680+
<label for="languageName" class="field-label">Язык</label>
681+
<app-select
682+
[selectedId]="selectedLanguageId()"
683+
formControlName="language"
684+
placeholder="Английский"
685+
[options]="languageList"
686+
>
687+
<i appIcon icon="arrow-no-body" appSquare="32" class="arrow-list__end"></i>
688+
</app-select>
688689

689-
@if (language | controlError: "required") {
690-
<div class="text-body-14 error">
691-
{{ errorMessage.VALIDATION_REQUIRED }}
692-
</div>
693-
}
694-
</fieldset>
695-
} @if (profileForm.get("languageLevel"); as languageLevel) {
696-
<fieldset class="years__right">
697-
<label for="languagLevel" class="field-label">Уровень</label>
698-
<app-select
699-
[selectedId]="selectedLanguageLevelId()"
700-
formControlName="languageLevel"
701-
placeholder="B1"
702-
[options]="languageLevelList"
703-
>
704-
<i appIcon icon="arrow-no-body" appSquare="32" class="arrow-list__end"></i>
705-
</app-select>
690+
@if (language | controlError: "required") {
691+
<div class="text-body-14 error">
692+
{{ errorMessage.VALIDATION_REQUIRED }}
693+
</div>
694+
}
695+
</fieldset>
696+
} @if (profileForm.get("languageLevel"); as languageLevel) {
697+
<fieldset class="years__right">
698+
<label for="languagLevel" class="field-label">Уровень</label>
699+
<app-select
700+
[selectedId]="selectedLanguageLevelId()"
701+
formControlName="languageLevel"
702+
placeholder="B1"
703+
[options]="languageLevelList"
704+
>
705+
<i appIcon icon="arrow-no-body" appSquare="32" class="arrow-list__end"></i>
706+
</app-select>
706707

707-
@if (languageLevel | controlError: "required") {
708-
<div class="text-body-14 error">
709-
{{ errorMessage.VALIDATION_REQUIRED }}
710-
</div>
708+
@if (languageLevel | controlError: "required") {
709+
<div class="text-body-14 error">
710+
{{ errorMessage.VALIDATION_REQUIRED }}
711+
</div>
712+
}
713+
</fieldset>
711714
}
712-
</fieldset>
713-
}
715+
</div>
716+
<span class="text-body-12 profile__language--attention"
717+
>Количество добавляемых языков не более 4-х</span
718+
>
714719
</div>
715720

716721
<app-button
@@ -719,7 +724,7 @@
719724
"
720725
[ngStyle]="{
721726
opacity: !isLanguageDirty ? '0.6' : '1',
722-
cursor: !isLanguageDirty ? 'not-allowed' : 'pointer'
727+
cursor: !isLanguageDirty ? 'not-allowed' : 'pointer',
723728
}"
724729
class="profile__add-education"
725730
(click)="addLanguage()"

projects/social_platform/src/app/office/profile/edit/edit.component.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@
151151
&__language {
152152
margin-top: 20px;
153153
margin-bottom: 20px;
154+
155+
&--attention {
156+
color: var(--dark-grey);
157+
}
154158
}
155159

156160
&__add-achievement {

projects/social_platform/src/app/office/profile/edit/edit.component.ts

Lines changed: 49 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -726,38 +726,60 @@ export class ProfileEditComponent implements OnInit, OnDestroy, AfterViewInit {
726726
}
727727

728728
addLanguage() {
729-
["language", "languageLevel"].forEach(name => this.profileForm.get(name)?.clearValidators());
730-
["language", "languageLevel"].forEach(name =>
731-
this.profileForm.get(name)?.setValidators([Validators.required])
732-
);
733-
["language", "languageLevel"].forEach(name =>
734-
this.profileForm.get(name)?.updateValueAndValidity()
735-
);
736-
["language", "languageLevel"].forEach(name => this.profileForm.get(name)?.markAsTouched());
729+
const languageValue = this.profileForm.get("language")?.value;
730+
const languageLevelValue = this.profileForm.get("languageLevel")?.value;
737731

738-
const languageItem = this.fb.group({
739-
language: this.profileForm.get("language")?.value,
740-
languageLevel: this.profileForm.get("languageLevel")?.value,
732+
["language", "languageLevel"].forEach(name => {
733+
this.profileForm.get(name)?.clearValidators();
741734
});
742735

743-
if (this.editIndex() !== null) {
744-
this.languageItems.update(items => {
745-
const updatedItems = [...items];
746-
updatedItems[this.editIndex()!] = languageItem.value;
747-
748-
this.userLanguages.at(this.editIndex()!).patchValue(languageItem.value);
749-
return updatedItems;
736+
if ((languageValue && !languageLevelValue) || (!languageValue && languageLevelValue)) {
737+
["language", "languageLevel"].forEach(name => {
738+
this.profileForm.get(name)?.setValidators([Validators.required]);
750739
});
751-
this.editIndex.set(null);
752-
} else {
753-
this.languageItems.update(items => [...items, languageItem.value]);
754-
this.userLanguages.push(languageItem);
755740
}
756741

757-
this.profileForm.get("language")?.reset();
758-
this.profileForm.get("languageLevel")?.reset();
742+
["language", "languageLevel"].forEach(name => {
743+
this.profileForm.get(name)?.updateValueAndValidity();
744+
this.profileForm.get(name)?.markAsTouched();
745+
});
746+
747+
const isLanguageValid = this.profileForm.get("language")?.valid;
748+
const isLanguageLevelValid = this.profileForm.get("languageLevel")?.valid;
749+
750+
if (!isLanguageValid || !isLanguageLevelValid) {
751+
return;
752+
}
753+
754+
const languageItem = this.fb.group({
755+
language: languageValue,
756+
languageLevel: languageLevelValue,
757+
});
758+
759+
if (languageValue && languageLevelValue) {
760+
if (this.editIndex() !== null) {
761+
this.languageItems.update(items => {
762+
const updatedItems = [...items];
763+
updatedItems[this.editIndex()!] = languageItem.value;
764+
this.userLanguages.at(this.editIndex()!).patchValue(languageItem.value);
765+
return updatedItems;
766+
});
767+
this.editIndex.set(null);
768+
} else {
769+
this.languageItems.update(items => [...items, languageItem.value]);
770+
this.userLanguages.push(languageItem);
771+
}
759772

760-
this.editLanguageClick = false;
773+
["language", "languageLevel"].forEach(name => {
774+
this.profileForm.get(name)?.reset();
775+
this.profileForm.get(name)?.setValue(null);
776+
this.profileForm.get(name)?.clearValidators();
777+
this.profileForm.get(name)?.markAsPristine();
778+
this.profileForm.get(name)?.updateValueAndValidity();
779+
});
780+
781+
this.editLanguageClick = false;
782+
}
761783
}
762784

763785
editLanguage(index: number) {
@@ -857,6 +879,8 @@ export class ProfileEditComponent implements OnInit, OnDestroy, AfterViewInit {
857879
this.isModalErrorSkillsChoose.set(true);
858880
if (error.error.phone_number) {
859881
this.isModalErrorSkillChooseText.set(error.error.phone_number[0]);
882+
} else if (error.error.language) {
883+
this.isModalErrorSkillChooseText.set(error.error.language);
860884
} else {
861885
this.isModalErrorSkillChooseText.set(error.error[0]);
862886
}

projects/social_platform/src/app/office/shared/vacancy-card/vacancy-card.component.scss

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,15 @@
2626
&__basket {
2727
color: var(--red);
2828
cursor: pointer;
29-
30-
svg {
31-
max-width: 24px;
32-
}
3329
}
3430

3531
&__edit {
3632
color: var(--dark-grey);
3733
cursor: pointer;
34+
}
3835

39-
svg {
40-
max-width: 24px;
41-
}
36+
i {
37+
width: 24px;
38+
height: 24px;
4239
}
4340
}
Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)