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} +{reason}
{/if} - {@const stats = getSpecificationStats(index, auditReport.data)} - {@const status = getSpecificationStatus(index, auditReport.data)} - {#if stats && status !== 'skipped'} -| Class | +PredefinedType | +Name | +Description | +Warning | +GlobalId | +Tag | +
|---|---|---|---|---|---|---|
| {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 ... | +||||||