From ac547568140ca8bc96075639ad1db6f262c4f0dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Poizat?= Date: Tue, 7 Nov 2023 17:13:34 +0100 Subject: [PATCH 1/2] feat: Display coachco2 call to action on web too --- .../AppHighlightAlert/GeolocationTrackingAppHighlightAlert.jsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/AppHighlightAlert/GeolocationTrackingAppHighlightAlert.jsx b/src/components/AppHighlightAlert/GeolocationTrackingAppHighlightAlert.jsx index 0e90815276..0efb1a4f46 100644 --- a/src/components/AppHighlightAlert/GeolocationTrackingAppHighlightAlert.jsx +++ b/src/components/AppHighlightAlert/GeolocationTrackingAppHighlightAlert.jsx @@ -1,7 +1,6 @@ import React, { useState } from 'react' import flag from 'cozy-flags' -import { isFlagshipApp } from 'cozy-device-helper' import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n' import AppHighlightAlert from 'components/AppHighlightAlert/AppHighlightAlert' @@ -15,7 +14,6 @@ const isAvailable = () => { const bikegoalSettings = flag('coachco2.bikegoal.settings') return ( - isFlagshipApp() && flag('home.push.coachco2.opencount') && flag('home.push.coachco2.opencount') >= 0 && (!bikegoalSettings || From 19de1c87af74b4780c41dbcf33bdcd178f0bbb8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Poizat?= Date: Tue, 7 Nov 2023 17:16:09 +0100 Subject: [PATCH 2/2] feat: Rename field in coachco2 call to action flag --- .../GeolocationTrackingAppHighlightAlert.jsx | 13 +++++++------ src/locales/en.json | 4 ++-- src/locales/fr.json | 4 ++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/components/AppHighlightAlert/GeolocationTrackingAppHighlightAlert.jsx b/src/components/AppHighlightAlert/GeolocationTrackingAppHighlightAlert.jsx index 0efb1a4f46..604e5c8398 100644 --- a/src/components/AppHighlightAlert/GeolocationTrackingAppHighlightAlert.jsx +++ b/src/components/AppHighlightAlert/GeolocationTrackingAppHighlightAlert.jsx @@ -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'))) ) } @@ -65,13 +66,13 @@ 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 { @@ -79,7 +80,7 @@ const getAlertDescription = t => { 'appHighlightAlert.geolocationTracking.bikegoalSourceDefaultDescription', { sourceType: bikegoalSettings.sourceType, - sourceIdentity: bikegoalSettings.sourceIdentity + sourceName: bikegoalSettings.sourceName } ) } diff --git a/src/locales/en.json b/src/locales/en.json index 23bf7a1dc0..758ece1c48 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -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!" } } } diff --git a/src/locales/fr.json b/src/locales/fr.json index 51c8acb523..0ab003d168 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -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 !" } } }