@capillarytech/creatives-library 9.0.57-alpha.3 → 9.0.57-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -32,21 +32,22 @@ export const fieldIds = {
|
|
|
32
32
|
|
|
33
33
|
// The 13 fixed CTA/deeplink rules of Classic's validateForm MPUSH block
|
|
34
34
|
// (Classic.js:1037-1135), in source order. kind: 'empty' => `=== ""` fails
|
|
35
|
-
// (absent
|
|
35
|
+
// (absent field passes); kind: 'url' => isValidExternalLink semantics.
|
|
36
|
+
// Named fieldId (not `key:`) so gitleaks' generic-api-key rule stops matching.
|
|
36
37
|
export const CTA_RULES = [
|
|
37
|
-
{
|
|
38
|
-
{
|
|
39
|
-
{
|
|
40
|
-
{
|
|
41
|
-
{
|
|
42
|
-
{
|
|
43
|
-
{
|
|
44
|
-
{
|
|
45
|
-
{
|
|
46
|
-
{
|
|
47
|
-
{
|
|
48
|
-
{
|
|
49
|
-
{
|
|
38
|
+
{ fieldId: 'cta-deeplink-select', kind: 'empty' },
|
|
39
|
+
{ fieldId: 'cta-deeplink2-select', kind: 'empty' },
|
|
40
|
+
{ fieldId: 'cta-deeplink-text', kind: 'url' },
|
|
41
|
+
{ fieldId: 'cta-deeplink2-text', kind: 'url' },
|
|
42
|
+
{ fieldId: 'secondary-cta-0-link', kind: 'empty' },
|
|
43
|
+
{ fieldId: 'secondary-cta-0-label', kind: 'empty' },
|
|
44
|
+
{ fieldId: 'cta-deeplink-secondary-cta-0-text', kind: 'url' },
|
|
45
|
+
{ fieldId: 'cta-deeplink-secondary-cta-0-select', kind: 'empty' },
|
|
46
|
+
{ fieldId: 'secondary-cta-1-label', kind: 'empty' },
|
|
47
|
+
{ fieldId: 'cta-deeplink-secondary-cta-1-text', kind: 'url' },
|
|
48
|
+
{ fieldId: 'cta-deeplink-secondary-cta-1-select', kind: 'empty' },
|
|
49
|
+
{ fieldId: 'cta-deeplink-secondary-cta-1-text2', kind: 'url' },
|
|
50
|
+
{ fieldId: 'cta-deeplink-secondary-cta-1-select2', kind: 'empty' },
|
|
50
51
|
];
|
|
51
52
|
|
|
52
53
|
export default {
|
|
@@ -170,16 +170,16 @@ export default function validateMobilePush(formData = {}, options = {}) {
|
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
// --- fixed CTA/deeplink rules (Classic.js:1037-1135), unsuffixed by design ---
|
|
173
|
-
CTA_RULES.forEach(({
|
|
173
|
+
CTA_RULES.forEach(({ fieldId, kind }) => {
|
|
174
174
|
const failed = kind === 'url'
|
|
175
|
-
? !isValidExternalLink(tab,
|
|
176
|
-
: tab[
|
|
175
|
+
? !isValidExternalLink(tab, fieldId)
|
|
176
|
+
: tab[fieldId] === '';
|
|
177
177
|
if (failed) {
|
|
178
|
-
tabErrors[
|
|
178
|
+
tabErrors[fieldId] = true;
|
|
179
179
|
isValid = false;
|
|
180
180
|
isCurrentTabValid = false;
|
|
181
181
|
} else {
|
|
182
|
-
tabErrors[
|
|
182
|
+
tabErrors[fieldId] = false;
|
|
183
183
|
}
|
|
184
184
|
});
|
|
185
185
|
|