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

[$1000] DEV:Getting a new warning on Workspace page #18890

Closed
6 tasks done
kavimuru opened this issue May 13, 2023 · 9 comments
Closed
6 tasks done

[$1000] DEV:Getting a new warning on Workspace page #18890

kavimuru opened this issue May 13, 2023 · 9 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Needs Reproduction Reproducible steps needed

Comments

@kavimuru
Copy link

kavimuru commented May 13, 2023

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. Go to settings -> workspaces
  2. Verify in the console a warning related to styles.

Expected Result:

There should be no console warning

Actual Result:

Console warning displayed

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: Dev
Reproducible in staging?: n/a
Reproducible in production?: n/a
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

Expensify/Expensify Issue URL:
Issue reported by: @allroundexperts
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1683922598562509

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016045352eae19effd
  • Upwork Job ID: 1658162772480372736
  • Last Price Increase: 2023-05-15
@kavimuru kavimuru added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels May 13, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 13, 2023

Triggered auto assignment to @flaviadefaria (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented May 13, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@allroundexperts
Copy link
Contributor

allroundexperts commented May 13, 2023

Proposal

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

Warning message on dev.

What is the root cause of that problem?

We're supplying a nested array as style here. These styles also contain falsy values. The component expects an array of object only.

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

We should use a prop type that allows either an object or an array. We should replace this with:

    style: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.object]),

Also, we need to make sure that we're supplying a single dimension array here without any false values.
This needs to be changed to:

{(state) => {
                 const style = _.filter(
                    _.flatten([
                        StyleUtils.parseStyleFromFunction(props.style, state),
                        !disabled && state.pressed && StyleUtils.parseStyleFromFunction(props.pressStyle, state),
                        !disabled && state.hovered && StyleUtils.parseStyleAsArray(props.hoverStyle, state),
                        state.focused && StyleUtils.parseStyleAsArray(props.focusStyle, state),
                    ]),
                    (element) => !!element,
                );
                return (
                    <OpacityView
                        shouldDim={!disabled && (state.pressed || state.hovered)}
                        dimmingValue={state.pressed ? props.pressDimmingValue : props.hoverDimmingValue}
                        style={style}
                    >
                        {props.children}
                    </OpacityView>
                );
            }}

We can also use ... to flatten the array in the place where we are creating this array ie here.

What alternative solutions did you explore? (Optional)

We can also edit the OpacityView component, such that it accepts a nested array of objects. In the component, we can then convert the nested array into a 1d array of objects.

@flaviadefaria flaviadefaria added the External Added to denote the issue can be worked on by a contributor label May 15, 2023
@melvin-bot melvin-bot bot changed the title DEV:Getting a new warning on Workspace page [$1000] DEV:Getting a new warning on Workspace page May 15, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 15, 2023

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

@melvin-bot melvin-bot bot added the Overdue label May 15, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 15, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 15, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label May 15, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 15, 2023

Triggered auto assignment to @youssef-lr (External), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@allroundexperts
Copy link
Contributor

@flaviadefaria @youssef-lr This has already been fixed here

@flaviadefaria
Copy link
Contributor

Ah amazing so closing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Needs Reproduction Reproducible steps needed
Projects
None yet
Development

No branches or pull requests

5 participants