Skip to content

Commit 15b1ed4

Browse files
committed
add actual programs for feed & registration ednds for programs & validators for project fields
1 parent 25f4139 commit 15b1ed4

6 files changed

Lines changed: 83 additions & 12 deletions

File tree

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,29 @@
2525
<p class="text-body-6">Политика обработки персональных данных</p>
2626
<p class="text-body-6">2022</p>
2727
</div>
28+
29+
<div class="office__programs">
30+
<div class="office__program" [routerLink]="'/office/programs/' + 1">
31+
<div class="program__top">
32+
<div class="program__info">
33+
<app-avatar [size]="30" [url]=""></app-avatar>
34+
<p class="text-body-10">до {{ "" | date: "dd.MM.yy" }}</p>
35+
</div>
36+
37+
<i
38+
appIcon
39+
[icon]="!(1 === 1) ? 'program' : 'person'"
40+
appSquare="10"
41+
class="program__icon"
42+
[style.color]="!(1 === 1) ? 'var(--grey-for-text)' : 'var(--green)'"
43+
></i>
44+
</div>
45+
46+
<p class="text-body-10 program__title">
47+
{{ "VI Кейс-чемпионат MIR" | truncate: 30 }}
48+
</p>
49+
</div>
50+
</div>
2851
</ui-sidebar>
2952

3053
<div class="office__inner--content">

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

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,30 @@
5656
}
5757
}
5858

59+
&__programs {
60+
display: flex;
61+
flex-direction: column;
62+
gap: 12px;
63+
margin-top: 12px;
64+
max-width: 135px;
65+
}
66+
67+
&__program {
68+
display: flex;
69+
flex-direction: column;
70+
gap: 5px;
71+
cursor: pointer;
72+
padding: 8px;
73+
border-radius: var(--rounded-lg);
74+
border: 0.5px solid var(--medium-grey-for-outline);
75+
background-color: var(--light-white);
76+
transition: background-color 0.2s ease-in-out;
77+
78+
&:hover {
79+
background-color: var(--white);
80+
}
81+
}
82+
5983
&__inner {
6084
display: flex;
6185
width: 100%;
@@ -105,6 +129,24 @@
105129
}
106130
}
107131

132+
.program {
133+
&__top {
134+
display: flex;
135+
align-items: center;
136+
justify-content: space-between;
137+
}
138+
139+
&__info {
140+
display: flex;
141+
align-items: center;
142+
gap: 5px;
143+
}
144+
145+
&__title {
146+
color: var(--black);
147+
}
148+
}
149+
108150
.message-modal {
109151
display: flex;
110152
flex-direction: column;

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { Component, OnDestroy, OnInit, Signal } from "@angular/core";
44
import { IndustryService } from "@services/industry.service";
55
import { forkJoin, map, noop, Subscription } from "rxjs";
6-
import { ActivatedRoute, Router, RouterOutlet } from "@angular/router";
6+
import { ActivatedRoute, Router, RouterOutlet, RouterLink } from "@angular/router";
77
import { Invite } from "@models/invite.model";
88
import { AuthService } from "@auth/services";
99
import { ProjectService } from "@services/project.service";
@@ -15,9 +15,11 @@ import { ButtonComponent } from "@ui/components";
1515
import { ModalComponent } from "@ui/components/modal/modal.component";
1616
import { NavComponent } from "./features/nav/nav.component";
1717
import { IconComponent, ProfileControlPanelComponent, SidebarComponent } from "@uilib";
18-
import { AsyncPipe } from "@angular/common";
18+
import { AsyncPipe, DatePipe } from "@angular/common";
1919
import { InviteService } from "@services/invite.service";
2020
import { toSignal } from "@angular/core/rxjs-interop";
21+
import { AvatarComponent } from "@ui/components/avatar/avatar.component";
22+
import { TruncatePipe } from "projects/core/src/lib/pipes/truncate.pipe";
2123

2224
/**
2325
* Главный компонент офиса - корневой компонент рабочего пространства
@@ -45,8 +47,12 @@ import { toSignal } from "@angular/core/rxjs-interop";
4547
DeleteConfirmComponent,
4648
SnackbarComponent,
4749
AsyncPipe,
50+
DatePipe,
51+
TruncatePipe,
4852
ProfileControlPanelComponent,
4953
IconComponent,
54+
AvatarComponent,
55+
RouterLink,
5056
],
5157
})
5258
export class OfficeComponent implements OnInit, OnDestroy {

projects/social_platform/src/app/office/program/shared/program-card/program-card.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<!-- ? "Регистрация до:" + " " + (program.datetimeRegistrationEnds | date: "dd MMMM") -->
2121
{{
2222
!registerDateExpired && (!program.isUserMember || !program.isUserManager)
23-
? "Подача проектов до:" + " " + (program.datetimeRegistrationEnds | date: "dd MMMM")
23+
? "Регистрация до:" + " " + (program.datetimeRegistrationEnds | date: "dd MMMM")
2424
: registerDateExpired
2525
? "регистрация завершена"
2626
: "ты уже участвуешь!"

projects/social_platform/src/app/office/projects/edit/services/project-additional.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ export class ProjectAdditionalService {
242242
control.addValidators([Validators.maxLength(500)]);
243243
break;
244244
case "textarea":
245-
control.addValidators([Validators.maxLength(300)]);
245+
control.addValidators([Validators.maxLength(500)]);
246246
break;
247247
}
248248
}

projects/social_platform/src/app/office/projects/edit/services/project-form.service.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@ export class ProjectFormService {
4040
private initializeForm(): void {
4141
this.projectForm = this.fb.group({
4242
imageAddress: [""],
43-
name: ["", [Validators.required]],
44-
region: ["", [Validators.required]],
43+
name: ["", [Validators.required, Validators.maxLength(256)]],
44+
region: ["", [Validators.required, Validators.maxLength(256)]],
4545
implementationDeadline: [null],
4646
trl: [null],
4747
links: this.fb.array([]),
4848
link: ["", Validators.pattern(/^(https?:\/\/)/)],
49-
industryId: [undefined, [Validators.required]],
50-
description: ["", [Validators.required, Validators.minLength(0), Validators.maxLength(800)]],
49+
industryId: [undefined],
50+
description: ["", [Validators.maxLength(800)]],
5151
presentationAddress: [""],
52-
coverImageAddress: ["", [Validators.required]],
53-
actuality: ["", [Validators.maxLength(400)]],
54-
targetAudience: ["", [Validators.required, Validators.maxLength(400)]],
55-
problem: ["", [Validators.required, Validators.maxLength(400)]],
52+
coverImageAddress: [""],
53+
actuality: ["", [Validators.maxLength(1000)]],
54+
targetAudience: ["", [Validators.maxLength(500)]],
55+
problem: ["", [Validators.maxLength(1000)]],
5656
partnerProgramId: [null],
5757
achievements: this.fb.array([]),
5858
title: [""],

0 commit comments

Comments
 (0)