diff --git a/cove_ofds/process.py b/cove_ofds/process.py index 509fff2..e228259 100644 --- a/cove_ofds/process.py +++ b/cove_ofds/process.py @@ -298,6 +298,41 @@ def process(self, process_data: dict) -> dict: context["additional_checks"], lambda i: i["type"] ) + # The library returns *_name_does_not_match and *_reference_name_set_but_not_in_original as different types, + # but in this UI we don't care - we just want to show them as one section. + # So join the 2 types of errors into 1 list. + for f1, f2 in [ + ( + "node_phase_reference_name_does_not_match", + "node_phase_reference_name_set_but_not_in_original", + ), + ( + "span_phase_reference_name_does_not_match", + "span_phase_reference_name_set_but_not_in_original", + ), + ( + "contract_related_phase_reference_name_does_not_match", + "contract_related_phase_reference_name_set_but_not_in_original", + ), + ( + "node_organisation_reference_name_does_not_match", + "node_organisation_reference_name_set_but_not_in_original", + ), + ( + "span_organisation_reference_name_does_not_match", + "span_organisation_reference_name_set_but_not_in_original", + ), + ( + "phase_organisation_reference_name_does_not_match", + "phase_organisation_reference_name_set_but_not_in_original", + ), + ]: + new_list = context["additional_checks"].get(f1, []) + context[ + "additional_checks" + ].get(f2, []) + if new_list: + context["additional_checks"][f1] = new_list + with open(self.data_filename, "w") as fp: json.dump(context, fp, indent=4) diff --git a/cove_ofds/templates/cove_ofds/additional_checks_table.html b/cove_ofds/templates/cove_ofds/additional_checks_table.html index dfc1002..18dac9a 100644 --- a/cove_ofds/templates/cove_ofds/additional_checks_table.html +++ b/cove_ofds/templates/cove_ofds/additional_checks_table.html @@ -293,85 +293,6 @@

{% trans 'Phase names' %}

{% endif %} {% endif %} -{% if 'node_phase_reference_name_set_but_not_in_original' in additional_checks %} -

{% trans 'TODO node_phase_reference_name_set_but_not_in_original' %}

-

{% trans 'TODO' %}

- - - - - - - - - {% for additional_check in additional_checks.node_phase_reference_name_set_but_not_in_original %} - - - - - {% endfor %} - -
{% trans 'Node Id' %}{% trans 'Network ID' %}
- {{ additional_check.node_id }} - - {{ additional_check.network_id }} -
-{% endif %} - - - - -{% if 'span_phase_reference_name_set_but_not_in_original' in additional_checks %} -

{% trans 'TODO span_phase_reference_name_set_but_not_in_original' %}

-

{% trans 'TODO' %}

- - - - - - - - - {% for additional_check in additional_checks.span_phase_reference_name_set_but_not_in_original %} - - - - - {% endfor %} - -
{% trans 'Span Id' %}{% trans 'Network ID' %}
- {{ additional_check.span_id }} - - {{ additional_check.network_id }} -
-{% endif %} - - -{% if 'contract_related_phase_reference_name_set_but_not_in_original' in additional_checks %} -

{% trans 'TODO span_phase_reference_name_set_but_not_in_original' %}

-

{% trans 'TODO' %}

- - - - - - - - - {% for additional_check in additional_checks.contract_related_phase_reference_name_set_but_not_in_original %} - - - - - {% endfor %} - -
{% trans 'Contract Id' %}{% trans 'Network ID' %}
- {{ additional_check.contract_id }} - - {{ additional_check.network_id }} -
-{% endif %} - {% if 'node_organisation_reference_id_not_found' in additional_checks or 'node_organisation_reference_id_not_found' in additional_checks or 'phase_organisation_reference_id_not_found' in additional_checks %}

{% trans 'Organisation references' %}

@@ -534,94 +455,6 @@

{% trans 'Organisation names' %}

{% endif %} -{% if 'node_organisation_reference_name_set_but_not_in_original' in additional_checks %} -

{% trans 'TODO node_organisation_reference_name_set_but_not_in_original' %}

-

{% trans 'TODO ' %}

- - - - - - - - - - {% for additional_check in additional_checks.node_organisation_reference_name_set_but_not_in_original %} - - - - - - {% endfor %} - -
{% trans 'Field' %}{% trans 'Node Id' %}{% trans 'Network ID' %}
- {{ additional_check.field }} - - {{ additional_check.node_id }} - - {{ additional_check.network_id }} -
-{% endif %} - - -{% if 'span_organisation_reference_name_set_but_not_in_original' in additional_checks %} -

{% trans 'TODO span_organisation_reference_name_set_but_not_in_original' %}

-

{% trans 'TODO ' %}

- - - - - - - - - - {% for additional_check in additional_checks.span_organisation_reference_name_set_but_not_in_original %} - - - - - - {% endfor %} - -
{% trans 'Field' %}{% trans 'Span Id' %}{% trans 'Network ID' %}
- {{ additional_check.field }} - - {{ additional_check.span_id }} - - {{ additional_check.network_id }} -
-{% endif %} - - - - -{% if 'phase_organisation_reference_name_set_but_not_in_original' in additional_checks %} -

{% trans 'TODO phase_organisation_reference_name_set_but_not_in_original' %}

-

{% trans 'TODO ' %}

- - - - - - - - - {% for additional_check in additional_checks.phase_organisation_reference_name_set_but_not_in_original %} - - - - - {% endfor %} - -
{% trans 'Phase Id' %}{% trans 'Network ID' %}
- {{ additional_check.phase_id }} - - {{ additional_check.network_id }} -
-{% endif %} - - {% if 'node_international_connections_country_not_set' in additional_checks %}

{% trans 'International connection countries' %}

{% trans 'Your data contains nodes with international connections that do not specify a country. `.country` must be set for each international connection in `/nodes/internationalConnections`.' %}