Ext.define("ICTest.view.RESTGenerate",{extend:"Ext.container.Container",alias:"widget.restgenerate",requires:["ICTest.view.RESTMeasureMappingGrid"],layout:{type:"vbox",align:"stretch"},margin:10,selectedMetrics:"",descriptorFields:"",dataFieldParentNode:"",uniqueValuesForColumn:"",measureInternalValueMapping:"",isSelectedFieldsHasTextBasedValues:false,multipleNodes:false,initComponent:function(){var l=this;
var p=this.selectedMetrics;var m=this.descriptorFields;var k=this.dataFieldParentNode;var a=[];if(!Ext.isEmpty(m)){for(var b in m){var j={};var e=m[b];if(e!=null&&e.indexOf("|^|")>0){e=e.substring(0,e.indexOf("|^|"));}j["displayField"]=e;j["valueField"]=m[b];a.push(j);}}var i=[];var c=[];if(!Ext.isEmpty(p)){var o=[];
for(var h in p){var d=p[h];if(d!=null&&d.indexOf("|^|")>0){d=d.substring(0,d.indexOf("|^|"));}var n={};n["COLUMNS"]=d;c.push({"displayField":d,"valueField":d});var g=1;o.push(n);}}var f=[];f.push({xtype:"container",layout:{type:"vbox",align:"stretch",pack:"left"},defaults:{labelSeparator:"",margin:0},items:[{xtype:"panel",cls:"measureHead datapanel",scroll:true,border:true,title:"<span>"+screenLabelsObj["measuresLbl"]+"</span>",height:"200",scroll:true,autoScroll:true,items:[{xtype:"dataview",margin:"0 0 0 0",padding:0,flex:1,layout:{type:"vbox",align:"stretch"},store:Ext.data.Store({fields:["COLUMNS"],data:o}),itemSelector:"div.thumb-wrap",tpl:new Ext.XTemplate('<div class="newTable x-table-outer-border lastBorderLess">','<table border="0" style="width:100%; border:none" >',"{[this.getRows(values)]}","</table>","</div>",{getRows:function(q){var r="",s=[];
var t=(q.length%3);Ext.each(q,function(w,u){if(u==0){r+="<tr>";}else{if(u%3==0){r+="</tr>";r+="<tr>";}}var v=w.COLUMNS;if(v!=null&&v.indexOf("_bs_")>0){v=v.replace("_bs_"," ");}r+="<td >"+v+"</td>";});if(t==1){r+='<td colspan="1"> </td><td  colspan="1" > </td>';}else{if(t==2){r+='<td  colspan="1"> </td>';
}}r+="</tr>";return r;}})}]}]});if(l.isSelectedFieldsHasTextBasedValues){f.push({xtype:"container",layout:{type:"vbox",align:"stretch"},padding:"20 0 0 0",items:[{xtype:"panel",layout:{type:"vbox",align:"stretch"},cls:"measureHead datapanel",title:"Measure internal value configuration Details",items:[{xtype:"container",ui:"newContainer",border:true,flex:1,layout:{type:"vbox",align:"stretch"},padding:"0 5 0 5",items:[{xtype:"container",layout:{type:"hbox"},margin:"5 0 0 5",flex:1,items:[{xtype:"textfield",fieldLabel:'<span class="newFont_normal12" >Measure Display Value</span>',margin:"5 5 3 5",labelWidth:130,width:250,labelSeparator:"",id:"param_key",name:"param_key",cls:"DStextfield"},{xtype:"textfield",fieldLabel:'<span class="newFont_normal12" style="line-height:1;">Measure Numeric Value</span>',labelWidth:130,margin:"5 5 3 5",width:250,labelSeparator:"",id:"param_value",name:"param_value",cls:"DStextfield"},{xtype:"button",id:"addParam",name:"addParam",margin:"5 5 3 5",width:84,height:25,metricsArr:c,cls:"buttonNew apiConfBtn",text:'<span class="f12-normal addHeaderClr" style="font-family: Roboto" >'+screenLabelsObj["AddBtnLbl"]+"</span>",tooltip:"Click here to add"}]},{xtype:"restMeasureMappingGrid",margin:"10 5 10 5",flex:1,layout:{type:"vbox",align:"stretch"},id:"measureInternalValueMappingGrid",hidden:(l.isSelectedFieldsHasTextBasedValues?false:true)}],},]}]});
}if(!l.multipleNodes&&!Ext.isEmpty(a)){f.push({xtype:"container",layout:{type:"hbox",align:"stretch"},padding:"20 0 15 0",cls:"apiConfBottombtn",items:[{xtype:"switchfield",labelWidth:200,height:34,width:240,margin:"0 15 0 0",cls:"apiConfbtn",labelCls:"DSswitchfieldCls",labelStyle:"margin: 8px 0 0 0; display:block;",fieldLabel:'<span class="newFont_normal12" style="line-height:1;">'+infoBasedTest+"</span>",checked:false,id:"DescriptorRequired",name:"DescriptorRequired",inputValue:"Yes",uncheckedValue:"No",},{xtype:"scrollcombo",id:"descriptorDataRestFld",name:"descriptorDataRestFld",margin:"0 0 5 30",fieldLabel:"Descriptor",labelWidth:72,width:310,hidden:true,store:new Ext.data.Store({fields:["displayField","valueField"],data:a}),value:a[0].valueField,displayField:"displayField",valueField:"valueField",queryMode:"local",editable:false,forceSelection:false},{xtype:"button",cls:"buttonNew apiConfbtn",text:generate,id:"generate",name:"generate",height:25,margin:"2 0 6 10",width:84,}]});
}else{f.push({xtype:"container",layout:{type:"hbox",align:"stretch"},cls:"apiConfBottombtn",items:[{xtype:"button",cls:"buttonNew apiConfbtn",text:generate,id:"generate",height:25,name:"generate",margin:"20 0 18 0",width:84,}]});}this.items=f;this.callParent(this);},listeners:{"boxready":function(){var a=Ext.getCmp("restDataLoadingMask");
if(!Ext.isEmpty(a)){a.hide();}if(publicJSON!=null&&publicJSON.hasOwnProperty("restMeasureInternalMappingArr")){var b=Ext.getCmp("measureInternalValueMappingGrid");if(!Ext.isEmpty(b)){b.getStore().loadData(publicJSON["restMeasureInternalMappingArr"]);}}}}});