Skip to content

Commit b1814be

Browse files
authored
Merge pull request #263 from ioet/252-customer-description-not-required
fix: #252 remove description as required on customers creation
2 parents 97780bd + 62e49ee commit b1814be

File tree

3 files changed

+2
-11
lines changed

3 files changed

+2
-11
lines changed

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@
2424
formControlName="description"
2525
placeholder="Customer description"
2626
></textarea>
27-
<span
28-
class="badge badge-pill badge-light text-danger"
29-
*ngIf="(description.dirty || description.touched) && description.invalid && description.errors.required"
30-
>Customer description is required</span
31-
>
3227
</div>
3328
<button type="submit" class="btn btn-primary" [disabled]="!customerForm.valid">Save</button>
3429
<button (click)="resetCustomerForm()" id="cancel" type="button" class="btn btn-secondary mb-2 ml-2 mt-2">

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

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

@@ -79,10 +79,6 @@ export class CreateCustomerComponent implements OnInit, OnDestroy {
7979
return this.customerForm.get('name');
8080
}
8181

82-
get description() {
83-
return this.customerForm.get('description');
84-
}
85-
8682
resetCustomerForm() {
8783
this.customerForm.reset();
8884
this.store.dispatch(new ResetCustomerToEdit());

src/app/modules/shared/components/details-fields/details-fields.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export class DetailsFieldsComponent implements OnChanges, OnInit {
154154

155155
closeEntryModal() {
156156
this.entryForm.reset();
157-
this.closeModal?.nativeElement.click();
157+
this.closeModal?.nativeElement?.click();
158158
}
159159

160160
onSubmit() {

0 commit comments

Comments
 (0)