Skip to content

Commit 87e8c54

Browse files
committed
hotfix edit profile, projects-filter in programs, news-card, & disabled select
1 parent ff401e7 commit 87e8c54

12 files changed

Lines changed: 78 additions & 17 deletions

File tree

projects/social_platform/src/app/office/features/detail/detail.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@
256256
size="medium"
257257
class="cancel__button"
258258
customTypographyClass="text-body-12"
259-
[disabled]="!selectedProjectId"
260-
[style.opacity]="!selectedProjectId ? '0.5' : '1'"
259+
[disabled]="!isProjectSelected"
260+
[class.cancel__button--disabled]="!isProjectSelected"
261261
(click)="addProjectModal()"
262262
>
263263
выбрать проект

projects/social_platform/src/app/office/features/detail/detail.component.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,11 @@ $detail-bar-mb: 12px;
229229

230230
&__button {
231231
margin-top: 20px;
232+
233+
&--disabled {
234+
opacity: 0.5;
235+
cursor: not-allowed;
236+
}
232237
}
233238

234239
&__cross {

projects/social_platform/src/app/office/features/detail/detail.component.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export class DeatilComponent implements OnInit, OnDestroy {
9090
isProfileFill = false;
9191

9292
// Переменные для работы с модалкой подачи проекта
93-
selectedProjectId = 0;
93+
selectedProjectId: number | null = null;
9494
dubplicatedProjectId = 0;
9595
memberProjects: Project[] = [];
9696

@@ -167,7 +167,7 @@ export class DeatilComponent implements OnInit, OnDestroy {
167167
this.showSubmitProjectModal.set(!this.showSubmitProjectModal());
168168

169169
if (!this.showSubmitProjectModal()) {
170-
this.selectedProjectId = 0;
170+
this.selectedProjectId = null;
171171
}
172172
}
173173

@@ -197,7 +197,7 @@ export class DeatilComponent implements OnInit, OnDestroy {
197197
* Добавление проекта на программу
198198
*/
199199
addProjectModal(): void {
200-
if (!this.selectedProjectId) {
200+
if (this.selectedProjectId === null) {
201201
return;
202202
}
203203

@@ -208,6 +208,10 @@ export class DeatilComponent implements OnInit, OnDestroy {
208208
this.assignProjectToProgram(selectedProject!);
209209
}
210210

211+
get isProjectSelected(): boolean {
212+
return this.selectedProjectId !== null;
213+
}
214+
211215
addNewProject(): void {
212216
this.projectsService.addProject();
213217
}

projects/social_platform/src/app/office/features/news-card/news-card.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@
6060
</ul>
6161
} @if (newsTextExpandable && !editMode) {
6262
<div
63-
class="read-more"
63+
class="read-more text-body-10"
6464
(click)="onExpandNewsText(newsTextEl?.nativeElement, 'expanded', readMore)"
6565
>
66-
{{ readMore ? "Скрыть" : "Читать полностью" }}
66+
{{ readMore ? "скрыть" : "читать полностью" }}
6767
</div>
6868
} @if (!editMode) {
6969

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
.page {
44
position: relative;
55
margin-bottom: 50px;
6+
padding-bottom: 130px;
67

78
&__form {
89
@include responsive.apply-desktop {

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

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,39 @@ export class ProfileEditComponent implements OnInit, OnDestroy, AfterViewInit {
10371037
* Валидирует всю форму и отправляет данные на сервер
10381038
*/
10391039
saveProfile(): void {
1040-
if (!this.validationService.getFormValidation(this.profileForm) || this.profileFormSubmitting) {
1040+
const tempFields = [
1041+
"organizationName",
1042+
"entryYear",
1043+
"completionYear",
1044+
"description",
1045+
"educationLevel",
1046+
"educationStatus",
1047+
"organization",
1048+
"entryYearWork",
1049+
"completionYearWork",
1050+
"descriptionWork",
1051+
"jobPosition",
1052+
"language",
1053+
"languageLevel",
1054+
"title",
1055+
"status",
1056+
"year",
1057+
"files",
1058+
];
1059+
1060+
tempFields.forEach(name => {
1061+
const control = this.profileForm.get(name);
1062+
if (control) {
1063+
control.clearValidators();
1064+
control.updateValueAndValidity();
1065+
}
1066+
});
1067+
1068+
const mainFieldsValid = ["firstName", "lastName", "birthday", "speciality"].every(
1069+
name => this.profileForm.get(name)?.valid
1070+
);
1071+
1072+
if (!mainFieldsValid || this.profileFormSubmitting) {
10411073
this.isModalErrorSkillsChoose.set(true);
10421074
return;
10431075
}

projects/social_platform/src/app/office/program/detail/list/list.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
tap,
2828
throttleTime,
2929
} from "rxjs";
30-
import { ProjectsFilterComponent } from "@office/projects/projects-filter/projects-filter.component";
30+
import { ProjectsFilterComponent } from "@office/program/detail/list/projects-filter/projects-filter.component";
3131
import Fuse from "fuse.js";
3232
import { ActivatedRoute, Router, RouterModule } from "@angular/router";
3333
import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from "@angular/forms";

projects/social_platform/src/app/office/program/detail/list/projects-filter/projects-filter.component.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<!-- @format -->
2+
<div class="filter__titles">
3+
<p class="text-body-14">фильтры</p>
4+
<!-- <a class="text-body-12 filter__clear" (click)="clearFilters()">Сбросить фильтры</a> -->
5+
</div>
6+
27
@if (filters()?.length) {
38
<div class="filter">
49
<div class="filter__body" [formGroup]="filterForm">
5-
<div class="filter__titles">
6-
<p class="text-body-14">фильтры</p>
7-
<!-- <a class="text-body-12 filter__clear" (click)="clearFilters()">Сбросить фильтры</a> -->
8-
</div>
9-
1010
@if (filters()?.length && filterForm.controls) { @for (field of filters(); track field.id) { @if
1111
(filterForm.get(field.name)) {
1212
<div class="filter__block">

projects/social_platform/src/app/office/program/main/main.component.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
<span class="text-body-12 programs__filter--text">участвую</span>
2020
</label>
2121

22-
<app-select size="big" placeholder="все" [options]="programOptionsFilter"></app-select>
22+
<app-select
23+
size="big"
24+
placeholder="все"
25+
[options]="programOptionsFilter"
26+
[isDisabled]="true"
27+
></app-select>
2328
</div>
2429
</div>

projects/social_platform/src/app/ui/components/select/select.component.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
[class.field__input--open]="isOpen"
99
[class.field__input--small]="size === 'small'"
1010
[class.field__input--big]="size === 'big'"
11+
[class.field__input--disabled]="disabled"
1112
(click)="isOpen = !isOpen; highlightedIndex = -1"
1213
>
1314
{{
@@ -30,7 +31,7 @@
3031
></i>
3132
}
3233
</div>
33-
@if (isOpen) {
34+
@if (!isDisabled) { @if (isOpen) {
3435
<ul #dropdown class="field__options">
3536
@for (option of options; track option.id; let index = $index) {
3637
<li
@@ -43,5 +44,5 @@
4344
</li>
4445
}
4546
</ul>
46-
}
47+
} }
4748
</div>

0 commit comments

Comments
 (0)