Skip to content

Commit 86d6795

Browse files
committed
Disable monthly report toggle for free users
They won't get this email for now, so they don't need to turn them off either.
1 parent a618cca commit 86d6795

File tree

3 files changed

+53
-26
lines changed

3 files changed

+53
-26
lines changed

src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/settings/SettingsPage.test.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2147,7 +2147,7 @@ describe("Settings page", () => {
21472147
);
21482148
});
21492149

2150-
it("checks that monthly monitor report is available to free users", () => {
2150+
it("checks that the monthly monitor report is disabled for free users", () => {
21512151
render(
21522152
<SettingsWrapper>
21532153
<SettingsView
@@ -2179,11 +2179,13 @@ describe("Settings page", () => {
21792179
</SettingsWrapper>,
21802180
);
21812181

2182-
const monthlyMonitorReportBtn = screen.getByLabelText(
2182+
const monthlyMonitorReportBtn = screen.queryByLabelText(
21832183
"Monthly ⁨Monitor⁩ report",
21842184
{ exact: false },
21852185
);
2186-
expect(monthlyMonitorReportBtn).toHaveAttribute("aria-checked", "true");
2186+
// The monthly email for free users is currently disabled; see MNTOR-4970.
2187+
// expect(monthlyMonitorReportBtn).toHaveAttribute("aria-checked", "true");
2188+
expect(monthlyMonitorReportBtn).not.toBeInTheDocument();
21872189
});
21882190

21892191
it("checks that monthly monitor report is enabled", () => {

src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/settings/panels/SettingsPanelNotifications.tsx

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ import { SwitchInput } from "../../../../../../../components/client/SwitchInput"
2121
import { RadioInput } from "../../../../../../../components/client/RadioInput";
2222
import { CONST_URL_MOZILLA_BASKET } from "../../../../../../../../constants";
2323

24+
// The monthly email for free users is currently disabled; see MNTOR-4970.
25+
const isFreeMonthlyMonitorReportDisabledSeeMNTOR4970 = true;
26+
2427
export type SettingsPanelNotificationsProps = {
2528
data?: SubscriberEmailPreferencesOutput;
2629
subscriber: SubscriberRow;
@@ -170,30 +173,36 @@ export const NotificationsSettings = (props: NotificationSettingsProps) => {
170173
</RadioInput>
171174
</span>
172175
)}
173-
<hr />
176+
{(hasPremium(props.user) ||
177+
!isFreeMonthlyMonitorReportDisabledSeeMNTOR4970) && <hr />}
174178
</AlertAddressContext.Provider>
175-
<SwitchInput
176-
className={styles.switchInput}
177-
isSelected={activateMonthlyMonitorReport}
178-
onChange={handleMonthlyMonitorReportToggle}
179-
>
180-
<div>
181-
<h4>
182-
{hasPremium(props.user)
183-
? l10n.getString(
184-
"settings-alert-preferences-allow-monthly-monitor-plus-report-title",
185-
)
186-
: l10n.getString(
187-
"settings-alert-preferences-allow-monthly-monitor-report-title",
188-
)}
189-
</h4>
190-
<p>
191-
{l10n.getString(
192-
"settings-alert-preferences-allow-monthly-monitor-report-subtitle",
193-
)}
194-
</p>
195-
</div>
196-
</SwitchInput>
179+
{(hasPremium(props.user) ||
180+
!isFreeMonthlyMonitorReportDisabledSeeMNTOR4970) && (
181+
<SwitchInput
182+
className={styles.switchInput}
183+
isSelected={activateMonthlyMonitorReport}
184+
onChange={handleMonthlyMonitorReportToggle}
185+
>
186+
<div>
187+
<h4>
188+
{hasPremium(props.user)
189+
? // The monthly email for free users is currently disabled; see MNTOR-4970.
190+
/* c8 ignore next 6 */
191+
l10n.getString(
192+
"settings-alert-preferences-allow-monthly-monitor-plus-report-title",
193+
)
194+
: l10n.getString(
195+
"settings-alert-preferences-allow-monthly-monitor-report-title",
196+
)}
197+
</h4>
198+
<p>
199+
{l10n.getString(
200+
"settings-alert-preferences-allow-monthly-monitor-report-subtitle",
201+
)}
202+
</p>
203+
</div>
204+
</SwitchInput>
205+
)}
197206
</div>
198207
</section>
199208
);

src/scripts/cronjobs/monthlyActivityFree.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5+
/*
6+
* Heads-up: this cron job is currently not running. (See MNTOR-4970.)
7+
*
8+
*
9+
*
10+
*
11+
*
12+
*
13+
*
14+
*
15+
*
16+
*
17+
*
18+
*
19+
*/
20+
521
import { FeatureFlagViewRow, SubscriberRow } from "knex/types/tables";
622
import { getFreeSubscribersWaitingForMonthlyEmail } from "../../db/tables/subscribers";
723
import { getScanResultsWithBroker } from "../../db/tables/onerep_scans";

0 commit comments

Comments
 (0)