Changes and additions to Submodules
OrderJourney Module State Submodule
stepActiveOrderErrorsstate variable to OrderJourney module's state submodule which is explained in Validation Improvements of Version 1.5
Campaign Module Service Submodule
getEmploymentTypesfunction to Campaign module's service which is explained in i18n Improvements of Version 1.5
Language Module Utilities Submodule
Language module has had utilities submodule added which contains the following:
localeKeyswhich is explained in i18n Improvements of Version 1.5localesSupportedByBackendwhich is explained in i18n Improvements of Version 1.5
Basket Module Utilities Submodule
These functions in Basket module's Utilities submodule have had their return type changed and may be breaking
getBasketProductTimeToSetupreturnsProductDurationinstead ofstringwhich had hardcoded strings that could not be translatedgetBasketProductTimeToProcessreturnsProductDurationinstead ofstringwhich had hardcoded strings that could not be translatedgetBasketProductDurationreturnsProductDurationinstead ofstringwhich had hardcoded strings that could not be translated
ProductDuration type can be found in the playground
Employment Types array is now locale based
This change may be breaking because now window.hapi.campaign.state.employmentTypes.value will return an empty array as it does first run window.hapi.campaign.service.getEmploymentTypes.run() which sets the employmentTypes variable in Campaign module's state submodule.
If you have code that works on mount of HAPI Elements, we suggest that you switch the code to be like below:
// version 4.1 added ability to dispose of events
const id = window.hapi.campaign.service.getEmploymentTypes.onSuccess((employmentTypes) => {
console.log('[HAPI Elements] employmentTypes', employmentTypes)
})
// later dispose of the listener to prevent memory leaks
window.hapi.removeEventById(id)