Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
d8b081ff
by Tony Chemit at 2023-12-01T15:35:26+01:00
-
a88911d9
by Tony Chemit at 2023-12-01T15:54:38+01:00
-
44de672d
by Tony Chemit at 2023-12-01T15:54:38+01:00
-
3f0ecbae
by Tony Chemit at 2023-12-01T15:55:24+01:00
-
bbeeac87
by Tony Chemit at 2023-12-01T16:06:32+01:00
-
7e08d2ef
by Tony Chemit at 2023-12-01T16:08:17+01:00
19 changed files:
- client/configuration/src/main/config/Client.ini
- client/configuration/src/main/i18n/getters/config.getter
- client/core/src/main/java/fr/ird/observe/client/main/body/ClientConfigUI.java
- client/datasource/actions/src/main/i18n/templates/reportHtmlExport_en_GB.ftl
- client/datasource/actions/src/main/i18n/templates/reportHtmlExport_es_ES.ftl
- client/datasource/actions/src/main/i18n/templates/reportHtmlExport_fr_FR.ftl
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/consolidate/ConsolidateModel.java
- client/datasource/actions/src/main/java/fr/ird/observe/client/datasource/actions/consolidate/actions/Start.java
- client/runner/src/main/i18n/translations/client-runner_en_GB.properties
- client/runner/src/main/i18n/translations/client-runner_es_ES.properties
- client/runner/src/main/i18n/translations/client-runner_fr_FR.properties
- core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ReportService-psLogbookWellPlanCheck.properties
- toolkit/api-report/src/main/java/fr/ird/observe/report/ColumnRendererConsumer.java
- toolkit/api-report/src/main/java/fr/ird/observe/report/operations/SubtractColum.java
- toolkit/api-report/src/main/java/fr/ird/observe/report/renderers/HighlightIfAbsoluteDeltaIsPositive.java
- toolkit/api-report/src/main/java/fr/ird/observe/report/renderers/HighlightIfNumericalValueIsPositive.java
- toolkit/api-report/src/main/resources/fr/ird/observe/report/renderers/HighlightIfAbsoluteDeltaIsPositive.js
- toolkit/api-report/src/main/resources/fr/ird/observe/report/renderers/HighlightIfNotI18nReferentialValue.js
- toolkit/api-report/src/main/resources/fr/ird/observe/report/renderers/HighlightIfNumericalValueIsPositive.js
Changes:
| ... | ... | @@ -1047,6 +1047,12 @@ key = ui.tree.config.node.unsaved.color |
| 1047 | 1047 | type = color
|
| 1048 | 1048 | defaultValue = java.awt.Color[r=255,g=0,b=0]
|
| 1049 | 1049 | |
| 1050 | +[option skipConsolidateStepForReport]
|
|
| 1051 | +description = observe.config.ui.actions.report.skipConsolidateStep
|
|
| 1052 | +key = ui.actions.report.skipConsolidateStep
|
|
| 1053 | +type = Boolean
|
|
| 1054 | +defaultValue = false
|
|
| 1055 | + |
|
| 1050 | 1056 | [action adminUi]
|
| 1051 | 1057 | description = observe.ui.action.commandline.launch.admin.ui
|
| 1052 | 1058 | action = fr.ird.observe.client.ObserveCLAction#launchAdminUI
|
| ... | ... | @@ -121,6 +121,7 @@ observe.config.swingPreferencesFile.description |
| 121 | 121 | observe.config.swingSessionFile.description
|
| 122 | 122 | observe.config.temperature.format
|
| 123 | 123 | observe.config.temporaryDirectory.description
|
| 124 | +observe.config.ui.actions.report.skipConsolidateStep
|
|
| 124 | 125 | observe.config.ui.autoPopupNumberEditor
|
| 125 | 126 | observe.config.ui.autoSelectText
|
| 126 | 127 | observe.config.ui.blockStateColor
|
| ... | ... | @@ -408,6 +408,7 @@ public class ClientConfigUI extends JXTitledPanel implements WithClientUIContext |
| 408 | 408 | |
| 409 | 409 | helper.addOption(ClientConfigOption.SHOW_SQL);
|
| 410 | 410 | helper.addOption(ClientConfigOption.USE_JVM_KEY_STORE);
|
| 411 | + helper.addOption(ClientConfigOption.SKIP_CONSOLIDATE_STEP_FOR_REPORT);
|
|
| 411 | 412 | |
| 412 | 413 | }
|
| 413 | 414 |
| ... | ... | @@ -40,6 +40,7 @@ |
| 40 | 40 | margin-right: 10px;
|
| 41 | 41 | }
|
| 42 | 42 | |
| 43 | + <#--noinspection CssUnusedSymbol-->
|
|
| 43 | 44 | td.gridjs-td {
|
| 44 | 45 | background-color: transparent;
|
| 45 | 46 | }
|
| ... | ... | @@ -61,28 +62,44 @@ |
| 61 | 62 | color: #fff;
|
| 62 | 63 | }
|
| 63 | 64 | |
| 65 | + tr:hover td[class~="cellNull"] {
|
|
| 66 | + background-color: rgb(160, 160, 160);
|
|
| 67 | + }
|
|
| 68 | + |
|
| 69 | + tr:hover td[class~="cellWarning"] {
|
|
| 70 | + background-color: rgb(255, 175, 10);
|
|
| 71 | + }
|
|
| 72 | + |
|
| 73 | + tr:hover td[class~="cellError"] {
|
|
| 74 | + background-color: rgb(255, 10, 10);
|
|
| 75 | + }
|
|
| 76 | + |
|
| 77 | + <#--noinspection CssUnusedSymbol-->
|
|
| 78 | + td.cellNull {
|
|
| 79 | + background-color: rgb(128, 128, 128);
|
|
| 80 | + }
|
|
| 64 | 81 | |
| 65 | 82 | <#--noinspection CssUnusedSymbol-->
|
| 66 | - .cellWarning {
|
|
| 67 | - background-color: orange;
|
|
| 83 | + td.cellWarning {
|
|
| 84 | + background-color: rgb(255, 165, 0);
|
|
| 68 | 85 | }
|
| 69 | 86 | |
| 70 | - <#-- <#–noinspection CssUnusedSymbol–>-->
|
|
| 71 | - <#-- td:has(span.cellWarning):before {-->
|
|
| 72 | - <#-- padding-right: 8px;-->
|
|
| 73 | - <#-- content: "\26A0";-->
|
|
| 74 | - <#-- }-->
|
|
| 87 | +<#-- <#–noinspection CssUnusedSymbol–>-->
|
|
| 88 | +<#-- td:has(span.cellWarning):before {-->
|
|
| 89 | +<#-- padding-right: 8px;-->
|
|
| 90 | +<#-- content: "\26A0";-->
|
|
| 91 | +<#-- }-->
|
|
| 75 | 92 | |
| 76 | 93 | <#--noinspection CssUnusedSymbol-->
|
| 77 | - .cellError {
|
|
| 78 | - background-color: red;
|
|
| 94 | + td.cellError {
|
|
| 95 | + background-color: rgb(255, 0, 0);
|
|
| 79 | 96 | }
|
| 80 | 97 | |
| 81 | - <#-- <#–noinspection CssUnusedSymbol–>-->
|
|
| 82 | - <#-- td:has(span.cellError):before {-->
|
|
| 83 | - <#-- padding-right: 8px;-->
|
|
| 84 | - <#-- content: "\26D4";-->
|
|
| 85 | - <#-- }-->
|
|
| 98 | +<#-- <#–noinspection CssUnusedSymbol–>-->
|
|
| 99 | +<#-- td:has(span.cellError):before {-->
|
|
| 100 | +<#-- padding-right: 8px;-->
|
|
| 101 | +<#-- content: "\26D4";-->
|
|
| 102 | +<#-- }-->
|
|
| 86 | 103 | |
| 87 | 104 | .widget {
|
| 88 | 105 | position: relative;
|
| ... | ... | @@ -257,7 +274,7 @@ |
| 257 | 274 | }
|
| 258 | 275 | |
| 259 | 276 | <#list .data_model.columnRendererFunctions as key>
|
| 260 | - ${key}</#list>
|
|
| 277 | +${key}</#list>
|
|
| 261 | 278 | |
| 262 | 279 | function createColumns(json) {
|
| 263 | 280 | let result = !!json["columnNames"] ? json["columnNames"] : [];
|
| ... | ... | @@ -266,6 +283,7 @@ |
| 266 | 283 | }
|
| 267 | 284 | let renderers = json["columnRendererDefinitions"];
|
| 268 | 285 | let i = 0;
|
| 286 | + let data = json.data;
|
|
| 269 | 287 | <#list .data_model.columnRendererInitCode as value>
|
| 270 | 288 | ${value}</#list>
|
| 271 | 289 | return result;
|
| ... | ... | @@ -323,7 +341,7 @@ |
| 323 | 341 | </div>
|
| 324 | 342 | </div>
|
| 325 | 343 | <ul class="widget-tabs">
|
| 326 | - <li class="widget-tab"><a href="#tab-configuration" class="widget-tab-link">Configuration</a>
|
|
| 344 | + <li class="widget-tab"><a href="#tab-configuration" class="widget-tab-link">Metadata</a>
|
|
| 327 | 345 | <li class="widget-tab"><a href="#tab-result" class="widget-tab-link">Result</a>
|
| 328 | 346 | </ul>
|
| 329 | 347 | </div>
|
| ... | ... | @@ -40,6 +40,7 @@ |
| 40 | 40 | margin-right: 10px;
|
| 41 | 41 | }
|
| 42 | 42 | |
| 43 | + <#--noinspection CssUnusedSymbol-->
|
|
| 43 | 44 | td.gridjs-td {
|
| 44 | 45 | background-color: transparent;
|
| 45 | 46 | }
|
| ... | ... | @@ -61,28 +62,44 @@ |
| 61 | 62 | color: #fff;
|
| 62 | 63 | }
|
| 63 | 64 | |
| 65 | + tr:hover td[class~="cellNull"] {
|
|
| 66 | + background-color: rgb(160, 160, 160);
|
|
| 67 | + }
|
|
| 68 | + |
|
| 69 | + tr:hover td[class~="cellWarning"] {
|
|
| 70 | + background-color: rgb(255, 175, 10);
|
|
| 71 | + }
|
|
| 72 | + |
|
| 73 | + tr:hover td[class~="cellError"] {
|
|
| 74 | + background-color: rgb(255, 10, 10);
|
|
| 75 | + }
|
|
| 64 | 76 | |
| 65 | 77 | <#--noinspection CssUnusedSymbol-->
|
| 66 | - .cellWarning {
|
|
| 67 | - background-color: orange;
|
|
| 78 | + td.cellNull {
|
|
| 79 | + background-color: rgb(128, 128, 128);
|
|
| 68 | 80 | }
|
| 69 | 81 | |
| 70 | - <#-- <#–noinspection CssUnusedSymbol–>-->
|
|
| 71 | - <#-- td:has(span.cellWarning):before {-->
|
|
| 72 | - <#-- padding-right: 8px;-->
|
|
| 73 | - <#-- content: "\26A0";-->
|
|
| 74 | - <#-- }-->
|
|
| 82 | + <#--noinspection CssUnusedSymbol-->
|
|
| 83 | + td.cellWarning {
|
|
| 84 | + background-color: rgb(255, 165, 0);
|
|
| 85 | + }
|
|
| 86 | + |
|
| 87 | +<#-- <#–noinspection CssUnusedSymbol–>-->
|
|
| 88 | +<#-- td:has(span.cellWarning):before {-->
|
|
| 89 | +<#-- padding-right: 8px;-->
|
|
| 90 | +<#-- content: "\26A0";-->
|
|
| 91 | +<#-- }-->
|
|
| 75 | 92 | |
| 76 | 93 | <#--noinspection CssUnusedSymbol-->
|
| 77 | - .cellError {
|
|
| 78 | - background-color: red;
|
|
| 94 | + td.cellError {
|
|
| 95 | + background-color: rgb(255, 0, 0);
|
|
| 79 | 96 | }
|
| 80 | 97 | |
| 81 | - <#-- <#–noinspection CssUnusedSymbol–>-->
|
|
| 82 | - <#-- td:has(span.cellError):before {-->
|
|
| 83 | - <#-- padding-right: 8px;-->
|
|
| 84 | - <#-- content: "\26D4";-->
|
|
| 85 | - <#-- }-->
|
|
| 98 | +<#-- <#–noinspection CssUnusedSymbol–>-->
|
|
| 99 | +<#-- td:has(span.cellError):before {-->
|
|
| 100 | +<#-- padding-right: 8px;-->
|
|
| 101 | +<#-- content: "\26D4";-->
|
|
| 102 | +<#-- }-->
|
|
| 86 | 103 | |
| 87 | 104 | .widget {
|
| 88 | 105 | position: relative;
|
| ... | ... | @@ -257,7 +274,7 @@ |
| 257 | 274 | }
|
| 258 | 275 | |
| 259 | 276 | <#list .data_model.columnRendererFunctions as key>
|
| 260 | - ${key}</#list>
|
|
| 277 | +${key}</#list>
|
|
| 261 | 278 | |
| 262 | 279 | function createColumns(json) {
|
| 263 | 280 | let result = !!json["columnNames"] ? json["columnNames"] : [];
|
| ... | ... | @@ -266,6 +283,7 @@ |
| 266 | 283 | }
|
| 267 | 284 | let renderers = json["columnRendererDefinitions"];
|
| 268 | 285 | let i = 0;
|
| 286 | + let data = json.data;
|
|
| 269 | 287 | <#list .data_model.columnRendererInitCode as value>
|
| 270 | 288 | ${value}</#list>
|
| 271 | 289 | return result;
|
| ... | ... | @@ -310,7 +328,6 @@ |
| 310 | 328 | </ul>
|
| 311 | 329 | </div>
|
| 312 | 330 | <div class="widget-list" id="tab-result">
|
| 313 | - |
|
| 314 | 331 | <div class="config-panel">
|
| 315 | 332 | <label><input id="search" type="checkbox" checked/> Search</label>|
|
| 316 | 333 | <label><input id="resizable" type="checkbox" checked/> Resizable columns</label>|
|
| ... | ... | @@ -323,10 +340,11 @@ |
| 323 | 340 | </div>
|
| 324 | 341 | </div>
|
| 325 | 342 | <ul class="widget-tabs">
|
| 326 | - <li class="widget-tab"><a href="#tab-configuration" class="widget-tab-link">Configuration</a>
|
|
| 343 | + <li class="widget-tab"><a href="#tab-configuration" class="widget-tab-link">Metadata</a>
|
|
| 327 | 344 | <li class="widget-tab"><a href="#tab-result" class="widget-tab-link">Result</a>
|
| 328 | 345 | </ul>
|
| 329 | 346 | </div>
|
| 347 | + |
|
| 330 | 348 | <script type="application/javascript">
|
| 331 | 349 | const json = ${.data_model.json};
|
| 332 | 350 |
| ... | ... | @@ -63,9 +63,26 @@ |
| 63 | 63 | color: #fff;
|
| 64 | 64 | }
|
| 65 | 65 | |
| 66 | + tr:hover td[class~="cellNull"] {
|
|
| 67 | + background-color: rgb(160, 160, 160);
|
|
| 68 | + }
|
|
| 69 | + |
|
| 70 | + tr:hover td[class~="cellWarning"] {
|
|
| 71 | + background-color: rgb(255, 175, 10);
|
|
| 72 | + }
|
|
| 73 | + |
|
| 74 | + tr:hover td[class~="cellError"] {
|
|
| 75 | + background-color: rgb(255, 10, 10);
|
|
| 76 | + }
|
|
| 77 | + |
|
| 78 | + <#--noinspection CssUnusedSymbol-->
|
|
| 79 | + td.cellNull {
|
|
| 80 | + background-color: rgb(128, 128, 128);
|
|
| 81 | + }
|
|
| 82 | + |
|
| 66 | 83 | <#--noinspection CssUnusedSymbol-->
|
| 67 | - .cellWarning {
|
|
| 68 | - background-color: orange;
|
|
| 84 | + td.cellWarning {
|
|
| 85 | + background-color: rgb(255, 165, 0);
|
|
| 69 | 86 | }
|
| 70 | 87 | |
| 71 | 88 | <#-- <#–noinspection CssUnusedSymbol–>-->
|
| ... | ... | @@ -75,8 +92,8 @@ |
| 75 | 92 | <#-- }-->
|
| 76 | 93 | |
| 77 | 94 | <#--noinspection CssUnusedSymbol-->
|
| 78 | - .cellError {
|
|
| 79 | - background-color: red;
|
|
| 95 | + td.cellError {
|
|
| 96 | + background-color: rgb(255, 0, 0);
|
|
| 80 | 97 | }
|
| 81 | 98 | |
| 82 | 99 | <#-- <#–noinspection CssUnusedSymbol–>-->
|
| ... | ... | @@ -267,6 +284,7 @@ ${key}</#list> |
| 267 | 284 | }
|
| 268 | 285 | let renderers = json["columnRendererDefinitions"];
|
| 269 | 286 | let i = 0;
|
| 287 | + let data = json.data;
|
|
| 270 | 288 | <#list .data_model.columnRendererInitCode as value>
|
| 271 | 289 | ${value}</#list>
|
| 272 | 290 | return result;
|
| ... | ... | @@ -323,7 +341,7 @@ ${key}</#list> |
| 323 | 341 | </div>
|
| 324 | 342 | </div>
|
| 325 | 343 | <ul class="widget-tabs">
|
| 326 | - <li class="widget-tab"><a href="#tab-configuration" class="widget-tab-link">Configuration</a>
|
|
| 344 | + <li class="widget-tab"><a href="#tab-configuration" class="widget-tab-link">Méta-données</a>
|
|
| 327 | 345 | <li class="widget-tab"><a href="#tab-result" class="widget-tab-link">Résultat</a>
|
| 328 | 346 | </ul>
|
| 329 | 347 | </div>
|
| ... | ... | @@ -53,6 +53,7 @@ public class ConsolidateModel extends AdminActionModel { |
| 53 | 53 | |
| 54 | 54 | private boolean consolidationFailIfLengthWeightParameterNotFound;
|
| 55 | 55 | private boolean consolidationFailIfLengthLengthParameterNotFound;
|
| 56 | + private boolean skipForReport;
|
|
| 56 | 57 | |
| 57 | 58 | public ConsolidateModel() {
|
| 58 | 59 | super(AdminStep.CONSOLIDATE);
|
| ... | ... | @@ -87,6 +88,7 @@ public class ConsolidateModel extends AdminActionModel { |
| 87 | 88 | |
| 88 | 89 | setConsolidationFailIfLengthWeightParameterNotFound(getClientConfig().isConsolidationFailIfLengthWeightParameterNotFound());
|
| 89 | 90 | setConsolidationFailIfLengthLengthParameterNotFound(getClientConfig().isConsolidationFailIfLengthLengthParameterNotFound());
|
| 91 | + uiModel.getConsolidateModel().setSkipForReport(getClientConfig().isSkipConsolidateStepForReport());
|
|
| 90 | 92 | }
|
| 91 | 93 | |
| 92 | 94 | @Override
|
| ... | ... | @@ -121,4 +123,12 @@ public class ConsolidateModel extends AdminActionModel { |
| 121 | 123 | this.consolidationFailIfLengthLengthParameterNotFound = consolidationFailIfLengthLengthParameterNotFound;
|
| 122 | 124 | firePropertyChange("consolidationFailIfLengthLengthParameterNotFound", oldValue, consolidationFailIfLengthLengthParameterNotFound);
|
| 123 | 125 | }
|
| 126 | + |
|
| 127 | + public boolean isSkipForReport() {
|
|
| 128 | + return skipForReport;
|
|
| 129 | + }
|
|
| 130 | + |
|
| 131 | + public void setSkipForReport(boolean skipForReport) {
|
|
| 132 | + this.skipForReport = skipForReport;
|
|
| 133 | + }
|
|
| 124 | 134 | } |
| ... | ... | @@ -87,7 +87,9 @@ public class Start extends AdminTabUIActionSupport<ConsolidateUI> { |
| 87 | 87 | |
| 88 | 88 | ConsolidateModel stepModel = ui.getStepModel();
|
| 89 | 89 | AdminUIModel model = ui.getModel();
|
| 90 | - |
|
| 90 | + if (stepModel.isSkipForReport()) {
|
|
| 91 | + return WizardState.SUCCESSED;
|
|
| 92 | + }
|
|
| 91 | 93 | stepModel.setSource(model.getConfigModel().getLeftSourceModel().getSafeSource(false));
|
| 92 | 94 | |
| 93 | 95 | Set<String> tripIds = model.getSelectDataModel().getSelectionDataModel().getSelectedDataIds();
|
| ... | ... | @@ -138,6 +138,7 @@ observe.config.swingPreferencesFile.description=Swing preferences file. |
| 138 | 138 | observe.config.swingSessionFile.description=Swing session file.
|
| 139 | 139 | observe.config.temperature.format=Default temperature unit
|
| 140 | 140 | observe.config.temporaryDirectory.description=Default temporary directory used by application and clean at each launch.
|
| 141 | +observe.config.ui.actions.report.skipConsolidateStep=To skip consolidate step in action Report
|
|
| 141 | 142 | observe.config.ui.autoPopupNumberEditor=To auto popup on number editor when it acquires the focus
|
| 142 | 143 | observe.config.ui.autoSelectText=To auto select text in widgets when it acquires the focus
|
| 143 | 144 | observe.config.ui.blockStateColor=Color of block state
|
| ... | ... | @@ -138,6 +138,7 @@ observe.config.swingPreferencesFile.description=Swing preferences file. |
| 138 | 138 | observe.config.swingSessionFile.description=Copia de seguridad del estado del UI.
|
| 139 | 139 | observe.config.temperature.format=Unidad de temperatura
|
| 140 | 140 | observe.config.temporaryDirectory.description=Directorio temporal por defecto
|
| 141 | +observe.config.ui.actions.report.skipConsolidateStep=To skip consolidate step in action Report \#TODO
|
|
| 141 | 142 | observe.config.ui.autoPopupNumberEditor=Para mostrar automáticamente el editor numérico durante la edición de un número
|
| 142 | 143 | observe.config.ui.autoSelectText=To auto select text in widgets when it acquires the focus \#TODO
|
| 143 | 144 | observe.config.ui.blockStateColor=Color of block state \#TODO
|
| ... | ... | @@ -138,6 +138,7 @@ observe.config.swingPreferencesFile.description=Fichier de sauvegarde des préf |
| 138 | 138 | observe.config.swingSessionFile.description=Fichier de sauvegarde des états des UI.
|
| 139 | 139 | observe.config.temperature.format=Unité de température
|
| 140 | 140 | observe.config.temporaryDirectory.description=Le répertoire temporaire par défaut
|
| 141 | +observe.config.ui.actions.report.skipConsolidateStep=Pour ne pas exécuter l'étape de consolidation dans l'assistant des rapports
|
|
| 141 | 142 | observe.config.ui.autoPopupNumberEditor=Pour afficher automatiquement l'éditeur numérique lors de l'édition d'un nombre
|
| 142 | 143 | observe.config.ui.autoSelectText=Pour sélectionner le texte sur les éditeurs lorsqu'il acquière le focus
|
| 143 | 144 | observe.config.ui.blockStateColor=Couleur lorsque l'on bloque une partie de l'application
|
| ... | ... | @@ -29,6 +29,6 @@ syntax.nbRequests=5 |
| 29 | 29 | result.columns=20
|
| 30 | 30 | result.rows=4
|
| 31 | 31 | result.0=483^CAP BOJADOR^30/03/2019^08/04/2019^30/03/2019^1^15:12^0.0^123.0^43.0^0.0^0.0^0.0^0.0^12.0^0.0^0.0^166.0^12.0^154.0
|
| 32 | -result.1=483^CAP BOJADOR^30/03/2019^08/04/2019^01/04/2019^1^15:12^null^null^null^null^null^null^null^null^null^null^null^null^-
|
|
| 33 | -result.2=483^CAP BOJADOR^30/03/2019^08/04/2019^01/04/2019^1^15:12^null^null^null^null^null^null^null^null^null^null^null^null^-
|
|
| 34 | -result.3=Total^null^null^null^null^null^-^0.0^123.0^43.0^0.0^0.0^0.0^0.0^12.0^0.0^0.0^166.0^12.0^- |
|
| \ No newline at end of file | ||
| 32 | +result.1=483^CAP BOJADOR^30/03/2019^08/04/2019^01/04/2019^1^15:12^null^null^null^null^null^null^null^null^null^null^null^null^null
|
|
| 33 | +result.2=483^CAP BOJADOR^30/03/2019^08/04/2019^01/04/2019^1^15:12^null^null^null^null^null^null^null^null^null^null^null^null^null
|
|
| 34 | +result.3=Total^null^null^null^null^null^-^0.0^123.0^43.0^0.0^0.0^0.0^0.0^12.0^0.0^0.0^166.0^12.0^154.0 |
|
| \ No newline at end of file |
| ... | ... | @@ -44,9 +44,12 @@ import java.util.Objects; |
| 44 | 44 | */
|
| 45 | 45 | public interface ColumnRendererConsumer<P extends ColumnRendererParameters> {
|
| 46 | 46 | |
| 47 | - static void addHighLighters(JXTable table, HighlightPredicate warningDPredicate, HighlightPredicate errorPredicate) {
|
|
| 47 | + static void addHighLighters(JXTable table, HighlightPredicate nullPredicate, HighlightPredicate warningPredicate, HighlightPredicate errorPredicate) {
|
|
| 48 | + if (nullPredicate != null) {
|
|
| 49 | + table.addHighlighter(new ColorHighlighter(nullPredicate, Color.GRAY, Color.BLACK));
|
|
| 50 | + }
|
|
| 48 | 51 | table.addHighlighter(new ColorHighlighter(errorPredicate, Color.RED, Color.BLACK));
|
| 49 | - table.addHighlighter(new ColorHighlighter(warningDPredicate, Color.ORANGE, Color.BLACK));
|
|
| 52 | + table.addHighlighter(new ColorHighlighter(warningPredicate, Color.ORANGE, Color.BLACK));
|
|
| 50 | 53 | }
|
| 51 | 54 | |
| 52 | 55 | static SingletonSupplier<String> htmlFunctions(Class<?> type) {
|
| ... | ... | @@ -94,6 +97,6 @@ public interface ColumnRendererConsumer<P extends ColumnRendererParameters> { |
| 94 | 97 | String htmlFunctions();
|
| 95 | 98 | |
| 96 | 99 | default String htmlInitCode() {
|
| 97 | - return String.format("init%s(renderers[i++], result);\n", getClass().getSimpleName());
|
|
| 100 | + return String.format("init%s(renderers[i++], result, data);\n", getClass().getSimpleName());
|
|
| 98 | 101 | }
|
| 99 | 102 | } |
| ... | ... | @@ -73,22 +73,27 @@ public class SubtractColum implements ReportOperationConsumer { |
| 73 | 73 | |
| 74 | 74 | Double v1 = getValue(row, column1, incoming);
|
| 75 | 75 | Double v2 = getValue(row, column2, incoming);
|
| 76 | - if (v1 == null || v2 == null) {
|
|
| 77 | - return "-";
|
|
| 76 | + if (v1 == null && v2 == null) {
|
|
| 77 | + return null;
|
|
| 78 | + }
|
|
| 79 | + if (v1 == null) {
|
|
| 80 | + v1 = 0d;
|
|
| 81 | + }
|
|
| 82 | + if (v2 == null) {
|
|
| 83 | + v2 = 0d;
|
|
| 78 | 84 | }
|
| 79 | 85 | float result = (float) (v1 - v2);
|
| 80 | 86 | return Numbers.roundFourDigits(result);
|
| 81 | 87 | }
|
| 82 | 88 | |
| 83 | - protected Double getValue(int x, int y, DataMatrix incoming) {
|
|
| 84 | - Serializable o = incoming.getValue(y, x);
|
|
| 89 | + protected Double getValue(int row, int column, DataMatrix incoming) {
|
|
| 90 | + Serializable o = incoming.getValue(column, row);
|
|
| 85 | 91 | if (o == null || "null".equals(o)) {
|
| 86 | 92 | return null;
|
| 87 | 93 | }
|
| 88 | 94 | try {
|
| 89 | 95 | return Double.parseDouble(o.toString());
|
| 90 | 96 | } catch (NumberFormatException e) {
|
| 91 | - // une des données de la colonne n'est pas un count on sort directement
|
|
| 92 | 97 | log.debug(String.format("Could not convert %s to number", o), e);
|
| 93 | 98 | return null;
|
| 94 | 99 | }
|
| ... | ... | @@ -78,6 +78,7 @@ public class HighlightIfAbsoluteDeltaIsPositive implements ColumnRendererConsume |
| 78 | 78 | @Override
|
| 79 | 79 | public void consumeSwing(Parameters parameters, JXTable table) {
|
| 80 | 80 | ColumnRendererConsumer.addHighLighters(table,
|
| 81 | + new ParametersHighlightPredicate(parameters, null),
|
|
| 81 | 82 | new ParametersHighlightPredicate(parameters, true),
|
| 82 | 83 | new ParametersHighlightPredicate(parameters, false));
|
| 83 | 84 | }
|
| ... | ... | @@ -124,9 +125,9 @@ public class HighlightIfAbsoluteDeltaIsPositive implements ColumnRendererConsume |
| 124 | 125 | |
| 125 | 126 | static class ParametersHighlightPredicate implements HighlightPredicate {
|
| 126 | 127 | private final Parameters parameters;
|
| 127 | - private final boolean warning;
|
|
| 128 | + private final Boolean warning;
|
|
| 128 | 129 | |
| 129 | - ParametersHighlightPredicate(Parameters parameters, boolean warning) {
|
|
| 130 | + ParametersHighlightPredicate(Parameters parameters, Boolean warning) {
|
|
| 130 | 131 | this.parameters = parameters;
|
| 131 | 132 | this.warning = warning;
|
| 132 | 133 | }
|
| ... | ... | @@ -137,13 +138,16 @@ public class HighlightIfAbsoluteDeltaIsPositive implements ColumnRendererConsume |
| 137 | 138 | if (column != parameters.getColumn1() && column != parameters.getColumn2()) {
|
| 138 | 139 | return false;
|
| 139 | 140 | }
|
| 140 | - Object value1 = adapter.getValue(parameters.getColumn1());
|
|
| 141 | + Object value1 = adapter.getValue();
|
|
| 141 | 142 | if (value1 == null || value1.toString().equals("-")) {
|
| 143 | + return warning == null;
|
|
| 144 | + }
|
|
| 145 | + if (warning == null) {
|
|
| 142 | 146 | return false;
|
| 143 | 147 | }
|
| 144 | - Object value2 = adapter.getValue(parameters.getColumn2());
|
|
| 148 | + Object value2 = adapter.getValue(column == parameters.getColumn1() ? parameters.getColumn2() : parameters.getColumn1());
|
|
| 145 | 149 | if (value2 == null || value2.toString().equals("-")) {
|
| 146 | - return false;
|
|
| 150 | + return !warning;
|
|
| 147 | 151 | }
|
| 148 | 152 | Double d1 = Double.valueOf(value1.toString());
|
| 149 | 153 | Double d2 = Double.valueOf(value2.toString());
|
| ... | ... | @@ -76,6 +76,7 @@ public class HighlightIfNumericalValueIsPositive implements ColumnRendererConsum |
| 76 | 76 | @Override
|
| 77 | 77 | public void consumeSwing(Parameters parameters, JXTable table) {
|
| 78 | 78 | ColumnRendererConsumer.addHighLighters(table,
|
| 79 | + new ParametersHighlightPredicate(parameters, null),
|
|
| 79 | 80 | new ParametersHighlightPredicate(parameters, true),
|
| 80 | 81 | new ParametersHighlightPredicate(parameters, false));
|
| 81 | 82 | }
|
| ... | ... | @@ -117,9 +118,9 @@ public class HighlightIfNumericalValueIsPositive implements ColumnRendererConsum |
| 117 | 118 | |
| 118 | 119 | static class ParametersHighlightPredicate implements HighlightPredicate {
|
| 119 | 120 | private final Parameters parameters;
|
| 120 | - private final boolean warning;
|
|
| 121 | + private final Boolean warning;
|
|
| 121 | 122 | |
| 122 | - ParametersHighlightPredicate(Parameters parameters, boolean warning) {
|
|
| 123 | + ParametersHighlightPredicate(Parameters parameters, Boolean warning) {
|
|
| 123 | 124 | this.parameters = parameters;
|
| 124 | 125 | this.warning = warning;
|
| 125 | 126 | }
|
| ... | ... | @@ -130,8 +131,11 @@ public class HighlightIfNumericalValueIsPositive implements ColumnRendererConsum |
| 130 | 131 | if (column != parameters.getColumn()) {
|
| 131 | 132 | return false;
|
| 132 | 133 | }
|
| 133 | - Object value1 = adapter.getValue(parameters.getColumn());
|
|
| 134 | + Object value1 = adapter.getValue();
|
|
| 134 | 135 | if (value1 == null || value1.toString().equals("-")) {
|
| 136 | + return warning == null;
|
|
| 137 | + }
|
|
| 138 | + if (warning == null) {
|
|
| 135 | 139 | return false;
|
| 136 | 140 | }
|
| 137 | 141 | double d1 = Double.parseDouble(value1.toString());
|
| ... | ... | @@ -19,38 +19,67 @@ |
| 19 | 19 | * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| 20 | 20 | * #L%
|
| 21 | 21 | */
|
| 22 | -function HighlightIfAbsoluteDeltaIsPositive(row, column1, column2, warningThreshHold, errorThreshHold) {
|
|
| 23 | - let value1 = row.cells[column1].data;
|
|
| 24 | - let value2 = row.cells[column2].data;
|
|
| 25 | - if (!!!value1 || value2 === "-") {
|
|
| 26 | - return value1;
|
|
| 22 | +function HighlightIfAbsoluteDeltaIsPositive(cell, row, column2, warningThreshHold, errorThreshHold) {
|
|
| 23 | + if (!cell) {
|
|
| 24 | + return;
|
|
| 25 | + }
|
|
| 26 | + if (!!!cell || cell === "-") {
|
|
| 27 | + return {
|
|
| 28 | + 'data-cell-content': "",
|
|
| 29 | + 'class': 'gridjs-td cellNull',
|
|
| 30 | + };
|
|
| 27 | 31 | }
|
| 28 | - if (!!!value2 || value2 === "-") {
|
|
| 29 | - return value1;
|
|
| 32 | + let value2 = row.cells[column2].data;
|
|
| 33 | + if (!!!value2 || value2 === " ") {
|
|
| 34 | + return;
|
|
| 30 | 35 | }
|
| 31 | - if (value1 === value2) {
|
|
| 32 | - return value1;
|
|
| 36 | + if (cell === value2) {
|
|
| 37 | + return;
|
|
| 33 | 38 | }
|
| 34 | - let delta = Math.abs(value1 - value2);
|
|
| 39 | + let delta = Math.abs(cell - value2);
|
|
| 35 | 40 | if (delta < warningThreshHold) {
|
| 36 | - return value1;
|
|
| 41 | + return;
|
|
| 37 | 42 | }
|
| 38 | - let className = delta < errorThreshHold ? "cellWarning" : "cellError";
|
|
| 39 | - // noinspection JSUnresolvedReference
|
|
| 40 | - return gridjs.html(`<span class="${className}"\>${value1}</span>`);
|
|
| 43 | + return {
|
|
| 44 | + 'data-cell-content': cell,
|
|
| 45 | + 'class': 'gridjs-td ' + (delta < errorThreshHold ? "cellWarning" : "cellError"),
|
|
| 46 | + };
|
|
| 41 | 47 | }
|
| 42 | 48 | |
| 43 | -function initHighlightIfAbsoluteDeltaIsPositive(renderer, result) {
|
|
| 49 | +function initHighlightIfAbsoluteDeltaIsPositive(renderer, result, json) {
|
|
| 44 | 50 | let column1 = renderer["column1"];
|
| 45 | 51 | let column2 = renderer["column2"];
|
| 52 | + let height = json.height;
|
|
| 53 | + let data = json.data;
|
|
| 54 | + for (let row = 0; row < height; row++) {
|
|
| 55 | + for (let column = column1; column <= column2; column++) {
|
|
| 56 | + if (!!!data[row][column]) {
|
|
| 57 | + data[row][column] = "-";
|
|
| 58 | + }
|
|
| 59 | + }
|
|
| 60 | + }
|
|
| 46 | 61 | let warningThreshHold = renderer["warningThreshHold"];
|
| 47 | 62 | let errorThreshHold = renderer["errorThreshHold"];
|
| 48 | 63 | result[column1] = {
|
| 49 | 64 | name: result [column1],
|
| 50 | - formatter: (_, row) => HighlightIfAbsoluteDeltaIsPositive(row, column1, column2, warningThreshHold, errorThreshHold)
|
|
| 65 | + formatter: cell => {
|
|
| 66 | + if (!!!cell || cell === "-") {
|
|
| 67 | + // noinspection JSUnresolvedReference
|
|
| 68 | + return gridjs.html(" ");
|
|
| 69 | + }
|
|
| 70 | + return cell;
|
|
| 71 | + },
|
|
| 72 | + attributes: (cell, row) => HighlightIfAbsoluteDeltaIsPositive(cell, row, column2, warningThreshHold, errorThreshHold)
|
|
| 51 | 73 | };
|
| 52 | 74 | result[column2] = {
|
| 53 | 75 | name: result [column2],
|
| 54 | - formatter: (_, row) => HighlightIfAbsoluteDeltaIsPositive(row, column2, column1, warningThreshHold, errorThreshHold)
|
|
| 76 | + formatter: cell => {
|
|
| 77 | + if (!!!cell || cell === "-") {
|
|
| 78 | + // noinspection JSUnresolvedReference
|
|
| 79 | + return gridjs.html(" ");
|
|
| 80 | + }
|
|
| 81 | + return cell;
|
|
| 82 | + },
|
|
| 83 | + attributes: (cell, row) => HighlightIfAbsoluteDeltaIsPositive(cell, row, column1, warningThreshHold, errorThreshHold)
|
|
| 55 | 84 | };
|
| 56 | -} |
|
| 85 | +} |
|
| \ No newline at end of file |
| ... | ... | @@ -19,26 +19,27 @@ |
| 19 | 19 | * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| 20 | 20 | * #L%
|
| 21 | 21 | */
|
| 22 | -function HighlightIfNotI18nReferentialValue(row, column, label) {
|
|
| 23 | - let value = row.cells[column].data;
|
|
| 24 | - if (!!!value) {
|
|
| 25 | - return value;
|
|
| 22 | +function HighlightIfNotI18nReferentialValue(cell, label) {
|
|
| 23 | + if (!!!cell) {
|
|
| 24 | + return;
|
|
| 26 | 25 | }
|
| 27 | - if (value === label) {
|
|
| 28 | - return value;
|
|
| 26 | + if (cell === label) {
|
|
| 27 | + return;
|
|
| 29 | 28 | }
|
| 30 | - // noinspection JSUnresolvedReference
|
|
| 31 | - return gridjs.html(`<span class="cellError">${value}</span>`);
|
|
| 29 | + return {
|
|
| 30 | + 'data-cell-content': cell,
|
|
| 31 | + 'class': 'gridjs-td cellError',
|
|
| 32 | + };
|
|
| 32 | 33 | }
|
| 33 | 34 | |
| 34 | -function initHighlightIfNotI18nReferentialValue(renderer, result) {
|
|
| 35 | +function initHighlightIfNotI18nReferentialValue(renderer, result, json) {
|
|
| 35 | 36 | let columns = renderer["columns"];
|
| 36 | 37 | let label = renderer["label"];
|
| 37 | 38 | for (let j = 0; j < columns.length; j++) {
|
| 38 | 39 | let column = columns[j];
|
| 39 | 40 | result [column] = {
|
| 40 | 41 | name: result [column],
|
| 41 | - formatter: (_, row) => HighlightIfNotI18nReferentialValue(row, column, label)
|
|
| 42 | + attributes: cell => HighlightIfNotI18nReferentialValue(cell, label)
|
|
| 42 | 43 | };
|
| 43 | 44 | }
|
| 44 | 45 | } |
| ... | ... | @@ -19,26 +19,46 @@ |
| 19 | 19 | * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| 20 | 20 | * #L%
|
| 21 | 21 | */
|
| 22 | -function HighlightIfNumericalValueIsPositive(row, column, warningThreshHold, errorThreshHold) {
|
|
| 23 | - let value = row.cells[column].data;
|
|
| 24 | - if (!!!value || value === "-") {
|
|
| 25 | - return value;
|
|
| 22 | +function HighlightIfNumericalValueIsPositive(cell, warningThreshHold, errorThreshHold) {
|
|
| 23 | + if (!cell) {
|
|
| 24 | + return;
|
|
| 26 | 25 | }
|
| 27 | - let delta = Math.abs(value);
|
|
| 26 | + if (!!!cell || cell === "-") {
|
|
| 27 | + return {
|
|
| 28 | + 'data-cell-content': "",
|
|
| 29 | + 'class': 'gridjs-td cellNull',
|
|
| 30 | + };
|
|
| 31 | + }
|
|
| 32 | + let delta = Math.abs(cell);
|
|
| 28 | 33 | if (delta < warningThreshHold) {
|
| 29 | - return value;
|
|
| 34 | + return;
|
|
| 30 | 35 | }
|
| 31 | - let className = delta < errorThreshHold ? "cellWarning" : "cellError";
|
|
| 32 | - // noinspection JSUnresolvedReference
|
|
| 33 | - return gridjs.html(`<span class="${className}"\>${value}</span>`);
|
|
| 36 | + return {
|
|
| 37 | + 'data-cell-content': cell,
|
|
| 38 | + 'class': 'gridjs-td ' + (delta < errorThreshHold ? "cellWarning" : "cellError"),
|
|
| 39 | + };
|
|
| 34 | 40 | }
|
| 35 | 41 | |
| 36 | -function initHighlightIfNumericalValueIsPositive(renderer, result) {
|
|
| 42 | +function initHighlightIfNumericalValueIsPositive(renderer, result, json) {
|
|
| 37 | 43 | let column = renderer["column"];
|
| 44 | + let height = json.height;
|
|
| 45 | + let data = json.data;
|
|
| 46 | + for (let row = 0; row < height; row++) {
|
|
| 47 | + if (!!!data[row][column]) {
|
|
| 48 | + data[row][column] = "-";
|
|
| 49 | + }
|
|
| 50 | + }
|
|
| 38 | 51 | let warningThreshHold = renderer["warningThreshHold"];
|
| 39 | 52 | let errorThreshHold = renderer["errorThreshHold"];
|
| 40 | 53 | result[column] = {
|
| 41 | 54 | name: result [column],
|
| 42 | - formatter: (_, row) => HighlightIfNumericalValueIsPositive(row, column, warningThreshHold, errorThreshHold)
|
|
| 55 | + formatter: cell => {
|
|
| 56 | + if (!!!cell || cell === "-") {
|
|
| 57 | + // noinspection JSUnresolvedReference
|
|
| 58 | + return gridjs.html(" ");
|
|
| 59 | + }
|
|
| 60 | + return cell;
|
|
| 61 | + },
|
|
| 62 | + attributes: cell => HighlightIfNumericalValueIsPositive(cell, warningThreshHold, errorThreshHold)
|
|
| 43 | 63 | };
|
| 44 | -} |
|
| 64 | +} |
|
| \ No newline at end of file |