diff --git a/src/app/modules/shared/store/technology.reducers.ts b/src/app/modules/shared/store/technology.reducers.ts index 4fc1c68c6..ebd2d18fe 100644 --- a/src/app/modules/shared/store/technology.reducers.ts +++ b/src/app/modules/shared/store/technology.reducers.ts @@ -7,7 +7,7 @@ export interface TechnologyState { } export const initialState = { - technologyList: null, + technologyList: { items: [] }, isLoading: false, }; diff --git a/src/app/modules/time-clock/components/entry-fields/entry-fields.component.ts b/src/app/modules/time-clock/components/entry-fields/entry-fields.component.ts index 079ee6664..301e62e8b 100644 --- a/src/app/modules/time-clock/components/entry-fields/entry-fields.component.ts +++ b/src/app/modules/time-clock/components/entry-fields/entry-fields.component.ts @@ -50,7 +50,8 @@ export class EntryFieldsComponent implements OnInit { const technologies$ = this.store.pipe(select(allTechnologies)); technologies$.subscribe((response) => { this.isLoading = response.isLoading; - this.technology = response.technologyList; + const filteredItems = response.technologyList.items.filter(item => !this.selectedTechnology.includes(item.name)); + this.technology = { items: filteredItems }; }); this.store.dispatch(new LoadActivities()); diff --git a/src/app/modules/time-clock/pages/time-clock.component.spec.ts b/src/app/modules/time-clock/pages/time-clock.component.spec.ts index 79f110121..da1f29201 100644 --- a/src/app/modules/time-clock/pages/time-clock.component.spec.ts +++ b/src/app/modules/time-clock/pages/time-clock.component.spec.ts @@ -1,5 +1,5 @@ import {EntryActionTypes, StopTimeEntryRunning } from './../store/entry.actions'; -import { async, ComponentFixture, TestBed, inject } from '@angular/core/testing'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { HttpClientTestingModule } from '@angular/common/http/testing'; import { provideMockStore, MockStore } from '@ngrx/store/testing'; @@ -88,7 +88,7 @@ describe('TimeClockComponent', () => { }); it('on success create entry, the notification is shown', () => { - const actionSubject = TestBed.get(ActionsSubject) as ActionsSubject; + const actionSubject = TestBed.inject(ActionsSubject) as ActionsSubject; const action = { type: EntryActionTypes.CREATE_ENTRY_SUCCESS }; @@ -97,7 +97,7 @@ describe('TimeClockComponent', () => { }); it('on success stop entry, the notification is shown', () => { - const actionSubject = TestBed.get(ActionsSubject) as ActionsSubject; + const actionSubject = TestBed.inject(ActionsSubject) as ActionsSubject; const action = { type: EntryActionTypes.STOP_TIME_ENTRY_RUNNING_SUCCESS };