App icon indicating copy to clipboard operation
App copied to clipboard

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

Open isagoico opened this issue 5 years ago • 13 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] 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

isagoico avatar Jul 30 '21 22:07 isagoico

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

MelvinBot avatar Jul 30 '21 22:07 MelvinBot

Proposal

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

https://github.com/Expensify/App/blob/74f8049b2429dfbf59e3e0cc20d2e0981b4f6751/src/pages/home/report/ReportActionCompose.js#L431

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

aman-atg avatar Jul 30 '21 22:07 aman-atg

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;

mananjadhav avatar Jul 31 '21 05:07 mananjadhav

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

MelvinBot avatar Aug 02 '21 08:08 MelvinBot

This looks like a great External issue

Beamanator avatar Aug 02 '21 08:08 Beamanator

@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.

Beamanator avatar Aug 02 '21 08:08 Beamanator

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

Christinadobrzyn avatar Aug 03 '21 03:08 Christinadobrzyn

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 avatar Aug 04 '21 04:08 Christinadobrzyn

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"

arpitdeveloper avatar Aug 04 '21 07:08 arpitdeveloper

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 👍

Beamanator avatar Aug 04 '21 08:08 Beamanator

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

Hired you in Upwork!

Christinadobrzyn avatar Aug 04 '21 08:08 Christinadobrzyn

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

No problem! ( It's in draft. )

aman-atg avatar Aug 04 '21 09:08 aman-atg

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

Christinadobrzyn avatar Aug 11 '21 01:08 Christinadobrzyn