Skip to content

Commit f882c9b

Browse files
committed
fix: #212 clean up design a little bit
1 parent 9424000 commit f882c9b

File tree

8 files changed

+34
-58
lines changed

8 files changed

+34
-58
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
>
1111
<strong>{{ messageToShow }}</strong>
1212
</div>
13-
13+
</div>
14+
<div class="form-group">
1415
<input
1516
class="form-control form-control-sm"
1617
id="customerName"
@@ -22,9 +23,11 @@
2223
/>
2324
<span
2425
class="badge badge-pill badge-light text-danger"
25-
*ngIf="(customerForm.dirty || customerForm.touched) && customerForm.invalid"
26+
*ngIf="(name.dirty || name.touched) && name.invalid && name.errors.required"
2627
>Customer name is required</span
2728
>
29+
</div>
30+
<div class="form-group">
2831
<textarea
2932
class="form-control form-control-sm mt-2"
3033
id="customerDescription"
@@ -34,13 +37,13 @@
3437
></textarea>
3538
<span
3639
class="badge badge-pill badge-light text-danger"
37-
*ngIf="(customerForm.dirty || customerForm.touched) && customerForm.invalid"
40+
*ngIf="(description.dirty || description.touched) && description.invalid && description.errors.required"
3841
>Customer description is required</span
3942
>
43+
</div>
4044
<button type="submit" class="btn btn-sm btn-primary" [disabled]="!customerForm.valid">Save</button>
4145
<button (click)="resetCustomerForm()" id="cancel" type="button" class="btn btn-sm btn-secondary mb-2 ml-2 mt-2">
4246
Cancel
4347
</button>
44-
</div>
4548
</form>
4649
</div>

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ export class CreateCustomerComponent implements OnInit, OnDestroy {
6262
id: this.customerToEdit.id,
6363
};
6464
this.store.dispatch(new UpdateCustomer(customer));
65-
this.customerForm.reset();
6665
} else {
6766
this.store.dispatch(new CreateCustomer(customerData));
6867
}
@@ -95,6 +94,14 @@ export class CreateCustomerComponent implements OnInit, OnDestroy {
9594
}
9695
}
9796

97+
get name() {
98+
return this.customerForm.get('name');
99+
}
100+
101+
get description() {
102+
return this.customerForm.get('description');
103+
}
104+
98105
resetCustomerForm() {
99106
this.customerForm.reset();
100107
this.store.dispatch(new ResetCustomerToEdit());

src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<table class="table table-sm table-bordered table-striped mb-0">
1313
<thead class="thead-orange">
1414
<tr class="d-flex">
15-
<th class="col-9">Name</th>
15+
<th class="col-9">Customer name</th>
1616
<th class="col-3 text-center"></th>
1717
</tr>
1818
</thead>
Lines changed: 14 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,21 @@
11
<form style="width: 600px;" [formGroup]="projectTypeForm" (ngSubmit)="onSubmit(projectTypeForm.value)">
22
<div class="form-group">
3-
<input
4-
type="text"
5-
class="form-control form-control-sm"
6-
id="name"
7-
formControlName="name"
8-
aria-describedby=""
9-
[class.is-invalid]="name.invalid && name.touched"
10-
required
11-
placeholder="Name"
12-
/>
3+
<input type="text" class="form-control form-control-sm" id="name" formControlName="name" aria-describedby=""
4+
[class.is-invalid]="name.invalid && name.touched" required placeholder="Name" />
135
<div class="text-danger" *ngIf="(name.dirty || name.touched) && name.invalid && name.errors.required">
146
Name is required.
157
</div>
16-
<textarea
17-
class="form-control form-control-sm mt-2"
18-
id="descriptionTextArea"
19-
rows="3"
20-
placeholder="Description"
21-
formControlName="description"
22-
></textarea>
23-
<div class="btn-toolbar" role="toolbar">
24-
<div class="btn-group mr-2" role="group">
25-
<button type="submit" class="btn btn-sm btn-primary mb-2 ml-2 mt-2" [disabled]="!projectTypeForm.valid">
26-
Save
27-
</button>
28-
</div>
29-
<div class="btn-group mr-2" role="group">
30-
<button
31-
class="btn btn-sm btn-secondary mb-2 ml-2 mt-2"
32-
type="reset"
33-
[hidden]="!projectTypeToEdit"
34-
(click)="cancelButton()"
35-
>
36-
Cancel
37-
</button>
38-
</div>
39-
</div>
408
</div>
9+
<div class="form-group">
10+
<textarea class="form-control form-control-sm mt-2" id="descriptionTextArea" rows="3" placeholder="Description"
11+
formControlName="description"></textarea>
12+
</div>
13+
<button type="submit" class="btn btn-sm btn-primary" [disabled]="!projectTypeForm.valid">
14+
Save
15+
</button>
16+
<button class="btn btn-sm btn-secondary mb-2 ml-2 mt-2" type="reset" [hidden]="!projectTypeToEdit"
17+
(click)="cancelButton()">
18+
Cancel
19+
</button>
4120
</form>
42-
<hr />
21+
<hr/>

src/app/modules/customer-management/components/projects/components/project-list/project-list.component.html

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
<div class="row text-right">
2-
<hr />
3-
<div class="col-5 text-right">
4-
<app-search (changedFilterValue)="filterProjects = $event"></app-search>
5-
</div>
6-
</div>
71
<table class="table table-sm table-bordered table-striped">
82
<thead class="thead-orange">
93
<tr class="d-flex">

src/app/modules/customer-management/pages/customer.component.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
<div class="container mt-2">
2-
<h4>Customers</h4>
32
<div class="row">
4-
<div class="col">
3+
<div class="col-5" style="padding: 15px;">
54
<button (click)="activateCustomerForm()" type="button" class="btn btn-primary">Add new customer</button>
65
</div>
7-
<div class="col-5 text-right">
8-
<app-search></app-search>
9-
</div>
106
</div>
117
<app-customer-list
128
[showCustomerForm]="showCustomerForm"

src/app/modules/time-clock/pages/time-clock.component.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<app-notification [notificationMsg]="message | async" [isError]="isError" *ngIf="showNotification"></app-notification>
22
<div class="text-center mt-3">
3-
<div class="card">
4-
<div class="card-body">
3+
54
<h6 class="text-left"><strong>Summary</strong></h6>
65
<hr />
76
<div class="row pb-4">
@@ -18,7 +17,6 @@ <h6>Month</h6>
1817
<h3>49:32</h3>
1918
</div>
2019
</div>
21-
<hr />
2220
<div class="row pb-4">
2321
<div class="col-12">
2422
<p *ngIf="areFieldsVisible" class="card-title text-left">
@@ -40,7 +38,6 @@ <h3>49:32</h3>
4038
<div *ngIf="areFieldsVisible">
4139
<app-entry-fields></app-entry-fields>
4240
</div>
43-
<hr />
4441
<div class="container">
4542
<div class="row">
4643
<div class="col text-right">
@@ -49,7 +46,5 @@ <h3>49:32</h3>
4946
</button>
5047
</div>
5148
</div>
52-
</div>
53-
</div>
5449
</div>
5550
</div>

src/styles/themes/_orange-theme.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
@import '../colors.scss';
22

3+
$font-size-base: 0.9rem;
4+
35
$primary: #fc5630;
46
$secondary: #16bac5;
57
$success: #16bac5;

0 commit comments

Comments
 (0)