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 August 10th] Chronos has a timezone set #4342

Closed
isagoico opened this issue Jul 30, 2021 · 13 comments
Closed

[Hold for payment August 10th] Chronos has a timezone set #4342

isagoico opened this issue Jul 30, 2021 · 13 comments
Assignees
Labels
Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@isagoico
Copy link

isagoico commented Jul 30, 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. Log in to staging
  2. Open a conversation with Chronos

Expected Result:

Chronos shouldn't have a timezone.

Actual Result:

Chronos is showing a timezone.

Workaround:

N/A

Platform:

Where is this issue occurring?

  • Web
  • iOS
  • Android
  • Desktop App
  • Mobile Web

Version Number: 1.0.81-3

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos:

image

2021-08-04_11-59-41 (1)

Expensify/Expensify Issue URL:

View all open jobs on Upwork


From @thienlnam https://expensify.slack.com/archives/C01GTK53T8Q/p1627609596004400

Chronos shouldn't have a timezone because luckily for us Chronos doesn't sleep

@MelvinBot
Copy link

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

@aman-atg
Copy link
Contributor

aman-atg commented Jul 30, 2021

Proposal

  • It can be easily fixed by adding a check inside ReportActionCompse.js
        const hasChronosParticipant = _.contains(reportParticipants, CONST.EMAIL.CHRONOS);

const shouldShowReportRecipientLocalTime = !hasConciergeParticipant

  • It can be used after line 431 like this
    const shouldShowReportRecipientLocalTime = !hasConciergeParticipant
        && !hasChronosParticipant

@mananjadhav
Copy link
Collaborator

mananjadhav commented Jul 31, 2021

My approach would be to combine Concierge and Chronos blocks into one:

ReportActionCompose:

import lodashIntersection from 'lodash/intersect'; // At the top of

const hasSystemParticipant = lodashIntersection.intersect(reportParticipants, _.values(CONST.EMAIL)).length > 0;

const shouldShowReportRecipientLocalTime = !hasSystemParticipant
            && !hasMultipleParticipants
            && reportRecipient
            && reportRecipientTimezone
            && currentUserTimezone.selected !== reportRecipientTimezone.selected;

This will ensure that in the future if we add any additional email in the constants it'll automatically not show the timezone. If you want to avoid that, the condition would be:

const hasSystemParticipant = lodashIntersection.intersect(reportParticipants, [CONST.EMAIL.CONCIERGE, CONST.EMAIL.CHRONOS]).length > 0;

@Beamanator Beamanator added the External Added to denote the issue can be worked on by a contributor label Aug 2, 2021
@MelvinBot
Copy link

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

@MelvinBot MelvinBot removed the Overdue label Aug 2, 2021
@Beamanator
Copy link
Contributor

This looks like a great External issue

@Beamanator
Copy link
Contributor

@aman-atg I like your proposal, please submit a PR when you have a chance!

@mananjadhav I like your idea too, but I don't think we need to do so much future-proofing at this time. I think if we eventually decide to have a constant that only stores system emails, your solution would be great. But for now with the constant just called EMAIL, we don't really know what could be stored in there so I would prefer we don't "assume" it will only be system emails.

@Christinadobrzyn
Copy link
Contributor

I'm ooo today but I'll get something in Upwork tomorrow.

@Christinadobrzyn
Copy link
Contributor

Posted in Upwork - invited @aman-atg to the job.

External Upwork post - https://www.upwork.com/jobs/~0199ea27a5587e0fc9
Internal Upwork post - https://www.upwork.com/ab/applicants/1422769769244663808/job-details

@Christinadobrzyn Christinadobrzyn added Weekly KSv2 and removed Daily KSv2 labels Aug 4, 2021
@arpitdeveloper
Copy link

We create a variable inside render() in - "src/pages/home/report/ReportActionCompose.js"
like - (const hasChronosParticipant = _.contains(reportParticipants, CONST.EMAIL.CHRONOS);
and
we add this line "&& !hasChronosParticipant"
after this line-> "const shouldShowReportRecipientLocalTime = !hasConciergeParticipant"

@Beamanator
Copy link
Contributor

Hey @arpitdeveloper thanks for your proposal but as you can see in the above messages, we have already hired someone for this job. Please look for open issues that have the Help Wanted label if you are looking for jobs that haven't had anyone hired yet 👍

@Christinadobrzyn
Copy link
Contributor

Ah so sorry @aman-atg - I missed the PR you created in this GH 🤦🏼‍♀️

Hired you in Upwork!

@aman-atg
Copy link
Contributor

aman-atg commented Aug 4, 2021

I missed the PR you created in this GH 🤦🏼‍♀️

No problem! ( It's in draft. )

@MelvinBot MelvinBot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 4, 2021
@Christinadobrzyn Christinadobrzyn removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 4, 2021
@Christinadobrzyn Christinadobrzyn changed the title Chronos has a timezone set [Hold for payment August 10th] Chronos has a timezone set Aug 6, 2021
@Christinadobrzyn
Copy link
Contributor

@aman-atg has been paid, Upwork job closed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

7 participants