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
Configuration of forms
<tcla-live-apps-settings-forms></tcla-live-apps-settings-forms>
selector | tcla-live-apps-settings-form-layout |
styleUrls | ./live-apps-settings-form-layout.component.css |
templateUrl | ./live-apps-settings-form-layout.component.html |
Properties |
|
Methods |
|
HostListeners |
constructor(route: ActivatedRoute, formConfigService: TcFormConfigService, snackBar: MatSnackBar)
|
||||||||||||
Parameters :
|
window:resize |
Arguments : '$event'
|
window:resize(event)
|
Inherited from
LiveAppsComponent
|
Defined in
LiveAppsComponent:45
|
Public formConfigChange | ||||||
formConfigChange(formConfig: FormConfig)
|
||||||
Parameters :
Returns :
void
|
Public ngOnInit |
ngOnInit()
|
Returns :
void
|
ngAfterViewInit |
ngAfterViewInit()
|
Inherited from
LiveAppsComponent
|
Defined in
LiveAppsComponent:91
|
Returns :
void
|
ngOnDestroy |
ngOnDestroy()
|
Inherited from
LiveAppsComponent
|
Defined in
LiveAppsComponent:99
|
Returns :
void
|
ngOnInit |
ngOnInit()
|
Inherited from
LiveAppsComponent
|
Defined in
LiveAppsComponent:104
|
Returns :
void
|
setupWidthObserver |
setupWidthObserver()
|
Inherited from
LiveAppsComponent
|
Defined in
LiveAppsComponent:70
|
Returns :
void
|
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
|
Defined in
LiveAppsComponent:39
|
componentChildDivs |
Type : LiveAppsComponent[]
|
Decorators :
@ViewChildren('componentChildDiv')
|
Inherited from
LiveAppsComponent
|
Defined in
LiveAppsComponent:36
|
componentDiv |
Type : ElementRef
|
Decorators :
@ViewChild('componentDiv', {static: false})
|
Inherited from
LiveAppsComponent
|
Defined in
LiveAppsComponent:35
|
Protected containerChanges$ |
Type : Observable<TcComponent>
|
Inherited from
LiveAppsComponent
|
Defined in
LiveAppsComponent:40
|
Private observer |
Inherited from
LiveAppsComponent
|
Defined in
LiveAppsComponent:42
|
Public resize |
Default value : () => {...}
|
Inherited from
LiveAppsComponent
|
Defined in
LiveAppsComponent:56
|
Public widget |
Type : TcComponent
|
Inherited from
LiveAppsComponent
|
Defined in
LiveAppsComponent:41
|
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
*
* 
*
*@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;
}