Skip to content

Commit d90de3c

Browse files
authored
Merge pull request #252 from PROCOLLAB-github/restriction-fields
Restriction fields
2 parents a0a4bf7 + b118626 commit d90de3c

21 files changed

Lines changed: 169 additions & 37 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
placeholder="сегодня был хороший день"
1212
(paste)="onPaste($event)"
1313
(keydown.meta.enter)="onSubmit()"
14+
[maxLength]="15940"
1415
></app-input>
1516
<i appIcon icon="send" appSquare="12" class="form__send" (click)="onSubmit()"></i>
1617
</div>

projects/social_platform/src/app/office/features/project-rating/project-rating.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
size="big"
3030
[formControlName]="criterion.id"
3131
placeholder="Небольшой комментарий, если необходимо"
32+
[maxLength]="50"
3233
></app-textarea>
3334

3435
@if (form.get(criterion.id.toString())?.errors?.['maxlength']) {

projects/social_platform/src/app/office/features/project-rating/project-rating.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ import { ControlErrorPipe } from "@corelib";
4949
RangeCriterionInputComponent,
5050
BooleanCriterionComponent,
5151
ReactiveFormsModule,
52-
ControlErrorPipe,
5352
],
5453
templateUrl: "./project-rating.component.html",
5554
styleUrl: "./project-rating.component.scss",

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,15 @@
55
&__greeting {
66
position: relative;
77
display: flex;
8+
flex-direction: column;
89
gap: 10px;
9-
align-items: center;
10+
max-width: 100%;
11+
12+
@include responsive.apply-desktop {
13+
flex-direction: row;
14+
align-items: center;
15+
max-width: 60%;
16+
}
1017
}
1118
}
1219

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,15 @@
55
&__greeting {
66
position: relative;
77
display: flex;
8+
flex-direction: column;
89
gap: 10px;
9-
align-items: center;
10+
max-width: 100%;
11+
12+
@include responsive.apply-desktop {
13+
flex-direction: row;
14+
align-items: center;
15+
max-width: 60%;
16+
}
1017
}
1118
}
1219

@@ -15,6 +22,14 @@
1522
display: inline-flex;
1623
gap: 10px;
1724
align-items: center;
25+
26+
::ng-deep {
27+
app-tooltip {
28+
.tooltip__content--right {
29+
top: 110%;
30+
}
31+
}
32+
}
1833
}
1934

2035
.content {

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ <h1 class="profile__title">редактирование профиля</h1>
180180
type="text"
181181
placeholder="москва"
182182
formControlName="city"
183+
[maxLength]="100"
183184
></app-input>
184185
@if (city | controlError: "required") {
185186
<div class="text-body-10 error">
@@ -265,6 +266,7 @@ <h1 class="profile__title">редактирование профиля</h1>
265266
type="text"
266267
placeholder="я java developer, очень люблю котиков"
267268
formControlName="aboutMe"
269+
[maxLength]="300"
268270
></app-textarea>
269271
@if (aboutMe | controlError: "required") {
270272
<div class="text-body-10 error">
@@ -394,6 +396,7 @@ <h1 class="profile__title">редактирование профиля</h1>
394396
[error]="organizationName | controlError"
395397
placeholder="вуз / колледж / школа"
396398
formControlName="organizationName"
399+
[maxLength]="100"
397400
></app-input>
398401
@if (organizationName | controlError: "required") {
399402
<div class="text-body-10 error">
@@ -413,6 +416,7 @@ <h1 class="profile__title">редактирование профиля</h1>
413416
[error]="description | controlError"
414417
placeholder="бизнес информатика"
415418
formControlName="description"
419+
[maxLength]="400"
416420
></app-input>
417421
@if (description | controlError: "required") {
418422
<div class="text-body-10 error">
@@ -589,6 +593,7 @@ <h1 class="profile__title">редактирование профиля</h1>
589593
type="text"
590594
placeholder="проколлаб"
591595
formControlName="organization"
596+
[maxLength]="50"
592597
></app-input>
593598
@if (organization | controlError: "required") {
594599
<div class="text-body-10 error">
@@ -631,6 +636,7 @@ <h1 class="profile__title">редактирование профиля</h1>
631636
type="text"
632637
placeholder="проект начал свое существование с 2020 года"
633638
formControlName="descriptionWork"
639+
[maxLength]="400"
634640
></app-textarea>
635641
@if (descriptionWork | controlError: "required") {
636642
<div class="text-body-10 error">

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export class ProjectFormService {
7676
coverImageAddress: [""],
7777
actuality: ["", [Validators.maxLength(1000)]],
7878
targetAudience: ["", [Validators.maxLength(500)]],
79-
problem: ["", [Validators.maxLength(1000)]],
79+
problem: ["", [Validators.maxLength(400)]],
8080
partnerProgramId: [null],
8181
achievements: this.fb.array([]),
8282
title: [""],
@@ -306,8 +306,8 @@ export class ProjectFormService {
306306
partnerProgramFields.forEach(field => {
307307
const validators: ValidatorFn[] = [];
308308
if (field.isRequired) validators.push(Validators.required);
309-
if (field.fieldType === "text") validators.push(Validators.maxLength(50));
310-
if (field.fieldType === "textarea") validators.push(Validators.maxLength(100));
309+
if (field.fieldType === "text") validators.push(Validators.maxLength(500));
310+
if (field.fieldType === "textarea") validators.push(Validators.maxLength(500));
311311
const initialValue = field.fieldType === "checkbox" ? false : "";
312312
const fieldCtrl = new FormControl(initialValue, validators);
313313
this.additionalForm.addControl(field.name, fieldCtrl);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class ProjectVacancyService {
6060
this.vacancyForm = this.fb.group({
6161
role: [null],
6262
skills: [[]],
63-
description: [""],
63+
description: ["", [Validators.maxLength(3500)]],
6464
requiredExperience: [null],
6565
workFormat: [null],
6666
salary: [""],

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
formControlName="{{ field.name }}"
2222
[error]="control | controlError: 'required'"
2323
[placeholder]="field.helpText"
24+
[maxLength]="500"
2425
></app-input>
2526
} } @case ("textarea") {
2627
<label
@@ -37,6 +38,7 @@
3738
formControlName="{{ field.name }}"
3839
[error]="control | controlError"
3940
[placeholder]="field.helpText"
41+
[maxLength]="500"
4042
></app-textarea>
4143
} } @case ("checkbox") {
4244
<div

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
formControlName="name"
100100
[error]="(name | controlError) || projSubmitInitiated"
101101
placeholder="название"
102+
[maxLength]="256"
102103
></app-input>
103104
@if ((name | controlError: "required") || projSubmitInitiated) {
104105
<div class="text-body-10 error">
@@ -115,6 +116,7 @@
115116
formControlName="region"
116117
[error]="(region | controlError) || projSubmitInitiated"
117118
placeholder="введите регион"
119+
[maxLength]="256"
118120
></app-input>
119121
@if ((region | controlError: "required") || projSubmitInitiated) {
120122
<div class="text-body-10 error">
@@ -180,6 +182,7 @@
180182
formControlName="problem"
181183
[error]="(problem | controlError) || projSubmitInitiated"
182184
placeholder="улучшить качество жизни студентов"
185+
[maxLength]="1000"
183186
></app-input>
184187
@if ((problem | controlError: "required") || projSubmitInitiated) {
185188
<div class="text-body-10 error">
@@ -203,6 +206,7 @@
203206
[error]="(description | controlError) || projSubmitInitiated"
204207
formControlName="description"
205208
placeholder="проект начал свое существование с 2020 года"
209+
[maxLength]="800"
206210
></app-textarea>
207211
@if ((description | controlError: "required") || projSubmitInitiated) {
208212
<div class="text-body-10 error">
@@ -228,6 +232,7 @@
228232
formControlName="actuality"
229233
[error]="actuality | controlError"
230234
placeholder="указом президента от 03.07.2023 "
235+
[maxLength]="1000"
231236
></app-textarea>
232237
@if ((actuality | controlError: "required")) {
233238
<div class="text-body-10 error">
@@ -250,6 +255,7 @@
250255
[error]="(targetAudience | controlError) || projSubmitInitiated"
251256
formControlName="targetAudience"
252257
placeholder="30% потери времени студентов во время работы"
258+
[maxLength]="500"
253259
></app-textarea>
254260
@if ((targetAudience | controlError: "required") || projSubmitInitiated) {
255261
<div class="text-body-10 error">

0 commit comments

Comments
 (0)