Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.
feat: gate access-screen logo behind logoOnAccessForm feature flag
Marc Seitz749f69efee1e
diff --git a/lib/featureFlags/index.ts b/lib/featureFlags/index.tsindex b6ffe19f..cf9de2e5 100644--- a/lib/featureFlags/index.ts+++ b/lib/featureFlags/index.ts@@ -17,7 +17,8 @@ export type BetaFeatures =| "ai"| "sso"| "textSelection"- | "requestList";+ | "requestList"+ | "logoOnAccessForm";type BetaFeaturesRecord = Record<BetaFeatures, string[]>;@@ -40,6 +41,7 @@ export const getFeatureFlags = async ({ teamId }: { teamId?: string }) => {sso: false,textSelection: false,requestList: false,+ logoOnAccessForm: false,};// Return all features as false if edge config is not availablediff --git a/pages/view/[linkId]/d/[documentId].tsx b/pages/view/[linkId]/d/[documentId].tsxindex ec0ff0e2..0c17d33a 100644--- a/pages/view/[linkId]/d/[documentId].tsx+++ b/pages/view/[linkId]/d/[documentId].tsx@@ -291,6 +291,7 @@ export async function getStaticProps(context: GetStaticPropsContext) {// Check feature flagsconst featureFlags = await getFeatureFlags({ teamId: teamId || undefined });const textSelectionEnabled = featureFlags.textSelection;+ const logoOnAccessFormEnabled = featureFlags.logoOnAccessForm;const defaultLanguage =brand && "defaultLanguage" in brand ? brand.defaultLanguage : undefined;@@ -339,7 +340,7 @@ export async function getStaticProps(context: GetStaticPropsContext) {teamId === "cm76hfyvy0002q623hmen99pf" ||teamId === "cm9ztf0s70005js04i689gefn" ||teamId === "cmk2hnmqh0000k304zcoezt6n",- logoOnAccessForm: teamId === "cm7nlkrhm0000qgh0nvyrrywr",+ logoOnAccessForm: logoOnAccessFormEnabled,textSelectionEnabled,...i18nProps,},diff --git a/pages/view/[linkId]/index.tsx b/pages/view/[linkId]/index.tsxindex a15af691..c6a719db 100644--- a/pages/view/[linkId]/index.tsx+++ b/pages/view/[linkId]/index.tsx@@ -204,6 +204,7 @@ export const getStaticProps = async (context: GetStaticPropsContext) => {const featureFlags = await getFeatureFlags({ teamId });const annotationsEnabled = featureFlags.annotations;const textSelectionEnabled = featureFlags.textSelection;+ const logoOnAccessFormEnabled = featureFlags.logoOnAccessForm;return {props: {@@ -241,9 +242,7 @@ export const getStaticProps = async (context: GetStaticPropsContext) => {teamId === "cm76hfyvy0002q623hmen99pf" ||teamId === "cm9ztf0s70005js04i689gefn" ||teamId === "cmk2hnmqh0000k304zcoezt6n",- logoOnAccessForm:- teamId === "cm7nlkrhm0000qgh0nvyrrywr" ||- teamId === "clup33by90000oewh4rfvp2eg",+ logoOnAccessForm: logoOnAccessFormEnabled,annotationsEnabled,textSelectionEnabled,...i18nProps,@@ -285,6 +284,7 @@ export const getStaticProps = async (context: GetStaticPropsContext) => {result.dataroomIndexEnabledForViewer ?? false;const annotationsEnabled = featureFlags.annotations;const textSelectionEnabled = featureFlags.textSelection;+ const logoOnAccessFormEnabled = featureFlags.logoOnAccessForm;const lastUpdatedAt = link.dataroom.documents.reduce((max: number, doc: any) => {@@ -328,9 +328,7 @@ export const getStaticProps = async (context: GetStaticPropsContext) => {teamId === "cm76hfyvy0002q623hmen99pf" ||teamId === "cm9ztf0s70005js04i689gefn" ||teamId === "cmk2hnmqh0000k304zcoezt6n",- logoOnAccessForm:- teamId === "cm7nlkrhm0000qgh0nvyrrywr" ||- teamId === "clup33by90000oewh4rfvp2eg",+ logoOnAccessForm: logoOnAccessFormEnabled,dataroomIndexEnabled,annotationsEnabled,textSelectionEnabled,diff --git a/pages/view/domains/[domain]/[slug]/d/[documentId].tsx b/pages/view/domains/[domain]/[slug]/d/[documentId].tsxindex fd4f399b..d6b14872 100644--- a/pages/view/domains/[domain]/[slug]/d/[documentId].tsx+++ b/pages/view/domains/[domain]/[slug]/d/[documentId].tsx@@ -302,6 +302,7 @@ export async function getStaticProps(context: GetStaticPropsContext) {// Check feature flagsconst featureFlags = await getFeatureFlags({ teamId: teamId || undefined });const textSelectionEnabled = featureFlags.textSelection;+ const logoOnAccessFormEnabled = featureFlags.logoOnAccessForm;const i18nProps = await buildViewerI18nPageProps(brand as any);@@ -344,7 +345,7 @@ export async function getStaticProps(context: GetStaticPropsContext) {teamId === "cm76hfyvy0002q623hmen99pf" ||teamId === "cm9ztf0s70005js04i689gefn" ||teamId === "cmk2hnmqh0000k304zcoezt6n",- logoOnAccessForm: teamId === "cm7nlkrhm0000qgh0nvyrrywr",+ logoOnAccessForm: logoOnAccessFormEnabled,textSelectionEnabled,...i18nProps,},diff --git a/pages/view/domains/[domain]/[slug]/index.tsx b/pages/view/domains/[domain]/[slug]/index.tsxindex fda13007..262ceb41 100644--- a/pages/view/domains/[domain]/[slug]/index.tsx+++ b/pages/view/domains/[domain]/[slug]/index.tsx@@ -177,6 +177,7 @@ export const getStaticProps = async (context: GetStaticPropsContext) => {// Check feature flags for document linksconst docFeatureFlags = await getFeatureFlags({ teamId: teamId || undefined });const textSelectionEnabled = docFeatureFlags.textSelection;+ const logoOnAccessFormEnabled = docFeatureFlags.logoOnAccessForm;return {props: {@@ -213,9 +214,7 @@ export const getStaticProps = async (context: GetStaticPropsContext) => {teamId === "cm76hfyvy0002q623hmen99pf" ||teamId === "cm9ztf0s70005js04i689gefn" ||teamId === "cmk2hnmqh0000k304zcoezt6n",- logoOnAccessForm:- teamId === "cm7nlkrhm0000qgh0nvyrrywr" ||- teamId === "clup33by90000oewh4rfvp2eg",+ logoOnAccessForm: logoOnAccessFormEnabled,textSelectionEnabled,...i18nProps,},@@ -255,6 +254,7 @@ export const getStaticProps = async (context: GetStaticPropsContext) => {const dataroomIndexEnabled =result.dataroomIndexEnabledForViewer ?? false;const textSelectionEnabled = featureFlags.textSelection;+ const logoOnAccessFormEnabled = featureFlags.logoOnAccessForm;const lastUpdatedAt = link.dataroom.documents.reduce((max: number, doc: any) => {@@ -298,9 +298,7 @@ export const getStaticProps = async (context: GetStaticPropsContext) => {teamId === "cm76hfyvy0002q623hmen99pf" ||teamId === "cm9ztf0s70005js04i689gefn" ||teamId === "cmk2hnmqh0000k304zcoezt6n",- logoOnAccessForm:- teamId === "cm7nlkrhm0000qgh0nvyrrywr" ||- teamId === "clup33by90000oewh4rfvp2eg",+ logoOnAccessForm: logoOnAccessFormEnabled,dataroomIndexEnabled,textSelectionEnabled,...i18nProps,