Contract Channel Posting Requirements Defaults and Contract Editing for Defaults Added
As per client feedback, we have improved the UX while filling in channel specific contract fields so that:
- When user first creates a contract, they can specify some defaults
- If user adds the contract with defaults to their basket, during order journey, on the step for contract channel's posting requirements, the defaults user entered while creating the contract will be applied to the form so that it is less time-consuming to order contracts
A recipe has been added to describe how to prefill defaults if needed.
Additions
Widget additions
- Contract Add Posting Requirements Defaults Widget:
he-contract-add-postingrequirementsdefaults
has been added - Contract Edit Widget:
he-contract-edit-id
has been added - Contract Edit Widget Save Button:
he-contract-edit-button
has been added
SDK additions
- We have added ability to save an already created contract. These functions can be used:This function takes in values stored in
1. [Service Function:](/docs/playground/?module=contract&mainTabId=service&subTabId=%2Fservice%2Fcontract%2FsaveContract) `saveContract`
2. [API Function:](/docs/playground/?module=contract&mainTabId=api&subTabId=%2Fapi%2Fcontract%2FsaveContract) `saveContract`contractForm
state variable and sends it to the API. You can tie the service function to your own custom button. The button widget we provide to save is disabled when either one of these is false:contractFormIsValid
state variable andgroupFormIsValid
state variable. - We have extended the type of
ContractChannel
type to also includeallows_edit: boolean
flag which we use to show the "Edit Contract" button - We have extended the type of
ContractCreateForm
type to includeposting_requirements_defaults: Record<string, string | string[]> | null
- We have extended the type of
Contract
type to includeposting_requirements_defaults: Record<string, string | string[]> | null
i18n additions
Key | "en" value | "de" value | "nl" value |
---|---|---|---|
contracts.add.posting-requirements-defaults.heading | Channel Requirements Defaults | Standardanforderungen des Kanals | Standaardkanaalvereisten |
contracts.add.posting-requirements-defaults.heading-explanation | You can fill in any of these values to be used for your future campaign orders. | Sie können beliebige dieser Werte ausfüllen, die für Ihre zukünftigen Kampagnenbestellungen verwendet werden sollen. | U kunt een van deze waarden invullen om te worden gebruikt voor uw toekomstige campagnebestellingen. |
contracts.edit.save-contract | Save Contract | Vertrag speichern | Contract opslaan |
contracts.edit.heading | Edit contract | Vertrag bearbeiten | Contract bewerken |
contract.edit.success | Contract "{name}" has been saved | Der Vertrag "{name}" wurde gespeichert | Contract "{name}" is opgeslagen |
Modal additions
A modal with key contract-edit
with an enum alias window.hapi.modal.utils.modalKeys.contractEdit
has been added in which we show the Contract Edit Widget: he-contract-edit-id
by passing contract-id="YOUR-ID-HERE"
attribute on the HTML Web Component.
Alert additions
An alert with key contract-edited
with an enum alias window.hapi.alert.utils.alertKeys.contractEditSuccess
has been added in which we show the message for i18n key contract.edit.success
(values listed in i18n additions section)
HTML Selector additions
- Contract Edit Widget:
he-contract-edit-id
container with CSS classhapi__contracts-edit
and the heading texthapi__contracts-edit-heading
- Contract Edit Widget Save Button:
he-contract-edit-button
container with CSS classhapi__contracts-add-button
- Edit Contract button in the card of the Contract with CSS ID
contract-edit-button
Changes
Widget changes
- Contract Add Widget:
he-contract-add
has had the section Contract Add Posting Requirements Defaults widgethe-contract-add-postingrequirementsdefaults
added in between:- Contract Add Optional Details Widget:
he-contract-add-optionaldetails
- added here ->
he-contract-add-postingrequirementsdefaults
- Contract Add Errors Widget:
he-contract-add-errors
- Contract Add Optional Details Widget:
- We have added an "Edit Contract" button in the card of the contract that is being shown in contract listing widgets (CSS ID selector listed in HTML Selector additions section):
- Contract List Widget:
he-contract-list
- Contract List Layout Card Widget:
he-contract-list-layout-card
- Contract List Layout Card with Label Query:
he-contract-list-layout-card-labels
- Contract List Widget: