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 2021-09-27] Chat - Text and URL inside a strikethrough markdown isn't working #4897

Closed
kavimuru opened this issue Aug 28, 2021 · 23 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@kavimuru
Copy link

kavimuru commented Aug 28, 2021

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Launch the app
  2. Log in with any account
  3. Start your conversation with text www.homedepot.com

Expected Result:

Text and URL inside a strikethrough markdown should work in Android app

Actual Result:

Text and URL inside a strikethrough markdown isn't working

Workaround:

Unknown

Platform:

Where is this issue occurring?

  • iOS
  • Android

Version Number:
1.0.88-2
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:

Bug5212974_Screen_Recording_20210827-215028_New_Expensify.mp4

Expensify/Expensify Issue URL:

View all open jobs on GitHub
Occurs in Production app too. So not adding Deployblocker

@MelvinBot
Copy link

Triggered auto assignment to @flodnv (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@flodnv
Copy link
Contributor

flodnv commented Aug 31, 2021

I can confirm this works on desktop but not on android. Probably a good External issue?

@MelvinBot MelvinBot removed the Overdue label Aug 31, 2021
@flodnv flodnv removed their assignment Aug 31, 2021
@flodnv flodnv added the External Added to denote the issue can be worked on by a contributor label Aug 31, 2021
@MelvinBot MelvinBot added Weekly KSv2 and removed Daily KSv2 labels Aug 31, 2021
@MelvinBot
Copy link

Triggered auto assignment to @dylanexpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@MelvinBot MelvinBot added Daily KSv2 and removed Weekly KSv2 labels Aug 31, 2021
@dylanexpensify
Copy link
Contributor

On it!

@dylanexpensify
Copy link
Contributor

@pROFESOR11
Copy link
Contributor

pROFESOR11 commented Aug 31, 2021

Proposal

Hi @dylanexpensify and everybody,
I've been debugging the issue for a while and here is my proposal:

Related code block:

function AnchorRenderer({tnode, key, style}) {
const htmlAttribs = tnode.attributes;
// An auth token is needed to download Expensify chat attachments
const isAttachment = Boolean(htmlAttribs['data-expensify-source']);
const fileName = lodashGet(tnode, 'domNode.children[0].data', '');
return (
<AnchorForCommentsOnly
href={htmlAttribs.href}
isAuthTokenRequired={isAttachment}
// Unless otherwise specified open all links in
// a new window. On Desktop this means that we will
// skip the default Save As... download prompt
// and defer to whatever browser the user has.
// eslint-disable-next-line react/jsx-props-no-multi-spaces
target={htmlAttribs.target || '_blank'}
rel={htmlAttribs.rel || 'noopener noreferrer'}
style={style}
key={key}
fileName={fileName}
>
<TNodeChildrenRenderer tnode={tnode} />
</AnchorForCommentsOnly>
);
}

Here in AnchorRenderer, I suggest to override styles with parent styles. So it will be:

function AnchorRenderer({tnode, key, style}) {
    const htmlAttribs = tnode.attributes;

    // An auth token is needed to download Expensify chat attachments
    const isAttachment = Boolean(htmlAttribs['data-expensify-source']);
    const fileName = lodashGet(tnode, 'domNode.children[0].data', '');
+   const parentStyle = lodashGet(tnode, 'parent.styles.nativeTextRet', {});

    return (
        <AnchorForCommentsOnly
            href={htmlAttribs.href}
            isAuthTokenRequired={isAttachment}

            // Unless otherwise specified open all links in
            // a new window. On Desktop this means that we will
            // skip the default Save As... download prompt
            // and defer to whatever browser the user has.
            // eslint-disable-next-line react/jsx-props-no-multi-spaces
            target={htmlAttribs.target || '_blank'}
            rel={htmlAttribs.rel || 'noopener noreferrer'}
-           style={style}
+           style={{...style, ...parentStyle}}
            key={key}
            fileName={fileName}
        >
            <TNodeChildrenRenderer tnode={tnode} />
        </AnchorForCommentsOnly>
    );
}

@roryabraham
Copy link
Contributor

@dylanexpensify Heads up that you forgot to add the Exported label here which means that there's no CME assigned to this issue.

@MelvinBot MelvinBot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 1, 2021
@MelvinBot
Copy link

Triggered auto assignment to @marcaaron (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@roryabraham
Copy link
Contributor

Interesting ... I think @pROFESOR11's proposal looks reasonable – if there are specific styles being applied to the parent element that conflict with the default styles of the link, we should give preference to the parent style.

LGTM, so @dylanexpensify let's hire @pROFESOR11 on Upwork. @pROFESOR11 please feel free to submit a pull request for this once you've been hired on Upwork.

@dylanexpensify
Copy link
Contributor

On it now to send the offer @roryabraham (cc @pROFESOR11)!

@dylanexpensify
Copy link
Contributor

Offer: sent!

@dylanexpensify dylanexpensify removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 2, 2021
@pROFESOR11
Copy link
Contributor

Hi @dylanexpensify and @roryabraham,
Thanks for the feedback and offer, PR submitted!

@MelvinBot
Copy link

@roryabraham, @dylanexpensify Eep! 4 days overdue now. Issues have feelings too...

@roryabraham
Copy link
Contributor

For some reason I wasn't automatically assigned as a reviewer of the linked PR, but I just submitted my review now.

@MelvinBot MelvinBot added Overdue and removed Overdue labels Sep 8, 2021
@dylanexpensify
Copy link
Contributor

Sounds good, thanks @roryabraham !

@MelvinBot MelvinBot removed the Overdue label Sep 13, 2021
@botify
Copy link

botify commented Sep 14, 2021

@pROFESOR11, Great job getting your first Expensify/App pull request over the finish line! 🎉

I know there's a lot of information in our contributing guidelines, so here are some points to take note of 📝:

  1. Now that your first PR has been merged, you can be hired for another issue. Once you've completed a few issues, you may be eligible to work on more than one job at a time.
  2. Once your PR is deployed to our staging servers, it will undergo quality assurance (QA) testing. If we find that it doesn't work as expected or causes a regression, you'll be responsible for fixing it. Typically, we would revert this PR and give you another chance to create a similar PR without causing a regression.
  3. Once your PR is deployed to production, we start a 7-day timer ⏰. After it has been on production for 7 days without causing any regressions, then we pay out the Upwork job. 💰

So it might take a while before you're paid for your work, but we typically post multiple new jobs every day, so there's plenty of opportunity. I hope you've had a positive experience contributing to this repo! 😊

@botify
Copy link

botify commented Sep 14, 2021

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@botify
Copy link

botify commented Sep 15, 2021

🚀 Deployed to staging by @marcaaron in version: 1.0.98-2 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@roryabraham
Copy link
Contributor

Not sure that this really needs to be on hold, because it's already been deployed to staging.

@MelvinBot MelvinBot removed the Overdue label Sep 20, 2021
@mountiny
Copy link
Contributor

The PR has been deployed to production on Monday 20th September. Updating the title appropriately 🙌

@mountiny mountiny added the Awaiting Payment Auto-added when associated PR is deployed to production label Sep 22, 2021
@mountiny mountiny changed the title Chat - Text and URL inside a strikethrough markdown isn't working [HOLD for payment 2021-09-27] Chat - Text and URL inside a strikethrough markdown isn't working Sep 22, 2021
@roryabraham roryabraham added the Weekly KSv2 label Sep 22, 2021
@MelvinBot MelvinBot removed the Overdue label Sep 22, 2021
@roryabraham roryabraham removed the Daily KSv2 label Sep 22, 2021
@roryabraham
Copy link
Contributor

On hold for payment, changing this to weekly to appease melvin

@dylanexpensify
Copy link
Contributor

Submitting payment today

@dylanexpensify
Copy link
Contributor

Payment sent!

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 Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

10 participants