diff --git a/src/frontend/src/app/dialogs/create-token-dialog/create-token-dialog.html b/src/frontend/src/app/dialogs/create-token-dialog/create-token-dialog.html index 4b411c42d031d65e39b95132b5775119574e3394..ab6420ec4f761300301e447361536fc4952da2ac 100644 --- a/src/frontend/src/app/dialogs/create-token-dialog/create-token-dialog.html +++ b/src/frontend/src/app/dialogs/create-token-dialog/create-token-dialog.html @@ -28,14 +28,21 @@ <nz-form-item class="analytics-token-description"> - <nz-form-label [nzSpan]="10">Description</nz-form-label> - <nz-form-control [nzSpan]="14"> - <textarea - nz-input - [rows]="5" - placeholder="Description" - [formControl]="descriptionController" - autocomplete="off"></textarea> + <nz-form-label nzRequired [nzSpan]="10">Description</nz-form-label> + <nz-form-control [nzSpan]="14" [nzErrorTip]="descriptionError"> + <nz-input-group> + <textarea + nz-input + [rows]="5" + placeholder="Description" + [formControl]="descriptionController" + autocomplete="off"></textarea> + </nz-input-group> + <ng-template #descriptionError let-control> + <ng-container *ngIf="control.hasError('required')"> + Description is <strong>required</strong> + </ng-container> + </ng-template> </nz-form-control> </nz-form-item> diff --git a/src/frontend/src/app/dialogs/create-token-dialog/create-token-dialog.ts b/src/frontend/src/app/dialogs/create-token-dialog/create-token-dialog.ts index c605ed1fee34123cdaa15e25266e61a3f16c1d68..5875b4d580e44f9981f8fa43d592ed67ad465b23 100644 --- a/src/frontend/src/app/dialogs/create-token-dialog/create-token-dialog.ts +++ b/src/frontend/src/app/dialogs/create-token-dialog/create-token-dialog.ts @@ -33,7 +33,7 @@ export class CreateTokenDialog implements OnInit { ) { this.form = this._formBuilder.group({ expires: [null, validateDate()], - description: [null], + description: ['', Validators.required], name: [ '', Validators.required,