Skip to content

Commit

Permalink
Merge pull request #797 from paulwarren-wk/summary-tolerate-missing-d…
Browse files Browse the repository at this point in the history
…imensions
  • Loading branch information
austinmatherne-wk authored Jan 17, 2025
2 parents 30daf14 + ff0f948 commit bb2d91c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 3 additions & 1 deletion iXBRLViewerPlugin/viewer/src/js/concept.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import { Balance } from "./balance.js";

export class Concept {
constructor(report, name) {
this._c = report.concepts()[name] || {};
const c = report.concepts()[name];
this.hasDefinition = (c !== undefined);
this._c = c ?? {};
this.name = name;
this.report = report;
}
Expand Down
8 changes: 6 additions & 2 deletions iXBRLViewerPlugin/viewer/src/js/summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,17 @@ export class DocumentSummary {
counter.addDimension(dimension);

const dimensionConcept = fact.report.getConcept(dimension);
if (dimensionConcept.isTypedDimension()) {
if (!dimensionConcept.hasDefinition) {
console.log("Missing definition for dimension: " + dimension);
}
else if (dimensionConcept.isTypedDimension()) {
const typedDomainElement = dimensionConcept.typedDomainElement();
if (typedDomainElement) {
counter = this._getTagCounter(tagCounts, typedDomainElement);
counter.addMember(typedDomainElement);
}
} else {
}
else {
counter = this._getTagCounter(tagCounts, member);
counter.addMember(member);
}
Expand Down
3 changes: 2 additions & 1 deletion iXBRLViewerPlugin/viewer/src/js/summary.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { DocumentSummary } from "./summary.js";
function testConcept(typedDomainElement) {
return {
isTypedDimension: () => typedDomainElement !== undefined,
typedDomainElement: () => typedDomainElement
typedDomainElement: () => typedDomainElement,
hasDefinition: true,
}
}

Expand Down

0 comments on commit bb2d91c

Please sign in to comment.