From 464dd51a936b1c9e2514fbb711febe162f2e90c7 Mon Sep 17 00:00:00 2001 From: jhugman Date: Wed, 6 Dec 2023 17:27:25 +0000 Subject: [PATCH] Refactor EXP-4109 [v121] Add string-alias types to messaging and onboarding FML files (#17588) * Refactor EXP-3675 [v121] Add string-alias to messaging feature * Refactor EXP-3675 [v121] Add string alias to onboarding feature --- nimbus-features/messagingFeature.yaml | 28 +++++++++++++------ .../onboardingFrameworkFeature.yaml | 14 ++++++---- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/nimbus-features/messagingFeature.yaml b/nimbus-features/messagingFeature.yaml index 6d67f38d0980..268ea98b3db8 100644 --- a/nimbus-features/messagingFeature.yaml +++ b/nimbus-features/messagingFeature.yaml @@ -30,7 +30,8 @@ features: A growable collection of messages, where the Key is the message identifier and the value is its associated MessageData. - type: Map + type: Map + string-alias: MessageKey default: {} triggers: @@ -38,19 +39,22 @@ features: A collection of out the box trigger expressions. Each entry maps to a valid JEXL expression. - type: Map + type: Map + string-alias: TriggerName default: {} styles: description: > A map of styles to configure message appearance. - type: Map + type: Map + string-alias: StyleName default: {} actions: - type: Map + type: Map description: A growable map of action URLs. + string-alias: ActionName default: {} on-control: @@ -58,8 +62,14 @@ features: description: What should be displayed when a control message is selected. default: show-next-message + $$experiment:: + type: ExperimentSlug + string-alias: ExperimentSlug + description: Not to be set by experiment. + default: "{experiment}" + message-under-experiment: - type: Option + type: Option description: 'Deprecated. Please use "experiment": "{experiment}" instead.' default: null @@ -164,6 +174,8 @@ objects: and call to action. fields: action: + # We would like this to be of ActionName type, but it accepts https:// URLs + # so changing this would be a breaking change. type: String description: > A URL of a page or a deeplink. @@ -190,13 +202,13 @@ objects: is present, the whole message is clickable. default: null style: - type: String + type: StyleName description: > The style as described in a `StyleData` from the styles table. default: DEFAULT trigger: - type: List + type: List description: > A list of strings corresponding to targeting expressions. The message will be @@ -207,7 +219,7 @@ objects: description: Each message will tell us the surface it is targeting with this. default: Unknown experiment: - type: Option + type: Option description: The experiment slug that this message is involved in. default: null diff --git a/nimbus-features/onboardingFrameworkFeature.yaml b/nimbus-features/onboardingFrameworkFeature.yaml index d26b804c4675..405587ca04bd 100644 --- a/nimbus-features/onboardingFrameworkFeature.yaml +++ b/nimbus-features/onboardingFrameworkFeature.yaml @@ -10,12 +10,14 @@ features: A collection of out the box conditional expressions to be used in determining whether a card should show or not. Each entry maps to a valid JEXL expression. - type: Map + type: Map + string-alias: ConditionName default: {} cards: description: > The list of available cards for onboarding. - type: Map + type: Map + string-alias: NimbusOnboardingCardKey default: {} dismissable: description: > @@ -167,17 +169,17 @@ objects: popup information default: null prerequisites: - type: List + type: List description: > - A list of strings corresponding to targeting expressions. + A list of ConditionName strings corresponding to targeting expressions. The card will be shown if all expressions `true` and if no expressions in the `disqualifiers` table are true, or if the `disqualifiers` table is empty. default: [] disqualifiers: - type: List + type: List description: > - A list of strings corresponding to targeting expressions. + A list of ConditionName strings corresponding to targeting expressions. The card will not be shown if any expression is `true`. default: [] type: