Skip to content

Commit 188aa29

Browse files
committed
fix: #214 remove selected technologies
1 parent 529bfc0 commit 188aa29

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/app/modules/shared/store/technology.reducers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export interface TechnologyState {
77
}
88

99
export const initialState = {
10-
technologyList: null,
10+
technologyList: { items: [] },
1111
isLoading: false,
1212
};
1313

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ export class EntryFieldsComponent implements OnInit {
5050
const technologies$ = this.store.pipe(select(allTechnologies));
5151
technologies$.subscribe((response) => {
5252
this.isLoading = response.isLoading;
53-
this.technology = response.technologyList;
53+
const filteredItems = response.technologyList.items.filter(item => !this.selectedTechnology.includes(item.name));
54+
this.technology = { items: filteredItems };
5455
});
5556

5657
this.store.dispatch(new LoadActivities());

src/app/modules/time-clock/pages/time-clock.component.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {EntryActionTypes, StopTimeEntryRunning } from './../store/entry.actions';
2-
import { async, ComponentFixture, TestBed, inject } from '@angular/core/testing';
2+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
33
import { HttpClientTestingModule } from '@angular/common/http/testing';
44
import { provideMockStore, MockStore } from '@ngrx/store/testing';
55

@@ -88,7 +88,7 @@ describe('TimeClockComponent', () => {
8888
});
8989

9090
it('on success create entry, the notification is shown', () => {
91-
const actionSubject = TestBed.get(ActionsSubject) as ActionsSubject;
91+
const actionSubject = TestBed.inject(ActionsSubject) as ActionsSubject;
9292
const action = {
9393
type: EntryActionTypes.CREATE_ENTRY_SUCCESS
9494
};
@@ -97,7 +97,7 @@ describe('TimeClockComponent', () => {
9797
});
9898

9999
it('on success stop entry, the notification is shown', () => {
100-
const actionSubject = TestBed.get(ActionsSubject) as ActionsSubject;
100+
const actionSubject = TestBed.inject(ActionsSubject) as ActionsSubject;
101101
const action = {
102102
type: EntryActionTypes.STOP_TIME_ENTRY_RUNNING_SUCCESS
103103
};

0 commit comments

Comments
 (0)