Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.52k stars 2.87k forks source link

[HOLD for payment 2024-10-14] [$100] Migrate DeeplinkRedirectLoadingIndicator from withOnyx to useOnyx #49104

Closed roryabraham closed 3 weeks ago

roryabraham commented 1 month ago

Coming from https://expensify.slack.com/archives/C01GTK53T8Q/p1725973460005309?thread_ts=1725905735.105989&cid=C01GTK53T8Q

Migrate src/components/DeeplinkWrapper/DeeplinkRedirectLoadingIndicator.tsx to use useOnyx instead of withOnyx.

Issue OwnerCurrent Issue Owner: @
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021834282172274819617
  • Upwork Job ID: 1834282172274819617
  • Last Price Increase: 2024-09-12
  • Automatic offers:
    • Nodebrute | Contributor | 103949156
Issue OwnerCurrent Issue Owner: @lschurr / @lschurr
melvin-bot[bot] commented 1 month ago

Triggered auto assignment to Contributor-plus team member for initial proposal review - @getusha (External)

melvin-bot[bot] commented 1 month ago

Triggered auto assignment to @lschurr (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

roryabraham commented 1 month ago

seems like upwork automation didn't work 😞

BhuvaneshPatil commented 1 month ago

Dibs

melvin-bot[bot] commented 1 month ago

Job added to Upwork: https://www.upwork.com/jobs/~021834282172274819617

melvin-bot[bot] commented 1 month ago

Current assignee @getusha is eligible for the External assigner, not assigning anyone new.

melvin-bot[bot] commented 1 month ago

Upwork job price has been updated to $100

Nodebrute commented 1 month ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

Migrate DeeplinkRedirectLoadingIndicator from withOnyx to useOnyx

What is the root cause of that problem?

Feature request

What changes do you think we should make in order to solve the problem?

We can remove this withOnyx https://github.com/Expensify/App/blob/7748eff72fc43ecaf3db6159928d8d581a63ab99/src/components/DeeplinkWrapper/DeeplinkRedirectLoadingIndicator.tsx#L65-L69

and then we can use

  const [session] = useOnyx(ONYXKEYS.SESSION);

What alternative solutions did you explore? (Optional)

github-actions[bot] commented 1 month ago

@Nodebrute Your proposal will be dismissed because you did not follow the proposal template.

Nodebrute commented 1 month ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

Migrate DeeplinkRedirectLoadingIndicator from withOnyx to useOnyx

What is the root cause of that problem?

Feature request

What changes do you think we should make in order to solve the problem?

We can remove this withOnyx https://github.com/Expensify/App/blob/7748eff72fc43ecaf3db6159928d8d581a63ab99/src/components/DeeplinkWrapper/DeeplinkRedirectLoadingIndicator.tsx#L65-L69

and then we can use

  const [session] = useOnyx(ONYXKEYS.SESSION);

Optional: we can also remove type props

What alternative solutions did you explore? (Optional)

ChavdaSachin commented 1 month ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

Migrate src/components/DeeplinkWrapper/DeeplinkRedirectLoadingIndicator.tsx to use useOnyx instead of withOnyx.

What is the root cause of that problem?

What changes do you think we should make in order to solve the problem?

type DeeplinkRedirectLoadingIndicatorOnyxProps = { /* Current user session / session: OnyxEntry; };

type DeeplinkRedirectLoadingIndicatorProps = DeeplinkRedirectLoadingIndicatorOnyxProps & { /* Opens the link in the browser / openLinkInBrowser: (value: boolean) => void; };

function DeeplinkRedirectLoadingIndicator({openLinkInBrowser}: DeeplinkRedirectLoadingIndicatorProps) { const {translate} = useLocalize(); const theme = useTheme(); const styles = useThemeStyles(); const [session] = useOnyx(ONYXKEYS.SESSION);

return (
    <View style={styles.deeplinkWrapperContainer}>
        <View style={styles.deeplinkWrapperMessage}>
            <View style={styles.mb2}>
                <Icon
                    width={200}
                    height={164}
                    src={Illustrations.RocketBlue}
                />
            </View>
            <Text style={[styles.textHeadline, styles.textXXLarge]}>{translate('deeplinkWrapper.launching')}</Text>
            <View style={[styles.mt2, styles.textAlignCenter]}>
                <Text>{translate('deeplinkWrapper.loggedInAs', {email: session?.email ?? ''})}</Text>
                <Text style={[styles.textAlignCenter]}>
                    {translate('deeplinkWrapper.doNotSeePrompt')} <TextLink onPress={() => openLinkInBrowser(true)}>{translate('deeplinkWrapper.tryAgain')}</TextLink>
                    {translate('deeplinkWrapper.or')} <TextLink onPress={() => Navigation.goBack()}>{translate('deeplinkWrapper.continueInWeb')}</TextLink>.
                </Text>
            </View>
        </View>
        <View style={styles.deeplinkWrapperFooter}>
            <Icon
                width={154}
                height={34}
                fill={theme.success}
                src={Expensicons.ExpensifyWordmark}
            />
        </View>
    </View>
);

}

DeeplinkRedirectLoadingIndicator.displayName = 'DeeplinkRedirectLoadingIndicator';

export default DeeplinkRedirectLoadingIndicator;



### What alternative solutions did you explore? (Optional)

**Reminder:** Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

<!---
ATTN: Contributor+

You are the first line of defense in making sure every proposal has a clear and easily understood problem with a "root cause". Do not approve any proposals that lack a satisfying explanation to the first two prompts. It is CRITICALLY important that we understand the root cause at a minimum even if the solution doesn't directly address it. When we avoid this step, we can end up solving the wrong problems entirely or just writing hacks and workarounds.

Instructions for how to review a proposal:

1. Address each contributor proposal one at a time and address each part of the question one at a time e.g. if a solution looks acceptable, but the stated problem is not clear, then you should provide feedback and make suggestions to improve each prompt before moving on to the next. Avoid responding to all sections of a proposal at once. Move from one question to the next each time asking the contributor to "Please update your original proposal and tag me again when it's ready for review".

2. Limit excessive conversation and moderate issues to keep them on track. If someone is doing any of the following things, please kindly and humbly course-correct them:

- Posting PRs.
- Posting large multi-line diffs (this is basically a PR).
- Skipping any of the required questions.
- Not using the proposal template at all.
- Suggesting that an existing issue is related to the current issue before a problem or root cause has been established.
- Excessively wordy explanations.

3. Choose the first proposal that has a reasonable answer to all the required questions.
-->
melvin-bot[bot] commented 1 month ago

📣 @Nodebrute 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻 Keep in mind: Code of Conduct | Contributing 📖

roryabraham commented 1 month ago

Assigning to @Nodebrute on a first-come-first-serve basis. @BhuvaneshPatil is assigned to two other migrations already

roryabraham commented 1 month ago

PR is on staging. @puneetlath choosing you at random to assign here just in case the PR is reverted and further internal engineering help is needed.

melvin-bot[bot] commented 4 weeks ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.45-4 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-10-14. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 4 weeks ago

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

lschurr commented 3 weeks ago

Payment summary:

getusha commented 1 week ago

This was a migration issue, i don't think we need a checklist.

garrettmknight commented 1 week ago

$100 approved for @getusha