import { Component, OnInit, AfterViewInit, ViewChild, ViewEncapsulation, OnDestroy, ChangeDetectorRef, ChangeDetectionStrategy } from '@angular/core';
import { ViewContainerRef, Inject } from '@angular/core';
import { Router } from '@angular/router';
import {
CommandColumnService, ToolbarService, DetailRowService,
EditService, ResizeService, AggregateService,
ContextMenuService, ContextMenuItem,
QueryCellInfoEventArgs, RowSelectEventArgs, RowDeselectEventArgs,
CommandClickEventArgs, ContextMenu, Grid
} from '@syncfusion/ej2-angular-grids';
import {
CheckBoxSelectionService, DropDownListComponent,
} from '@syncfusion/ej2-angular-dropdowns';
import { DialogUtility, Tooltip, TooltipEventArgs } from '@syncfusion/ej2-popups';
import { COMPANY_NAME, ResultService } from '../../service/data/result.service';
import { AttributeService } from '../../service/data/attribute.service';
import { ComparelistService } from '../../service/data/comparelist.service';
import { Dialog, DialogComponent } from '@syncfusion/ej2-angular-popups';
import { Subscription } from 'rxjs';
import { MenuItemModel } from '@syncfusion/ej2-navigations';
import { FormBuilder, FormGroup, FormArray } from '@angular/forms';
import { MenuEventArgs } from '@syncfusion/ej2-angular-navigations';
import { ToastComponent } from '@syncfusion/ej2-angular-notifications';
class DocData {
documentName: string;
qcStatus: string;
};
@Component({
selector: 'app-newresultsdoc',
templateUrl: './newresultsdoc.component.html',
styleUrls: ['./newresultsdoc.component.css'],
providers: [CommandColumnService, ToolbarService, DetailRowService,
EditService, ResizeService, AggregateService,
CheckBoxSelectionService, ContextMenuService],
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class NewresultsdocComponent implements OnInit {
@ViewChild('clauseCompareDialog') public clauseCompareDialog: DialogComponent;
@ViewChild('duplicateDialog') public duplicateDialog: DialogComponent;
@ViewChild('ddldupdoccopies') public ddldupdoccopies: DropDownListComponent;
@ViewChild('prevValueDialog') public prevValueDialog: DialogComponent;
@ViewChild('rulesetDialog') public rulesetDialog: DialogComponent;
@ViewChild('rblDialog') public rblDialog: DialogComponent;
@ViewChild('showrbDialog') public showrbDialog: DialogComponent;
@ViewChild('element') public tcelement: ToastComponent;
@ViewChild('ignoreDialog') public ignoreDialog: DialogComponent;
public alertDiag: Dialog;
att_Data: any[];
Doc_Data: Array<any> = [];
temp_Doc_Data:Array<any> =[];
resultList: any[]
docTypeName: any;
attrCustomList: any;
mapLink: string;
private subscription: Subscription = new Subscription();
public currentPdf: string = "";
orderForm: FormGroup;
items: FormArray;
public docRuleBook: string[] = [];
viewRuleSetList = [];
message: any;
map;
public clauseText: string = "";
public diffText: string = "";
public selectedClauseStatus: string = "";
public right: string = "";
public left: string = "";
visible: boolean = true;
public attributeType: string = "";
public ruleSetName: string = "";
public prevDS: Object[] = [];
public vCount: number = 0;
public pvCount: number = 0;
public pageLoad: boolean = true;
public pageLoadCount: number = 0;
public TextVal:string ="fhfhf";
public selectedCopies: number = 1;
public attributeCopy: number = 0;
deleteSplitedButton: boolean = false;
//qcStatus :any;
docName: string; tid: string;
public filterItems: MenuItemModel[] = [
{
text: 'All'
},
{
text: 'Verified'
},
{
text: 'Pending'
},
]
public menuItems: MenuItemModel[] = [
// {
// text: 'Ignore'
// },
// {
// text: 'Doughtful'
// },
// {
// separator: true
// },
{
text: 'View Previous Results'
},
{
text: 'View Ruleset'
},
{
separator: true
},
{
text: 'No error'
},
{
text: 'Conceptual'
},
{
text: 'Overlook'
},
];
fieldsvalues: Object;
public getDropdownInstance:any
public transactionId = sessionStorage.getItem('transactionId');
public qcLevel = sessionStorage.getItem('qcLevel');
public reExecuteText: string = "Execute";
public clauseStatus: string[] = ["Standard", "Non Standard", "Not Available", "Not Applicable", "Clause does not exist"];
public noCopies: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
public lbData: string[] = ['All', 'Verified', 'Unverified'];
curDoc: any;
public confirmDelDup: any;
public ignorebuttons: Object = [{
click: this.ignoreButton.bind(this),
buttonModel: { content: 'OK', isPrimary: true }
},
{
click: this.cancelSplit.bind(this),
buttonModel: { content: 'Cancel', isPrimary: false }
}
]
public dupbuttons: Object = [
{
click: this.splitDocuments.bind(this),
buttonModel: { content: 'OK', isPrimary: true }
},
{
click: this.cancelSplit.bind(this),
buttonModel: { content: 'Cancel', isPrimary: false }
}
];
public clausebuttons: Object = [
{
click: this.clauseCompare.bind(this),
buttonModel: { content: 'OK', isPrimary: true }
},
{
click: this.cancelClauseCompare.bind(this),
buttonModel: { content: 'Cancel', isPrimary: false }
}
];
public rblbuttons: Object = [
{
click: this.okRbl.bind(this),
buttonModel: { content: 'OK', isPrimary: true }
},
{
click: this.closeRbl.bind(this),
buttonModel: { content: 'Close', isPrimary: false }
}
];
public showrbbuttons: Object = [
{
click: this.closeShowRb.bind(this),
buttonModel: { content: 'Close', isPrimary: true }
}
]
public rulesetButton: Object = [
{
click: this.okRuleSet.bind(this),
buttonModel: { content: 'OK', isPrimary: true }
},
]
selectedRuleBook: string;
currentPdfManual: string;
ConfirmVerifyDlg1: Dialog;
ConfirmVerifyDlg3: Dialog;
constructor(private resultService: ResultService, private formBuilder: FormBuilder, private cd: ChangeDetectorRef,
private router: Router,
private attributeService: AttributeService,
private compareListService: ComparelistService,
@Inject(ViewContainerRef) private viewContainerRef?: ViewContainerRef) {
}
ngOnInit() {
this.GetAllDocuments4ThisTransaction(this.transactionId, +this.qcLevel);
let currentUrl = window.location.rel='nofollow' href;
this.mapLink = currentUrl.toString().replace("dashboard/newresultsDocument", "map");
let selectedReexFlag = sessionStorage.getItem('selectedReexFlag');
if (selectedReexFlag == "Y") {
this.reExecuteText = "Re-Execute";
}
// this.GetAllDocuments4ThisTransaction(this.transactionId, +this.qcLevel);
// this.onCreateDuplicate();
//this.getDocumentFromServer(this.docName, this.tid);
// this.changeDocument1(this.qcStatus);
this.orderForm = this.formBuilder.group({
panelId: '',
extractedChunk: '',
items: this.formBuilder.array([])
});
}
ngAfterViewChecked() {
this.cd.detectChanges();
}
createItem(panelId): FormGroup {
return this.formBuilder.group({
extractedChunk: '',
panelId: panelId,
});
}
addItem(panel): void {
console.log(panel);
this.items = this.orderForm.get('items') as FormArray;
this.items.push(this.createItem(panel.panelId));
}
removeGroup(index) {
const form = this.orderForm.get('items') as FormArray
form.removeAt(index);
}
public onFilterItem(args: MenuEventArgs,): void {
console.log(args);
if (args.item.text == "Verified") {
alert('verified');
this.filterChange('Verified')
}
else if (args.item.text == "Pending") {
}
}
getValue(e,v){
console.log(e);
console.log("att" + JSON.stringify(v));
}
public select(args: MenuEventArgs, attrValue, attribute,index) {
console.log(attribute);
console.log("att" + JSON.stringify(attrValue));
if (args.item.text == "Ignore") {
this.ignoreDialog.show();
this.onIgnoreChange(attrValue,attribute)
}
else if(args.item.text == "Doughtful"){
this.onDoubtfulChange(attrValue,attribute);
}
else if (args.item.text == "View Ruleset") {
this.rulesetDialog.show();
this.viewRuleSet(attrValue.appliedRule, attribute.attributeName)
}
else if (args.item.text == "View Previous Results") {
this.viewPrevResults(attribute, attrValue)
}
}
updateQc(data: any, ignore: string, doubtful: string, eventact: string,
bVerify: boolean,attribute:any) {
let content: any;
if (!bVerify) {
content = {
"DocumentName": this.documentName,
"AttributeId": attribute['attributeId'].toString(),
"AttributeName": attribute['attributeName'],
"AppliedRule": data['appliedRule'],
"InitialValue": data['qcValidation']['initialValue'],
"QcLevel": this.qcLevel,
"NewValue": data['qcValidation']['NewValue'],
"Status": "UNVERIFIED",
"QcDoneBy": sessionStorage.getItem('authenticateUser'),
"IgnoreResult": ignore,
"DoubtfulResult": doubtful,
"Critical": data['qcValidation']['Critical'],
"clauseStandardBool":""
}
// AppliedRule: "204"
// AttributeId: "203"
// AttributeName: "Party1 Name"
// Critical: "No Error"
// DocumentName: "03_NDA_Disc5 - Copy.pdf"
// DoubtfulResult: "NO"
// Event: "IgnoreResult"
// IgnoreResult: "YES"
// InitialValue: "Acme Incorporation"
// NewValue: "Acme Incorporation"
// QcLevel: 1
// Status: "UNVERIFIED"
// clauseStandardBool: ""
this.subscription.add(this.resultService.upadteQCLevel(content, this.transactionId).subscribe(
result => {
let str = 'Record updated successfully.';
this.toasts[0].content = str;
this.toastShow();
},
error => { }
));
} else {
content = {
"CompanyName": sessionStorage.getItem(COMPANY_NAME),
"TransactionId": this.transactionId,
"DocumentName": this.curDoc,
"AttributeId": data['Id'].toString(),
"AttributeName": data['Name'],
"AppliedRule": data['Rule'],
"InitialValue": 'initVal',
"NewValue": 'newVal',
"QcDoneBy": sessionStorage.getItem('authenticateUser'),
"QcLevel": this.qcLevel,
"IgnoreResult": ignore,
"DoubtfulResult": doubtful,
"Critical": 'ce'
}
this.subscription.add(this.resultService.verifyAttribute(content).subscribe(
response => {
let str = 'Record verified successfully.';
this.toasts[0].content = str;
this.toastShow();
})
);
}
}
// Toaster /////////////////////////////////////////////////////////////////////////////
public toasts = [{ title: 'Success !', content: '', cssClass: 'e-toast-success' }];
public toastPosition = { X: 'Right', Y: 'Bottom' };
public toastFlag: number = 0;
toastShow(): void {
setTimeout(() => {
this.tcelement.show(this.toasts[this.toastFlag]);
++this.toastFlag;
if (this.toastFlag === (this.toasts.length)) {
this.toastFlag = 0;
}
}, 0);
}
onIgnoreChange( data: any,attribute) {
console.log("ignore data"+JSON.stringify(data));
let s1 = "YES";
let s2 = "NO";
if (data['qcValidation']['ignoreResult'] == "YES") {
s1 = "NO";
}
else if (data['qcValidation']["ignoreResult"] == "NO") {
s2 = "YES";
}
this.updateQc(data,s1, s2, "IgnoreResult",false,attribute);
// let o = (this.childGrid.dataSource as Array<Object>).find(x => (x['Index'] == data['Index']));
// if (o != undefined) {
// o['Ignore'] = (s1 == 'YES') ? true : false;
// o['QCStatus'] = "Pending Verification";
// this.refreshChildGrids(+data['Id']);
// this.SetDocumentStatus(this.curDoc, false);
// }
}
onDoubtfulChange( data: any,attribute) {
let s1 = "NO";
let s2 = "YES";
if (data['Ignore'] == true) {
s1 = "YES";
}
if (data["Doubtful"] == true) {
s2 = "NO";
}
this.updateQc(data, s1, s2, "DoubtfulResult", false,attribute);
}
documentName
// Service Calls ////////////////////////////////////////////////////////////////////////////////
private GetAllDocuments4ThisTransaction(tid: string, qcl: number) {
this.Doc_Data = [];
this.resultService.getDocumentNamesAndStatus(tid, qcl).subscribe(
data => {
console.log(data);
let o1: object[] = data;
o1.forEach(e1 => {
let d: DocData = new DocData();
d.documentName = e1['documentName'];
let s1 = e1['qcStatus'];
if (s1 === 'VERIFIED') {
s1 = 'Verified';
} else {
s1 = 'Pending Verification';
}
d.qcStatus = s1;
this.Doc_Data.push(d);
console.log(this.Doc_Data);
this.temp_Doc_Data =[...this.Doc_Data]
this.vCount = this.Doc_Data.filter(x => (x.qcStatus == 'Verified')).length;
this.pvCount = this.Doc_Data.filter(x => (x.qcStatus == 'Pending Verification')).length;
console.log(`count ${this.vCount} pending ${this.pvCount}`);
this.fieldsvalues = { dataSource: this.temp_Doc_Data, text: "documentName", value: "documentName" };
this.cd.detectChanges();
setTimeout(() => {
this.documentName = this.Doc_Data[0].documentName;
this.getDocumentsById(this.documentName)
}, 10);
console.log(this.documentName);
})
}
);
}
GetAllAttributes4Document(tid: string, qcl: number, docName: string) {
this.resultService.getMongoDataAttributewiseDocumentwise(tid, qcl, docName, null).subscribe((data) => {
this.resultList = data;
this.pageLoad = false;
// console.log( "result" +JSON.stringify(this.resultList) );
for (let index = 0; index < this.resultList.length; index++) {
const element = this.resultList[index];
this.items = this.orderForm.get('items') as FormArray;
while (this.items.controls.length != 0) {
this.items.removeAt(0);
}
for (let j = 0; j < element.attributewiseValues.length; j++) {
const attr = element.attributewiseValues[j];
attr.panelId = j + 1;
this.items.push(this.createItem(attr.panelId));
for (let k = 0; k < attr.attributeValues.length; k++) {
const element = attr.attributeValues[k];
let atr = (this.orderForm.get('items') as FormArray);
atr.controls[j].patchValue({ extractedChunk: element.extractedChunk });
// atr.get("extractedChunk").patchValue(element.extractedChunk);
this.TextVal = element.extractedChunk;
}
}
console.log(this.items.value);
}
})
}
getConsolidatedData(transactionId: string, qcLevel: string) {
this.resultService.getDocumentNamesAndStatus(transactionId, +qcLevel).subscribe(
data => {
let o1: object[] = data;
this.Doc_Data = [];
o1.forEach(e1 => {
let d: DocData = new DocData();
d.documentName = e1['documentName'];
let s1 = e1['qcStatus'];
if (s1 === 'VERIFIED') {
s1 = 'Verified';
} else {
s1 = 'Pending Verification';
}
d.qcStatus = s1;
this.Doc_Data.push(d);
});
}
);
}
getDocumentsById(name) {
// this.pageLoad = true;
if (this.pageLoadCount >= this.Doc_Data.length - 1) {
this.curDoc = name;
this.OpenDocInPDFViewer(this.curDoc, this.transactionId);
this.GetAllAttributes4Document(this.transactionId, +this.qcLevel, this.curDoc);
this.checkDocumentSplitedOrNot();
}
this.pageLoadCount++;
this.pageLoad = false
}
// PDF Viewer ///////////////////////////////////////////////////////////////////////
private OpenDocInPDFViewer(docName, tid): void {
setTimeout(() => {
this.getDocumentFromServer(docName, tid);
}, 500);
}
private getDocumentFromServer(docName, txn_id): void {
this.subscription.add(this.resultService.getDocumentFromServer(docName, txn_id).subscribe(
response => {
this.saveFile(response.body, docName);
},
error => {
}
));
}
private saveFile(data: any, filename?: string) {
const blob = new Blob([data], { type: 'application/octet-stream' });
this.currentPdf = URL.createObjectURL(blob);
sessionStorage.setItem("currentPDF", this.currentPdf);
}
checkDocumentSplitedOrNot() {
if (this.documentName.search("_Copy[0-9]") == -1) {
this.deleteSplitedButton = false;
} else {
this.deleteSplitedButton = true;
}
console.log("splited button"+this.deleteSplitedButton);
}
getdata(e){
console.log(e);
}
changeDocument1(qcStatus) {
// const blob = new Blob([""], { type: 'text' });
// this.currentPdf = URL.createObjectURL(blob);
// this.resultList = [];
this.Doc_Data=[];
this.getDropdownInstance =document.getElementById("Name");
console.log("dropdown" + this.getDropdownInstance);
console.log(qcStatus);
console.log("doc data" +JSON.stringify(this.Doc_Data));
if (qcStatus == "VERIFIED") {
let verified = this.Doc_Data.filter(x => (x.qcStatus == "Verified"));
console.log(verified);
// this.temp_Doc_Data = verified;
this.getDropdownInstance.ej2_instances[0].dataSource = null;
this.getDropdownInstance.ej2_instances[0].dataSource = verified;
this.getDropdownInstance.ej2_instances[0].dataBind();
this.fieldsvalues = { text: "documentName", value: "documentName" };
this.documentName = null;
this.documentName = this.temp_Doc_Data[0].documentName;
// this.getDocumentsById(this.documentName)
console.log(this.documentName);
} else if (qcStatus == "UNVERIFIED") {
let pending = this.Doc_Data.filter(x => (x.qcStatus == "Pending Verification"));
console.log('pend' + pending);
// this.temp_Doc_Data = pending;
this.getDropdownInstance.ej2_instances[0].value = null;
this.getDropdownInstance.ej2_instances[0].dataBind();
this.getDropdownInstance.ej2_instances[0].dataSource = null;
this.getDropdownInstance.ej2_instances[0].dataSource = pending;
this.getDropdownInstance.ej2_instances[0].dataBind();
this.documentName = null;
this.documentName =pending[0].documentName;
this.getDropdownInstance.ej2_instances[0].value = this.documentName;
this.getDropdownInstance.ej2_instances[0].dataBind();
// this.getDocumentsById(this.documentName);
}
else{
this.temp_Doc_Data = this.Doc_Data;
this.fieldsvalues = { text: "documentName", value: "documentName" };
this.documentName = this.temp_Doc_Data[0].documentName;
}
// if (this.docCount == 0) {
// $('#myTable').DataTable().destroy();
// const blob = new Blob([""], { type: 'text' });
// this.currentPdf = URL.createObjectURL(blob);
// this.docName1 = "";
// } else {
// this.getDoumentWiseData();
// this.docName1 = this.singleselectedItems;
// this.getDocumentFromServer(this.singleselectedItems, this.transactionId);
// }
}
filterChange(args) {
console.log(this.resultList);
console.log("status" + args);
// this.childGrid_Data = [];
// this.uniqueAttributes_Data = [];
let v = args.value;
switch (v) {
case "Unverified":
this.resultList = this.resultList.filter(x => (x['qcStatus'] == 'Pending'));
break;
case "Verified":
this.resultList = this.resultList.filter(x => (x['qcStatus'] == 'Verified'));
break;
default:
this.resultList = this.resultList;
}
// this.childGrid_Data.forEach(item => {
// let f = this.uniqueAttributes_Data.find(x => (x['Id'] == item['Id']) && x['Name'] == item['Name']);
// if (f == undefined) {
// let u = new Object();
// u['Id'] = item['Id'];
// u['Type'] = item['Type'];
// u['Name'] = item['Name'];
// u['extractedChunk'] = item['extractedChunk'];
// u['Page'] = item['Page'];
// u['Rule'] = item['Rule'];
// this.uniqueAttributes_Data.push(u);
// }
// });
// this.childGrid.dataSource = this.childGrid_Data;
// this.attMainGrid.dataSource = this.childGrid_Data;
// this.attMainGrid.refresh();
}
//view ruleset
viewRuleSet(ruleId, attributeName) {
console.log(ruleId, attributeName);
this.viewRuleSetList = [];
this.subscription.add(this.resultService.getRuleByRuleSetIdForViewRuleSet(this.transactionId, attributeName).subscribe(
response => {
let demoRuleList = [];
this.message = "";
if (response.length == 0) {
this.message = 'No rule is mapped for this attribute.';
}
else {
for (let i = 0; i < response.length; i++) {
let rule = this.getFormatedRule(response[i], response[i]['attributeName']);
demoRuleList.push(response[i]);
if (response[i]['regex'] == undefined) {
demoRuleList[i].before = rule.split("[")[0];
demoRuleList[i].after = rule.split("]")[1];
} else {
demoRuleList[i].regex = rule;
}
demoRuleList[i].currentRuleId = ruleId;
}
if (response[0]['attributeType'] == "") {
this.attributeType = "N/A"
} else {
this.attributeType = response[0]['attributeType'];
}
this.viewRuleSetList = demoRuleList;
console.log(this.viewRuleSetList);
this.ruleSetName = response[0]['ruleSetName'];
}
},
error => {
}));
}
getFormatedRule(rule, attributeName) {
let before = '';
let after = '';
let regex;
if (rule.regex !== undefined && rule.regex !== '') {
regex = rule.regex;
return regex;
}
if (rule.textBefore1 !== undefined) {
before = before + "(" + rule.textBefore1 + ")";
if (rule.opBefore1 !== undefined) {
before = before + rule.opBefore1 + "(" + rule.textBefore2 + ")";
}
if (rule.opBefore2 !== undefined) {
before = before + rule.opBefore2 + "(" + rule.textBefore3 + ")";
}
if (rule.opBefore3 !== undefined) {
before = before + rule.opBefore3 + "(" + rule.textBefore4 + ")";
}
if (rule.opBefore4 !== undefined) {
before = before + rule.opBefore4 + "(" + rule.textBefore5 + ")";
}
}
if (rule.textAfter1 !== undefined) {
after = after + "(" + rule.textAfter1 + ")";
if (rule.opAfter1 !== undefined) {
after = after + rule.opAfter1 + "(" + rule.textAfter2 + ")";
}
if (rule.opAfter2 !== undefined) {
after = after + rule.opAfter2 + "(" + rule.textAfter3 + ")";
}
if (rule.opAfter3 !== undefined) {
after = after + rule.opAfter3 + "(" + rule.textAfter4 + ")";
}
if (rule.opAfter4 !== undefined) {
after = after + rule.opAfter4 + "(" + rule.textAfter5 + ")";
}
}
return before + "[" + attributeName + "]" + after;
}
viewPrevResults(rowData, rule) {
this.prevDS = [];
let attrName = rowData['attributeName'];
let attrId: string = rowData['attributeId'].toString();
let userName = sessionStorage.getItem('authenticateUser');
let compName = sessionStorage.getItem('companyName');
let qc_level: number = +this.qcLevel;
let appliedRule = rule['appliedRule']
let content = {
"DocumentName": this.curDoc,
"AttributeName": attrName,
"AttributeId": attrId,
"AppliedRule": appliedRule,
"InitialValue": "MICRO-ACME GROUP, Inc.",
"QcLevel": +this.qcLevel,
"NewValue": "MICRO-ACME GROUP, Inc.",
"Status": "UNVERIFIED",
"QcDoneBy": userName,
"IgnoreResult": "YES",
"DoubtfulResult": "NO",
"CompanyName": compName,
"TransactionId": this.transactionId
}
this.subscription.add(this.resultService.mongoViewPreviousResults(content).subscribe(
response => {
console.log(response);
$("#valueTableId").empty();
for (let i = 0; i < qc_level; i++) {
let val = "";
if (i == 0) {
val = response.map.SystemExtractedValue;
let u: Object = {};
u['Level'] = "System Extracted Value";
u['Value'] = val;
this.prevDS.push(u);
}
else {
let QC = "QC" + i;
val = response.map[QC];
let u: Object = {};
u['Level'] = QC;
u['Value'] = val;
this.prevDS.push(u);
}
}
this.prevValueDialog.show();
}
))
}
//RuleSet Dialog
okRuleSet() {
this.rulesetDialog.hide();
}
// Rulebook Dialog /////////////////////////////////////////////////////////////
closeRbl() {
this.selectedRuleBook = "";
this.rblDialog.hide();
}
okRbl() {
this.rblDialog.hide();
this.resultService.getManualDocFromServer(this.docTypeName, this.selectedRuleBook).subscribe(
response => {
const blobManual = new Blob([response.body], { type: 'application/octet-stream' });
this.currentPdfManual = URL.createObjectURL(blobManual);
this.showrbDialog.header = "Rule book for " + this.docTypeName;
this.showrbDialog.show();
}, error => {
});
}
closeShowRb() {
this.showrbDialog.hide();
}
private okClickAlert(): void {
this.alertDiag.hide();
}
onViewRulebookClick() {
this.resultService.getManualDocList(this.docTypeName).subscribe(
response => {
if (response == null || response == '') {
this.alertDiag = DialogUtility.alert({
title: 'Information',
content: 'Please upload rule book first..',
okButton: { text: 'OK', click: this.okClickAlert.bind(this) },
showCloseIcon: true,
closeOnEscape: true,
animationSettings: { effect: 'Zoom' }
});
}
else {
this.docRuleBook = JSON.parse(response);
this.rblDialog.show();
}
});
}
//Ignore Dialog
public ignoreButton(){
this.ignoreDialog.hide();
}
// Duplicate Dialog /////////////////////////////////////////////////////////////
splitDocuments() {
this.duplicateDialog.hide();
this.subscription.add(this.resultService.splitDocumentInMongo(
sessionStorage.getItem(COMPANY_NAME), this.transactionId, this.curDoc, +this.qcLevel,
this.selectedCopies, this.attributeCopy).subscribe(
response => {
this.transactionId = response;
let s1 = "Document " + this.curDoc + " Duplicated Successfully"
DialogUtility.alert(s1);
this.getConsolidatedData(this.transactionId, this.qcLevel);
// this.temp_Doc_Data=[];
//this.Doc_Data=[];
this.GetAllDocuments4ThisTransaction(this.transactionId, +this.qcLevel);
//this.changeDocument1(qcStatus)
console.log(this.temp_Doc_Data+"updated document in dropdown")
})
)
this.attributeCopy = 0;
this.ddldupdoccopies.value = 1;
}
cancelSplit() {
this.duplicateDialog.hide();
this.ignoreDialog.hide();
}
deleteSpiltedDocument() {
let s1 = 'You have selected to delete the copied document ' + '<b>' + this.documentName +
'</b>' + '. Are you sure you want to proceed?'
this.confirmDelDup = DialogUtility.confirm({
title: "Delete Copied Document",
content: s1,
okButton: { text: 'Yes', click: this.okClickDelDup.bind(this) },
cancelButton: { text: 'No', click: this.cancelClickDelDup.bind(this) },
showCloseIcon: true,
closeOnEscape: true,
animationSettings: { effect: 'Zoom' }
});
}
okClickDelDup() {
this.confirmDelDup.hide();
let content = {
"documentName": this.curDoc,
"companyName": sessionStorage.getItem(COMPANY_NAME),
"transactionId": this.transactionId,
"qcLevel": +this.qcLevel,
"qcDoneBy": sessionStorage.getItem('authenticateUser'),
"companyId": sessionStorage.getItem('companyId')
};
this.subscription.add(this.resultService.deleteSpiltedDocument(content).subscribe(
response => {
DialogUtility.alert(
'Document ' + '<b>' +this.documentName + '</b>' + ' is deleted successfully.'
);
let idx = this.Doc_Data.indexOf(this.documentName);
this.Doc_Data.splice(idx, 1);
this.vCount = this.Doc_Data.filter(x => (x.QCStatus == 'Verified')).length;
this.pvCount = this.Doc_Data.filter(x => (x.QCStatus == 'Pending Verification')).length;
}, error => {
})
);
}
cancelClickDelDup() {
this.confirmDelDup.hide();
}
public onCreateDuplicate(): any {
this.duplicateDialog.show();
this.duplicateDialog.refresh();
}
public copyToClipboard():any{
console.log(this.curDoc);
const selBox = document.createElement('textarea');
selBox.style.position = 'fixed';
selBox.style.left = '0';
selBox.style.top = '0';
selBox.style.opacity = '0';
selBox.value = this.curDoc;
document.body.appendChild(selBox);
selBox.focus();
selBox.select();
document.execCommand('copy');
console.log(selBox);
/* Alert the copied text */
alert("Copied the text: " + selBox.value);
}
//View More dialog ////////
viewMore(item, att) {
alert('dfd')
console.log(item);
console.log("non standard" + JSON.stringify(att));
if (att.attributeType == 'Clause Compare' && att.standardClauseTextExists) {
console.log("sdsff" + att.clauseCompareBool);
this.onBegin(item, att)
// this.clauseCompareDialog.show();
}
}
onBegin(val, args): void {
console.log(args);
this.compareListService.getClauseCompareListByAttributeId(args.attributeId).subscribe(
data => {
var data1 = data["ClauseCompareList"];
this.right = "";
for (let i = 0; i < data1.length; i++) {
if (data1[i]["customValue"] == this.clauseText) {
this.right = data1[i]["customValue"];
break;
}
}
if (this.right == "") {
for (let i = 0; i < data1.length; i++) {
if (data1[i]["defaultValue"] == "Yes") {
this.right = data1[i]["customValue"];
break;
}
}
}
// if (this.right !== "") {
// alert('true')
this.clauseText = val["extractedChunk"];
let content = {
"extracted": this.clauseText,
"standard": this.right
};
this.resultService.getClauseCompareForRichText(content).subscribe(
response => {
this.diffText = response;
this.left = this.clauseText;
this.clauseCompareDialog.header = "Clause Compare - " + args['attributeName'];
this.clauseCompareDialog.show();
this.clauseCompareDialog.refresh();
}
)
// }
}
);
}
popOut() {
if (this.visible == false) {
this.visible = true;
this.map.close();
this.map = null;
// document.querySelector('#popout').innerHTML = 'Pop Out';
document.querySelector('#leftpane').className = 'col-lg-4';
// $('#leftpane').css("margin-left", "-40px");
}
else {
this.visible = false;
this.openMap();
// document.querySelector('#popout').innerHTML = 'Pop In';
//this.varPopInOut = "Pop In";
document.querySelector('#leftpane').className = 'col-lg-12';
// $('#leftpane').css("margin-left", "0px");
// $('#leftpane').css("width", "200px");
}
}
openMap() {
this.map = window.open(this.mapLink, 'Map', 'width=1300,height=700'); //,left='+left + ',top=' + top);
window.addEventListener('message', this.receiveMessage.bind(this));
return false;
}
private receiveMessage(event) {
this.visible = true;
this.map.close();
this.map = null;
// document.querySelector('#popout').innerHTML = 'Pop Out';
document.querySelector('#leftpane').className = 'col-lg-4';
// $('#leftpane').css("margin-left", "-40px");
$("#findHighlightAll").prop("checked", false);
}
//////////////////////Verify document ////////////////
verifyAllDocs(){
let s1 = "Do you want to verify document : " +this.documentName + " ?"
this.ConfirmVerifyDlg1 = DialogUtility.confirm({
title: ' Confirmation Dialog',
content: s1,
okButton: { text: 'Yes', click: this.okClick1.bind(this) },
cancelButton: { text: 'No', click: this.cancelClick1.bind(this) },
showCloseIcon: true,
closeOnEscape: true,
animationSettings: { effect: 'Zoom' }
})
}
private okClick1(args): void {
this.ConfirmVerifyDlg1.hide();
let attrList = [];
let docList = [];
this.resultService.getMongoDataAttributewiseDocumentwise(this.transactionId, this.qcLevel, this.documentName,null).subscribe(
data => {
let data1 = data[0].attributewiseValues;
let count;
for (let i = 0; i < data1.length; i++) {
if (data1[i].attributeValues.length > 1) {
count = 0;
for (let j = 0; j < data1[i].attributeValues.length; j++) {
if (data1[i].attributeValues[j].qcValidation != undefined) {
if (data1[i].attributeValues[j].qcValidation.ignoreResult == "YES") {
count++;
if (count == data1[i].attributeValues.length) {
attrList.push(data1[i].attributeName);
}
}
}
}
}
else if (data1[i].attributeValues.length == 1) {
if (data1[i].attributeValues[0].qcValidation != undefined) {
if (data1[i].attributeValues[0].qcValidation.ignoreResult == "YES") {
attrList.push(data1[i].attributeName);
}
}
}
}
if (attrList.length != 0) {
DialogUtility.alert("should have at least one attribute which is un-ignored !" );
return;
}
else{
this.okClick2(args);
}
});
}
private okClick2(args): void {
let content = {
"DocumentName": this.documentName,
"QcDoneBy": sessionStorage.getItem('authenticateUser'),
"QcLevel": +this.qcLevel,
"CompanyName": sessionStorage.getItem('companyName'),
"TransactionId": this.transactionId
}
this.resultService.verifyDocument(content).subscribe(
result => {
this.resultList.forEach(item => {
item['QCStatus'] = 'Verified';
})
}
);
let s1 = 'document(s) successfully verified. Do you want to go to the result screen?';
this.ConfirmVerifyDlg3 = DialogUtility.confirm({
title: ' Confirmation Dialog',
content: s1,
okButton: { text: 'Yes', click: this.okClick3.bind(this, args) },
cancelButton: { text: 'No', click: this.cancelClick3.bind(this) },
showCloseIcon: true,
closeOnEscape: true,
animationSettings: { effect: 'Zoom' }
})
}
private okClick3(args): void {
this.ConfirmVerifyDlg3.hide();
this.router.navigate(['dashboard/newresult']);
}
private cancelClick3(): void {
this.ConfirmVerifyDlg3.hide();
}
private cancelClick1(): void {
this.ConfirmVerifyDlg1.hide();
}
// Clause compare dialog /////////////////////////////////////////////////////////////////
beforeopen(args) {
args.maxHeight = "1000px";
}
clauseCompare(args) {
this.clauseCompareDialog.hide();
}
cancelClauseCompare(args) {
this.clauseCompareDialog.hide();
}
}
HTML file
<div class="row page-titles">
<div class="col-md-4">
<ol class="breadcrumb">
<li class="breadcrumb-item" tabindex="0" ng-reflect-router-link="/index">
<a style="font-size: 16px" routerLink="/dashboard/newresult">Result</a>
</li>
<li class="breadcrumb-item active" style="font-size: 16px">Result Document wise</li>
</ol>
<!-- <div class="row justify-content-md-center">
<button ejs-button cssClass="e-small" (click)="popOutClick($event)" [content]="popText">Pop Out</button>
<button ejs-button content="View Rulebook" cssClass="e-small" (click)="onViewRulebookClick()"></button>
<button ejs-button content="Risk Score" cssClass="e-small" (click)="onRiskScoreClick()"></button>
</div> -->
</div>
</div>
<div class="e-card res-topbar">
<div class="row">
<div class="col-md-4">
<h5>Transaction Name<br> <b>{{transactionId}} - ({{reExecuteText}})</b></h5>
</div>
<div class="col-md-8">
<div class="d-flex justify-content-end align-center">
<div class="vertical-separator"></div>
<div>
<button ejs-button cssClass="e-round total" iconCss="e-icons" content="{{pvCount + vCount}}"
[isPrimary]="true" (click)="changeDocument1('ALL')" ></button>
<button ejs-button cssClass="e-round pending" iconCss="e-icons" content="{{pvCount}}"
(click)="changeDocument1('UNVERIFIED')" [isPrimary]="false"></button>
<button ejs-button cssClass="e-round verified" iconCss="e-icons" (click)="changeDocument1('VERIFIED')"
content="{{vCount}}"></button>
</div>
<div >
<!-- *ngIf='temp_Doc_Data && temp_Doc_Data.length != 0' -->
<ejs-dropdownlist id='Name' (dataBound)="getdata($event)" [dataSource]='temp_Doc_Data' [fields]='fieldsvalues' [(value)]='documentName'
[(ngModel)]="documentName" width='300' [allowFiltering]='true'
(change)="getDocumentsById(documentName)" >
</ejs-dropdownlist>
</div>
<div class="button-custom">
<button ejs-button iconCss="e-search-icon" (click)="copyToClipboard()"></button>
<button ejs-button iconCss="e-restore" (click)="onCreateDuplicate()" (change)="getdata($event)"></button>
<button ejs-button iconCss="e-file-delete" *ngIf="deleteSplitedButton" (click)="deleteSpiltedDocument()"></button>
<button ejs-button content="Verify" cssClass="e-success" (click)="verifyAllDocs()"></button>
</div>
<div class="vertical-separator"></div>
<div class="button-custom">
<button ejs-button iconCss="e-rulebook" (click)="onViewRulebookClick()"></button>
<button ejs-button iconCss="e-popout" style="margin-right: 0px;" id="popout" (click)="popOut()"></button>
</div>
</div>
</div>
</div>
</div>
<div class="row res-content">
<div class="col-md-4" id="leftpane">
<h5><b>Attribute Data</b></h5>
<div class="e-card" [style.margin-bottom.px]="10">
<div class="e-card-content d-flex attr">
<ejs-textbox type="search" iconCss="e-search-icon" style="width: 100%;" placeholder="search">
</ejs-textbox>
<button ejs-button iconCss="e-filter-icon" [style.margin-left.px]="10" id="filter"></button>
<ejs-contextmenu id='contextmenu' target='#filter' [items]='filterItems' (select)=onFilterItem($event)>
</ejs-contextmenu>
</div>
</div>
<form [formGroup]="orderForm">
<ng-container *ngFor="let c1 of resultList; let i=index;">
<ng-container >
<!-- *ngIf="c1.documentName==curDoc" -->
<div tabindex="0" class="e-card" id="basic" *ngFor="let a1 of c1.attributewiseValues;let j=index;"
[style.margin-bottom.px]="10">
<div class="e-card-header">
<div class="e-card-header-caption">
<div class="e-card-title">{{a1.attributeName}}</div>
</div>
<div>
<button ejs-button cssClass="e-round" (click)="addItem(a1)" iconCss="e-icons e-plus-icon"
[isPrimary]="true"></button>
</div>
</div>
<ng-container *ngFor="let attr of a1.attributeValues; let l=index;">
<div
*ngIf="attr.customList[0].customizeList==undefined then thenBlockTextArea else elseBlockDropDown"
class="form-group" style="margin-top: 1em;margin-left: 0em;"></div>
<ng-container formArrayName="items"
*ngFor="let item of orderForm.get('items')['controls']; let k = index;">
<div class="e-card-content d-flex" *ngIf="item.get('panelId').value==a1.panelId">
<div class="e-control-wrapper wrapper-custom" [formGroupName]="k" id="wrapper">
<ejs-tooltip id='tooltip' content={{attr.extractedChunk}} target="#target1">
<!-- [(value)]="TextVal" -->
<ejs-textbox [multiline]='true' formControlName="extractedChunk" id="target1" (click)=viewMore(attr,a1)>
</ejs-textbox>
</ejs-tooltip>
</div>
<div style="width: 120px;">
<!-- <button ejs-button cssClass="e-round" (click)="removeGroup(k)" iconCss="e-icons" [isPrimary]="true"></button> -->
<button ejs-button cssClass="e-flat" iconCss="e-icons e-right-icon"
[isPrimary]="true" (click)="getValue(attr,a1)"></button>
<img src="assets/images/show_more_icn.png" id="target">
<ejs-contextmenu id='contextmenu' target='#target' [items]='menuItems'
(select)="select($event,attr,a1,i)"></ejs-contextmenu>
</div>
</div>
</ng-container>
<div class="ignore-custom">
<div *ngIf="attr?.qcValidation == undefined then callfunction; else nofunction"></div>
<ng-template #callfunction>
<!-- <input type="checkbox" id="ignoreResulttt{{a1.attributeId}}_{{i}}_{{j}}_{{l}}"
(click)="ignoreResult(a1.attributeId+'_'+i+'_'+j+'_'+l,i+'_'+j)" /><span
class="common-font-setting">Ignore -->
<ejs-checkbox label="Ignore" (click)="onIgnoreChange(attr,a1.attributeName)"></ejs-checkbox>
<!-- </span> -->
</ng-template>
<ng-template #nofunction>
<div *ngIf="attr?.qcValidation?.ignoreResult == 'YES' then checked; else unchecked"></div>
<ng-template #checked>
<!-- <input type="checkbox" id="ignoreResulttt{{a1.attributeId}}_{{i}}_{{j}}_{{l}}"
(click)="ignoreResult(a1.attributeId+'_'+i+'_'+j+'_'+l,i+'_'+j)" checked /><span
class="common-font-setting">Ignore</span>
<br><br> -->
<ejs-checkbox label="Ignore" (click)="onIgnoreChange(attr,a1.attributeName)" [checked]="true"></ejs-checkbox>
</ng-template>
<ng-template #unchecked>
<!-- <input type="checkbox" id="ignoreResulttt{{a1.attributeId}}_{{i}}_{{j}}_{{l}}"
(click)="ignoreResult(a1.attributeId+'_'+i+'_'+j+'_'+l,i+'_'+j)" />
<span class="common-font-setting">Ignore</span>
<br><br> -->
<ejs-checkbox label="Ignore" (click)="onIgnoreChange(attr,a1.attributeName)" [checked]="false"></ejs-checkbox>
</ng-template>
</ng-template>
<div *ngIf="attr?.qcValidation==undefined; then thenDoubtBlock else elseDoubtBlock"></div>
<ng-template #thenDoubtBlock>
<!-- <input type="checkbox" id="doubtbtnId{{a1.attributeId}}_{{i}}_{{j}}_{{l}}" #doutBtnTemp
(click)="onDoubtfull(doutBtnTemp,a1.attributeId+'_'+i+'_'+j+'_'+l,i+'_'+j)"
[disabled]="qcLevel==companyQclevel" style="font-size: 12px;display: inline;" />
<span class="common-font-setting">Doubtful</span> -->
<ejs-checkbox label="Doubtful" [checked]="false"></ejs-checkbox>
</ng-template>
<ng-template #elseDoubtBlock>
<div *ngIf="attr?.qcValidation?.qcLevel==1; then thenQcDoubtBlock else elseQcDoubtBlock">
</div>
<ng-template #thenQcDoubtBlock>
<!-- <input type="checkbox" id="doubtbtnId{{a1.attributeId}}_{{i}}_{{j}}_{{l}}" #doutBtnTemp
(click)="onDoubtfull(doutBtnTemp,a1.attributeId+'_'+i+'_'+j+'_'+l,i+'_'+j)"
style="font-size: 12px;" [disabled]="qcLevel==companyQclevel"
[checked]="attr?.qcValidation?.doubtfulResult=='YES' && qcLevel==1 ? true : false" />
<span class="common-font-setting">Doubtful</span> -->
<ejs-checkbox label="Doubtful" [checked]="attr?.qcValidation?.doubtfulResult=='YES' && qcLevel==1 ? true : false"></ejs-checkbox>
</ng-template>
<ng-template #elseQcDoubtBlock>
<!-- <input type="checkbox" id="doubtbtnId{{a1.attributeId}}_{{i}}_{{j}}_{{l}}" #doutBtnTemp
(click)="onDoubtfull(doutBtnTemp,a1.attributeId+'_'+i+'_'+j+'_'+l,i+'_'+j)"
[disabled]="qcLevel==companyQclevel" style="font-size: 12px;"
[checked]="attr?.qcValidation.doubtfulResult=='YES' && qcLevel== al.qcValidation.qcLevel ? true : false" />
<span class="common-font-setting">Doubtful</span> -->
<ejs-checkbox label="Doubtful" [checked]="attr?.qcValidation?.doubtfulResult=='YES' &&attr?.qcValidation?.qcLevel ? true : false"></ejs-checkbox>
</ng-template>
</ng-template>
<div *ngIf="a1.attributeType=='Clause Compare' && a1.standardClauseTextExists">
<span>Non Standard</span>
</div>
</div>
</ng-container>
</div>
</ng-container>
</ng-container>
</form>
</div>
<div class="col-md-8" *ngIf="visible">
<ngx-extended-pdf-viewer delayFirstView="250" [showPrintButton]="false" [showOpenFileButton]="true" height='100%'
[showHandToolButton]="true" [handTool]="false" [ignoreKeyboard]="true" [showDownloadButton]="false"
[showBookmarkButton]="false" [showDownloadButton]="false" useBrowserLocale="true" [ignoreKeys]="['CTRL+S']"
[src]="currentPdf">
</ngx-extended-pdf-viewer>
</div>
</div>
<!-- All Dialogs --------------------------------------------------------------------------------->
<ejs-dialog id='ignoreDialog' header="Note For Ignore" #ignoreDialog [showCloseIcon]=true [width]=400
[buttons]='ignorebuttons' [visible]=false isModal='true'>
<ng-template #content>
<div class="e-float-input e-control-wrapper">
<textarea name="ignoreText" mdInput placeholder="Enter Note" rows="4"></textarea>
</div>
</ng-template>
</ejs-dialog>
<ejs-dialog id='duplicateDialog' header="Duplicate Document" #duplicateDialog [showCloseIcon]=true [visible]=false
isModal='true' [buttons]='dupbuttons' [width]=400>
<ng-template #content>
<div class="e-float-input e-control-wrapper">
<ejs-dropdownlist id='noOfCopies' #ddldupdoccopies [dataSource]='noCopies' [(value)]='selectedCopies'
floatLabelType='Always' placeholder='Select number of copies' ></ejs-dropdownlist>
</div>
<div class="e-float-input e-control-wrapper">
<div>
<ejs-radiobutton label="Copy same attribute values" name="0" [value]="0" checked="true"
[(ngModel)]="attributeCopy"></ejs-radiobutton>
</div>
<div>
<ejs-radiobutton label="Keep attribute values blank, Dropdown to default" [value]="1" name="1"
[(ngModel)]="attributeCopy"></ejs-radiobutton>
</div>
</div>
</ng-template>
</ejs-dialog>
<ejs-dialog id='rulebooklistDialog' header="Select Rule Book" #rblDialog [showCloseIcon]=true [width]=400 [height]=200
[visible]=false isModal='true' [buttons]='rblbuttons'>
<ng-template #content>
<div class="e-float-input e-control-wrapper">
<ejs-dropdownlist id='rblelement' #rblist [dataSource]='docRuleBook' [(value)]='selectedRuleBook'
floatLabelType='Always' placeholder='Select a rule book'></ejs-dropdownlist>
</div>
</ng-template>
</ejs-dialog>
<ejs-dialog id='showrulebookDialog' header="Rule Book" #showrbDialog [showCloseIcon]=true [width]=1000 [height]=600
[visible]=false isModal='true' [buttons]='showrbbuttons'>
<ng-template #content>
<p>fggffggffg</p>
<div style='position: relative; height: 100%;'>
<pdf-viewer [src]="currentPdfManual" [autoresize]="true" [original-size]='true' [fit-to-page]='true'>
</pdf-viewer>
</div>
</ng-template>
</ejs-dialog>
<ejs-dialog id='rulesetDialog' header="View Ruleset" #rulesetDialog [showCloseIcon]=true [width]=800 [height]=400
[visible]=false isModal='true' [buttons]="rulesetButton">
<ng-template #content>
<label>
<b>
<h4 style="font-size: 14px;">RuleSet Name: {{ruleSetName}}</h4>
<h4 style="font-size: 14px;">Attribute Type: {{attributeType}}</h4>
<h4 style="font-size: 14px;">{{message}}</h4>
</b>
</label>
<ejs-grid #rulesetGrid [dataSource]='viewRuleSetList' *ngIf='viewRuleSetList && viewRuleSetList.length != 0'
width='100%' gridLines="Both" [rowHeight]='30' [allowResizing]='true' [allowTextWrap]="true">
<e-columns>
<e-column field='attributeName' headerText='Rule' width=500></e-column>
<e-column field='merge' headerText='Merge' width=80></e-column>
<e-column field='ignoreCase' headerText='Ignore Case' width=80></e-column>
<e-column field='fallbackValue' headerText='Fallback Value' width=100></e-column>
</e-columns>
</ejs-grid>
</ng-template>
</ejs-dialog>
<ejs-dialog id='clauseCompareDialog' header="Clause Compare" #clauseCompareDialog [showCloseIcon]=false [width]=1000
[height]=600 [visible]=false isModal='true' [buttons]='clausebuttons' (beforeOpen)="beforeopen($event)">
<ng-template #content>
<div class="e-float-input e-control-wrapper">
<textarea [(ngModel)]="clauseText" name="clauseText" mdInput placeholder="Extracted Clause Text"
rows="5"></textarea>
<span class="e-float-line"></span>
<label class="e-float-text e-label-top" for="clauseText"> Extracted Clause Text</label>
</div>
<div class="e-float-input e-control-wrapper">
<textarea readonly [(ngModel)]="right" name="StandardClauseText" mdInput placeholder="Standard Clause Text"
rows="5"></textarea>
<span class="e-float-line"></span>
<label class="e-float-text e-label-top" for="clauseText">Standard Clause Text</label>
</div>
<div class="row justify-content-between">
<div class="col-8">
<ejs-dropdownlist id='clauseStatus' #ddlclausestatus [dataSource]='clauseStatus'
[(value)]='selectedClauseStatus' floatLabelType='Always' placeholder='Select Status'></ejs-dropdownlist>
</div>
<div class="col-4">
<div class="row justify-content-end">
<div class="col-4"></div>
<button ejs-button content="Compare" (click)="onCompareClick()"></button>
</div>
</div>
</div>
<div class="e-float-input e-control-wrapper">
<ejs-tab id="element">
<e-tabitems>
<e-tabitem>
<ng-template #headerText>
<div>Red Line</div>
</ng-template>
<ng-template #content>
<br>
<p [innerHTML]="diffText"></p>
<br>
<h6>a. Green Color: Text present in Extracted Clause but not present in the Standard Clause</h6>
<h6>b. Red Color (Strikeout): Text present in Standard Clause but not present in the Extracted
Clause</h6>
</ng-template>
</e-tabitem>
<e-tabitem>
<ng-template #headerText>
<div>Side by Side</div>
</ng-template>
<ng-template #content>
<br>
<div class="row">
<h4 style="color:#007bff">Extracted Clause</h4>
<h4 style="margin-left:35%;color:#007bff">Standard Clause</h4>
</div>
<td-ngx-text-diff [left]="left" [right]="right" (compareResults)="onCompareResults($event)">
</td-ngx-text-diff>
<br>
<h6>a. Green Color: Text present in Extracted Clause but not present in the Standard Clause</h6>
<h6>b. Red Color (Strikeout): Text present in Standard Clause but not present in the Extracted
Clause</h6>
</ng-template>
</e-tabitem>
</e-tabitems>
</ejs-tab>
</div>
</ng-template>
</ejs-dialog>
<ejs-dialog id='prevValueDialog' header="View Previous Results" #prevValueDialog [showCloseIcon]=true [width]=650
[height]=450 [visible]=false isModal='true'>
<ng-template #content>
<ejs-grid #prevResultGrid [dataSource]='prevDS' *ngIf='prevDS && prevDS.length != 0' [width]='580'
gridLines="Both" [rowHeight]='30' [allowTextWrap]='true'>
<e-columns>
<e-column field='Level' headerText=''></e-column>
<e-column field='Value' headerText='Value'></e-column>
</e-columns>
</ejs-grid>
</ng-template>
</ejs-dialog>
<!-- All Edit templates --------------------------------------------------------------------------------->
<ng-template #editTemplate let-att_Data>
<ng-container *ngIf="att_Data.Type === 'Simple' || att_Data.Type === 'CC' || att_Data.Type == undefined">
<textarea rows="6" style="resize:none;width:100%" [(ngModel)]="saveData.Value"></textarea>
</ng-container>
<ng-container *ngIf="att_Data.Type === 'MS'">
<ejs-multiselect id='multiselectelement' #multiselectelement [dataSource]='customlistdata' [fields]='fields'
[placeholder]='placeholder' [mode]='mode' [showDropDownIcon]='true' [popupHeight]='popupHeight'
[value]="multVal" [popupWidth]='popupWidth' (close)="closeMS($event, att_Data)" (select)="selectMS($event)"
(removed)="removedMS($event)">
</ejs-multiselect>
</ng-container>
<ng-container *ngIf="att_Data.Type === 'CS'">
<ejs-dropdownlist id='dropdownelement' #dropdownelement [dataSource]='customlistdata' [autofill]='true'
[fields]='fields' [placeholder]='placeholder' [showDropDownIcon]='true' [popupHeight]='popupHeight'
[popupWidth]='popupWidth' [(value)]='selectedCust' (change)="dropDownChange($event, att_Data)"
(close)="onCloseCS($event, att_Data)">
</ejs-dropdownlist>
</ng-container>
</ng-template>
<ng-template #IgnoreTemplate let-att_Data>
<div>
<ejs-checkbox #Ignore label="Ignore" [(ngModel)]="att_Data.Ignore" [checked]='att_Data.Ignore'
(change)='onIgnoreChange($event, att_Data)'></ejs-checkbox>
</div>
</ng-template>
<ng-template #DoubtfulTemplate let-att_Data>
<div>
<ejs-checkbox #Doubtful label="Doubtful" [(ngModel)]="att_Data.Doubtful" [checked]='att_Data.Doubtful'
(click)='onDoubtfulChange($event, att_Data)'></ejs-checkbox>
</div>
</ng-template>
<!-- Toaster -------------------------------------------------------------------------------------->
<ejs-toast #element [position]='toastPosition'></ejs-toast>
