{# The outcome of a push, or its progress while it runs. Included by the page and served on its own by /seek/sync/progress, which the bar polls until the result replaces it. #} {% set box = "border:1px solid var(--border, #ddd); border-radius:6px; padding:0.9rem 1rem; margin:1rem 0;" %} {# Many nodes of one entity type give the same reason; show each reason once with a count, rather than repeating it per node. #} {% macro reasons(items) %}{% set counts = {} %}{% for node_id, reason in items %}{% set _ = counts.update({reason: counts.get(reason, 0) + 1}) %}{% endfor %}{% for reason, n in counts.items() %}{{ reason }}{% if n > 1 %} (×{{ n }}){% endif %}{% if not loop.last %}; {% endif %}{% endfor %}{% endmacro %} {% if sync_job is defined and sync_job and not sync_job.done %}
Syncing to SEEK…
{{ sync_job.placed }} of {{ sync_job.total or "?" }} entities placed{% if sync_job.total %} ({{ sync_job.percent }}%){% endif %}. Every entity is a request to SEEK; a registered data file makes SEEK fetch it.
{% elif action_error is defined and action_error and sync_job is defined and sync_job %}
{{ action_error }}
{% endif %} {% if sync_result is defined and sync_result %} {% set not_uploaded = sync_result.skipped|length + sync_result.errors|length %} {% set not_sent = sync_result.notes|length %}
Synced {{ sync_result.synced_count }} resource{{ "" if sync_result.synced_count == 1 else "s" }} to SEEK{% if not_uploaded %}, but {{ not_uploaded }} entit{{ "y was" if not_uploaded == 1 else "ies were" }} not uploaded{% endif %}{% if not_sent %}, {{ not_sent }} value{{ "" if not_sent == 1 else "s" }} not sent{% endif %}.
{{ sync_result.investigations|length }} investigation(s), {{ sync_result.studies|length }} study(ies), {{ sync_result.assays|length }} assay(s), {{ sync_result.samples|length }} sample(s).
{% if not_uploaded %}
{{ not_uploaded }} of your entit{{ "y" if not_uploaded == 1 else "ies" }} did not reach SEEK — see below. Your SEEK copy is incomplete.
{% endif %} {% if sync_result.skipped %}
Skipped: {{ reasons(sync_result.skipped) }}
{% endif %} {% if sync_result.errors %}
Errors: {{ reasons(sync_result.errors) }}
{% endif %} {# Attribute values left out of a record that WAS pushed -- the record is there, so not an entity count, but a real omission in the copy. #} {% if sync_result.notes %}
Values not sent: {{ reasons(sync_result.notes) }}
{% endif %}
{% endif %}