Skip to content

Commit c19f4d2

Browse files
committed
fix: #186 mark customer description as required and #185 fix error message
1 parent e0a97ee commit c19f4d2

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/app/modules/customer-management/components/customer-info/components/create-customer/create-customer.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="form-group">
44
<div
55
*ngIf="showAlert && messageToShow !== ''"
6-
[ngClass]="{'bg-secondary': messageToShow == 'Customer created successfully!' || messageToShow == 'Customer updated successfully!',
6+
[ngClass]="{'bg-secondary': messageToShow == 'Customer created successfully!' || messageToShow == 'Customer updated successfully!',
77
'bg-primary': messageToShow !== 'Customer created successfully!' }"
88
class="alert alert-dismissible fade fade-in show text-white"
99
role="alert"
@@ -23,7 +23,7 @@
2323
<span
2424
class="badge badge-pill badge-light text-danger"
2525
*ngIf="(customerForm.dirty || customerForm.touched) && customerForm.invalid"
26-
>Activity name is required</span
26+
>Customer name is required</span
2727
>
2828
<textarea
2929
class="form-control form-control-sm mt-2"
@@ -32,6 +32,11 @@
3232
formControlName="description"
3333
placeholder="Customer description"
3434
></textarea>
35+
<span
36+
class="badge badge-pill badge-light text-danger"
37+
*ngIf="(customerForm.dirty || customerForm.touched) && customerForm.invalid"
38+
>Customer description is required</span
39+
>
3540
<button type="submit" class="btn btn-sm btn-primary" [disabled]="!customerForm.valid">Save</button>
3641
<button (click)="resetCustomerForm()" id="cancel" type="button" class="btn btn-sm btn-secondary mb-2 ml-2 mt-2">
3742
Cancel

src/app/modules/customer-management/components/customer-info/components/create-customer/create-customer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class CreateCustomerComponent implements OnInit, OnDestroy {
3131
constructor(private formBuilder: FormBuilder, private store: Store<CustomerState>) {
3232
this.customerForm = this.formBuilder.group({
3333
name: ['', Validators.required],
34-
description: [''],
34+
description: ['', Validators.required],
3535
});
3636
}
3737

0 commit comments

Comments
 (0)