Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
fix: #214 remove selected technologies
  • Loading branch information
enriquezrene committed May 7, 2020
commit 188aa29d8a7f85aed45a814d3cab2e96aeb346a7
2 changes: 1 addition & 1 deletion src/app/modules/shared/store/technology.reducers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface TechnologyState {
}

export const initialState = {
technologyList: null,
technologyList: { items: [] },
isLoading: false,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
6 changes: 3 additions & 3 deletions src/app/modules/time-clock/pages/time-clock.component.spec.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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
};
Expand All @@ -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
};
Expand Down