File

C:/GoDev/src/TCSTK-Angular/projects/tibco-tcstk/tc-liveapps-lib/src/lib/components/live-apps-settings-form-layout/live-apps-settings-form-layout.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-form-layout
styleUrls ./live-apps-settings-form-layout.component.css
templateUrl ./live-apps-settings-form-layout.component.html

Index

Properties
Methods
HostListeners

Constructor

constructor(route: ActivatedRoute, formConfigService: TcFormConfigService, snackBar: MatSnackBar)
Parameters :
Name Type Optional
route ActivatedRoute No
formConfigService TcFormConfigService No
snackBar MatSnackBar No

HostListeners

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

Methods

Public formConfigChange
formConfigChange(formConfig: FormConfig)
Parameters :
Name Type Optional
formConfig FormConfig 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 formConfig
Type : FormConfig
Public generalConfig
Type : GeneralConfig
Public liveAppsConfig
Type : LiveAppsConfig
Public runSaveFunction
Default value : () => {...}
Public sandboxId
Type : number
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 {FormConfig, LiveAppsConfig} from '../../models/tc-liveapps-config';
import {ActivatedRoute} from '@angular/router';
import {GeneralConfig, Claim} from '@tibco-tcstk/tc-core-lib';
import {LiveAppsComponent} from '../live-apps-component/live-apps-component.component';
import { MatSnackBar } from '@angular/material/snack-bar';
import {TcFormConfigService} from '../../services/tc-form-config.service';


/**
 * 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-form-layout',
  templateUrl: './live-apps-settings-form-layout.component.html',
  styleUrls: ['./live-apps-settings-form-layout.component.css']
})
export class LiveAppsSettingsFormLayoutComponent extends LiveAppsComponent implements OnInit {

  public sandboxId: number;
  public liveAppsConfig: LiveAppsConfig;
  public generalConfig: GeneralConfig;
  public formConfig: FormConfig;
  public claims: Claim;

  constructor(protected route: ActivatedRoute, protected formConfigService: TcFormConfigService, protected snackBar: MatSnackBar) {
    super();
  }

  public formConfigChange(formConfig: FormConfig) {
    this.formConfig = formConfig;
    this.runSaveFunction();
  }

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

  public runSaveFunction = (): void => {
    this.formConfigService.updateFormConfig(this.sandboxId, this.generalConfig.uiAppId, this.formConfig, this.formConfig.id).subscribe(
      result => {
        this.snackBar.open('Live Apps form layout configuration settings saved', 'OK', {
          duration: 3000
        });
      },
      error => {
        this.snackBar.open('Error saving form layout 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; overflow: hidden" fxLayout="column">
    <tcla-live-apps-form-preview style="max-height: 100%; height: 100%;" [sandbox]="sandboxId" [appIds]="liveAppsConfig.applicationIds" [formsFramework]="liveAppsConfig.formsFramework" [formConfig]="formConfig" (formConfigUpdate)="formConfigChange($event)"></tcla-live-apps-form-preview>
  </div>
</div>

./live-apps-settings-form-layout.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 ""