Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
>
<strong>{{ messageToShow }}</strong>
</div>

</div>
<div class="form-group">
<input
class="form-control form-control-sm"
id="customerName"
Expand All @@ -22,9 +23,11 @@
/>
<span
class="badge badge-pill badge-light text-danger"
*ngIf="(customerForm.dirty || customerForm.touched) && customerForm.invalid"
*ngIf="(name.dirty || name.touched) && name.invalid && name.errors.required"
>Customer name is required</span
>
</div>
<div class="form-group">
<textarea
class="form-control form-control-sm mt-2"
id="customerDescription"
Expand All @@ -34,13 +37,13 @@
></textarea>
<span
class="badge badge-pill badge-light text-danger"
*ngIf="(customerForm.dirty || customerForm.touched) && customerForm.invalid"
*ngIf="(description.dirty || description.touched) && description.invalid && description.errors.required"
>Customer description is required</span
>
</div>
<button type="submit" class="btn btn-sm btn-primary" [disabled]="!customerForm.valid">Save</button>
<button (click)="resetCustomerForm()" id="cancel" type="button" class="btn btn-sm btn-secondary mb-2 ml-2 mt-2">
Cancel
</button>
</div>
</form>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export class CreateCustomerComponent implements OnInit, OnDestroy {
id: this.customerToEdit.id,
};
this.store.dispatch(new UpdateCustomer(customer));
this.customerForm.reset();
} else {
this.store.dispatch(new CreateCustomer(customerData));
}
Expand Down Expand Up @@ -95,6 +94,14 @@ export class CreateCustomerComponent implements OnInit, OnDestroy {
}
}

get name() {
return this.customerForm.get('name');
}

get description() {
return this.customerForm.get('description');
}

resetCustomerForm() {
this.customerForm.reset();
this.store.dispatch(new ResetCustomerToEdit());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<table class="table table-sm table-bordered table-striped mb-0">
<thead class="thead-orange">
<tr class="d-flex">
<th class="col-9">Name</th>
<th class="col-9">Customer name</th>
<th class="col-3 text-center"></th>
</tr>
</thead>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,42 +1,21 @@
<form style="width: 600px;" [formGroup]="projectTypeForm" (ngSubmit)="onSubmit(projectTypeForm.value)">
<div class="form-group">
<input
type="text"
class="form-control form-control-sm"
id="name"
formControlName="name"
aria-describedby=""
[class.is-invalid]="name.invalid && name.touched"
required
placeholder="Name"
/>
<input type="text" class="form-control form-control-sm" id="name" formControlName="name" aria-describedby=""
[class.is-invalid]="name.invalid && name.touched" required placeholder="Name" />
<div class="text-danger" *ngIf="(name.dirty || name.touched) && name.invalid && name.errors.required">
Name is required.
</div>
<textarea
class="form-control form-control-sm mt-2"
id="descriptionTextArea"
rows="3"
placeholder="Description"
formControlName="description"
></textarea>
<div class="btn-toolbar" role="toolbar">
<div class="btn-group mr-2" role="group">
<button type="submit" class="btn btn-sm btn-primary mb-2 ml-2 mt-2" [disabled]="!projectTypeForm.valid">
Save
</button>
</div>
<div class="btn-group mr-2" role="group">
<button
class="btn btn-sm btn-secondary mb-2 ml-2 mt-2"
type="reset"
[hidden]="!projectTypeToEdit"
(click)="cancelButton()"
>
Cancel
</button>
</div>
</div>
</div>
<div class="form-group">
<textarea class="form-control form-control-sm mt-2" id="descriptionTextArea" rows="3" placeholder="Description"
formControlName="description"></textarea>
</div>
<button type="submit" class="btn btn-sm btn-primary" [disabled]="!projectTypeForm.valid">
Save
</button>
<button class="btn btn-sm btn-secondary mb-2 ml-2 mt-2" type="reset" [hidden]="!projectTypeToEdit"
(click)="cancelButton()">
Cancel
</button>
</form>
<hr />
<hr/>
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
<div class="row text-right">
<hr />
<div class="col-5 text-right">
<app-search (changedFilterValue)="filterProjects = $event"></app-search>
</div>
</div>
<table class="table table-sm table-bordered table-striped">
<thead class="thead-orange">
<tr class="d-flex">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
<div class="container mt-2">
<h4>Customers</h4>
<div class="row">
<div class="col">
<div class="col-5" style="padding: 15px;">
<button (click)="activateCustomerForm()" type="button" class="btn btn-primary">Add new customer</button>
</div>
<div class="col-5 text-right">
<app-search></app-search>
</div>
</div>
<app-customer-list
[showCustomerForm]="showCustomerForm"
Expand Down
7 changes: 1 addition & 6 deletions src/app/modules/time-clock/pages/time-clock.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<app-notification [notificationMsg]="message | async" [isError]="isError" *ngIf="showNotification"></app-notification>
<div class="text-center mt-3">
<div class="card">
<div class="card-body">

<h6 class="text-left"><strong>Summary</strong></h6>
<hr />
<div class="row pb-4">
Expand All @@ -18,7 +17,6 @@ <h6>Month</h6>
<h3>49:32</h3>
</div>
</div>
<hr />
<div class="row pb-4">
<div class="col-12">
<p *ngIf="areFieldsVisible" class="card-title text-left">
Expand All @@ -40,7 +38,6 @@ <h3>49:32</h3>
<div *ngIf="areFieldsVisible">
<app-entry-fields></app-entry-fields>
</div>
<hr />
<div class="container">
<div class="row">
<div class="col text-right">
Expand All @@ -49,7 +46,5 @@ <h3>49:32</h3>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
2 changes: 2 additions & 0 deletions src/styles/themes/_orange-theme.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@import '../colors.scss';

$font-size-base: 0.9rem;

$primary: #fc5630;
$secondary: #16bac5;
$success: #16bac5;
Expand Down