diff --git a/src/main/angular/src/app/api/area/area.service.spec.ts b/src/main/angular/src/app/api/area/area.service.spec.ts deleted file mode 100644 index 746b0f2..0000000 --- a/src/main/angular/src/app/api/area/area.service.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import {TestBed} from '@angular/core/testing'; - -import {AreaService} from './area.service'; - -describe('AreaService', () => { - let service: AreaService; - - beforeEach(() => { - TestBed.configureTestingModule({}); - service = TestBed.inject(AreaService); - }); - - it('should be created', () => { - expect(service).toBeTruthy(); - }); -}); diff --git a/src/main/angular/src/app/api/channel/channel.service.spec.ts b/src/main/angular/src/app/api/channel/channel.service.spec.ts deleted file mode 100644 index 9167918..0000000 --- a/src/main/angular/src/app/api/channel/channel.service.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import {TestBed} from '@angular/core/testing'; - -import {ChannelService} from './channel.service'; - -describe('ChannelService', () => { - let service: ChannelService; - - beforeEach(() => { - TestBed.configureTestingModule({}); - service = TestBed.inject(ChannelService); - }); - - it('should be created', () => { - expect(service).toBeTruthy(); - }); -}); diff --git a/src/main/angular/src/app/api/device/device.service.spec.ts b/src/main/angular/src/app/api/device/device.service.spec.ts deleted file mode 100644 index 0a1f82a..0000000 --- a/src/main/angular/src/app/api/device/device.service.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import {TestBed} from '@angular/core/testing'; - -import {DeviceService} from './device.service'; - -describe('DeviceService', () => { - let service: DeviceService; - - beforeEach(() => { - TestBed.configureTestingModule({}); - service = TestBed.inject(DeviceService); - }); - - it('should be created', () => { - expect(service).toBeTruthy(); - }); -}); diff --git a/src/main/angular/src/app/api/property/property.service.spec.ts b/src/main/angular/src/app/api/property/property.service.spec.ts deleted file mode 100644 index d3f54bc..0000000 --- a/src/main/angular/src/app/api/property/property.service.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import {TestBed} from '@angular/core/testing'; - -import {PropertyService} from './property.service'; - -describe('PropertyService', () => { - let service: PropertyService; - - beforeEach(() => { - TestBed.configureTestingModule({}); - service = TestBed.inject(PropertyService); - }); - - it('should be created', () => { - expect(service).toBeTruthy(); - }); -}); diff --git a/src/main/angular/src/app/api/room/room.service.spec.ts b/src/main/angular/src/app/api/room/room.service.spec.ts deleted file mode 100644 index 627f402..0000000 --- a/src/main/angular/src/app/api/room/room.service.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import {TestBed} from '@angular/core/testing'; - -import {RoomService} from './room.service'; - -describe('RoomService', () => { - let service: RoomService; - - beforeEach(() => { - TestBed.configureTestingModule({}); - service = TestBed.inject(RoomService); - }); - - it('should be created', () => { - expect(service).toBeTruthy(); - }); -}); diff --git a/src/main/angular/src/app/api/scene/scene.service.spec.ts b/src/main/angular/src/app/api/scene/scene.service.spec.ts deleted file mode 100644 index ce6d35f..0000000 --- a/src/main/angular/src/app/api/scene/scene.service.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import {TestBed} from '@angular/core/testing'; - -import {SceneService} from './scene.service'; - -describe('SceneService', () => { - let service: SceneService; - - beforeEach(() => { - TestBed.configureTestingModule({}); - service = TestBed.inject(SceneService); - }); - - it('should be created', () => { - expect(service).toBeTruthy(); - }); -}); diff --git a/src/main/angular/src/app/api/schedule/entry/schedule-entry.service.spec.ts b/src/main/angular/src/app/api/schedule/entry/schedule-entry.service.spec.ts deleted file mode 100644 index 42d8de7..0000000 --- a/src/main/angular/src/app/api/schedule/entry/schedule-entry.service.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import {TestBed} from '@angular/core/testing'; - -import {ScheduleEntryService} from './schedule-entry.service'; - -describe('ScheduleEntryService', () => { - let service: ScheduleEntryService; - - beforeEach(() => { - TestBed.configureTestingModule({}); - service = TestBed.inject(ScheduleEntryService); - }); - - it('should be created', () => { - expect(service).toBeTruthy(); - }); -}); diff --git a/src/main/angular/src/app/api/schedule/schedule.service.spec.ts b/src/main/angular/src/app/api/schedule/schedule.service.spec.ts deleted file mode 100644 index 7eabf6f..0000000 --- a/src/main/angular/src/app/api/schedule/schedule.service.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import {TestBed} from '@angular/core/testing'; - -import {ScheduleService} from './schedule.service'; - -describe('ScheduleService', () => { - let service: ScheduleService; - - beforeEach(() => { - TestBed.configureTestingModule({}); - service = TestBed.inject(ScheduleService); - }); - - it('should be created', () => { - expect(service).toBeTruthy(); - }); -}); diff --git a/src/main/angular/src/app/api/schedule/schedule.service.ts b/src/main/angular/src/app/api/schedule/schedule.service.ts index ae8265a..c757906 100644 --- a/src/main/angular/src/app/api/schedule/schedule.service.ts +++ b/src/main/angular/src/app/api/schedule/schedule.service.ts @@ -1,6 +1,8 @@ import {Injectable} from '@angular/core'; import {ApiService, NO_OP} from "../api.service"; import {Schedule} from "./Schedule"; +import {Next} from "../types"; +import {Update} from "../Update"; @Injectable({ providedIn: 'root' @@ -33,4 +35,8 @@ export class ScheduleService { this.api.getReturnItem("schedule/delete/" + schedule.id, _ => _, next, error); } + subscribe(next: Next>): void { + this.api.subscribe("ScheduleDto", Schedule.fromJson, next); + } + } diff --git a/src/main/angular/src/app/data.service.spec.ts b/src/main/angular/src/app/data.service.spec.ts deleted file mode 100644 index cbde108..0000000 --- a/src/main/angular/src/app/data.service.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import {TestBed} from '@angular/core/testing'; - -import {DataService} from './data.service'; - -describe('DataService', () => { - let service: DataService; - - beforeEach(() => { - TestBed.configureTestingModule({}); - service = TestBed.inject(DataService); - }); - - it('should be created', () => { - expect(service).toBeTruthy(); - }); -}); diff --git a/src/main/angular/src/app/data.service.ts b/src/main/angular/src/app/data.service.ts index b813f58..2d25244 100644 --- a/src/main/angular/src/app/data.service.ts +++ b/src/main/angular/src/app/data.service.ts @@ -1,5 +1,4 @@ import {Injectable} from '@angular/core'; -import {Schedule} from "./api/schedule/Schedule"; import {Device} from "./api/device/Device"; @Injectable({ @@ -7,16 +6,6 @@ import {Device} from "./api/device/Device"; }) export class DataService { - private _schedule?: Schedule; - - get schedule(): Schedule | undefined { - return this._schedule; - } - - set schedule(schedule: Schedule | undefined) { - this._schedule = schedule; - } - private _device?: Device; get device(): Device | undefined { diff --git a/src/main/angular/src/app/pages/bulk/bulk-list/bulk-list.component.spec.ts b/src/main/angular/src/app/pages/bulk/bulk-list/bulk-list.component.spec.ts deleted file mode 100644 index 3dda216..0000000 --- a/src/main/angular/src/app/pages/bulk/bulk-list/bulk-list.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {ComponentFixture, TestBed} from '@angular/core/testing'; - -import {BulkListComponent} from './bulk-list.component'; - -describe('BulkListComponent', () => { - let component: BulkListComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [BulkListComponent] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(BulkListComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/main/angular/src/app/pages/bulk/bulk/bulk.component.spec.ts b/src/main/angular/src/app/pages/bulk/bulk/bulk.component.spec.ts deleted file mode 100644 index 607ae11..0000000 --- a/src/main/angular/src/app/pages/bulk/bulk/bulk.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {ComponentFixture, TestBed} from '@angular/core/testing'; - -import {BulkComponent} from './bulk.component'; - -describe('BulkComponent', () => { - let component: BulkComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [BulkComponent] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(BulkComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/main/angular/src/app/pages/channel-list/channel-list.component.spec.ts b/src/main/angular/src/app/pages/channel-list/channel-list.component.spec.ts deleted file mode 100644 index 6adc500..0000000 --- a/src/main/angular/src/app/pages/channel-list/channel-list.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {ComponentFixture, TestBed} from '@angular/core/testing'; - -import {ChannelListComponent} from './channel-list.component'; - -describe('ChannelListComponent', () => { - let component: ChannelListComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ChannelListComponent] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(ChannelListComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/main/angular/src/app/pages/device-all-list/device-all-list.component.spec.ts b/src/main/angular/src/app/pages/device-all-list/device-all-list.component.spec.ts deleted file mode 100644 index d7e6234..0000000 --- a/src/main/angular/src/app/pages/device-all-list/device-all-list.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {ComponentFixture, TestBed} from '@angular/core/testing'; - -import {DeviceAllListComponent} from './device-all-list.component'; - -describe('DeviceAllListComponent', () => { - let component: DeviceAllListComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [DeviceAllListComponent] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(DeviceAllListComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/main/angular/src/app/pages/device/device.component.spec.ts b/src/main/angular/src/app/pages/device/device.component.spec.ts deleted file mode 100644 index 4d215e8..0000000 --- a/src/main/angular/src/app/pages/device/device.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {ComponentFixture, TestBed} from '@angular/core/testing'; - -import {DeviceComponent} from './device.component'; - -describe('DeviceComponent', () => { - let component: DeviceComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [DeviceComponent] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(DeviceComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/main/angular/src/app/pages/mobile/device-tree/area-list/area-list.component.spec.ts b/src/main/angular/src/app/pages/mobile/device-tree/area-list/area-list.component.spec.ts deleted file mode 100644 index a6dac34..0000000 --- a/src/main/angular/src/app/pages/mobile/device-tree/area-list/area-list.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {ComponentFixture, TestBed} from '@angular/core/testing'; - -import {AreaListComponent} from './area-list.component'; - -describe('AreaListComponent', () => { - let component: AreaListComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [AreaListComponent] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(AreaListComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/main/angular/src/app/pages/mobile/device-tree/device-list/device-list.component.spec.ts b/src/main/angular/src/app/pages/mobile/device-tree/device-list/device-list.component.spec.ts deleted file mode 100644 index 764bbb8..0000000 --- a/src/main/angular/src/app/pages/mobile/device-tree/device-list/device-list.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {ComponentFixture, TestBed} from '@angular/core/testing'; - -import {DeviceListComponent} from './device-list.component'; - -describe('DeviceListComponent', () => { - let component: DeviceListComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [DeviceListComponent] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(DeviceListComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/main/angular/src/app/pages/mobile/device-tree/room-list/room-list.component.spec.ts b/src/main/angular/src/app/pages/mobile/device-tree/room-list/room-list.component.spec.ts deleted file mode 100644 index 69176f8..0000000 --- a/src/main/angular/src/app/pages/mobile/device-tree/room-list/room-list.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {ComponentFixture, TestBed} from '@angular/core/testing'; - -import {RoomListComponent} from './room-list.component'; - -describe('RoomListComponent', () => { - let component: RoomListComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [RoomListComponent] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(RoomListComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/main/angular/src/app/pages/property-list/property-list.component.spec.ts b/src/main/angular/src/app/pages/property-list/property-list.component.spec.ts deleted file mode 100644 index 9c4d429..0000000 --- a/src/main/angular/src/app/pages/property-list/property-list.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {ComponentFixture, TestBed} from '@angular/core/testing'; - -import {PropertyListComponent} from './property-list.component'; - -describe('PropertyListComponent', () => { - let component: PropertyListComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [PropertyListComponent] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(PropertyListComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/main/angular/src/app/pages/schedule-list/schedule-list.component.spec.ts b/src/main/angular/src/app/pages/schedule-list/schedule-list.component.spec.ts deleted file mode 100644 index 8f5cad8..0000000 --- a/src/main/angular/src/app/pages/schedule-list/schedule-list.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {ComponentFixture, TestBed} from '@angular/core/testing'; - -import {ScheduleListComponent} from './schedule-list.component'; - -describe('ScheduleListComponent', () => { - let component: ScheduleListComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ScheduleListComponent] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(ScheduleListComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/main/angular/src/app/pages/schedule/schedule.component.spec.ts b/src/main/angular/src/app/pages/schedule/schedule.component.spec.ts deleted file mode 100644 index c841428..0000000 --- a/src/main/angular/src/app/pages/schedule/schedule.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {ComponentFixture, TestBed} from '@angular/core/testing'; - -import {ScheduleComponent} from './schedule.component'; - -describe('ScheduleComponent', () => { - let component: ScheduleComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ScheduleComponent] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(ScheduleComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/main/angular/src/app/pages/schedule/schedule.component.ts b/src/main/angular/src/app/pages/schedule/schedule.component.ts index 806cb16..efe8287 100644 --- a/src/main/angular/src/app/pages/schedule/schedule.component.ts +++ b/src/main/angular/src/app/pages/schedule/schedule.component.ts @@ -5,7 +5,6 @@ import {ScheduleEntry} from "../../api/schedule/entry/ScheduleEntry"; import {ScheduleEntryService} from "../../api/schedule/entry/schedule-entry.service"; import {faCheckCircle, faCircle, faTimesCircle} from '@fortawesome/free-regular-svg-icons'; import {ActivatedRoute} from "@angular/router"; -import {DataService} from "../../data.service"; import {PropertyService} from "../../api/property/property.service"; import {Scene} from "../../api/scene/Scene"; import {SceneService} from "../../api/scene/scene.service"; @@ -37,20 +36,17 @@ export class ScheduleComponent implements OnInit { readonly propertyService: PropertyService, readonly bulkService: BulkService, readonly sceneService: SceneService, - readonly dataService: DataService, ) { // nothing } ngOnInit(): void { - this.dataService.schedule = undefined; this.sceneService.findAll(scenes => this.scenes = scenes); this.activatedRoute.params.subscribe(params => this.scheduleService.getById(params['id'], schedule => this.setSchedule(schedule))); } private setSchedule(schedule: Schedule): void { this.schedule = schedule; - this.dataService.schedule = schedule; } set(entry: ScheduleEntry | null, key: string, value: any): void {