Skip to content

Commit

Permalink
Merge branch 'main' into dark-mode-ios
Browse files Browse the repository at this point in the history
  • Loading branch information
codemist authored Oct 29, 2024
2 parents 26fc5b3 + 11a8025 commit 90938d2
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 31 deletions.
2 changes: 1 addition & 1 deletion locales/el/app.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ error-page-error-other-title = { $errorCode }: Κάτι πήγε στραβά
## Breach overview page

all-breaches-headline-3 = Βάση δεδομένων παραβίασης δεδομένων
all-breaches-headline-3 = Βάση δεδομένων παραβιάσεων
all-breaches-lead = Παρακολουθούμε όλες τις γνωστές παραβιάσεις δεδομένων για να διαπιστώσουμε εάν τα προσωπικά σας στοιχεία παραβιάστηκαν. Ακολουθεί μια πλήρης λίστα με όλες τις παραβιάσεις που έχουν αναφερθεί από το 2007.
search-breaches = Αναζήτηση παραβιάσεων
# the kind of user data exposed to hackers in data breach.
Expand Down
2 changes: 1 addition & 1 deletion locales/el/breaches.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

breach-all-meta-page-title = Βάση δεδομένων παραβίασης δεδομένων{ -brand-fx-monitor }
breach-all-meta-page-title = Βάση δεδομένων παραβιάσεων{ -brand-fx-monitor }
breach-all-meta-social-title = Όλες οι παραβιάσεις που εντοπίστηκαν από το { -brand-fx-monitor }
breach-all-meta-social-description = Περιηγηθείτε στην πλήρη λίστα των γνωστών παραβιάσεων που εντοπίστηκαν από το { -brand-fx-monitor } και μάθετε εάν αποκαλύφθηκαν οι πληροφορίες σας.
# Variables:
Expand Down
2 changes: 1 addition & 1 deletion locales/gn/app.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ error-page-error-other-title = { $errorCode } Oĩ osẽvaíva
## Breach overview page

all-breaches-headline-2 = Opaite ñembogua ohecháva { -brand-fx-monitor }
all-breaches-headline-3 = Mba’ekuaarã rupa ñembogua rehegua
all-breaches-lead = Rohechapaite umi mba’ekuaarã ñembogua roikuaa hag̃ua ne maranduetépa oñembyaikuaára’e. Ko’ápe oĩ peteĩ tysýi opaite ñembogua oñemomaranduva’ekue rehegua ary 2007 guive.
search-breaches = Ñembyai jeheka
# the kind of user data exposed to hackers in data breach.
Expand Down
14 changes: 4 additions & 10 deletions locales/gn/breaches.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,17 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

breach-all-meta-title = { -brand-fx-monitor } - Opaite mba’ekuaarã ñembogua
breach-all-meta-page-title = Mba’ekuaarã rupa ñembogua rehegua — { -brand-fx-monitor }
breach-all-meta-social-title = Opaite ñembogua ohecháva { -brand-fx-monitor }
breach-all-meta-social-description = Ehapykueho { -brand-fx-monitor } ñemboguakuaa rysýi ojehechakuaáva, upéi ehecha ne marandúpa oñemboguakuaápara’e.
# Variables:
# $company (String) - Name of the company that was breached, e.g. "PHP Freaks"
breach-detail-meta-page-title = Mba’ekuaarã rupa ñembogua { $company }{ -brand-fx-monitor } rehegua
# Variables:
# $company (String) - Name of the company that was breached, e.g. "PHP Freaks"
breach-detail-meta-social-title = ¿Ne myangekói { $company } mba’ekuaarã ñembogua?
breach-detail-meta-social-description = Eiporu { -brand-fx-monitor } eikuaa hag̃ua ne maranduetépa oñemboguakuaára’e ha péicha rupi eikuaa mba’etépa ejapóta.
## Breaches header

## Breaches resolved filter

## Breaches table

## Links that we might refer to when prompting the user to make changes after a breach

breach-checklist-link-firefox-relay = { -brand-relay }
Expand All @@ -26,7 +22,6 @@ breach-checklist-link-mozilla-vpn = { -brand-mozilla-vpn }
## Prompts the user for changes when there is a breach detected of password

breach-checklist-pw-header-text = Embohekopyahu ñe’ẽñemi ha embojuruja mokõi papapyñemi (2FA).
# The `breached-company-link` tags will be replaced with link tags or stripped if no link is available.
# Variables:
# $passwordManagerLink (string) - a link to the password manager documentation, with { -breach-checklist-link-password-manager } as the label
Expand Down Expand Up @@ -95,7 +90,6 @@ breach-checklist-phone-header-2 = Emo’ã ne pumbyry papapy mba’eporu rovamo
## Prompts the user for changes when there is a breach detected of security questions

breach-checklist-sq-header-text = Embopyahu porandu tekorosãgua.
# The `breached-company-link` tags will be replaced with link tags or stripped if no link is available.
breach-checklist-sq-body-text = Hetavejey, ro’e ndéve embohekopyahu hag̃ua porandu tekorosãgua mba’apohaguasu ñanduti rendápe. Hákatu <b>iñanduti renda hekopytakuaa térã oreko tetepy ivaikuaáva</b>, upévare ema’ẽke <breached-company-link>rendápe jeike</breached-company-link>. Eñemo’ãve hag̃ua, embohekopyahu ko’ã porandu tekorosãgua oimeraẽva mba’ete eiporuvéva peteĩva hendápe, ha emoheñói ñe’ẽñemi oiko ha iñambuéva peteĩteĩva ñe’ẽñemíme.
Expand Down
17 changes: 7 additions & 10 deletions src/emails/components/EmailDataPointCount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { DashboardSummary } from "../../app/functions/server/dashboard";
import { getSignupLocaleCountry } from "../functions/getSignupLocaleCountry";
import { isEligibleForPremium } from "../../app/functions/universal/premium";
import { SanitizedSubscriberRow } from "../../app/functions/server/sanitize";
import { sumSanitizedDataPoints } from "../functions/reduceSanitizedDataPoints";

type Props = {
l10n: ExtendedReactLocalization;
Expand All @@ -24,14 +25,6 @@ export const DataPointCount = (props: Props) => {
const assumedCountryCode = getSignupLocaleCountry(props.subscriber);
const unresolvedDataBreaches = props.dataSummary.dataBreachUnresolvedNum;

const sumOfUnresolvedDataPoints =
props.dataSummary.unresolvedSanitizedDataPoints.reduce(
(total, dataPointSummary) => {
return total + Object.values(dataPointSummary)[0];
},
0,
);

const hasRunFreeScan = typeof props.subscriber.onerep_profile_id === "number";
const utmContentSuffix = isEligibleForPremium(assumedCountryCode)
? "-us"
Expand Down Expand Up @@ -73,7 +66,9 @@ export const DataPointCount = (props: Props) => {
line-height="68px"
>
{hasRunFreeScan
? sumOfUnresolvedDataPoints
? sumSanitizedDataPoints(
props.dataSummary.unresolvedSanitizedDataPoints,
)
: unresolvedDataBreaches}
</mj-text>
<mj-text
Expand All @@ -89,7 +84,9 @@ export const DataPointCount = (props: Props) => {
: "email-monthly-report-no-scan-results-data-points-label",
{
data_point_count: hasRunFreeScan
? sumOfUnresolvedDataPoints
? sumSanitizedDataPoints(
props.dataSummary.unresolvedSanitizedDataPoints,
)
: unresolvedDataBreaches,
},
)}
Expand Down
13 changes: 13 additions & 0 deletions src/emails/functions/reduceSanitizedDataPoints.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// data is inteferred from the SanitizedDataPoints type, but we ran into inference issues directly importing it
export function sumSanitizedDataPoints(
data: Array<Record<string, number>>,
): number {
return data.reduce((accumulatedValue, currentDataPoint) => {
const dataPointValue = Object.values(currentDataPoint)[0];
return accumulatedValue + dataPointValue;
}, 0);
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { isEligibleForPremium } from "../../../app/functions/universal/premium";
import { getSignupLocaleCountry } from "../../functions/getSignupLocaleCountry";
import { HeaderStyles, MetaTags } from "../HeaderStyles";
import { SanitizedSubscriberRow } from "../../../app/functions/server/sanitize";
import { sumSanitizedDataPoints } from "../../functions/reduceSanitizedDataPoints";

export type MonthlyActivityFreeEmailProps = {
l10n: ExtendedReactLocalization;
Expand Down Expand Up @@ -78,19 +79,15 @@ export const MonthlyActivityFreeEmail = (
// Show a sum of resolved data breach & broker exposures if a scan has been run
// Otherwise, only show resolved data breaches
dataPointValue: hasRunFreeScan
? props.dataSummary.fixedSanitizedDataPoints.reduce(
(total, dataPointSummary) => {
return total + Object.values(dataPointSummary)[0];
},
0,
)
? sumSanitizedDataPoints(props.dataSummary.fixedSanitizedDataPoints)
: props.dataSummary.dataBreachResolvedNum,
// The resolved box would be active if
// a user has run a free scan and they have resolved data breaches, and or brokers (count number of resolved data points)
// if a user hasn't run a free scan but they have resolved data breaches (count number of resolved breach cards)
activeState:
(hasRunFreeScan &&
props.dataSummary.fixedSanitizedDataPoints.length > 0) ||
sumSanitizedDataPoints(props.dataSummary.fixedSanitizedDataPoints) >
0) ||
(!hasRunFreeScan && props.dataSummary.dataBreachResolvedNum > 0),
};

Expand All @@ -101,7 +98,9 @@ export const MonthlyActivityFreeEmail = (
preScan: !hasRunFreeScan && props.dataSummary.dataBreachUnresolvedNum === 0,
postScan:
hasRunFreeScan &&
props.dataSummary.unresolvedSanitizedDataPoints.length === 0,
sumSanitizedDataPoints(
props.dataSummary.unresolvedSanitizedDataPoints,
) === 0,
};

return (
Expand Down

0 comments on commit 90938d2

Please sign in to comment.