issue-92 #109

Merged
sebastian merged 4 commits from issue-92 into master 2024-03-17 13:21:28 +01:00
7 changed files with 165 additions and 0 deletions
Showing only changes of commit f921d1d222 - Show all commits

View File

@ -17,6 +17,7 @@ import {
} from "./dashboard/forgotten-task-start-dialog/forgotten-task-start-dialog.component";
import {TaskgroupActivityComponent} from "./statistics/taskgroup-activity/taskgroup-activity.component";
import {ScheduleHistoryComponent} from "./statistics/schedule-history/schedule-history.component";
import {UpcomingDeadlinesOverviewComponent} from "./upcoming-deadlines-overview/upcoming-deadlines-overview.component";
const routes: Routes = [
{path: '', component: MainComponent},
@ -35,6 +36,7 @@ const routes: Routes = [
{path: 'forgotten', component: ForgottenTaskStartDialogComponent},
{path: 'statistics/taskgroup-activity', component: TaskgroupActivityComponent},
{path: 'statistics/schedule-history', component: ScheduleHistoryComponent},
{path: 'deadlines', component: UpcomingDeadlinesOverviewComponent}
];
@NgModule({

View File

@ -6,10 +6,13 @@
<mat-menu #organizeMenu=matMenu>
<button mat-menu-item routerLink="taskgroups/" aria-label="Task groups">Taskgroups</button>
<button mat-menu-item routerLink="scheduler/" aria-label="Task groups">Scheduler</button>
<mat-divider></mat-divider>
<button mat-menu-item routerLink="active/" aria-label="Missed Schedules">Active Tasks</button>
<button mat-menu-item routerLink="upcoming/" aria-label="Upcoming Tasks">Upcoming Tasks</button>
<button mat-menu-item routerLink="overdue/" aria-label="Overdue Tasks">Overdue Tasks</button>
<button mat-menu-item routerLink="reschedule/" aria-label="Missed Schedules">Missed Schedules</button>
<mat-divider></mat-divider>
<button mat-menu-item routerLink="deadlines" aria-label="Upcoming Deadlines">Deadlines</button>
</mat-menu>
<mat-menu #statisticsMenu=matMenu>

View File

@ -94,6 +94,8 @@ import { NtfySettingsComponent } from './user-settings/connection-settings/ntfy-
import { TaskSeriesCreatorComponent } from './tasks/task-series-creator/task-series-creator.component';
import {MatStepperModule} from "@angular/material/stepper";
import { TaskWeeklySeriesCreatorComponent } from './tasks/task-weekly-series-creator/task-weekly-series-creator.component';
import { UpcomingDeadlinesOverviewComponent } from './upcoming-deadlines-overview/upcoming-deadlines-overview.component';
import {CommonModule} from "@angular/common";
@NgModule({
declarations: [
AppComponent,
@ -143,6 +145,7 @@ import { TaskWeeklySeriesCreatorComponent } from './tasks/task-weekly-series-cre
NtfySettingsComponent,
TaskSeriesCreatorComponent,
TaskWeeklySeriesCreatorComponent,
UpcomingDeadlinesOverviewComponent,
],
imports: [
BrowserModule,
@ -187,6 +190,7 @@ import { TaskWeeklySeriesCreatorComponent } from './tasks/task-weekly-series-cre
MatButtonToggleModule,
MatGridListModule,
MatStepperModule,
CommonModule
],
providers: [
HttpClientModule,

View File

@ -0,0 +1,54 @@
.container {
margin: 20px auto;
width: 70%;
}
.spacer {
margin-bottom: 2.5%;
}
@media screen and (max-width: 600px) {
.container {
width: 100%;
margin: 20px 10px;
}
}
.undecorated-link {
text-decoration: none;
color: black;
}
.undecorated-link:hover {
color: #3498db;
}
.cal-event-title {
color: black;
margin-left: 5px;
white-space: nowrap;
display: inline-block;
}
.cal-event-circle {
width: 10px; /* Beispielgröße für den Kreis */
height: 10px; /* Beispielgröße für den Kreis */
border-radius: 50%;
display: inline-block;
background-color: #1e90ff;
vertical-align: top; /* Vertikale Ausrichtung zentrieren */
}
.event {
display: block;
align-items: center;
margin-bottom: 10px;
}
.cal-cell-content {
width: calc(100% - 20px); /* Breite der Zelle abzüglich des linken Randes für den Titel */
}

View File

@ -0,0 +1,21 @@
<div class="container">
<app-navigation-link-list [navigationLinks]="defaultNavigationLinkPath"></app-navigation-link-list>
<ng-template #customCellTemplate let-day="day" let-locale="locale">
<div class="cal-cell-top">
<span class="cal-day-badge" *ngIf="day.badgeTotal > 0">{{ day.badgeTotal }}</span>
<span class="cal-day-number">{{ day.date | calendarDate:'monthViewDayNumber':locale }}</span>
</div>
<div class="cal-cell-content">
<div class="cal-events">
<div *ngFor="let event of day.events" class="event">
<div class="cal-event-circle"></div> <!-- Small circle -->
<div class="cal-event-title">{{ event.title }}</div> <!-- Event title -->
</div>
</div>
</div>
</ng-template>
<mwl-calendar-month-view [viewDate]="viewDate" [events]="events" [cellTemplate]="customCellTemplate" [refresh]="refresh"
></mwl-calendar-month-view>
</div>

View File

@ -0,0 +1,21 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { UpcomingDeadlinesOverviewComponent } from './upcoming-deadlines-overview.component';
describe('UpcomingDeadlinesOverviewComponent', () => {
let component: UpcomingDeadlinesOverviewComponent;
let fixture: ComponentFixture<UpcomingDeadlinesOverviewComponent>;
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [UpcomingDeadlinesOverviewComponent]
});
fixture = TestBed.createComponent(UpcomingDeadlinesOverviewComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,60 @@
import {ChangeDetectionStrategy, Component, OnInit} from '@angular/core';
import {NavigationLink} from "../navigation-link-list/navigation-link-list.component";
import {TaskService, TaskTaskgroupInfo} from "../../api";
import {CalendarEvent} from "angular-calendar";
import * as moment from "moment";
import {locale} from "moment";
import {Subject} from "rxjs";
@Component({
selector: 'app-upcoming-deadlines-overview',
templateUrl: './upcoming-deadlines-overview.component.html',
styleUrls: ['./upcoming-deadlines-overview.component.css'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class UpcomingDeadlinesOverviewComponent implements OnInit{
defaultNavigationLinkPath: NavigationLink[] = [
{
linkText: "Dashboard",
routerLink: ['/']
},
{
linkText: "Upcoming Deadlines",
routerLink: ["/deadlines"]
}
]
events: CalendarEvent[] = []
viewDate = new Date()
refresh: Subject<void> = new Subject<void>()
constructor(private taskService: TaskService) {
}
ngOnInit() {
this.taskService.tasksAllScopeDetailedGet("UNFINISHED", true).subscribe({
next: resp => {
resp.forEach(taskShortInfo => {
const task_taskgroupInfo = taskShortInfo as TaskTaskgroupInfo
this.events.push({
title: task_taskgroupInfo.taskName,
start: moment(task_taskgroupInfo.deadline).toDate(),
end: moment(task_taskgroupInfo.deadline).toDate(),
resizable: {
beforeStart: false,
afterEnd: false
},
draggable: false,
allDay: true,
color: {
primary: '#1e90ff',
secondary: '#D1E8FF',
}
})
})
this.refresh.next()
}
})
}
}