Skip to main content

Posting Details Salary Indication Further Changes

info

This changelog is a revised version of the changes introduced in version 2.1 for Posting Details Salary Indication Optional 2.1 Changelog and the removals are marked in red while additions are marked in green text color.

During ordering of a campaign, user had to enter the following values into the campaignForm for Salary Indication:

  • postingDetails.salaryIndication.range.from (optional)
  • postingDetails.salaryIndication.range.to (previously required, now optional but still required when currency or period is specified)
  • postingDetails.salaryIndication.range.currency (optional, fallback to EUR on HAPI Backend and HAPI Elements automatically sets EUR when to, currency or period is specified)
  • postingDetails.salaryIndication.period (previously required, now optional but still required when currency or to is specified)

HAPI Backend made changes to allow passing of the below during campaign order request:

Example

postingDetails: {
salaryIndication: null
}

// OR

postingDetails: {
salaryIndication: {
range: {
from: null,
to: null, // cannot be null when currency or period is specified
currency: null
},
period: null // cannot be null when currency or to is specified
}
}

New example case added compared to version 2.1

// OR
postingDetails: {
salaryIndication: {
range: {
from: null,
to: 1000,
// fallback to EUR on HAPI backend
// and HAPI Elements automatically sets EUR when to, currency or period is specified
currency: null
},
period: 'yearly' // cannot be null when currency or to is specified
}
}

This change is backwards compatible, meaning, any ATS that is prefilling salaryIndication as part of the campaignForm will not be affected.


For ATSs that integrate with HAPI Elements, who wants to make salary indication optional, will need to remove their prefill (or pass data like on the example, which is automatically done by Elements on initial load thus if you don't prefill it, you can ignore this)


As part of this change, validations on HAPI Elements frontend have been removed so that HAPI Backend takes care of validations. There is a chance that you might prefill invalid data, the end user will have to fix the errors, as HAPI Backend will not be passing the validation.


In the UI of HAPI Elements widgets for Salary Indication, once the user enters a value in either to, currency or period fields, all the other fields (apart from from field) will be marked as required with a red asterisk next to the label. If user enters a value into to or period and they don't have a value set in currency then the default EUR option will be selected, matching the behavior on HAPI Backend.


As part of this change, the validators for salaryIndication are no longer static, meaning that, the validations depend on whether user entered a value into from or to values. To allow for dynamic validations, a new computed variable has been added to orderJourney state module as postingDetailsStepValidators.


When salaryIndication matches the validations in the example, this variable will output only the validators for non-salaryIndication fields. When salaryIndication is not matching the validations in the example, then it will also contain the validators for salaryIndication.


The validators are not actual functions but names of the functions ran to validate. For example, for window.hapi.orderJourney.state.postingDetailsStepValidators.value, it outputs:


Loading...

The actual validator functions can be found in the Validation submodule's common property as described here.


As part of the changes for making salary indication optional, the following has been added:

Translations

Key"en" value"de" value"nl" value
common.input-number-please-enter-non-default-valueLeave it blank for the default of ({defaultValue})Lassen Sie das Feld leer für den Standardwert von ({defaultValue})Laat het leeg voor de standaardwaarde van ({defaultValue})