Skip to content

Commit

Permalink
feat: show description counter
Browse files Browse the repository at this point in the history
  • Loading branch information
gion-andri committed Dec 4, 2023
1 parent 2a27e1a commit 4ca3a68
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/app/user-area/pages/new-event/new-event.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ <h1>Registrar in’occurrenza</h1>
*</label>
<textarea formControlName="description" class="form-control" id="description" style="height: 150px"
[class.is-invalid]="isFieldInvalid('description')"></textarea>
<span id="description-size">{{ descriptionSize }}</span>
<div class="invalid-feedback" *ngIf="isFieldInvalid('description')">
<ng-container *ngIf="isFieldError('description', 'required')">
Endatescha p.pl. ina descripziun.
Expand Down
8 changes: 8 additions & 0 deletions src/app/user-area/pages/new-event/new-event.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ h2 {
margin-top: 36px;
}

#description-size {
float: right;
margin-top: -30px;
margin-right: 10px;
font-size: .8rem;
color: #667080;
}

.occurrence-item {
border-left: 3px solid black;
margin-bottom: 16px;
Expand Down
4 changes: 4 additions & 0 deletions src/app/user-area/pages/new-event/new-event.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@ export class NewEventComponent implements OnInit {
this.modalService.open(NetiquetteComponent, {size: 'xl', centered: true});
}

get descriptionSize(): string {
return this.f.get('description')?.value.length + ' / 750';
}

private transformToEventDto(isDraft: boolean): EventDto {
let newState: EventStatusTypes = 'DRAFT';
if (!isDraft) {
Expand Down

0 comments on commit 4ca3a68

Please sign in to comment.