chore: add database-backed feature flag for sidebar tips section (#26516)
* chore: remove tips section from sidebar Co-Authored-By: amit@cal.com <samit91848@gmail.com> * chore: add feature flag for sidebar tips section Co-Authored-By: amit@cal.com <samit91848@gmail.com> * chore: use database-backed feature flag for sidebar tips section Co-Authored-By: amit@cal.com <samit91848@gmail.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
parent
2b7c087ac8
commit
a12ab5bb65
@@ -5,6 +5,7 @@ import Link from "next/link";
|
||||
import { usePathname } from "next/navigation";
|
||||
|
||||
import { getBookerBaseUrlSync } from "@calcom/features/ee/organizations/lib/getBookerBaseUrlSync";
|
||||
import { useFlagMap } from "@calcom/features/flags/context/provider";
|
||||
import { IS_VISUAL_REGRESSION_TESTING, ENABLE_PROFILE_SWITCHER } from "@calcom/lib/constants";
|
||||
import { getPlaceholderAvatar } from "@calcom/lib/defaultAvatarImage";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
@@ -56,6 +57,7 @@ export function SideBar({ bannersHeight, user }: SideBarProps) {
|
||||
const pathname = usePathname();
|
||||
const isPlatformPages = pathname?.startsWith("/settings/platform");
|
||||
const isAdmin = session.data?.user.role === UserPermissionRole.ADMIN;
|
||||
const flags = useFlagMap();
|
||||
|
||||
const publicPageUrl = `${getBookerBaseUrlSync(user?.org?.slug ?? null)}/${user?.orgAwareUsername}`;
|
||||
|
||||
@@ -137,9 +139,11 @@ export function SideBar({ bannersHeight, user }: SideBarProps) {
|
||||
|
||||
{!isPlatformPages && (
|
||||
<div className="md:px-2 md:pb-4 lg:p-0">
|
||||
<div className="overflow-hidden">
|
||||
<Tips />
|
||||
</div>
|
||||
{flags["sidebar-tips"] && (
|
||||
<div className="overflow-hidden">
|
||||
<Tips />
|
||||
</div>
|
||||
)}
|
||||
{bottomNavItems.map((item, index) => (
|
||||
<Tooltip side="right" content={t(item.name)} className="lg:hidden" key={item.name}>
|
||||
<ButtonOrLink
|
||||
|
||||
@@ -34,6 +34,7 @@ export type AppFlags = {
|
||||
"booking-email-sms-tasker": boolean;
|
||||
"bookings-v3": boolean;
|
||||
"booking-audit": boolean;
|
||||
"sidebar-tips": boolean;
|
||||
};
|
||||
|
||||
export type TeamFeatures = Record<keyof AppFlags, boolean>;
|
||||
|
||||
@@ -33,6 +33,7 @@ const initialData: AppFlags = {
|
||||
"booking-email-sms-tasker": false,
|
||||
"bookings-v3": false,
|
||||
"booking-audit": false,
|
||||
"sidebar-tips": false,
|
||||
};
|
||||
|
||||
if (process.env.NEXT_PUBLIC_IS_E2E) {
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
INSERT INTO "Feature" (slug, enabled, description, "type")
|
||||
VALUES ('sidebar-tips', false, 'Enables the tips section in the sidebar.', 'OPERATIONAL')
|
||||
ON CONFLICT (slug) DO NOTHING;
|
||||
Reference in New Issue
Block a user