mirror of
https://github.com/documenso/documenso.git
synced 2025-11-10 04:22:32 +10:00
feat: add feature flag
This commit is contained in:
@ -94,6 +94,12 @@ export const DocumentPageViewRecentActivity = ({
|
|||||||
</li>
|
</li>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{documentAuditLogs.length === 0 && (
|
||||||
|
<div className="flex items-center justify-center py-4">
|
||||||
|
<p className="text-muted-foreground/70 text-sm">No recent activity</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
{documentAuditLogs.map((auditLog, auditLogIndex) => (
|
{documentAuditLogs.map((auditLog, auditLogIndex) => (
|
||||||
<li key={auditLog.id} className="relative flex gap-x-4">
|
<li key={auditLog.id} className="relative flex gap-x-4">
|
||||||
<div
|
<div
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import { match } from 'ts-pattern';
|
|||||||
import { DOCUMENSO_ENCRYPTION_KEY } from '@documenso/lib/constants/crypto';
|
import { DOCUMENSO_ENCRYPTION_KEY } from '@documenso/lib/constants/crypto';
|
||||||
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
|
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
|
||||||
import { getDocumentById } from '@documenso/lib/server-only/document/get-document-by-id';
|
import { getDocumentById } from '@documenso/lib/server-only/document/get-document-by-id';
|
||||||
|
import { getServerComponentFlag } from '@documenso/lib/server-only/feature-flags/get-server-component-feature-flag';
|
||||||
import { getRecipientsForDocument } from '@documenso/lib/server-only/recipient/get-recipients-for-document';
|
import { getRecipientsForDocument } from '@documenso/lib/server-only/recipient/get-recipients-for-document';
|
||||||
import { symmetricDecrypt } from '@documenso/lib/universal/crypto';
|
import { symmetricDecrypt } from '@documenso/lib/universal/crypto';
|
||||||
import { formatDocumentsPath } from '@documenso/lib/utils/teams';
|
import { formatDocumentsPath } from '@documenso/lib/utils/teams';
|
||||||
@ -55,6 +56,10 @@ export const DocumentPageView = async ({ params, team }: DocumentPageViewProps)
|
|||||||
teamId: team?.id,
|
teamId: team?.id,
|
||||||
}).catch(() => null);
|
}).catch(() => null);
|
||||||
|
|
||||||
|
const isDocumentHistoryEnabled = await getServerComponentFlag(
|
||||||
|
'app_document_page_view_history_sheet',
|
||||||
|
);
|
||||||
|
|
||||||
if (!document || !document.documentData) {
|
if (!document || !document.documentData) {
|
||||||
redirect(documentRootPath);
|
redirect(documentRootPath);
|
||||||
}
|
}
|
||||||
@ -120,14 +125,16 @@ export const DocumentPageView = async ({ params, team }: DocumentPageViewProps)
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="self-end">
|
{isDocumentHistoryEnabled && (
|
||||||
<DocumentHistorySheet documentId={document.id} userId={user.id}>
|
<div className="self-end">
|
||||||
<Button variant="outline">
|
<DocumentHistorySheet documentId={document.id} userId={user.id}>
|
||||||
<Clock9 className="mr-1.5 h-4 w-4" />
|
<Button variant="outline">
|
||||||
Document history
|
<Clock9 className="mr-1.5 h-4 w-4" />
|
||||||
</Button>
|
Document history
|
||||||
</DocumentHistorySheet>
|
</Button>
|
||||||
</div>
|
</DocumentHistorySheet>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="mt-6 grid w-full grid-cols-12 gap-8">
|
<div className="mt-6 grid w-full grid-cols-12 gap-8">
|
||||||
|
|||||||
@ -18,6 +18,7 @@ export const FEATURE_FLAG_POLL_INTERVAL = 30000;
|
|||||||
export const LOCAL_FEATURE_FLAGS: Record<string, boolean> = {
|
export const LOCAL_FEATURE_FLAGS: Record<string, boolean> = {
|
||||||
app_billing: process.env.NEXT_PUBLIC_FEATURE_BILLING_ENABLED === 'true',
|
app_billing: process.env.NEXT_PUBLIC_FEATURE_BILLING_ENABLED === 'true',
|
||||||
app_teams: true,
|
app_teams: true,
|
||||||
|
app_document_page_view_history_sheet: false,
|
||||||
marketing_header_single_player_mode: false,
|
marketing_header_single_player_mode: false,
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user