diff --git a/src/main/angular/src/app/app.component.less b/src/main/angular/src/app/app.component.less index 755d2e9..432091f 100644 --- a/src/main/angular/src/app/app.component.less +++ b/src/main/angular/src/app/app.component.less @@ -8,7 +8,7 @@ } .itemActive { - background-color: palegreen; + background-color: lightblue; } } diff --git a/src/main/angular/src/app/app.module.ts b/src/main/angular/src/app/app.module.ts index b6882ab..3094896 100644 --- a/src/main/angular/src/app/app.module.ts +++ b/src/main/angular/src/app/app.module.ts @@ -7,7 +7,6 @@ import {HttpClientModule} from "@angular/common/http"; import {FormsModule} from "@angular/forms"; import {EditFieldComponent} from './shared/edit-field/edit-field.component'; import {ScheduleListComponent} from './pages/schedule-list/schedule-list.component'; -import {ToggleSwitchComponent} from './shared/toggle-switch/toggle-switch.component'; import {FontAwesomeModule} from '@fortawesome/angular-fontawesome'; import {NumberComponent} from './shared/number/number.component'; @@ -16,7 +15,6 @@ import {NumberComponent} from './shared/number/number.component'; AppComponent, EditFieldComponent, ScheduleListComponent, - ToggleSwitchComponent, NumberComponent, ], imports: [ diff --git a/src/main/angular/src/app/pages/schedule-list/schedule-list.component.html b/src/main/angular/src/app/pages/schedule-list/schedule-list.component.html index 85e72ba..8948903 100644 --- a/src/main/angular/src/app/pages/schedule-list/schedule-list.component.html +++ b/src/main/angular/src/app/pages/schedule-list/schedule-list.component.html @@ -1,19 +1,21 @@ + + + + + + + - - + - - - + + - - - + + @@ -27,35 +29,18 @@ - - - - - - - - - + + + + + + + + @@ -97,7 +82,7 @@
  
- -
{{schedule.name}}
  Mo Di MiUnschärfe Nächste Ausführung
- - - - - - - - - - - - - - - - - @@ -64,7 +49,7 @@ - - : - - diff --git a/src/main/angular/src/app/pages/schedule-list/schedule-list.component.less b/src/main/angular/src/app/pages/schedule-list/schedule-list.component.less index b63beec..da84fc9 100644 --- a/src/main/angular/src/app/pages/schedule-list/schedule-list.component.less +++ b/src/main/angular/src/app/pages/schedule-list/schedule-list.component.less @@ -1,4 +1,3 @@ - select { background-color: transparent; border-width: 0; @@ -7,14 +6,24 @@ select { font-family: monospace; } +th { + background-color: lightblue; +} + tr.blank { + th, td { border: none; } + } -th { - background-color: palegreen; +tr.header { + + th:not(:first-child), td:not(:first-child) { + border: none; + } + } .empty { @@ -27,6 +36,14 @@ th { text-align: center; } +.true { + background-color: palegreen; +} + +.false { + background-color: indianred; +} + .number { text-align: right; } diff --git a/src/main/angular/src/app/pages/schedule-list/schedule-list.component.ts b/src/main/angular/src/app/pages/schedule-list/schedule-list.component.ts index 1fa3d7e..7f59fac 100644 --- a/src/main/angular/src/app/pages/schedule-list/schedule-list.component.ts +++ b/src/main/angular/src/app/pages/schedule-list/schedule-list.component.ts @@ -3,6 +3,7 @@ import {ScheduleService} from "../../api/schedule/schedule.service"; import {Schedule} from "../../api/schedule/Schedule"; import {ScheduleEntry} from "../../api/schedule/entry/ScheduleEntry"; import {ScheduleEntryService} from "../../api/schedule/entry/schedule-entry.service"; +import {faCheck, faTimes} from '@fortawesome/free-solid-svg-icons'; @Component({ selector: 'app-schedule-list', @@ -11,6 +12,8 @@ import {ScheduleEntryService} from "../../api/schedule/entry/schedule-entry.serv }) export class ScheduleListComponent implements OnInit { + readonly faCheck = faCheck; + readonly faTimes = faTimes; readonly Schedule = Schedule; schedules: Schedule[] = []; @@ -26,12 +29,12 @@ export class ScheduleListComponent implements OnInit { this.scheduleService.findAll(schedules => this.schedules = schedules, Schedule.compareName); } - scheduleUpdate(schedule: Schedule, key: string, value: any): void { - this.scheduleService.set(schedule, key, value, schedule => this.updateSchedule(schedule)); - } - - entryUpdate(schedule: Schedule, entry: ScheduleEntry, key: string, value: any): void { - this.scheduleEntryService.set(entry, key, value, entry => this.updateEntry(schedule, entry)); + set(schedule: Schedule, entry: ScheduleEntry, key: string, value: any): void { + if (entry) { + this.scheduleEntryService.set(entry, key, value, entry => this.updateEntry(schedule, entry)); + } else { + this.scheduleService.set(schedule, key, value, schedule => this.updateSchedule(schedule)); + } } private updateSchedule(schedule: Schedule): void { diff --git a/src/main/angular/src/app/shared/toggle-switch/toggle-switch.component.html b/src/main/angular/src/app/shared/toggle-switch/toggle-switch.component.html deleted file mode 100644 index 2f89c8c..0000000 --- a/src/main/angular/src/app/shared/toggle-switch/toggle-switch.component.html +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/src/main/angular/src/app/shared/toggle-switch/toggle-switch.component.less b/src/main/angular/src/app/shared/toggle-switch/toggle-switch.component.less deleted file mode 100644 index e69de29..0000000 diff --git a/src/main/angular/src/app/shared/toggle-switch/toggle-switch.component.spec.ts b/src/main/angular/src/app/shared/toggle-switch/toggle-switch.component.spec.ts deleted file mode 100644 index 7980f8d..0000000 --- a/src/main/angular/src/app/shared/toggle-switch/toggle-switch.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {ComponentFixture, TestBed} from '@angular/core/testing'; - -import {ToggleSwitchComponent} from './toggle-switch.component'; - -describe('ToggleSwitchComponent', () => { - let component: ToggleSwitchComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ToggleSwitchComponent] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(ToggleSwitchComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/main/angular/src/app/shared/toggle-switch/toggle-switch.component.ts b/src/main/angular/src/app/shared/toggle-switch/toggle-switch.component.ts deleted file mode 100644 index 3c174d0..0000000 --- a/src/main/angular/src/app/shared/toggle-switch/toggle-switch.component.ts +++ /dev/null @@ -1,40 +0,0 @@ -import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; - -import {faCheck, faTimes} from '@fortawesome/free-solid-svg-icons'; - -@Component({ - selector: 'app-toggle-switch', - templateUrl: './toggle-switch.component.html', - styleUrls: ['./toggle-switch.component.less'] -}) -export class ToggleSwitchComponent implements OnInit { - - faCheck = faCheck; - faTimes = faTimes; - - @Input() - initial!: boolean; - - @Input() - active: string = "Aktiv"; - - @Input() - inactive: string = "Inaktiv"; - - @Output() - onChange: EventEmitter = new EventEmitter(); - - value!: boolean; - - constructor() { - } - - ngOnInit(): void { - this.value = this.initial; - } - - toggle(): void { - this.onChange.emit(!this.initial); - } - -}