App icon indicating copy to clipboard operation
App copied to clipboard

[HOLD for payment 2021-11-04] Edit Workspace - Saving an empty name shows infinite loading in button +$250 N6hold bonus

Open isagoico opened this issue 5 years ago • 23 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. Navigate to settings
  2. Click on a workspace
  3. Click on the workspace avatar to edit
  4. Delete the name and save

Expected Result:

There should be an error and the button should be enabled so the user can enter and save the new name.

Actual Result:

An error and a infinite loading is displayed in the button.

Workaround:

User has to refresh the page to remove the infinite loading and enable the button.

Platform:

Where is this issue occurring?

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

Version Number: 1.0.96-0

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

Notes/Photos/Videos: Any additional supporting documentation

image

Expensify/Expensify Issue URL:

Issue reported by: @parasharrajat Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1631214975132400

View all open jobs on GitHub

isagoico avatar Sep 10 '21 17:09 isagoico

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

MelvinBot avatar Sep 10 '21 17:09 MelvinBot

Proposal

  1. We should update the Validation isButtonDisabled so that button is disabled when the name is empty and is not an empty string. https://github.com/Expensify/App/blob/6cdfd4b9003e74d4ea1806f79ce16485f778ae6e/src/pages/workspace/WorkspaceEditorPage.js#L97
const isButtonDisabled = policy.isAvatarUploading
            || (this.state.avatarURL === this.props.policy.avatarURL
            && this.state.name === this.props.policy.name)
            || _.isEmpty(this.state.name.trim());
  1. Then we have to propagate the update API error to the main Promise. https://github.com/Expensify/App/blob/6cdfd4b9003e74d4ea1806f79ce16485f778ae6e/src/pages/workspace/WorkspaceEditorPage.js#L79

a. we should return a promise from update function and then return that promise in this then callback so that catch block can be triggered when update fails. With respect to this we should also throw the err in the catch block of the update Promise. b. Or, we can simply reset the loader in the catch block here https://github.com/Expensify/App/blob/6cdfd4b9003e74d4ea1806f79ce16485f778ae6e/src/libs/actions/Policy.js#L256.

            updateLocalPolicyValues(this.props.policy.id, {isPolicyUpdating: false});

I think it is good that there are fewer side-effects so I suggest 2.a.

parasharrajat avatar Sep 10 '21 18:09 parasharrajat

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

MelvinBot avatar Sep 13 '21 16:09 MelvinBot

Adding to Upwork now.

laurenreidexpensify avatar Sep 13 '21 16:09 laurenreidexpensify

@parasharrajat your proposal looks good!

johnmlee101 avatar Sep 13 '21 16:09 johnmlee101

https://www.upwork.com/jobs/~013b1b10c80cb7c1b2 will hire @parasharrajat now

laurenreidexpensify avatar Sep 13 '21 16:09 laurenreidexpensify

There have been recent changes to the Form design style guide. cc @Jag96. I would like to ask the same for this component.

  1. Instead of disabling the button, should we enable the button and show the error on blur and submit if the field is required?

parasharrajat avatar Sep 13 '21 20:09 parasharrajat

@Jag96 Any input? Thanks for looking into the request.

parasharrajat avatar Sep 14 '21 22:09 parasharrajat

@parasharrajat let's ensure the button is always enabled and that the error message shows up on submit if the field is required. We can leave out the onBlur for now, per this message.

Jag96 avatar Sep 14 '21 22:09 Jag96

On it. Thanks. @Jag96

But but... we have to check where if the name or avatar does not change button remains disabled. How should we handle this?

I think for this case button should be disabled. What do you say?

parasharrajat avatar Sep 14 '21 22:09 parasharrajat

Hi @parasharrajat, I've placed this issue on hold as per this update, as we are prioritising issues related to a feature release scheduled for 9/24. As an apology for the delay, we will add a $100 bonus as a thank you for waiting.

kadiealexander avatar Sep 16 '21 02:09 kadiealexander

Still on Hold

laurenreidexpensify avatar Sep 24 '21 07:09 laurenreidexpensify

Still on hold

laurenreidexpensify avatar Oct 05 '21 07:10 laurenreidexpensify

Please refer to this post for updated information on the n6 hold, we've raised the bonus to $250 for all issues where a PR is created before the N6 hold is lifted.

kadiealexander avatar Oct 08 '21 01:10 kadiealexander

Still on N6 Hold

laurenreidexpensify avatar Oct 13 '21 11:10 laurenreidexpensify

@johnmlee101 I think this should not be on n6-hold. Also, I see that the page is already changed but there is a bug in that code which this PR is trying to solve too.

So if you roll the dice here, I will update the PR and ready it for merge.

parasharrajat avatar Oct 13 '21 16:10 parasharrajat

@johnmlee101 as the N6 hold is lifted can you confirm if Rajat can move forward on the PR?

laurenreidexpensify avatar Oct 22 '21 07:10 laurenreidexpensify

@johnmlee101 bump

laurenreidexpensify avatar Oct 25 '21 10:10 laurenreidexpensify

@laurenreidexpensify PR is already ready for review and just need to be reviewed.

parasharrajat avatar Oct 25 '21 11:10 parasharrajat

Yep! @parasharrajat go ahead!

johnmlee101 avatar Oct 25 '21 16:10 johnmlee101