File

C:/GoDev/src/TCSTK-Angular/projects/tibco-tcstk/tc-liveapps-lib/src/lib/components/live-apps-settings-forms/live-apps-settings-forms.component.ts

Description

Configuration of forms

alt-text

Extends

LiveAppsComponent

Implements

OnInit

Example

<tcla-live-apps-settings-forms></tcla-live-apps-settings-forms>

Metadata

selector tcla-live-apps-settings-forms
styleUrls ./live-apps-settings-forms.component.css
templateUrl ./live-apps-settings-forms.component.html

Index

Properties
Methods
HostListeners

Constructor

constructor(route: ActivatedRoute, liveAppsConfigService: TcLiveAppsConfigService, snackBar: MatSnackBar)
Parameters :
Name Type Optional
route ActivatedRoute No
liveAppsConfigService TcLiveAppsConfigService No
snackBar MatSnackBar No

HostListeners

window:resize
Arguments : '$event'
window:resize(event)
Inherited from LiveAppsComponent

Methods

Protected getLiveAppsConfigService
getLiveAppsConfigService()
Public handleAppIdSelection
handleAppIdSelection(appIds: string[])
Parameters :
Name Type Optional
appIds string[] No
Returns : void
Public ngOnInit
ngOnInit()
Returns : void
ngAfterViewInit
ngAfterViewInit()
Inherited from LiveAppsComponent
Returns : void
ngOnDestroy
ngOnDestroy()
Inherited from LiveAppsComponent
Returns : void
ngOnInit
ngOnInit()
Inherited from LiveAppsComponent
Returns : void
setupWidthObserver
setupWidthObserver()
Inherited from LiveAppsComponent
Returns : void

Properties

Public claims
Type : Claim
Public generalConfig
Type : GeneralConfig
Public liveAppsConfig
Type : LiveAppsConfig
Public runSaveFunction
Default value : () => {...}
Public sandboxId
Type : number
Public selectedAppIds
Type : string[]
Protected _destroyed$
Default value : new Subject()
Inherited from LiveAppsComponent
componentChildDivs
Type : LiveAppsComponent[]
Decorators :
@ViewChildren('componentChildDiv')
Inherited from LiveAppsComponent
componentDiv
Type : ElementRef
Decorators :
@ViewChild('componentDiv', {static: false})
Inherited from LiveAppsComponent
Protected containerChanges$
Type : Observable<TcComponent>
Inherited from LiveAppsComponent
Private observer
Inherited from LiveAppsComponent
Public resize
Default value : () => {...}
Inherited from LiveAppsComponent
Public widget
Type : TcComponent
Inherited from LiveAppsComponent
import {Component, OnInit} from '@angular/core';
import {LiveAppsConfig} from '../../models/tc-liveapps-config';
import {ActivatedRoute} from '@angular/router';
import {GeneralConfig, Claim, Sandbox} from '@tibco-tcstk/tc-core-lib';
import {TcLiveAppsConfigService} from '../../services/tc-live-apps-config.service';
import {LiveAppsComponent} from '../live-apps-component/live-apps-component.component';
import { MatSnackBar } from '@angular/material/snack-bar';


/**
 * Configuration of forms
 *
 * ![alt-text](../live-apps-settings-forms.png "")
 *
 *@example <tcla-live-apps-settings-forms></tcla-live-apps-settings-forms>
 */
@Component({
  selector: 'tcla-live-apps-settings-forms',
  templateUrl: './live-apps-settings-forms.component.html',
  styleUrls: ['./live-apps-settings-forms.component.css']
})
export class LiveAppsSettingsFormsComponent extends LiveAppsComponent implements OnInit {

  public sandboxId: number;
  public selectedAppIds: string[];
  public liveAppsConfig: LiveAppsConfig;
  public generalConfig: GeneralConfig;
  public claims: Claim;

  constructor(protected route: ActivatedRoute, protected liveAppsConfigService: TcLiveAppsConfigService, protected snackBar: MatSnackBar) {
    super();
  }

  protected getLiveAppsConfigService(): TcLiveAppsConfigService {
    return this.liveAppsConfigService;
  }

  public handleAppIdSelection(appIds: string[]) {
    console.log('Selected: ', appIds);
    this.selectedAppIds = appIds;
  }

  public ngOnInit() {
    this.generalConfig = this.route.snapshot.data.laConfigHolder.generalConfig;
    this.liveAppsConfig = this.route.snapshot.data.laConfigHolder.liveAppsConfig;
    this.claims = this.route.snapshot.data.claims;
    this.sandboxId = Number(this.claims.primaryProductionSandbox.id).valueOf();
    this.selectedAppIds = this.liveAppsConfig.applicationIds;
  }

  public runSaveFunction = (): void => {
    const liveAppsConfig = new LiveAppsConfig().deserialize({
      applicationIds: this.selectedAppIds,
      caseIconsFolderId: this.liveAppsConfig.caseIconsFolderId,
      documentAppId: this.liveAppsConfig.documentAppId,
      collaborationAppId: this.liveAppsConfig.documentAppId,
      legacyCreators: this.liveAppsConfig.legacyCreators,
      legacyActions: this.liveAppsConfig.legacyActions,
      legacyWorkitems: this.liveAppsConfig.legacyWorkitems,
      formsFramework: this.liveAppsConfig.formsFramework
    });
    this.liveAppsConfigService.updateLiveAppsConfig(this.sandboxId, this.generalConfig.uiAppId, liveAppsConfig, this.liveAppsConfig.id).subscribe(
      result => {
        this.snackBar.open('Live Apps form configuration settings saved', 'OK', {
          duration: 3000
        });
      },
      error => {
        this.snackBar.open('Error saving forms configuration', 'OK', {
          duration: 3000
        });
      }
    );
  }
}
<div fxLayout="column" class="tcs-live-apps-settings-pane" fxFill>
  <tc-tibco-cloud-widget-header style="height: 40px;" [icon]="'tcs-capabilities'" [headerText]="'Live Apps Form Configuration'">
  </tc-tibco-cloud-widget-header>
  <div fxFlex style="padding: 20px;" fxLayout="column">
    <div fxLayout="row" fxLayoutAlign="start start" fxLayoutGap="5px" style="height: 20px">
      <p class="tcs-settings-text">Select framework for generated forms (only applies when NOT using legacy or custom forms):</p>
    </div>
    <div fxLayout="column" style="padding: 10px;">
      <mat-radio-group [(ngModel)]="liveAppsConfig.formsFramework" fxLayout="column">
        <mat-radio-button class="tcs-radio-label-content" value="material-design">Material Design</mat-radio-button>
        <mat-radio-button class="tcs-radio-label-content" value="bootstrap-4">Bootstrap 4</mat-radio-button>
      </mat-radio-group>
    </div>
    <div fxLayout="row" fxLayoutAlign="start start" fxLayoutGap="5px" style="height: 20px">
      <p class="tcs-settings-text">Select whether to use Live Apps Case Manager Forms for this application:</p>
    </div>
    <div fxLayout="column" style="padding: 10px;">
      <div>
        <p class="tcs-settings-text">Use Live Apps generated forms for:</p>
      </div>
      <mat-checkbox [(ngModel)]="liveAppsConfig.legacyCreators">
        <mat-label class="tcs-checkbox-label">Creators</mat-label>
      </mat-checkbox>
      <mat-checkbox [(ngModel)]="liveAppsConfig.legacyActions">
        <mat-label class="tcs-checkbox-label">Actions</mat-label>
      </mat-checkbox>
      <mat-checkbox [(ngModel)]="liveAppsConfig.legacyWorkitems">
        <mat-label class="tcs-checkbox-label">Workitems</mat-label>
      </mat-checkbox>
    </div>
    <div fxFlex class="tcs-filler-panel"></div>
    <div fxLayout="column" fxLayoutAlign="end end" style="min-height: 50px">
      <button mat-raised-button color="primary" (click)="runSaveFunction()">Save</button>
    </div>
  </div>
</div>

./live-apps-settings-forms.component.css

.tcs-live-apps-summary-cards-settings {
  overflow: hidden;
}

.tcs-card-config-widget-pane {
  overflow: hidden;
}

.tcs-settings-text {
  font-family: Source Sans Pro;
  font-size: 14px;
  font-weight: normal;
  font-style: normal;
  font-stretch: normal;
  line-height: 1.5;
  letter-spacing: 0.3px;
}

.tcs-checkbox-label {
  font-family: Source Sans Pro;
  font-size: 14px;
  font-weight: normal;
  font-style: normal;
  font-stretch: normal;
  line-height: 1.5;
  letter-spacing: 0.3px;
}

:host ::ng-deep .tcs-radio-label-content .mat-radio-label-content {
  font-family: Source Sans Pro;
  font-size: 14px;
  font-weight: normal;
  font-style: normal;
  font-stretch: normal;
  line-height: 1.5;
  letter-spacing: 0.3px;
}
Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""