ixbrl-viewer 1.4.1__py3-none-any.whl → 1.4.86__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- iXBRLViewerPlugin/__init__.py +231 -127
- iXBRLViewerPlugin/_version.py +33 -3
- iXBRLViewerPlugin/constants.py +96 -2
- iXBRLViewerPlugin/featureConfig.py +8 -1
- iXBRLViewerPlugin/iXBRLViewer.py +356 -214
- iXBRLViewerPlugin/plugin.py +12 -0
- iXBRLViewerPlugin/ui.py +81 -50
- iXBRLViewerPlugin/viewer/dist/ixbrlviewer.js +1 -1
- iXBRLViewerPlugin/viewer/dist/ixbrlviewer.js.LICENSE.txt +12 -5
- iXBRLViewerPlugin/viewer/i18next-parser.config.js +1 -1
- iXBRLViewerPlugin/viewer/src/data/utr.json +1244 -0
- iXBRLViewerPlugin/viewer/src/html/fact-details.html +69 -38
- iXBRLViewerPlugin/viewer/src/html/footer-logo.html +4 -0
- iXBRLViewerPlugin/viewer/src/html/footnote-details.html +2 -2
- iXBRLViewerPlugin/viewer/src/html/inspector.html +352 -197
- iXBRLViewerPlugin/viewer/src/i18n/cy/balancetypes.json +1 -0
- iXBRLViewerPlugin/viewer/src/i18n/cy/currencies.json +13 -0
- iXBRLViewerPlugin/viewer/src/i18n/cy/datatypes.json +9 -0
- iXBRLViewerPlugin/viewer/src/i18n/cy/labelroles.json +24 -0
- iXBRLViewerPlugin/viewer/src/i18n/cy/referenceparts.json +10 -0
- iXBRLViewerPlugin/viewer/src/i18n/cy/scale.json +16 -0
- iXBRLViewerPlugin/viewer/src/i18n/cy/tooltips.json +17 -0
- iXBRLViewerPlugin/viewer/src/i18n/cy/translation.json +179 -0
- iXBRLViewerPlugin/viewer/src/i18n/da/balancetypes.json +4 -0
- iXBRLViewerPlugin/viewer/src/i18n/da/currencies.json +13 -0
- iXBRLViewerPlugin/viewer/src/i18n/da/datatypes.json +9 -0
- iXBRLViewerPlugin/viewer/src/i18n/da/labelroles.json +24 -0
- iXBRLViewerPlugin/viewer/src/i18n/da/referenceparts.json +10 -0
- iXBRLViewerPlugin/viewer/src/i18n/da/scale.json +15 -0
- iXBRLViewerPlugin/viewer/src/i18n/da/tooltips.json +17 -0
- iXBRLViewerPlugin/viewer/src/i18n/da/translation.json +179 -0
- iXBRLViewerPlugin/viewer/src/i18n/de/balancetypes.json +4 -0
- iXBRLViewerPlugin/viewer/src/i18n/de/currencies.json +13 -0
- iXBRLViewerPlugin/viewer/src/i18n/de/datatypes.json +9 -0
- iXBRLViewerPlugin/viewer/src/i18n/de/labelroles.json +24 -0
- iXBRLViewerPlugin/viewer/src/i18n/de/referenceparts.json +10 -0
- iXBRLViewerPlugin/viewer/src/i18n/de/scale.json +15 -0
- iXBRLViewerPlugin/viewer/src/i18n/de/tooltips.json +17 -0
- iXBRLViewerPlugin/viewer/src/i18n/de/translation.json +179 -0
- iXBRLViewerPlugin/viewer/src/i18n/en/balancetypes.json +4 -0
- iXBRLViewerPlugin/viewer/src/i18n/en/datatypes.json +10 -0
- iXBRLViewerPlugin/viewer/src/i18n/en/labelroles.json +4 -0
- iXBRLViewerPlugin/viewer/src/i18n/en/scale.json +16 -0
- iXBRLViewerPlugin/viewer/src/i18n/en/tooltips.json +17 -0
- iXBRLViewerPlugin/viewer/src/i18n/en/translation.json +73 -23
- iXBRLViewerPlugin/viewer/src/i18n/es/balancetypes.json +4 -0
- iXBRLViewerPlugin/viewer/src/i18n/es/datatypes.json +10 -0
- iXBRLViewerPlugin/viewer/src/i18n/es/labelroles.json +24 -0
- iXBRLViewerPlugin/viewer/src/i18n/es/scale.json +16 -0
- iXBRLViewerPlugin/viewer/src/i18n/es/tooltips.json +17 -0
- iXBRLViewerPlugin/viewer/src/i18n/es/translation.json +87 -37
- iXBRLViewerPlugin/viewer/src/i18n/fr/balancetypes.json +4 -0
- iXBRLViewerPlugin/viewer/src/i18n/fr/currencies.json +13 -0
- iXBRLViewerPlugin/viewer/src/i18n/fr/datatypes.json +9 -0
- iXBRLViewerPlugin/viewer/src/i18n/fr/labelroles.json +24 -0
- iXBRLViewerPlugin/viewer/src/i18n/fr/referenceparts.json +10 -0
- iXBRLViewerPlugin/viewer/src/i18n/fr/scale.json +15 -0
- iXBRLViewerPlugin/viewer/src/i18n/fr/tooltips.json +17 -0
- iXBRLViewerPlugin/viewer/src/i18n/fr/translation.json +179 -0
- iXBRLViewerPlugin/viewer/src/i18n/nl/balancetypes.json +4 -0
- iXBRLViewerPlugin/viewer/src/i18n/nl/currencies.json +13 -0
- iXBRLViewerPlugin/viewer/src/i18n/nl/datatypes.json +9 -0
- iXBRLViewerPlugin/viewer/src/i18n/nl/labelroles.json +24 -0
- iXBRLViewerPlugin/viewer/src/i18n/nl/referenceparts.json +10 -0
- iXBRLViewerPlugin/viewer/src/i18n/nl/scale.json +15 -0
- iXBRLViewerPlugin/viewer/src/i18n/nl/tooltips.json +17 -0
- iXBRLViewerPlugin/viewer/src/i18n/nl/translation.json +179 -0
- iXBRLViewerPlugin/viewer/src/i18n/uk/balancetypes.json +4 -0
- iXBRLViewerPlugin/viewer/src/i18n/uk/currencies.json +13 -0
- iXBRLViewerPlugin/viewer/src/i18n/uk/datatypes.json +9 -0
- iXBRLViewerPlugin/viewer/src/i18n/uk/labelroles.json +24 -0
- iXBRLViewerPlugin/viewer/src/i18n/uk/referenceparts.json +10 -0
- iXBRLViewerPlugin/viewer/src/i18n/uk/scale.json +15 -0
- iXBRLViewerPlugin/viewer/src/i18n/uk/tooltips.json +17 -0
- iXBRLViewerPlugin/viewer/src/i18n/uk/translation.json +179 -0
- iXBRLViewerPlugin/viewer/src/icons/calculator.svg +13 -0
- iXBRLViewerPlugin/viewer/src/icons/circle-cross.svg +11 -0
- iXBRLViewerPlugin/viewer/src/icons/circle-tick.svg +11 -0
- iXBRLViewerPlugin/viewer/src/icons/dark-mode.svg +4 -0
- iXBRLViewerPlugin/viewer/src/icons/dimension.svg +1 -5
- iXBRLViewerPlugin/viewer/src/icons/member.svg +2 -5
- iXBRLViewerPlugin/viewer/src/icons/multi-tag.svg +10 -0
- iXBRLViewerPlugin/viewer/src/img/arelle-dark.svg +179 -0
- iXBRLViewerPlugin/viewer/src/img/inline-viewer-dark.svg +59 -0
- iXBRLViewerPlugin/viewer/src/js/accordian.js +5 -4
- iXBRLViewerPlugin/viewer/src/js/aspect.js +29 -10
- iXBRLViewerPlugin/viewer/src/js/aspect.test.js +40 -31
- iXBRLViewerPlugin/viewer/src/js/balance.js +14 -0
- iXBRLViewerPlugin/viewer/src/js/calculation.js +213 -0
- iXBRLViewerPlugin/viewer/src/js/calculation.test.js +306 -0
- iXBRLViewerPlugin/viewer/src/js/calculationInspector.js +187 -0
- iXBRLViewerPlugin/viewer/src/js/chart.js +26 -24
- iXBRLViewerPlugin/viewer/src/js/chart.test.js +10 -9
- iXBRLViewerPlugin/viewer/src/js/concept.js +37 -4
- iXBRLViewerPlugin/viewer/src/js/concept.test.js +30 -6
- iXBRLViewerPlugin/viewer/src/js/datatype.js +20 -0
- iXBRLViewerPlugin/viewer/src/js/datatype.test.js +62 -0
- iXBRLViewerPlugin/viewer/src/js/dialog.js +6 -4
- iXBRLViewerPlugin/viewer/src/js/docOrderIndex.js +7 -7
- iXBRLViewerPlugin/viewer/src/js/fact.js +156 -59
- iXBRLViewerPlugin/viewer/src/js/fact.test.js +160 -29
- iXBRLViewerPlugin/viewer/src/js/factset.js +64 -15
- iXBRLViewerPlugin/viewer/src/js/factset.test.js +102 -31
- iXBRLViewerPlugin/viewer/src/js/footnote.js +8 -2
- iXBRLViewerPlugin/viewer/src/js/index.js +11 -3
- iXBRLViewerPlugin/viewer/src/js/inspector.js +747 -221
- iXBRLViewerPlugin/viewer/src/js/inspector.test.js +143 -25
- iXBRLViewerPlugin/viewer/src/js/interval.js +70 -0
- iXBRLViewerPlugin/viewer/src/js/interval.test.js +153 -0
- iXBRLViewerPlugin/viewer/src/js/ixbrlviewer.js +391 -262
- iXBRLViewerPlugin/viewer/src/js/ixbrlviewer.test.js +134 -20
- iXBRLViewerPlugin/viewer/src/js/ixnode.js +1 -1
- iXBRLViewerPlugin/viewer/src/js/menu.js +25 -7
- iXBRLViewerPlugin/viewer/src/js/number-matcher.js +7 -3
- iXBRLViewerPlugin/viewer/src/js/number-matcher.test.js +4 -0
- iXBRLViewerPlugin/viewer/src/js/outline.js +34 -13
- iXBRLViewerPlugin/viewer/src/js/outline.test.js +97 -91
- iXBRLViewerPlugin/viewer/src/js/period.js +0 -1
- iXBRLViewerPlugin/viewer/src/js/report.js +260 -351
- iXBRLViewerPlugin/viewer/src/js/report.test.js +95 -27
- iXBRLViewerPlugin/viewer/src/js/reportset.js +264 -0
- iXBRLViewerPlugin/viewer/src/js/reportset.test.js +357 -0
- iXBRLViewerPlugin/viewer/src/js/search.js +72 -38
- iXBRLViewerPlugin/viewer/src/js/search.test.js +184 -84
- iXBRLViewerPlugin/viewer/src/js/summary.js +34 -8
- iXBRLViewerPlugin/viewer/src/js/summary.test.js +69 -25
- iXBRLViewerPlugin/viewer/src/js/tableExport.js +9 -9
- iXBRLViewerPlugin/viewer/src/js/taxonomynamer.js +34 -0
- iXBRLViewerPlugin/viewer/src/js/taxonomynamer.test.js +32 -0
- iXBRLViewerPlugin/viewer/src/js/test-utils.js +46 -0
- iXBRLViewerPlugin/viewer/src/js/theme.js +50 -0
- iXBRLViewerPlugin/viewer/src/js/unit.js +90 -32
- iXBRLViewerPlugin/viewer/src/js/unit.test.js +62 -25
- iXBRLViewerPlugin/viewer/src/js/util.js +94 -0
- iXBRLViewerPlugin/viewer/src/js/util.test.js +33 -1
- iXBRLViewerPlugin/viewer/src/js/utr.js +27 -0
- iXBRLViewerPlugin/viewer/src/js/viewer.js +205 -181
- iXBRLViewerPlugin/viewer/src/js/viewerOptions.js +0 -2
- iXBRLViewerPlugin/viewer/src/less/accordian.less +10 -6
- iXBRLViewerPlugin/viewer/src/less/block-list.less +16 -5
- iXBRLViewerPlugin/viewer/src/less/calculation-inspector.less +83 -0
- iXBRLViewerPlugin/viewer/src/less/chart.less +8 -5
- iXBRLViewerPlugin/viewer/src/less/colours-dark-mode.less +40 -0
- iXBRLViewerPlugin/viewer/src/less/colours.less +32 -20
- iXBRLViewerPlugin/viewer/src/less/common.less +3 -3
- iXBRLViewerPlugin/viewer/src/less/components.less +6 -4
- iXBRLViewerPlugin/viewer/src/less/core.less +2 -0
- iXBRLViewerPlugin/viewer/src/less/dialog.less +21 -14
- iXBRLViewerPlugin/viewer/src/less/form-controls.less +33 -11
- iXBRLViewerPlugin/viewer/src/less/inspector.less +1045 -726
- iXBRLViewerPlugin/viewer/src/less/loader.less +2 -2
- iXBRLViewerPlugin/viewer/src/less/menu.less +33 -15
- iXBRLViewerPlugin/viewer/src/less/summary.less +16 -6
- iXBRLViewerPlugin/viewer/src/less/tabs.less +9 -9
- iXBRLViewerPlugin/viewer/src/less/text-block-viewer.less +2 -0
- iXBRLViewerPlugin/viewer/src/less/text-mixins.less +2 -1
- iXBRLViewerPlugin/viewer/src/less/validation-report.less +2 -3
- iXBRLViewerPlugin/viewer/src/less/viewer.less +105 -74
- iXBRLViewerPlugin/viewer/webpack.common.js +19 -9
- iXBRLViewerPlugin/xhtmlserialize.py +59 -45
- {ixbrl_viewer-1.4.1.dist-info → ixbrl_viewer-1.4.86.dist-info}/METADATA +181 -50
- ixbrl_viewer-1.4.86.dist-info/RECORD +217 -0
- {ixbrl_viewer-1.4.1.dist-info → ixbrl_viewer-1.4.86.dist-info}/WHEEL +1 -1
- ixbrl_viewer-1.4.1.dist-info/LICENSE → ixbrl_viewer-1.4.86.dist-info/licenses/LICENSE.md +8 -14
- {ixbrl_viewer-1.4.1.dist-info → ixbrl_viewer-1.4.86.dist-info}/top_level.txt +0 -1
- iXBRLViewerPlugin/viewer/src/js/calculations.js +0 -111
- iXBRLViewerPlugin/viewer/src/js/interact.min.js +0 -6
- ixbrl_viewer-1.4.1.dist-info/RECORD +0 -155
- tests/__init__.py +0 -0
- tests/puppeteer/framework/core_elements.js +0 -117
- tests/puppeteer/framework/page_objects/doc_frame.js +0 -105
- tests/puppeteer/framework/page_objects/fact_details_panel.js +0 -80
- tests/puppeteer/framework/page_objects/search_panel.js +0 -76
- tests/puppeteer/framework/page_objects/toolbar.js +0 -18
- tests/puppeteer/framework/utils.js +0 -3
- tests/puppeteer/framework/viewer_page.js +0 -103
- tests/puppeteer/puppeteer_test_run_via_intellij.jpg +0 -0
- tests/puppeteer/test_filings/filing_documents_smoke_test.zip +0 -0
- tests/puppeteer/test_filings/highlights.zip +0 -0
- tests/puppeteer/tests/fact_properties.test.js +0 -78
- tests/puppeteer/tests/highlight.test.js +0 -186
- tests/puppeteer/tests/search.test.js +0 -86
- tests/puppeteer/tools/generate.sh +0 -15
- tests/unit_tests/__init__.py +0 -0
- tests/unit_tests/iXBRLViewerPlugin/__init__.py +0 -0
- tests/unit_tests/iXBRLViewerPlugin/mock_arelle.py +0 -39
- tests/unit_tests/iXBRLViewerPlugin/test_iXBRLViewer.py +0 -641
- tests/unit_tests/iXBRLViewerPlugin/test_xhtmlserialize.py +0 -310
- {ixbrl_viewer-1.4.1.dist-info → ixbrl_viewer-1.4.86.dist-info}/entry_points.txt +0 -0
- {ixbrl_viewer-1.4.1.dist-info → ixbrl_viewer-1.4.86.dist-info/licenses}/NOTICE +0 -0
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
// See COPYRIGHT.md for copyright information
|
|
2
2
|
|
|
3
3
|
import $ from 'jquery'
|
|
4
|
-
import {
|
|
4
|
+
import { ReportSet } from "./reportset.js";
|
|
5
5
|
import { DocumentOutline } from "./outline.js";
|
|
6
6
|
import { IXNode } from "./ixnode.js";
|
|
7
|
+
import { NAMESPACE_ISO4217, viewerUniqueId } from "./util.js";
|
|
7
8
|
|
|
8
9
|
const testReportData = {
|
|
9
10
|
prefixes: {
|
|
10
11
|
eg: "http://www.example.com",
|
|
11
|
-
iso4217:
|
|
12
|
+
iso4217: NAMESPACE_ISO4217,
|
|
12
13
|
e: "http://example.com/entity",
|
|
13
14
|
},
|
|
14
15
|
roles: {
|
|
@@ -165,56 +166,60 @@ const testFacts = {
|
|
|
165
166
|
},
|
|
166
167
|
};
|
|
167
168
|
|
|
168
|
-
function
|
|
169
|
+
function testReportSet(factList) {
|
|
169
170
|
// Deep copy of standing data
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
const data = JSON.parse(JSON.stringify(testReportData));
|
|
172
|
+
const ixNodeMap = {};
|
|
173
|
+
let i = 0;
|
|
173
174
|
data.facts = {};
|
|
174
175
|
for (const f of factList) {
|
|
175
176
|
data.facts[f] = testFacts[f];
|
|
176
|
-
ixNodeMap[f] = new IXNode(f, $('<span></span>'), i++);
|
|
177
|
+
ixNodeMap[viewerUniqueId(0,f)] = new IXNode(f, $('<span></span>'), i++);
|
|
177
178
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
return
|
|
179
|
+
const reportSet = new ReportSet(data);
|
|
180
|
+
reportSet.setIXNodeMap(ixNodeMap);
|
|
181
|
+
return reportSet;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function getFact(rs, id) {
|
|
185
|
+
return rs.getItemById(viewerUniqueId(0, id));
|
|
181
186
|
}
|
|
182
187
|
|
|
183
188
|
describe("Section filtering", () => {
|
|
184
189
|
// f1 has a line item from elr1, f2 has a line item from elr3
|
|
185
190
|
test("Both groups", () => {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
expect(outline.factInGroup(
|
|
189
|
-
expect(outline.factInGroup(
|
|
190
|
-
expect(outline.factInGroup(
|
|
191
|
+
const reportSet = testReportSet(["f1", "f2"]);
|
|
192
|
+
const outline = new DocumentOutline(reportSet.reports[0]);
|
|
193
|
+
expect(outline.factInGroup(getFact(reportSet, "f1"), "elr1")).toBe(true);
|
|
194
|
+
expect(outline.factInGroup(getFact(reportSet, "f1"), "elr2")).toBe(false);
|
|
195
|
+
expect(outline.factInGroup(getFact(reportSet, "f1"), "elr3")).toBe(false);
|
|
191
196
|
|
|
192
|
-
expect(outline.factInGroup(
|
|
193
|
-
expect(outline.factInGroup(
|
|
194
|
-
expect(outline.factInGroup(
|
|
197
|
+
expect(outline.factInGroup(getFact(reportSet, "f2"), "elr1")).toBe(false);
|
|
198
|
+
expect(outline.factInGroup(getFact(reportSet, "f2"), "elr2")).toBe(false);
|
|
199
|
+
expect(outline.factInGroup(getFact(reportSet, "f2"), "elr3")).toBe(true);
|
|
195
200
|
|
|
196
|
-
expect(outline.sortedSections()).toEqual(["elr1", "elr3"]);
|
|
201
|
+
expect(outline.sortedSections().map(g => g.elr)).toEqual(["elr1", "elr3"]);
|
|
197
202
|
});
|
|
198
203
|
|
|
199
204
|
test("First group", () => {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
expect(outline.sortedSections()).toEqual(["elr1"]);
|
|
205
|
+
const reportSet = testReportSet(["f1"]);
|
|
206
|
+
const outline = new DocumentOutline(reportSet.reports[0]);
|
|
207
|
+
expect(outline.sortedSections().map(g => g.elr)).toEqual(["elr1"]);
|
|
203
208
|
});
|
|
204
209
|
|
|
205
210
|
test("Last group", () => {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
expect(outline.sortedSections()).toEqual(["elr3"]);
|
|
211
|
+
const reportSet = testReportSet(["f2"]);
|
|
212
|
+
const outline = new DocumentOutline(reportSet.reports[0]);
|
|
213
|
+
expect(outline.sortedSections().map(g => g.elr)).toEqual(["elr3"]);
|
|
209
214
|
});
|
|
210
215
|
});
|
|
211
216
|
|
|
212
217
|
describe("Dimensional filtering", () => {
|
|
213
218
|
test("Simple", () => {
|
|
214
|
-
|
|
215
|
-
|
|
219
|
+
const reportSet = testReportSet(["f3"]);
|
|
220
|
+
let outline = new DocumentOutline(reportSet.reports[0]);
|
|
216
221
|
// ELR1 does not mention Dimension 1, so f3 is included.
|
|
217
|
-
|
|
222
|
+
const f3 = getFact(reportSet, "f3");
|
|
218
223
|
expect(outline.factInGroup(f3, "elr1")).toBe(true);
|
|
219
224
|
// ELR1 includes Dimension 2 with specified member, so included
|
|
220
225
|
expect(outline.factInGroup(f3, "elr2")).toBe(true);
|
|
@@ -222,17 +227,17 @@ describe("Dimensional filtering", () => {
|
|
|
222
227
|
// Missing required TypedDimensions1
|
|
223
228
|
expect(outline.factInGroup(f3, "elr4")).toBe(false);
|
|
224
229
|
|
|
225
|
-
expect(outline.sortedSections()).toEqual(["elr1", "elr2"]);
|
|
230
|
+
expect(outline.sortedSections().map(g => g.elr)).toEqual(["elr1", "elr2"]);
|
|
226
231
|
|
|
227
|
-
expect(outline.groupsForFact(f3)).toEqual(["elr1", "elr2"]);
|
|
232
|
+
expect(outline.groupsForFact(f3).map(g => g.elr)).toEqual(["elr1", "elr2"]);
|
|
228
233
|
|
|
229
234
|
// Exclude Member1 from Dimension1 in ELR2
|
|
230
|
-
|
|
235
|
+
reportSet.reports[0]._reportData.rels.pres.elr2['eg:Dimension1'] = [
|
|
231
236
|
{ "t": "eg:Member2" }
|
|
232
237
|
];
|
|
233
|
-
|
|
238
|
+
reportSet.reports[0]._reverseRelationshipCache = {};
|
|
234
239
|
|
|
235
|
-
outline = new DocumentOutline(
|
|
240
|
+
outline = new DocumentOutline(reportSet.reports[0]);
|
|
236
241
|
|
|
237
242
|
// ELR1 does not mention Dimension 1, so f3 is included.
|
|
238
243
|
expect(outline.factInGroup(f3, "elr1")).toBe(true);
|
|
@@ -242,15 +247,15 @@ describe("Dimensional filtering", () => {
|
|
|
242
247
|
// Missing required TypedDimensions1
|
|
243
248
|
expect(outline.factInGroup(f3, "elr4")).toBe(false);
|
|
244
249
|
|
|
245
|
-
expect(outline.sortedSections()).toEqual(["elr1"]);
|
|
246
|
-
expect(outline.groupsForFact(f3)).toEqual(["elr1"]);
|
|
250
|
+
expect(outline.sortedSections().map(g => g.elr)).toEqual(["elr1"]);
|
|
251
|
+
expect(outline.groupsForFact(f3).map(g => g.elr)).toEqual(["elr1"]);
|
|
247
252
|
|
|
248
253
|
});
|
|
249
254
|
|
|
250
255
|
test("Typed Dimensions", () => {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
256
|
+
const reportSet = testReportSet(["ft"]);
|
|
257
|
+
const outline = new DocumentOutline(reportSet.reports[0]);
|
|
258
|
+
const ft = getFact(reportSet, "ft");
|
|
254
259
|
expect(outline.factInGroup(ft, "elr1")).toBe(true);
|
|
255
260
|
// Missing required Dimension1
|
|
256
261
|
expect(outline.factInGroup(ft, "elr2")).toBe(false);
|
|
@@ -261,24 +266,25 @@ describe("Dimensional filtering", () => {
|
|
|
261
266
|
|
|
262
267
|
test("Defaults", () => {
|
|
263
268
|
// Make Member1 the default for Dimension1
|
|
264
|
-
|
|
265
|
-
report
|
|
269
|
+
const reportSet = testReportSet(["f1", "f2", "f3"]);
|
|
270
|
+
const report = reportSet.reports[0];
|
|
271
|
+
report._reportData.rels["d-d"] = { elr1: { 'eg:Dimension1': [ { t: 'eg:Member1' } ] } };
|
|
266
272
|
|
|
267
|
-
|
|
268
|
-
|
|
273
|
+
const outline = new DocumentOutline(reportSet.reports[0]);
|
|
274
|
+
const f1 = getFact(reportSet, "f1");
|
|
269
275
|
expect(outline.factInGroup(f1, "elr1")).toBe(true);
|
|
270
276
|
// f1 is now included in elr2 because the default member is in ELR2
|
|
271
277
|
expect(outline.factInGroup(f1, "elr2")).toBe(true);
|
|
272
278
|
expect(outline.factInGroup(f1, "elr3")).toBe(false);
|
|
273
279
|
|
|
274
280
|
// This should be unchanged
|
|
275
|
-
|
|
276
|
-
expect(outline.factInGroup(
|
|
277
|
-
expect(outline.factInGroup(
|
|
278
|
-
expect(outline.factInGroup(
|
|
281
|
+
const f2 = getFact(reportSet, "f2");
|
|
282
|
+
expect(outline.factInGroup(f2, "elr1")).toBe(false);
|
|
283
|
+
expect(outline.factInGroup(f2, "elr2")).toBe(false);
|
|
284
|
+
expect(outline.factInGroup(f2, "elr3")).toBe(true);
|
|
279
285
|
|
|
280
286
|
// f3 is now technically illegal because it includes the default value for a dimension
|
|
281
|
-
|
|
287
|
+
const f3 = getFact(reportSet, "f3");
|
|
282
288
|
expect(outline.factInGroup(f3, "elr1")).toBe(true);
|
|
283
289
|
// ELR2 now excludeds f3 because the default must be omitted
|
|
284
290
|
expect(outline.factInGroup(f3, "elr2")).toBe(false);
|
|
@@ -292,71 +298,71 @@ describe("Section grouping", () => {
|
|
|
292
298
|
// f1* in ELR1, f2* in ELR3
|
|
293
299
|
test("Single group", () => {
|
|
294
300
|
// All facts in a single group
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
expect(outline.sortedSections()).toEqual(["elr1"]);
|
|
298
|
-
expect(outline.sections["elr1"].
|
|
301
|
+
const reportSet = testReportSet(["f1", "f1a"]);
|
|
302
|
+
const outline = new DocumentOutline(reportSet.reports[0]);
|
|
303
|
+
expect(outline.sortedSections().map(g => g.elr)).toEqual(["elr1"]);
|
|
304
|
+
expect(outline.sections["elr1"].localId()).toEqual("f1");
|
|
299
305
|
expect(outline.sections["elr3"]).toBeUndefined();
|
|
300
306
|
});
|
|
301
307
|
|
|
302
308
|
test("Longest runs 1", () => {
|
|
303
309
|
// ELR1 is the f1, f1a run
|
|
304
310
|
// ELR3 is the f2a, f2b run
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
expect(outline.sortedSections()).toEqual(["elr1", "elr3"]);
|
|
308
|
-
expect(outline.sections["elr1"].
|
|
309
|
-
expect(outline.sections["elr3"].
|
|
311
|
+
const reportSet = testReportSet(["f1", "f1a", "f2", "f1b", "f2a", "f2b"]);
|
|
312
|
+
const outline = new DocumentOutline(reportSet.reports[0]);
|
|
313
|
+
expect(outline.sortedSections().map(g => g.elr)).toEqual(["elr1", "elr3"]);
|
|
314
|
+
expect(outline.sections["elr1"].localId()).toEqual("f1");
|
|
315
|
+
expect(outline.sections["elr3"].localId()).toEqual("f2a");
|
|
310
316
|
});
|
|
311
317
|
|
|
312
318
|
test("Longest runs 2", () => {
|
|
313
319
|
// ELR1 is the f1a, f1b run
|
|
314
320
|
// ELR3 is the f2, f2b run
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
expect(outline.sortedSections()).toEqual(["elr1", "elr3"]);
|
|
318
|
-
expect(outline.sections["elr1"].
|
|
319
|
-
expect(outline.sections["elr3"].
|
|
321
|
+
const reportSet = testReportSet(["f1", "f2", "f2b", "f1a", "f1b", "f2a"]);
|
|
322
|
+
const outline = new DocumentOutline(reportSet.reports[0]);
|
|
323
|
+
expect(outline.sortedSections().map(g => g.elr)).toEqual(["elr1", "elr3"]);
|
|
324
|
+
expect(outline.sections["elr1"].localId()).toEqual("f1a");
|
|
325
|
+
expect(outline.sections["elr3"].localId()).toEqual("f2");
|
|
320
326
|
});
|
|
321
327
|
|
|
322
328
|
test("Equal length runs", () => {
|
|
323
329
|
// If multiple runs have the same length, we arbitrarily assign the ELR
|
|
324
330
|
// to the first.
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
expect(outline.sortedSections()).toEqual(["elr1", "elr3"]);
|
|
328
|
-
expect(outline.sections["elr1"].
|
|
329
|
-
expect(outline.sections["elr3"].
|
|
331
|
+
const reportSet = testReportSet(["f1", "f1a", "f2", "f1b", "f1c", "f2b" ]);
|
|
332
|
+
const outline = new DocumentOutline(reportSet.reports[0]);
|
|
333
|
+
expect(outline.sortedSections().map(g => g.elr)).toEqual(["elr1", "elr3"]);
|
|
334
|
+
expect(outline.sections["elr1"].localId()).toEqual("f1");
|
|
335
|
+
expect(outline.sections["elr3"].localId()).toEqual("f2");
|
|
330
336
|
});
|
|
331
337
|
|
|
332
338
|
test("Hidden facts", () => {
|
|
333
339
|
// Start with ELR1*2 ELR3*1 ELR1*3
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
expect(outline.sortedSections()).toEqual(["elr1", "elr3"]);
|
|
337
|
-
expect(outline.sections["elr1"].
|
|
338
|
-
expect(outline.sections["elr3"].
|
|
340
|
+
const reportSet = testReportSet(["f1a", "f1", "f2", "f1b", "f1c", "f1d"]);
|
|
341
|
+
let outline = new DocumentOutline(reportSet.reports[0]);
|
|
342
|
+
expect(outline.sortedSections().map(g => g.elr)).toEqual(["elr1", "elr3"]);
|
|
343
|
+
expect(outline.sections["elr1"].localId()).toEqual("f1b");
|
|
344
|
+
expect(outline.sections["elr3"].localId()).toEqual("f2");
|
|
339
345
|
|
|
340
346
|
// Make f1c hidden. We now have ELR1*2 ELR3*1 ELR1*2
|
|
341
347
|
// The first ELR1 run should be selected.
|
|
342
|
-
|
|
343
|
-
outline = new DocumentOutline(
|
|
344
|
-
expect(outline.sortedSections()).toEqual(["elr1", "elr3"]);
|
|
345
|
-
expect(outline.sections["elr1"].
|
|
346
|
-
expect(outline.sections["elr3"].
|
|
348
|
+
getFact(reportSet, "f1c").ixNode.isHidden = true;
|
|
349
|
+
outline = new DocumentOutline(reportSet.reports[0]);
|
|
350
|
+
expect(outline.sortedSections().map(g => g.elr)).toEqual(["elr1", "elr3"]);
|
|
351
|
+
expect(outline.sections["elr1"].localId()).toEqual("f1a");
|
|
352
|
+
expect(outline.sections["elr3"].localId()).toEqual("f2");
|
|
347
353
|
|
|
348
354
|
// Make f1a hidden. f1b-[f1c]-f1d is now the longest run.
|
|
349
|
-
|
|
350
|
-
outline = new DocumentOutline(
|
|
351
|
-
expect(outline.sortedSections()).toEqual(["elr1", "elr3"]);
|
|
352
|
-
expect(outline.sections["elr1"].
|
|
353
|
-
expect(outline.sections["elr3"].
|
|
355
|
+
getFact(reportSet, "f1a").ixNode.isHidden = true;
|
|
356
|
+
outline = new DocumentOutline(reportSet.reports[0]);
|
|
357
|
+
expect(outline.sortedSections().map(g => g.elr)).toEqual(["elr1", "elr3"]);
|
|
358
|
+
expect(outline.sections["elr1"].localId()).toEqual("f1b");
|
|
359
|
+
expect(outline.sections["elr3"].localId()).toEqual("f2");
|
|
354
360
|
|
|
355
361
|
// Hide f2. We now have a single run for ELR1
|
|
356
|
-
|
|
357
|
-
outline = new DocumentOutline(
|
|
358
|
-
expect(outline.sortedSections()).toEqual(["elr1"]);
|
|
359
|
-
expect(outline.sections["elr1"].
|
|
362
|
+
getFact(reportSet, "f2").ixNode.isHidden = true;
|
|
363
|
+
outline = new DocumentOutline(reportSet.reports[0]);
|
|
364
|
+
expect(outline.sortedSections().map(g => g.elr)).toEqual(["elr1"]);
|
|
365
|
+
expect(outline.sections["elr1"].localId()).toEqual("f1");
|
|
360
366
|
|
|
361
367
|
});
|
|
362
368
|
});
|
|
@@ -364,14 +370,14 @@ describe("Section grouping", () => {
|
|
|
364
370
|
describe("No presentation", () => {
|
|
365
371
|
// f1 has a line item from elr1, f2 has a line item from elr3
|
|
366
372
|
test("Remove presentation relationships", () => {
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
expect(outline.sortedSections()).toEqual(["elr1", "elr3"]);
|
|
373
|
+
const reportSet = testReportSet(["f1", "f2"]);
|
|
374
|
+
let outline = new DocumentOutline(reportSet.reports[0]);
|
|
375
|
+
expect(outline.sortedSections().map(g => g.elr)).toEqual(["elr1", "elr3"]);
|
|
370
376
|
expect(outline.hasOutline()).toEqual(true);
|
|
371
377
|
|
|
372
|
-
delete
|
|
373
|
-
outline = new DocumentOutline(
|
|
374
|
-
expect(outline.sortedSections()).toEqual([]);
|
|
378
|
+
delete reportSet.reports[0]._reportData.rels.pres;
|
|
379
|
+
outline = new DocumentOutline(reportSet.reports[0]);
|
|
380
|
+
expect(outline.sortedSections().map(g => g.elr)).toEqual([]);
|
|
375
381
|
expect(outline.hasOutline()).toEqual(false);
|
|
376
382
|
});
|
|
377
383
|
});
|