aurelia/aurelia

View on GitHub
docs/images/validation/seq-validator.svg

Summary

Maintainability
Test Coverage
<svg id="mermaid-1585176838316" width="100%" xmlns="http://www.w3.org/2000/svg" height="100%" style="max-width:875px;" viewBox="-75 -10 875 606"><style>#mermaid-1585176838316 .label{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);color:#333}#mermaid-1585176838316 .label text{fill:#333}#mermaid-1585176838316 .node rect,#mermaid-1585176838316 .node circle,#mermaid-1585176838316 .node ellipse,#mermaid-1585176838316 .node polygon{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-1585176838316 .node .label{text-align:center}#mermaid-1585176838316 .node.clickable{cursor:pointer}#mermaid-1585176838316 .arrowheadPath{fill:#333}#mermaid-1585176838316 .edgePath .path{stroke:#333;stroke-width:1.5px}#mermaid-1585176838316 .edgeLabel{background-color:#e8e8e8;text-align:center}#mermaid-1585176838316 .cluster rect{fill:#ffffde;stroke:#aa3;stroke-width:1px}#mermaid-1585176838316 .cluster text{fill:#333}#mermaid-1585176838316 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:12px;background:#ffffde;border:1px solid #aa3;border-radius:2px;pointer-events:none;z-index:100}#mermaid-1585176838316 .actor{stroke:#ccf;fill:#ECECFF}#mermaid-1585176838316 text.actor{fill:#000;stroke:none}#mermaid-1585176838316 .actor-line{stroke:grey}#mermaid-1585176838316 .messageLine0{stroke-width:1.5;stroke-dasharray:'2 2';stroke:#333}#mermaid-1585176838316 .messageLine1{stroke-width:1.5;stroke-dasharray:'2 2';stroke:#333}#mermaid-1585176838316 #arrowhead{fill:#333}#mermaid-1585176838316 .sequenceNumber{fill:#fff}#mermaid-1585176838316 #sequencenumber{fill:#333}#mermaid-1585176838316 #crosshead path{fill:#333 !important;stroke:#333 !important}#mermaid-1585176838316 .messageText{fill:#333;stroke:none}#mermaid-1585176838316 .labelBox{stroke:#ccf;fill:#ECECFF}#mermaid-1585176838316 .labelText{fill:#000;stroke:none}#mermaid-1585176838316 .loopText{fill:#000;stroke:none}#mermaid-1585176838316 .loopLine{stroke-width:2;stroke-dasharray:'2 2';stroke:#ccf}#mermaid-1585176838316 .note{stroke:#aa3;fill:#fff5ad}#mermaid-1585176838316 .noteText{fill:black;stroke:none;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:14px}#mermaid-1585176838316 .activation0{fill:#f4f4f4;stroke:#666}#mermaid-1585176838316 .activation1{fill:#f4f4f4;stroke:#666}#mermaid-1585176838316 .activation2{fill:#f4f4f4;stroke:#666}#mermaid-1585176838316 .mermaid-main-font{font-family:"trebuchet ms", verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-1585176838316 .section{stroke:none;opacity:0.2}#mermaid-1585176838316 .section0{fill:rgba(102,102,255,0.49)}#mermaid-1585176838316 .section2{fill:#fff400}#mermaid-1585176838316 .section1,#mermaid-1585176838316 .section3{fill:#fff;opacity:0.2}#mermaid-1585176838316 .sectionTitle0{fill:#333}#mermaid-1585176838316 .sectionTitle1{fill:#333}#mermaid-1585176838316 .sectionTitle2{fill:#333}#mermaid-1585176838316 .sectionTitle3{fill:#333}#mermaid-1585176838316 .sectionTitle{text-anchor:start;font-size:11px;text-height:14px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-1585176838316 .grid .tick{stroke:#d3d3d3;opacity:0.3;shape-rendering:crispEdges}#mermaid-1585176838316 .grid .tick text{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-1585176838316 .grid path{stroke-width:0}#mermaid-1585176838316 .today{fill:none;stroke:red;stroke-width:2px}#mermaid-1585176838316 .task{stroke-width:2}#mermaid-1585176838316 .taskText{text-anchor:middle;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-1585176838316 .taskText:not([font-size]){font-size:11px}#mermaid-1585176838316 .taskTextOutsideRight{fill:#000;text-anchor:start;font-size:11px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-1585176838316 .taskTextOutsideLeft{fill:#000;text-anchor:end;font-size:11px}#mermaid-1585176838316 .task.clickable{cursor:pointer}#mermaid-1585176838316 .taskText.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-1585176838316 .taskTextOutsideLeft.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-1585176838316 .taskTextOutsideRight.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-1585176838316 .taskText0,#mermaid-1585176838316 .taskText1,#mermaid-1585176838316 .taskText2,#mermaid-1585176838316 .taskText3{fill:#fff}#mermaid-1585176838316 .task0,#mermaid-1585176838316 .task1,#mermaid-1585176838316 .task2,#mermaid-1585176838316 .task3{fill:#8a90dd;stroke:#534fbc}#mermaid-1585176838316 .taskTextOutside0,#mermaid-1585176838316 .taskTextOutside2{fill:#000}#mermaid-1585176838316 .taskTextOutside1,#mermaid-1585176838316 .taskTextOutside3{fill:#000}#mermaid-1585176838316 .active0,#mermaid-1585176838316 .active1,#mermaid-1585176838316 .active2,#mermaid-1585176838316 .active3{fill:#bfc7ff;stroke:#534fbc}#mermaid-1585176838316 .activeText0,#mermaid-1585176838316 .activeText1,#mermaid-1585176838316 .activeText2,#mermaid-1585176838316 .activeText3{fill:#000 !important}#mermaid-1585176838316 .done0,#mermaid-1585176838316 .done1,#mermaid-1585176838316 .done2,#mermaid-1585176838316 .done3{stroke:grey;fill:#d3d3d3;stroke-width:2}#mermaid-1585176838316 .doneText0,#mermaid-1585176838316 .doneText1,#mermaid-1585176838316 .doneText2,#mermaid-1585176838316 .doneText3{fill:#000 !important}#mermaid-1585176838316 .crit0,#mermaid-1585176838316 .crit1,#mermaid-1585176838316 .crit2,#mermaid-1585176838316 .crit3{stroke:#f88;fill:red;stroke-width:2}#mermaid-1585176838316 .activeCrit0,#mermaid-1585176838316 .activeCrit1,#mermaid-1585176838316 .activeCrit2,#mermaid-1585176838316 .activeCrit3{stroke:#f88;fill:#bfc7ff;stroke-width:2}#mermaid-1585176838316 .doneCrit0,#mermaid-1585176838316 .doneCrit1,#mermaid-1585176838316 .doneCrit2,#mermaid-1585176838316 .doneCrit3{stroke:#f88;fill:#d3d3d3;stroke-width:2;cursor:pointer;shape-rendering:crispEdges}#mermaid-1585176838316 .milestone{transform:rotate(45deg) scale(0.8, 0.8)}#mermaid-1585176838316 .milestoneText{font-style:italic}#mermaid-1585176838316 .doneCritText0,#mermaid-1585176838316 .doneCritText1,#mermaid-1585176838316 .doneCritText2,#mermaid-1585176838316 .doneCritText3{fill:#000 !important}#mermaid-1585176838316 .activeCritText0,#mermaid-1585176838316 .activeCritText1,#mermaid-1585176838316 .activeCritText2,#mermaid-1585176838316 .activeCritText3{fill:#000 !important}#mermaid-1585176838316 .titleText{text-anchor:middle;font-size:18px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-1585176838316 g.classGroup text{fill:#9370db;stroke:none;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:10px}#mermaid-1585176838316 g.classGroup text .title{font-weight:bolder}#mermaid-1585176838316 g.classGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-1585176838316 g.classGroup line{stroke:#9370db;stroke-width:1}#mermaid-1585176838316 .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5}#mermaid-1585176838316 .classLabel .label{fill:#9370db;font-size:10px}#mermaid-1585176838316 .relation{stroke:#9370db;stroke-width:1;fill:none}#mermaid-1585176838316 #compositionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-1585176838316 #compositionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-1585176838316 #aggregationStart{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-1585176838316 #aggregationEnd{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-1585176838316 #dependencyStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-1585176838316 #dependencyEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-1585176838316 #extensionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-1585176838316 #extensionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-1585176838316 .commit-id,#mermaid-1585176838316 .commit-msg,#mermaid-1585176838316 .branch-label{fill:lightgrey;color:lightgrey;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-1585176838316 .pieTitleText{text-anchor:middle;font-size:25px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-1585176838316 .slice{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-1585176838316 g.stateGroup text{fill:#9370db;stroke:none;font-size:10px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-1585176838316 g.stateGroup text{fill:#9370db;stroke:none;font-size:10px}#mermaid-1585176838316 g.stateGroup .state-title{font-weight:bolder;fill:#000}#mermaid-1585176838316 g.stateGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-1585176838316 g.stateGroup line{stroke:#9370db;stroke-width:1}#mermaid-1585176838316 .transition{stroke:#9370db;stroke-width:1;fill:none}#mermaid-1585176838316 .stateGroup .composit{fill:white;border-bottom:1px}#mermaid-1585176838316 .state-note{stroke:#aa3;fill:#fff5ad}#mermaid-1585176838316 .state-note text{fill:black;stroke:none;font-size:10px}#mermaid-1585176838316 .stateLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5}#mermaid-1585176838316 .stateLabel text{fill:#000;font-size:10px;font-weight:bold;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}:root{--mermaid-font-family: '"trebuchet ms", verdana, arial';--mermaid-font-family: "Comic Sans MS", "Comic Sans", cursive}

:root { --mermaid-font-family: "trebuchet ms", verdana, arial;}</style><style>#mermaid-1585176838316 {
    color: rgb(0, 0, 0);
    font: 16px "trebuchet ms", verdana, arial;
  }</style><g></g><g><line id="actor0" x1="75" y1="5" x2="75" y2="595" class="actor-line" stroke-width="0.5px" stroke="#999"></line><rect x="0" y="0" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="75" y="32.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle; font-size: 14px;"><tspan x="75" dy="0">Validator</tspan></text></g><g><line id="actor1" x1="275" y1="5" x2="275" y2="595" class="actor-line" stroke-width="0.5px" stroke="#999"></line><rect x="200" y="0" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="275" y="32.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle; font-size: 14px;"><tspan x="275" dy="0">RulesRegistry</tspan></text></g><g><line id="actor2" x1="475" y1="5" x2="475" y2="595" class="actor-line" stroke-width="0.5px" stroke="#999"></line><rect x="400" y="0" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="475" y="32.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle; font-size: 14px;"><tspan x="475" dy="0">PropertyRule</tspan></text></g><g><line id="actor3" x1="675" y1="5" x2="675" y2="595" class="actor-line" stroke-width="0.5px" stroke="#999"></line><rect x="600" y="0" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="675" y="32.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle; font-size: 14px;"><tspan x="675" dy="0">MessageProvider</tspan></text></g><defs><marker id="arrowhead" refX="5" refY="2" markerWidth="6" markerHeight="4" orient="auto"><path d="M 0,0 V 4 L6,2 Z"></path></marker></defs><defs><marker id="crosshead" markerWidth="15" markerHeight="8" orient="auto" refX="16" refY="4"><path fill="black" stroke="#000000" stroke-width="1px" d="M 9,2 V 6 L16,4 Z" style="stroke-dasharray: 0, 0;"></path><path fill="none" stroke="#000000" stroke-width="1px" d="M 0,1 L 6,7 M 6,1 L 0,7" style="stroke-dasharray: 0, 0;"></path></marker></defs><defs><marker id="sequencenumber" refX="15" refY="15" markerWidth="60" markerHeight="40" orient="auto"><circle cx="15" cy="15" r="6"></circle></marker></defs><g><text x="175" y="93" class="messageText" style="text-anchor: middle;">Get rules for object</text><line x1="75" y1="100" x2="275" y2="100" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></line></g><g><text x="175" y="128" class="messageText" style="text-anchor: middle;">rules[]</text><line x1="275" y1="135" x2="75" y2="135" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></line></g><g><text x="275" y="188" class="messageText" style="text-anchor: middle;">validate() (async)</text><line x1="75" y1="195" x2="475" y2="195" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></line></g><g><text x="475" y="248" class="messageText" style="text-anchor: middle;">execute rule (async)</text><path d="M 475,255 C 535,245 535,285 475,275" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></path></g><g><text x="575" y="338" class="messageText" style="text-anchor: middle;">get validation message</text><line x1="475" y1="345" x2="675" y2="345" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></line></g><g><text x="575" y="373" class="messageText" style="text-anchor: middle;">validation message</text><line x1="675" y1="380" x2="475" y2="380" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></line></g><g><line x1="465" y1="295" x2="685" y2="295" class="loopLine"></line><line x1="685" y1="295" x2="685" y2="390" class="loopLine"></line><line x1="465" y1="390" x2="685" y2="390" class="loopLine"></line><line x1="465" y1="295" x2="465" y2="390" class="loopLine"></line><polygon points="465,295 515,295 515,308 506.6,315 465,315" class="labelBox"></polygon><text x="472.5" y="310" class="labelText"><tspan x="472.5">opt</tspan></text><text x="575" y="310" class="loopText" style="text-anchor: middle;"><tspan x="575">[ invalid ]</tspan></text></g><g><line x1="365" y1="205" x2="695" y2="205" class="loopLine"></line><line x1="695" y1="205" x2="695" y2="400" class="loopLine"></line><line x1="365" y1="400" x2="695" y2="400" class="loopLine"></line><line x1="365" y1="205" x2="365" y2="400" class="loopLine"></line><polygon points="365,205 415,205 415,218 406.6,225 365,225" class="labelBox"></polygon><text x="372.5" y="220" class="labelText"><tspan x="372.5">loop</tspan></text><text x="530" y="220" class="loopText" style="text-anchor: middle;"><tspan x="530">[ rule in $rules ]</tspan></text></g><g><text x="275" y="428" class="messageText" style="text-anchor: middle;">ValidationResults[]</text><line x1="475" y1="435" x2="75" y2="435" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></line></g><g><line x1="65" y1="145" x2="705" y2="145" class="loopLine"></line><line x1="705" y1="145" x2="705" y2="445" class="loopLine"></line><line x1="65" y1="445" x2="705" y2="445" class="loopLine"></line><line x1="65" y1="145" x2="65" y2="445" class="loopLine"></line><polygon points="65,145 115,145 115,158 106.6,165 65,165" class="labelBox"></polygon><text x="72.5" y="160" class="labelText"><tspan x="72.5">loop</tspan></text><text x="385" y="160" class="loopText" style="text-anchor: middle;"><tspan x="385">[ property rule ]</tspan></text></g><g><text x="75" y="473" class="messageText" style="text-anchor: middle;">flatten results and return</text><path d="M 75,480 C 135,470 135,510 75,500" class="messageLine0" stroke-width="2" stroke="black" marker-end="url(#arrowhead)" style="fill: none;"></path></g><g><rect x="0" y="530" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="75" y="562.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle; font-size: 14px;"><tspan x="75" dy="0">Validator</tspan></text></g><g><rect x="200" y="530" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="275" y="562.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle; font-size: 14px;"><tspan x="275" dy="0">RulesRegistry</tspan></text></g><g><rect x="400" y="530" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="475" y="562.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle; font-size: 14px;"><tspan x="475" dy="0">PropertyRule</tspan></text></g><g><rect x="600" y="530" fill="#eaeaea" stroke="#666" width="150" height="65" rx="3" ry="3" class="actor"></rect><text x="675" y="562.5" dominant-baseline="central" alignment-baseline="central" class="actor" style="text-anchor: middle; font-size: 14px;"><tspan x="675" dy="0">MessageProvider</tspan></text></g></svg>