argos/dmp-frontend/src/app/app.module.ts

155 lines
7.3 KiB
TypeScript
Raw Normal View History

2018-01-10 17:05:23 +01:00
import { HostConfiguration } from './app.constants';
import { LoginOptions } from './user-management/utilties/LoginOptions';
import { LoginModule } from './user-management/login.module';
2018-01-08 12:44:48 +01:00
import { InvitationAcceptedComponent } from './invitation-accepted/invitation-accepted.component';
2018-01-05 16:40:19 +01:00
import { InvitationComponent } from './invitation/invitation.component';
2017-12-19 09:38:47 +01:00
import { UnauthorizedComponent } from './unauthorized/unauthorized.component';
2017-12-06 17:45:54 +01:00
import { PaginationService } from './form/pagination/pagination-service';
2017-12-20 09:17:13 +01:00
import { TableOfContentsFieldComponent } from './form/tableOfContents/table-of-content-field/table-of-content-field.component';
2017-12-05 17:56:21 +01:00
import { ProgressBarComponent } from './form/pprogress-bar/progress-bar.component';
2017-12-20 09:17:13 +01:00
import { TableOfContentsSectionComponent } from './form/tableOfContents/table-of-content-section/table-of-content-section.component';
import { TableOfContentsGroupComponent } from './form/tableOfContents/table-of-content-group/table-of-content-group.component';
import { TableOfContentsFieldSetComponent } from './form/tableOfContents/table-of-content-fieldset/table-of-content-fieldset.component';
2017-12-05 17:56:21 +01:00
import { TableOfContentsComponent } from './form/tableOfContents/table-of-contents.component';
2017-12-20 09:17:13 +01:00
import { DynamicFieldRadioBoxComponent } from './form/dynamic-fields/dynamic-field-radiobox/dynamic-field-radiobox.component';
import { DynamicFieldBooleanDecisionComponent } from './form/dynamic-fields/dynamic-field-boolean-decision/dynamic-field-boolean-decision.component';
2017-11-27 14:40:16 +01:00
import { AutocompleteRemoteComponent } from './form/dynamic-fields/dynamic-field-autocomplete/autocomplete-remote.component';
import { DynamicFieldDropdownComponent } from './form/dynamic-fields/dynamic-field-dropdown/dynamic-field-dropdown';
import { DynamicFieldCheckBoxComponent } from './form/dynamic-fields/dynamic-field-checkbox/dynamic-field-checkbox';
2017-11-23 12:26:22 +01:00
import { VisibilityRulesService } from './visibility-rules/visibility-rules.service';
import { DynamicFormSectionComponent } from './form/dynamic-form-section/dynamic-form-section';
import { DynamicFormCompositeFieldComponent } from './form/dynamic-form-composite-field/dynamic-form-composite-field';
import { BrowserModule } from '@angular/platform-browser';
2017-11-10 10:53:01 +01:00
import { NgModule, forwardRef } from '@angular/core';
import { FormsModule, ReactiveFormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
2017-12-14 11:41:26 +01:00
import { HttpClientModule, HttpClient } from '@angular/common/http';
import { HttpModule } from '@angular/http';
2017-09-26 17:16:04 +02:00
import { RouterModule, Routes, Router } from '@angular/router';
import { AppComponent } from './app.component';
import { DynamicFormComponent } from './form/dynamic-form.component';
2017-11-27 14:40:16 +01:00
import { DynamicFormFieldComponent } from './form/dynamic-fields/dynamic-form-field.component';
import { DynamicFormGroupComponent } from './form/dynamic-form-group/dynamic-form-group.component';
2017-11-27 14:40:16 +01:00
import { AppRoutingModule } from './app-routing.module';
2017-09-26 17:16:04 +02:00
import { AuthGuard } from './guards/auth.guard';
2017-11-27 14:40:16 +01:00
import { PageNotFoundComponent } from './not-found.component';
import { HomepageComponent } from './homepage/homepage.component';
2017-10-27 10:34:05 +02:00
import { HTTP_INTERCEPTORS } from '@angular/common/http';
2017-11-27 14:40:16 +01:00
import { CommonModule } from '@angular/common';
2017-11-03 18:57:06 +01:00
2017-12-14 11:41:26 +01:00
import { TranslateModule } from '@ngx-translate/core';
import { TranslateLoader } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { SharedModule } from './shared/shared.module';
import { MaterialModule } from './shared/material/material.module';
import { AuthService } from './services/auth/auth.service';
2017-12-14 18:13:28 +01:00
import { ProjectListingComponent } from './projects/project-listing.component';
2017-12-15 12:52:11 +01:00
import { DashboardService } from './services/dashboard/dashboard.service';
2017-12-15 16:33:18 +01:00
import { DatasetService } from './services/dataset/dataset.service';
2017-12-14 18:13:28 +01:00
import { BaseHttpService } from './utilities/cite-http-service-module/base-http.service';
import { DataManagementPlanListingComponent } from './dmps/dmp-listing.component';
import { ProjectEditorComponent } from './projects/editor/project-editor.component';
import { DataManagementPlanEditorComponent } from './dmps/editor/dmp-editor.component';
2017-12-19 18:34:00 +01:00
import { FigurecardComponent } from './shared/components/figurecard/figurecard.component';
2017-12-20 09:17:13 +01:00
import { DatasetListingComponent } from './datasets/dataset-listing.component';
import { DatasetEditorComponent } from './datasets/editor/dataset-editor.component';
import { DatasetWizardComponent } from './dataset-wizard/dataset-wizard.component';
2017-12-20 14:34:32 +01:00
import { AutocompleteComponent } from './shared/components/autocomplete/autocomplete.component';
2017-12-14 17:43:57 +01:00
@NgModule({
declarations: [
AppComponent,
DynamicFormComponent,
DynamicFormFieldComponent,
2017-09-26 17:16:04 +02:00
DynamicFormGroupComponent,
2017-11-23 12:26:22 +01:00
DynamicFormCompositeFieldComponent,
2017-11-27 14:40:16 +01:00
DynamicFieldBooleanDecisionComponent,
DynamicFieldRadioBoxComponent,
2017-12-05 17:56:21 +01:00
TableOfContentsComponent,
TableOfContentsFieldSetComponent,
TableOfContentsGroupComponent,
TableOfContentsSectionComponent,
2017-11-03 18:57:06 +01:00
PageNotFoundComponent,
HomepageComponent,
2017-12-14 18:13:28 +01:00
ProjectListingComponent,
2017-12-15 16:33:18 +01:00
DatasetListingComponent,
2017-12-19 18:34:00 +01:00
DataManagementPlanListingComponent,
2017-11-08 11:35:56 +01:00
AutocompleteRemoteComponent,
2017-11-27 14:40:16 +01:00
DynamicFieldDropdownComponent,
2017-11-23 12:26:22 +01:00
DynamicFormSectionComponent,
2017-12-05 17:56:21 +01:00
TableOfContentsFieldComponent,
ProgressBarComponent,
2017-11-27 14:40:16 +01:00
DynamicFieldCheckBoxComponent,
2017-12-14 18:13:28 +01:00
ProjectEditorComponent,
DataManagementPlanEditorComponent,
2018-01-05 16:40:19 +01:00
InvitationComponent,
2018-01-08 12:44:48 +01:00
InvitationAcceptedComponent,
2017-12-20 09:17:13 +01:00
DatasetWizardComponent,
2017-12-19 13:47:08 +01:00
FigurecardComponent,
2017-12-20 14:34:32 +01:00
DatasetEditorComponent,
AutocompleteComponent
],
imports: [
BrowserModule,
ReactiveFormsModule,
2017-12-14 11:41:26 +01:00
SharedModule,
FormsModule,
2018-01-10 17:05:23 +01:00
LoginModule.forRoot({
loginProviders: [
LoginOptions.facebookOauth,
LoginOptions.googleOauth,
LoginOptions.nativeLogin,
2018-01-11 12:13:01 +01:00
LoginOptions.linkedInOauth,
LoginOptions.twitterOauth
2018-01-10 17:05:23 +01:00
],
facebookConfiguration: { clientId: "110586756143149" },
googleConfiguration: { clientId: '524432312250-sc9qsmtmbvlv05r44onl6l93ia3k9deo.apps.googleusercontent.com' },
linkedInConfiguration: {
clientId: "86bl8vfk77clh9",
oauthUrl: "https://www.linkedin.com/oauth/v2/authorization",
redirectUri: HostConfiguration.App + "login/linkedin",
accessTokenUri: "https://www.linkedin.com/oauth/v2/accessToken",
clientSecret: "2OCO9e3wKylW05Tt"
2018-01-11 12:13:01 +01:00
},
twitterConfiguration: { clientId: "HiR4hQH9HNubKC5iKQy0l4mAZ", oauthUrl: "https://api.twitter.com/oauth/authenticate" }
2018-01-10 17:05:23 +01:00
}),
HttpModule,
2017-09-26 17:16:04 +02:00
HttpClientModule,
2017-11-03 18:57:06 +01:00
CommonModule,
2017-10-18 14:50:12 +02:00
AppRoutingModule,
2017-12-05 17:56:21 +01:00
BrowserAnimationsModule,
2017-12-14 11:41:26 +01:00
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
}
}),
BrowserAnimationsModule,
MaterialModule
],
2017-12-19 15:09:49 +01:00
providers: [
2017-12-19 18:34:00 +01:00
VisibilityRulesService,
PaginationService,
AuthGuard,
AuthService,
DashboardService,
DatasetService,
2017-12-14 18:13:28 +01:00
BaseHttpService
2017-11-27 14:40:16 +01:00
],
2018-01-08 15:57:21 +01:00
entryComponents: [
InvitationComponent,
],
bootstrap: [AppComponent]
})
export class AppModule {
constructor() {
}
}
2017-12-14 11:41:26 +01:00
export function HttpLoaderFactory(httpClient: HttpClient) {
return new TranslateHttpLoader(httpClient, 'assets/lang/', '.json');
}