2020-05-13 14:41:43 +02:00
|
|
|
import { OverlayModule } from '@angular/cdk/overlay';
|
2020-07-09 10:54:55 +02:00
|
|
|
import { CommonModule, registerLocaleData } from '@angular/common';
|
2020-05-13 14:41:43 +02:00
|
|
|
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
|
|
|
import localeDe from '@angular/common/locales/de';
|
|
|
|
import { APP_INITIALIZER, NgModule } from '@angular/core';
|
|
|
|
import { MatButtonModule } from '@angular/material/button';
|
|
|
|
import { MatCardModule } from '@angular/material/card';
|
2020-07-24 09:48:58 +02:00
|
|
|
import { MatDialogModule } from '@angular/material/dialog';
|
2020-05-13 14:41:43 +02:00
|
|
|
import { MatIconModule } from '@angular/material/icon';
|
|
|
|
import { MatMenuModule } from '@angular/material/menu';
|
|
|
|
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
|
|
import { MatSidenavModule } from '@angular/material/sidenav';
|
|
|
|
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
|
|
|
import { MatToolbarModule } from '@angular/material/toolbar';
|
|
|
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
|
|
import { BrowserModule } from '@angular/platform-browser';
|
|
|
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
|
|
import { ServiceWorkerModule } from '@angular/service-worker';
|
|
|
|
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
|
|
|
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
|
|
|
|
import { AuthConfig, OAuthModule, OAuthStorage } from 'angular-oauth2-oidc';
|
fix(console): cleanup structure, role guard, paginated requests, cleanup policies, toast i18n, view timestamp, preloading strategy, maennchenfindings, fix passwordchange (#483)
* routes, move grid to list comopnent
* rename app list component, move to project sub
* add owned-project-detail child module
* seperate pipes
* set password validators only if needed
* create org initialize without pwd
* no caps
* self xss message
* fix user table
* fix project member paginator
* fix project members pagination, user grant pag
* move project grants, fix imports
* fix owned project detail imports
* use pipe and directives
* ng content bindings, rem custom schemas
* i18n, fix error toast parameter
* toast i18n
* side background
* fix: sequence, add timestamp
* audit
* fix metanav background
* org domain label
* cleanup policy component
* shorten user grant roles, mk cols visible as bind
* move user components, show otp only if available
* preload modules
* fix password change
* fix org create buttons
* class css
2020-07-16 15:13:36 +02:00
|
|
|
import { QuicklinkModule } from 'ngx-quicklink';
|
2020-05-13 14:41:43 +02:00
|
|
|
|
|
|
|
import { environment } from '../environments/environment';
|
|
|
|
import { AppRoutingModule } from './app-routing.module';
|
|
|
|
import { AppComponent } from './app.component';
|
|
|
|
import { HasRoleModule } from './directives/has-role/has-role.module';
|
|
|
|
import { OutsideClickModule } from './directives/outside-click/outside-click.module';
|
|
|
|
import { AccountsCardModule } from './modules/accounts-card/accounts-card.module';
|
2020-06-26 14:15:05 +02:00
|
|
|
import { AvatarModule } from './modules/avatar/avatar.module';
|
2020-07-24 09:48:58 +02:00
|
|
|
import { WarnDialogModule } from './modules/warn-dialog/warn-dialog.module';
|
2020-05-13 14:41:43 +02:00
|
|
|
import { SignedoutComponent } from './pages/signedout/signedout.component';
|
fix(console): cleanup structure, role guard, paginated requests, cleanup policies, toast i18n, view timestamp, preloading strategy, maennchenfindings, fix passwordchange (#483)
* routes, move grid to list comopnent
* rename app list component, move to project sub
* add owned-project-detail child module
* seperate pipes
* set password validators only if needed
* create org initialize without pwd
* no caps
* self xss message
* fix user table
* fix project member paginator
* fix project members pagination, user grant pag
* move project grants, fix imports
* fix owned project detail imports
* use pipe and directives
* ng content bindings, rem custom schemas
* i18n, fix error toast parameter
* toast i18n
* side background
* fix: sequence, add timestamp
* audit
* fix metanav background
* org domain label
* cleanup policy component
* shorten user grant roles, mk cols visible as bind
* move user components, show otp only if available
* preload modules
* fix password change
* fix org create buttons
* class css
2020-07-16 15:13:36 +02:00
|
|
|
import { HasRolePipeModule } from './pipes/has-role-pipe.module';
|
2020-05-13 14:41:43 +02:00
|
|
|
import { AuthUserService } from './services/auth-user.service';
|
|
|
|
import { AuthService } from './services/auth.service';
|
|
|
|
import { GrpcService } from './services/grpc.service';
|
2020-07-09 10:54:55 +02:00
|
|
|
import { GrpcAuthInterceptor } from './services/interceptors/grpc-auth.interceptor';
|
|
|
|
import { GRPC_INTERCEPTORS } from './services/interceptors/grpc-interceptor';
|
|
|
|
import { GrpcOrgInterceptor } from './services/interceptors/grpc-org.interceptor';
|
2020-05-13 14:41:43 +02:00
|
|
|
import { StatehandlerProcessorService, StatehandlerProcessorServiceImpl } from './services/statehandler-processor.service';
|
|
|
|
import { StatehandlerService, StatehandlerServiceImpl } from './services/statehandler.service';
|
|
|
|
import { StorageService } from './services/storage.service';
|
|
|
|
import { ThemeService } from './services/theme.service';
|
|
|
|
|
|
|
|
registerLocaleData(localeDe);
|
|
|
|
|
|
|
|
// AoT requires an exported function for factories
|
|
|
|
export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {
|
2020-07-09 10:54:55 +02:00
|
|
|
return new TranslateHttpLoader(http, './assets/i18n/');
|
2020-05-13 14:41:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
const appInitializerFn = (grpcServ: GrpcService) => {
|
|
|
|
return () => {
|
|
|
|
return grpcServ.loadAppEnvironment();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const stateHandlerFn = (stateHandler: StatehandlerService) => {
|
|
|
|
return () => {
|
|
|
|
return stateHandler.initStateHandler();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-07-08 13:56:37 +02:00
|
|
|
const authConfig: AuthConfig = {
|
2020-05-13 14:41:43 +02:00
|
|
|
scope: 'openid profile email', // offline_access
|
|
|
|
responseType: 'code',
|
|
|
|
oidc: true,
|
|
|
|
};
|
|
|
|
|
|
|
|
@NgModule({
|
|
|
|
declarations: [
|
|
|
|
AppComponent,
|
|
|
|
SignedoutComponent,
|
|
|
|
],
|
|
|
|
imports: [
|
|
|
|
AppRoutingModule,
|
|
|
|
CommonModule,
|
|
|
|
BrowserModule,
|
|
|
|
OverlayModule,
|
|
|
|
OAuthModule.forRoot({
|
|
|
|
resourceServer: {
|
|
|
|
allowedUrls: ['https://test.api.zitadel.caos.ch/caos.zitadel.auth.api.v1.AuthService', 'https://test.api.zitadel.caos.ch/oauth/v2/userinfo', 'https://test.api.zitadel.caos.ch/caos.zitadel.management.api.v1.ManagementService/', 'https://preview.api.zitadel.caos.ch'],
|
|
|
|
sendAccessToken: true,
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
TranslateModule.forRoot({
|
|
|
|
loader: {
|
|
|
|
provide: TranslateLoader,
|
|
|
|
useFactory: HttpLoaderFactory,
|
|
|
|
deps: [HttpClient],
|
|
|
|
},
|
|
|
|
}),
|
fix(console): cleanup structure, role guard, paginated requests, cleanup policies, toast i18n, view timestamp, preloading strategy, maennchenfindings, fix passwordchange (#483)
* routes, move grid to list comopnent
* rename app list component, move to project sub
* add owned-project-detail child module
* seperate pipes
* set password validators only if needed
* create org initialize without pwd
* no caps
* self xss message
* fix user table
* fix project member paginator
* fix project members pagination, user grant pag
* move project grants, fix imports
* fix owned project detail imports
* use pipe and directives
* ng content bindings, rem custom schemas
* i18n, fix error toast parameter
* toast i18n
* side background
* fix: sequence, add timestamp
* audit
* fix metanav background
* org domain label
* cleanup policy component
* shorten user grant roles, mk cols visible as bind
* move user components, show otp only if available
* preload modules
* fix password change
* fix org create buttons
* class css
2020-07-16 15:13:36 +02:00
|
|
|
QuicklinkModule,
|
2020-05-13 14:41:43 +02:00
|
|
|
AccountsCardModule,
|
|
|
|
HasRoleModule,
|
|
|
|
BrowserAnimationsModule,
|
|
|
|
HttpClientModule,
|
|
|
|
MatButtonModule,
|
|
|
|
MatIconModule,
|
|
|
|
MatTooltipModule,
|
|
|
|
MatSidenavModule,
|
|
|
|
MatCardModule,
|
|
|
|
OutsideClickModule,
|
fix(console): cleanup structure, role guard, paginated requests, cleanup policies, toast i18n, view timestamp, preloading strategy, maennchenfindings, fix passwordchange (#483)
* routes, move grid to list comopnent
* rename app list component, move to project sub
* add owned-project-detail child module
* seperate pipes
* set password validators only if needed
* create org initialize without pwd
* no caps
* self xss message
* fix user table
* fix project member paginator
* fix project members pagination, user grant pag
* move project grants, fix imports
* fix owned project detail imports
* use pipe and directives
* ng content bindings, rem custom schemas
* i18n, fix error toast parameter
* toast i18n
* side background
* fix: sequence, add timestamp
* audit
* fix metanav background
* org domain label
* cleanup policy component
* shorten user grant roles, mk cols visible as bind
* move user components, show otp only if available
* preload modules
* fix password change
* fix org create buttons
* class css
2020-07-16 15:13:36 +02:00
|
|
|
HasRolePipeModule,
|
2020-05-13 14:41:43 +02:00
|
|
|
MatProgressBarModule,
|
|
|
|
MatToolbarModule,
|
|
|
|
MatMenuModule,
|
|
|
|
MatSnackBarModule,
|
2020-06-26 14:15:05 +02:00
|
|
|
AvatarModule,
|
2020-07-24 09:48:58 +02:00
|
|
|
WarnDialogModule,
|
|
|
|
MatDialogModule,
|
2020-07-08 10:00:15 +02:00
|
|
|
ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }),
|
2020-05-13 14:41:43 +02:00
|
|
|
],
|
|
|
|
providers: [
|
|
|
|
ThemeService,
|
|
|
|
{
|
|
|
|
provide: APP_INITIALIZER,
|
|
|
|
useFactory: appInitializerFn,
|
|
|
|
multi: true,
|
|
|
|
deps: [GrpcService],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
provide: APP_INITIALIZER,
|
|
|
|
useFactory: stateHandlerFn,
|
|
|
|
multi: true,
|
|
|
|
deps: [StatehandlerService],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
provide: AuthConfig,
|
|
|
|
useValue: authConfig,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
provide: StatehandlerProcessorService,
|
|
|
|
useClass: StatehandlerProcessorServiceImpl,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
provide: StatehandlerService,
|
|
|
|
useClass: StatehandlerServiceImpl,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
provide: OAuthStorage,
|
|
|
|
useClass: StorageService,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
provide: GRPC_INTERCEPTORS,
|
|
|
|
multi: true,
|
|
|
|
useClass: GrpcAuthInterceptor,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
provide: GRPC_INTERCEPTORS,
|
|
|
|
multi: true,
|
|
|
|
useClass: GrpcOrgInterceptor,
|
|
|
|
},
|
|
|
|
GrpcService,
|
|
|
|
AuthService,
|
|
|
|
AuthUserService,
|
2020-07-20 15:23:29 +02:00
|
|
|
{ provide: 'windowObject', useValue: window },
|
2020-05-13 14:41:43 +02:00
|
|
|
],
|
|
|
|
bootstrap: [AppComponent],
|
|
|
|
})
|
2020-07-01 17:48:34 +02:00
|
|
|
export class AppModule {
|
|
|
|
|
2020-07-09 10:54:55 +02:00
|
|
|
constructor() { }
|
2020-07-01 17:48:34 +02:00
|
|
|
}
|