Skip to content

Commit

Permalink
House survey (#12402)
Browse files Browse the repository at this point in the history
* chore(survey): add house survey

* add prod dates
  • Loading branch information
fiji-flo authored Jan 7, 2025
1 parent 1189820 commit 8393ad1
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/prod-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,14 @@ jobs:
REACT_APP_MDN_PLUS_10Y_PLAN: price_1KeG02JNcmPzuWtRlrSiLTI6

# Surveys.
REACT_APP_SURVEY_START_HOMEPAGE_FEEDBACK_2024: 1731369600000 # new Date("2024-11-12Z").getTime()
REACT_APP_SURVEY_END_HOMEPAGE_FEEDBACK_2024: 1733616000000 # new Date("2024-12-08Z").getTime()
REACT_APP_SURVEY_RATE_FROM_HOMEPAGE_FEEDBACK_2024: 0.0
REACT_APP_SURVEY_RATE_TILL_HOMEPAGE_FEEDBACK_2024: 1 # 100%
REACT_APP_SURVEY_START_WEBDX_EDITING_2024: 1731628800000 # new Date("2024-11-15Z").getTime()
REACT_APP_SURVEY_END_WEBDX_EDITING_2024: 1732320000000 # new Date("2024-11-23Z").getTime()
REACT_APP_SURVEY_RATE_FROM_WEBDX_EDITING_2024: 0.0
REACT_APP_SURVEY_RATE_TILL_WEBDX_EDITING_2024: 0.1 # 10%
REACT_APP_SURVEY_START_HOUSE_SURVEY_2025: 1736208000000 # new Date("2025-01-07Z").getTime()
REACT_APP_SURVEY_END_HOUSE_SURVEY_2025: 1736899200000 # new Date("2025-01-15Z").getTime()
REACT_APP_SURVEY_RATE_FROM_HOUSE_SURVEY_2025: 0.0
REACT_APP_SURVEY_RATE_TILL_HOUSE_SURVEY_2025: 0.05 # 5%

# Telemetry.
REACT_APP_GLEAN_CHANNEL: prod
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/stage-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@ jobs:
REACT_APP_SURVEY_END_WEB_APP_AUGUST_2024: 1723593600000 # new Date("2024-08-14Z").getTime()
REACT_APP_SURVEY_RATE_FROM_WEB_APP_AUGUST_2024: 0.0
REACT_APP_SURVEY_RATE_TILL_WEB_APP_AUGUST_2024: 0.05 # 5%
REACT_APP_SURVEY_START_HOUSE_SURVEY_2025: 0 # stage
REACT_APP_SURVEY_END_HOUSE_SURVEY_2025: 1736899200000 # new Date("2025-01-15Z").getTime()
REACT_APP_SURVEY_RATE_FROM_HOUSE_SURVEY_2025: 0.0
REACT_APP_SURVEY_RATE_TILL_HOUSE_SURVEY_2025: 0.05 # 5%

# Telemetry.
REACT_APP_GLEAN_CHANNEL: stage
Expand Down
4 changes: 0 additions & 4 deletions client/src/homepage/homepage-hero/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@ import { Search } from "../../ui/molecules/search";
import Mandala from "../../ui/molecules/mandala";
import { useLocale } from "../../hooks";
import { HOMEPAGE_HERO } from "../../telemetry/constants";
import { DocumentSurvey } from "../../ui/molecules/document-survey";
import { useLocation } from "react-router";

export function HomepageHero() {
const { pathname } = useLocation();
const locale = useLocale();
return (
<div className="homepage-hero dark">
<section>
<DocumentSurvey doc={{ mdn_url: pathname }} />
<h1>
Resources for <u>Developers</u>,
<br /> by Developers
Expand Down
22 changes: 14 additions & 8 deletions client/src/ui/molecules/document-survey/surveys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ enum SurveyBucket {
WEB_APP_AUGUST_2024 = "WEB_APP_AUGUST_2024",
HOMEPAGE_FEEDBACK_2024 = "HOMEPAGE_FEEDBACK_2024",
WEBDX_EDITING_2024 = "WEBDX_EDITING_2024",
HOUSE_SURVEY_2025 = "HOUSE_SURVEY_2025",
}

enum SurveyKey {
Expand All @@ -54,6 +55,7 @@ enum SurveyKey {
WEB_APP_AUGUST_2024 = "WEB_APP_AUGUST_2024",
HOMEPAGE_FEEDBACK_2024 = "HOMEPAGE_FEEDBACK_2024",
WEBDX_EDITING_2024 = "WEBDX_EDITING_2024",
HOUSE_SURVEY_2025 = "HOUSE_SURVEY_2025",
}

// When adding a survey, make sure it has this JavaScript action (in Alchemer)
Expand Down Expand Up @@ -93,14 +95,18 @@ export const SURVEYS: Survey[] = [
end: Infinity,
},
{
key: SurveyKey.HOMEPAGE_FEEDBACK_2024,
bucket: SurveyBucket.HOMEPAGE_FEEDBACK_2024,
show: (doc: Pick<Doc, "mdn_url">) => /^\/[^/]+\/$/i.test(doc.mdn_url),
src: "https://survey.alchemer.com/s3/8075407/MDN-Homepage-Improvements",
teaser: "We are refreshing our homepage and would love",
question: "your input",
...survey_duration(SurveyBucket.HOMEPAGE_FEEDBACK_2024),
...survey_rates(SurveyKey.HOMEPAGE_FEEDBACK_2024),
key: SurveyKey.HOUSE_SURVEY_2025,
bucket: SurveyBucket.HOUSE_SURVEY_2025,
show: (doc: Pick<Doc, "mdn_url">) =>
/^\/[^/]+\/docs\/(Web|Learn_web_development)($|\/.*$)|/i.test(
doc.mdn_url
),
src: "https://survey.alchemer.com/s3/8145183/MDN-short-survey",
teaser:
"We'd love to hear more about your role and the company you work for",
question: "Please help us by answering a few questions.",
...survey_duration(SurveyBucket.HOUSE_SURVEY_2025),
...survey_rates(SurveyKey.HOUSE_SURVEY_2025),
},
{
key: SurveyKey.WEBDX_EDITING_2024,
Expand Down

0 comments on commit 8393ad1

Please sign in to comment.