How to use @scion/workbench - 10 common examples

To help you get started, we’ve selected a few @scion/workbench examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SchweizerischeBundesbahnen / scion-workbench / projects / scion / workbench-application-platform / src / lib / popup-capability / popup-capability.module.ts View on Github external
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();
github SchweizerischeBundesbahnen / scion-workbench / projects / scion / workbench-application-platform / src / lib / view-capability / view-capability.module.ts View on Github external
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)
github SchweizerischeBundesbahnen / scion-workbench / projects / scion / workbench-application-platform / src / lib / messagebox-capability / message-box-capability.module.ts View on Github external
*/

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.');
}
github SchweizerischeBundesbahnen / scion-workbench / projects / scion / workbench-application-platform / src / lib / manifest-capability / manifest-capability.module.ts View on Github external
*  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 {
}
github SchweizerischeBundesbahnen / scion-workbench / projects / scion / workbench-application-platform / src / lib / activity-capability / activity-capability.module.ts View on Github external
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,
  ],
})
github SchweizerischeBundesbahnen / scion-workbench / projects / scion / workbench-application-platform / src / lib / workbench-application-platform.module.ts View on Github external
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) {
  }

  /**
github SchweizerischeBundesbahnen / scion-workbench / projects / scion / workbench-application-platform / src / lib / notification-capability / notification-capability.module.ts View on Github external
*/

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.');
}
github SchweizerischeBundesbahnen / scion-workbench / projects / app / workbench-application-platform / host-app / src / app / app.module.ts View on Github external
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,
        },
        {
github SchweizerischeBundesbahnen / scion-workbench / projects / app / workbench / workbench-app / src / app / app.module.ts View on Github external
@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 {
}
github SchweizerischeBundesbahnen / scion-workbench / projects / scion / workbench-application-platform / src / lib / spec / workbench-application-platform.module.spec.ts View on Github external
beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [
        WorkbenchTestingModule.forRoot(),
        WorkbenchApplicationPlatformModule.forRoot({errorHandler: NullErrorHandler, applicationConfig: []}),
        RouterTestingModule.withRoutes([{path: 'lazy-module-forroot', loadChildren: './lazy-forroot.module'}]),
      ],
    });
  });

@scion/workbench

SCION Workbench enables the creation of Angular web applications that require a flexible layout to arrange content side-by-side or stacked, all personalizable by the user via drag & drop.

EPL-2.0
Latest version published 10 days ago

Package Health Score

84 / 100
Full package analysis