Skip to content

Commit

Permalink
Merge pull request #614 from paulwarren-wk/calculation-validation
Browse files Browse the repository at this point in the history
Calculation 1.1 support and calculation validation
  • Loading branch information
austinmatherne-wk authored Jan 20, 2024
2 parents bb2c942 + 21b35f3 commit 92a6f07
Show file tree
Hide file tree
Showing 36 changed files with 1,945 additions and 205 deletions.
3 changes: 2 additions & 1 deletion iXBRLViewerPlugin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def generateViewer(
zipViewerOutput: bool = False,
features: list[str] | None = None,
packageDownloadURL: str | None = None,
copyScript = True
) -> None:
"""
Generate and save a viewer at the given destination (file, directory, or in-memory file) with the given viewer URL.
Expand Down Expand Up @@ -137,7 +138,7 @@ def generateViewer(
else:
viewerAbsolutePath = getAbsoluteViewerPath(saveViewerDest, viewerURL)

if os.path.isfile(viewerAbsolutePath):
if copyScript and os.path.isfile(viewerAbsolutePath):
# The script was found on the local file system and will be copied into the
# destination directory, so the local path (just the basename) of viewerURL should
# be passed to the script tag
Expand Down
27 changes: 27 additions & 0 deletions iXBRLViewerPlugin/viewer/src/html/inspector.html
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,33 @@ <h2 data-i18n="inspector.validationResults">Validation results</h2>
</div>
</div>
</div>
<div class="dialog calculation-inspector">
<div class="close"></div>
<div class="contents">
<h2 data-i18n="inspector.calculationDetails">Calculation details</h2>
<table class="calculation-trace">
<thead>
<tr>
<th class="weight"></th>
<th class="line-item" data-i18n="calculation.concept">Concept</th>
<th class="value-column" data-i18n="calculation.reported-value">Reported Value</th>
<th class="icons"></th>
<th class="value-column calc11-only" data-i18n="calculation.mininum">Minimum</th>
<th class="value-column calc11-only" data-i18n="calculation.maximum">Maximum</th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot>
<tr>
<td colspan="6" class="status"><span class="icon"></span> <span class="message"></span></td>
</tr>
</tfoot>
</table>
<div class="buttons">
</div>
</div>
</div>
<div class="dialog text-block-viewer">
<div class="close"></div>
<div class="contents">
Expand Down
19 changes: 18 additions & 1 deletion iXBRLViewerPlugin/viewer/src/i18n/en/translation.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
{
"calculation": {
"calculated-total": "Calculated",
"calculations11": "Calculations v1.1",
"concept": "Concept",
"consistent-duplicate-facts-present": "{{nfacts}} consistent duplicate facts present",
"inconsistent-duplicate-facts-present": "{{nfacts}} inconsistent duplicate facts present",
"maximum": "Maximum",
"mininum": "Minimum",
"reported-total": "Reported",
"reported-value": "Reported value"
},
"common": {
"accuracyInfinite": "Infinite precision",
"none": "None",
Expand All @@ -8,6 +19,9 @@
},
"factDetails": {
"accuracy": "Accuracy",
"calculationIsConsistent": "Calculation is consistent",
"calculationIsInconsistent": "Calculation is inconsistent",
"calculationUnchecked": "Calculation not checked due to presence of duplicate facts",
"change": "Change",
"changeFromIn": "From {{from}} in ",
"changePercentageDecrease": "{{decrease}}% decrease on ",
Expand All @@ -18,17 +32,20 @@
"duplicatesCount": "{{current}} of {{total}}",
"entity": "Entity",
"factValue": "Fact Value",
"nonNumericFact": "non-numeric fact",
"noPriorFactInThisReport": "No prior fact in this report",
"noUnit": "<NOUNIT>",
"properties": "Properties",
"scale": "Scale"
"scale": "Scale",
"viewCalculationDetails": "View calculation details"
},
"footnotes": {
"footnote": "Footnote"
},
"inspector": {
"anchoring": "Anchoring",
"associatedFacts": "Associated facts",
"calculationDetails": "",
"calculations": "Calculations",
"concealedFact": "Concealed fact",
"conceptType": "Concept Type",
Expand Down
19 changes: 18 additions & 1 deletion iXBRLViewerPlugin/viewer/src/i18n/es/translation.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
{
"calculation": {
"calculated-total": "",
"calculations11": "",
"concept": "",
"consistent-duplicate-facts-present": "",
"inconsistent-duplicate-facts-present": "",
"maximum": "",
"mininum": "",
"reported-total": "",
"reported-value": ""
},
"common": {
"accuracyInfinite": "Precisió infinita",
"none": "Ninguno",
Expand All @@ -8,6 +19,9 @@
},
"factDetails": {
"accuracy": "Precisión",
"calculationIsConsistent": "",
"calculationIsInconsistent": "",
"calculationUnchecked": "",
"change": "Cambio",
"changeFromIn": "Anteriormente {{from}} en ",
"changePercentageDecrease": "{{decrease}}% menos que en ",
Expand All @@ -18,17 +32,20 @@
"duplicatesCount": "{{current}} de {{total}}",
"entity": "Entidad",
"factValue": "Valor del hecho",
"nonNumericFact": "",
"noPriorFactInThisReport": "No hay un hecho previo",
"noUnit": "Sin unidad",
"properties": "Características",
"scale": "Escala"
"scale": "Escala",
"viewCalculationDetails": ""
},
"footnotes": {
"footnote": "Nota al pie de página"
},
"inspector": {
"anchoring": "Anclaje",
"associatedFacts": "Hechos asociados",
"calculationDetails": "",
"calculations": "Cálculos",
"concealedFact": "",
"conceptType": "Tipo de concepto",
Expand Down
13 changes: 13 additions & 0 deletions iXBRLViewerPlugin/viewer/src/icons/calculator.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions iXBRLViewerPlugin/viewer/src/icons/circle-cross.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions iXBRLViewerPlugin/viewer/src/icons/circle-tick.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 1 addition & 5 deletions iXBRLViewerPlugin/viewer/src/icons/dimension.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 2 additions & 5 deletions iXBRLViewerPlugin/viewer/src/icons/member.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions iXBRLViewerPlugin/viewer/src/icons/multi-tag.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions iXBRLViewerPlugin/viewer/src/js/accordian.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class Accordian {
}
})
)
.append($('<div class="body"></div>').append(body))
.append($('<div class="card-body"></div>').append(body))
.appendTo(this._contents);

if (data !== null) {
Expand All @@ -48,7 +48,7 @@ export class Accordian {
this._contents.find(".card").first().addClass("active");
}
if (this.options.dissolveSingle && this._contents.children().length == 1) {
return this._contents.children().first().find(".body");
return this._contents.children().first().find(".card-body");
}
return this._contents;
}
Expand Down
Loading

0 comments on commit 92a6f07

Please sign in to comment.