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-08-19] [$250] [Wave Control] Update the Report field list type creation flow #45990

Closed
mountiny opened this issue Jul 23, 2024 · 38 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item.

Comments

@mountiny
Copy link
Contributor

mountiny commented Jul 23, 2024

When creating a list-type report field, we need to make sure the Initial value option comes after the list of values AND the List values option shows the created values as a comma-separated list, as shown below.

Note that the list values should not truncate but wrap to next line

image

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0124fe6a5dd4337910
  • Upwork Job ID: 1815657257015158749
  • Last Price Increase: 2024-07-23
  • Automatic offers:
    • shubham1206agra | Reviewer | 103272331
    • Krishna2323 | Contributor | 103272333
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @muttmuure
@mountiny mountiny added Daily KSv2 NewFeature Something to build that is a new item. labels Jul 23, 2024
@mountiny mountiny self-assigned this Jul 23, 2024
Copy link

melvin-bot bot commented Jul 23, 2024

Triggered auto assignment to @muttmuure (NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Jul 23, 2024
@mountiny
Copy link
Contributor Author

@Expensify/design @JmillsExpensify Can you please double check that is right?

@shawnborton
Copy link
Contributor

Looks good to me!

@Krishna2323
Copy link
Contributor

Krishna2323 commented Jul 23, 2024

Proposal

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

Initial value incorrectly appears above List values for report field configuration

What is the root cause of that problem?

The MenuItemWithTopDescription for initialValue is placed above lisvalues

<MenuItemWithTopDescription
style={[styles.moneyRequestMenuItem]}
titleStyle={styles.flex1}
title={WorkspaceReportFieldUtils.getReportFieldInitialValue(reportField)}
description={translate('common.initialValue')}
shouldShowRightIcon={!isDateFieldType}
interactive={!isDateFieldType}
onPress={() => Navigation.navigate(ROUTES.WORKSPACE_EDIT_REPORT_FIELDS_INITIAL_VALUE.getRoute(policyID, reportFieldID))}
/>
{isListFieldType && (
<MenuItemWithTopDescription
style={[styles.moneyRequestMenuItem]}
titleStyle={styles.flex1}
description={translate('workspace.reportFields.listValues')}
shouldShowRightIcon
onPress={() => Navigation.navigate(ROUTES.WORKSPACE_REPORT_FIELDS_LIST_VALUES.getRoute(policyID, reportFieldID))}

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

  • Place MenuItemWithTopDescription for initialValue after MenuItemWithTopDescription for lisvalues

  • We should also do this in CreateReportFieldsPage.

  • Then in ReportFieldsSettingsPage we need to get the list values. We can merge disabled values if needed.

    const listValues = Object.values(policy?.fieldList?.[reportFieldKey]?.values ?? {});
    const reportFieldDisabledValues = Object.values(policy?.fieldList?.[reportFieldKey]?.disabledOptions ?? {});
    
    // Pass title
    {isListFieldType && (
        <MenuItemWithTopDescription
            style={[styles.moneyRequestMenuItem]}
            titleStyle={styles.flex1}
            title={listValues.join(', ')}
  • Same should be done in CreateReportFieldsPage but there we should get the list values from formDraft?.[INPUT_IDS.LIST_VALUES].

        {inputValues[INPUT_IDS.TYPE] === CONST.REPORT_FIELD_TYPES.LIST && (
            <MenuItemWithTopDescription
                description={translate('workspace.reportFields.listValues')}
                shouldShowRightIcon
                onPress={() => Navigation.navigate(ROUTES.WORKSPACE_REPORT_FIELDS_LIST_VALUES.getRoute(policyID))}
                title={formDraft?.[INPUT_IDS.LIST_VALUES]?.join(', ')}
            />
        )}
  • If we want to wrap the title in next line we can do that by using numberOfLinesTitle prop.
  • Code can be refactored because we have the similar way of getting list values in ReportFieldsListValuesPage also.

What alternative solutions did you explore? (Optional)

  • If we don't want to show disabled value then we can filter that out using disabledListValues in ReportFieldsSettingsPage and formDraft?.[INPUT_IDS.DISABLED_LIST_VALUES] in CreateReportFieldsPage page.
// In 'ReportFieldsSettingsPage'
title={listValues.filter((v, i) => !disabledListValues[i]).join(', ')}

// In 'CreateReportFieldsPage'
title={formDraft?.[INPUT_IDS.LIST_VALUES]?.filter((v, i) => !formDraft?.[INPUT_IDS.DISABLED_LIST_VALUES][i]).join(', ')}

Additionally we also might want to increase the number of lines for value field in ReportFieldsValueSettingsPage.
Note: This will be refactored

Result

field_list.mp4

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jul 23, 2024
@Krishna2323
Copy link
Contributor

Proposal Updated

  • Minor change in main solution
  • Added result video
  • Added alternative/optional solution

@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label Jul 23, 2024
@melvin-bot melvin-bot bot changed the title [Wave Control] Update the Report field list type creation flow [$250] [Wave Control] Update the Report field list type creation flow Jul 23, 2024
Copy link

melvin-bot bot commented Jul 23, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 23, 2024
Copy link

melvin-bot bot commented Jul 23, 2024

Current assignees @rushatgabhane and @shubham1206agra are eligible for the External assigner, not assigning anyone new.

@mountiny
Copy link
Contributor Author

@rushatgabhane @shubham1206agra can you please review the proposal?

I think the main problem here is to make sure the list values nicely wrap even if the list is very long

@shubham1206agra
Copy link
Contributor

@Krishna2323 Your proposal looks good. Can you just show the screenshot with 20 values and one super-long list value?

Thanks

@nkdengineer
Copy link
Contributor

nkdengineer commented Jul 23, 2024

Proposal

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

The list values are displayed incorrectly

What is the root cause of that problem?

This is a new feature request

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

  1. We should move the initial value item to below the list value

  2. Get the values of the report field and pass the title prop as the joined list value. Add styles.preWrap style to titleStyle prop so the list value can be displayed in multiline and add styles.breakAll so the long value can be displayed fully.

OPTIONAL: If we only want to display some lines of list values, we can pass numberOfLines prop to control the number of lines that we want to display.

const reportFieldValues = policy?.fieldList?.[reportFieldKey].values ?? [];
{isListFieldType && (
    <MenuItemWithTopDescription
        style={[styles.moneyRequestMenuItem]}
        titleStyle={{...styles.flex1, ...styles.preWrap, ...styles.breakAll}}
        description={translate('workspace.reportFields.listValues')}
        shouldShowRightIcon
        title={reportFieldValues.join(', ')}
        onPress={() => Navigation.navigate(ROUTES.WORKSPACE_REPORT_FIELDS_LIST_VALUES.getRoute(policyID, reportFieldID))}
    />
)}

{isListFieldType && (
<MenuItemWithTopDescription

  1. We also need to wrap the ScrollView here so that if the list value is too long, we can scroll to the initial value

We should do the same for the creation flow in CreateReportFieldsPage.

We can see the test branch here for more details https://github.com/nkdengineer/App/tree/fix/45990.

What alternative solutions did you explore? (Optional)

NA

Result

Screen.Recording.2024-07-23.at.17.02.09.mov

@Krishna2323
Copy link
Contributor

Krishna2323 commented Jul 23, 2024

@shubham1206agra, I think we should allow only 4-5 lines. @shawnborton what's you opinion?

Note: numberOfLinesTitle={0} can be used for not setting any limits on number of lines.

One super long value l 20 values
Monosnap New Expensify 2024-07-23 15-42-34 Monosnap New Expensify 2024-07-23 15-43-43

@shawnborton
Copy link
Contributor

Cc @Expensify/design @JmillsExpensify @trjExpensify - do we have strong feelings here? Part of me thinks that trimming to 4-5 lines makes sense here in case the list is insanely long.

@trjExpensify
Copy link
Contributor

I definitely think we should cap it, these imported lists of customers/projects can be very long.

Copy link

melvin-bot bot commented Jul 23, 2024

📣 @rafaykr! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@rafaykr
Copy link

rafaykr commented Jul 23, 2024

contributor details
expensify account email:kamham56@gmail.com
upwork account : https://www.upwork.com/freelancers/~01510f6bfd2680dd92

Dear Hiring Manager,

I am excited to submit my proposal for the React Native developer position to assist with the migration project at Expensify. As a seasoned full-stack developer with a strong focus on mobile application development and user experience, I am confident in my ability to address the challenges outlined in GitHub issue #45990.

Expensify’s commitment to maintaining a reliable and secure system for processing financial transactions is commendable, and the goal of unifying the front-end across platforms using React Native is a strategic move towards enhancing user experience and operational efficiency. I am eager to contribute to this mission and help ensure that your platform remains at the forefront of innovation in the financial sector.

Addressing Your Needs:
Ensuring Accurate Field Order:

I will modify the React component responsible for rendering the list-type report field to ensure the Initial value option appears after the List values. This will involve a careful restructuring of the JSX to guarantee the desired order is achieved.
Improving List Values Display:

To ensure that the List values are displayed correctly as a comma-separated list without truncation, I will update the CSS/styling. This will involve implementing a wrapping mechanism that maintains readability and presentation integrity, even when the values exceed the container width.
Proposed Technical Solution:
Component Restructuring:
Locate and adjust the relevant component file to place the Initial value option after the List values. This ensures logical and user-friendly field arrangement.
Styling Adjustments:
Update the CSS to prevent truncation and enable wrapping of List values. The goal is to enhance readability and ensure that the comma-separated values are clearly displayed across all device sizes.
Implementation Plan:
Component File Update:

Adjust the JSX structure in the React component.

Apply CSS to ensure proper wrapping.

..list-values {
white-space: normal;
word-wrap: break-word;
}

Testing:

Conduct comprehensive unit and visual tests across all platforms to verify the correctness and usability of the changes.
Provide detailed screenshots and test cases to demonstrate the solution’s effectiveness.

Why I am the Right Fit:

Experience: With a strong background in React Native and UI/UX design, I have successfully delivered numerous projects that required meticulous attention to detail and robust cross-platform compatibility.
Commitment to Quality: I am dedicated to ensuring that my contributions meet the highest standards of quality and reliability, aligning with Expensify’s reputation for excellence.
Collaborative Approach: I value clear communication and collaboration, ensuring that I work seamlessly with your team to integrate the solution efficiently.
I have reviewed the Expensify Contributor Guidelines and am fully prepared to adhere to all standards and practices outlined. My proposal is detailed on the GitHub issue as requested, and I am eager to discuss how my skills and experience align with your needs further.

Thank you for considering my application. I look forward to the possibility of contributing to Expensify's continued success and helping to advance your migration project.

Best regards,
Muhammad Rafay khan

@dannymcclain
Copy link
Contributor

Part of me thinks that trimming to 4-5 lines makes sense here in case the list is insanely long.

I definitely think we should cap it, these imported lists of customers/projects can be very long.

Yeah I agree. After seeing the super mega long one, I don't really see a whole lot of value gained by NEVER truncating. At a certain point the huge push input list is just not helpful. I think capping at 4-5 lines is good.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 Weekly KSv2 labels Jul 28, 2024
Copy link

melvin-bot bot commented Aug 8, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Aug 12, 2024
@melvin-bot melvin-bot bot changed the title [$250] [Wave Control] Update the Report field list type creation flow [HOLD for payment 2024-08-19] [$250] [Wave Control] Update the Report field list type creation flow Aug 12, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Aug 12, 2024
Copy link

melvin-bot bot commented Aug 12, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Aug 12, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.18-10 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-08-19. 🎊

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

Copy link

melvin-bot bot commented Aug 12, 2024

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Aug 18, 2024
@Krishna2323
Copy link
Contributor

@muttmuure, this is ready for payments :)

@shubham1206agra
Copy link
Contributor

@mountiny For this issue, my payment will be separate from the project or in the project?

@melvin-bot melvin-bot bot added the Overdue label Aug 20, 2024
Copy link

melvin-bot bot commented Aug 21, 2024

@rushatgabhane, @mountiny, @muttmuure, @shubham1206agra, @Krishna2323 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@mountiny
Copy link
Contributor Author

This can be separate

$250 to @Krishna2323 and to @shubham1206agra please @muttmuure

@Krishna2323
Copy link
Contributor

I have been paid. 🙏🏻

@muttmuure
Copy link
Contributor

@Krishna2323 has indeed been paid

@melvin-bot melvin-bot bot removed the Overdue label Aug 22, 2024
@muttmuure
Copy link
Contributor

@shubham1206agra I need you to accept the offer https://www.upwork.com/nx/wm/offer/103272331

@muttmuure
Copy link
Contributor

muttmuure commented Aug 22, 2024

@rushatgabhane - $250 C+
@Krishna2323 - $250
@shubham1206agra - $250

@shubham1206agra
Copy link
Contributor

@muttmuure Offer accepted

@muttmuure
Copy link
Contributor

Paid

@muttmuure
Copy link
Contributor

@rushatgabhane can request in ND using the summary above #45990 (comment)

@garrettmknight
Copy link
Contributor

$250 approved for @rushatgabhane based on this summary.

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 Daily KSv2 External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item.
Development

No branches or pull requests