[BP-841] Integrate cyclic reporting in app
Signed-off-by: Christopher Keim <keim@develop-group.de>
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index a8fa012..4cec9e7 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -1,14 +1,19 @@
/********************************************************************************
- * Copyright © 2018 Mettenmeier GmbH.
+ * Copyright © 2018 Mettenmeier GmbH and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Mettenmeier GmbH - initial implementation
+ * Basys GmbH - automatic report generation implementation
********************************************************************************/
+
import { BrowserModule } from '@angular/platform-browser';
-import { NgModule, ErrorHandler, LOCALE_ID } from '@angular/core';
+import { NgModule, ErrorHandler } from '@angular/core';
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { CoreModule } from '@core/core.module';
@@ -25,7 +30,7 @@
import { NgbDateStringParserFormatter } from '@shared/utils/dateFormatter.util';
import { ReportingModule } from '@reporting/reporting.module';
import { CustomDatepickerI18nService } from '@shared/utils/custom-datepicker-i18n.service';
-
+import { CyclicReportingModule } from '@cyclic-reporting/cyclic-reporting.module';
@NgModule({
declarations: [
@@ -39,7 +44,8 @@
StandbyScheduleModule,
HttpClientModule,
BrowserAnimationsModule,
- ReportingModule
+ ReportingModule,
+ CyclicReportingModule
],
providers: [
{
@@ -52,9 +58,13 @@
useClass: ErrorInterceptor,
},
{
- provide: NgbDateParserFormatter, useClass: NgbDateStringParserFormatter
+ provide: NgbDateParserFormatter,
+ useClass: NgbDateStringParserFormatter
},
- { provide: NgbDatepickerI18n, useClass: CustomDatepickerI18nService },
+ {
+ provide: NgbDatepickerI18n,
+ useClass: CustomDatepickerI18nService
+ },
MessageService
],
bootstrap: [AppComponent]
diff --git a/src/app/cyclic-reporting/cyclic-reporting-routing.module.ts b/src/app/cyclic-reporting/cyclic-reporting-routing.module.ts
new file mode 100644
index 0000000..feadb45
--- /dev/null
+++ b/src/app/cyclic-reporting/cyclic-reporting-routing.module.ts
@@ -0,0 +1,43 @@
+/********************************************************************************
+ * Copyright © 2020 Basys GmbH.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ ********************************************************************************/
+
+import {NgModule} from '@angular/core';
+import {RouterModule, Routes} from '@angular/router';
+import {AuthGuard} from '@core/guards/auth.guard';
+import {RoleGuard} from '@core/guards/role.guard';
+import {CyclicReportFormComponent} from './components/form/cyclic-report-form.component';
+import {CyclicReportsOverviewComponent} from './components/overview/cyclic-reports-overview.component';
+
+const routes: Routes = [
+ {
+ path: 'zyklische-reports',
+ component: CyclicReportsOverviewComponent,
+ canActivate: [AuthGuard, RoleGuard],
+ data: {
+ expectedRoles: ['BP_Admin']
+ }
+ },
+ {
+ path: 'zyklische-reports/:id',
+ component: CyclicReportFormComponent,
+ canActivate: [AuthGuard, RoleGuard],
+ data: {
+ expectedRoles: ['BP_Admin']
+ }
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class CyclicReportingRoutingModule {
+
+}
diff --git a/src/app/cyclic-reporting/cyclic-reporting.module.ts b/src/app/cyclic-reporting/cyclic-reporting.module.ts
new file mode 100644
index 0000000..f6ee83b
--- /dev/null
+++ b/src/app/cyclic-reporting/cyclic-reporting.module.ts
@@ -0,0 +1,44 @@
+/********************************************************************************
+ * Copyright © 2020 Basys GmbH.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ ********************************************************************************/
+
+import {CommonModule} from '@angular/common';
+import {NgModule} from '@angular/core';
+import {RouterModule} from '@angular/router';
+import {SharedModule} from '@shared/shared.module';
+import {CyclicReportFormComponent} from './components/form/cyclic-report-form.component';
+import {CyclicReportFormDateControlsComponent} from './components/form-date-controls/cyclic-report-form-date-controls.component';
+import {CyclicReportFormInfoComponent} from './components/form-info/cyclic-report-form-info.component';
+import {CyclicReportFormInputComponent} from './components/form-input/cyclic-report-form-input.component';
+import {CyclicReportFormSelectComponent} from './components/form-select/cyclic-report-form-select.component';
+import {CyclicReportsOverviewComponent} from './components/overview/cyclic-reports-overview.component';
+import {CyclicReportFormTextareaComponent} from './components/form-textarea/cyclic-report-form-textarea.component';
+import {CyclicReportingRoutingModule} from './cyclic-reporting-routing.module';
+
+@NgModule({
+ imports: [
+ CommonModule,
+ RouterModule,
+
+ CyclicReportingRoutingModule,
+ SharedModule
+ ],
+ declarations: [
+ CyclicReportFormComponent,
+ CyclicReportFormDateControlsComponent,
+ CyclicReportFormInfoComponent,
+ CyclicReportFormInputComponent,
+ CyclicReportFormSelectComponent,
+ CyclicReportFormTextareaComponent,
+ CyclicReportsOverviewComponent
+ ]
+})
+export class CyclicReportingModule {
+
+}