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

110 lines
4.6 KiB
TypeScript
Raw Normal View History

2018-01-30 10:35:26 +01:00
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { BaseHttpService } from './utilities/cite-http-service-module/base-http.service';
import { DashboardService } from './services/dashboard/dashboard.service';
import { DatasetService } from './services/dataset/dataset.service';
import { AuthService } from './services/auth/auth.service';
import { AuthGuard } from './guards/auth.guard';
import { PaginationService } from './services/pagination.service';
import { VisibilityRulesService } from './visibility-rules/visibility-rules.service';
import { MaterialModule } from './shared/material/material.module';
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { AppRoutingModule } from './app-routing.module';
import { CommonModule } from '@angular/common';
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { HttpModule } from '@angular/http';
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-30 10:35:26 +01:00
import { DataManagementPlanModule } from './dmps/dmps.module';
import { DynamicFormModule } from './form/dynamic-form.module';
import { DatasetModule } from './datasets/dataset.module';
import { ProjectsModule } from './projects/projects.module';
import { SharedModule } from './shared/shared.module';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import { FigurecardComponent } from './shared/components/figurecard/figurecard.component';
2018-01-08 12:44:48 +01:00
import { InvitationAcceptedComponent } from './invitation-accepted/invitation-accepted.component';
2017-11-27 14:40:16 +01:00
import { HomepageComponent } from './homepage/homepage.component';
2018-01-30 10:35:26 +01:00
import { PageNotFoundComponent } from './not-found.component';
import { AppComponent } from './app.component';
import { NgModule } from "@angular/core";
import { DatasetProfileModule } from './dataset-profile-form/dataset-profile.module';
2018-02-02 15:07:25 +01:00
import { WelcomepageComponent } from '@app/welcomepage/welcomepage.component';
2018-02-16 08:45:18 +01:00
import { HelpContentService } from './services/help-content/help-content.service';
import { HelpContentComponent } from './help-content/help-content.component';
2018-02-23 11:36:51 +01:00
import { B2AccessLoginComponent } from './user-management/login/b2access/b2access-login.component';
2017-12-14 17:43:57 +01:00
@NgModule({
declarations: [
AppComponent,
2017-11-03 18:57:06 +01:00
PageNotFoundComponent,
2018-02-02 15:07:25 +01:00
HomepageComponent,
2018-02-16 08:45:18 +01:00
WelcomepageComponent,
2018-02-23 11:36:51 +01:00
HelpContentComponent,
B2AccessLoginComponent
],
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,
2018-02-23 11:36:51 +01:00
LoginOptions.twitterOauth,
LoginOptions.b2Access
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
},
2018-02-23 11:36:51 +01:00
twitterConfiguration: { clientId: "HiR4hQH9HNubKC5iKQy0l4mAZ", oauthUrl: "https://api.twitter.com/oauth/authenticate" },
b2accessConfiguration: {
clientId: "eudatdmptool",
clientSecret: "A3b*1*92",
2018-03-01 10:14:10 +01:00
oauthUrl: "https://b2access-integration.fz-juelich.de:443/oauth2-as/oauth2-authz",
2018-02-23 11:36:51 +01:00
redirectUri: "http://dmp.eudat.org:4200/api/oauth/authorized/b2access",
2018-03-01 10:14:10 +01:00
accessTokenUri: "https://b2access-integration.fz-juelich.de:443/oauth2/token"
2018-02-23 11:36:51 +01:00
}
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
AuthService,
DashboardService,
2018-02-16 08:45:18 +01:00
BaseHttpService,
HelpContentService
2017-11-27 14:40:16 +01:00
],
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');
}