-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert "Revert 54064 and 53396" #54263
Merged
puneetlath
merged 13 commits into
Expensify:main
from
ishpaul777:revert-54260-revert-54064-and-53396
Dec 24, 2024
+816
−329
Merged
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
9111a2c
Revert "Revert 54064 and 53396"
ishpaul777 5138fed
Merge branch 'main' into revert-54260-revert-54064-and-53396
ishpaul777 aa00cd5
formatting
ishpaul777 dcb8e79
fix warning
ishpaul777 e9e3c21
refactor: change timestamp type from Date to string in DismissedProdu…
ishpaul777 caa87c2
Merge branch 'Expensify:main' into revert-54260-revert-54064-and-53396
ishpaul777 599d5d6
Merge branch 'main' into revert-54260-revert-54064-and-53396
ishpaul777 3db3ba6
Merge branch 'main' into revert-54260-revert-54064-and-53396
ishpaul777 805446f
remove unused variable
ishpaul777 c3446bd
Merge branch 'Expensify:main' into revert-54260-revert-54064-and-53396
ishpaul777 0e97038
FloatingActionButton logic to conditionally show tooltip based on sid…
ishpaul777 d288477
Merge branch 'main' into revert-54260-revert-54064-and-53396
ishpaul777 8fca124
Merge branch 'main' into revert-54260-revert-54064-and-53396
ishpaul777 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import {useFocusEffect} from '@react-navigation/native'; | ||
import React, {useCallback, useRef, useState} from 'react'; | ||
import React, {useCallback, useMemo, useRef, useState} from 'react'; | ||
import type {GestureResponderEvent, ViewStyle} from 'react-native'; | ||
import {StyleSheet, View} from 'react-native'; | ||
import {useOnyx} from 'react-native-onyx'; | ||
|
@@ -11,6 +11,7 @@ | |
import OfflineWithFeedback from '@components/OfflineWithFeedback'; | ||
import {useSession} from '@components/OnyxProvider'; | ||
import PressableWithSecondaryInteraction from '@components/PressableWithSecondaryInteraction'; | ||
import {useProductTrainingContext} from '@components/ProductTrainingContext'; | ||
import SubscriptAvatar from '@components/SubscriptAvatar'; | ||
import Text from '@components/Text'; | ||
import Tooltip from '@components/Tooltip'; | ||
|
@@ -22,7 +23,6 @@ | |
import useThemeStyles from '@hooks/useThemeStyles'; | ||
import DateUtils from '@libs/DateUtils'; | ||
import DomUtils from '@libs/DomUtils'; | ||
import {hasCompletedGuidedSetupFlowSelector} from '@libs/onboardingSelectors'; | ||
import * as OptionsListUtils from '@libs/OptionsListUtils'; | ||
import Parser from '@libs/Parser'; | ||
import Performance from '@libs/Performance'; | ||
|
@@ -32,7 +32,6 @@ | |
import FreeTrial from '@pages/settings/Subscription/FreeTrial'; | ||
import variables from '@styles/variables'; | ||
import Timing from '@userActions/Timing'; | ||
import * as User from '@userActions/User'; | ||
import CONST from '@src/CONST'; | ||
import ONYXKEYS from '@src/ONYXKEYS'; | ||
import {isEmptyObject} from '@src/types/utils/EmptyObject'; | ||
|
@@ -47,19 +46,22 @@ | |
const {shouldUseNarrowLayout} = useResponsiveLayout(); | ||
|
||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | ||
const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${optionItem?.reportID || -1}`); | ||
Check failure on line 49 in src/components/LHNOptionsList/OptionRowLHN.tsx GitHub Actions / Changed files ESLint check
|
||
const [isFirstTimeNewExpensifyUser] = useOnyx(ONYXKEYS.NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER); | ||
const [isOnboardingCompleted = true] = useOnyx(ONYXKEYS.NVP_ONBOARDING, { | ||
selector: hasCompletedGuidedSetupFlowSelector, | ||
}); | ||
const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID); | ||
const isActiveWorkspaceChat = ReportUtils.isPolicyExpenseChat(report) && report?.isOwnPolicyExpenseChat && activePolicyID === report?.policyID; | ||
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); | ||
const session = useSession(); | ||
|
||
// Guides are assigned for the MANAGE_TEAM onboarding action, except for emails that have a '+'. | ||
const isOnboardingGuideAssigned = introSelected?.choice === CONST.ONBOARDING_CHOICES.MANAGE_TEAM && !session?.email?.includes('+'); | ||
const shouldShowToooltipOnThisReport = isOnboardingGuideAssigned ? ReportUtils.isAdminRoom(report) : ReportUtils.isConciergeChatReport(report); | ||
const [shouldHideGBRTooltip] = useOnyx(ONYXKEYS.NVP_SHOULD_HIDE_GBR_TOOLTIP, {initialValue: true}); | ||
const shouldShowGetStartedTooltip = isOnboardingGuideAssigned ? ReportUtils.isAdminRoom(report) : ReportUtils.isConciergeChatReport(report); | ||
|
||
const {tooltipToRender, shouldShowTooltip} = useMemo(() => { | ||
const tooltip = shouldShowGetStartedTooltip ? CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.CONCEIRGE_LHN_GBR : CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.LHN_WORKSPACE_CHAT_TOOLTIP; | ||
|
||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | ||
return {tooltipToRender: tooltip, shouldShowTooltip: shouldUseNarrowLayout ? isScreenFocused : true}; | ||
}, [shouldShowGetStartedTooltip, isScreenFocused, shouldUseNarrowLayout]); | ||
|
||
const {shouldShowProductTrainingTooltip, renderProductTrainingTooltip, hideProductTrainingTooltip} = useProductTrainingContext(tooltipToRender, shouldShowTooltip); | ||
const {translate} = useLocalize(); | ||
const [isContextMenuActive, setIsContextMenuActive] = useState(false); | ||
|
||
|
@@ -72,30 +74,6 @@ | |
}, []), | ||
); | ||
|
||
const renderGBRTooltip = useCallback( | ||
() => ( | ||
<View style={[styles.alignItemsCenter, styles.flexRow, styles.justifyContentCenter, styles.flexWrap, styles.textAlignCenter, styles.gap1]}> | ||
<Icon | ||
src={Expensicons.Lightbulb} | ||
fill={theme.tooltipHighlightText} | ||
medium | ||
/> | ||
<Text style={styles.quickActionTooltipSubtitle}>{translate('sidebarScreen.tooltip')}</Text> | ||
</View> | ||
), | ||
[ | ||
styles.alignItemsCenter, | ||
styles.flexRow, | ||
styles.justifyContentCenter, | ||
styles.flexWrap, | ||
styles.textAlignCenter, | ||
styles.gap1, | ||
styles.quickActionTooltipSubtitle, | ||
theme.tooltipHighlightText, | ||
translate, | ||
], | ||
); | ||
|
||
const isInFocusMode = viewMode === CONST.OPTION_MODE.COMPACT; | ||
const sidebarInnerRowStyle = StyleSheet.flatten<ViewStyle>( | ||
isInFocusMode | ||
|
@@ -180,17 +158,18 @@ | |
needsOffscreenAlphaCompositing | ||
> | ||
<EducationalTooltip | ||
shouldRender={isFirstTimeNewExpensifyUser && !shouldHideGBRTooltip && isOnboardingCompleted && isScreenFocused && shouldUseNarrowLayout && shouldShowToooltipOnThisReport} | ||
renderTooltipContent={renderGBRTooltip} | ||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | ||
shouldRender={shouldShowProductTrainingTooltip && (isActiveWorkspaceChat || shouldShowGetStartedTooltip)} | ||
renderTooltipContent={renderProductTrainingTooltip} | ||
anchorAlignment={{ | ||
horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT, | ||
horizontal: isActiveWorkspaceChat ? CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.LEFT : CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT, | ||
vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP, | ||
}} | ||
shouldUseOverlay | ||
shiftHorizontal={variables.gbrTooltipShiftHorizontal} | ||
shiftVertical={variables.composerTooltipShiftVertical} | ||
wrapperStyle={styles.quickActionTooltipWrapper} | ||
onHideTooltip={User.dismissGBRTooltip} | ||
shiftHorizontal={isActiveWorkspaceChat ? variables.workspaceLHNtooltipShiftHorizontal : variables.gbrTooltipShiftHorizontal} | ||
shiftVertical={isActiveWorkspaceChat ? 0 : variables.composerTooltipShiftVertical} | ||
onHideTooltip={hideProductTrainingTooltip} | ||
wrapperStyle={styles.productTrainingTooltipWrapper} | ||
> | ||
<View> | ||
<Hoverable> | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
waiting till sidebar is loaded so we dont show the lower priority Fabbutton tooltip before the getStarted tooltip on conceirge chat..