Skip to content
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

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

Closed
roryabraham opened this issue Sep 12, 2024 · 19 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@roryabraham
Copy link
Contributor

roryabraham commented Sep 12, 2024

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
@roryabraham roryabraham added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 12, 2024
@roryabraham roryabraham self-assigned this Sep 12, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 12, 2024
Copy link

melvin-bot bot commented Sep 12, 2024

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

Copy link

melvin-bot bot commented Sep 12, 2024

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
Copy link
Contributor Author

seems like upwork automation didn't work 😞

@BhuvaneshPatil
Copy link
Contributor

Dibs

@roryabraham roryabraham added External Added to denote the issue can be worked on by a contributor and removed External Added to denote the issue can be worked on by a contributor labels Sep 12, 2024
@melvin-bot melvin-bot bot changed the title Migrate DeeplinkRedirectLoadingIndicator from withOnyx to useOnyx [$250] Migrate DeeplinkRedirectLoadingIndicator from withOnyx to useOnyx Sep 12, 2024
Copy link

melvin-bot bot commented Sep 12, 2024

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

Copy link

melvin-bot bot commented Sep 12, 2024

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

@roryabraham roryabraham changed the title [$250] Migrate DeeplinkRedirectLoadingIndicator from withOnyx to useOnyx [$100] Migrate DeeplinkRedirectLoadingIndicator from withOnyx to useOnyx Sep 12, 2024
Copy link

melvin-bot bot commented Sep 12, 2024

Upwork job price has been updated to $100

@Nodebrute

This comment was marked as resolved.

Copy link
Contributor

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

@Nodebrute
Copy link
Contributor

Nodebrute commented Sep 12, 2024

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

export default withOnyx<DeeplinkRedirectLoadingIndicatorProps, DeeplinkRedirectLoadingIndicatorOnyxProps>({
session: {
key: ONYXKEYS.SESSION,
},
})(DeeplinkRedirectLoadingIndicator);

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
Copy link
Contributor

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?

  • migration

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

  • Old file here
    Updated code here
import React from 'react';
import {View} from 'react-native';
import type {OnyxEntry} from 'react-native-onyx';
import {useOnyx} from 'react-native-onyx';
import Icon from '@components/Icon';
import * as Expensicons from '@components/Icon/Expensicons';
import * as Illustrations from '@components/Icon/Illustrations';
import Text from '@components/Text';
import TextLink from '@components/TextLink';
import useLocalize from '@hooks/useLocalize';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import Navigation from '@libs/Navigation/Navigation';
import ONYXKEYS from '@src/ONYXKEYS';
import type * as OnyxTypes from '@src/types/onyx';

type DeeplinkRedirectLoadingIndicatorOnyxProps = {
    /** Current user session */
    session: OnyxEntry<OnyxTypes.Session>;
};

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.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 13, 2024
Copy link

melvin-bot bot commented Sep 13, 2024

📣 @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
Copy link
Contributor Author

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

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Sep 15, 2024
@roryabraham
Copy link
Contributor Author

roryabraham commented Oct 4, 2024

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.

@roryabraham roryabraham removed the Reviewing Has a PR in review label Oct 4, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 7, 2024
@melvin-bot melvin-bot bot changed the title [$100] Migrate DeeplinkRedirectLoadingIndicator from withOnyx to useOnyx [HOLD for payment 2024-10-14] [$100] Migrate DeeplinkRedirectLoadingIndicator from withOnyx to useOnyx Oct 7, 2024
Copy link

melvin-bot bot commented Oct 7, 2024

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

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

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

Copy link

melvin-bot bot commented Oct 7, 2024

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:

  • [@getusha] The PR that introduced the bug has been identified. Link to the PR:
  • [@getusha] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@getusha] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@getusha] Determine if we should create a regression test for this bug.
  • [@getusha] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@lschurr] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Oct 14, 2024
@lschurr
Copy link
Contributor

lschurr commented Oct 14, 2024

Payment summary:

@lschurr lschurr closed this as completed Oct 14, 2024
@melvin-bot melvin-bot bot removed the Overdue label Oct 14, 2024
@github-project-automation github-project-automation bot moved this from LOW to Done in [#whatsnext] #quality Oct 14, 2024
@getusha
Copy link
Contributor

getusha commented Oct 28, 2024

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

@garrettmknight
Copy link
Contributor

$100 approved for @getusha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
Development

No branches or pull requests

8 participants