Skip to content

Commit 647e48e

Browse files
authored
Merge pull request #244 from PROCOLLAB-github/fixes-new
modals for empty conditions & fixes of edit project in date pick
2 parents dd046be + 8e616ca commit 647e48e

11 files changed

Lines changed: 164 additions & 107 deletions

File tree

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

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -63,38 +63,23 @@
6363
<ng-template #programTpl>
6464
@if (userType() !== undefined) { @if (!isUserMember && !isUserManager) { @if
6565
(info().name.includes("Кейс-чемпионат MIR")) {
66-
<a href="https://case-champ.ru/corporate#rec1176757836">
67-
<app-button
68-
[disabled]="!!registerDateExpired"
69-
[style.opacity]="registerDateExpired ? '0.5' : '1'"
70-
appearance="outline"
71-
size="medium"
72-
customTypographyClass="text-body-12"
73-
>
66+
<a
67+
(click)="checkPrograRegistrationEnded($event)"
68+
href="https://case-champ.ru/corporate#rec1176757836"
69+
>
70+
<app-button appearance="outline" size="medium" customTypographyClass="text-body-12">
7471
зарегистрироваться
7572
</app-button>
7673
</a>
7774
} @else if (info().registrationLink) {
78-
<a [href]="info().registrationLink">
79-
<app-button
80-
[disabled]="!!registerDateExpired"
81-
[style.opacity]="registerDateExpired ? '0.5' : '1'"
82-
appearance="outline"
83-
size="medium"
84-
customTypographyClass="text-body-12"
85-
>
75+
<a (click)="checkPrograRegistrationEnded($event)" [href]="info().registrationLink">
76+
<app-button appearance="outline" size="medium" customTypographyClass="text-body-12">
8677
зарегистрироваться
8778
</app-button>
8879
</a>
8980
} @else {
90-
<a [routerLink]="['/office/program', info().id, 'register']">
91-
<app-button
92-
[disabled]="!!registerDateExpired"
93-
[style.opacity]="registerDateExpired ? '0.5' : '1'"
94-
appearance="outline"
95-
size="medium"
96-
customTypographyClass="text-body-12"
97-
>
81+
<a (click)="checkPrograRegistrationEnded($event)">
82+
<app-button appearance="outline" size="medium" customTypographyClass="text-body-12">
9883
зарегистрироваться
9984
</app-button>
10085
</a>
@@ -310,6 +295,19 @@
310295
</app-button>
311296
</div>
312297
</app-modal>
298+
299+
<app-modal
300+
[open]="isProgramEndedModalOpen()"
301+
(openChange)="isProgramEndedModalOpen.set(!isProgramEndedModalOpen())"
302+
>
303+
<div class="cancel" style="padding: 24px">
304+
<div class="cancel__top">
305+
<p class="cancel__title text-body-14">к сожалению, программа уже завершена!</p>
306+
</div>
307+
308+
<i appIcon icon="sad-smile" appSquare="50" style="margin-top: 36px"></i>
309+
</div>
310+
</app-modal>
313311
</ng-template>
314312

315313
<ng-template #projectTpl>

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ export class DeatilComponent implements OnInit, OnDestroy {
103103
// Переменные для работы с модалками
104104
isAssignProjectToProgramModalOpen = signal(false);
105105
showSubmitProjectModal = signal(false);
106+
isProgramEndedModalOpen = signal(false);
106107
isLeaveProjectModalOpen = false; // Флаг модального окна выхода
107108
isEditDisable = false; // Флаг недоступности редактирования
108109
isEditDisableModal = false; // Флаг недоступности редактирования для модалки
@@ -369,6 +370,24 @@ export class DeatilComponent implements OnInit, OnDestroy {
369370
}
370371
}
371372

373+
/**
374+
* Проверка завершения программы перед регистрацией
375+
*/
376+
checkPrograRegistrationEnded(event: Event): void {
377+
const program = this.info();
378+
379+
if (
380+
program?.datetimeRegistrationEnds &&
381+
Date.now() > Date.parse(program.datetimeRegistrationEnds)
382+
) {
383+
event.preventDefault();
384+
event.stopPropagation();
385+
this.isProgramEndedModalOpen.set(true);
386+
} else {
387+
this.router.navigateByUrl("/office/program/" + this.info().id + "/register");
388+
}
389+
}
390+
372391
/**
373392
* Обновляет состояния страниц на основе URL
374393
*/

projects/social_platform/src/app/office/feed/feed.component.html

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

33
<div class="page">
44
<app-feed-filter class="page__filter"></app-feed-filter>
5-
<div #feedRoot class="page__feed">
6-
@for (item of feedItems(); track item.content.id) { @if (item.typeModel === "vacancy") {
5+
<div #feedRoot class="page__feed" [style.column-count]="feedItems().length > 0 ? '2' : '1'">
6+
@if (feedItems().length > 0) { @for (item of feedItems(); track item.content.id) { @if
7+
(item.typeModel === "vacancy") {
78
<app-open-vacancy
89
class="page__item"
910
[attr.data-id]="item.content.id"
@@ -35,6 +36,11 @@
3536
[resourceLink]="['/office/projects', item.content.contentObject.id]"
3637
(like)="onLike($event)"
3738
></app-news-card>
38-
} } }
39+
} } } } @else {
40+
<div class="page__feed--no-items">
41+
<i appIcon icon="empty-chat" appSquare="38"></i>
42+
<p class="text-body-12">в данном разделе пока нет новостей</p>
43+
</div>
44+
}
3945
</div>
4046
</div>

projects/social_platform/src/app/office/feed/feed.component.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@
99
&__feed {
1010
column-count: 2;
1111
column-gap: 20px;
12+
13+
&--no-items {
14+
display: flex;
15+
flex-direction: column;
16+
gap: 20px;
17+
align-items: center;
18+
justify-content: center;
19+
margin-top: 70px;
20+
21+
i,
22+
p {
23+
color: var(--grey-for-text);
24+
}
25+
}
1226
}
1327

1428
&__item {

projects/social_platform/src/app/office/feed/feed.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,19 @@ import { ProfileNewsService } from "@office/profile/detail/services/profile-news
2323
import { FeedFilterComponent } from "@office/feed/filter/feed-filter.component";
2424
import { NewsCardComponent } from "@office/features/news-card/news-card.component";
2525
import { OpenVacancyComponent } from "./shared/open-vacancy/open-vacancy.component";
26+
import { IconComponent } from "@ui/components";
2627

2728
@Component({
2829
selector: "app-feed",
2930
standalone: true,
3031
imports: [
3132
CommonModule,
33+
IconComponent,
3234
NewProjectComponent,
3335
FeedFilterComponent,
3436
NewsCardComponent,
3537
OpenVacancyComponent,
38+
IconComponent,
3639
],
3740
changeDetection: ChangeDetectionStrategy.OnPush,
3841
templateUrl: "./feed.component.html",

projects/social_platform/src/app/office/projects/edit/shared/project-achievement-step/project-achievement-step.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
[tooltipPosition]="'left'"
3838
[tooltipWidth]="300"
3939
[error]="achievementsDate | controlError"
40-
type="text"
40+
type="date"
4141
placeholder="2022"
4242
mask="0000"
4343
formControlName="status"

projects/social_platform/src/app/office/vacancies/detail/info/info.component.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,6 @@
151151
&:hover {
152152
color: var(--accent-dark);
153153
}
154-
155-
@include typography.body-14;
156154
}
157155

158156
.about {

projects/social_platform/src/app/office/vacancies/list/list.component.html

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
</app-project-vacancy-card>
99
} }
1010
</div>
11-
} @if (type() === 'my') { @if (responsesList().length) { @for (response of responsesList(); track
12-
$index) {
11+
} @if (type() === 'my') { @if (responsesList().length > 0) { @for (response of responsesList();
12+
track $index) {
1313
<app-response-card [response]="response"></app-response-card>
1414
}
1515
<app-modal [open]="isMyModal()" (openChange)="isMyModal.set(!isMyModal())">
@@ -24,5 +24,13 @@
2424
</a>
2525
</div>
2626
</app-modal>
27-
} @else { } }
27+
} @else {
28+
<div class="page__vacancies--no-items">
29+
<i appIcon icon="empty-chat" appSquare="38"></i>
30+
<p class="text-body-12">
31+
в данном разделе пока нет ваших откликов : - ( <br />
32+
давайте это <a routerLink="/office/vacancies/all/" style="color: var(--accent)">исправим</a>
33+
</p>
34+
</div>
35+
} }
2836
</div>

projects/social_platform/src/app/office/vacancies/list/list.component.scss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@
66
display: grid;
77
grid-template-columns: 333px 333px;
88
grid-gap: 20px;
9+
10+
&--no-items {
11+
display: flex;
12+
flex-direction: column;
13+
gap: 20px;
14+
align-items: center;
15+
justify-content: center;
16+
margin-top: 70px;
17+
text-align: center;
18+
19+
i,
20+
p {
21+
color: var(--grey-for-text);
22+
}
23+
}
924
}
1025

1126
&__item {

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<div class="field__left-icon">
55
<ng-content select="left-icon"></ng-content>
66
</div>
7+
78
@if (type === 'radio') {
89
<input
910
type="radio"
@@ -13,6 +14,24 @@
1314
(change)="onRadioChange($event)"
1415
class="field__input"
1516
/>
17+
} @else if (type === 'date') {
18+
<input
19+
matInput
20+
[matDatepicker]="picker"
21+
[value]="dateValue"
22+
(dateChange)="onDateChange($event)"
23+
(click)="picker.open()"
24+
[placeholder]="placeholder"
25+
class="field__input"
26+
[class.field__input--error]="error"
27+
[class.field__input--small]="size === 'small'"
28+
[class.field__input--small--error]="size === 'small' && error"
29+
[class.field__input--big]="size === 'big'"
30+
[class.field__input--with-tooltip]="size !== 'small' && haveHint"
31+
[class.field__input--border]="hasBorder"
32+
readonly
33+
/>
34+
<mat-datepicker #picker></mat-datepicker>
1635
} @else {
1736
<input
1837
[value]="value"
@@ -55,6 +74,7 @@
5574
></app-tooltip>
5675
</div>
5776
}
77+
5878
<div
5979
class="field__right-icon"
6080
[ngStyle]="{

0 commit comments

Comments
 (0)