From ab27addaed06cbb51e88f2669d21f109326ca159 Mon Sep 17 00:00:00 2001 From: Sandro Castillo Date: Fri, 29 Jan 2021 10:10:47 -0500 Subject: [PATCH 1/6] fix: TT-117 two entries in progress bug (#627) * fix: TT-117 two entries in progress bug * fix: TT-117 creating new test --- .../details-fields.component.spec.ts | 24 ++++++++++++++----- .../details-fields.component.ts | 1 + 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/app/modules/shared/components/details-fields/details-fields.component.spec.ts b/src/app/modules/shared/components/details-fields/details-fields.component.spec.ts index d41f565a8..60139632f 100644 --- a/src/app/modules/shared/components/details-fields/details-fields.component.spec.ts +++ b/src/app/modules/shared/components/details-fields/details-fields.component.spec.ts @@ -128,14 +128,14 @@ describe('DetailsFieldsComponent', () => { expect(component).toBeTruthy(); }); - it('onClearedComponent project id and name it is set to empty', () => { + it('onClearedComponent project id and name are set to empty', () => { component.onClearedComponent(null); expect(component.project_id.value).toBe(''); expect(component.project_name.value).toBe(''); }); - it('onSelectedProject project id and name it is set using event data', () => { + it('onSelectedProject project id and name are set using event data', () => { spyOn(component.entryForm, 'patchValue'); component.onSelectedProject( {id: 'id', search_field: 'foo'} ); @@ -143,7 +143,7 @@ describe('DetailsFieldsComponent', () => { expect(component.entryForm.patchValue).toHaveBeenCalledWith( { project_id: 'id', project_name: 'foo', } ); }); - it('if form is invalid then no save is emited', () => { + it('if form is invalid then saveEntry is not emited', () => { spyOn(component.saveEntry, 'emit'); component.onSubmit(); @@ -172,6 +172,7 @@ describe('DetailsFieldsComponent', () => { it('should emit ngOnChange without data', () => { component.entryToEdit = null; component.ngOnChanges(); + expect(component.shouldRestartEntry).toBeFalse(); expect(component.entryForm.value).toEqual(initialData); }); @@ -243,6 +244,7 @@ describe('DetailsFieldsComponent', () => { }, shouldRestartEntry: false }; + expect(component.saveEntry.emit).toHaveBeenCalledWith(data); }); @@ -298,14 +300,23 @@ describe('DetailsFieldsComponent', () => { fixture.componentInstance.ngOnChanges(); expect(component.goingToWorkOnThis).toBeFalse(); + expect(component.shouldRestartEntry).toBeFalse(); }); - it('when editing entry that already finished, then the entry should not be marked as running', () => { - component.entryToEdit = { ...entryToEdit, running: false }; + it('when editing entry is running, shouldRestartEntry should be false', () => { + component.entryToEdit = { ...entryToEdit, running: true }; fixture.componentInstance.ngOnChanges(); - expect(component.goingToWorkOnThis).toBeFalse(); + expect(component.goingToWorkOnThis).toBeTrue(); + expect(component.shouldRestartEntry).toBeFalse(); + }); + + it('when editing entry change to going to work on this shouldRestartEntry should be true', () => { + component.onGoingToWorkOnThisChange({ currentTarget: { checked: true } }); + + expect(component.goingToWorkOnThis).toBeTrue(); + expect(component.shouldRestartEntry).toBeTrue(); }); it('when submitting a entry that is currently running, the end date should not be sent ', () => { @@ -328,6 +339,7 @@ describe('DetailsFieldsComponent', () => { }, shouldRestartEntry: false }; + expect(component.saveEntry.emit).toHaveBeenCalledWith(data); }); diff --git a/src/app/modules/shared/components/details-fields/details-fields.component.ts b/src/app/modules/shared/components/details-fields/details-fields.component.ts index 566960acc..5bc62652d 100644 --- a/src/app/modules/shared/components/details-fields/details-fields.component.ts +++ b/src/app/modules/shared/components/details-fields/details-fields.component.ts @@ -126,6 +126,7 @@ export class DetailsFieldsComponent implements OnChanges, OnInit { ngOnChanges(): void { this.goingToWorkOnThis = this.entryToEdit ? this.entryToEdit.running : false; + this.shouldRestartEntry = false; if (this.entryToEdit) { this.selectedTechnologies = this.entryToEdit.technologies; const projectFound = this.listProjects.find((project) => project.id === this.entryToEdit.project_id); From a4064caecc3893fcc29d7f1f71bd3ed05c33f9b8 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Fri, 29 Jan 2021 15:12:15 +0000 Subject: [PATCH 2/6] chore(release): 1.31.11 [skip ci]nn --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 06a2dbb45..4d3b56065 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "time-tracker", - "version": "1.31.10", + "version": "1.31.11", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f7ce1959a..04f7d2f15 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "time-tracker", - "version": "1.31.10", + "version": "1.31.11", "scripts": { "preinstall": "npx npm-force-resolutions", "ng": "ng", From 724ef671783a9601a52a5498f9ddf2dab6975f65 Mon Sep 17 00:00:00 2001 From: jr-98 Date: Wed, 27 Jan 2021 11:11:46 -0500 Subject: [PATCH 3/6] fix: TT-139 Reduce the left margin on coutome page --- .../customer-list/customer-list.component.html | 14 +++++++------- .../customer-list/customer-list.component.ts | 5 +++-- .../pages/customer.component.html | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.html b/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.html index 784ddf685..f8af93e2d 100644 --- a/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.html +++ b/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.html @@ -1,23 +1,23 @@ - - - + + + - - - + + - + diff --git a/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.html b/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.html index f8af93e2d..711471409 100644 --- a/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.html +++ b/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.html @@ -1,23 +1,24 @@ -
Customer IDNameOptionsCustomer IDNameOptions
{{ customer.id }}{{ customer.name }} + {{ customer.id }}{{ customer.name }} From 88d48718737599a5d3aaa73a9f63c5bbaaaa5f51 Mon Sep 17 00:00:00 2001 From: jr-98 Date: Wed, 27 Jan 2021 22:28:15 -0500 Subject: [PATCH 4/6] fix: TT-139-Reduce-the-left-margin-on-the-customer-page2 --- .../activity-list/activity-list.component.html | 2 +- .../customer-list/customer-list.component.html | 18 ++++++++++-------- .../customer-list/customer-list.component.scss | 4 ++++ 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/app/modules/activities-management/components/activity-list/activity-list.component.html b/src/app/modules/activities-management/components/activity-list/activity-list.component.html index a4582ed10..903587928 100644 --- a/src/app/modules/activities-management/components/activity-list/activity-list.component.html +++ b/src/app/modules/activities-management/components/activity-list/activity-list.component.html @@ -4,7 +4,7 @@
Activity ID ActivityOptions
+
- - - + + + - - - + +
Customer IDNameOptionsCustomer IDNameOptions
{{ customer.id }}{{ customer.name }} + {{ customer.id }}{{ customer.name }}
+ Date: Thu, 28 Jan 2021 19:35:30 -0500 Subject: [PATCH 5/6] fix: TT-139 Resolved the cometaries on GitHub about identation and bootstrap --- .../customer-list.component.html | 80 +++++++++---------- .../customer-list.component.scss | 5 +- 2 files changed, 41 insertions(+), 44 deletions(-) diff --git a/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.html b/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.html index 711471409..09b7a0b76 100644 --- a/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.html +++ b/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.html @@ -1,44 +1,44 @@ -
+
- - - - - - - - - - - - - - - -
Customer IDNameOptions
{{ customer.id }}{{ customer.name }} - - -
+ *ngIf="customers" + class="table table-bordered table-striped mb-0" + datatable + [dtTrigger]="dtTrigger" + [dtOptions]="dtOptions" + > + + + Customer ID + Name + Options + + + + + + {{ customer.id }} + {{ customer.name }} + + + + + + +
Date: Fri, 29 Jan 2021 12:09:16 -0500 Subject: [PATCH 6/6] fix: TT-139 delete line white --- .../components/customer-list/customer-list.component.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.scss b/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.scss index 8b1378917..e69de29bb 100644 --- a/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.scss +++ b/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.scss @@ -1 +0,0 @@ -