Skip to content

Commit c9358e7

Browse files
committed
fix project & profile editing modules
1 parent 0a90ae1 commit c9358e7

8 files changed

Lines changed: 348 additions & 237 deletions

File tree

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

Lines changed: 64 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@
206206
</div>
207207
</div>
208208

209-
<div class="profile__row education__block">
209+
<div class="profile__row education__block" style="margin-top: 12px !important">
210210
@if (profileForm.get("city"); as city) {
211211
<fieldset>
212212
<label for="city" class="field-label">Город</label>
@@ -318,7 +318,7 @@
318318
<label for="description" class="field-label">Направление</label>
319319
<app-input
320320
[error]="description | controlError"
321-
placeholder="Востоковедение и Африканистика"
321+
placeholder="Бизнес информатика"
322322
formControlName="description"
323323
></app-input>
324324
@if (description | controlError: "required") {
@@ -365,8 +365,16 @@
365365
</div>
366366

367367
<div class="profile__row education__block">
368-
<app-button class="profile__add-education" (click)="addEducation()">
369-
<span>Добавить новое образование</span>
368+
<app-button
369+
[disabled]="!isEducationDirty"
370+
[ngStyle]="{
371+
opacity: !isEducationDirty ? '0.6' : '1',
372+
cursor: !isEducationDirty ? 'not-allowed' : 'pointer'
373+
}"
374+
class="profile__add-education"
375+
(click)="addEducation()"
376+
>
377+
<span>Добавить образование</span>
370378
<i appIcon icon="plus" appSquare="14"></i>
371379
</app-button>
372380

@@ -378,12 +386,10 @@
378386
{{ educationItem.organizationName }}
379387

380388
@if(educationItem.entryYear && educationItem.completionYear) {
381-
{{ educationItem.entryYear }} - {{ educationItem.completionYear }}
382-
} @else if (educationItem.entryYear && !educationItem.completionYear) {
383-
{{ educationItem.entryYear }}
384-
} @else if (!educationItem.entryYear && educationItem.completionYear){
385-
{{ educationItem.completionYear }}
386-
}
389+
{{ educationItem.entryYear }} год - {{ educationItem.completionYear }} год } @else if
390+
(educationItem.entryYear && !educationItem.completionYear) {
391+
{{ educationItem.entryYear }} год } @else if (!educationItem.entryYear &&
392+
educationItem.completionYear){ {{ educationItem.completionYear }} год }
387393

388394
{{ educationItem.description }} {{ educationItem.educationStatus }}
389395
{{ educationItem.educationLevel }}
@@ -496,7 +502,15 @@
496502
</div>
497503

498504
<div class="profile__row education__block">
499-
<app-button class="profile__add-education" (click)="addWork()">
505+
<app-button
506+
[disabled]="!isWorkDirty"
507+
[ngStyle]="{
508+
opacity: !isWorkDirty ? '0.6' : '1',
509+
cursor: !isWorkDirty ? 'not-allowed' : 'pointer'
510+
}"
511+
class="profile__add-education"
512+
(click)="addWork()"
513+
>
500514
<span>Добавить место работы</span>
501515
<i appIcon icon="plus" appSquare="14"></i>
502516
</app-button>
@@ -508,12 +522,10 @@
508522
<p class="text-body-16 education__text">
509523
{{ workItem.organizationName }}
510524
@if(workItem.entryYear && workItem.completionYear) {
511-
{{ workItem.entryYear }} - {{ workItem.completionYear }}
512-
} @else if (workItem.entryYear && !workItem.completionYear) {
513-
{{ workItem.entryYear }}
514-
} @else if (!workItem.entryYear && workItem.completionYear){
515-
{{ workItem.completionYear }}
516-
}
525+
{{ workItem.entryYear }} год - {{ workItem.completionYear }} год } @else if
526+
(workItem.entryYear && !workItem.completionYear) { {{ workItem.entryYear }} год }
527+
@else if (!workItem.entryYear && workItem.completionYear){
528+
{{ workItem.completionYear }} год }
517529
{{ workItem.description }}
518530
{{ workItem.jobPosition }}
519531
</p>
@@ -530,7 +542,7 @@
530542
<div class="education__first-row">
531543
<ng-container formArrayName="achievements">
532544
<ul>
533-
@for (control of achievements.controls; let i = $index; track i) {
545+
@for (control of achievements.controls; track control.value.id; let i = $index) {
534546
<li class="profile__achievement">
535547
<form [formGroupName]="i" class="achievement">
536548
<div class="achievement__first-row">
@@ -580,7 +592,7 @@
580592
</div>
581593
</div>
582594
<app-button class="profile__add-achievement" (click)="addAchievement()">
583-
<span>Добавить новое достижение</span>
595+
<span>Добавить достижение</span>
584596
<i appIcon icon="plus" appSquare="14"></i>
585597
</app-button>
586598
} @if (editingStep === 'skills') {
@@ -668,7 +680,13 @@
668680
</div>
669681

670682
<app-button
671-
[ariaDisabled]="languageItems().length === 4 || userLanguages.length === 4"
683+
[disabled]="
684+
!isLanguageDirty || languageItems().length === 4 || userLanguages.length === 4
685+
"
686+
[ngStyle]="{
687+
opacity: !isLanguageDirty ? '0.6' : '1',
688+
cursor: !isLanguageDirty ? 'not-allowed' : 'pointer'
689+
}"
672690
class="profile__add-education"
673691
(click)="addLanguage()"
674692
>
@@ -763,12 +781,34 @@
763781
</div>
764782
<div appEditorSubmitButton containerSelector=".profile" class="profile__save">
765783
<app-button
766-
[disabled]="editEducationClick || editWorkClick || editLanguageClick"
784+
[disabled]="
785+
editEducationClick ||
786+
editWorkClick ||
787+
editLanguageClick ||
788+
isEducationDirty ||
789+
isWorkDirty ||
790+
isLanguageDirty
791+
"
767792
[loader]="profileFormSubmitting"
768793
[ngStyle]="{
769-
opacity: editEducationClick || editWorkClick || editLanguageClick ? '0.6' : '1',
794+
opacity:
795+
editEducationClick ||
796+
editWorkClick ||
797+
editLanguageClick ||
798+
isEducationDirty ||
799+
isWorkDirty ||
800+
isLanguageDirty
801+
? '0.6'
802+
: '1',
770803
cursor:
771-
editEducationClick || editWorkClick || editLanguageClick ? 'not-allowed' : 'pointer'
804+
editEducationClick ||
805+
editWorkClick ||
806+
editLanguageClick ||
807+
isEducationDirty ||
808+
isWorkDirty ||
809+
isLanguageDirty
810+
? 'not-allowed'
811+
: 'pointer'
772812
}"
773813
customTypographyClass="text-body-12"
774814
(click)="saveProfile()"
@@ -792,7 +832,7 @@
792832
icon="cross"
793833
class="cancel__cross"
794834
></i>
795-
<p class="cancel__title text-bold-body-16">Произошла ошибка при редактированиия!</p>
835+
<p class="cancel__title text-bold-body-16">Произошла ошибка при редактировании!</p>
796836
</div>
797837
<p class="text-body-14 cancel__text">{{ isModalErrorSkillChooseText() }}.</p>
798838
</div>

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155

156156
&__add-achievement {
157157
display: block;
158-
margin-top: 12px;
158+
margin-top: 36px;
159159
margin-bottom: 100px;
160160
}
161161

@@ -230,6 +230,7 @@
230230
flex-basis: 50%;
231231
flex-direction: column;
232232
gap: 20px;
233+
margin-top: 36px;
233234
}
234235

235236
&__years {
@@ -359,7 +360,7 @@
359360
overflow-y: auto;
360361

361362
@include responsive.apply-desktop {
362-
width: 50%;
363+
width: 80%;
363364
}
364365

365366
&__cross {

0 commit comments

Comments
 (0)