2019-07-15 14:54:19 +00:00
|
|
|
// angular modules
|
|
|
|
import { NgModule, APP_INITIALIZER, ModuleWithProviders, Injector } from '@angular/core';
|
|
|
|
import { CommonModule, DatePipe } from '@angular/common';
|
|
|
|
import { HttpClientModule, HttpClient, HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
|
|
import { FormsModule } from '@angular/forms';
|
|
|
|
|
|
|
|
// external modules
|
|
|
|
import { OAuthModule,AuthConfig, OAuthService, OAuthStorage } from 'angular-oauth2-oidc';
|
|
|
|
import { StoreModule,Store } from '@ngrx/store';
|
|
|
|
import { EffectsModule } from '@ngrx/effects';
|
|
|
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
2019-07-18 16:59:42 +00:00
|
|
|
import {UploadxModule } from 'ngx-uploadx';
|
2019-07-15 14:54:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
// routing module
|
|
|
|
import { AppCommonRoutingModule } from './common-routing.module';
|
|
|
|
|
|
|
|
import { MODULE_NAME } from './module-name';
|
|
|
|
|
|
|
|
//components
|
2019-08-08 11:59:07 +00:00
|
|
|
import { ItemTypeService } from './services/itemtype.service';
|
2019-07-15 14:54:19 +00:00
|
|
|
import { FolderService } from './services/folder.service';
|
|
|
|
import { TimespanService} from './services/timespan.service';
|
|
|
|
import { ItemService} from './services/item.service';
|
|
|
|
import { EventService } from './services/event.service';
|
|
|
|
import { TypeaheadService } from './services/typeahead.service';
|
|
|
|
import { UserService } from './services/user.service';
|
|
|
|
import { AppConfig } from './shared/app.config';
|
|
|
|
import { AccessTokenInterceptor } from "./shared/accesstoken.interceptor";
|
|
|
|
import { appConfigFactory } from "./shared/app.config.factory";
|
|
|
|
import { AuthGuard } from './services/auth-guard.service';
|
|
|
|
import { NavBarGuard } from './services/nav-bar-guard.service';
|
|
|
|
import { FullScreenGuard } from './services/full-screen-guard.service';
|
|
|
|
import { SafePipe } from './shared/safe.pipe';
|
|
|
|
import { AuthCallbackComponent } from './components/auth-callback/auth-callback.component';
|
|
|
|
import { AuthCallbackGuard } from './components/auth-callback/auth-callback.guard';
|
|
|
|
import { SessionClearedComponent } from './components/session-cleared/session-cleared.component';
|
|
|
|
import { ResumableFileUploadService } from './components/resumable-file-upload/resumable-file-upload.service';
|
|
|
|
import { ResumableFileUploadComponent } from './components/resumable-file-upload/resumable-file-upload.component';
|
|
|
|
import { NotFoundComponent } from './components/not-found/not-found.component';
|
|
|
|
import { SidePanelComponent } from './components/side-panel/side-panel.component';
|
|
|
|
import { TimespanComponent } from './components/timespan/timespan.component';
|
|
|
|
import { TagInputComponent } from './components/tag-input/tag-input.component';
|
2019-07-17 09:51:14 +00:00
|
|
|
import {IEventMessage } from './models/event.message';
|
|
|
|
import { IItem, Item } from './models/item';
|
|
|
|
import {IItemType} from './models/item.type';
|
|
|
|
import {IItemTypes} from './models/item.types';
|
|
|
|
import {IItemTask,ItemTask} from './models/itemTask';
|
|
|
|
import {IListItem} from './models/list.item';
|
|
|
|
import {ITypeaheadItem} from './models/typeahead.item';
|
|
|
|
import {IUser} from './models/user';
|
|
|
|
import * as commonActions from './actions/app-common.actions';
|
|
|
|
import * as commonReducers from './reducers/app-common.reducer';
|
|
|
|
import * as commonEffects from './effects/app-common.effects';
|
2019-07-17 10:02:02 +00:00
|
|
|
import {NgbDateNativeAdapter} from './services/date-adapter.service'
|
2019-07-17 09:51:14 +00:00
|
|
|
import { from } from 'rxjs';
|
2019-07-12 11:07:31 +00:00
|
|
|
|
2019-07-16 14:15:40 +00:00
|
|
|
export {FolderService,
|
2019-08-08 11:59:07 +00:00
|
|
|
ItemTypeService,
|
2019-07-16 14:15:40 +00:00
|
|
|
TimespanService,
|
|
|
|
ItemService,
|
|
|
|
EventService,
|
|
|
|
TypeaheadService,
|
|
|
|
UserService,
|
|
|
|
AppConfig,
|
|
|
|
AccessTokenInterceptor,
|
|
|
|
AuthGuard,
|
|
|
|
NavBarGuard,
|
|
|
|
FullScreenGuard,
|
|
|
|
SafePipe,
|
|
|
|
AuthCallbackComponent,
|
|
|
|
AuthCallbackGuard,
|
|
|
|
SessionClearedComponent,
|
|
|
|
ResumableFileUploadService,
|
|
|
|
ResumableFileUploadComponent,
|
|
|
|
NotFoundComponent,
|
|
|
|
SidePanelComponent,
|
|
|
|
TimespanComponent,
|
2019-07-17 09:51:14 +00:00
|
|
|
TagInputComponent,
|
|
|
|
IEventMessage,
|
|
|
|
IItem,
|
|
|
|
Item,
|
|
|
|
IItemType,
|
|
|
|
IItemTypes,
|
|
|
|
IItemTask,
|
|
|
|
ItemTask,
|
|
|
|
IListItem,
|
|
|
|
ITypeaheadItem,
|
|
|
|
IUser,
|
|
|
|
commonActions,
|
|
|
|
commonReducers,
|
2019-07-17 10:02:02 +00:00
|
|
|
NgbDateNativeAdapter
|
2019-07-16 14:15:40 +00:00
|
|
|
};
|
|
|
|
|
2019-07-12 11:07:31 +00:00
|
|
|
@NgModule({
|
|
|
|
imports: [
|
2019-07-15 14:54:19 +00:00
|
|
|
CommonModule,
|
|
|
|
HttpClientModule,
|
|
|
|
AppCommonRoutingModule,
|
2019-07-17 09:51:14 +00:00
|
|
|
StoreModule.forFeature(MODULE_NAME, commonReducers.reducer ),
|
|
|
|
EffectsModule.forFeature([commonEffects.AppCommonEffects]),
|
2019-07-15 14:54:19 +00:00
|
|
|
OAuthModule.forRoot(),
|
|
|
|
NgbModule,
|
2019-07-18 16:59:42 +00:00
|
|
|
FormsModule,
|
|
|
|
UploadxModule
|
2019-07-15 14:54:19 +00:00
|
|
|
],
|
|
|
|
providers: [
|
|
|
|
DatePipe
|
|
|
|
],
|
|
|
|
declarations: [
|
|
|
|
AuthCallbackComponent,
|
|
|
|
SidePanelComponent,
|
|
|
|
SafePipe,
|
|
|
|
NotFoundComponent,
|
|
|
|
ResumableFileUploadComponent,
|
|
|
|
TimespanComponent,
|
|
|
|
TagInputComponent,
|
|
|
|
SessionClearedComponent
|
2019-07-12 11:07:31 +00:00
|
|
|
],
|
2019-07-18 16:59:42 +00:00
|
|
|
exports: [NgbModule,UploadxModule, ResumableFileUploadComponent, SidePanelComponent, CommonModule, HttpClientModule, SafePipe, TimespanComponent, TagInputComponent ]
|
2019-07-12 11:07:31 +00:00
|
|
|
})
|
2019-07-15 14:54:19 +00:00
|
|
|
export class AppCommonModule {
|
|
|
|
static forRoot(): ModuleWithProviders {
|
|
|
|
return {
|
|
|
|
ngModule: AppCommonModule,
|
|
|
|
providers: [
|
|
|
|
AppConfig,
|
|
|
|
{
|
|
|
|
provide: APP_INITIALIZER,
|
|
|
|
useFactory: appConfigFactory,
|
|
|
|
deps: [Injector, AppConfig, OAuthService],
|
|
|
|
multi: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
provide: HTTP_INTERCEPTORS,
|
|
|
|
useClass: AccessTokenInterceptor,
|
|
|
|
multi: true
|
|
|
|
},
|
|
|
|
ResumableFileUploadService,
|
|
|
|
EventService,
|
|
|
|
FolderService,
|
|
|
|
UserService,
|
|
|
|
ItemService,
|
|
|
|
TypeaheadService,
|
|
|
|
AuthCallbackGuard,
|
|
|
|
AuthGuard,
|
|
|
|
NavBarGuard,
|
|
|
|
FullScreenGuard,
|
2019-08-08 11:59:07 +00:00
|
|
|
TimespanService,
|
|
|
|
ItemTypeService
|
2019-07-15 14:54:19 +00:00
|
|
|
]
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|