timemanager/frontend/src/app/app.module.ts
2023-10-29 17:53:47 +01:00

182 lines
8.5 KiB
TypeScript

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import {LoginComponent} from "./auth/login/login.component";
import {FormsModule, ReactiveFormsModule} from "@angular/forms";
import {HttpClient, HttpClientModule, HttpHandler} from "@angular/common/http";
import {ApiModule, Configuration} from "../api";
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import {MatToolbarModule} from "@angular/material/toolbar";
import {MatIconModule} from "@angular/material/icon";
import {MatDialogModule as MatDialogModule} from "@angular/material/dialog";
import {MatFormFieldModule as MatFormFieldModule} from "@angular/material/form-field";
import {MatInputModule as MatInputModule} from "@angular/material/input";
import {MatProgressSpinnerModule as MatProgressSpinnerModule} from "@angular/material/progress-spinner";
import {MatSnackBar as MatSnackBar, MatSnackBarModule as MatSnackBarModule} from "@angular/material/snack-bar";
import { AdminDashboardComponent } from './admin-dashboard/admin-dashboard.component';
import { MainComponent } from './main/main.component';
import { UsermanagementComponent } from './admin-dashboard/usermanagement/usermanagement.component';
import {AuthService} from "./auth.service";
import {environment} from "../environments/environment";
import { DeleteConfirmationComponent } from './admin-dashboard/usermanagement/delete-confirmation/delete-confirmation.component';
import { EditComponent } from './admin-dashboard/usermanagement/edit/edit.component';
import {UserSettingsComponent} from "./user-settings/user-settings.component";
import {AccountSettingsComponent} from "./user-settings/account-settings/account-settings.component";
import { ChangePasswordComponent } from './user-settings/account-settings/change-password/change-password.component';
import { ManageEmailComponent } from './user-settings/account-settings/manage-email/manage-email.component';
import { DeleteAccountComponent } from './user-settings/account-settings/delete-account/delete-account.component';
import { RegistrationComponent } from './auth/registration/registration.component';
import { SettingsComponent } from './admin-dashboard/settings/settings.component';
import { TaskgroupDashboardComponent } from './taskgroups/taskgroup-dashboard/taskgroup-dashboard.component';
import { TaskgroupCreationComponent } from './taskgroups/taskgroup-creation/taskgroup-creation.component';
import { TaskgroupDeletionComponent } from './taskgroups/taskgroup-deletion/taskgroup-deletion.component';
import { TaskEditorComponent } from './tasks/task-editor/task-editor.component';
import {MatDatepickerModule} from "@angular/material/datepicker";
import {MatButtonModule} from "@angular/material/button";
import {MatMenuModule} from "@angular/material/menu";
import {MatTabsModule} from "@angular/material/tabs";
import {MatTableModule} from "@angular/material/table";
import {MatCheckboxModule} from "@angular/material/checkbox";
import {MatCardModule} from "@angular/material/card";
import {MatListModule} from "@angular/material/list";
import {MAT_DATE_FORMATS, MAT_DATE_LOCALE, MatNativeDateModule} from "@angular/material/core";
import {MatMomentDateModule, MomentDateModule} from "@angular/material-moment-adapter";
import { TaskDashboardComponent } from './tasks/task-dashboard/task-dashboard.component';
import {MatSlideToggleModule} from "@angular/material/slide-toggle";
import {MatSortModule} from "@angular/material/sort";
import {MatPaginatorModule} from "@angular/material/paginator";
import { ClearTaskDialogComponent } from './tasks/clear-task-dialog/clear-task-dialog.component';
import { NavigationLinkListComponent } from './navigation-link-list/navigation-link-list.component';
import { TaskDetailOverviewComponent } from './tasks/task-detail-overview/task-detail-overview.component';
import {MatProgressBarModule} from "@angular/material/progress-bar";
import {MatExpansionModule} from "@angular/material/expansion";
import { SchedulerComponent } from './schedules/scheduler/scheduler.component';
import { CalendarModule, DateAdapter } from 'angular-calendar';
import { adapterFactory } from 'angular-calendar/date-adapters/date-fns';
import {MatSelectModule} from "@angular/material/select";
import { BasicSchedulerComponent } from './schedules/basic-scheduler/basic-scheduler.component';
import { ScheduleDashboardComponent } from './schedules/schedule-dashboard/schedule-dashboard.component';
import { DashboardComponent } from './dashboard/dashboard.component';
import { ActiveScheduleComponent } from './dashboard/active-schedule/active-schedule.component';
import {MatTreeModule} from "@angular/material/tree";
import { TaskgroupOverviewComponent } from './dashboard/taskgroup-overview/taskgroup-overview.component';
import { TaskOverviewComponent } from './dashboard/task-overview/task-overview.component';
import { ForgottenTaskStartDialogComponent } from './dashboard/forgotten-task-start-dialog/forgotten-task-start-dialog.component';
import {MatAutocompleteModule} from "@angular/material/autocomplete";
import { MissedSchedulesComponent } from './missed-schedules/missed-schedules.component';
import { MissedScheduleForgetConfirmationDialogComponent } from './missed-schedules/missed-schedule-forget-confirmation-dialog/missed-schedule-forget-confirmation-dialog.component';
import { OverdueTaskOverviewComponent } from './overdue-task-overview/overdue-task-overview.component';
import { UpcomingTaskOverviewComponent } from './upcoming-task-overview/upcoming-task-overview.component';
import { ActiveTaskOverviewComponent } from './active-task-overview/active-task-overview.component';
@NgModule({
declarations: [
AppComponent,
LoginComponent,
AdminDashboardComponent,
MainComponent,
UsermanagementComponent,
DeleteConfirmationComponent,
EditComponent,
UserSettingsComponent,
AccountSettingsComponent,
ChangePasswordComponent,
ManageEmailComponent,
DeleteAccountComponent,
RegistrationComponent,
SettingsComponent,
TaskgroupDashboardComponent,
TaskgroupCreationComponent,
TaskgroupDeletionComponent,
TaskEditorComponent,
TaskDashboardComponent,
ClearTaskDialogComponent,
NavigationLinkListComponent,
TaskDetailOverviewComponent,
SchedulerComponent,
BasicSchedulerComponent,
ScheduleDashboardComponent,
DashboardComponent,
ActiveScheduleComponent,
TaskgroupOverviewComponent,
TaskOverviewComponent,
ForgottenTaskStartDialogComponent,
MissedSchedulesComponent,
MissedScheduleForgetConfirmationDialogComponent,
OverdueTaskOverviewComponent,
UpcomingTaskOverviewComponent,
ActiveTaskOverviewComponent
],
imports: [
BrowserModule,
AppRoutingModule,
FormsModule,
ApiModule,
HttpClientModule,
BrowserAnimationsModule,
MatToolbarModule,
MatButtonModule,
MatIconModule,
MatDialogModule,
MatFormFieldModule,
MatInputModule,
MatProgressSpinnerModule,
MatSnackBarModule,
MatMenuModule,
MatTabsModule,
MatTableModule,
MatCheckboxModule,
MatCardModule,
ReactiveFormsModule,
MatListModule,
MatDatepickerModule,
MatInputModule,
MatDatepickerModule,
MatMomentDateModule,
FormsModule,
MatSlideToggleModule,
MatSortModule,
MatPaginatorModule,
MatProgressBarModule,
MatExpansionModule,
CalendarModule.forRoot({provide: DateAdapter, useFactory: adapterFactory}),
MatSelectModule,
MatTreeModule,
MatAutocompleteModule
],
providers: [
HttpClientModule,
/*
This is the configuration for the code generated by OpenApiGenerator.
It specifies that the API code should use our `AuthService` to get the currently stored
JWT token.
It also specifies where the base path (e.g. https://example.com/api/) for the api is.
*/
{
provide: Configuration,
useFactory: (authService: AuthService) => new Configuration(
{
credentials: {
// We bind the `getAccessToken` function. This means that
// the `this` instance in the `getAccessToken` function is bound to the singleton instance
// Angular injected. Else, the function would be called without context and would lose its
// context
"API_TOKEN": authService.getAccessToken.bind(authService)
},
//basePath: environment.api
}
),
deps: [AuthService],
multi: false
},
],
bootstrap: [AppComponent]
})
export class AppModule { }