-
Notifications
You must be signed in to change notification settings - Fork 0
/
546.5244a013180fc21763e4.js
1 lines (1 loc) · 14.7 KB
/
546.5244a013180fc21763e4.js
1
"use strict";(self.webpackChunksparkworks_console=self.webpackChunksparkworks_console||[]).push([[546],{97546:function(Q,h,u){u.r(h),u.d(h,{TypeModule:function(){return I}});var c=u(61116),d=u(11462),b=u(41190),y=u(33310),f=u(19772),v=u(57887),_=u(24830),q=u(87065),T=u(85831),p=u(32821),t=u(10312);function M(i,a){if(1&i&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td"),t.TgZ(6,"a",7),t._UZ(7,"i",8),t.qZA(),t.qZA(),t.qZA()),2&i){var e=a.$implicit;t.xp6(2),t.hij(" ",e.typeName," "),t.xp6(2),t.hij(" ",e.deprecated," "),t.xp6(2),t.MGl("routerLink","/console/types/",e.typeName,"")}}var C=function(){function i(){this.types=null,this.subtitle="This is some text within a card block."}return i.prototype.ngOnInit=function(){var a=this;console.log("Nikos-types"),T.b.get(p.x.apiName,p.x.paths.pathTypes,p.x.params).then(function(e){a.types=e.data.types,console.log(a.types)}).catch(function(e){console.log(e.response)})},i.prototype.ngAfterViewInit=function(){},i.\u0275fac=function(e){return new(e||i)},i.\u0275cmp=t.Xpm({type:i,selectors:[["ng-component"]],decls:16,vars:1,consts:[[1,"card"],[1,"card-body"],[1,"card-title"],[1,"lstick"],[1,"table-responsive"],[1,"table","vm","no-th-brd","pro-of-month","mb-0","v-middle"],[4,"ngFor","ngForOf"],["type","button",1,"btn","btn-primary","btn-rounded","btn-xs",3,"routerLink"],[1,"fa","fa-arrow-right"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0),t.TgZ(1,"div",1),t.TgZ(2,"h4",2),t._UZ(3,"span",3),t._uU(4,"Types List"),t.qZA(),t.TgZ(5,"div",4),t.TgZ(6,"table",5),t.TgZ(7,"thead"),t.TgZ(8,"tr"),t.TgZ(9,"th"),t._uU(10,"Name"),t.qZA(),t.TgZ(11,"th"),t._uU(12,"Deprecated"),t.qZA(),t._UZ(13,"th"),t.qZA(),t.qZA(),t.TgZ(14,"tbody"),t.YNc(15,M,8,3,"tr",6),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.xp6(15),t.Q6J("ngForOf",n.types))},directives:[c.sg,b.yS],encapsulation:2}),i}(),A=u(68063);function x(i,a){if(1&i){var e=t.EpF();t.TgZ(0,"tr"),t.TgZ(1,"td",16),t._uU(2),t.qZA(),t.TgZ(3,"td",16),t.TgZ(4,"a",17),t.NdJ("click",function(){var s=t.CHM(e).$implicit,m=t.oxw(),Z=t.MAs(49);return m.openEditAttributeModal(Z,s,m.unitMeasurements[s],0)}),t._uU(5),t.qZA(),t.qZA(),t.qZA()}if(2&i){var n=a.$implicit,o=t.oxw();t.xp6(2),t.Oqu(n),t.xp6(3),t.hij(" ",o.unitMeasurements[n]," ")}}function U(i,a){if(1&i&&(t.TgZ(0,"tr"),t.TgZ(1,"td",16),t._uU(2),t.qZA(),t._UZ(3,"td",16),t.qZA()),2&i){var e=t.oxw();t.xp6(2),t.Oqu(e.noUnitsTitle)}}function N(i,a){if(1&i){var e=t.EpF();t.TgZ(0,"tr"),t.TgZ(1,"td",16),t._uU(2),t.qZA(),t.TgZ(3,"td",16),t.TgZ(4,"a",17),t.NdJ("click",function(){var s=t.CHM(e).$implicit,m=t.oxw(),Z=t.MAs(49);return m.openEditAttributeModal(Z,s,m.attributes[s],1)}),t._uU(5),t.qZA(),t.qZA(),t.qZA()}if(2&i){var n=a.$implicit,o=t.oxw();t.xp6(2),t.Oqu(n),t.xp6(3),t.hij(" ",o.attributes[n]," ")}}function O(i,a){if(1&i&&(t.TgZ(0,"tr"),t.TgZ(1,"td",16),t._uU(2),t.qZA(),t._UZ(3,"td",16),t.qZA()),2&i){var e=t.oxw();t.xp6(2),t.Oqu(e.noAttributesTitle)}}var g=function(){return{standalone:!0}};function J(i,a){if(1&i){var e=t.EpF();t.TgZ(0,"div",18),t.TgZ(1,"h5",19),t._uU(2),t.qZA(),t.TgZ(3,"button",20),t.NdJ("click",function(){return t.CHM(e).$implicit.dismiss("Cross click")}),t.TgZ(4,"span",21),t._uU(5,"\xd7"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(6,"form",22),t.NdJ("ngSubmit",function(){return t.CHM(e),t.oxw().addAttribute()}),t.TgZ(7,"div",23),t.TgZ(8,"div",24),t.TgZ(9,"div",25),t.TgZ(10,"label",26),t._uU(11),t.qZA(),t.TgZ(12,"div",27),t.TgZ(13,"input",28),t.NdJ("ngModelChange",function(r){return t.CHM(e),t.oxw().attributeKey=r}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"div",25),t.TgZ(15,"label",29),t._uU(16),t.qZA(),t.TgZ(17,"div",27),t.TgZ(18,"input",30),t.NdJ("ngModelChange",function(r){return t.CHM(e),t.oxw().attributeValue=r}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(19,"div",31),t._UZ(20,"button",32),t.qZA(),t.qZA()}if(2&i){var n=t.oxw();t.xp6(2),t.hij(" ",0==n.attributeType?n.uomAddModalTitle:n.attrAddModalTitle," "),t.xp6(9),t.Oqu(n.keyTitle),t.xp6(2),t.s9C("placeholder",0==n.attributeType?n.uomKeyPlaceholder:n.attrKeyPlaceholder),t.Q6J("ngModel",n.attributeKey)("ngModelOptions",t.DdM(11,g)),t.xp6(3),t.Oqu(n.valueTitle),t.xp6(2),t.s9C("placeholder",0==n.attributeType?n.uomValuePlaceholder:n.attrValuePlaceholder),t.Q6J("ngModel",n.attributeValue)("ngModelOptions",t.DdM(12,g)),t.xp6(2),t.Q6J("disabled",!n.attributeKey||!n.attributeValue)("innerHTML",n.attributeAddBtn,t.oJD)}}function w(i,a){if(1&i&&t._UZ(0,"button",41),2&i){var e=t.oxw(2);t.Q6J("innerHTML",e.attributeUpdateBtn,t.oJD)}}function k(i,a){if(1&i){var e=t.EpF();t.TgZ(0,"div",18),t.TgZ(1,"h5",33),t._uU(2),t.qZA(),t.TgZ(3,"button",20),t.NdJ("click",function(){return t.CHM(e).$implicit.dismiss("Cross click")}),t.TgZ(4,"span",21),t._uU(5,"\xd7"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(6,"form",34),t.NdJ("ngSubmit",function(){return t.CHM(e),t.oxw().editAttribute()}),t.TgZ(7,"div",23),t.TgZ(8,"div",24),t.TgZ(9,"div",25),t.TgZ(10,"label",35),t._uU(11),t.qZA(),t.TgZ(12,"div",27),t._UZ(13,"input",36),t.qZA(),t.qZA(),t.TgZ(14,"div",25),t.TgZ(15,"label",37),t._uU(16),t.qZA(),t.TgZ(17,"div",27),t.TgZ(18,"input",38),t.NdJ("ngModelChange",function(r){return t.CHM(e),t.oxw().attributeValue=r}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(19,"div",31),t.YNc(20,w,1,1,"button",39),t.TgZ(21,"button",40),t.NdJ("click",function(){return t.CHM(e),t.oxw().deleteAttribute()}),t.qZA(),t.qZA(),t.qZA()}if(2&i){var n=t.oxw();t.xp6(2),t.hij(" ",0==n.attributeType?n.uomEditModalTitle:n.attrEditModalTitle," "),t.xp6(9),t.Oqu(n.keyTitle),t.xp6(2),t.Q6J("readOnly",!0)("value",n.attributeKey),t.xp6(3),t.Oqu(n.valueTitle),t.xp6(2),t.Q6J("value",n.attributeValue)("ngModel",n.attributeValue)("ngModelOptions",t.DdM(10,g)),t.xp6(2),t.Q6J("ngIf",n.attributeValue),t.xp6(1),t.Q6J("innerHTML",n.attributeDeleteBtn,t.oJD)}}var F=function(){function i(a,e){this.activatedRoute=a,this.modalService=e,this.objectKeys=Object.keys,this.type=null,this.attributes={},this.unitMeasurements={},this.attributeKey="",this.attributeValue="",this.typePath="",this.attributeType=2,this.uomPrefix="uom:",this.attributeAddBtn="Add",this.attributeUpdateBtn="Update",this.attributeDeleteBtn="Delete",this.keyTitle="Name",this.valueTitle="Value",this.uomCardTitle="Units of Measurement",this.uomAddModalTitle="Add unit",this.uomEditModalTitle="Edit unit",this.uomKeyPlaceholder="Unit name",this.uomValuePlaceholder="Unit value",this.attrCardTitle="Attributes",this.attrAddModalTitle="Add Attribute",this.attrEditModalTitle="Edit Attribute",this.attrKeyPlaceholder="Attribute name",this.attrValuePlaceholder="Attribute value",this.noUnitsTitle="No units",this.noAttributesTitle="No attributes"}return i.prototype.ngOnInit=function(){var a=this;this.activatedRoute.paramMap.subscribe(function(e){a.typeName=e.get("typeName")}),T.b.get(p.x.apiName,p.x.paths.pathType+this.typeName,p.x.params).then(function(e){if(a.type=e.data,a.type.hasOwnProperty("attributes")){var n=a.type.attributes,o={},r={},l=a.uomPrefix;Object.keys(n).forEach(function(s){s.substring(0,4)==l?o[s.substr(4)]=n[s]:r[s]=n[s]}),a.unitMeasurements=o,a.attributes=r}}).catch(function(e){console.log(e.response)})},i.prototype.openAddAttributeModal=function(a,e){this.attributeType=e,this.modalService.open(a,{size:"lg"})},i.prototype.openEditAttributeModal=function(a,e,n,o){this.attributeType=o,this.attributeKey=e,this.attributeValue=n,this.typePath=p.x.paths.pathType+this.typeName+p.x.paths.pathAttribute,this.modalService.open(a,{size:"lg"})},i.prototype.ngAfterViewInit=function(){},i.prototype.addAttribute=function(){var a,e=this,n={body:(a={},a[this.attributeType?this.attributeKey:this.uomPrefix+this.attributeKey]=this.attributeValue,a)};console.log(n),this.attributeAddBtn='<i class="fas fa-spinner fa-spin"></i>',T.b.post(p.x.apiName,p.x.paths.pathType+this.typeName+p.x.paths.pathAttribute,n).then(function(r){console.log(r),e.ngOnInit(),e.attributeAddBtn="Added!",setTimeout(function(){e.attributeAddBtn="Add"},1e3)}).catch(function(r){console.log(r)})},i.prototype.deleteAttribute=function(){var a,e=this;console.log("deleting attribute key: "+this.attributeKey);var n={body:(a={},a[this.attributeType?this.attributeKey:this.uomPrefix+this.attributeKey]="",a)};this.attributeDeleteBtn='<i class="fas fa-spinner fa-spin"></i>',T.b.post(p.x.apiName,this.typePath,n).then(function(o){console.log(o),e.ngOnInit(),e.modalService.dismissAll(),e.attributeDeleteBtn="Delete"}).catch(function(o){console.log(o)})},i.prototype.editAttribute=function(){var a,e=this,n={body:(a={},a[this.attributeType?this.attributeKey:this.uomPrefix+this.attributeKey]=this.attributeValue,a)};console.log(n),this.attributeUpdateBtn='<i class="fas fa-spinner fa-spin"></i>',T.b.post(p.x.apiName,this.typePath,n).then(function(o){console.log(o),e.ngOnInit(),e.attributeUpdateBtn="Updated!",setTimeout(function(){e.attributeUpdateBtn="Update"},1e3)}).catch(function(o){console.log(o)})},i.\u0275fac=function(e){return new(e||i)(t.Y36(b.gz),t.Y36(A.FF))},i.\u0275cmp=t.Xpm({type:i,selectors:[["app-type-attributes-table"]],inputs:{typeName:"typeName"},decls:50,vars:13,consts:[[1,"col-lg-3","col-md-4"],[1,"card"],[1,"card-body"],[1,"d-flex","row"],[1,"col-10"],[1,"card-title"],[1,"lstick"],[1,"col-2"],[1,"link","m-r-10",2,"cursor","pointer",3,"click"],[1,"fas","fa-plus","fa-pull-right"],[1,"table-responsive"],[1,"table","vm","no-th-brd","pro-of-month","mb-0","v-middle",2,"border-collapse","collapse","table-layout","fixed"],[4,"ngFor","ngForOf"],[4,"ngIf"],["addAttributeModal",""],["editAttributeModal",""],[2,"word-wrap","break-word"],[2,"cursor","pointer","color","#398bf7",3,"click"],[1,"modal-header"],["id","addAttributeModalLabel",1,"modal-title"],["type","button","aria-label","Close",1,"close",3,"click"],["aria-hidden","true"],["id","addAttributeForm",3,"ngSubmit"],[1,"modal-body"],[1,"form-check"],[1,"form-group","row"],["for","addAttributeKey",1,"col-sm-2","col-form-label"],[1,"col-sm-10"],["type","text","id","addAttributeKey","required","",1,"form-control",3,"placeholder","ngModel","ngModelOptions","ngModelChange"],["for","addAttributeValue",1,"col-sm-2","col-form-label"],["type","text","id","addAttributeValue","required","",1,"form-control",3,"placeholder","ngModel","ngModelOptions","ngModelChange"],[1,"modal-footer"],["type","submit",1,"btn","btn-primary","mb-2","float-right",3,"disabled","innerHTML"],["id","editAttributeModalLabel",1,"modal-title"],["id","editAttributeForm",3,"ngSubmit"],["for","editAttributeKey",1,"col-sm-2","col-form-label"],["type","text","id","editAttributeKey",1,"form-control-plaintext",3,"readOnly","value"],["for","editAttributeValue",1,"col-sm-2","col-form-label"],["type","text","id","editAttributeValue",1,"form-control",3,"value","ngModel","ngModelOptions","ngModelChange"],["type","submit","class","btn btn-primary mb-2 float-right",3,"innerHTML",4,"ngIf"],["type","button",1,"btn","btn-danger","mb-2","float-right",3,"innerHTML","click"],["type","submit",1,"btn","btn-primary","mb-2","float-right",3,"innerHTML"]],template:function(e,n){if(1&e){var o=t.EpF();t.TgZ(0,"div",0),t.TgZ(1,"div",1),t.TgZ(2,"div",2),t.TgZ(3,"div",3),t.TgZ(4,"div",4),t.TgZ(5,"h4",5),t._UZ(6,"span",6),t._uU(7),t.qZA(),t.qZA(),t.TgZ(8,"div",7),t.TgZ(9,"a",8),t.NdJ("click",function(){t.CHM(o);var l=t.MAs(47);return n.openAddAttributeModal(l,0)}),t._UZ(10,"i",9),t.qZA(),t.qZA(),t.qZA(),t.TgZ(11,"div",10),t.TgZ(12,"table",11),t.TgZ(13,"thead"),t.TgZ(14,"tr"),t.TgZ(15,"th"),t._uU(16),t.qZA(),t.TgZ(17,"th"),t._uU(18,"Unit"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(19,"tbody"),t.YNc(20,x,6,2,"tr",12),t.YNc(21,U,4,1,"tr",13),t.ALo(22,"json"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(23,"div",0),t.TgZ(24,"div",1),t.TgZ(25,"div",2),t.TgZ(26,"div",3),t.TgZ(27,"div",4),t.TgZ(28,"h4",5),t._UZ(29,"span",6),t._uU(30),t.qZA(),t.qZA(),t.TgZ(31,"div",7),t.TgZ(32,"a",8),t.NdJ("click",function(){t.CHM(o);var l=t.MAs(47);return n.openAddAttributeModal(l,1)}),t._UZ(33,"i",9),t.qZA(),t.qZA(),t.qZA(),t.TgZ(34,"div",10),t.TgZ(35,"table",11),t.TgZ(36,"thead"),t.TgZ(37,"tr"),t.TgZ(38,"th"),t._uU(39),t.qZA(),t.TgZ(40,"th"),t._uU(41),t.qZA(),t.qZA(),t.qZA(),t.TgZ(42,"tbody"),t.YNc(43,N,6,2,"tr",12),t.YNc(44,O,4,1,"tr",13),t.ALo(45,"json"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.YNc(46,J,21,13,"ng-template",null,14,t.W1O),t.YNc(48,k,22,11,"ng-template",null,15,t.W1O)}2&e&&(t.xp6(7),t.Oqu(n.uomCardTitle),t.xp6(9),t.Oqu(n.keyTitle),t.xp6(4),t.Q6J("ngForOf",n.objectKeys(n.unitMeasurements)),t.xp6(1),t.Q6J("ngIf","{}"==t.lcZ(22,9,n.unitMeasurements)),t.xp6(9),t.Oqu(n.attrCardTitle),t.xp6(9),t.Oqu(n.keyTitle),t.xp6(2),t.Oqu(n.valueTitle),t.xp6(2),t.Q6J("ngForOf",n.objectKeys(n.attributes)),t.xp6(1),t.Q6J("ngIf","{}"==t.lcZ(45,11,n.attributes)))},directives:[c.sg,c.O5,d._Y,d.JL,d.F,d.Fj,d.Q7,d.JJ,d.On],pipes:[c.Ts],encapsulation:2}),i}();function K(i,a){if(1&i&&(t.TgZ(0,"div",5),t.TgZ(1,"div",6),t.TgZ(2,"div",7),t.TgZ(3,"div",8),t.TgZ(4,"div",9),t.TgZ(5,"div",10),t.TgZ(6,"h4",11),t._UZ(7,"span",12),t._uU(8),t.qZA(),t.qZA(),t._UZ(9,"div",13),t.qZA(),t._UZ(10,"p",14),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&i){var e=t.oxw(2);t.xp6(8),t.hij("",e.typeName," ")}}function V(i,a){if(1&i&&(t.TgZ(0,"div",1),t.YNc(1,K,11,1,"div",2),t.TgZ(2,"div",3),t._UZ(3,"app-type-attributes-table",4),t.qZA(),t.qZA()),2&i){var e=t.oxw();t.xp6(1),t.Q6J("ngIf",null!==e.type),t.xp6(2),t.Q6J("typeName",e.typeName)}}var H=[{path:"types",data:{title:"",urls:[{title:"Types",url:"/types"},{title:"Types"}]},component:C},{path:"types/:typeName",data:{title:"",urls:[{title:"Type",url:"/types/:typeName"},{title:"Type"}]},component:function(){function i(a,e){this.activatedRoute=a,this.modalService=e,this.type=null,this.subtitle="This is some text within a card block.",this.typeName=null}return i.prototype.ngOnInit=function(){var a=this;this.activatedRoute.paramMap.subscribe(function(e){a.typeName=e.get("typeName")}),console.log(this.typeName),T.b.get(p.x.apiName,p.x.paths.pathType+this.typeName,p.x.params).then(function(e){a.type=e.data}).catch(function(e){console.log(e.response)})},i.prototype.ngAfterViewInit=function(){},i.prototype.openModal=function(a){this.modalService.open(a,{size:"lg"})},i.\u0275fac=function(e){return new(e||i)(t.Y36(b.gz),t.Y36(A.FF))},i.\u0275cmp=t.Xpm({type:i,selectors:[["ng-component"]],decls:1,vars:1,consts:[["class","row",4,"ngIf"],[1,"row"],["class","col-lg-3 col-md-6",4,"ngIf"],[1,"col-lg-9","col-md-6"],[1,"row",3,"typeName"],[1,"col-lg-3","col-md-6"],[1,"col-lg-12","col-md-12"],[1,"card"],[1,"card-body"],[1,"d-flex","row"],[1,"col-10"],[2,"white-space","nowrap","overflow","hidden","text-overflow","ellipsis"],[1,"lstick",2,"position","absolute"],[1,"col-2"],[1,"card-text"]],template:function(e,n){1&e&&t.YNc(0,V,4,2,"div",0),2&e&&t.Q6J("ngIf",null!==n.type)},directives:[c.O5,F],encapsulation:2}),i}()}],I=function(){function i(){}return i.\u0275fac=function(e){return new(e||i)},i.\u0275mod=t.oAB({type:i}),i.\u0275inj=t.cJS({imports:[[v.vQ.forRoot({defaults:{},plugins:[_.Z,q.WY]}),f.rW,d.u5,c.ez,b.Bz.forChild(H),y.nq]]}),i}()}}]);