Skip to content

Commit 69263bc

Browse files
committed
fix: TT-25 Delete the '-1' option from the html file
1 parent c3701ff commit 69263bc

File tree

3 files changed

+1
-16
lines changed

3 files changed

+1
-16
lines changed

src/app/modules/time-clock/components/entry-fields/entry-fields.component.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
(change)="onSubmit()"
66
class="form-control"
77
formControlName="activity_id"
8-
[class.is-invalid]="activity_id.invalid && activity_id.touched || activity_id.value == '-1'"
8+
[class.is-invalid]="activity_id.invalid && activity_id.touched"
99
required>
10-
<option value="-1"></option>
1110
<option *ngFor="let activity of activities" value="{{ activity.id }}">{{ activity.name }}</option>
1211
</select>
1312
</div>

src/app/modules/time-clock/components/entry-fields/entry-fields.component.spec.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { DATE_FORMAT_YEAR } from 'src/environments/environment';
1818
import { FeatureManagerService } from './../../../shared/feature-toggles/feature-toggle-manager.service';
1919
import { FeatureToggleGeneralService } from './../../../shared/feature-toggles/feature-toggle-general/feature-toggle-general.service';
2020
import { FeatureToggle } from 'src/environments/enum';
21-
import { By } from '@angular/platform-browser';
2221

2322

2423
describe('EntryFieldsComponent', () => {
@@ -467,15 +466,6 @@ describe('EntryFieldsComponent', () => {
467466
expect(featureToggleGeneralService.isActivated).toHaveBeenCalled();
468467
});
469468
});
470-
471-
it('toastrService should be called when the activity field is empty', () => {
472-
fixture.detectChanges();
473-
const select: HTMLSelectElement = fixture.debugElement.query(By.css('select')).nativeElement;
474-
spyOn(toastrServiceStub, 'error');
475-
select.value = select.options[0].value;
476-
select.dispatchEvent(new Event('change'));
477-
expect(toastrServiceStub.error).toHaveBeenCalled();
478-
});
479469
});
480470

481471

src/app/modules/time-clock/components/entry-fields/entry-fields.component.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,6 @@ export class EntryFieldsComponent implements OnInit, OnDestroy {
133133
}
134134

135135
onSubmit() {
136-
if (this.entryForm.value.activity_id === '-1') {
137-
this.toastrService.error('Please enter a valid activity');
138-
return;
139-
}
140136
this.store.dispatch(new entryActions.UpdateEntryRunning({ ...this.newData, ...this.entryForm.value }));
141137
}
142138

0 commit comments

Comments
 (0)