Commit c02d0fdd by GD-A-150752

edit-workflow-template initial

parent ff8bb8bd
...@@ -4,7 +4,7 @@ root = true ...@@ -4,7 +4,7 @@ root = true
[*] [*]
charset = utf-8 charset = utf-8
indent_style = space indent_style = space
indent_size = 2 indent_size = 4
insert_final_newline = true insert_final_newline = true
trim_trailing_whitespace = true trim_trailing_whitespace = true
......
import {Component, OnDestroy, Renderer, OnInit, NgZone} from '@angular/core'; import { Component } from '@angular/core';
@Component({ @Component({
// tslint:disable-next-line:component-selector
selector: 'body', selector: 'body',
template: '<router-outlet></router-outlet>' template: '<router-outlet></router-outlet>'
}) })
......
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { FormBuilder } from '@angular/forms'; import { FormBuilder } from '@angular/forms';
import { ConfirmationService, EditorModule, OverlayPanelModule } from 'primeng/primeng'; import { ConfirmationService, EditorModule, InputSwitchModule, OverlayPanelModule, PanelModule } from 'primeng/primeng';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
import { AppRoutingModule } from './app.routing'; import { AppRoutingModule } from './app.routing';
import { AppService } from './app.service'; import { AppService } from './app.service';
import { EditMessageTemplateComponent } from './components/edit-message-template/edit-message-template.component'; import { EditMessageTemplateComponent } from './components/edit-message-template/edit-message-template.component';
import { EditMessageTemplateService } from './components/edit-message-template/edit-message-template.service'; import { EditMessageTemplateService } from './components/edit-message-template/edit-message-template.service';
import { EditWorkflowTemplateComponent } from './components/edit-workflow-template/edit-workflow-template.component';
import { EditWorkflowTemplateService } from './components/edit-workflow-template/edit-workflow-template.service';
import { ListMessageTemplateComponent } from './components/list-message-template/list-message-template.component'; import { ListMessageTemplateComponent } from './components/list-message-template/list-message-template.component';
import { ListMessageTemplateService } from './components/list-message-template/list-message-template.service';
import { ListWorkFlowsComponent } from './components/list-work-flows/list-work-flows.component'; import { ListWorkFlowsComponent } from './components/list-work-flows/list-work-flows.component';
import { ListWorkFlowsService } from './components/list-work-flows/list-work-flows.service';
import { FullLayoutComponent } from './oneit/components/full-layout/full-layout.component'; import { FullLayoutComponent } from './oneit/components/full-layout/full-layout.component';
import { OneITModule } from './oneit/oneit.module'; import { OneITModule } from './oneit/oneit.module';
@NgModule({ @NgModule({
imports: [ imports: [
AppRoutingModule, AppRoutingModule,
OneITModule, OneITModule,
EditorModule, EditorModule,
OverlayPanelModule OverlayPanelModule,
], PanelModule,
declarations: [ InputSwitchModule
AppComponent, ],
FullLayoutComponent, declarations: [
EditMessageTemplateComponent, AppComponent,
ListMessageTemplateComponent, FullLayoutComponent,
ListWorkFlowsComponent EditMessageTemplateComponent,
], EditWorkflowTemplateComponent,
providers: [ ListMessageTemplateComponent,
FormBuilder, ListWorkFlowsComponent
ConfirmationService, ],
AppService, providers: [
EditMessageTemplateService, FormBuilder,
ListMessageTemplateService, ConfirmationService,
ListWorkFlowsService AppService,
], EditMessageTemplateService,
bootstrap: [AppComponent] EditWorkflowTemplateService
],
bootstrap: [AppComponent]
}) })
export class AppModule { export class AppModule {
constructor() { // tslint:disable-next-line:no-empty
} constructor() {
}
} }
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router'; import { RouterModule, Routes } from '@angular/router';
import { EditMessageTemplateComponent } from './components/edit-message-template/edit-message-template.component'; import { EditMessageTemplateComponent } from './components/edit-message-template/edit-message-template.component';
import { EditWorkflowTemplateComponent } from "./components/edit-workflow-template/edit-workflow-template.component";
import { ListMessageTemplateComponent } from './components/list-message-template/list-message-template.component'; import { ListMessageTemplateComponent } from './components/list-message-template/list-message-template.component';
import { ListWorkFlowsComponent } from './components/list-work-flows/list-work-flows.component'; import { ListWorkFlowsComponent } from './components/list-work-flows/list-work-flows.component';
...@@ -12,65 +13,75 @@ import { IframePageComponent } from './oneit/components/iframe-page/iframe-page. ...@@ -12,65 +13,75 @@ import { IframePageComponent } from './oneit/components/iframe-page/iframe-page.
import { AuthGuard } from './oneit/guards/auth.guard'; import { AuthGuard } from './oneit/guards/auth.guard';
export const routes: Routes = [ export const routes: Routes = [
{ {
path: '', path: '',
redirectTo: 'home', redirectTo: 'home',
pathMatch: 'full' pathMatch: 'full'
},
{
path: '',
component: FullLayoutComponent,
data: {
showDefaultHeader: true,
showDefaultFooter: true,
showMenu: true,
showFeedback: true
}, },
children: [ {
{ path: '',
path: 'access-denied', component: FullLayoutComponent,
component: AccessDeniedComponent data: {
}, showDefaultHeader: true,
{ showDefaultFooter: true,
path: 'home', showMenu: true,
canActivate: [AuthGuard], showFeedback: true
component: HomeComponent },
}, children: [
{ {
path: 'iframe-page/:url', path: 'access-denied',
canActivate: [AuthGuard], component: AccessDeniedComponent
component: IframePageComponent, },
runGuardsAndResolvers: 'always' {
}, path: 'home',
{ canActivate: [AuthGuard],
path: 'edit-message-template', component: HomeComponent
component: EditMessageTemplateComponent, },
canActivate: [AuthGuard] {
}, path: 'iframe-page/:url',
{ canActivate: [AuthGuard],
path: 'edit-message-template/:id', component: IframePageComponent,
component: EditMessageTemplateComponent, runGuardsAndResolvers: 'always'
canActivate: [AuthGuard] },
}, {
{ path: 'edit-message-template',
path: 'list-message-template', component: EditMessageTemplateComponent,
component: ListMessageTemplateComponent, canActivate: [AuthGuard]
canActivate: [AuthGuard] },
}, {
{ path: 'edit-message-template/:id',
path: 'list-work-flows', component: EditMessageTemplateComponent,
component: ListWorkFlowsComponent, canActivate: [AuthGuard]
canActivate: [AuthGuard] },
} {
] path: 'list-message-template',
} component: ListMessageTemplateComponent,
// Don't forget to add below line in app.module.ts canActivate: [AuthGuard]
// entryComponents: [CustomHeaderComponent], },
{
path: 'list-work-flows',
component: ListWorkFlowsComponent,
canActivate: [AuthGuard]
},
{
path: 'edit-workflow-template',
component: EditWorkflowTemplateComponent,
canActivate: [AuthGuard]
},
{
path: 'edit-workflow-template/:id',
component: EditWorkflowTemplateComponent,
canActivate: [AuthGuard]
}
]
}
// Don't forget to add below line in app.module.ts
// entryComponents: [CustomHeaderComponent],
]; ];
@NgModule({ @NgModule({
imports: [RouterModule.forRoot(routes, {useHash: true, onSameUrlNavigation: 'reload'})], imports: [RouterModule.forRoot(routes, {useHash: true, onSameUrlNavigation: 'reload'})],
exports: [RouterModule] exports: [RouterModule]
}) })
export class AppRoutingModule { export class AppRoutingModule {
} }
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { PlaceholderOptionsModel } from './models/placeholderOptions.model'; import { PlaceholderOptionsEnum } from './models/placeholderOptions.enum';
import { TemplateTypeModel } from './models/templateTypeModel'; import { TemplateTypeEnum } from './models/templateType.enum';
import { EnumService } from './oneit/services/enum.service'; import { EnumService } from './oneit/services/enum.service';
import { SearchService } from './oneit/services/search.service';
import { UtilsService } from './oneit/services/utils.service';
@Injectable() @Injectable()
export class AppService { export class AppService {
HiringTeam = 'ID:37952977'; HiringTeam = 'ID:37952977';
constructor( constructor(
private enumService: EnumService private enumService: EnumService,
) { private searchService: SearchService,
private utilsService: UtilsService
} ) {
getMessageTemplateTypeEnum(): Observable<Array<TemplateTypeModel>> { }
return this.enumService.getEnums('TemplateTypes', true);
} getMessageTemplateTypeEnum(): Observable<Array<TemplateTypeEnum>> {
return this.enumService.getEnums('TemplateTypes', true);
getPlaceholderOptionsEnum(): Observable<Array<PlaceholderOptionsModel>> { }
return this.enumService.getEnums('PlaceholderOptions', true);
} getPlaceholderOptionsEnum(): Observable<Array<PlaceholderOptionsEnum>> {
return this.enumService.getEnums('PlaceholderOptions', true);
// Helper functions }
moveCreatedToUpdated(data, createdObjs, updatedObjs, deletedObjs = null): void { getTypes(serviceName: string): Observable<Array<any>> {
Object.keys(createdObjs) return this.enumService.getEnums(serviceName, true);
.forEach(nData => { }
if (data.created[nData]) {
updatedObjs[data.created[nData]] = createdObjs[nData]; getSearchListing(serviceName: string, queryType: string, queryParams, assocs, searchName): Observable<Array<any>> {
updatedObjs[data.created[nData]].ObjectID = data.created[nData]; return this.searchService.searchAndSaveSearchRequest(serviceName, queryType,
// tslint:disable-next-line:no-dynamic-delete queryParams, assocs, null, null, null, null, searchName, false)
delete createdObjs[nData]; .map(
} data =>
}); this.utilsService.convertResponseToObjects(data, assocs)
if (deletedObjs) { );
Object.keys(deletedObjs)
.forEach(nData => {
if (data.deleted.indexOf(nData) > -1) {
// tslint:disable-next-line:no-dynamic-delete
delete deletedObjs[nData];
}
});
} }
}
} }
...@@ -4,16 +4,16 @@ import { UtilsService } from '../../oneit/services/utils.service'; ...@@ -4,16 +4,16 @@ import { UtilsService } from '../../oneit/services/utils.service';
export class BaseComponent implements OnDestroy { export class BaseComponent implements OnDestroy {
isLoading = false; isLoading = false;
subscriptions: Array<Subscription> = []; subscriptions: Array<Subscription> = [];
constructor( constructor(
protected utilService: UtilsService protected utilService: UtilsService
) { ) {
} }
ngOnDestroy(): void { ngOnDestroy(): void {
this.utilService.unsubscribeSubscriptions(this.subscriptions); this.utilService.unsubscribeSubscriptions(this.subscriptions);
} }
} }
<form #form="ngForm"> <form #form="ngForm">
<div class="ui-g ui-fluid"> <div class="ui-g ui-fluid">
<div class="ui-g-12 nopad"> <div class="ui-g-12 nopad">
<p-toolbar> <p-toolbar>
<div class="ui-toolbar-group-left"> <div class="ui-toolbar-group-left">
{{editMode ? "Edit" : "Add"}} Message Template {{editMode ? "Edit" : "Add"}} Message Template
</div>
</p-toolbar>
</div> </div>
</p-toolbar>
</div> </div>
</div> <div class="ui-g form-group">
<div class="ui-g form-group"> <div class="ui-g-12 ui-md-3">
<div class="ui-g-12 ui-md-3"> <img data-elementID="image_sidePanel" title="sidePanel"
<img data-elementID="image_sidePanel" title="sidePanel" src="assets/images/SelectPanel_MessageFlow.png"/>
src="/assets/images/SelectPanel_MessageFlow.png"/>
</div>
<div class="ui-g-12 ui-md-9">
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-4 s-a-center">
<label>Message Template</label>
</div>
<div class="ui-g-12 ui-md-4 ui-fluid">
<input [(ngModel)]="messageTemplate.TemplateName" name="MessageTemplate{{messageTemplate.ObjectID}}"
fieldLabel="Message Template" type="text" [disabled]="showLoader" pInputText
class="form-control ui-inputtext" id="MessageTemplate{{messageTemplate.ObjectID}}">
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-4">
<label>Message Template Type</label>
</div>
<div class="ui-g-12 ui-md-4 ui-fluid">
<p-dropdown [(ngModel)]="messageTemplate.TemplateType"
name="MessageTemplateType{{messageTemplate.ObjectID}}" fieldLabel="Message Template Type"
[options]="messageTemplateTypes" optionLabel="Description" [disabled]="showLoader"
(onChange)="storeMessageContent()">
</p-dropdown>
</div>
</div>
<div class="ui-g form-group" *ngIf="emailTemplateType()">
<div class="ui-g-12 ui-md-4 s-a-center">
<label>Subject</label>
</div>
<div class="ui-g-12 ui-md-4 ui-fluid">
<input id="subjectInputId" [(ngModel)]="messageTemplate.Subject" name="Subject{{messageTemplate.ObjectID}}"
fieldLabel="Subject" placeholder="Subject" type="text" pInputText class="form-control ui-inputtext"
[disabled]="showLoader">
</div>
<div class="ui-g-12 ui-md-4">
<p-dropdown [(ngModel)]="subjectPlaceholder" name="SubjectOption{{messageTemplate.ObjectID}}"
[options]="subjectPlaceholderOptions" optionLabel="Description"
(onChange)="addPlaceholderInSubject()" [disabled]="showLoader">
</p-dropdown>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-4">
<label> Message Content </label>
</div>
<div class="ui-g-12 ui-md-4" *ngIf="emailTemplateType()">
</div> </div>
<div class="ui-g-12 ui-md-4"> <div class="ui-g-12 ui-md-9">
<p-dropdown [(ngModel)]="contentPlaceholder" name="ContentOption{{messageTemplate.ObjectID}}" <div class="ui-g form-group">
[options]="contentPlaceholderOptions" optionLabel="Description" <div class="ui-g-12 ui-md-4 s-a-center">
(onChange)="addPlaceholderInMessageContent($event)" [disabled]="showLoader"> <label>Message Template</label>
</p-dropdown> </div>
<p-overlayPanel #contentLinkModal> <div class="ui-g-12 ui-md-4 ui-fluid">
<label class="ui-g-12" style="padding-left: 0;">Please enter anchor text</label> <input [(ngModel)]="messageTemplate.TemplateName" name="MessageTemplate{{messageTemplate.ObjectID}}"
<input pInputText name="contentLinkModal" type="text" class="ui-g-12" fieldLabel="Message Template" type="text" [disabled]="showLoader" pInputText
style="font-size:15px !important;height:25px !important;" [(ngModel)]="this.linkText" id="overlay"> class="form-control ui-inputtext" id="MessageTemplate{{messageTemplate.ObjectID}}">
<p-button class="ui-button-success" </div>
(click)="addAnchorText(true); contentLinkModal.hide()">Add </div>
</p-button> <div class="ui-g form-group">
<p-button class="ui-button-danger" <div class="ui-g-12 ui-md-4">
(click)="addAnchorText(false); contentLinkModal.hide()">Cancel <label>Message Template Type</label>
</p-button> </div>
</p-overlayPanel> <div class="ui-g-12 ui-md-4 ui-fluid">
</div> <p-dropdown [(ngModel)]="messageTemplate.TemplateType"
</div> name="MessageTemplateType{{messageTemplate.ObjectID}}"
<div class="ui-g form-group"> fieldLabel="Message Template Type"
<div class="ui-g-12 ui-md-12"> [options]="messageTemplateTypes" optionLabel="Description" [disabled]="showLoader"
<p-editor *ngIf="emailTemplateType()" [(ngModel)]="messageTemplate.MessageContent" (onChange)="storeMessageContent()">
name="MessageContent{{messageTemplate.ObjectID}}" </p-dropdown>
#messageContent </div>
fieldLabel="Message Content"> </div>
<p-header> <div class="ui-g form-group" *ngIf="emailTemplateType()">
<div class="ui-g-12 ui-md-4 s-a-center">
<label>Subject</label>
</div>
<div class="ui-g-12 ui-md-4 ui-fluid">
<input id="subjectInputId" [(ngModel)]="messageTemplate.Subject"
name="Subject{{messageTemplate.ObjectID}}"
fieldLabel="Subject" placeholder="Subject" type="text" pInputText
class="form-control ui-inputtext"
[disabled]="showLoader">
</div>
<div class="ui-g-12 ui-md-4">
<p-dropdown [(ngModel)]="subjectPlaceholder" name="SubjectOption{{messageTemplate.ObjectID}}"
[options]="subjectPlaceholderOptions" optionLabel="Description"
(onHide)="addPlaceholderInSubject()" [disabled]="showLoader">
</p-dropdown>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-4">
<label> Message Content </label>
</div>
<div class="ui-g-12 ui-md-4" *ngIf="emailTemplateType()">
</div>
<div class="ui-g-12 ui-md-4">
<p-dropdown [(ngModel)]="contentPlaceholder"
name="ContentOption{{messageTemplate.ObjectID}}"
[options]="contentPlaceholderOptions" optionLabel="Description"
(onChange)="addPlaceholderInMessageContent($event)" [disabled]="showLoader">
</p-dropdown>
<p-overlayPanel #contentLinkModal>
<label class="ui-g-12" style="padding-left: 0;">Please enter anchor text</label>
<input pInputText name="contentLinkModal" type="text" class="ui-g-12"
style="font-size:15px !important;height:25px !important;" [(ngModel)]="this.linkText"
id="overlay">
<p-button class="ui-button-success"
(click)="addAnchorText(true); contentLinkModal.hide()">Add
</p-button>
<p-button class="ui-button-danger"
(click)="addAnchorText(false); contentLinkModal.hide()">Cancel
</p-button>
</p-overlayPanel>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-12">
<p-editor *ngIf="emailTemplateType()" [(ngModel)]="messageTemplate.MessageContent"
name="MessageContent{{messageTemplate.ObjectID}}"
#messageContent
fieldLabel="Message Content">
<p-header>
<span class="ql-formats"> <span class="ql-formats">
<button class="ql-bold" aria-label="Bold"></button> <button class="ql-bold" aria-label="Bold"></button>
<button class="ql-italic" aria-label="Italic"></button> <button class="ql-italic" aria-label="Italic"></button>
<button class="ql-underline" aria-label="Underline"></button> <button class="ql-underline" aria-label="Underline"></button>
</span> </span>
<span class="ql-formats"> <span class="ql-formats">
<button class="ql-list" aria-label="Bullet" value="bullet"></button> <button class="ql-list" aria-label="Bullet" value="bullet"></button>
<button class="ql-link" aria-label="Link"></button> <button class="ql-link" aria-label="Link"></button>
</span> </span>
</p-header> </p-header>
</p-editor> </p-editor>
<textarea id="messageContentTxtAreaId" *ngIf="smsTemplateType()" pInputTextarea <textarea id="messageContentTxtAreaId" *ngIf="smsTemplateType()" pInputTextarea
[(ngModel)]="messageTemplate.MessageContent" [(ngModel)]="messageTemplate.MessageContent"
name="MessageContent{{messageTemplate.ObjectID}}" name="MessageContent{{messageTemplate.ObjectID}}"
fieldLabel="Message Content" style="width: 100%" placeholder="Message Content"></textarea> fieldLabel="Message Content" style="width: 100%" placeholder="Message Content"></textarea>
</div> </div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-12">
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-3 ui-fluid">
<p-button label="Cancel" [disabled]="showLoader" routerLink="/edit-message-template"></p-button>
</div>
<div class="ui-g-12 ui-md-3 ui-fluid">
<p-button *ngIf="showSaveBtn()" label="Save" [disabled]="showLoader"
(onClick)="saveMessageTemplate()">
</p-button>
</div> </div>
<div class="ui-g-12 ui-md-3 ui-fluid"> <div class="ui-g form-group">
<p-button *ngIf="showSaveCopyBtn()" label="Save As a Copy" [disabled]="showLoader" <div class="ui-g-12 ui-md-12">
(onClick)="saveMessageTemplate(true)" <div class="ui-g form-group">
> <div class="ui-g-12 ui-md-3 ui-fluid">
</p-button> <p-button label="Cancel" [disabled]="showLoader"
routerLink="/edit-message-template"></p-button>
</div>
<div class="ui-g-12 ui-md-3 ui-fluid">
<p-button *ngIf="showSaveBtn()" label="Save" [disabled]="showLoader"
(onClick)="saveMessageTemplate()">
</p-button>
</div>
<div class="ui-g-12 ui-md-3 ui-fluid">
<p-button *ngIf="showSaveCopyBtn()" label="Save As a Copy" [disabled]="showLoader"
(onClick)="saveMessageTemplate(true)">
</p-button>
</div>
</div>
</div>
</div> </div>
</div>
</div> </div>
</div>
</div> </div>
</div> <div id="showPlainText"></div>
<div id="showPlainText"></div> <p-progressSpinner *ngIf="showLoader"></p-progressSpinner>
<p-progressSpinner *ngIf="showLoader"></p-progressSpinner>
</form> </form>
...@@ -6,295 +6,308 @@ import { OverlayPanel } from 'primeng/overlaypanel'; ...@@ -6,295 +6,308 @@ import { OverlayPanel } from 'primeng/overlaypanel';
import { Subscription } from 'rxjs/Subscription'; import { Subscription } from 'rxjs/Subscription';
import { AppService } from '../../app.service'; import { AppService } from '../../app.service';
import { SERVICES } from '../../constants'; import { SERVICES } from '../../constants';
import { MessageTemplateModel } from '../../models/messageTemplateModel'; import { MessageTemplateModel } from '../../models/messageTemplate.model';
import { PlaceholderOptionsModel } from '../../models/placeholderOptions.model'; import { PlaceholderOptionsEnum } from '../../models/placeholderOptions.enum';
import { TemplateTypeModel } from '../../models/templateTypeModel'; import { TemplateTypeEnum } from '../../models/templateType.enum';
import { SaveService } from '../../oneit/services/save.service'; import { SaveService } from '../../oneit/services/save.service';
import { UtilsService } from '../../oneit/services/utils.service'; import { UtilsService } from '../../oneit/services/utils.service';
import { BaseComponent } from '../base/base.component'; import { BaseComponent } from '../base/base.component';
import { EditMessageTemplateService } from './edit-message-template.service'; import { EditMessageTemplateService } from './edit-message-template.service';
@Component({ @Component({
selector: 'app-edit-message-template', selector: 'app-edit-message-template',
templateUrl: './edit-message-template.component.html' templateUrl: './edit-message-template.component.html'
}) })
export class EditMessageTemplateComponent extends BaseComponent implements OnInit { export class EditMessageTemplateComponent extends BaseComponent implements OnInit {
subscriptions: Array<Subscription> = []; subscriptions: Array<Subscription> = [];
@ViewChild('form') form: NgForm; @ViewChild('form') form: NgForm;
@ViewChild('messageContent') messageContentEditor: Editor; @ViewChild('messageContent') messageContentEditor: Editor;
@ViewChild('contentLinkModal') contentLinkModal: OverlayPanel; @ViewChild('contentLinkModal') contentLinkModal: OverlayPanel;
createdObjs; createdObjs;
updatedObjs; updatedObjs;
deletedObjs; deletedObjs;
messageTemplate = new MessageTemplateModel(); messageTemplate = new MessageTemplateModel();
messageTemplateTypes: Array<TemplateTypeModel>; messageTemplateTypes: Array<TemplateTypeEnum>;
subjectPlaceholderOptions: Array<PlaceholderOptionsModel>; subjectPlaceholderOptions: Array<PlaceholderOptionsEnum>;
contentPlaceholderOptions: Array<PlaceholderOptionsModel>; contentPlaceholderOptions: Array<PlaceholderOptionsEnum>;
subjectPlaceholder: PlaceholderOptionsModel; ContentPlaceholderOptionsEnum: Array<PlaceholderOptionsEnum>;
contentPlaceholder: PlaceholderOptionsModel; subjectPlaceholder: PlaceholderOptionsEnum;
contentCursorPoint; contentPlaceholder: PlaceholderOptionsEnum;
temporaryMessageContent = ''; contentCursorPoint;
linkText = ''; temporaryMessageContent = '';
showLoader = false; linkText = '';
editMode = false; showLoader = false;
editMode = false;
constructor(
private router: Router, constructor(
private activatedRoute: ActivatedRoute, private router: Router,
private utilsService: UtilsService, private activatedRoute: ActivatedRoute,
private saveService: SaveService, private utilsService: UtilsService,
private appService: AppService, private saveService: SaveService,
private editMessageTemplateService: EditMessageTemplateService private appService: AppService,
) { private editMessageTemplateService: EditMessageTemplateService
super(utilsService); ) {
} super(utilsService);
}
ngOnInit(): void {
this.createdObjs = {}; ngOnInit(): void {
this.updatedObjs = {}; this.createdObjs = {};
this.deletedObjs = {}; this.updatedObjs = {};
this.utilsService.resetCounter(); this.deletedObjs = {};
this.showLoader = true; this.utilsService.resetCounter();
this.getPlaceholderOptions(); this.showLoader = true;
setTimeout(() => { this.getPlaceholderOptions();
this.subscriptions.push(this.appService.getMessageTemplateTypeEnum() setTimeout(() => {
.subscribe( this.subscriptions.push(this.appService.getMessageTemplateTypeEnum()
data => { .subscribe(
this.messageTemplateTypes = data; data => {
this.subscriptions.push(this.activatedRoute.params this.messageTemplateTypes = data;
.subscribe( this.subscriptions.push(this.activatedRoute.params
(params: Params) => { .subscribe(
if (params.id && params.id !== '0') { (params: Params) => {
this.editMode = true; if (params.id && params.id !== '0') {
this.getMessageTemplateByID(params.id); this.editMode = true;
} else { this.getMessageTemplateByID(params.id);
// TODO: Hardcoded for now } else {
this.messageTemplate.HiringTeam = this.appService.HiringTeam; // TODO: Hardcoded for now
if (this.messageTemplateTypes) { this.messageTemplate.HiringTeam = this.appService.HiringTeam;
this.messageTemplate.TemplateType = this.messageTemplateTypes[0]; if (this.messageTemplateTypes) {
this.messageTemplate.TemplateType = this.messageTemplateTypes[0];
}
this.utilsService.createObject(this.messageTemplate, this.createdObjs);
this.setInputListener();
this.showLoader = false;
}
}
));
},
error => {
this.utilsService.handleError(error);
} }
this.utilsService.createObject(this.messageTemplate, this.createdObjs); )
this.setInputListener(); );
this.showLoader = false; }, 0);
} }
showSaveBtn(): boolean {
return this.messageTemplate && this.messageTemplate.ObjectID ?
(this.messageTemplate.HiringTeam === this.appService.HiringTeam) : false;
}
showSaveCopyBtn(): boolean {
return this.messageTemplate && this.messageTemplate.ObjectID ?
(!!this.messageTemplate.HiringTeam) : false;
}
setInputListener(): void {
let editElement;
setTimeout(() => {
if (this.emailTemplateType()) {
editElement = this.messageContentEditor.getQuill().container;
if (editElement) {
['keyup', 'click'].forEach(event => {
editElement.addEventListener(event, () => {
this.contentCursorPoint = this.messageContentEditor.getQuill()
.getSelection().index;
});
});
}
} else {
editElement = document.getElementById('messageContentTxtAreaId');
if (editElement) {
['keyup', 'click'].forEach(event => {
editElement.addEventListener(event, () => {
this.contentCursorPoint = this.getCursorPos(editElement);
});
});
} }
));
}, }
error => {
this.utilsService.handleError(error); }, 0);
} }
)
); addAnchorText(show: boolean): void {
}, 0); if (show) {
} const delta = {
ops: [
showSaveBtn(): boolean { {retain: this.contentCursorPoint},
return this.messageTemplate && this.messageTemplate.ObjectID ? {insert: this.contentPlaceholder.Placeholder, attributes: {link: this.linkText}}
(this.messageTemplate.HiringTeam === this.appService.HiringTeam) : false; ]
} };
this.messageContentEditor.getQuill()
showSaveCopyBtn(): boolean { .updateContents(delta);
return this.messageTemplate && this.messageTemplate.ObjectID ? } else {
(!!this.messageTemplate.HiringTeam) : false; this.linkText = '';
}
setInputListener(): void {
let editElement;
setTimeout(() => {
if (this.emailTemplateType()) {
editElement = this.messageContentEditor.getQuill().container;
if (editElement) {
['keyup', 'click'].forEach(event => {
editElement.addEventListener(event, () => {
this.contentCursorPoint = this.messageContentEditor.getQuill()
.getSelection().index;
});
});
} }
}
addPlaceholderInMessageContent($event): void {
} else { if (typeof this.contentCursorPoint === 'number') {
if (this.emailTemplateType()) {
if (this.contentPlaceholder.IsLink) {
this.contentLinkModal.toggle($event);
} else {
this.messageContentEditor.getQuill()
.insertText(this.contentCursorPoint, this.contentPlaceholder.Placeholder);
}
} else {
const textarea: HTMLTextAreaElement = document.getElementById('messageContentTxtAreaId') as HTMLTextAreaElement;
this.setValueAndFocus(textarea, 'messageContentTxtArea', this.contentPlaceholder.Placeholder);
}
if (editElement) {
editElement = document.getElementById('messageContentTxtAreaId');
['keyup', 'click'].forEach(event => {
editElement.addEventListener(event, () => {
this.contentCursorPoint = this.getCursorPos(editElement);
});
});
} }
}
}, 0);
}
addAnchorText(show: boolean): void {
if (show) {
const delta = {
ops: [
{retain: this.contentCursorPoint},
{insert: this.contentPlaceholder.Placeholder, attributes: {link: this.linkText}}
]
};
this.messageContentEditor.getQuill()
.updateContents(delta);
} else {
this.linkText = '';
} }
}
addPlaceholderInMessageContent($event): void { showPlainText(HTMLTitle: string): string {
const temp = document.getElementById('showPlainText');
temp.innerHTML = HTMLTitle;
const title = temp.innerText.trim();
temp.innerHTML = '';
if (typeof this.contentCursorPoint === 'number') { return title;
}
if (this.emailTemplateType()) { storeMessageContent(): void {
if (this.contentPlaceholder.IsLink) {
this.contentLinkModal.toggle($event); if (this.messageTemplate.MessageContent !== undefined) {
} else {
this.messageContentEditor.getQuill() if (this.messageTemplate.TemplateType.Description === 'SMS') {
.insertText(this.contentCursorPoint, this.contentPlaceholder.Placeholder); this.temporaryMessageContent = this.messageTemplate.MessageContent;
this.messageTemplate.MessageContent = this.showPlainText(this.temporaryMessageContent);
} else {
this.messageTemplate.MessageContent = this.temporaryMessageContent !== '' ? this.temporaryMessageContent
: this.messageTemplate.MessageContent;
}
}
if (this.ContentPlaceholderOptionsEnum) {
if (this.emailTemplateType()) {
this.contentPlaceholderOptions = this.ContentPlaceholderOptionsEnum.filter(option => option.ShowForContent);
} else {
this.contentPlaceholderOptions = this.ContentPlaceholderOptionsEnum
.filter(option => option.ShowForContent && option.Value !== 'JOB_LINK');
}
} }
} else {
const textarea: HTMLTextAreaElement = document.getElementById('messageContentTxtAreaId') as HTMLTextAreaElement;
this.setValueAndFocus(textarea, 'messageContentTxtArea', this.contentPlaceholder.Placeholder);
}
this.setInputListener();
} }
} addPlaceholderInSubject(): void {
if (this.emailTemplateType()) {
const input: HTMLInputElement = document.getElementById('subjectInputId') as HTMLInputElement;
this.setValueAndFocus(input, 'subjectInput', this.subjectPlaceholder.Placeholder);
}
}
showPlainText(HTMLTitle: string): string { getCursorPos(input): number {
const temp = document.getElementById('showPlainText'); if ('selectionStart' in input && document.activeElement === input) {
temp.innerHTML = HTMLTitle; return input.selectionStart;
const title = temp.innerText.trim(); }
temp.innerHTML = '';
return title; return -1;
} }
storeMessageContent(): void { getMessageTemplateByID(id): void {
if (this.messageTemplate.MessageContent !== undefined) { this.showLoader = true;
this.createdObjs = {};
this.updatedObjs = {};
this.deletedObjs = {};
this.utilsService.resetCounter();
this.utilsService.clearErrorMessages();
if (this.messageTemplate.TemplateType.Description === 'SMS') { this.subscriptions.push(this.editMessageTemplateService.getMessageTemplateByID(id, [])
this.temporaryMessageContent = this.messageTemplate.MessageContent; .subscribe(
this.messageTemplate.MessageContent = this.showPlainText(this.temporaryMessageContent); data => {
} else { this.messageTemplate = data;
this.messageTemplate.MessageContent = this.temporaryMessageContent !== '' ? this.temporaryMessageContent this.updatedObjs[this.messageTemplate.ObjectID] = this.messageTemplate;
: this.messageTemplate.MessageContent; this.showLoader = false;
} setTimeout(() => this.setInputListener(), 0);
},
error => {
this.showLoader = false;
this.utilsService.handleError(error);
}
)
);
}
saveMessageTemplate(saveCopy = false): void {
this.utilsService.clearErrorMessages();
const service = `svc/${saveCopy ? SERVICES.SAVE_MESSAGE_AS_COPY : SERVICES.SAVE}`;
if (this.form.invalid) {
this.utilsService.showAllErrorMessages();
} else {
this.showLoader = true;
this.subscriptions.push(this.saveService.saveObjects(service, this.createdObjs, this.updatedObjs, this.deletedObjs)
.subscribe(
() => {
this.utilsService.handleSuccess();
this.router.navigate(['/list-message-template']);
},
error => {
this.showLoader = false;
this.utilsService.handleError(error);
}
)
);
}
} }
} getPlaceholderOptions(): void {
this.subscriptions.push(this.appService.getPlaceholderOptionsEnum()
.subscribe(options => {
this.ContentPlaceholderOptionsEnum = options;
this.contentPlaceholderOptions = this.ContentPlaceholderOptionsEnum.filter(option => option.ShowForContent);
this.subjectPlaceholderOptions = this.ContentPlaceholderOptionsEnum.filter(option => option.ShowForSubject);
})
);
}
addPlaceholderInSubject(): void { emailTemplateType(): boolean {
if (this.emailTemplateType()) { return this.messageTemplate && this.messageTemplate.TemplateType ?
const input: HTMLInputElement = document.getElementById('subjectInputId') as HTMLInputElement; this.messageTemplate.TemplateType.Value === 'EMAIL' :
this.setValueAndFocus(input, 'subjectInput', this.subjectPlaceholder.Placeholder); false;
} }
}
getCursorPos(input): number { smsTemplateType(): boolean {
if ('selectionStart' in input && document.activeElement === input) { return this.messageTemplate && this.messageTemplate.TemplateType ?
return input.selectionStart; this.messageTemplate.TemplateType.Value === 'SMS' :
false;
} }
return -1; setValueAndFocus(element, elementId, placeholder): void {
} const start = element.selectionStart;
const end = element.selectionEnd;
getMessageTemplateByID(id): void { element.value = `${element.value.substring(0, start)}${placeholder}${element.value.substring(end)}`;
this.focusField(elementId);
this.showLoader = true; element.selectionEnd = end + placeholder.length;
this.createdObjs = {}; }
this.updatedObjs = {};
this.deletedObjs = {}; focusField(elementId: string): void {
this.utilsService.resetCounter(); setTimeout(() => {
this.utilsService.clearErrorMessages(); try {
document.getElementById(`${elementId}Id`)
this.subscriptions.push(this.editMessageTemplateService.getMessageTemplateByID(id, []) .focus();
.subscribe( document.getElementById(`${elementId}Id`)
data => { .getElementsByTagName('input')[0]
this.messageTemplate = data; .focus();
this.updatedObjs[this.messageTemplate.ObjectID] = this.messageTemplate; } catch (e) {
this.showLoader = false; // ignore this.
setTimeout(() => this.setInputListener(), 0); }
}, }, 0);
error => {
this.showLoader = false;
this.utilsService.handleError(error);
}
)
);
}
saveMessageTemplate(saveCopy = false): void {
this.utilsService.clearErrorMessages();
const service = `svc/${saveCopy ? SERVICES.SAVE_MESSAGE_AS_COPY : SERVICES.SAVE}`;
if (this.form.invalid) {
this.utilsService.showAllErrorMessages();
} else {
this.showLoader = true;
this.subscriptions.push(this.saveService.saveObjects(service, this.createdObjs, this.updatedObjs, this.deletedObjs)
.subscribe(
() => {
this.utilsService.handleSuccess();
this.router.navigate(['/list-message-template']);
},
error => {
this.showLoader = false;
this.utilsService.handleError(error);
}
)
);
} }
}
getPlaceholderOptions(): void {
this.subscriptions.push(this.appService.getPlaceholderOptionsEnum()
.subscribe(options => {
this.contentPlaceholderOptions = options.filter(option => option.ShowForContent);
this.subjectPlaceholderOptions = options.filter(option => option.ShowForSubject);
})
);
}
emailTemplateType(): boolean {
return this.messageTemplate && this.messageTemplate.TemplateType ?
this.messageTemplate.TemplateType.Value === 'EMAIL' :
false;
}
smsTemplateType(): boolean {
return this.messageTemplate && this.messageTemplate.TemplateType ?
this.messageTemplate.TemplateType.Value === 'SMS' :
false;
}
setValueAndFocus(element, elementId, placeholder): void {
const start = element.selectionStart;
const end = element.selectionEnd;
element.value = `${element.value.substring(0, start)}${placeholder}${element.value.substring(end)}`;
this.focusField(elementId);
element.selectionEnd = end + placeholder.length;
}
focusField(elementId: string): void {
setTimeout(() => {
try {
document.getElementById(`${elementId}Id`)
.focus();
document.getElementById(`${elementId}Id`)
.getElementsByTagName('input')[0]
.focus();
} catch (e) {
// ignore this.
}
}, 0);
}
} }
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
import { MessageTemplateModel } from '../../models/messageTemplateModel'; import { MessageTemplateModel } from '../../models/messageTemplate.model';
import { TemplateTypeModel } from '../../models/templateTypeModel';
import { SearchService } from '../../oneit/services/search.service'; import { SearchService } from '../../oneit/services/search.service';
import { UtilsService } from '../../oneit/services/utils.service'; import { UtilsService } from '../../oneit/services/utils.service';
@Injectable() @Injectable()
export class EditMessageTemplateService { export class EditMessageTemplateService {
constructor( constructor(
private searchService: SearchService, private searchService: SearchService,
private utilsService: UtilsService private utilsService: UtilsService
) { ) {
} }
getMessageTemplateByID(id, assocs): Observable<any> { getMessageTemplateByID(id, assocs): Observable<MessageTemplateModel> {
return this.searchService.getObjectById('MessageTemplates', id, assocs) return this.searchService.getObjectById('MessageTemplates', id, assocs)
.map( .map(
data => { data => {
const objs = this.utilsService.convertResponseToObjects(data, assocs); const objs = this.utilsService.convertResponseToObjects(data, assocs);
if (objs && objs.length > 0) { if (objs && objs.length > 0) {
return objs[0]; return objs[0];
} }
} }
); );
} }
} }
<form #form="ngForm">
<div class="ui-g ui-fluid">
<div class="ui-g-12 nopad">
<p-toolbar>
<div class="ui-toolbar-group-left">
{{editMode ? "Edit" : "Add"}} Workflow Template
</div>
</p-toolbar>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<img data-elementID="image_sidePanel" title="sidePanel"
src="assets/images/SelectPanel_Workflow.png" style="width:100%"/>
</div>
<div class="ui-g-12 ui-md-10">
<div class="ui-g form-group">
<div class="ui-g-12 ui-g-offset-4 ui-md-4">
<label (click)="toggleInput($event, 'TemplateName')"
*ngIf="showLabel('TemplateName')">{{workflow.TemplateName}}</label>
<input id="TemplateNameId" *ngIf="showInput('TemplateName')" pInputText
[(ngModel)]="workflow.TemplateName"
(blur)="toggleInput($event, 'TemplateName', true)"
name="TemplateName"/>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-12">
<p-panel toggler="header" [toggleable]="true">
<p-header>
<span class="ui-panel-title" style="font-size:16px;display:inline-block;margin-top:2px">
Initial Stage (2)
</span>
</p-header>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-12">
<h4>Landing Page</h4>
<hr>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label>Button Text</label>
</div>
<div class="ui-g-12 ui-md-4 ui-fluid">
<input [(ngModel)]="workflow.LandingButtonText"
name="LandingButtonText"
fieldLabel="Landing Button Text" type="text" pInputText
class="ui-inputtext"/>
</div>
</div>
<h4>Verification Page</h4>
<hr/>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label>Header Text</label>
</div>
<div class="ui-g-12 ui-md-4 ui-fluid">
<input [(ngModel)]="workflow.VerificationHeaderText"
name="VerificationHeaderText"
fieldLabel="Verification Header Text" type="text" pInputText
class="ui-inputtext">
</div>
</div>
<h4>Application</h4>
<hr/>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label> Capture CV </label>
</div>
<div class="ui-g-12 ui-md-4">
<p-inputSwitch [(ngModel)]="workflow.CaptureCV" name="CaptureCV">
</p-inputSwitch>
</div>
<div class="ui-g-12 ui-md-2">
<label> Mandatory </label>
</div>
<div class="ui-g-12 ui-md-4">
<p-inputSwitch [(ngModel)]="workflow.IsCVMandatory" name="CaptureCV">
</p-inputSwitch>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label>Capture Cover Letter</label>
</div>
<div class="ui-g-12 ui-md-4">
<p-inputSwitch [(ngModel)]="workflow.CaptureCL" name="CaptureCV">
</p-inputSwitch>
</div>
<div class="ui-g-12 ui-md-2">
<label> Mandatory </label>
</div>
<div class="ui-g-12 ui-md-4">
<p-inputSwitch [(ngModel)]="workflow.IsCLMandatory" name="CaptureCV">
</p-inputSwitch>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label>Button Text</label>
</div>
<div class="ui-g-12 ui-md-4 ui-fluid">
<input [(ngModel)]="workflow.ApplicationButtonText"
name="ApplicationButtonText"
fieldLabel="Application Button Text" type="text" pInputText
class="ui-inputtext">
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label> Action </label>
</div>
<div class="ui-g-12 ui-md-4">
<p-dropdown [(ngModel)]="workflow.ApplicationResponseAction"
[options]="responseActions" fieldLabel="Name"
optionLabel="Name" name="ApplicationResponseAction">
</p-dropdown>
</div>
</div>
</div>
</div>
</p-panel>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-12">
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-12">
<div class="ui-g-12 card card-w-title">
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label>Header Text for Thank You page</label>
</div>
<div class="ui-g-12 ui-md-4 ui-fluid">
<input [(ngModel)]="workflowTemplate.HeaderTextforThankYoupage"
name="HeaderTextforThankYoupage{{workflowTemplate.ObjectID}}"
fieldLabel="Header Text for Thank You page" type="text" pInputText
class="ui-inputtext">
</div>
<div class="ui-g-12 ui-md-2">
<label>Secondary Text</label>
</div>
<div class="ui-g-12 ui-md-4 ui-fluid">
<input [(ngModel)]="workflowTemplate.SecondaryText"
name="SecondaryText{{workflowTemplate.ObjectID}}"
fieldLabel="Secondary Text" type="text"
pInputText class="ui-inputtext">
</div>
</div>
</div>
<div class="ui-g-12 card card-w-title">
<h4>Job Outline Page</h4>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label>Button Text</label>
</div>
<div class="ui-g-12 ui-md-4 ui-fluid">
<input [(ngModel)]="workflowTemplate.ButtonText"
name="ButtonText{{workflowTemplate.ObjectID}}"
fieldLabel="Button Text" type="text" pInputText class="ui-inputtext">
</div>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-12">
</div>
</div>
<div class="ui-g-12 card card-w-title">
<h4></h4>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label> Steps </label>
</div>
<div class="ui-g-12 ui-md-6">
</div>
<div class="ui-g-12 ui-md-4 ui-fluid">
<p-button label="Add Step"></p-button>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-12">
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-1">
<a href="#" class=" data-link " style="">::</a>
</div>
<div class="ui-g-12 ui-md-2">
<label> Requirement Fit </label>
</div>
<div class="ui-g-12 ui-md-2">
<p-button label="X"></p-button>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 "></div>
</div>
</div>
<div class="ui-g-12 card card-w-title">
<h4></h4>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label> Automatically progress to next stage </label>
</div>
<div class="ui-g-12 ui-md-10">
<p-selectButton [(ngModel)]="workflowTemplate.Automaticallyprogresstonextstage"
name="Automaticallyprogresstonextstage{{workflowTemplate.ObjectID}}"
fieldLabel="Automatically progress to next stage"
[options]="Automatically_progress_to_next_stages"
optionLabel="Description"></p-selectButton>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label> Use messaging </label>
</div>
<div class="ui-g-12 ui-md-10">
<p-selectButton [(ngModel)]="workflowTemplate.Usemessaging"
name="Usemessaging{{workflowTemplate.ObjectID}}"
fieldLabel="Use messaging"
[options]="Use_messagings"
optionLabel="Description"></p-selectButton>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-12">
<div class="ui-g-12 card card-w-title">
<h4>Message Schedule (3)</h4>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-7">
</div>
<div class="ui-g-12 ui-md-4">
<p-button label="Add Message"></p-button>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2 ui-fluid">
<p-dropdown [(ngModel)]="workflowTemplate.Dummy457"
name="Dummy457{{workflowTemplate.ObjectID}}"
fieldLabel="" [options]="s"
optionLabel="Description"></p-dropdown>
</div>
<div class="ui-g-12 ui-md-2 ui-fluid">
<input [(ngModel)]="workflowTemplate.Hrs1"
name="Hrs1{{workflowTemplate.ObjectID}}"
fieldLabel="hrs1" type="text" pInputText
class="ui-inputtext">
</div>
<div class="ui-g-12 ui-md-1 ui-fluid">
<input [(ngModel)]="workflowTemplate.Hrs1"
name="Hrs1{{workflowTemplate.ObjectID}}"
fieldLabel="hrs1" type="text" pInputText
class="ui-inputtext">
</div>
<div class="ui-g-12 ui-md-2 ui-fluid">
<p-checkbox [(ngModel)]="workflowTemplate.BusinessHrsOnly"
name="BusinessHrsOnly{{workflowTemplate.ObjectID}}"
fieldLabel="Business Hrs Only"
binary="true"></p-checkbox>
</div>
<div class="ui-g-12 ui-md-3 ui-fluid">
Send
<p-autoComplete [(ngModel)]="workflowTemplate.Messagetemplate"
name="Messagetemplate{{workflowTemplate.ObjectID}}"
fieldLabel="messagetemplate" field="XXXX"
[suggestions]="messagetemplates"
(completeMethod)="autoCompleteMessagetemplate($event)"
(onClear)="this.workflowTemplate.messagetemplate = null"
[forceSelection]="true"
[minLength]="0"></p-autoComplete>
</div>
<div class="ui-g-12 ui-md-1 ui-fluid">
<p-button label=""></p-button>
</div>
<div class="ui-g-12 ui-md-1 ui-fluid">
<p-button label="X"></p-button>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-7">
</div>
<div class="ui-g-12 ui-md-3 ui-fluid">
<a href="ConfirmEdit.html" class="popup data-link "
style="margin-left:100px"
data-fielduid="4b4d8f43ca184ecfb980" data-elementID="New">New</a>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2 ui-fluid">
<p-dropdown [(ngModel)]="workflowTemplate.Dummy461"
name="Dummy461{{workflowTemplate.ObjectID}}"
fieldLabel="" [options]="s"
optionLabel="Description"></p-dropdown>
</div>
<div class="ui-g-12 ui-md-2 ui-fluid">
<input [(ngModel)]="workflowTemplate.Hrs1"
name="Hrs1{{workflowTemplate.ObjectID}}"
fieldLabel="hrs1" type="text" pInputText
class="ui-inputtext">
</div>
<div class="ui-g-12 ui-md-1 ui-fluid">
<input [(ngModel)]="workflowTemplate.Hrs1"
name="Hrs1{{workflowTemplate.ObjectID}}"
fieldLabel="hrs1" type="text" pInputText
class="ui-inputtext">
</div>
<div class="ui-g-12 ui-md-2 ui-fluid">
<p-checkbox [(ngModel)]="workflowTemplate.BusinessHrsOnly"
name="BusinessHrsOnly{{workflowTemplate.ObjectID}}"
fieldLabel="Business Hrs Only"
binary="true"></p-checkbox>
</div>
<div class="ui-g-12 ui-md-3 ui-fluid">
Send
<p-autoComplete [(ngModel)]="workflowTemplate.Messagetemplate"
name="Messagetemplate{{workflowTemplate.ObjectID}}"
fieldLabel="messagetemplate" field="XXXX"
[suggestions]="messagetemplates"
(completeMethod)="autoCompleteMessagetemplate($event)"
(onClear)="this.workflowTemplate.messagetemplate = null"
[forceSelection]="true"
[minLength]="0"></p-autoComplete>
</div>
<div class="ui-g-12 ui-md-1 ui-fluid">
<p-button label=""></p-button>
</div>
<div class="ui-g-12 ui-md-1 ui-fluid">
<p-button label="X"></p-button>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-7">
</div>
<div class="ui-g-12 ui-md-3 ui-fluid">
<a href="ConfirmEdit.html" class="popup data-link "
style="margin-left:100px"
data-fielduid="47f59ccf968ff2d846b8" data-elementID="New">New</a>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-12">
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label> Withdrawal Process </label>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2 ui-fluid">
<input [(ngModel)]="workflowTemplate.Hrswithdraw"
name="Hrswithdraw{{workflowTemplate.ObjectID}}"
fieldLabel="hrswithdraw" type="text"
pInputText class="ui-inputtext">
</div>
<div class="ui-g-12 ui-md-2">
<label> +/- </label>
</div>
<div class="ui-g-12 ui-md-1 ui-fluid">
<input [(ngModel)]="workflowTemplate.Variationwithdraw"
name="Variationwithdraw{{workflowTemplate.ObjectID}}"
fieldLabel="variationwithdraw"
type="text" pInputText class="ui-inputtext">
</div>
<div class="ui-g-12 ui-md-2 ui-fluid">
<p-checkbox [(ngModel)]="workflowTemplate.BusinessHrsOnly"
name="BusinessHrsOnly{{workflowTemplate.ObjectID}}"
fieldLabel="Business Hrs Only"
binary="true"></p-checkbox>
</div>
<div class="ui-g-12 ui-md-3 ui-fluid">
Send
<p-autoComplete
[(ngModel)]="workflowTemplate.Messagetemplate_withdraw"
name="Messagetemplate_withdraw{{workflowTemplate.ObjectID}}"
fieldLabel="messagetemplate_withdraw" field="XXXX"
[suggestions]="messagetemplate_withdraws"
(completeMethod)="autoCompleteMessagetemplate_withdraw($event)"
(onClear)="this.workflowTemplate.messagetemplate_withdraw = null"
[forceSelection]="true" [minLength]="0"></p-autoComplete>
</div>
<div class="ui-g-12 ui-md-1 ui-fluid">
<p-button label=""></p-button>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-7">
</div>
<div class="ui-g-12 ui-md-3 ui-fluid">
<a href="ConfirmEdit.html" class="popup data-link "
style="margin-left:100px"
data-fielduid="4bf0b51cb9067bcefd94" data-elementID="New">New</a>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 "></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-7">
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-7">
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-11">
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-12">
<label> Stages </label>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-12">
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-12 ui-fluid">
<p-button label="Add Stage"></p-button>
</div>
</div>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-11">
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2 ui-fluid">
<a href="#" class=" data-link " style="" data-fielduid="4313ab5b702c04d4ac79">::</a>
</div>
<div class="ui-g-12 ui-md-9"> C+RF (3)
</div>
<div class="ui-g-12 ui-md-1">
<i class="fa fa fa-caret-down referenceCheckDropDown" style=""></i>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-12">
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-11">
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label> Steps </label>
</div>
<div class="ui-g-12 ui-md-9">
</div>
<div class="ui-g-12 ui-md-1 ui-fluid">
<p-button label="Add Step"></p-button>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-7">
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-1">
<a href="#" class=" data-link " style=""
data-fielduid="4ac0b0e3ee16fd71a618">::</a>
</div>
<div class="ui-g-12 ui-md-3">
<label> Culture Fit </label>
</div>
<div class="ui-g-12 ui-md-1">
<p-button label="X"></p-button>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-1">
<a href="#" class=" data-link " style="">::</a>
</div>
<div class="ui-g-12 ui-md-3">
<label> Role Fit </label>
</div>
<div class="ui-g-12 ui-md-1">
<p-button label="X"></p-button>
</div>
</div>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label> Automatically progress to next stage </label>
</div>
<div class="ui-g-12 ui-md-5">
<p-selectButton
[(ngModel)]="workflowTemplate.Automaticallyprogresstonextstage"
name="Automaticallyprogresstonextstage{{workflowTemplate.ObjectID}}"
fieldLabel="Automatically progress to next stage"
[options]="Automatically_progress_to_next_stages"
optionLabel="Description"></p-selectButton>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label> Use messaging </label>
</div>
<div class="ui-g-12 ui-md-5">
<p-selectButton [(ngModel)]="workflowTemplate.Usemessaging"
name="Usemessaging{{workflowTemplate.ObjectID}}"
fieldLabel="Use messaging"
[options]="Use_messagings"
optionLabel="Description"></p-selectButton>
</div>
</div>
<div class="ui-g-12 card card-w-title">
<h4>Message Schedule (3)</h4>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-7">
</div>
<div class="ui-g-12 ui-md-4">
<p-button label="Add Message"></p-button>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2 ui-fluid">
<input [(ngModel)]="workflowTemplate.Hrs1"
name="Hrs1{{workflowTemplate.ObjectID}}"
fieldLabel="hrs1" type="text" pInputText class="ui-inputtext">
</div>
<div class="ui-g-12 ui-md-1">
<label> +/- </label>
</div>
<div class="ui-g-12 ui-md-2 ui-fluid">
<input [(ngModel)]="workflowTemplate.Hrs1"
name="Hrs1{{workflowTemplate.ObjectID}}"
fieldLabel="hrs1" type="text" pInputText class="ui-inputtext">
</div>
<div class="ui-g-12 ui-md-2 ui-fluid">
<p-checkbox [(ngModel)]="workflowTemplate.BusinessHrsOnly"
name="BusinessHrsOnly{{workflowTemplate.ObjectID}}"
fieldLabel="Business Hrs Only"
binary="true"></p-checkbox>
</div>
<div class="ui-g-12 ui-md-3 ui-fluid">
Send
<p-autoComplete [(ngModel)]="workflowTemplate.Messagetemplate"
name="Messagetemplate{{workflowTemplate.ObjectID}}"
fieldLabel="messagetemplate"
field="XXXX" [suggestions]="messagetemplates"
(completeMethod)="autoCompleteMessagetemplate($event)"
(onClear)="this.workflowTemplate.messagetemplate = null"
[forceSelection]="true"
[minLength]="0"></p-autoComplete>
</div>
<div class="ui-g-12 ui-md-1 ui-fluid">
<p-button label=""></p-button>
</div>
<div class="ui-g-12 ui-md-1 ui-fluid">
<p-button label="X"></p-button>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-7">
</div>
<div class="ui-g-12 ui-md-3 ui-fluid">
<a href="ConfirmEdit.html" class="popup data-link "
style="margin-left:100px"
data-fielduid="4300843a5345a33981cb" data-elementID="New">New</a>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2 ui-fluid">
<input [(ngModel)]="workflowTemplate.Hrs1"
name="Hrs1{{workflowTemplate.ObjectID}}"
fieldLabel="hrs1" type="text" pInputText class="ui-inputtext">
</div>
<div class="ui-g-12 ui-md-1">
<label> +/- </label>
</div>
<div class="ui-g-12 ui-md-2 ui-fluid">
<input [(ngModel)]="workflowTemplate.Hrs1"
name="Hrs1{{workflowTemplate.ObjectID}}"
fieldLabel="hrs1" type="text" pInputText class="ui-inputtext">
</div>
<div class="ui-g-12 ui-md-2 ui-fluid">
<p-checkbox [(ngModel)]="workflowTemplate.BusinessHrsOnly"
name="BusinessHrsOnly{{workflowTemplate.ObjectID}}"
fieldLabel="Business Hrs Only"
binary="true"></p-checkbox>
</div>
<div class="ui-g-12 ui-md-3 ui-fluid">
Send
<p-autoComplete [(ngModel)]="workflowTemplate.Messagetemplate"
name="Messagetemplate{{workflowTemplate.ObjectID}}"
fieldLabel="messagetemplate"
field="XXXX" [suggestions]="messagetemplates"
(completeMethod)="autoCompleteMessagetemplate($event)"
(onClear)="this.workflowTemplate.messagetemplate = null"
[forceSelection]="true"
[minLength]="0"></p-autoComplete>
</div>
<div class="ui-g-12 ui-md-1 ui-fluid">
<p-button label=""></p-button>
</div>
<div class="ui-g-12 ui-md-1 ui-fluid">
<p-button label="X"></p-button>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-7">
</div>
<div class="ui-g-12 ui-md-3 ui-fluid">
<a href="ConfirmEdit.html" class="popup data-link "
style="margin-left:100px"
data-fielduid="42a7b32277f2a92f5125" data-elementID="New">New</a>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-12">
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label> Withdrawal Process </label>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2 ui-fluid">
<input [(ngModel)]="workflowTemplate.Hrswithdraw"
name="Hrswithdraw{{workflowTemplate.ObjectID}}"
fieldLabel="hrswithdraw" type="text"
pInputText class="ui-inputtext">
</div>
<div class="ui-g-12 ui-md-1">
<label> +/- </label>
</div>
<div class="ui-g-12 ui-md-2 ui-fluid">
<input [(ngModel)]="workflowTemplate.Variationwithdraw"
name="Variationwithdraw{{workflowTemplate.ObjectID}}"
fieldLabel="variationwithdraw"
type="text" pInputText class="ui-inputtext">
</div>
<div class="ui-g-12 ui-md-2 ui-fluid">
<p-checkbox [(ngModel)]="workflowTemplate.BusinessHrsOnly"
name="BusinessHrsOnly{{workflowTemplate.ObjectID}}"
fieldLabel="Business Hrs Only"
binary="true"></p-checkbox>
</div>
<div class="ui-g-12 ui-md-3 ui-fluid">
Send
<p-autoComplete [(ngModel)]="workflowTemplate.Messagetemplate_withdraw"
name="Messagetemplate_withdraw{{workflowTemplate.ObjectID}}"
fieldLabel="messagetemplate_withdraw" field="aaa"
[suggestions]="messagetemplate_withdraws"
(completeMethod)="autoCompleteMessagetemplate_withdraw($event)"
(onClear)="this.workflowTemplate.messagetemplate_withdraw = null"
[forceSelection]="true"
[minLength]="0"></p-autoComplete>
</div>
<div class="ui-g-12 ui-md-1 ui-fluid">
<p-button label=""></p-button>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-7">
</div>
<div class="ui-g-12 ui-md-3 ui-fluid">
<a href="/" class="popup data-link " style="margin-left:100px"
data-fielduid="4a509a31f98c256a38a7" data-elementID="New">New</a>
</div>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2 ui-fluid">
<p-button label="Remove Stage"></p-button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-7">
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-11">
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<a href="#" class=" data-link " style="">::</a>
</div>
<div class="ui-g-12 ui-md-9"> Shortlist (0)
</div>
<div class="ui-g-12 ui-md-1">
<i class="fa fa fa-caret-down referenceCheckDropDown" style=""></i>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-12">
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label> Steps </label>
</div>
<div class="ui-g-12 ui-md-9">
</div>
<div class="ui-g-12 ui-md-1 ui-fluid">
<p-button label="Add Step"></p-button>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label> Automatically progress to next stage </label>
</div>
<div class="ui-g-12 ui-md-5">
<p-selectButton [(ngModel)]="workflowTemplate.Automaticallyprogresstonextstage"
name="Automaticallyprogresstonextstage{{workflowTemplate.ObjectID}}"
fieldLabel="Automatically progress to next stage"
[options]="Automatically_progress_to_next_stages"
optionLabel="Description"></p-selectButton>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label> Use messaging </label>
</div>
<div class="ui-g-12 ui-md-5">
<p-selectButton [(ngModel)]="workflowTemplate.Usemessaging"
name="Usemessaging{{workflowTemplate.ObjectID}}"
fieldLabel="Use messaging"
[options]="Use_messagings"
optionLabel="Description"></p-selectButton>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2 ui-fluid">
<p-button label="Remove Stage"></p-button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-7">
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-11">
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<a href="#" class=" data-link " style="">::</a>
</div>
<div class="ui-g-12 ui-md-9"> Custom Stage (0)
</div>
<div class="ui-g-12 ui-md-1">
<i class="fa fa fa-caret-down firstRoundDropDown" style=""></i>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-12">
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-12">
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label> Steps </label>
</div>
<div class="ui-g-12 ui-md-9">
</div>
<div class="ui-g-12 ui-md-1 ui-fluid">
<p-button label="Add Step"></p-button>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label> Automatically progress to next stage </label>
</div>
<div class="ui-g-12 ui-md-5">
<p-selectButton
[(ngModel)]="workflowTemplate.Automaticallyprogresstonextstage"
name="Automaticallyprogresstonextstage{{workflowTemplate.ObjectID}}"
fieldLabel="Automatically progress to next stage"
[options]="Automatically_progress_to_next_stages"
optionLabel="Description"></p-selectButton>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label> Use messaging </label>
</div>
<div class="ui-g-12 ui-md-5">
<p-selectButton [(ngModel)]="workflowTemplate.Usemessaging"
name="Usemessaging{{workflowTemplate.ObjectID}}"
fieldLabel="Use messaging"
[options]="Use_messagings"
optionLabel="Description"></p-selectButton>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2 ui-fluid">
<p-button label="Remove Stage"></p-button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-7">
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-7">
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-11">
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-7">
<label> </label>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-11">
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
</div>
<div class="ui-g-12 ui-md-9"> Successfull (0)
</div>
<div class="ui-g-12 ui-md-1">
<i class="fa fa fa-caret-down successDropDown" style=""></i>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-12">
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-12">
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label> Automatically progress to next stage </label>
</div>
<div class="ui-g-12 ui-md-5">
<p-selectButton
[(ngModel)]="workflowTemplate.Automaticallyprogresstonextstage"
name="Automaticallyprogresstonextstage{{workflowTemplate.ObjectID}}"
fieldLabel="Automatically progress to next stage"
[options]="Automatically_progress_to_next_stages"
optionLabel="Description">
</p-selectButton>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label> Use messaging </label>
</div>
<div class="ui-g-12 ui-md-5">
<p-selectButton [(ngModel)]="workflowTemplate.Usemessaging"
name="Usemessaging{{workflowTemplate.ObjectID}}"
fieldLabel="Use messaging"
[options]="Use_messagings"
optionLabel="Description"></p-selectButton>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-7">
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-11">
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
</div>
<div class="ui-g-12 ui-md-9"> Unsuitable (0)
</div>
<div class="ui-g-12 ui-md-1">
<i class="fa fa fa-caret-down unsuitableDropDown" style=""></i>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-12">
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-12">
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label> Automatically progress to next stage </label>
</div>
<div class="ui-g-12 ui-md-5">
<p-selectButton
[(ngModel)]="workflowTemplate.Automaticallyprogresstonextstage"
name="Automaticallyprogresstonextstage{{workflowTemplate.ObjectID}}"
fieldLabel="Automatically progress to next stage"
[options]="Automatically_progress_to_next_stages"
optionLabel="Description"></p-selectButton>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label> Use messaging </label>
</div>
<div class="ui-g-12 ui-md-5">
<p-selectButton [(ngModel)]="workflowTemplate.Usemessaging"
name="Usemessaging{{workflowTemplate.ObjectID}}"
fieldLabel="Use messaging"
[options]="Use_messagings"
optionLabel="Description"></p-selectButton>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-7">
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-11">
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
</div>
<div class="ui-g-12 ui-md-9"> Withdrew (0)
</div>
<div class="ui-g-12 ui-md-1">
<i class="fa fa fa-caret-down withdrewDropDown" style=""></i>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-12">
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-12">
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label> Automatically progress to next stage </label>
</div>
<div class="ui-g-12 ui-md-5">
<p-selectButton
[(ngModel)]="workflowTemplate.Automaticallyprogresstonextstage"
name="Automaticallyprogresstonextstage{{workflowTemplate.ObjectID}}"
fieldLabel="Automatically progress to next stage"
[options]="Automatically_progress_to_next_stages"
optionLabel="Description"></p-selectButton>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label> Use messaging </label>
</div>
<div class="ui-g-12 ui-md-5">
<p-selectButton [(ngModel)]="workflowTemplate.Usemessaging"
name="Usemessaging{{workflowTemplate.ObjectID}}"
fieldLabel="Use messaging"
[options]="Use_messagings"
optionLabel="Description"></p-selectButton>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-7 ui-fluid">
<p-button label="Cancel"></p-button>
</div>
<div class="ui-g-12 ui-md-2 ui-fluid">
<p-button label="Save"></p-button>
</div>
<div class="ui-g-12 ui-md-2 ui-fluid">
<p-button label="Save As a Copy"></p-button>
</div>
</div>
</div>
</div>
<p-progressSpinner *ngIf="showLoader"></p-progressSpinner>
</form>
import { Component, OnInit, ViewChild } from '@angular/core';
import { NgForm } from '@angular/forms';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { Subscription } from 'rxjs/Subscription';
import { AppService } from '../../app.service';
import { ResponseActionEnum } from '../../models/responseAction.enum';
import { StageTypeEnum } from '../../models/stageType.enum';
import { StepTypeEnum } from '../../models/stepType.enum';
import { WorkflowTemplateModel } from '../../models/workflowTemplate.model';
import { SaveService } from '../../oneit/services/save.service';
import { UtilsService } from '../../oneit/services/utils.service';
import { BaseComponent } from '../base/base.component';
import { EditWorkflowTemplateService } from './edit-workflow-template.service';
import { WorkflowTemplate } from './edit-workflow-template.model';
@Component({
selector: 'app-edit-workflow-template',
templateUrl: './edit-workflow-template.component.html'
})
export class EditWorkflowTemplateComponent extends BaseComponent implements OnInit {
subscriptions: Array<Subscription> = [];
@ViewChild('form') form: NgForm;
createdObjs = {};
updatedObjs = {};
deletedObjs = {};
workflow = new WorkflowTemplateModel();
stageTypes: Array<StageTypeEnum>;
stepTypes: Array<StepTypeEnum>;
responseActions: Array<ResponseActionEnum>;
editField: any = {};
showLoader = false;
editMode = false;
workflowTemplate = new WorkflowTemplate();
s: Array<any> = [];
messagetemplates: Array<any> = [];
messagetemplate_withdraws: Array<any> = [];
Capture_CVs = [];
Mandatory_CVs = [];
Capture_Cover_Letters = [];
Mandatory_cover_letters = [];
Automatically_progress_to_next_stages = [];
Use_messagings = [];
constructor(
private router: Router,
private activatedRoute: ActivatedRoute,
private utilsService: UtilsService,
private saveService: SaveService,
private appService: AppService,
private editWorkflowTemplateService: EditWorkflowTemplateService
) {
super(utilsService);
}
ngOnInit(): void {
this.createdObjs = {};
this.updatedObjs = {};
this.deletedObjs = {};
this.utilsService.resetCounter();
this.showLoader = true;
this.subscriptions.push(this.activatedRoute.params
.subscribe(
(params: Params) => {
this.showLoader = true;
this.getStageTypes();
this.getStepTypes();
this.getResponseActions();
if (params.id && params.id !== '0') {
this.editMode = true;
this.getWorkflowTemplateByID(params.id);
} else {
this.utilsService.createObject(this.workflow, this.createdObjs);
this.setDefaults();
this.showLoader = false;
}
}
));
this.gets();
}
setDefaults(): void {
this.workflow.TemplateName = 'Workflow Template';
this.workflow.LandingButtonText = 'Apply Now';
this.workflow.VerificationHeaderText = 'Please verify your identity before applying to:';
this.workflow.ThankYouHeaderText = 'Thank You for your application to:';
this.workflow.ThankYouSecondaryText = 'We will get in touch with you soon';
this.workflow.ApplicationButtonText = 'Submit';
this.workflow.CaptureCV = true;
}
getStageTypes(): void {
this.subscriptions.push(
this.appService.getTypes('StageTypes')
.subscribe((types: Array<StageTypeEnum>) => {
this.stageTypes = types;
})
);
}
getStepTypes(): void {
this.subscriptions.push(
this.appService.getTypes('StepTypes')
.subscribe((types: Array<StepTypeEnum>) => {
this.stepTypes = types;
})
);
}
getResponseActions(): void {
this.subscriptions.push(
this.appService.getTypes('ResponseActions')
.subscribe((types: Array<ResponseActionEnum>) => {
this.responseActions = types;
})
);
}
showLabel(id: string): boolean {
return (this.editField[id] === undefined || this.editField[id] === false);
}
showInput(id: string): boolean {
return this.editField && !!this.editField[id];
}
toggleInput(event, fieldName, save = true): void {
this.utilsService.clearErrorMessages();
if (event.type === 'blur') {
if (!this.form.controls[fieldName].invalid) {
this.editField[fieldName] = false;
if (save) {
// save call to be sent
}
} else {
this.utilsService.showAllErrorMessages();
}
} else {
this.editField[fieldName] = true;
setTimeout(() => {
try {
document.getElementById(`${fieldName}Id`)
.focus();
document.getElementById(`${fieldName}Id`)
.getElementsByTagName('input')[0]
.focus();
} catch (e) {
// ignore this.
}
}, 0);
}
}
gets(): void {
this.subscriptions.push(this.editWorkflowTemplateService.getDummy456s([])
.subscribe(
data => {
this.s = data;
},
error => {
this.utilsService.handleError(error);
}
)
);
}
autoCompleteMessagetemplate(event): void {
this.subscriptions.push(this.editWorkflowTemplateService.getmessagetemplatesForAutocomplete(event.query, [])
.subscribe(
data => {
for (const obj of data) {
// If you need to display anything complex in autocomplete label, put that code here
// e.g. obj.Name = obj.FirstName + ' ' + obj.LastName. So that you can use "Name" attribute in HTML
}
this.messagetemplates = data;
},
error => {
this.utilsService.handleError(error);
}
)
);
}
autoCompleteMessagetemplate_withdraw(event): void {
this.subscriptions.push(this.editWorkflowTemplateService.getmessagetemplate_withdrawsForAutocomplete(event.query, [])
.subscribe(
data => {
for (const obj of data) {
// sd
}
this.messagetemplate_withdraws = data;
},
error => {
this.utilsService.handleError(error);
}
)
);
}
getWorkflowTemplateByID(id): void {
this.showLoader = true;
this.createdObjs = {};
this.updatedObjs = {};
this.deletedObjs = {};
this.utilsService.resetCounter();
this.utilsService.clearErrorMessages();
this.subscriptions.push(this.editWorkflowTemplateService.getWorkflowTemplateByID(id, [])
.subscribe(
data => {
this.workflowTemplate = data;
this.updatedObjs[this.workflowTemplate.ObjectID] = this.workflowTemplate;
this.showLoader = false;
},
error => {
this.showLoader = false;
this.utilsService.handleError(error);
}
)
);
}
saveWorkflowTemplate(reload: boolean): void {
this.utilsService.clearErrorMessages();
if (this.form.invalid) {
this.utilsService.showAllErrorMessages();
} else {
this.showLoader = true;
this.subscriptions.push(this.saveService.saveObjectsWithDefaultSvc(this.createdObjs, this.updatedObjs, this.deletedObjs)
.subscribe(
data => {
this.utilsService.handleSuccess();
if (reload) {
let idToNavigate = this.workflowTemplate.ObjectID;
if (data.created[idToNavigate]) {
idToNavigate = data.created[idToNavigate];
this.router.navigate(['/edit-workflow-template', idToNavigate]);
return;
}
this.getWorkflowTemplateByID(idToNavigate);
} else {
this.router.navigate(['']);
}
},
error => {
this.showLoader = false;
this.utilsService.handleError(error);
}
)
);
}
}
}
export class WorkflowTemplate {
ObjectID: string;
ButtonText: string;
HeaderText: string;
CaptureCV: boolean;
MandatoryCV: boolean;
CaptureCoverLetter: boolean;
Mandatorycoverletter: boolean;
HeaderTextforThankYoupage: string;
SecondaryText: string;
Automaticallyprogresstonextstage: boolean;
Hrs1: string;
BusinessHrsOnly: boolean;
Messagetemplate: any;
Hrswithdraw: string;
Variationwithdraw: string;
Messagetemplate_withdraw: any;
Usemessaging: boolean;
Dummy457: string;
messagetemplate_withdraw: string;
messagetemplate: string;
Dummy461: string;
}
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { SearchService } from '../../oneit/services/search.service';
import { UtilsService } from '../../oneit/services/utils.service';
@Injectable()
export class EditWorkflowTemplateService {
constructor(
private searchService: SearchService,
private utilsService: UtilsService
) {
}
getDummy456s(assocs): Observable<any> {
return this.searchService.getObjects('MessageTemplates', 'All', {}, assocs, null, null, null, null)
.map(
data =>
this.utilsService.convertResponseToObjects(data, assocs)
);
}
getmessagetemplate_withdrawsForAutocomplete(searchTerm, assocs): Observable<any> {
return this.searchService.getObjects('', 'All', {}, assocs, null, null, null, null)
.map(
data =>
this.utilsService.convertResponseToObjects(data, assocs)
);
}
getmessagetemplatesForAutocomplete(searchTerm, assocs): Observable<any> {
return this.searchService.getObjects('', 'All', {}, assocs, null, null, null, null)
.map(
data => {
return this.utilsService.convertResponseToObjects(data, assocs);
}
);
}
getWorkflowTemplateByID(id, assocs): Observable<any> {
return this.searchService.getObjectById('', id, assocs)
.map(
data => {
const objs = this.utilsService.convertResponseToObjects(data, assocs);
if (objs && objs.length > 0) {
return objs[0];
}
}
);
}
}
<form #form="ngForm"> <form #form="ngForm">
<div class="ui-g ui-fluid"> <div class="ui-g ui-fluid">
<div class="ui-g-12 nopad"> <div class="ui-g-12 nopad">
<p-toolbar> <p-toolbar>
<div class="ui-toolbar-group-left"> <div class="ui-toolbar-group-left">
Messages Messages
</div>
<div class="ui-toolbar-group-right actionBtn">
<button pButton type="button" routerLink="/edit-message-template" label="Add Message Template"
icon="ui-icon-"></button>
</div>
</p-toolbar>
</div> </div>
<div class="ui-toolbar-group-right actionBtn">
<button pButton type="button" routerLink="/edit-message-template" label="Add Message Template"
icon="ui-icon-"></button>
</div>
</p-toolbar>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-3">
<img data-elementID="image_sidePanel" title="sidePanel"
src="assets/images/SelectPanel_MessageFlow.png"/>
</div> </div>
<div class="ui-g-12 ui-md-9"> <div class="ui-g form-group">
<div class="ui-g-offset-3 pull-right"> <div class="ui-g-12 ui-md-3">
<label>Sort By</label> <img data-elementID="image_sidePanel" title="sidePanel"
<p-dropdown [options]="sortOptions" name="sort" [(ngModel)]="sortSelected" (onChange)="sortMessageTemplates()" src="assets/images/SelectPanel_MessageFlow.png"/>
optionLabel="description">
</p-dropdown>
</div>
<h1>My Templates</h1>
<hr/>
<div *ngFor="let message of myTemplates" class="messageTemplate">
<div class="messageRow">
<div class="templateName">
<span (click)="onRowSelect(message)">{{message.TemplateName}}</span>
</div>
<button pButton type="button" icon="ui-icon-edit" title="Edit"
(click)="onRowSelect(message)" [disabled]="showLoader">
</button>
</div>
</div>
<div *ngIf="myTemplates.length === 0" class="messageTemplate">
<div class="messageRow">
<div class="templateName">
<span>No records found.</span>
</div>
</div>
</div>
<h1>Shared Templates</h1>
<hr/>
<div *ngFor="let message of sharedTemplates" class="messageTemplate">
<div class="messageRow">
<div class="templateName">
<span (click)="onRowSelect(message)">{{message.TemplateName}}</span>
</div>
<button pButton type="button" icon="ui-icon-edit" title="Edit"
(click)="onRowSelect(message)" [disabled]="showLoader">
</button>
</div> </div>
</div> <div class="ui-g-12 ui-md-9">
<div *ngIf="sharedTemplates.length === 0" class="messageTemplate"> <div class="ui-g-offset-3 pull-right">
<div class="messageRow"> <label>Sort By</label>
<div class="templateName"> <p-dropdown [options]="sortOptions" name="sort" [(ngModel)]="sortSelected"
<span>No records found.</span> (onClick)="sortMessageTemplates()"
</div> (onShow)="setDefaultSorter()"
(onHide)="allowSort = false"
optionLabel="description">
</p-dropdown>
</div>
<h1>My Templates</h1>
<hr/>
<div *ngFor="let message of myTemplates" class="messageTemplate">
<div class="messageRow">
<div class="templateName">
<span (click)="onRowSelect(message)">{{message.TemplateName}}</span>
</div>
<button pButton type="button" icon="ui-icon-edit" title="Edit"
(click)="onRowSelect(message)" [disabled]="showLoader">
</button>
</div>
</div>
<div *ngIf="myTemplates.length === 0" class="messageTemplate">
<div class="messageRow">
<div class="templateName">
<span>No records found.</span>
</div>
</div>
</div>
<h1>Shared Templates</h1>
<hr/>
<div *ngFor="let message of sharedTemplates" class="messageTemplate">
<div class="messageRow">
<div class="templateName">
<span (click)="onRowSelect(message)">{{message.TemplateName}}</span>
</div>
<button pButton type="button" icon="ui-icon-edit" title="Edit"
(click)="onRowSelect(message)" [disabled]="showLoader">
</button>
</div>
</div>
<div *ngIf="sharedTemplates.length === 0" class="messageTemplate">
<div class="messageRow">
<div class="templateName">
<span>No records found.</span>
</div>
</div>
</div>
</div> </div>
</div>
</div> </div>
</div> <p-progressSpinner *ngIf="showLoader"></p-progressSpinner>
<p-progressSpinner *ngIf="showLoader"></p-progressSpinner>
</form> </form>
.messageTemplate { .messageTemplate {
background: #fff none repeat scroll 0 0; background: #fff none repeat scroll 0 0;
display: inline-block; display: inline-block;
width: 100%; width: 100%;
border-left: 5px solid #03ac66; border-left: 5px solid #03ac66;
box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.02); box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.02);
margin-bottom: 10px; margin-bottom: 10px;
.messageRow { .messageRow {
height: 40px; height: 40px;
padding: 15px; padding: 15px;
display: flex; display: flex;
.templateName { .templateName {
width: 95%; width: 95%;
align-self: center; align-self: center;
span { span {
cursor: pointer; cursor: pointer;
font-weight: bold; font-weight: bold;
color: #4e5258; color: #4e5258;
font-size: 18px; font-size: 18px;
} }
}
} }
}
} }
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { Subscription } from 'rxjs/Subscription'; import { Subscription } from 'rxjs/Subscription';
import { MessageTemplateModel } from '../../models/messageTemplateModel';
import { SorterModel } from '../../models/sorterModel';
import { BaseComponent } from '../base/base.component';
import { AppService } from '../../app.service'; import { AppService } from '../../app.service';
import { SEARCH, SERVICES } from '../../constants';
import { MessageTemplateModel } from '../../models/messageTemplate.model';
import { SorterModel } from '../../models/sorterModel';
import { SearchService } from '../../oneit/services/search.service'; import { SearchService } from '../../oneit/services/search.service';
import { UtilsService } from '../../oneit/services/utils.service'; import { UtilsService } from '../../oneit/services/utils.service';
import { ListMessageTemplateService } from './list-message-template.service'; import { BaseComponent } from '../base/base.component';
@Component({ @Component({
selector: 'app-list-message-template', selector: 'app-list-message-template',
templateUrl: './list-message-template.component.html', templateUrl: './list-message-template.component.html',
styleUrls: ['./list-message-template.component.scss'] styleUrls: ['./list-message-template.component.scss']
}) })
export class ListMessageTemplateComponent extends BaseComponent implements OnInit { export class ListMessageTemplateComponent extends BaseComponent implements OnInit {
subscriptions: Array<Subscription> = []; subscriptions: Array<Subscription> = [];
myTemplates: Array<MessageTemplateModel> = []; myTemplates: Array<MessageTemplateModel> = [];
sharedTemplates: Array<MessageTemplateModel> = []; sharedTemplates: Array<MessageTemplateModel> = [];
sortOptions: Array<SorterModel>; sortOptions: Array<SorterModel>;
sortSelected: SorterModel; sortSelected: SorterModel;
showLoader = false; allowSort: boolean;
showLoader = false;
constructor( constructor(
private router: Router, private router: Router,
private activatedRoute: ActivatedRoute, private activatedRoute: ActivatedRoute,
private utilsService: UtilsService, private utilsService: UtilsService,
private searchService: SearchService, private searchService: SearchService,
private appService: AppService, private appService: AppService
private listMessageTemplateService: ListMessageTemplateService ) {
) { super(utilsService);
super(utilsService); }
}
ngOnInit(): void { ngOnInit(): void {
this.sortOptions = [ this.sortOptions = [
new SorterModel('Alphabetical (A-Z)', true), new SorterModel('Alphabetical (A-Z)', true),
new SorterModel('Alphabetical (Z-A)', false) new SorterModel('Alphabetical (Z-A)', false)
]; ];
this.showLoader = true; // this.sortSelected = new SorterModel('Alphabetical (A-Z)', true);
const sharedMsgParams = { this.showLoader = true;
OnlyGlobalTemplate: true const sharedMsgParams = {
}; OnlyGlobalTemplate: true
const myMsgParams = { };
OnlyGlobalTemplate: false const myMsgParams = {
}; OnlyGlobalTemplate: false
this.subscriptions.push( };
this.listMessageTemplateService this.subscriptions.push(
.getMessageTemplates(myMsgParams, []) this.appService.getSearchListing(SERVICES.MESSAGE_TEMPLATES, 'All', myMsgParams, [], SEARCH.MESSAGE_TEMPLATE)
.subscribe( .subscribe(
messages => { messages => {
this.myTemplates = messages; this.myTemplates = messages;
}, },
error => { error => {
this.showLoader = false; this.showLoader = false;
this.utilsService.handleError(error); this.utilsService.handleError(error);
} }
)
) )
); ;
this.subscriptions.push( this.subscriptions.push(
this.listMessageTemplateService this.appService
.getMessageTemplates(sharedMsgParams, []) .getSearchListing(SERVICES.MESSAGE_TEMPLATES, 'All', sharedMsgParams, [], SEARCH.MESSAGE_TEMPLATE)
.subscribe( .subscribe(
messages => { messages => {
this.sharedTemplates = messages; this.sharedTemplates = messages;
}, },
error => { error => {
this.showLoader = false;
this.utilsService.handleError(error);
}
)
);
setTimeout(() => (this.showLoader = false), 0);
}
sortMessageTemplates(): void {
if (this.allowSort) {
this.showLoader = true;
this.myTemplates = this.utilsService.sort(this.myTemplates,
['TemplateName'], [this.sortSelected.ascending ? 1 : -1], false);
this.sharedTemplates = this.utilsService.sort(this.sharedTemplates,
['TemplateName'], [this.sortSelected.ascending ? 1 : -1], false);
this.allowSort = false;
this.showLoader = false; this.showLoader = false;
this.utilsService.handleError(error); }
}
) }
);
setTimeout(() => (this.showLoader = false), 0); setDefaultSorter(): void {
}
if (!this.sortSelected) {
this.sortSelected = new SorterModel('Alphabetical (A-Z)', true);
}
sortMessageTemplates(): void { this.allowSort = true;
this.showLoader = true; }
this.myTemplates = this.utilsService.sort(this.myTemplates,
['TemplateName'], [this.sortSelected.ascending ? 1 : -1], false);
this.sharedTemplates = this.utilsService.sort(this.sharedTemplates,
['TemplateName'], [this.sortSelected.ascending ? 1 : -1], false);
this.showLoader = false;
}
onRowSelect(data: MessageTemplateModel): void { onRowSelect(data: MessageTemplateModel): void {
this.showLoader = true; this.showLoader = true;
this.router.navigate(['/edit-message-template', data.ObjectID]); this.router.navigate(['/edit-message-template', data.ObjectID]);
} }
} }
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { SearchService } from '../../oneit/services/search.service';
import { UtilsService } from '../../oneit/services/utils.service';
@Injectable()
export class ListMessageTemplateService {
constructor(
private searchService: SearchService,
private utilsService: UtilsService
) {
}
getMessageTemplates(queryParams, assocs): Observable<any> {
return this.searchService.searchAndSaveSearchRequest('MessageTemplates', 'All',
queryParams, assocs, null, null, null, null, 'ListMessageTemplate', false)
.map(
data =>
this.utilsService.convertResponseToObjects(data, assocs)
);
}
}
<form #form="ngForm"> <form #form="ngForm">
<div class="ui-g ui-fluid"> <div class="ui-g ui-fluid">
<div class="ui-g-12 nopad"> <div class="ui-g-12 nopad">
<p-toolbar> <p-toolbar>
<div class="ui-toolbar-group-left"> <div class="ui-toolbar-group-left">
Workflows Workflows
</div>
<div class="ui-toolbar-group-right actionBtn">
<button pButton type="button" routerLink="/edit-workflow-template" label="Add Workflow Template"
icon="ui-icon-"></button>
</div>
</p-toolbar>
</div> </div>
<div class="ui-toolbar-group-right actionBtn">
<button pButton type="button" routerLink="/edit-work-flow" label="Add Workflow Template"
icon="ui-icon-"></button>
</div>
</p-toolbar>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-3">
<img data-elementID="image_sidePanel" title="sidePanel"
src="assets/images/SelectPanel_MessageFlow.png"/>
</div> </div>
<div class="ui-g-12 ui-md-9"> <div class="ui-g form-group">
<div class="ui-g form-group"> <div class="ui-g-12 ui-md-3">
<div class="ui-g-12 ui-md-7"> <img data-elementID="image_sidePanel" title="sidePanel"
</div> src="assets/images/SelectPanel_MessageFlow.png"/>
<div class="ui-g-12 ui-md-2">
<label> Order By </label>
</div> </div>
<div class="ui-g-12 ui-md-3 ui-fluid"> <div class="ui-g-12 ui-md-9">
<p-dropdown [options]="sortOptions" name="sort" [(ngModel)]="sortSelected"
(onChange)="sortWorkFlowTemplates()"
optionLabel="description">
</p-dropdown>
</div>
</div>
<div class="ui-g-12 card card-w-title">
<h4>My Templates</h4>
<div *ngFor="let workflow of myTemplates" class="ui-g form-group">
<div class="ui-g-12 ui-md-12">
<div class="ui-g form-group"> <div class="ui-g form-group">
<div class="ui-g-12 ui-md-1"> <div class="ui-g-12 ui-md-7">
<label> </label> </div>
</div> <div class="ui-g-12 ui-md-2">
<div class="ui-g-12 ui-md-8"> <label> Order By </label>
<label>{{workflow.TemplateName}}</label><br/> </div>
</div> <div class="ui-g-12 ui-md-3 ui-fluid">
<div class="ui-g-12 ui-md-3 ui-fluid"> <p-dropdown [options]="sortOptions" name="sort" [(ngModel)]="sortSelected"
<button pButton type="button" icon="ui-icon-edit" title="Edit" (onChange)="sortWorkFlowTemplates()"
(click)="onRowSelect(workflow)" [disabled]="showLoader"> optionLabel="description">
</button> </p-dropdown>
</div> </div>
</div> </div>
</div> <div class="ui-g-12 card card-w-title">
</div> <h4>My Templates</h4>
<div *ngIf="myTemplates.length === 0" class="ui-g form-group"> <div *ngFor="let workflow of myTemplates" class="ui-g form-group">
<div class="ui-g-12 ui-md-12"> <div class="ui-g-12 ui-md-12">
<div class="ui-g form-group"> <div class="ui-g form-group">
<div class="ui-g-12 ui-md-1"> <div class="ui-g-12 ui-md-1">
<label> </label> <label> </label>
</div> </div>
<div class="ui-g-12 ui-md-8"> <div class="ui-g-12 ui-md-8">
<label>No records found.</label><br/> <label>{{workflow.TemplateName}}</label><br/>
</div> </div>
<div class="ui-g-12 ui-md-3 ui-fluid">
<button pButton type="button" icon="ui-icon-edit" title="Edit"
(click)="onRowSelect(workflow)" [disabled]="showLoader">
</button>
</div>
</div>
</div>
</div>
<div *ngIf="myTemplates.length === 0" class="ui-g form-group">
<div class="ui-g-12 ui-md-12">
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-1">
<label> </label>
</div>
<div class="ui-g-12 ui-md-8">
<label>No records found.</label><br/>
</div>
</div>
</div>
</div>
</div> </div>
</div> <div class="ui-g-12 card card-w-title">
</div> <h4>Shared Templates</h4>
</div> <div *ngFor="let workflow of sharedTemplates" class="ui-g form-group">
<div class="ui-g-12 card card-w-title"> <div class="ui-g-12 ui-md-12">
<h4>Shared Templates</h4> <div class="ui-g form-group">
<div *ngFor="let workflow of sharedTemplates" class="ui-g form-group"> <div class="ui-g-12 ui-md-1">
<div class="ui-g-12 ui-md-12"> <label> </label>
<div class="ui-g form-group"> </div>
<div class="ui-g-12 ui-md-1"> <div class="ui-g-12 ui-md-8">
<label> </label> <label>{{workflow.TemplateName}}</label><br/>
</div> </div>
<div class="ui-g-12 ui-md-8"> <div class="ui-g-12 ui-md-3 ui-fluid">
<label>{{workflow.TemplateName}}</label><br/> <button pButton type="button" icon="ui-icon-edit" title="Edit"
</div> (click)="onRowSelect(workflow)" [disabled]="showLoader">
<div class="ui-g-12 ui-md-3 ui-fluid"> </button>
<button pButton type="button" icon="ui-icon-edit" title="Edit" </div>
(click)="onRowSelect(workflow)" [disabled]="showLoader"> </div>
</button> </div>
</div> </div>
</div> <div *ngIf="sharedTemplates.length === 0" class="ui-g form-group">
</div> <div class="ui-g-12 ui-md-12">
</div> <div class="ui-g form-group">
<div *ngIf="sharedTemplates.length === 0" class="ui-g form-group"> <div class="ui-g-12 ui-md-1">
<div class="ui-g-12 ui-md-12"> <label> </label>
<div class="ui-g form-group"> </div>
<div class="ui-g-12 ui-md-1"> <div class="ui-g-12 ui-md-8">
<label> </label> <label>No records found.</label><br/>
</div> </div>
<div class="ui-g-12 ui-md-8"> </div>
<label>No records found.</label><br/> </div>
</div> </div>
</div> </div>
</div>
</div> </div>
</div>
</div> </div>
</div> <p-progressSpinner *ngIf="showLoader"></p-progressSpinner>
<p-progressSpinner *ngIf="showLoader"></p-progressSpinner>
</form> </form>
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { Subscription } from 'rxjs/Subscription'; import { Subscription } from 'rxjs/Subscription';
import { AppService } from '../../app.service'; import { AppService } from '../../app.service';
import { SEARCH, SERVICES } from '../../constants';
import { SorterModel } from '../../models/sorterModel'; import { SorterModel } from '../../models/sorterModel';
import { WorkflowTemplateModel } from '../../models/workflowTemplateModel'; import { WorkflowTemplateModel } from '../../models/workflowTemplate.model';
import { SearchService } from '../../oneit/services/search.service'; import { SearchService } from '../../oneit/services/search.service';
import { UtilsService } from '../../oneit/services/utils.service'; import { UtilsService } from '../../oneit/services/utils.service';
import { BaseComponent } from '../base/base.component'; import { BaseComponent } from '../base/base.component';
import { ListWorkFlowsService } from './list-work-flows.service';
@Component({ @Component({
selector: 'app-list-work-flows', selector: 'app-list-work-flows',
templateUrl: './list-work-flows.component.html' templateUrl: './list-work-flows.component.html'
}) })
export class ListWorkFlowsComponent extends BaseComponent implements OnInit { export class ListWorkFlowsComponent extends BaseComponent implements OnInit {
subscriptions: Array<Subscription> = []; subscriptions: Array<Subscription> = [];
myTemplates: Array<WorkflowTemplateModel> = []; myTemplates: Array<WorkflowTemplateModel> = [];
sharedTemplates: Array<WorkflowTemplateModel> = []; sharedTemplates: Array<WorkflowTemplateModel> = [];
sortOptions: Array<SorterModel>; sortOptions: Array<SorterModel>;
sortSelected: SorterModel; sortSelected: SorterModel;
showLoader = false; showLoader = false;
constructor( constructor(
private router: Router, private router: Router,
private activatedRoute: ActivatedRoute, private activatedRoute: ActivatedRoute,
private utilsService: UtilsService, private utilsService: UtilsService,
private searchService: SearchService, private searchService: SearchService,
private appService: AppService, private appService: AppService
private listWorkFlowsService: ListWorkFlowsService ) {
) { super(utilsService);
super(utilsService); }
}
ngOnInit(): void { ngOnInit(): void {
this.sortOptions = [ this.sortOptions = [
new SorterModel('Alphabetical (A-Z)', true), new SorterModel('Alphabetical (A-Z)', true),
new SorterModel('Alphabetical (Z-A)', false) new SorterModel('Alphabetical (Z-A)', false)
]; ];
const sharedParams = { const sharedParams = {
OnlyGlobalTemplates: true OnlyGlobalTemplates: true
}; };
const myParams = { const myParams = {
OnlyGlobalTemplates: false OnlyGlobalTemplates: false
}; };
this.subscriptions.push( this.subscriptions.push(
this.listWorkFlowsService this.appService.getSearchListing(SERVICES.WORKFLOW_TEMPLATES, 'All', myParams, [], SEARCH.WORKFLOW_TEMPLATE)
.getWorkFlows(myParams, []) .subscribe(
.subscribe( messages => {
messages => { this.myTemplates = messages;
this.myTemplates = messages; },
}, error => {
error => { this.showLoader = false;
this.showLoader = false; this.utilsService.handleError(error);
this.utilsService.handleError(error); }
} )
) );
); this.subscriptions.push(
this.subscriptions.push( this.appService.getSearchListing(SERVICES.WORKFLOW_TEMPLATES, 'All', sharedParams, [], SEARCH.WORKFLOW_TEMPLATE)
this.listWorkFlowsService .subscribe(
.getWorkFlows(sharedParams, []) messages => {
.subscribe( this.sharedTemplates = messages;
messages => { },
this.sharedTemplates = messages; error => {
}, this.showLoader = false;
error => { this.utilsService.handleError(error);
this.showLoader = false; }
this.utilsService.handleError(error); )
} );
) setTimeout(() => (this.showLoader = false), 0);
); }
setTimeout(() => (this.showLoader = false), 0);
}
sortWorkFlowTemplates(): void { sortWorkFlowTemplates(): void {
this.showLoader = true; this.showLoader = true;
this.myTemplates = this.utilsService.sort(this.myTemplates, this.myTemplates = this.utilsService.sort(this.myTemplates,
['TemplateName'], [this.sortSelected.ascending ? 1 : -1], false); ['TemplateName'], [this.sortSelected.ascending ? 1 : -1], false);
this.sharedTemplates = this.utilsService.sort(this.sharedTemplates, this.sharedTemplates = this.utilsService.sort(this.sharedTemplates,
['TemplateName'], [this.sortSelected.ascending ? 1 : -1], false); ['TemplateName'], [this.sortSelected.ascending ? 1 : -1], false);
this.showLoader = false; this.showLoader = false;
} }
onRowSelect(data: WorkflowTemplateModel): void { onRowSelect(data: WorkflowTemplateModel): void {
this.showLoader = true; this.showLoader = true;
this.router.navigate(['/edit-work-flow', data.ObjectID]); this.router.navigate(['/edit-workflow-template', data.ObjectID]);
} }
} }
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { SearchService } from '../../oneit/services/search.service';
import { UtilsService } from '../../oneit/services/utils.service';
@Injectable()
export class ListWorkFlowsService {
constructor(
private searchService: SearchService,
private utilsService: UtilsService
) {
}
getWorkFlows(queryParams, assocs): Observable<any> {
return this.searchService.searchAndSaveSearchRequest('WorkFlowTemplates', 'All', queryParams,
assocs, null, null, null, null, 'ListWorkFlow', false)
.map(
data =>
this.utilsService.convertResponseToObjects(data, assocs)
);
}
}
export const CLASSES = { export const CLASSES = {
MESSAGE_TEMPLATE: 'performa.orm.MessageTemplate', MESSAGE_TEMPLATE: 'performa.orm.MessageTemplate',
TEMPLATE_TYPE: 'performa.orm.types.TemplateType', TEMPLATE_TYPE: 'performa.orm.types.TemplateType',
APPLICATION_STATUS: 'performa.orm.types.ApplicationStatus', APPLICATION_STATUS: 'performa.orm.types.ApplicationStatus',
HIRING_TEAM: 'performa.orm.HiringTeam', HIRING_TEAM: 'performa.orm.HiringTeam',
PLACEHOLDER_OPTIONS: 'performa.orm.types.PlaceholderOptions', PLACEHOLDER_OPTIONS: 'performa.orm.types.PlaceholderOptions',
WORKFLOW_TEMPLATE: 'performa.orm.WorkFlowTemplate' WORKFLOW_TEMPLATE: 'performa.orm.WorkFlowTemplate'
}; };
export const SERVICES = { export const SERVICES = {
SAVE_MESSAGE_AS_COPY: 'SaveMessageAsCopy', MESSAGE_TEMPLATES: 'MessageTemplates',
SAVE: 'Save' WORKFLOW_TEMPLATES: 'WorkFlowTemplates',
SAVE_MESSAGE_AS_COPY: 'SaveMessageAsCopy',
SAVE: 'Save'
};
export const SEARCH = {
MESSAGE_TEMPLATE: 'ListMessageTemplate',
WORKFLOW_TEMPLATE: 'ListWorkFlow'
}; };
export class ApplicationStatusModel { export class ApplicationStatusEnum {
Name: string; Name: string;
Value: string; Value: string;
Description: string; Description: string;
Disabled: boolean; Disabled: boolean;
} }
export class HiringTeamModel { export class HiringTeamModel {
HiringTeamName: string; HiringTeamName: string;
} }
import { CLASSES } from '../constants'; import { CLASSES } from '../constants';
import { ApplicationStatusModel } from './applicationStatus'; import { ApplicationStatusEnum } from './applicationStatus.enum';
import { HiringTeamModel } from './hiringTeamModel'; import { HiringTeamModel } from './hiringTeam.model';
import { TemplateTypeModel } from './templateTypeModel'; import { TemplateTypeEnum } from './templateType.enum';
export class MessageTemplateModel { export class MessageTemplateModel {
ObjectID: string; ObjectID: string;
ObjectClass = CLASSES.MESSAGE_TEMPLATE; ObjectClass = CLASSES.MESSAGE_TEMPLATE;
id: string; id: string;
MessageID: number; MessageID: number;
TemplateName: string; TemplateName: string;
Subject: string; Subject: string;
ApplicationStatus: ApplicationStatusModel; ApplicationStatus: ApplicationStatusEnum;
DelayHrs: number; DelayHrs: number;
DelayMin: number; DelayMin: number;
Variance: number; Variance: number;
BusinessHoursOnly: boolean; BusinessHoursOnly: boolean;
MessageContent: string; MessageContent: string;
TemplateType: TemplateTypeModel; TemplateType: TemplateTypeEnum;
RelatedToJob: boolean; RelatedToJob: boolean;
IsSystemGenerated: boolean; IsSystemGenerated: boolean;
HiringTeam: HiringTeamModel | string; HiringTeam: HiringTeamModel | string;
} }
export class PlaceholderOptionsModel { export class PlaceholderOptionsEnum {
Name: string; Name: string;
Value: string; Value: string;
Description: string; Description: string;
Disabled: boolean; Disabled: boolean;
Placeholder: string; Placeholder: string;
ShowForSubject: boolean; ShowForSubject: boolean;
ShowForContent: boolean; ShowForContent: boolean;
IsLink: boolean; IsLink: boolean;
} }
export class TemplateTypeModel { export class ResponseActionEnum {
Name: string; Name: string;
Value: string; Value: string;
Description: string; Description: string;
Disabled: boolean; Disabled: boolean;
} }
export class SorterModel { export class SorterModel {
description; description;
ascending; ascending;
constructor(des: string, sort: boolean) { constructor(des: string, sort: boolean) {
this.description = des; this.description = des;
this.ascending = sort; this.ascending = sort;
} }
} }
export class StageTypeEnum {
Name: string;
Value: string;
Description: string;
Disabled: boolean;
IsPreStage: boolean;
IsPostStage: boolean;
}
export class StepTypeEnum {
Name: string;
Value: string;
Description: string;
Disabled: boolean;
}
export class TemplateTypeEnum {
Name: string;
Value: string;
Description: string;
Disabled: boolean;
}
import { CLASSES } from '../constants'; import { CLASSES } from '../constants';
import { HiringTeamModel } from './hiringTeam.model';
import { ResponseActionEnum } from './responseAction.enum';
export class WorkflowTemplateModel { export class WorkflowTemplateModel {
ObjectID: string; ObjectID: string;
ObjectClass = CLASSES.WORKFLOW_TEMPLATE; ObjectClass = CLASSES.WORKFLOW_TEMPLATE;
TemplateName: string; TemplateName: string;
LandingButtonText: string; LandingButtonText: string;
VerificationHeaderText: string; VerificationHeaderText: string;
CaptureCV: boolean; CaptureCV: boolean;
IsCVMandatory: boolean; IsCVMandatory: boolean;
CaptureCL: boolean; CaptureCL: boolean;
IsCLMandatory: boolean; IsCLMandatory: boolean;
ApplicationButtonText: string; ApplicationButtonText: string;
ApplicationResponseAction: string; ApplicationResponseAction: ResponseActionEnum;
ThankYouHeaderText: string;
ThankYouSecondaryText: string;
JobOutlineButtonText: string;
RelatedToJob: boolean;
IsSystemGenerated: boolean;
WithdrawalMessage: string;
HiringTeam: HiringTeamModel | string;
WorkFlowStages: Array<string>;
Jobs: Array<string>;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment