Skip to content

Commit

Permalink
fix(web): Always show the BridgeURL widget
Browse files Browse the repository at this point in the history
Before this fix, the widget was hidden if the user did not set or cleared the Bridge URL. The same feature flag controlled the top level back button for the workflow page.
  • Loading branch information
SokratisVidros committed Oct 7, 2024
1 parent d8d5274 commit 31e20be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
10 changes: 4 additions & 6 deletions apps/web/src/components/layout/components/v2/HeaderNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,14 @@ import { NotificationCenterWidget } from '../NotificationCenterWidget';
import { HeaderMenuItems } from './HeaderMenuItems';
import { UserProfileButton } from '../../../../ee/clerk';
import { BridgeMenuItems } from './BridgeMenuItems';
import { useStudioState } from '../../../../studio/StudioStateProvider';
import { WorkflowHeaderBackButton } from './WorkflowHeaderBackButton';

export function HeaderNav() {
const { currentUser } = useAuth();
const { bridgeURL } = useStudioState();

const isSelfHosted = IS_SELF_HOSTED;
const isV2Enabled = useFeatureFlag(FeatureFlagsKeysEnum.IS_V2_ENABLED);

const shouldShowNewNovuExperience = isV2Enabled && bridgeURL;

useBootIntercom();

const { Icon, themeLabel, toggleColorScheme } = useThemeChange();
Expand All @@ -43,9 +39,11 @@ export function HeaderNav() {
>
{/* TODO: Change position: right to space-between for breadcrumbs */}
<HStack justifyContent="space-between" width="full" display="flex">
<HStack gap="100">{shouldShowNewNovuExperience && <WorkflowHeaderBackButton />}</HStack>
<HStack gap="100">
<WorkflowHeaderBackButton />
</HStack>
<HStack flexWrap={'nowrap'} justifyContent="flex-end" gap={'100'}>
{shouldShowNewNovuExperience && <BridgeMenuItems />}
{isV2Enabled && <BridgeMenuItems />}
<ActionIcon variant="transparent" onClick={() => toggleColorScheme()}>
<Tooltip label={themeLabel}>
<div>
Expand Down
5 changes: 2 additions & 3 deletions apps/web/src/ee/clerk/components/QuestionnaireForm.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, useState } from 'react';
import { useState } from 'react';
import { useLocation, useNavigate, useSearchParams } from 'react-router-dom';
import { Controller, useForm } from 'react-hook-form';
import { useMutation } from '@tanstack/react-query';
Expand All @@ -16,7 +16,7 @@ import { Button, inputStyles, Select } from '@novu/design-system';
import styled from '@emotion/styled/macro';
import { api } from '../../../api/api.client';
import { useAuth } from '../../../hooks/useAuth';
import { useFeatureFlag, useVercelIntegration, useVercelParams, useEffectOnce, useContainer } from '../../../hooks';
import { useFeatureFlag, useVercelIntegration } from '../../../hooks';
import { ROUTES } from '../../../constants/routes';
import { useSegment } from '../../../components/providers/SegmentProvider';
import { BRIDGE_SYNC_SAMPLE_ENDPOINT } from '../../../config/index';
Expand All @@ -31,7 +31,6 @@ function updateClerkOrgMetadata(data: UpdateExternalOrganizationDto) {

export function QuestionnaireForm() {
const { isSupported } = useWebContainerSupported();
const isV2Enabled = useFeatureFlag(FeatureFlagsKeysEnum.IS_V2_ENABLED);
const isPlaygroundOnboardingEnabled = useFeatureFlag(FeatureFlagsKeysEnum.IS_PLAYGROUND_ONBOARDING_ENABLED);
const [loading, setLoading] = useState<boolean>();
const {
Expand Down

0 comments on commit 31e20be

Please sign in to comment.