Skip to content

Commit db9b42e

Browse files
committed
Remove MultiDimDataPage feature flag
1 parent 04a5f0f commit db9b42e

File tree

3 files changed

+14
-23
lines changed

3 files changed

+14
-23
lines changed

adminSiteServer/apiRoutes/mdims.ts

+1-8
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ import {
88
multiDimDataPageExists,
99
} from "../../db/model/MultiDimDataPage.js"
1010
import { expectInt, isValidSlug } from "../../serverUtils/serverUtil.js"
11-
import {
12-
FEATURE_FLAGS,
13-
FeatureFlagFeature,
14-
} from "../../settings/clientSettings.js"
1511
import {
1612
upsertMultiDimConfig,
1713
setMultiDimPublished,
@@ -71,10 +67,7 @@ export async function handlePutMultiDim(
7167
const rawConfig = req.body as MultiDimDataPageConfigRaw
7268
const id = await upsertMultiDimConfig(trx, slug, rawConfig)
7369

74-
if (
75-
FEATURE_FLAGS.has(FeatureFlagFeature.MultiDimDataPage) &&
76-
(await multiDimDataPageExists(trx, { slug, published: true }))
77-
) {
70+
if (await multiDimDataPageExists(trx, { slug, published: true })) {
7871
await triggerStaticBuild(
7972
res.locals.user,
8073
`Publishing multidimensional chart ${slug}`

baker/SiteBaker.tsx

-7
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ import { getAllImages } from "../db/model/Image.js"
8383
import { generateEmbedSnippet } from "../site/viteUtils.js"
8484
import { logErrorAndMaybeCaptureInSentry } from "../serverUtils/errorLog.js"
8585
import { mapSlugsToConfigs } from "../db/model/Chart.js"
86-
import { FeatureFlagFeature } from "../settings/clientSettings.js"
8786
import pMap from "p-map"
8887
import { GdocDataInsight } from "../db/model/Gdoc/GdocDataInsight.js"
8988
import { calculateDataInsightIndexPageCount } from "../db/model/Gdoc/gdocUtils.js"
@@ -810,12 +809,6 @@ export class SiteBaker {
810809

811810
private async bakeMultiDimPages(knex: db.KnexReadonlyTransaction) {
812811
if (!this.bakeSteps.has("multiDimPages")) return
813-
if (!FEATURE_FLAGS.has(FeatureFlagFeature.MultiDimDataPage)) {
814-
console.log(
815-
"Skipping baking multi-dim pages because feature flag is not set"
816-
)
817-
return
818-
}
819812
const { imageMetadata } = await this.getPrefetchedGdocAttachments(knex)
820813
await bakeAllMultiDimDataPages(knex, this.bakedSiteDir, imageMetadata)
821814

settings/clientSettings.ts

+13-8
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,21 @@ export const GDOCS_DETAILS_ON_DEMAND_ID: string =
102102

103103
export const PUBLISHED_AT_FORMAT = "ddd, MMM D, YYYY HH:mm"
104104

105-
// Feature flags: FEATURE_FLAGS is a comma-separated list of flags, and they need to be part of this enum to be considered
106-
export enum FeatureFlagFeature {
107-
MultiDimDataPage = "MultiDimDataPage",
108-
}
105+
/** A map of possible features which can be enabled or disabled. */
106+
const Features = {
107+
ExampleFeature: "ExampleFeature",
108+
} as const
109+
110+
type Feature = (typeof Features)[keyof typeof Features]
111+
112+
// process.env.FEATURE_FLAGS is a comma-separated list of flags, and they need
113+
// to be a valid value in the Features object to be considered.
109114
const featureFlagsRaw =
110115
(typeof process.env.FEATURE_FLAGS === "string" &&
111116
process.env.FEATURE_FLAGS.trim()?.split(",")) ||
112117
[]
113-
export const FEATURE_FLAGS: Set<FeatureFlagFeature> = new Set(
114-
Object.keys(FeatureFlagFeature).filter((key) =>
115-
featureFlagsRaw.includes(key)
116-
) as FeatureFlagFeature[]
118+
export const FEATURE_FLAGS: Set<Feature> = new Set(
119+
Object.values(Features).filter((feature) =>
120+
featureFlagsRaw.includes(feature)
121+
)
117122
)

0 commit comments

Comments
 (0)