@zklogic/draw.io
Version:
Draw.IO - Graph Editor integration in Angular-cli
1 lines • 5.08 kB
JavaScript
function mxAtlassianJiraIssue(e,a,s,t){mxShape.call(this),this.bounds=e,this.fill=a,this.stroke=s,this.strokewidth=null!=t?t:1,this.dx=.5}mxUtils.extend(mxAtlassianJiraIssue,mxRectangleShape),mxAtlassianJiraIssue.prototype.customProperties=[{name:"issueType",dispName:"Issue Type",type:"enum",enumList:[{val:"story",dispName:"Story"},{val:"task",dispName:"Task"},{val:"subTask",dispName:"Sub-Task"},{val:"feature",dispName:"Feature"},{val:"bug",dispName:"Bug"},{val:"techTask",dispName:"Tech Task"},{val:"epic",dispName:"Epic"},{val:"improvement",dispName:"Improvement"},{val:"fault",dispName:"Fault"},{val:"change",dispName:"Change"},{val:"access",dispName:"Access"},{val:"purchase",dispName:"Purchase"},{val:"itHelp",dispName:"IT Help"}]},{name:"issuePriority",dispName:"Issue Priority",type:"enum",enumList:[{val:"blocker",dispName:"Blocker"},{val:"critical",dispName:"Critical"},{val:"major",dispName:"Major"},{val:"minor",dispName:"Minor"},{val:"trivial",dispName:"Trivial"}]},{name:"issueStatus",dispName:"Issue Status",type:"enum",enumList:[{val:"todo",dispName:"TODO"},{val:"inProgress",dispName:"In Progress"},{val:"inReview",dispName:"In Review"},{val:"done",dispName:"Done"}]}],mxAtlassianJiraIssue.prototype.cst={ISSUE:"mxgraph.atlassian.issue"},mxAtlassianJiraIssue.prototype.paintForeground=function(e,a,s,t,l){e.translate(a,s);var i=mxUtils.getValue(this.style,"issueType","task"),r=mxUtils.getValue(this.style,"issuePriority","minor"),n=mxUtils.getValue(this.style,"issueStatus","todo");switch(e.setStrokeColor("none"),i){case"story":null!=(m=mxStencilRegistry.getStencil("mxgraph.atlassian.story"))&&(e.setFillColor("#61B659"),m.drawShape(e,this,5,5,10,10));break;case"task":null!=(m=mxStencilRegistry.getStencil("mxgraph.atlassian.task"))&&(e.setFillColor("#5EA3E4"),m.drawShape(e,this,5,5,10,10));break;case"subTask":null!=(m=mxStencilRegistry.getStencil("mxgraph.atlassian.subtask"))&&(e.setFillColor("#5EA3E4"),m.drawShape(e,this,5,5,10,10));break;case"feature":null!=(m=mxStencilRegistry.getStencil("mxgraph.atlassian.new_feature"))&&(e.setFillColor("#61B659"),m.drawShape(e,this,5,5,10,10));break;case"bug":null!=(m=mxStencilRegistry.getStencil("mxgraph.atlassian.bug"))&&(e.setFillColor("#CE0000"),m.drawShape(e,this,5,5,10,10));break;case"techTask":null!=(m=mxStencilRegistry.getStencil("mxgraph.atlassian.tech_task"))&&(e.setFillColor("#999C95"),m.drawShape(e,this,5,5,10,10));break;case"epic":null!=(m=mxStencilRegistry.getStencil("mxgraph.atlassian.epic"))&&(e.setFillColor("#9E4ADD"),m.drawShape(e,this,5,5,10,10));break;case"improvement":null!=(m=mxStencilRegistry.getStencil("mxgraph.atlassian.improvement"))&&(e.setFillColor("#61B659"),m.drawShape(e,this,5,5,10,10));break;case"fault":null!=(m=mxStencilRegistry.getStencil("mxgraph.atlassian.fault"))&&(e.setFillColor("#F8902F"),m.drawShape(e,this,5,5,10,10));break;case"change":null!=(m=mxStencilRegistry.getStencil("mxgraph.atlassian.change"))&&(e.setFillColor("#9E4ADD"),m.drawShape(e,this,5,5,10,10));break;case"access":null!=(m=mxStencilRegistry.getStencil("mxgraph.atlassian.access"))&&(e.setFillColor("#F8902F"),m.drawShape(e,this,5,5,10,10));break;case"purchase":null!=(m=mxStencilRegistry.getStencil("mxgraph.atlassian.purchase"))&&(e.setFillColor("#61B659"),m.drawShape(e,this,5,5,10,10));break;case"itHelp":null!=(m=mxStencilRegistry.getStencil("mxgraph.atlassian.it_help"))&&(e.setFillColor("#5EA3E4"),m.drawShape(e,this,5,5,10,10))}switch(r){case"blocker":null!=(m=mxStencilRegistry.getStencil("mxgraph.atlassian.no"))&&(e.setFillColor("#CE0000"),m.drawShape(e,this,85,5,10,10));break;case"critical":null!=(m=mxStencilRegistry.getStencil("mxgraph.atlassian.critical"))&&(e.setFillColor("#CE0000"),m.drawShape(e,this,86,3,8,14));break;case"major":null!=(m=mxStencilRegistry.getStencil("mxgraph.atlassian.double_up"))&&(e.setFillColor("#CE0000"),m.drawShape(e,this,85,5,10,10));break;case"minor":null!=(m=mxStencilRegistry.getStencil("mxgraph.atlassian.double"))&&(e.setFillColor("#2A8735"),m.drawShape(e,this,85,5,10,10));break;case"trivial":var m;null!=(m=mxStencilRegistry.getStencil("mxgraph.atlassian.single"))&&(e.setFillColor("#9AA1B2"),m.drawShape(e,this,85,5,10,10))}switch(e.setFillColor("#FFFFFD"),e.setFontColor("#4E6B89"),n){case"todo":e.rect(t-45,5,40,20),e.fill(),e.text(t-25,15,0,0,"TO DO",mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0);break;case"inProgress":e.rect(t-85,5,80,20),e.fill(),e.text(t-45,15,0,0,"IN PROGRESS",mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0);break;case"inReview":e.rect(t-75,5,70,20),e.fill(),e.text(t-40,15,0,0,"IN REVIEW",mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0);break;case"done":e.rect(t-45,5,40,20),e.fill(),e.text(t-25,15,0,0,"DONE",mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0);break;default:var o=mxUtils.getValue(this.style,"issueStatusWidth",6.5*n.length);e.rect(t-o-5,5,o,20),e.fill(),e.text(t-7,15,0,0,n,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_MIDDLE,0,null,0,0,0)}},mxCellRenderer.registerShape(mxAtlassianJiraIssue.prototype.cst.ISSUE,mxAtlassianJiraIssue);