diff --git a/src/ifctester/ifctester/reporter.py b/src/ifctester/ifctester/reporter.py index e99e13ea8f..38b3ba8f5b 100644 --- a/src/ifctester/ifctester/reporter.py +++ b/src/ifctester/ifctester/reporter.py @@ -81,6 +81,7 @@ class ResultsSpecification(TypedDict): description: str instructions: str status: bool + is_skipped: bool is_ifc_version: bool total_applicable: int total_applicable_pass: int @@ -380,6 +381,7 @@ class Json(Reporter): description=specification.description, instructions=specification.instructions, status=specification.status, + is_skipped=cardinality == "optional" and total_checks == 0, is_ifc_version=specification.is_ifc_version, total_applicable=total_applicable, total_applicable_pass=total_applicable_pass, @@ -474,8 +476,6 @@ class Html(Json): def report(self) -> None: super().report() for spec in self.results["specifications"]: - if spec["cardinality"] == "optional" and spec["total_checks"] == 0: - spec["is_skipped"] = True spec["is_prohibited"] = spec["cardinality"] == "prohibited" spec["cardinality"] = spec["cardinality"].capitalize() spec["has_requirements"] = bool(spec["requirements"]) diff --git a/src/ifctester/webapp/src/pages/Home/IdsViewer.svelte b/src/ifctester/webapp/src/pages/Home/IdsViewer.svelte index e9645e0984..2fda5f0c2c 100644 --- a/src/ifctester/webapp/src/pages/Home/IdsViewer.svelte +++ b/src/ifctester/webapp/src/pages/Home/IdsViewer.svelte @@ -50,13 +50,7 @@ function getSpecificationStatus(specIndex, auditData) { const spec = auditData.specifications[specIndex]; if (!spec) return null; - - // If no applicable elements and no checks, and it passed, it's actually skipped - if (spec.total_applicable === 0 && spec.total_checks === 0 && spec.status === true) { - return 'skipped'; - } - - return spec.status; + return spec.is_skipped ? 'skipped' : spec.status; } function getSpecificationStats(specIndex, auditData) { @@ -79,11 +73,13 @@ const status = getSpecificationStatus(specIndex, auditData); if (status === 'skipped') { - return "Skipped because no applicable entities were found and the cardinality is OPTIONAL or PROHIBITED"; + return "Skipped because no applicable entities were found and the cardinality is OPTIONAL"; } if (status === false) { // Failed - if (spec.total_applicable === 0) { + if (spec.cardinality === 'prohibited') { + return `Failed because ${spec.total_applicable} prohibited entities were found`; + } else if (spec.total_applicable === 0) { return "Failed because no applicable entities were found but the cardinality is REQUIRED"; } else { const failedChecks = spec.total_checks - spec.total_checks_pass; @@ -240,19 +236,30 @@ {#if "@description" in spec}

{spec["@description"]}

{/if} +
+ {#if spec.applicability["@minOccurs"] === 1 && spec.applicability["@maxOccurs"] === 'unbounded'} + Required + {/if} + {#if spec.applicability["@minOccurs"] === 0 && spec.applicability["@maxOccurs"] === 'unbounded'} + Optional + {/if} + {#if spec.applicability["@minOccurs"] === 0 && spec.applicability["@maxOccurs"] === 0} + Prohibited + {/if} + {#if auditReport} + {@const stats = getSpecificationStats(index, auditReport.data)} + {@const status = getSpecificationStatus(index, auditReport.data)} + {#if stats && spec.applicability["@maxOccurs"] !== 0 && status !== 'skipped'} + Checks: {stats.checksPassed}/{stats.checksTotal} + Requirements: {stats.requirementsPassed}/{stats.requirements} + {/if} + {/if} +
{#if auditReport} {@const reason = getSpecificationReason(index, auditReport.data)} {#if reason}

{reason}

{/if} - {@const stats = getSpecificationStats(index, auditReport.data)} - {@const status = getSpecificationStatus(index, auditReport.data)} - {#if stats && status !== 'skipped'} -
- Checks: {stats.checksPassed}/{stats.checksTotal} - Requirements: {stats.requirementsPassed}/{stats.requirements} -
- {/if} {/if}
@@ -292,9 +299,105 @@ {/if} {/each}
+ + {#if auditReport} + {@const status = getSpecificationStatus(index, auditReport.data)} + {#if ! status && spec.applicability["@maxOccurs"] == 0} + {@const specReport = auditReport.data.specifications[index]} +
+ {#if specReport.applicable_entities && specReport.applicable_entities.length > 0} +
+

Failed Elements ({specReport.applicable_entities.length})

+
+ + + + + + + + + + + + + + + {#each specReport.applicable_entities.slice(0, 10) as entity} + + + + + + + + + + {/each} + {#if specReport.applicable_entities.length > 10} + + + + {/if} + +
ClassPredefinedTypeNameDescriptionWarningGlobalIdTag
{entity.class}{entity.predefined_type || '-'} + + +
{entity.name || '-'}
+
+ +

{entity.name || '-'}

+
+
+
+ + +
{entity.description || '-'}
+
+ +

{entity.description || '-'}

+
+
+
+ + +
{entity.reason || '-'}
+
+ +

{entity.reason || '-'}

+
+
+
+ + +
{entity.global_id || '-'}
+
+ +

{entity.global_id || '-'}

+
+
+
+ + +
{entity.tag || '-'}
+
+ +

{entity.tag || '-'}

+
+
+
... {specReport.applicable_entities.length - 10} more failing elements not shown ...
+
+
+
+ {/if} +
+ + {/if} + {/if} + {#if Array.isArray(spec.requirements) && spec.requirements.length > 0}

Requirements

@@ -497,6 +600,7 @@ {/each}
+ {/if} {/if} @@ -1128,4 +1232,4 @@ white-space: nowrap; cursor: pointer; } - \ No newline at end of file +