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 2022-11-02] [$250] Saving a workspace name should close the keyboard - reported by @chauchausoup #11195

Closed
mvtglobally opened this issue Sep 22, 2022 · 40 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review

Comments

@mvtglobally
Copy link

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 workspace section
  2. Click on workspace name
  3. Form input will come to address the change in the name
  4. Once a desired name is input, press save button
  5. Keyboard modal doesn’t goes down instead no any freezing behavior is shown on Save button

Expected Result:

Keyboard modal should close
Save button should be frozen as in web app

Actual Result:

Nothing happens. It remains as it is once a desired name is updated.

Workaround:

unknown

Platform:

Where is this issue occurring?

  • iOS
  • Android

Version Number: 1.2.1-0
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

Screen.Recording.2022-09-04.at.11.52.02.mov

Expensify/Expensify Issue URL:
Issue reported by: @chauchausoup
Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1662272007043879

View all open jobs on GitHub

@mvtglobally mvtglobally added AutoAssignerTriage Auto assign issues for triage to an available triage team member Daily KSv2 labels Sep 22, 2022
@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2022

Triggered auto assignment to @NicMendonca (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

@melvin-bot melvin-bot bot removed the AutoAssignerTriage Auto assign issues for triage to an available triage team member label Sep 22, 2022
@Puneet-here
Copy link
Contributor

Puneet-here commented Sep 22, 2022

Proposal

Add Keyboard.dismiss() after line 64 (not sure if we should dismiss the keyboard before validation or after, do we wanna keep the keyboard open if there is some error?)

submit() {
if (this.props.policy.isPolicyUpdating || !this.validate()) {
return;
}

We have to do the same for other pages too because it's not only on workspace settings page.

@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2022

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

@NicMendonca NicMendonca removed their assignment Sep 22, 2022
@Luke9389
Copy link
Contributor

@Puneet-here please wait for the Help Wanted label to be applied before leaving a proposal. Thanks!

@Luke9389 Luke9389 added the External Added to denote the issue can be worked on by a contributor label Sep 22, 2022
@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2022

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2022

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 22, 2022
@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2022

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

@melvin-bot melvin-bot bot changed the title Saving a workspace name should close the keyboard - reported by @chauchausoup [$250] Saving a workspace name should close the keyboard - reported by @chauchausoup Sep 22, 2022
@Puneet-here
Copy link
Contributor

@Puneet-here please wait for the Help Wanted label to be applied before leaving a proposal. Thanks!

Sorry for proposing early, I like the idea of waiting for the label to be applied. But recently most of the contributors are proposing just after the issue gets created. Because of it we really don't get the chance to propose a solution if we wait for the label.

@vladnyk
Copy link
Contributor

vladnyk commented Sep 23, 2022

@Puneet-here please wait for the Help Wanted label to be applied before leaving a proposal. Thanks!

Sorry for proposing early, I like the idea of waiting for the label to be applied. But recently most of the contributors are proposing just after the issue gets created. Because of it we really don't get the chance to propose a solution if we wait for the label.

It would be good to add something like below in contributing guideline:

Any proposals before applying External label are ignored, even though they are the best working proposals to the GH.
So if any contributor already proposed before External label by mistake, they need to re-submit proposal again after External applied. This is very risky because any other contributors can just copy a good proposal as soon as External applied.

This way, contributors save time wasting to search for non External issues.

cc: @mallenexpensify (sorry but I am tagging you because you were the last man to update CONTRIBUTING.md)

@Luke9389
Copy link
Contributor

Thanks so much for the feedback!

@mollfpr
Copy link
Contributor

mollfpr commented Sep 24, 2022

Proposal

I got confused after clicking the save button because there's no feedback and closing the keyboard doesn't make me realize if the save is a success.

I'm suggesting navigating the page back to the workspace initial page after submitting or adding a growl notification.

diff --git a/src/pages/workspace/WorkspaceSettingsPage.js b/src/pages/workspace/WorkspaceSettingsPage.js
index 40c370abb..ad3503a18 100644
--- a/src/pages/workspace/WorkspaceSettingsPage.js
+++ b/src/pages/workspace/WorkspaceSettingsPage.js
@@ -23,6 +23,8 @@ import withPolicy, {policyPropTypes, policyDefaultProps} from './withPolicy';
 import {withNetwork} from '../../components/OnyxProvider';
 import OfflineWithFeedback from '../../components/OfflineWithFeedback';
 import FullPageNotFoundView from '../../components/BlockingViews/FullPageNotFoundView';
+import Navigation from '../../libs/Navigation/Navigation';
+import ROUTES from '../../ROUTES';

 const propTypes = {
     ...policyPropTypes,
@@ -65,6 +67,7 @@ class WorkspaceSettingsPage extends React.Component {
         const name = this.state.name.trim();
         const outputCurrency = this.state.currency;
         Policy.updateGeneralSettings(this.props.policy.id, name, outputCurrency);
+        Navigation.navigate(ROUTES.getWorkspaceInitialRoute(this.props.policy.id));
     }

     validate() {

Result

Screen.Recording.2022-09-25.at.00.13.46.mov

@melvin-bot
Copy link

melvin-bot bot commented Sep 24, 2022

Looks like something related to react-navigation may have been mentioned in this issue discussion.

As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our DeprecatedCustomActions.js files should not be accepted.

Feel free to drop a note in #expensify-open-source with any questions.

@chauchausoup
Copy link

Saving a workspace name should close the keyboard and un select the focus from form input section. Also in case of other input form elements in ios and android app. When I do same thing in web app then the Save button is frozen immediately once its pressed. We need same sort of button freezing effect in ios app.
@mollfpr this is the actual issue as per slack thread.

@rushatgabhane
Copy link
Member

rushatgabhane commented Sep 25, 2022

Save button should be frozen as in web app

Don't agree with the expected results because https://github.com/Expensify/App/blob/main/contributingGuides/FORMS.md#form-submission

@Luke9389 How about we refactor this page to use Form.js? It should fix this issue and also get a refactor done

@MitchExpensify
Copy link
Contributor

Upwork Job

@syedsaroshfarrukhdot
Copy link
Contributor

Proposal
For dismissing Keyboard we need to add Keyboard.dismiss(); in submit function.

submit() {
if (this.props.policy.isPolicyUpdating || !this.validate()) {
return;
}

To disable button we need to add isDisabled={this.state.isDisabled ? true : false} in the button props

We need to add a new state isDisabled.

this.state = {
name: props.policy.name,
currency: props.policy.outputCurrency,
isDisabled: true,
};

this.state = {
name: props.policy.name,
currency: props.policy.outputCurrency,
};

We need to change state of isDisabled on Change of state of all fields in WorkspaceSettingPage to enable button again.

onImageSelected={(file) => {

                Policy.updateWorkspaceAvatar(
                  lodashGet(this.props.policy, 'id', ''),
                  file,
                );
                this.setState({isDisabled: false});

}}

onInputChange={(currency) => {

                  this.setState({currency});
                  this.setState({isDisabled: false});

}}

onChangeText={(name) => {

                this.setState({name});
                this.setState({isDisabled: false});

}}

submit Function should look something like this by adding Keyboard.dismiss() and setting this.setState({isDisabled: true}).

submit() {

if (this.props.policy.isPolicyUpdating || !this.validate()) {
  return;
}
const name = this.state.name.trim();
const outputCurrency = this.state.currency;
Policy.updateGeneralSettings(this.props.policy.id, name, outputCurrency);
Keyboard.dismiss();
this.setState({isDisabled: true});

}

Simulator.Screen.Recording.-.iPhone.13.Pro.-.2022-09-27.at.02.02.50.mp4

@Luke9389
Copy link
Contributor

@rushatgabhane I like the approach of refactoring to use Form.js 👍

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Help Wanted Apply this label when an issue is open to proposals by contributors Daily KSv2 labels Oct 4, 2022
@melvin-bot
Copy link

melvin-bot bot commented Oct 4, 2022

📣 @mollfpr You have been assigned to this job by @Luke9389!
Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@Luke9389
Copy link
Contributor

Luke9389 commented Oct 4, 2022

My bad @mollfpr, didn't realize I needed to assign you!

@MitchExpensify
Copy link
Contributor

MitchExpensify commented Oct 5, 2022

@chauchausoup mind applying for the Upwork job for eventual reporting bonus?

@melvin-bot melvin-bot bot added the Overdue label Oct 13, 2022
@Luke9389 Luke9389 added the Reviewing Has a PR in review label Oct 14, 2022
@Luke9389
Copy link
Contributor

@mollfpr is working on a PR. Not overdue.

@melvin-bot melvin-bot bot removed the Overdue label Oct 14, 2022
@chauchausoup
Copy link

@MitchExpensify can't open the Upwork link.

@mallenexpensify
Copy link
Contributor

@chauchausoup this should work for ya https://www.upwork.com/jobs/~014b51c853743c4959
The GH issue number and Expensify should always be in the job title.

@puneetlath puneetlath added the Bug Something is broken. Auto assigns a BugZero manager. label Oct 19, 2022
@MitchExpensify
Copy link
Contributor

Hired @chauchausoup, thanks for sharing the working link @mallenexpensify !

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 26, 2022
@melvin-bot melvin-bot bot changed the title [$250] Saving a workspace name should close the keyboard - reported by @chauchausoup [HOLD for payment 2022-11-02] [$250] Saving a workspace name should close the keyboard - reported by @chauchausoup Oct 26, 2022
@melvin-bot
Copy link

melvin-bot bot commented Oct 26, 2022

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.2.19-2 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 2022-11-02. 🎊

@MitchExpensify
Copy link
Contributor

Made a note to pay on 2022-11-02

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Nov 2, 2022
@MitchExpensify
Copy link
Contributor

Paid to all bar @mollfpr, just waiting on you to accept the offer! Thanks everyone

@mollfpr
Copy link
Contributor

mollfpr commented Nov 3, 2022

@MitchExpensify accepted, thanks!

@MitchExpensify
Copy link
Contributor

Paid all, thanks again

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 Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests