Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
38138697
by Tony Chemit at 2023-07-31T13:09:08+02:00
3 changed files:
- client/datasource/actions/src/main/i18n/templates/validationReport_en_GB.ftl
- client/datasource/actions/src/main/i18n/templates/validationReport_es_ES.ftl
- client/datasource/actions/src/main/i18n/templates/validationReport_fr_FR.ftl
Changes:
| 1 | -<#-- @ftlvariable name=".data_model" type="fr.ird.observe.client.datasource.actions.validate.ValidateModel" --><#--
|
|
| 1 | +<#-- @ftlvariable name=".data_model" type="fr.ird.observe.client.datasource.actions.validate.ValidateModel" -->
|
|
| 2 | +<#--
|
|
| 2 | 3 | #%L
|
| 3 | 4 | ObServe Client :: DataSource :: Actions
|
| 4 | 5 | %%
|
| ... | ... | @@ -17,44 +18,232 @@ |
| 17 | 18 | <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| 18 | 19 | #L%
|
| 19 | 20 | -->
|
| 20 | -<html>
|
|
| 21 | +<!doctype html>
|
|
| 22 | +<html lang="en">
|
|
| 23 | +<#macro displayNode node>
|
|
| 24 | +<#-- @ftlvariable name="node" type="fr.ird.observe.client.datasource.actions.validate.tree.ValidationNode" -->
|
|
| 25 | + <#assign withChildren = node.childCount != 0 />
|
|
| 26 | + <#assign withMessages = node.messagesCount != 0 />
|
|
| 27 | + <li>
|
|
| 28 | + <span id="${node.id}" class="<#if withChildren>caret<#else>leaf</#if>"></span>
|
|
| 29 | + <span class="datum">${node.label}</span> <#if node.id?starts_with("fr.ird.referential") || node.id?starts_with("fr.ird.data") > - <span
|
|
| 30 | + class="topiaId">${node.id}</span></#if>
|
|
| 31 | + <#if withChildren || withMessages>
|
|
| 32 | + <ul class="nested">
|
|
| 33 | + <#if withMessages>
|
|
| 34 | + <#assign messages = node.messagesByLabel />
|
|
| 35 | + <table>
|
|
| 36 | + <#list messages as fieldName, fieldMessages>
|
|
| 37 | + <tr>
|
|
| 38 | + <td style="width:25%">${fieldName}</td>
|
|
| 39 | + <td>
|
|
| 40 | + <ul class="messages">
|
|
| 41 | + <#list fieldMessages as message>
|
|
| 42 | + <li class="<#if message.scope.name() == "ERROR">error<#else>warning</#if>">${message.message}</li>
|
|
| 43 | + </#list>
|
|
| 44 | + </ul>
|
|
| 45 | + </td>
|
|
| 46 | + </tr>
|
|
| 47 | + </#list>
|
|
| 48 | + </table>
|
|
| 49 | + </#if>
|
|
| 50 | + <#if withChildren>
|
|
| 51 | + <#list node.getChildren() as childNode>
|
|
| 52 | + <@displayNode childNode/>
|
|
| 53 | + </#list>
|
|
| 54 | + </#if>
|
|
| 55 | + </ul>
|
|
| 56 | + </#if>
|
|
| 57 | + </li>
|
|
| 58 | +</#macro>
|
|
| 59 | +<head>
|
|
| 60 | + <meta charset="UTF-8">
|
|
| 61 | + <meta lang="en">
|
|
| 62 | + <meta content="text/html">
|
|
| 63 | + <title>Rapport de validation</title>
|
|
| 64 | + <style>
|
|
| 65 | + #result {
|
|
| 66 | + list-style-type: none;
|
|
| 67 | + margin: 0;
|
|
| 68 | + padding: 0;
|
|
| 69 | + }
|
|
| 70 | + |
|
| 71 | + #result ul {
|
|
| 72 | + list-style-type: none;
|
|
| 73 | + }
|
|
| 74 | + |
|
| 75 | + .caret {
|
|
| 76 | + cursor: pointer;
|
|
| 77 | + user-select: none;
|
|
| 78 | + }
|
|
| 79 | + |
|
| 80 | + .caret::before {
|
|
| 81 | + content: "\1f5c0";
|
|
| 82 | + /*content: "\25B6";*/
|
|
| 83 | + color: #027BFF;
|
|
| 84 | + display: inline-block;
|
|
| 85 | + margin-right: 6px;
|
|
| 86 | + }
|
|
| 87 | + |
|
| 88 | + .caretSymbol::before {
|
|
| 89 | + content: "\1f5c0";
|
|
| 90 | + /*content: "\25B6";*/
|
|
| 91 | + color: #027BFF;
|
|
| 92 | + display: inline-block;
|
|
| 93 | + margin-right: 6px;
|
|
| 94 | + }
|
|
| 95 | + .leaf {
|
|
| 96 | + margin-top: 6px;
|
|
| 97 | + }
|
|
| 98 | + |
|
| 99 | + .leaf::before {
|
|
| 100 | + content: "\25CB";
|
|
| 101 | + color: #027BFF;
|
|
| 102 | + display: inline-block;
|
|
| 103 | + margin-right: 6px;
|
|
| 104 | + }
|
|
| 105 | + |
|
| 106 | + .caret-down::before {
|
|
| 107 | + content: "\1f5c1";
|
|
| 108 | + color: #027BFF;
|
|
| 109 | + /*transform: rotate(90deg);*/
|
|
| 110 | + }
|
|
| 111 | + |
|
| 112 | + #result .nested {
|
|
| 113 | + display: none;
|
|
| 114 | + }
|
|
| 115 | + |
|
| 116 | + #result .active {
|
|
| 117 | + display: block;
|
|
| 118 | + }
|
|
| 119 | + |
|
| 120 | + .datum {
|
|
| 121 | + |
|
| 122 | + }
|
|
| 123 | + |
|
| 124 | + table {
|
|
| 125 | + /*font-family: arial, sans-serif;*/
|
|
| 126 | + border-collapse: collapse;
|
|
| 127 | + width: 90%;
|
|
| 128 | + /*margin-left: 20px;*/
|
|
| 129 | + margin-top: 10px;
|
|
| 130 | + margin-bottom: 10px;
|
|
| 131 | + }
|
|
| 132 | + |
|
| 133 | + td, th {
|
|
| 134 | + border: 1px solid #027BFF;
|
|
| 135 | + text-align: left;
|
|
| 136 | + padding: 4px;
|
|
| 137 | + }
|
|
| 138 | + |
|
| 139 | + tr:nth-child(even) {
|
|
| 140 | + background-color: #dddddd;
|
|
| 141 | + }
|
|
| 142 | + |
|
| 143 | + .error:before {
|
|
| 144 | + padding-right: 8px;
|
|
| 145 | + content: "\26D4";
|
|
| 146 | + }
|
|
| 147 | + |
|
| 148 | + .warning:before {
|
|
| 149 | + padding-right: 8px;
|
|
| 150 | + content: "\26A0";
|
|
| 151 | + font-style: normal;
|
|
| 152 | + }
|
|
| 153 | + |
|
| 154 | + .information::before {
|
|
| 155 | + content: "\1F6C8";
|
|
| 156 | + color: #027BFF;
|
|
| 157 | + display: inline-block;
|
|
| 158 | + margin-right: 6px;
|
|
| 159 | + }
|
|
| 160 | + |
|
| 161 | + .topiaId {
|
|
| 162 | + -moz-user-select: all;
|
|
| 163 | + -webkit-user-select: all;
|
|
| 164 | + -ms-user-select: all;
|
|
| 165 | + user-select: all;
|
|
| 166 | + }
|
|
| 167 | + |
|
| 168 | + ul.messages {
|
|
| 169 | + list-style-type: none;
|
|
| 170 | + }
|
|
| 171 | + </style>
|
|
| 172 | +</head>
|
|
| 21 | 173 | <body>
|
| 22 | -<b>#TODO</b>
|
|
| 174 | +<b>TODO</b>
|
|
| 23 | 175 | <h1>Rapport de validation</h1>
|
| 24 | 176 | |
| 25 | 177 | <h2>Configuration</h2>
|
| 26 | 178 | |
| 27 | 179 | <ul>
|
| 28 | 180 | <li>Rapport de validation généré le ${.data_model.now}</li>
|
| 29 | - <li>Scopes : ${.data_model.scopes?join(", ")}</li>
|
|
| 181 | + <li>Niveau(x) de validation :
|
|
| 182 | + <#list .data_model.scopes as scope>
|
|
| 183 | + <span class="<#if scope.name() == "ERROR">error<#else>warning</#if>">${scope.label}</span>
|
|
| 184 | + </#list>
|
|
| 185 | + </li>
|
|
| 30 | 186 | <li>Context : ${.data_model.contextName}</li>
|
| 31 | 187 | </ul>
|
| 32 | 188 | |
| 33 | -<#assign nodes = .data_model.validationResult.nodes />
|
|
| 34 | -<#list nodes as node>
|
|
| 35 | -<#--<h2>${decorateType(type)} : ${count}</h2>-->
|
|
| 36 | -<#--<table>-->
|
|
| 37 | -<#-- <thead>-->
|
|
| 38 | -<#-- <tr>-->
|
|
| 39 | -<#-- <th>Identifiant</th>-->
|
|
| 40 | -<#-- <th>Libellé</th>-->
|
|
| 41 | -<#-- <th>Scope</th>-->
|
|
| 42 | -<#-- <th>Champs</th>-->
|
|
| 43 | -<#-- <th>Message</th>-->
|
|
| 44 | -<#-- </tr>-->
|
|
| 45 | -<#-- </thead>-->
|
|
| 46 | -<#-- <#list validationResult.getResultsForType(type) as dto>-->
|
|
| 47 | -<#-- <#list validationResult.getMessagesForId(dto.id) as message>-->
|
|
| 48 | -<#-- <tr>-->
|
|
| 49 | -<#-- <td>${dto.id}</td>-->
|
|
| 50 | -<#-- <td>${dto.reference}</td>-->
|
|
| 51 | -<#-- <td>${message.scope}</td>-->
|
|
| 52 | -<#-- <td>${decorateProperty(type, message.fieldName)}</td>-->
|
|
| 53 | -<#-- <td>${message.message}</td>-->
|
|
| 54 | -<#-- </tr>-->
|
|
| 55 | -<#-- </#list>-->
|
|
| 56 | -<#-- </#list>-->
|
|
| 57 | -<#--</table>-->
|
|
| 58 | -</#list>
|
|
| 189 | +<h2>Résultat</h2>
|
|
| 190 | +<h3>Notes</h3>
|
|
| 191 | +<div class="information">Pour déplier un nœud, cliquez sur l'icone <span class="caretSymbol"></span> (la combinaison avec la touche <b>Maj</b> effectue l'action sur le sous-arbre constitué de ses fils).</div>
|
|
| 192 | +<div class="information">Pour replier un nœud, cliquez sur l'icone <span class="caret-down"></span> (la combinaison avec la touche <b>Maj</b> effectue l'action sur le sous-arbre constitué de ses fils).</div>
|
|
| 193 | +<div class="information">Un clic sur un identifiant le sélectionne automatiquement.</div>
|
|
| 194 | +<br/>
|
|
| 195 | +<#assign rootNode = .data_model.rootNode />
|
|
| 196 | +<ul id="result">
|
|
| 197 | + <#list rootNode.getChildren() as node>
|
|
| 198 | + <@displayNode node/>
|
|
| 199 | + <br/>
|
|
| 200 | + </#list>
|
|
| 201 | +</ul>
|
|
| 202 | + |
|
| 203 | +<script>
|
|
| 204 | + function expand(node) {
|
|
| 205 | + // console.info("will expand child " + node.id);
|
|
| 206 | + node.classList.add("caret-down");
|
|
| 207 | + node.parentElement.querySelector(".nested").classList.add("active");
|
|
| 208 | + }
|
|
| 209 | + |
|
| 210 | + function collapse(node) {
|
|
| 211 | + // console.info("will collapse child " + node.id);
|
|
| 212 | + node.classList.remove("caret-down");
|
|
| 213 | + node.parentElement.querySelector(".nested").classList.remove("active");
|
|
| 214 | + }
|
|
| 215 | + |
|
| 216 | + function toggle(expanded, node) {
|
|
| 217 | + if (expanded) {
|
|
| 218 | + collapse(node);
|
|
| 219 | + } else {
|
|
| 220 | + expand(node);
|
|
| 221 | + }
|
|
| 222 | + }
|
|
| 223 | + |
|
| 224 | + for (const caret of document.getElementsByClassName("caret")) {
|
|
| 225 | + caret.addEventListener("click", function (event) {
|
|
| 226 | + let expanded = this.classList.contains("caret-down");
|
|
| 227 | + // console.info("do click on " + this.id+", was expanded? "+expanded);
|
|
| 228 | + toggle(expanded, this);
|
|
| 229 | + |
|
| 230 | + if (event.shiftKey) {
|
|
| 231 | + // console.info("SHIFT on " + this.id+" was expanded? "+expanded);
|
|
| 232 | + for (const child of this.parentElement.querySelector(".nested").getElementsByClassName("caret")) {
|
|
| 233 | + toggle(expanded, child);
|
|
| 234 | + }
|
|
| 235 | + }
|
|
| 236 | + });
|
|
| 237 | + <#if .data_model.modelMode.name() == "REFERENTIEL">
|
|
| 238 | + caret.click();
|
|
| 239 | + </#if>
|
|
| 240 | + }
|
|
| 241 | + for (const caret of document.getElementsByClassName("leaf")) {
|
|
| 242 | + let element = caret.parentElement.querySelector(".nested");
|
|
| 243 | + if (element != null) {
|
|
| 244 | + element.classList.toggle("active");
|
|
| 245 | + }
|
|
| 246 | + }
|
|
| 247 | +</script>
|
|
| 59 | 248 | </body>
|
| 60 | 249 | </html> |
| ... | ... | @@ -18,44 +18,231 @@ |
| 18 | 18 | <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| 19 | 19 | #L%
|
| 20 | 20 | -->
|
| 21 | -<html>
|
|
| 22 | -<body>
|
|
| 21 | +<!doctype html>
|
|
| 22 | +<html lang="es">
|
|
| 23 | +<#macro displayNode node>
|
|
| 24 | +<#-- @ftlvariable name="node" type="fr.ird.observe.client.datasource.actions.validate.tree.ValidationNode" -->
|
|
| 25 | + <#assign withChildren = node.childCount != 0 />
|
|
| 26 | + <#assign withMessages = node.messagesCount != 0 />
|
|
| 27 | + <li>
|
|
| 28 | + <span id="${node.id}" class="<#if withChildren>caret<#else>leaf</#if>"></span>
|
|
| 29 | + <span class="datum">${node.label}</span> <#if node.id?starts_with("fr.ird.referential") || node.id?starts_with("fr.ird.data") > - <span
|
|
| 30 | + class="topiaId">${node.id}</span></#if>
|
|
| 31 | + <#if withChildren || withMessages>
|
|
| 32 | + <ul class="nested">
|
|
| 33 | + <#if withMessages>
|
|
| 34 | + <#assign messages = node.messagesByLabel />
|
|
| 35 | + <table>
|
|
| 36 | + <#list messages as fieldName, fieldMessages>
|
|
| 37 | + <tr>
|
|
| 38 | + <td style="width:25%">${fieldName}</td>
|
|
| 39 | + <td>
|
|
| 40 | + <ul class="messages">
|
|
| 41 | + <#list fieldMessages as message>
|
|
| 42 | + <li class="<#if message.scope.name() == "ERROR">error<#else>warning</#if>">${message.message}</li>
|
|
| 43 | + </#list>
|
|
| 44 | + </ul>
|
|
| 45 | + </td>
|
|
| 46 | + </tr>
|
|
| 47 | + </#list>
|
|
| 48 | + </table>
|
|
| 49 | + </#if>
|
|
| 50 | + <#if withChildren>
|
|
| 51 | + <#list node.getChildren() as childNode>
|
|
| 52 | + <@displayNode childNode/>
|
|
| 53 | + </#list>
|
|
| 54 | + </#if>
|
|
| 55 | + </ul>
|
|
| 56 | + </#if>
|
|
| 57 | + </li>
|
|
| 58 | +</#macro>
|
|
| 59 | +<head>
|
|
| 60 | + <meta charset="UTF-8">
|
|
| 61 | + <meta lang="es">
|
|
| 62 | + <meta content="text/html">
|
|
| 63 | + <title>Rapport de validation</title>
|
|
| 64 | + <style>
|
|
| 65 | + #result {
|
|
| 66 | + list-style-type: none;
|
|
| 67 | + margin: 0;
|
|
| 68 | + padding: 0;
|
|
| 69 | + }
|
|
| 70 | + |
|
| 71 | + #result ul {
|
|
| 72 | + list-style-type: none;
|
|
| 73 | + }
|
|
| 74 | + |
|
| 75 | + .caret {
|
|
| 76 | + cursor: pointer;
|
|
| 77 | + user-select: none;
|
|
| 78 | + }
|
|
| 79 | + |
|
| 80 | + .caret::before {
|
|
| 81 | + content: "\1f5c0";
|
|
| 82 | + /*content: "\25B6";*/
|
|
| 83 | + color: #027BFF;
|
|
| 84 | + display: inline-block;
|
|
| 85 | + margin-right: 6px;
|
|
| 86 | + }
|
|
| 87 | + |
|
| 88 | + .caretSymbol::before {
|
|
| 89 | + content: "\1f5c0";
|
|
| 90 | + /*content: "\25B6";*/
|
|
| 91 | + color: #027BFF;
|
|
| 92 | + display: inline-block;
|
|
| 93 | + margin-right: 6px;
|
|
| 94 | + }
|
|
| 95 | + .leaf {
|
|
| 96 | + margin-top: 6px;
|
|
| 97 | + }
|
|
| 98 | + |
|
| 99 | + .leaf::before {
|
|
| 100 | + content: "\25CB";
|
|
| 101 | + color: #027BFF;
|
|
| 102 | + display: inline-block;
|
|
| 103 | + margin-right: 6px;
|
|
| 104 | + }
|
|
| 105 | + |
|
| 106 | + .caret-down::before {
|
|
| 107 | + content: "\1f5c1";
|
|
| 108 | + color: #027BFF;
|
|
| 109 | + /*transform: rotate(90deg);*/
|
|
| 110 | + }
|
|
| 111 | + |
|
| 112 | + #result .nested {
|
|
| 113 | + display: none;
|
|
| 114 | + }
|
|
| 115 | + |
|
| 116 | + #result .active {
|
|
| 117 | + display: block;
|
|
| 118 | + }
|
|
| 119 | + |
|
| 120 | + .datum {
|
|
| 121 | + |
|
| 122 | + }
|
|
| 123 | + |
|
| 124 | + table {
|
|
| 125 | + /*font-family: arial, sans-serif;*/
|
|
| 126 | + border-collapse: collapse;
|
|
| 127 | + width: 90%;
|
|
| 128 | + /*margin-left: 20px;*/
|
|
| 129 | + margin-top: 10px;
|
|
| 130 | + margin-bottom: 10px;
|
|
| 131 | + }
|
|
| 132 | + |
|
| 133 | + td, th {
|
|
| 134 | + border: 1px solid #027BFF;
|
|
| 135 | + text-align: left;
|
|
| 136 | + padding: 4px;
|
|
| 137 | + }
|
|
| 23 | 138 | |
| 24 | -<h1>Informe de validación</h1>
|
|
| 139 | + tr:nth-child(even) {
|
|
| 140 | + background-color: #dddddd;
|
|
| 141 | + }
|
|
| 25 | 142 | |
| 26 | -<h2>Configuración</h2>
|
|
| 143 | + .error:before {
|
|
| 144 | + padding-right: 8px;
|
|
| 145 | + content: "\26D4";
|
|
| 146 | + }
|
|
| 147 | + |
|
| 148 | + .warning:before {
|
|
| 149 | + padding-right: 8px;
|
|
| 150 | + content: "\26A0";
|
|
| 151 | + font-style: normal;
|
|
| 152 | + }
|
|
| 153 | + |
|
| 154 | + .information::before {
|
|
| 155 | + content: "\1F6C8";
|
|
| 156 | + color: #027BFF;
|
|
| 157 | + display: inline-block;
|
|
| 158 | + margin-right: 6px;
|
|
| 159 | + }
|
|
| 160 | + |
|
| 161 | + .topiaId {
|
|
| 162 | + -moz-user-select: all;
|
|
| 163 | + -webkit-user-select: all;
|
|
| 164 | + -ms-user-select: all;
|
|
| 165 | + user-select: all;
|
|
| 166 | + }
|
|
| 167 | + |
|
| 168 | + ul.messages {
|
|
| 169 | + list-style-type: none;
|
|
| 170 | + }
|
|
| 171 | + </style>
|
|
| 172 | +</head>
|
|
| 173 | +<body>
|
|
| 174 | +<h1>Rapport de validation</h1>
|
|
| 175 | + |
|
| 176 | +<h2>Configuration</h2>
|
|
| 27 | 177 | |
| 28 | 178 | <ul>
|
| 29 | - <li>Informe de validación generado el ${.data_model.now}</li>
|
|
| 30 | - <li>Scopes : ${.data_model.scopes?join(", ")}</li>
|
|
| 179 | + <li>Rapport de validation généré le ${.data_model.now}</li>
|
|
| 180 | + <li>Niveau(x) de validation :
|
|
| 181 | + <#list .data_model.scopes as scope>
|
|
| 182 | + <span class="<#if scope.name() == "ERROR">error<#else>warning</#if>">${scope.label}</span>
|
|
| 183 | + </#list>
|
|
| 184 | + </li>
|
|
| 31 | 185 | <li>Context : ${.data_model.contextName}</li>
|
| 32 | 186 | </ul>
|
| 33 | 187 | |
| 34 | -<#assign nodes = .data_model.validationResult.nodes />
|
|
| 35 | -<#list nodes as node>
|
|
| 36 | -<#--<h2>${decorateType(type)} : ${count}</h2>-->
|
|
| 37 | -<#--<table>-->
|
|
| 38 | -<#-- <thead>-->
|
|
| 39 | -<#-- <tr>-->
|
|
| 40 | -<#-- <th>Identifiant</th>-->
|
|
| 41 | -<#-- <th>Libellé</th>-->
|
|
| 42 | -<#-- <th>Scope</th>-->
|
|
| 43 | -<#-- <th>Champs</th>-->
|
|
| 44 | -<#-- <th>Message</th>-->
|
|
| 45 | -<#-- </tr>-->
|
|
| 46 | -<#-- </thead>-->
|
|
| 47 | -<#-- <#list validationResult.getResultsForType(type) as dto>-->
|
|
| 48 | -<#-- <#list validationResult.getMessagesForId(dto.id) as message>-->
|
|
| 49 | -<#-- <tr>-->
|
|
| 50 | -<#-- <td>${dto.id}</td>-->
|
|
| 51 | -<#-- <td>${dto.reference}</td>-->
|
|
| 52 | -<#-- <td>${message.scope}</td>-->
|
|
| 53 | -<#-- <td>${decorateProperty(type, message.fieldName)}</td>-->
|
|
| 54 | -<#-- <td>${message.message}</td>-->
|
|
| 55 | -<#-- </tr>-->
|
|
| 56 | -<#-- </#list>-->
|
|
| 57 | -<#-- </#list>-->
|
|
| 58 | -<#--</table>-->
|
|
| 59 | -</#list>
|
|
| 188 | +<h2>Résultat</h2>
|
|
| 189 | +<h3>Notes</h3>
|
|
| 190 | +<div class="information">Pour déplier un nœud, cliquez sur l'icone <span class="caretSymbol"></span> (la combinaison avec la touche <b>Maj</b> effectue l'action sur le sous-arbre constitué de ses fils).</div>
|
|
| 191 | +<div class="information">Pour replier un nœud, cliquez sur l'icone <span class="caret-down"></span> (la combinaison avec la touche <b>Maj</b> effectue l'action sur le sous-arbre constitué de ses fils).</div>
|
|
| 192 | +<div class="information">Un clic sur un identifiant le sélectionne automatiquement.</div>
|
|
| 193 | +<br/>
|
|
| 194 | +<#assign rootNode = .data_model.rootNode />
|
|
| 195 | +<ul id="result">
|
|
| 196 | + <#list rootNode.getChildren() as node>
|
|
| 197 | + <@displayNode node/>
|
|
| 198 | + <br/>
|
|
| 199 | + </#list>
|
|
| 200 | +</ul>
|
|
| 201 | + |
|
| 202 | +<script>
|
|
| 203 | + function expand(node) {
|
|
| 204 | + // console.info("will expand child " + node.id);
|
|
| 205 | + node.classList.add("caret-down");
|
|
| 206 | + node.parentElement.querySelector(".nested").classList.add("active");
|
|
| 207 | + }
|
|
| 208 | + |
|
| 209 | + function collapse(node) {
|
|
| 210 | + // console.info("will collapse child " + node.id);
|
|
| 211 | + node.classList.remove("caret-down");
|
|
| 212 | + node.parentElement.querySelector(".nested").classList.remove("active");
|
|
| 213 | + }
|
|
| 214 | + |
|
| 215 | + function toggle(expanded, node) {
|
|
| 216 | + if (expanded) {
|
|
| 217 | + collapse(node);
|
|
| 218 | + } else {
|
|
| 219 | + expand(node);
|
|
| 220 | + }
|
|
| 221 | + }
|
|
| 222 | + |
|
| 223 | + for (const caret of document.getElementsByClassName("caret")) {
|
|
| 224 | + caret.addEventListener("click", function (event) {
|
|
| 225 | + let expanded = this.classList.contains("caret-down");
|
|
| 226 | + // console.info("do click on " + this.id+", was expanded? "+expanded);
|
|
| 227 | + toggle(expanded, this);
|
|
| 228 | + |
|
| 229 | + if (event.shiftKey) {
|
|
| 230 | + // console.info("SHIFT on " + this.id+" was expanded? "+expanded);
|
|
| 231 | + for (const child of this.parentElement.querySelector(".nested").getElementsByClassName("caret")) {
|
|
| 232 | + toggle(expanded, child);
|
|
| 233 | + }
|
|
| 234 | + }
|
|
| 235 | + });
|
|
| 236 | + <#if .data_model.modelMode.name() == "REFERENTIEL">
|
|
| 237 | + caret.click();
|
|
| 238 | + </#if>
|
|
| 239 | + }
|
|
| 240 | + for (const caret of document.getElementsByClassName("leaf")) {
|
|
| 241 | + let element = caret.parentElement.querySelector(".nested");
|
|
| 242 | + if (element != null) {
|
|
| 243 | + element.classList.toggle("active");
|
|
| 244 | + }
|
|
| 245 | + }
|
|
| 246 | +</script>
|
|
| 60 | 247 | </body>
|
| 61 | 248 | </html> |
| ... | ... | @@ -18,43 +18,231 @@ |
| 18 | 18 | <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| 19 | 19 | #L%
|
| 20 | 20 | -->
|
| 21 | -<html>
|
|
| 22 | -<body>
|
|
| 21 | +<!doctype html>
|
|
| 22 | +<html lang="fr">
|
|
| 23 | +<#macro displayNode node>
|
|
| 24 | +<#-- @ftlvariable name="node" type="fr.ird.observe.client.datasource.actions.validate.tree.ValidationNode" -->
|
|
| 25 | + <#assign withChildren = node.childCount != 0 />
|
|
| 26 | + <#assign withMessages = node.messagesCount != 0 />
|
|
| 27 | + <li>
|
|
| 28 | + <span id="${node.id}" class="<#if withChildren>caret<#else>leaf</#if>"></span>
|
|
| 29 | + <span class="datum">${node.label}</span> <#if node.id?starts_with("fr.ird.referential") || node.id?starts_with("fr.ird.data") > - <span
|
|
| 30 | + class="topiaId">${node.id}</span></#if>
|
|
| 31 | + <#if withChildren || withMessages>
|
|
| 32 | + <ul class="nested">
|
|
| 33 | + <#if withMessages>
|
|
| 34 | + <#assign messages = node.messagesByLabel />
|
|
| 35 | + <table>
|
|
| 36 | + <#list messages as fieldName, fieldMessages>
|
|
| 37 | + <tr>
|
|
| 38 | + <td style="width:25%">${fieldName}</td>
|
|
| 39 | + <td>
|
|
| 40 | + <ul class="messages">
|
|
| 41 | + <#list fieldMessages as message>
|
|
| 42 | + <li class="<#if message.scope.name() == "ERROR">error<#else>warning</#if>">${message.message}</li>
|
|
| 43 | + </#list>
|
|
| 44 | + </ul>
|
|
| 45 | + </td>
|
|
| 46 | + </tr>
|
|
| 47 | + </#list>
|
|
| 48 | + </table>
|
|
| 49 | + </#if>
|
|
| 50 | + <#if withChildren>
|
|
| 51 | + <#list node.getChildren() as childNode>
|
|
| 52 | + <@displayNode childNode/>
|
|
| 53 | + </#list>
|
|
| 54 | + </#if>
|
|
| 55 | + </ul>
|
|
| 56 | + </#if>
|
|
| 57 | + </li>
|
|
| 58 | +</#macro>
|
|
| 59 | +<head>
|
|
| 60 | + <meta charset="UTF-8">
|
|
| 61 | + <meta lang="fr">
|
|
| 62 | + <meta content="text/html">
|
|
| 63 | + <title>Rapport de validation</title>
|
|
| 64 | + <style>
|
|
| 65 | + #result {
|
|
| 66 | + list-style-type: none;
|
|
| 67 | + margin: 0;
|
|
| 68 | + padding: 0;
|
|
| 69 | + }
|
|
| 70 | + |
|
| 71 | + #result ul {
|
|
| 72 | + list-style-type: none;
|
|
| 73 | + }
|
|
| 74 | + |
|
| 75 | + .caret {
|
|
| 76 | + cursor: pointer;
|
|
| 77 | + user-select: none;
|
|
| 78 | + }
|
|
| 79 | + |
|
| 80 | + .caret::before {
|
|
| 81 | + content: "\1f5c0";
|
|
| 82 | + /*content: "\25B6";*/
|
|
| 83 | + color: #027BFF;
|
|
| 84 | + display: inline-block;
|
|
| 85 | + margin-right: 6px;
|
|
| 86 | + }
|
|
| 87 | + |
|
| 88 | + .caretSymbol::before {
|
|
| 89 | + content: "\1f5c0";
|
|
| 90 | + /*content: "\25B6";*/
|
|
| 91 | + color: #027BFF;
|
|
| 92 | + display: inline-block;
|
|
| 93 | + margin-right: 6px;
|
|
| 94 | + }
|
|
| 95 | + .leaf {
|
|
| 96 | + margin-top: 6px;
|
|
| 97 | + }
|
|
| 98 | + |
|
| 99 | + .leaf::before {
|
|
| 100 | + content: "\25CB";
|
|
| 101 | + color: #027BFF;
|
|
| 102 | + display: inline-block;
|
|
| 103 | + margin-right: 6px;
|
|
| 104 | + }
|
|
| 105 | + |
|
| 106 | + .caret-down::before {
|
|
| 107 | + content: "\1f5c1";
|
|
| 108 | + color: #027BFF;
|
|
| 109 | + /*transform: rotate(90deg);*/
|
|
| 110 | + }
|
|
| 111 | + |
|
| 112 | + #result .nested {
|
|
| 113 | + display: none;
|
|
| 114 | + }
|
|
| 115 | + |
|
| 116 | + #result .active {
|
|
| 117 | + display: block;
|
|
| 118 | + }
|
|
| 119 | + |
|
| 120 | + .datum {
|
|
| 121 | + |
|
| 122 | + }
|
|
| 123 | + |
|
| 124 | + table {
|
|
| 125 | + /*font-family: arial, sans-serif;*/
|
|
| 126 | + border-collapse: collapse;
|
|
| 127 | + width: 90%;
|
|
| 128 | + margin-left: 20px;
|
|
| 129 | + margin-top: 10px;
|
|
| 130 | + margin-bottom: 10px;
|
|
| 131 | + }
|
|
| 132 | + |
|
| 133 | + td, th {
|
|
| 134 | + border: 1px solid #027BFF;
|
|
| 135 | + text-align: left;
|
|
| 136 | + padding: 4px;
|
|
| 137 | + }
|
|
| 23 | 138 | |
| 139 | + tr:nth-child(even) {
|
|
| 140 | + background-color: #dddddd;
|
|
| 141 | + }
|
|
| 142 | + |
|
| 143 | + .error:before {
|
|
| 144 | + padding-right: 8px;
|
|
| 145 | + content: "\26D4";
|
|
| 146 | + }
|
|
| 147 | + |
|
| 148 | + .warning:before {
|
|
| 149 | + padding-right: 8px;
|
|
| 150 | + content: "\26A0";
|
|
| 151 | + font-style: normal;
|
|
| 152 | + }
|
|
| 153 | + |
|
| 154 | + .information::before {
|
|
| 155 | + content: "\1F6C8";
|
|
| 156 | + color: #027BFF;
|
|
| 157 | + display: inline-block;
|
|
| 158 | + margin-right: 6px;
|
|
| 159 | + }
|
|
| 160 | + |
|
| 161 | + .topiaId {
|
|
| 162 | + -moz-user-select: all;
|
|
| 163 | + -webkit-user-select: all;
|
|
| 164 | + -ms-user-select: all;
|
|
| 165 | + user-select: all;
|
|
| 166 | + }
|
|
| 167 | + |
|
| 168 | + ul.messages {
|
|
| 169 | + list-style-type: none;
|
|
| 170 | + }
|
|
| 171 | + </style>
|
|
| 172 | +</head>
|
|
| 173 | +<body>
|
|
| 24 | 174 | <h1>Rapport de validation</h1>
|
| 25 | 175 | |
| 26 | 176 | <h2>Configuration</h2>
|
| 27 | 177 | |
| 28 | 178 | <ul>
|
| 29 | - <li>Rapport de validation généré le ${now}</li>
|
|
| 30 | - <li>Scopes : ${.data_model.scopes?join(", ")}</li>
|
|
| 179 | + <li>Rapport de validation généré le ${.data_model.now}</li>
|
|
| 180 | + <li>Niveau(x) de validation :
|
|
| 181 | + <#list .data_model.scopes as scope>
|
|
| 182 | + <span class="<#if scope.name() == "ERROR">error<#else>warning</#if>">${scope.label}</span>
|
|
| 183 | + </#list>
|
|
| 184 | + </li>
|
|
| 31 | 185 | <li>Context : ${.data_model.contextName}</li>
|
| 32 | 186 | </ul>
|
| 33 | -<#assign nodes = .data_model.validationResult.nodes />
|
|
| 34 | -<#list nodes as node>
|
|
| 35 | -<#--<h2>${decorateType(type)} : ${count}</h2>-->
|
|
| 36 | -<#--<table>-->
|
|
| 37 | -<#-- <thead>-->
|
|
| 38 | -<#-- <tr>-->
|
|
| 39 | -<#-- <th>Identifiant</th>-->
|
|
| 40 | -<#-- <th>Libellé</th>-->
|
|
| 41 | -<#-- <th>Scope</th>-->
|
|
| 42 | -<#-- <th>Champs</th>-->
|
|
| 43 | -<#-- <th>Message</th>-->
|
|
| 44 | -<#-- </tr>-->
|
|
| 45 | -<#-- </thead>-->
|
|
| 46 | -<#-- <#list validationResult.getResultsForType(type) as dto>-->
|
|
| 47 | -<#-- <#list validationResult.getMessagesForId(dto.id) as message>-->
|
|
| 48 | -<#-- <tr>-->
|
|
| 49 | -<#-- <td>${dto.id}</td>-->
|
|
| 50 | -<#-- <td>${dto.reference}</td>-->
|
|
| 51 | -<#-- <td>${message.scope}</td>-->
|
|
| 52 | -<#-- <td>${decorateProperty(type, message.fieldName)}</td>-->
|
|
| 53 | -<#-- <td>${message.message}</td>-->
|
|
| 54 | -<#-- </tr>-->
|
|
| 55 | -<#-- </#list>-->
|
|
| 56 | -<#-- </#list>-->
|
|
| 57 | -<#--</table>-->
|
|
| 58 | -</#list>
|
|
| 187 | + |
|
| 188 | +<h2>Résultat</h2>
|
|
| 189 | +<h3>Notes</h3>
|
|
| 190 | +<div class="information">Pour déplier un nœud, cliquez sur l'icone <span class="caretSymbol"></span> (la combinaison avec la touche <b>Maj</b> effectue l'action sur le sous-arbre constitué de ses fils).</div>
|
|
| 191 | +<div class="information">Pour replier un nœud, cliquez sur l'icone <span class="caret-down"></span> (la combinaison avec la touche <b>Maj</b> effectue l'action sur le sous-arbre constitué de ses fils).</div>
|
|
| 192 | +<div class="information">Un clic sur un identifiant le sélectionne automatiquement.</div>
|
|
| 193 | +<br/>
|
|
| 194 | +<#assign rootNode = .data_model.rootNode />
|
|
| 195 | +<ul id="result">
|
|
| 196 | + <#list rootNode.getChildren() as node>
|
|
| 197 | + <@displayNode node/>
|
|
| 198 | + <br/>
|
|
| 199 | + </#list>
|
|
| 200 | +</ul>
|
|
| 201 | + |
|
| 202 | +<script>
|
|
| 203 | + function expand(node) {
|
|
| 204 | + // console.info("will expand child " + node.id);
|
|
| 205 | + node.classList.add("caret-down");
|
|
| 206 | + node.parentElement.querySelector(".nested").classList.add("active");
|
|
| 207 | + }
|
|
| 208 | + |
|
| 209 | + function collapse(node) {
|
|
| 210 | + // console.info("will collapse child " + node.id);
|
|
| 211 | + node.classList.remove("caret-down");
|
|
| 212 | + node.parentElement.querySelector(".nested").classList.remove("active");
|
|
| 213 | + }
|
|
| 214 | + |
|
| 215 | + function toggle(expanded, node) {
|
|
| 216 | + if (expanded) {
|
|
| 217 | + collapse(node);
|
|
| 218 | + } else {
|
|
| 219 | + expand(node);
|
|
| 220 | + }
|
|
| 221 | + }
|
|
| 222 | + |
|
| 223 | + for (const caret of document.getElementsByClassName("caret")) {
|
|
| 224 | + caret.addEventListener("click", function (event) {
|
|
| 225 | + let expanded = this.classList.contains("caret-down");
|
|
| 226 | + // console.info("do click on " + this.id+", was expanded? "+expanded);
|
|
| 227 | + toggle(expanded, this);
|
|
| 228 | + |
|
| 229 | + if (event.shiftKey) {
|
|
| 230 | + // console.info("SHIFT on " + this.id+" was expanded? "+expanded);
|
|
| 231 | + for (const child of this.parentElement.querySelector(".nested").getElementsByClassName("caret")) {
|
|
| 232 | + toggle(expanded, child);
|
|
| 233 | + }
|
|
| 234 | + }
|
|
| 235 | + });
|
|
| 236 | + <#if .data_model.modelMode.name() == "REFERENTIEL">
|
|
| 237 | + caret.click();
|
|
| 238 | + </#if>
|
|
| 239 | + }
|
|
| 240 | + for (const caret of document.getElementsByClassName("leaf")) {
|
|
| 241 | + let element = caret.parentElement.querySelector(".nested");
|
|
| 242 | + if (element != null) {
|
|
| 243 | + element.classList.toggle("active");
|
|
| 244 | + }
|
|
| 245 | + }
|
|
| 246 | +</script>
|
|
| 59 | 247 | </body>
|
| 60 | 248 | </html> |