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
TT-65 fix: correct changes of github messages
  • Loading branch information
PaulRC-ioet committed Dec 11, 2020
commit e37c8dcc61d1136a2070f75efbb554720b85515c
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
></ngx-timepicker-field>
</div>
<div class="col-md-auto">
<button *ngIf="showtimeInbuttons" (click)="onUpdateStartHour()" class="btn btn-success">Update</button>
<button *ngIf="showTimeInbuttons" (click)="onUpdateStartHour()" class="btn btn-success">Update</button>
</div>
<div class="col-md-auto">
<button *ngIf="showtimeInbuttons" (click)="cancelTimeInUpdate()" class="btn btn-danger">Cancel</button>
<button *ngIf="showTimeInbuttons" (click)="cancelTimeInUpdate()" class="btn btn-danger">Cancel</button>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ describe('EntryFieldsComponent', () => {
component.onUpdateStartHour();

expect(toastrServiceStub.error).toHaveBeenCalled();
expect(component.showtimeInbuttons).toEqual(false);
expect(component.showTimeInbuttons).toEqual(false);
});

it('Displays an error message when the active entry has start_time before the start_time of another entry', () => {
Expand All @@ -174,16 +174,16 @@ describe('EntryFieldsComponent', () => {
component.onUpdateStartHour();

expect(toastrServiceStub.error).toHaveBeenCalled();
expect(component.showtimeInbuttons).toEqual(false);
expect(component.showTimeInbuttons).toEqual(false);
});

it('should show time In buttons when time is modified', () => {
it('should show time In control buttons when time is modified', () => {
component.activeTimeInButtons();

expect(component.showtimeInbuttons).toEqual(true);
expect(component.showTimeInbuttons).toEqual(true);
});

it('should go back to the starting time and disappear buttons', () => {
it('should reset displayed time and hide control buttons when cancelTimeInUpdate', () => {
component.newData = entry;
component.activeEntry = entry ;
component.setDataToUpdate(entry);
Expand All @@ -192,7 +192,7 @@ describe('EntryFieldsComponent', () => {
spyOn(component.entryForm, 'patchValue');
component.cancelTimeInUpdate();

expect(component.showtimeInbuttons).toEqual(false);
expect(component.showTimeInbuttons).toEqual(false);
expect(component.entryForm.patchValue).toHaveBeenCalledWith(
{
start_hour: component.newData.start_hour
Expand All @@ -216,7 +216,7 @@ describe('EntryFieldsComponent', () => {
start_hour: component.newData.start_hour
}
);
expect(component.showtimeInbuttons).toEqual(false);
expect(component.showTimeInbuttons).toEqual(false);
});

it('If start hour is in the future, reset to initial start_date in form', () => {
Expand All @@ -235,7 +235,7 @@ describe('EntryFieldsComponent', () => {
start_hour: component.newData.start_hour
}
);
expect(component.showtimeInbuttons).toEqual(false);
expect(component.showTimeInbuttons).toEqual(false);
});

it('when a start hour is updated, then dispatch UpdateActiveEntry', () => {
Expand All @@ -247,7 +247,7 @@ describe('EntryFieldsComponent', () => {

component.onUpdateStartHour();
expect(store.dispatch).toHaveBeenCalled();
expect(component.showtimeInbuttons).toEqual(false);
expect(component.showTimeInbuttons).toEqual(false);
});

it('When start_time is updated, component.last_entry is equal to time entry in the position 1', waitForAsync(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class EntryFieldsComponent implements OnInit {
activeEntry;
newData;
lastEntry;
showtimeInbuttons = false;
showTimeInbuttons = false;

constructor(
private formBuilder: FormBuilder,
Expand Down Expand Up @@ -129,7 +129,7 @@ export class EntryFieldsComponent implements OnInit {
if (isEntryDateInTheFuture) {
this.toastrService.error('You cannot start a time-entry in the future');
this.entryForm.patchValue({ start_hour: this.newData.start_hour });
this.showtimeInbuttons = false;
this.showTimeInbuttons = false;
return;
}

Expand All @@ -138,12 +138,12 @@ export class EntryFieldsComponent implements OnInit {
if (isEntryDateInLastStartDate) {
this.toastrService.error('There is another time entry registered in this time range');
this.entryForm.patchValue({ start_hour: this.newData.start_hour });
this.showtimeInbuttons = false;
this.showTimeInbuttons = false;
return;
}
this.entryForm.patchValue({ start_date: newHourEntered });
this.dispatchEntries(newHourEntered);
this.showtimeInbuttons = false;
this.showTimeInbuttons = false;
}

private dispatchEntries(newHourEntered) {
Expand All @@ -163,12 +163,12 @@ export class EntryFieldsComponent implements OnInit {
}

activeTimeInButtons(){
this.showtimeInbuttons = true;
this.showTimeInbuttons = true;
}

cancelTimeInUpdate(){
this.entryForm.patchValue({ start_hour: this.newData.start_hour });
this.showtimeInbuttons = false;
this.showTimeInbuttons = false;
}

onTechnologyAdded($event: string[]) {
Expand Down
4 changes: 2 additions & 2 deletions src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ body {
}

.timepicker-overlay {
z-index: 10000000 !important;
z-index: 1100 !important;
}

.timepicker-backdrop-overlay {
z-index: 10000000 !important;
z-index: 1100 !important;
}