Skip to main content

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:

  1. When user first creates a contract, they can specify some defaults
  2. 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

  1. Contract Add Posting Requirements Defaults Widget: he-contract-add-postingrequirementsdefaults has been added
  2. Contract Edit Widget: he-contract-edit-id has been added
  3. Contract Edit Widget Save Button: he-contract-edit-button has been added

SDK additions

  1. We have added ability to save an already created contract. These functions can be used:
    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`
    This function takes in values stored in 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 and groupFormIsValid state variable.
  2. We have extended the type of ContractChannel type to also include allows_edit: boolean flag which we use to show the "Edit Contract" button
  3. We have extended the type of ContractCreateForm type to include posting_requirements_defaults: Record<string, string | string[]> | null
  4. We have extended the type of Contract type to include posting_requirements_defaults: Record<string, string | string[]> | null

i18n additions

Key"en" value"de" value"nl" value
contracts.add.posting-requirements-defaults.headingChannel Requirements DefaultsStandardanforderungen des KanalsStandaardkanaalvereisten
contracts.add.posting-requirements-defaults.heading-explanationYou 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-contractSave ContractVertrag speichernContract opslaan
contracts.edit.headingEdit contractVertrag bearbeitenContract bewerken
contract.edit.successContract "{name}" has been savedDer Vertrag "{name}" wurde gespeichertContract "{name}" is opgeslagen

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

  1. Contract Edit Widget: he-contract-edit-id container with CSS class hapi__contracts-edit and the heading text hapi__contracts-edit-heading
  2. Contract Edit Widget Save Button: he-contract-edit-button container with CSS class hapi__contracts-add-button
  3. Edit Contract button in the card of the Contract with CSS ID contract-edit-button

Changes

Widget changes

  1. Contract Add Widget: he-contract-add has had the section Contract Add Posting Requirements Defaults widget he-contract-add-postingrequirementsdefaults added in between:
    1. Contract Add Optional Details Widget: he-contract-add-optionaldetails
    2. added here -> he-contract-add-postingrequirementsdefaults
    3. Contract Add Errors Widget: he-contract-add-errors
  2. 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):
    1. Contract List Widget: he-contract-list
    2. Contract List Layout Card Widget: he-contract-list-layout-card
    3. Contract List Layout Card with Label Query: he-contract-list-layout-card-labels