VONQ
ChangelogVersion 4.8

Filter the campaign list by campaign name

Filter the campaign list by campaign name

The Campaign Filters widget (he-campaign-filters) is now implemented. The Campaign Landing widget (he-campaign) shows it as a Campaign Filters accordion above the list, with a Campaign Name field and an Apply Filters button.

Typing a name and pressing Apply Filters reloads the list from the first page with only the campaigns whose name matches, and closes the accordion. Clearing the field and applying again brings the full list back.

Matching

Matching is case-insensitive and anchored to the beginning of the campaign name: mock matches "Mock Campaign Name", campaign name does not.

New widgets

The two parts of the filter are also available as standalone widgets, so you can lay the filter out yourself instead of using he-campaign-filters:

WidgetPurpose
he-campaign-filters-campaignnameThe Campaign Name label and input
he-campaign-filters-applybuttonThe Apply Filters button

SDK

The name currently typed into the field is held in campaign state, so you can read or preset it:

// Preset a filter, then load the matching campaigns
window.hapi.campaign.state.filterCampaignName = "Sales"
await window.hapi.service.campaign.getCampaigns()
State propertyTypeMeaning
filterCampaignNamestringName the campaign list is filtered by. Empty means no filter
filtersAccordionIsOpenbooleanWhether the Campaign Filters accordion is expanded

window.hapi.service.campaign.getCampaigns() sends filterCampaignName to the campaign list endpoint whenever it is set, including for calls your own code makes.

Styling

SelectorElement
.hapi__campaigns-filters-accordionThe accordion wrapping the filters on Campaign Landing
.hapi__campaigns-filtersThe filters container
.hapi__campaigns-filters-campaign-nameThe Campaign Name field
.hapi__campaigns-filters-apply-buttonThe Apply Filters button
#campaign-filter-campaign-name-inputThe Campaign Name input
#campaign-filters-apply-buttonThe Apply Filters button

Backwards compatibility

  • Additive: the filter is empty by default, so getCampaigns() returns the same campaigns as before until a name is set.
  • The Campaign Landing widget gains the accordion above the list. Collapse it from view with window.hapi.ui.service.hideElement(".hapi__campaigns-filters-accordion") if you do not want to offer filtering.
  • No SDK function, getter, setter, property, or event was removed or renamed.
  • No translation keys were removed.

I18n

The following i18n translations have been added:

Key"en" value"de" value"nl" value"fr" value"es" value"it" value
campaign.filters.headingCampaign FiltersKampagnenfilterCampagnefiltersFiltres de campagneFiltros de campañaFiltri campagna
campaigns.filters.campaign-nameCampaign NameKampagnennameCampagnenaamNom de la campagneNombre de la campañaNome della campagna
campaigns.filters.campaign-name-placeholderType the start of a campaign nameAnfang eines Kampagnennamens eingebenTyp het begin van een campagnenaamSaisissez le début d'un nom de campagneEscribe el inicio de un nombre de campañaDigita l'inizio di un nome campagna
campaigns.filters.apply-filtersApply FiltersFilter anwendenFilters toepassenAppliquer les filtresAplicar FiltrosApplica Filtri