Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • intl-whitelabel-cms:

    • Create a new item boolean to enable or disable the complementaryCta:

      • Where: upside complementaryCta;

        Image Removed
        Code Block
        languagetypescript
        {
          title: 'Show Complementary CTA',
          description: 'By checking this, it show the complementary CTA',
          name: 'showComplementaryCTA',
          type: 'boolean',
        },
    • Change the complementaryCta:

      • from:

        Code Block
        languagetypescript
        {
          title: 'Complementary CTA',
          name: 'complementaryCta',
          type: 'linkAction',
          validation: (Rule: RuleType) => Rule.required(),
        },
      • to:

        Code Block
        languagetypescript
        {
          title: 'Complementary CTA',
          name: 'complementaryCta',
          type: 'linkAction',
          validation: (Rule: RuleType) => {
            return Rule.required().custom((showComplementaryCTA, context) => {
              const showComplementaryText = !!(context.document.complementaryCta?.actionText || {})[
                defaultLanguage
              ];
              const showComplementaryAction = !!(context.document.complementaryCta?.actionUrl || {})[
                defaultLanguage
              ];
              if (showComplementaryCTA && !(showComplementaryText || showComplementaryAction)) {
                return 'If you want to enable the complementary CTA button, you must either provide "Action Text" and add a "Action url"';
              }
              return true;
            });
          },
        },

...