Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
#78 PR comments
  • Loading branch information
enriquezrene committed Apr 14, 2020
commit 17026d3195fd10df2b5f76dd351ca725b46fa7cc
2 changes: 1 addition & 1 deletion src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const routes: Routes = [
{ path: 'time-clock', component: TimeClockComponent },
{ path: 'time-entries', component: TimeEntriesComponent },
{ path: 'activities-management', component: ActivitiesManagementComponent },
{ path: 'customer-managment', component: CustomerComponent },
{ path: 'customers-management', component: CustomerComponent },
{ path: '', pathMatch: 'full', redirectTo: 'time-clock' },
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('InputCustomerComponent', () => {
fixture.detectChanges();
});

it('component should create', () => {
it('component should be created', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
>
<td class="col-sm-9">{{ customer.name }}</td>
<td class="col-sm-3 text-center">
<button (click)="activateCustomerForm()" type="button" class="btn btn-sm btn-secondary">
<button type="button" class="btn btn-sm btn-secondary">
<i class="fa fa-pencil fa-xs"></i>
</button>
<button type="button" class="btn btn-sm btn-danger ml-2"><i class="fas fa-trash-alt fa-xs"></i></button>
<button type="button" class="btn btn-sm btn-danger ml-2">
<i class="fas fa-trash-alt fa-xs"></i>
</button>
</td>
</tr>
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,8 @@ describe('CustomerTableListComponent', () => {
fixture.detectChanges();
});

it('component should create', () => {
it('component should be created', () => {
expect(component).toBeTruthy();
});

it('changeShowCustomerForm should listen form changes', () => {
component.showCustomerForm = true;
spyOn(component.changeShowCustomerForm, 'emit');
component.activateCustomerForm();
expect(component.changeShowCustomerForm.emit).toHaveBeenCalled();
});
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, Input, Output, EventEmitter } from '@angular/core';
import { Component } from '@angular/core';
import { ITEMS_PER_PAGE } from 'src/environments/environment';

@Component({
Expand Down Expand Up @@ -29,13 +29,6 @@ export class CustomerListComponent {
},
];

@Input() showCustomerForm;
@Output() changeShowCustomerForm = new EventEmitter<boolean>();

constructor() {}

activateCustomerForm() {
this.showCustomerForm = true;
this.changeShowCustomerForm.emit(this.showCustomerForm);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@
<form style="width: 600px;">
<div class="form-group">
<input type="text" class="form-control form-control-sm" id="" aria-describedby="" placeholder="Name" />
<textarea
class="form-control form-control-sm mt-2"
id="descriptionTextArea"
rows="3"
placeholder="Description"
></textarea>
<button type="submit" class="btn btn-sm btn-primary mb-2 mt-2">Save</button>
<textarea class="form-control form-control-sm mt-2" id="descriptionTextArea" rows="3"
placeholder="Description"></textarea>
<button type="submit" class="btn btn-sm btn-primary">Save</button>
<button type="submit" class="btn btn-sm btn-secondary mb-2 ml-2 mt-2">Cancel</button>
</div>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('InputProjectTypeComponent', () => {
fixture.detectChanges();
});

it('component should create', () => {
it('component should be created', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('ProjectTypeTableListComponent', () => {
fixture.detectChanges();
});

it('component should create', () => {
it('component should be created', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('InputProjectComponent', () => {
fixture.detectChanges();
});

it('component should create', () => {
it('component should be created', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('ProjectTableListComponent', () => {
fixture.detectChanges();
});

it('component should create', () => {
it('component should be created', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('SearchComponent', () => {
fixture.detectChanges();
});

it('should create', () => {
it('component should be created', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { Component, OnInit } from '@angular/core';
import { Component } from '@angular/core';

@Component({
selector: 'app-search',
templateUrl: './search.component.html',
styleUrls: ['./search.component.scss'],
})
export class SearchComponent implements OnInit {
export class SearchComponent {
constructor() {}

ngOnInit(): void {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ <h4>Customers</h4>
</div>
<app-search></app-search>
</div>
<app-customer-list
[showCustomerForm]="showCustomerForm"
(changeShowCustomerForm)="showCustomerForm = $event"
></app-customer-list>
<app-customer-list></app-customer-list>
<div class="row" *ngIf="showCustomerForm">
<div class="col">
<app-management-customer-projects></app-management-customer-projects>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('CustomerComponent', () => {
fixture.detectChanges();
});

it('should create', () => {
it('should be created', () => {
expect(component).toBeTruthy();
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import { Component, OnInit } from '@angular/core';
import { Component } from '@angular/core';

@Component({
selector: 'app-customer',
templateUrl: './customer.component.html',
styleUrls: ['./customer.component.scss'],
})
export class CustomerComponent implements OnInit {
export class CustomerComponent {
showCustomerForm = false;

constructor() {}

ngOnInit(): void {}

activateCustomerForm(): boolean {
this.showCustomerForm = true;
return this.showCustomerForm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ export class SidebarComponent implements OnInit {
{ route: '/time-clock', icon: 'far fa-clock', text: 'Time Clock' },
{ route: '/time-entries', icon: 'far fa-list-alt', text: 'Time Entries' },
{ route: '/reports', icon: 'fas fa-chart-pie', text: 'Reports' },
// { route: '/project-management', icon: 'far fa-folder-open', text: 'Projects' },
{ route: '/activities-management', icon: 'far fa-file-alt', text: 'Activities' },
{ route: '/customer-managment', icon: 'fas fa-users-cog', text: 'Customer' },
{ route: '/customers-management', icon: 'fas fa-users-cog', text: 'Customers' },
];
}
}