Skip to content

Commit ca2eaa2

Browse files
committed
add modals of errors & fix registration fields
1 parent c9358e7 commit ca2eaa2

7 files changed

Lines changed: 18 additions & 9 deletions

File tree

projects/social_platform/src/app/office/onboarding/stage-zero/stage-zero.component.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ <h3 class="auth__title">
5555
<fieldset class="years__left">
5656
<label for="entryYear" class="field-label">Дата начала</label>
5757
<app-select
58-
[selectedId]="selectedEntryYearEducationId()"
5958
formControlName="entryYear"
6059
placeholder="2023 год"
6160
[options]="yearListEducation"
@@ -73,7 +72,6 @@ <h3 class="auth__title">
7372
<fieldset class="years__right">
7473
<label for="completionYear" class="field-label">Дата окончания</label>
7574
<app-select
76-
[selectedId]="selectedComplitionYearEducationId()"
7775
formControlName="completionYear"
7876
placeholder="2023 год"
7977
[options]="yearListEducation.slice(5)"
@@ -167,7 +165,7 @@ <h3 class="auth__title">
167165
class="page__add-education"
168166
(click)="addEducation()"
169167
>
170-
<span>Добавить образование</span>
168+
<span>{{ editEducationClick ? "Созранить изменения" : "Добавить образование" }}</span>
171169
<i appIcon icon="plus" appSquare="14"></i>
172170
</app-button>
173171

@@ -305,7 +303,7 @@ <h3 class="auth__title">
305303
class="page__add-education"
306304
(click)="addWork()"
307305
>
308-
<span>Добавить место работы</span>
306+
<span>{{ editWorkClick ? "Сохранить изменения" : "Добавить место работы" }}</span>
309307
<i appIcon icon="plus" appSquare="14"></i>
310308
</app-button>
311309

@@ -435,7 +433,7 @@ <h3 class="auth__title">
435433
class="page__add-education"
436434
(click)="addLanguage()"
437435
>
438-
<span>Добавить язык</span>
436+
<span>{{ editLanguageClick ? "Сохранить изменения" : "Добавить язык" }}</span>
439437
<i appIcon icon="plus" appSquare="14"></i>
440438
</app-button>
441439

projects/social_platform/src/app/office/onboarding/stage-zero/stage-zero.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,7 @@ export class OnboardingStageZeroComponent implements OnInit, OnDestroy {
579579

580580
onSubmit(): void {
581581
if (!this.validationService.getFormValidation(this.stageForm)) {
582+
this.achievements.markAllAsTouched();
582583
return;
583584
}
584585

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
<app-avatar-control
4444
id="avatar"
4545
formControlName="avatar"
46+
type="profile"
4647
[size]="180"
4748
[error]="avatar | controlError"
4849
></app-avatar-control>
@@ -834,7 +835,15 @@
834835
></i>
835836
<p class="cancel__title text-bold-body-16">Произошла ошибка при редактировании!</p>
836837
</div>
838+
@if (isModalErrorSkillChooseText()) {
837839
<p class="text-body-14 cancel__text">{{ isModalErrorSkillChooseText() }}.</p>
840+
} @else {
841+
<p class="text-body-14 cancel__text">
842+
Для публикации профиля, нужно заполнить все <strong>обязательные поля</strong> (они будут
843+
<strong>подсвечены&nbsp;<span>красным</span></strong
844+
>).
845+
</p>
846+
}
838847
</div>
839848
</app-modal>
840849

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,7 @@ export class ProfileEditComponent implements OnInit, OnDestroy, AfterViewInit {
739739

740740
saveProfile(): void {
741741
if (!this.validationService.getFormValidation(this.profileForm) || this.profileFormSubmitting) {
742+
this.isModalErrorSkillsChoose.set(true);
742743
return;
743744
}
744745

projects/social_platform/src/app/ui/components/avatar-control/avatar-control.component.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
<div
44
[ngStyle]="{
5-
border: type === 'project' ? '3px solid var(--accent)' : '3px solid var(--accent)',
6-
borderRadius: type === 'project' ? '50%' : '0%',
7-
}"
5+
border: (type === 'project' || type === 'profile') ? '3px solid var(--accent)' : 'none',
6+
}"
87
class="control"
98
[style.width]="size + 'px'"
109
[style.height]="size + 'px'"

projects/social_platform/src/app/ui/components/avatar-control/avatar-control.component.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.control {
2+
border-radius: 50%;
23
&__overlay {
34
position: absolute;
45
top: 0;

projects/social_platform/src/app/ui/components/avatar-control/avatar-control.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class AvatarControlComponent implements OnInit, ControlValueAccessor {
2828

2929
@Input() size = 140;
3030
@Input() error = false;
31-
@Input() type: "avatar" | "project" = "avatar";
31+
@Input() type: "avatar" | "project" | "profile" = "avatar";
3232

3333
ngOnInit(): void {}
3434

0 commit comments

Comments
 (0)