{{#let (group-by "Status" (or @items (array))) as |grouped|}} {{! Check the status of each Status of checks in order }} {{! First one to have more than one check wins }} {{! Otherwise we are empty }} {{#let (or (if (gt grouped.critical.length 0) grouped.critical) (if (gt grouped.warning.length 0) grouped.warning) (if (gt grouped.passing.length 0) grouped.passing) (array) ) as |checks|}} {{#let checks.firstObject.Status as |status|}}
{{capitalize @type}} Checks
{{#let (or (if (eq status 'critical') 'failing') (if (eq status 'warning') 'with a warning') status ) as |humanized|}}
{{or (if (eq checks.length 0) (concat 'No ' @type ' checks')) (if (eq checks.length @items.length) (concat 'All ' @type ' checks ' humanized)) (concat checks.length '/' @items.length ' ' @type ' checks ' humanized) }}
{{/let}}
{{/let}} {{/let}} {{/let}}