File

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

Description

Special rendering of LiveAppsApplicationsComponent

alt-text

Extends

LiveAppsApplicationsComponent

Example

<tcla-live-apps-application-create-button></tcla-live-apps-application-create-button>

Metadata

selector tcla-live-apps-application-create-button
styleUrls ./live-apps-application-create-button.component.css
templateUrl ./live-apps-application-create-button.component.html

Index

Properties
Methods
Inputs
Outputs
HostListeners
Accessors

Inputs

createLabel
Type : string
appIds
Type : string[]

The list of LA Application IDs you want to handle

formFieldRendering
Type : boolean
label
Type : string
sandboxId
Type : number

sandboxId - this comes from claims resolver

selectedApp
selectedAppId
Type : string

Pre-select specified appId

selectFirstApp
Type : boolean

Whether to auto select the first app in dropdown selector (eg search)

Outputs

selection
Type : EventEmitter<CaseType>

~event selection : Value selected in child component ~payload CaseType : type varies. but is when something is selected in a drop down it is passed back to the caller

HostListeners

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

Methods

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 createLabel
Type : string
Default value : 'Create Case'
Public handleCreateCaseClick
Default value : () => {...}
Public handleCreatorAppSelection
Default value : () => {...}
applications
Type : CaseTypesList
Default value : new CaseTypesList()
changeAppSelection
Default value : () => {...}
Public compareProcessId
Default value : () => {...}
errorMessage
Type : string
Public formFieldRendering
Type : boolean
Default value : false

Use Form field rendering around the selection box

Public label
Type : string
Default value : 'Applications'

Label for the application selector

Public refresh
Default value : () => {...}
selectApplication
Default value : () => {...}
Public selectedApp
Type : CaseType
Default value : new CaseType()

Application selected from dropdown (output)

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

Accessors

CreateLabel
setCreateLabel(createLabel: string)
Parameters :
Name Type Optional
createLabel string No
Returns : void
import {Component, Input, OnInit} from '@angular/core';
import {LiveAppsApplicationsComponent} from '../live-apps-applications/live-apps-applications.component';
import {CaseType} from '../../models/liveappsdata';


/**
 * Special rendering of LiveAppsApplicationsComponent
 *
 * ![alt-text](../live-apps-application-create-button.png "Image")
 *
 *@example <tcla-live-apps-application-create-button></tcla-live-apps-application-create-button>
 */
@Component({
  selector: 'tcla-live-apps-application-create-button',
  templateUrl: './live-apps-application-create-button.component.html',
  styleUrls: ['./live-apps-application-create-button.component.css']
})
export class LiveAppsApplicationCreateButtonComponent extends LiveAppsApplicationsComponent {

  public createLabel: string = 'Create Case';
  @Input('createLabel') set CreateLabel(createLabel: string) {
    if (createLabel){
      this.createLabel = createLabel;
    }
  }

  public handleCreatorAppSelection = (application: CaseType) => {
    this.selection.emit(application);
  }

  public handleCreateCaseClick = () => {
    // console.log('Select Case: ' + this.applications.casetypes.length);
    if (this.applications.casetypes.length === 1) {
      // Open Case Directly
      // console.log('Opening Case Directly...');
      this.handleCreatorAppSelection(this.applications.casetypes[0]);
    }
  }
}
<button mat-button [matMenuTriggerFor]="creatorApplicationMenu" (click)="handleCreateCaseClick()">
  <mat-icon [svgIcon]="'tcs-case-start-icon'"></mat-icon>
  <span class="tcs-case-create-button-text">{{createLabel}}</span>
</button>
<mat-menu #creatorApplicationMenu="matMenu">
  <button mat-menu-item *ngFor="let application of applications.casetypes" (click)="handleCreatorAppSelection(application)">{{application.applicationName}}</button>
</mat-menu>

./live-apps-application-create-button.component.css

.tcs-case-create-button-text {
  font-family: Source Sans Pro;
  font-size: 18px;
  font-weight: 600;
  font-style: normal;
  font-stretch: normal;
  line-height: normal;
  letter-spacing: normal;
  text-align: center;
  color: #0081cb;
}
Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""