From aa97215040725e60f35f24d30985c6c6b3f2242c Mon Sep 17 00:00:00 2001 From: Awakich Date: Tue, 11 Nov 2025 19:02:52 +0300 Subject: [PATCH 1/3] add modals for empty conditions in feed, vacancies, registration ends in program, datepicker for edit project --- .../features/detail/detail.component.html | 49 +++---- .../features/detail/detail.component.ts | 17 +++ .../src/app/office/feed/feed.component.html | 12 +- .../src/app/office/feed/feed.component.scss | 13 ++ .../src/app/office/feed/feed.component.ts | 3 + .../project-achievement-step.component.html | 2 +- .../vacancies/detail/info/info.component.scss | 2 - .../office/vacancies/list/list.component.html | 14 +- .../office/vacancies/list/list.component.scss | 14 ++ .../ui/components/input/input.component.html | 20 +++ .../ui/components/input/input.component.ts | 124 +++++++----------- 11 files changed, 163 insertions(+), 107 deletions(-) diff --git a/projects/social_platform/src/app/office/features/detail/detail.component.html b/projects/social_platform/src/app/office/features/detail/detail.component.html index 56e54c261..942f3529f 100644 --- a/projects/social_platform/src/app/office/features/detail/detail.component.html +++ b/projects/social_platform/src/app/office/features/detail/detail.component.html @@ -63,38 +63,26 @@ @if (userType() !== undefined) { @if (!isUserMember && !isUserManager) { @if (info().name.includes("Кейс-чемпионат MIR")) { - - + + зарегистрироваться } @else if (info().registrationLink) { - - + + зарегистрироваться } @else { - - + + зарегистрироваться @@ -310,6 +298,19 @@ + + +
+
+

к сожалению, программа уже завершена!

+
+ + +
+
diff --git a/projects/social_platform/src/app/office/features/detail/detail.component.ts b/projects/social_platform/src/app/office/features/detail/detail.component.ts index bc8754f9f..ceeab1aad 100644 --- a/projects/social_platform/src/app/office/features/detail/detail.component.ts +++ b/projects/social_platform/src/app/office/features/detail/detail.component.ts @@ -103,6 +103,7 @@ export class DeatilComponent implements OnInit, OnDestroy { // Переменные для работы с модалками isAssignProjectToProgramModalOpen = signal(false); showSubmitProjectModal = signal(false); + isProgramEndedModalOpen = signal(false); isLeaveProjectModalOpen = false; // Флаг модального окна выхода isEditDisable = false; // Флаг недоступности редактирования isEditDisableModal = false; // Флаг недоступности редактирования для модалки @@ -369,6 +370,22 @@ export class DeatilComponent implements OnInit, OnDestroy { } } + /** + * Проверка завершения программы перед регистрацией + */ + checkPrograRegistrationEnded(event: Event): void { + const program = this.info(); + + if ( + program?.datetimeRegistrationEnds && + Date.now() > Date.parse(program.datetimeRegistrationEnds) + ) { + event.preventDefault(); + event.stopPropagation(); + this.isProgramEndedModalOpen.set(true); + } + } + /** * Обновляет состояния страниц на основе URL */ diff --git a/projects/social_platform/src/app/office/feed/feed.component.html b/projects/social_platform/src/app/office/feed/feed.component.html index 10204d50e..448daf628 100644 --- a/projects/social_platform/src/app/office/feed/feed.component.html +++ b/projects/social_platform/src/app/office/feed/feed.component.html @@ -2,8 +2,9 @@
-
- @for (item of feedItems(); track item.content.id) { @if (item.typeModel === "vacancy") { +
+ @if (feedItems().length > 0) { @for (item of feedItems(); track item.content.id) { @if + (item.typeModel === "vacancy") { - } } } + } } } } @else { +
+ +

в данном разделе пока нет новостей

+
+ }
diff --git a/projects/social_platform/src/app/office/feed/feed.component.scss b/projects/social_platform/src/app/office/feed/feed.component.scss index cf6a935c2..9e4a067cf 100644 --- a/projects/social_platform/src/app/office/feed/feed.component.scss +++ b/projects/social_platform/src/app/office/feed/feed.component.scss @@ -9,6 +9,19 @@ &__feed { column-count: 2; column-gap: 20px; + + &--no-items { + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + gap: 20px; + margin-top: 70px; + + i, p { + color: var(--grey-for-text); + } + } } &__item { diff --git a/projects/social_platform/src/app/office/feed/feed.component.ts b/projects/social_platform/src/app/office/feed/feed.component.ts index 0dc4e9128..b0cd630d4 100644 --- a/projects/social_platform/src/app/office/feed/feed.component.ts +++ b/projects/social_platform/src/app/office/feed/feed.component.ts @@ -23,16 +23,19 @@ import { ProfileNewsService } from "@office/profile/detail/services/profile-news import { FeedFilterComponent } from "@office/feed/filter/feed-filter.component"; import { NewsCardComponent } from "@office/features/news-card/news-card.component"; import { OpenVacancyComponent } from "./shared/open-vacancy/open-vacancy.component"; +import { IconComponent } from "@ui/components"; @Component({ selector: "app-feed", standalone: true, imports: [ CommonModule, + IconComponent, NewProjectComponent, FeedFilterComponent, NewsCardComponent, OpenVacancyComponent, + IconComponent, ], changeDetection: ChangeDetectionStrategy.OnPush, templateUrl: "./feed.component.html", diff --git a/projects/social_platform/src/app/office/projects/edit/shared/project-achievement-step/project-achievement-step.component.html b/projects/social_platform/src/app/office/projects/edit/shared/project-achievement-step/project-achievement-step.component.html index 2cf466293..428d06048 100644 --- a/projects/social_platform/src/app/office/projects/edit/shared/project-achievement-step/project-achievement-step.component.html +++ b/projects/social_platform/src/app/office/projects/edit/shared/project-achievement-step/project-achievement-step.component.html @@ -37,7 +37,7 @@ [tooltipPosition]="'left'" [tooltipWidth]="300" [error]="achievementsDate | controlError" - type="text" + type="date" placeholder="2022" mask="0000" formControlName="status" diff --git a/projects/social_platform/src/app/office/vacancies/detail/info/info.component.scss b/projects/social_platform/src/app/office/vacancies/detail/info/info.component.scss index e838f943a..9b65cc0f1 100644 --- a/projects/social_platform/src/app/office/vacancies/detail/info/info.component.scss +++ b/projects/social_platform/src/app/office/vacancies/detail/info/info.component.scss @@ -151,8 +151,6 @@ &:hover { color: var(--accent-dark); } - - @include typography.body-14; } .about { diff --git a/projects/social_platform/src/app/office/vacancies/list/list.component.html b/projects/social_platform/src/app/office/vacancies/list/list.component.html index e4644b551..c5f851fc6 100644 --- a/projects/social_platform/src/app/office/vacancies/list/list.component.html +++ b/projects/social_platform/src/app/office/vacancies/list/list.component.html @@ -8,8 +8,8 @@ } }
- } @if (type() === 'my') { @if (responsesList().length) { @for (response of responsesList(); track - $index) { + } @if (type() === 'my') { @if (responsesList().length > 0) { @for (response of responsesList(); + track $index) { } @@ -24,5 +24,13 @@ - } @else { } } + } @else { +
+ +

+ в данном разделе пока нет ваших откликов : - (
+ давайте это исправим +

+
+ } } diff --git a/projects/social_platform/src/app/office/vacancies/list/list.component.scss b/projects/social_platform/src/app/office/vacancies/list/list.component.scss index dfb6f78b5..03b3aa375 100644 --- a/projects/social_platform/src/app/office/vacancies/list/list.component.scss +++ b/projects/social_platform/src/app/office/vacancies/list/list.component.scss @@ -6,6 +6,20 @@ display: grid; grid-template-columns: 333px 333px; grid-gap: 20px; + + &--no-items { + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + gap: 20px; + margin-top: 70px; + text-align: center; + + i, p { + color: var(--grey-for-text); + } + } } &__item { diff --git a/projects/social_platform/src/app/ui/components/input/input.component.html b/projects/social_platform/src/app/ui/components/input/input.component.html index 0edc178d4..44d83b388 100644 --- a/projects/social_platform/src/app/ui/components/input/input.component.html +++ b/projects/social_platform/src/app/ui/components/input/input.component.html @@ -4,6 +4,7 @@
+ @if (type === 'radio') { + } @else if (type === 'date') { + + } @else { } +
(); - - /** Событие нажатия Enter */ @Output() enter = new EventEmitter(); - - /** Событие изменения состояния радио (для внешних обработчиков) */ @Output() change = new EventEmitter(); - /** Обработчик для радио */ + /** Обработчик для radвариант io */ onRadioChange(event: Event): void { if (this.type === "radio") { const target = event.target as HTMLInputElement; this.value = target.value; this.onChange(this.value); this.appValueChange.emit(this.value); - this.change.emit(event); // Эмитим событие для внешних обработчиков + this.change.emit(event); + this.onTouch(); + } + } + + /** Обработчик изменения даты в datepicker */ + onDateChange(event: any): void { + if (this.type === "date" && event.value) { + const date = event.value as Date; + // Форматируем дату в нужный формат (например, DD.MM.YY) + const day = String(date.getDate()).padStart(2, "0"); + const month = String(date.getMonth() + 1).padStart(2, "0"); + const year = String(date.getFullYear()).slice(-2); + const formattedDate = `${day}.${month}.${year}`; + + this.value = formattedDate; + this.onChange(formattedDate); + this.appValueChange.emit(formattedDate); this.onTouch(); } } - /** Показать подсказку */ showTooltip(): void { this.isTooltipVisible = true; } - /** Скрыть подсказку */ hideTooltip(): void { this.isTooltipVisible = false; } - /** Обработчик ввода текста */ onInput(event: Event): void { const value = (event.target as HTMLInputElement).value; this.onChange(value); this.appValueChange.emit(value); } - /** Обработчик потери фокуса */ onBlur(): void { this.onTouch(); } - /** Текущее значение поля */ value = ""; - // Методы ControlValueAccessor + // Геттер для преобразования строковой даты в объект Date для datepicker + get dateValue(): Date | null { + if (!this.value || this.type !== "date") return null; + + // Парсим дату из формата DD.MM.YY и преобразуем дату + const parts = this.value.split("."); + if (parts.length === 3) { + const day = parseInt(parts[0], 10); + const month = parseInt(parts[1], 10) - 1; + const year = parseInt(parts[2], 10) + 2000; + return new Date(year, month, day); + } + + return null; + } + writeValue(value: string): void { setTimeout(() => { this.value = value; @@ -170,14 +148,12 @@ export class InputComponent implements ControlValueAccessor { this.onTouch = fn; } - /** Состояние блокировки */ disabled = false; setDisabledState(isDisabled: boolean) { this.disabled = isDisabled; } - /** Обработчик нажатия Enter */ onEnter(event: Event) { event.preventDefault(); this.enter.emit(); From 574566e5ab6d3353a3d3d25bbe3f8e6f77f67c48 Mon Sep 17 00:00:00 2001 From: Awakich Date: Tue, 11 Nov 2025 19:03:36 +0300 Subject: [PATCH 2/3] add styles for modals & datepicker --- .../src/app/office/feed/feed.component.scss | 7 ++++--- .../src/app/office/vacancies/list/list.component.scss | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/projects/social_platform/src/app/office/feed/feed.component.scss b/projects/social_platform/src/app/office/feed/feed.component.scss index 9e4a067cf..7ae1bc2fb 100644 --- a/projects/social_platform/src/app/office/feed/feed.component.scss +++ b/projects/social_platform/src/app/office/feed/feed.component.scss @@ -12,13 +12,14 @@ &--no-items { display: flex; - align-items: center; - justify-content: center; flex-direction: column; gap: 20px; + align-items: center; + justify-content: center; margin-top: 70px; - i, p { + i, + p { color: var(--grey-for-text); } } diff --git a/projects/social_platform/src/app/office/vacancies/list/list.component.scss b/projects/social_platform/src/app/office/vacancies/list/list.component.scss index 03b3aa375..8edcfef42 100644 --- a/projects/social_platform/src/app/office/vacancies/list/list.component.scss +++ b/projects/social_platform/src/app/office/vacancies/list/list.component.scss @@ -9,14 +9,15 @@ &--no-items { display: flex; - align-items: center; - justify-content: center; flex-direction: column; gap: 20px; + align-items: center; + justify-content: center; margin-top: 70px; text-align: center; - i, p { + i, + p { color: var(--grey-for-text); } } From 8e616caa141384f7ff5020afb130e2ce73f0da06 Mon Sep 17 00:00:00 2001 From: Awakich Date: Wed, 12 Nov 2025 13:35:20 +0300 Subject: [PATCH 3/3] fix routing to registration in program --- .../src/app/office/features/detail/detail.component.html | 5 +---- .../src/app/office/features/detail/detail.component.ts | 2 ++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/projects/social_platform/src/app/office/features/detail/detail.component.html b/projects/social_platform/src/app/office/features/detail/detail.component.html index 942f3529f..4834fe541 100644 --- a/projects/social_platform/src/app/office/features/detail/detail.component.html +++ b/projects/social_platform/src/app/office/features/detail/detail.component.html @@ -78,10 +78,7 @@ } @else { - + зарегистрироваться diff --git a/projects/social_platform/src/app/office/features/detail/detail.component.ts b/projects/social_platform/src/app/office/features/detail/detail.component.ts index ceeab1aad..961be05ce 100644 --- a/projects/social_platform/src/app/office/features/detail/detail.component.ts +++ b/projects/social_platform/src/app/office/features/detail/detail.component.ts @@ -383,6 +383,8 @@ export class DeatilComponent implements OnInit, OnDestroy { event.preventDefault(); event.stopPropagation(); this.isProgramEndedModalOpen.set(true); + } else { + this.router.navigateByUrl("/office/program/" + this.info().id + "/register"); } }