Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { WorkbenchModule } from '@scion/workbench';
import { CommonModule } from '@angular/common';
import { PopupOutletComponent } from './popup-outlet.component';
import { PopupIntentDispatcher } from './popup-intent-dispatcher.service';
/**
* Built-in capability to show a popup.
*/
@NgModule({
declarations: [
PopupOutletComponent,
],
imports: [
CommonModule,
CoreModule,
WorkbenchModule.forChild(),
],
providers: [
{provide: APP_INITIALIZER, useFactory: provideModuleInitializerFn, multi: true, deps: [Injector]},
PopupIntentDispatcher,
],
entryComponents: [
PopupOutletComponent,
],
})
export class PopupCapabilityModule {
}
export function provideModuleInitializerFn(injector: Injector): () => void {
// use injector because Angular Router cannot be injected in `APP_INITIALIZER` function
// do not return the function directly to not break the AOT build (add redundant assignment)
const fn = (): void => injector.get(PopupIntentDispatcher).init();
import { WorkbenchModule } from '@scion/workbench';
import { RouterModule } from '@angular/router';
import { CommonModule } from '@angular/common';
import { ViewOutletComponent } from './view-outlet.component';
/**
* Built-in capability to show a view.
*/
@NgModule({
declarations: [
ViewOutletComponent,
],
imports: [
CommonModule,
CoreModule,
WorkbenchModule.forChild(),
RouterModule.forChild([]),
],
providers: [
{provide: APP_INITIALIZER, useFactory: provideModuleInitializerFn, multi: true, deps: [Injector]},
ViewIntentDispatcher,
],
entryComponents: [
ViewOutletComponent,
],
})
export class ViewCapabilityModule {
}
export function provideModuleInitializerFn(injector: Injector): () => void {
// use injector because Angular Router cannot be injected in `APP_INITIALIZER` function
// do not return the function directly to not break the AOT build (add redundant assignment)
*/
import { NgModule } from '@angular/core';
import { WorkbenchModule } from '@scion/workbench';
import { MessageBoxIntentHandler } from './message-box-intent-handler.service';
import { CoreModule } from '../core/core.module';
import { INTENT_HANDLER } from '../core/metadata';
import { NilQualifier } from '@scion/workbench-application-platform.api';
/**
* Built-in capability to display a messagebox.
*/
@NgModule({
imports: [
CoreModule,
WorkbenchModule.forChild(),
],
providers: [
{
provide: INTENT_HANDLER,
useFactory: provideDefaultMessageBoxIntentHandler,
multi: true,
},
],
})
export class MessageBoxCapabilityModule {
}
export function provideDefaultMessageBoxIntentHandler(): MessageBoxIntentHandler {
return new MessageBoxIntentHandler(NilQualifier, 'Displays a messagebox to the user.');
}
* SPDX-License-Identifier: EPL-2.0
*/
import { NgModule } from '@angular/core';
import { WorkbenchModule } from '@scion/workbench';
import { CoreModule } from '../core/core.module';
import { INTENT_HANDLER } from '../core/metadata';
import { ManifestRegistryIntentHandler } from './manifest-registry-intent-handler.service';
/**
* Built-in capability to lookup manifests.
*/
@NgModule({
imports: [
CoreModule,
WorkbenchModule.forChild(),
],
providers: [
{provide: INTENT_HANDLER, useClass: ManifestRegistryIntentHandler, multi: true},
],
})
export class ManifestCapabilityModule {
}
import { PopupOpenActivityActionComponent } from './popup-open-action/popup-open-activity-action.component';
/**
* Built-in capability to allow applications to register activities.
*/
@NgModule({
declarations: [
ActivityOutletComponent,
ViewOpenActivityActionComponent,
PopupOpenActivityActionComponent,
UrlOpenActivityActionComponent,
],
imports: [
CommonModule,
CoreModule,
WorkbenchModule.forChild(),
RouterModule.forChild([]),
],
providers: [
{provide: ACTIVITY_ACTION_PROVIDER, useClass: ViewOpenActivityActionProvider, multi: true},
{provide: ACTIVITY_ACTION_PROVIDER, useClass: PopupOpenActivityActionProvider, multi: true},
{provide: ACTIVITY_ACTION_PROVIDER, useClass: UrlOpenActivityActionProvider, multi: true},
{provide: APP_INITIALIZER, useFactory: provideModuleInitializerFn, multi: true, deps: [Injector]},
ActivityRegistrator,
],
entryComponents: [
ActivityOutletComponent,
ViewOpenActivityActionComponent,
PopupOpenActivityActionComponent,
UrlOpenActivityActionComponent,
],
})
import { FORROOT_GUARD } from './workbench-application-platform.constants';
import { ErrorHandler, PlatformConfigLoader } from './core/metadata';
import { DefaultErrorHandler } from './core/default-error-handler.service';
import { CoreModule } from './core/core.module';
import { ViewCapabilityModule } from './view-capability/view-capability.module';
import { ActivityCapabilityModule } from './activity-capability/activity-capability.module';
import { MessageBoxCapabilityModule } from './messagebox-capability/message-box-capability.module';
import { NotificationCapabilityModule } from './notification-capability/notification-capability.module';
import { ManifestCapabilityModule } from './manifest-capability/manifest-capability.module';
import { PopupCapabilityModule } from './popup-capability/popup-capability.module';
import { ModulePlatformConfigLoader } from './core/module-platform-config-loader.service';
import { ActivatorCapabilityModule } from './activator-capability/activator-capability.module';
@NgModule({
imports: [
WorkbenchModule.forChild(),
CoreModule,
ViewCapabilityModule,
ActivityCapabilityModule,
MessageBoxCapabilityModule,
NotificationCapabilityModule,
PopupCapabilityModule,
ManifestCapabilityModule,
ActivatorCapabilityModule,
],
})
export class WorkbenchApplicationPlatformModule {
constructor(@Inject(FORROOT_GUARD) guard: any) {
}
/**
*/
import { NgModule } from '@angular/core';
import { CoreModule } from '../core/core.module';
import { WorkbenchModule } from '@scion/workbench';
import { NotificationIntentHandler } from './notification-intent-handler.service';
import { INTENT_HANDLER } from '../core/metadata';
import { NilQualifier } from '@scion/workbench-application-platform.api';
/**
* Built-in capability to show a notification.
*/
@NgModule({
imports: [
CoreModule,
WorkbenchModule.forChild(),
],
providers: [
{
provide: INTENT_HANDLER,
useFactory: provideDefaultNotificationIntentHandler,
multi: true,
},
],
})
export class NotificationCapabilityModule {
}
export function provideDefaultNotificationIntentHandler(): NotificationIntentHandler {
return new NotificationIntentHandler(NilQualifier, 'Shows a notification to the user.');
}
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { WorkbenchModule } from '@scion/workbench';
import { RouterModule } from '@angular/router';
import { WorkbenchApplicationPlatformModule } from '@scion/workbench-application-platform';
import { CustomExtensionModule } from './custom-extension/custom-extension.module';
import { environment } from '../environments/environment';
@NgModule({
declarations: [
AppComponent,
],
imports: [
WorkbenchModule.forRoot(),
WorkbenchApplicationPlatformModule.forRoot({
applicationConfig: [
{
symbolicName: 'contact-app',
manifestUrl: environment.contact_app_manifest_url,
},
{
symbolicName: 'communication-app',
manifestUrl: environment.communication_app_manifest_url,
},
{
symbolicName: 'devtools-app',
manifestUrl: environment.devtools_app_manifest_url,
scopeCheckDisabled: true,
},
{
@NgModule({
declarations: [
AppComponent,
Activity1a90c8d31Component,
Activity1a90c8d32Component,
WelcomePageComponent,
ViewComponent,
View4a3a8932Component,
ViewBb9700a6Component,
ViewNavigationComponent,
ViewInterationComponent,
],
imports: [
BrowserModule,
AppRoutingModule,
WorkbenchModule.forRoot(),
BrowserAnimationsModule,
FormsModule,
ReactiveFormsModule,
SciParamsEnterModule,
SciPropertyModule,
],
providers: [],
bootstrap: [
AppComponent,
],
})
export class AppModule {
}
beforeEach(() => {
TestBed.configureTestingModule({
imports: [
WorkbenchTestingModule.forRoot(),
WorkbenchApplicationPlatformModule.forRoot({errorHandler: NullErrorHandler, applicationConfig: []}),
RouterTestingModule.withRoutes([{path: 'lazy-module-forroot', loadChildren: './lazy-forroot.module'}]),
],
});
});