Skip to content

Commit

Permalink
Refactor EXP-4109 [v121] Add string-alias types to messaging and onbo…
Browse files Browse the repository at this point in the history
…arding FML files (#17588)

* Refactor EXP-3675 [v121] Add string-alias to messaging feature

* Refactor EXP-3675 [v121] Add string alias to onboarding feature
  • Loading branch information
jhugman authored Dec 6, 2023
1 parent 6ec1144 commit 464dd51
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 14 deletions.
28 changes: 20 additions & 8 deletions nimbus-features/messagingFeature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,36 +30,46 @@ features:
A growable collection of messages, where the
Key is the message identifier and the value
is its associated MessageData.
type: Map<String, MessageData>
type: Map<MessageKey, MessageData>
string-alias: MessageKey
default: {}

triggers:
description: >
A collection of out the box trigger
expressions. Each entry maps to a
valid JEXL expression.
type: Map<String, String>
type: Map<TriggerName, String>
string-alias: TriggerName
default: {}

styles:
description: >
A map of styles to configure message
appearance.
type: Map<String, StyleData>
type: Map<StyleName, StyleData>
string-alias: StyleName
default: {}

actions:
type: Map<String, String>
type: Map<ActionName, String>
description: A growable map of action URLs.
string-alias: ActionName
default: {}

on-control:
type: ControlMessageBehavior
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<String>
type: Option<MessageKey>
description: 'Deprecated. Please use "experiment": "{experiment}" instead.'
default: null

Expand Down Expand Up @@ -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.
Expand All @@ -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<String>
type: List<TriggerName>
description: >
A list of strings corresponding to
targeting expressions. The message will be
Expand All @@ -207,7 +219,7 @@ objects:
description: Each message will tell us the surface it is targeting with this.
default: Unknown
experiment:
type: Option<String>
type: Option<ExperimentSlug>
description: The experiment slug that this message is involved in.
default: null

Expand Down
14 changes: 8 additions & 6 deletions nimbus-features/onboardingFrameworkFeature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, String>
type: Map<ConditionName, String>
string-alias: ConditionName
default: {}
cards:
description: >
The list of available cards for onboarding.
type: Map<String, NimbusOnboardingCardData>
type: Map<NimbusOnboardingCardKey, NimbusOnboardingCardData>
string-alias: NimbusOnboardingCardKey
default: {}
dismissable:
description: >
Expand Down Expand Up @@ -167,17 +169,17 @@ objects:
popup information
default: null
prerequisites:
type: List<String>
type: List<ConditionName>
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<String>
type: List<ConditionName>
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:
Expand Down

0 comments on commit 464dd51

Please sign in to comment.