app/presenters/specialist_document_presenter.rb
# The facet value is hyphenated, map this to the
# friendly readable version provided in `allowed_values`
The facet value is hyphenated, map this to the
friendly readable version provided in `allowed_values`
The facet value is hyphenated map this to the friendly readable version provided in ` allowed_values `
def facet_blocks(facet, values)
    values.map do |value|
      allowed_value = facet["allowed_values"].detect { |av| av["value"] == value }
      if allowed_value
        facet_block(facet, allowed_value)
      else
        GovukError.notify(
          "Facet value not in list of allowed values",
          extra: { error_message: "Facet value '#{value}' not an allowed value for facet '#{facet['name']}' on #{base_path} content item" },
        )
        value
      end
    end
  end
def facet_blocks ( facet , values ) values . map do | value | allowed_value = facet [ "allowed_values" ] . detect { | av | av [ "value" ] == value } if allowed_value facet_block ( facet , allowed_value ) else GovukError . notify ( "Facet value not in list of allowed values" , extra : { error_message : "Facet value '#{value}' not an allowed value for facet '#{facet['name']}' on #{base_path} content item" } , ) value end end end
The facet value is hyphenated, map this to the
friendly readable version provided in `allowed_values`
The facet value is hyphenated map this to the friendly readable version provided in ` allowed_values `
facet
values