Skip to content

Commit

Permalink
feat: Rename field in coachco2 call to action flag
Browse files Browse the repository at this point in the history
  • Loading branch information
zatteo committed Nov 7, 2023
1 parent ac54756 commit 19de1c8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ const isAvailable = () => {
flag('home.push.coachco2.opencount') &&
flag('home.push.coachco2.opencount') >= 0 &&
(!bikegoalSettings ||
bikegoalSettings.sourceId === null ||
(bikegoalSettings.sourceId !== null && flag('coachco2.bikegoal.enabled')))
bikegoalSettings.sourceOffer === null ||
(bikegoalSettings.sourceOffer !== null &&
flag('coachco2.bikegoal.enabled')))
)
}

Expand Down Expand Up @@ -65,21 +66,21 @@ const onDisplayed = () => {
const getAlertDescription = t => {
const bikegoalSettings = flag('coachco2.bikegoal.settings')

if (bikegoalSettings?.sourceId) {
if (bikegoalSettings.sourceId === 'employer') {
if (bikegoalSettings?.sourceOffer) {
if (bikegoalSettings.sourceOffer === 'employer') {
return t(
'appHighlightAlert.geolocationTracking.bikegoalSourceEmployerDescription',
{
sourceType: bikegoalSettings.sourceType,
sourceIdentity: bikegoalSettings.sourceIdentity
sourceName: bikegoalSettings.sourceName
}
)
} else {
return t(
'appHighlightAlert.geolocationTracking.bikegoalSourceDefaultDescription',
{
sourceType: bikegoalSettings.sourceType,
sourceIdentity: bikegoalSettings.sourceIdentity
sourceName: bikegoalSettings.sourceName
}
)
}
Expand Down
4 changes: 2 additions & 2 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -590,8 +590,8 @@
"appHighlightAlert": {
"geolocationTracking": {
"defaultDescription": "Track your travel and carbon footprint with the CO2 Coach",
"bikegoalSourceEmployerDescription": "Your %{sourceType} %{sourceIdentity} invites you to take part in improving the area and benefit from the \"prime vélo\", this application will help you measure its progress, and much more!",
"bikegoalSourceDefaultDescription": "Your %{sourceType} %{sourceIdentity} invites you to play your part in improving the region. Save and analyse your journeys!"
"bikegoalSourceEmployerDescription": "Your %{sourceType} %{sourceName} invites you to take part in improving the area and benefit from the \"prime vélo\", this application will help you measure its progress, and much more!",
"bikegoalSourceDefaultDescription": "Your %{sourceType} %{sourceName} invites you to play your part in improving the region. Save and analyse your journeys!"
}
}
}
4 changes: 2 additions & 2 deletions src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -590,8 +590,8 @@
"appHighlightAlert": {
"geolocationTracking": {
"defaultDescription": "Suivez vos déplacements et votre empreinte carbone avec le Coach CO2",
"bikegoalSourceEmployerDescription": "Votre %{sourceType} %{sourceIdentity} vous invite à participer à l’amélioration du territoire et bénéficier de la \"prime vélo\", cette application vous aidera à mesurer son avancement, et bien plus !",
"bikegoalSourceDefaultDescription": "Votre %{sourceType} %{sourceIdentity} vous invite à participer à l'amélioration du territoire, mémorisez et analysez vos déplacements !"
"bikegoalSourceEmployerDescription": "Votre %{sourceType} %{sourceName} vous invite à participer à l’amélioration du territoire et bénéficier de la \"prime vélo\", cette application vous aidera à mesurer son avancement, et bien plus !",
"bikegoalSourceDefaultDescription": "Votre %{sourceType} %{sourceName} vous invite à participer à l'amélioration du territoire, mémorisez et analysez vos déplacements !"
}
}
}

0 comments on commit 19de1c8

Please sign in to comment.