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

Solved closing of keyboard on changing text field on profile page #9441

Merged
merged 76 commits into from
Sep 6, 2022
Merged
Show file tree
Hide file tree
Changes from 73 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
8e9b60d
fixed closing of keyboard on changing text field on profile page
liyamahendra Jun 14, 2022
54e0294
Solved the incorrect display of error at bottom
liyamahendra Jun 16, 2022
26d331a
Solved automatic timezone checkbox not being clickable
liyamahendra Jun 16, 2022
060f307
Making CheckboxWithLabel compatible with the Form
liyamahendra Jun 17, 2022
d04ecac
Renamed Set Automatic Timezone Checkbox inputID
liyamahendra Jun 17, 2022
7d07035
Moved the character limit value to CONST
liyamahendra Jun 17, 2022
c4e1cf3
refactored doesFailCharacterLimit function and ProfilePage validation
liyamahendra Jun 17, 2022
e844388
Refactoring ProfilePage validation
liyamahendra Jun 17, 2022
651efb7
Fixed lint error
liyamahendra Jun 17, 2022
885ef63
added JSDoc for validate method
liyamahendra Jun 24, 2022
7fe6433
Using PROFILE_INPUTS_CHARACTER_LIMIT in RequestCallPage and PersonalD…
liyamahendra Jun 24, 2022
c7e6ae2
Removed the redundant style
liyamahendra Jun 24, 2022
a9a8b78
Refactored form name from PROFILE_FORM to PROFILE_SETTINGS_FORM
liyamahendra Jun 25, 2022
bcbee9a
refactored ProfilePage
liyamahendra Jun 25, 2022
fafbdeb
Removed inputID from LoginField
liyamahendra Jun 27, 2022
bacc8eb
Removed usage of getMaxCharacterError from validate method
liyamahendra Jun 27, 2022
10cfb09
Added missing import for Localize
liyamahendra Jun 29, 2022
b901c3c
Added JSdocs for values
liyamahendra Jun 29, 2022
e2e3e85
Removed firstName, lastName and pronouns from state
liyamahendra Jun 29, 2022
db10881
Removed firstName, lastName and pronouns from state and console.log s…
liyamahendra Jun 30, 2022
3fe935b
Moved state variables to class properties
liyamahendra Jul 1, 2022
329595b
changed if condition to ternary operator
liyamahendra Jul 2, 2022
0368f9b
Adding early return instead of conditionally wrapped function body
liyamahendra Jul 2, 2022
849ea0f
Added flexGrow1 to form style
liyamahendra Jul 2, 2022
614109e
Fixed self-select picker
liyamahendra Jul 2, 2022
b750b7b
Merge branch 'Expensify:main' into 9234
liyamahendra Jul 5, 2022
6bc29d9
Renamed PROFILE_INPUTS_CHARACTER_LIMIT to FORM_CHARACTER_LIMIT
liyamahendra Jul 11, 2022
bd42089
Making isAvatarChanged to true when updateAvatar is called
liyamahendra Jul 11, 2022
3c1b5c3
Saving draft values for all form elements
liyamahendra Jul 11, 2022
49f8a6d
Moved AvatarWithImagePicker outside form
liyamahendra Jul 11, 2022
0c93128
created a new function doesFailCharacterLimitAfterTrim
liyamahendra Jul 12, 2022
fe5933a
Resolved enable/disable of timezone picker
liyamahendra Jul 14, 2022
0e9ffbc
resolved conflicts
liyamahendra Jul 17, 2022
1542247
Merge branch 'Expensify:main' into 9234
liyamahendra Jul 20, 2022
303ab2c
Moved AvatarWithImagePicker inside Form
liyamahendra Jul 20, 2022
369ebe9
Merge branch '9234' of https://github.com/liyamahendra/Expensify into…
liyamahendra Jul 20, 2022
10f7274
Resolved conflicts due to rename of myPersonalDetails to currentUserP…
liyamahendra Jul 20, 2022
b60e13e
removed doesFailCharacterLimit
liyamahendra Jul 20, 2022
a1a1f38
Tested change related to currentUserPersonalDetails
liyamahendra Jul 20, 2022
7174104
solved the timezone guessing
liyamahendra Aug 2, 2022
e916b9f
Moved logins to state
liyamahendra Aug 2, 2022
eab67a8
Resolved merge conflicts
liyamahendra Aug 2, 2022
557c218
added missing curly brace
liyamahendra Aug 2, 2022
2247af9
Resolved conflicts
liyamahendra Aug 6, 2022
f43cbe7
Update src/libs/ValidationUtils.js
liyamahendra Aug 6, 2022
af2ba91
Keeping both doesFailCharacterLimit and doesFailCharacterLimitAfterTrim
liyamahendra Aug 6, 2022
a6d08bc
Revert package-lock.json
liyamahendra Aug 6, 2022
3ef2ae7
Update package-lock.json to main's codebase
liyamahendra Aug 8, 2022
78dcfd3
Fixed lint issue
liyamahendra Aug 8, 2022
7f88f46
Added a new line at bottom of package-lock.json
liyamahendra Aug 8, 2022
1791c52
Using doesFailCharacterLimit and trimming values
liyamahendra Aug 11, 2022
b760b67
Merge branch 'Expensify:main' into 9234
liyamahendra Aug 11, 2022
60c468b
Removed trim
liyamahendra Aug 12, 2022
3109ce3
Changes suggested by @luacmartins - Update src/pages/settings/Profile…
liyamahendra Aug 17, 2022
c088aca
Using PersonalDetails.updateProfile
liyamahendra Aug 17, 2022
63785a9
Merge branch 'Expensify:main' into 9234
liyamahendra Aug 19, 2022
4a7dcd8
Update src/pages/settings/Profile/ProfilePage.js
liyamahendra Aug 19, 2022
8e0b8b5
Update src/pages/settings/Profile/ProfilePage.js
liyamahendra Aug 19, 2022
13c853d
Update src/libs/actions/PersonalDetails.js
liyamahendra Aug 20, 2022
b80c9b8
Update src/pages/settings/Profile/ProfilePage.js
liyamahendra Aug 20, 2022
6664779
Update PersonalDetails.js
liyamahendra Aug 20, 2022
5822b7e
resolved conflicts
liyamahendra Aug 20, 2022
a059ebe
Removed shouldSaveDraft
liyamahendra Aug 22, 2022
313df27
Updated updateProfile function
liyamahendra Aug 23, 2022
30e704d
Moved PROFILE_SETTINGS_FORM to CONST
liyamahendra Aug 24, 2022
9dd6f06
Fixed lint - removed unused variable
liyamahendra Aug 25, 2022
c87184c
Resolved merge conflicts
liyamahendra Aug 25, 2022
82dd959
Removed KeyboardAvoidingView
liyamahendra Aug 31, 2022
da7d1b1
Resolved lint errors
liyamahendra Aug 31, 2022
963d242
resolved conflicts
liyamahendra Aug 31, 2022
447cd8a
Solved profile avatar update crash
liyamahendra Sep 3, 2022
a9c2cff
Trigger checks again
liyamahendra Sep 3, 2022
36061f6
Trigger checks again
liyamahendra Sep 3, 2022
9686c11
Using lodashGet for firstName and lastName
liyamahendra Sep 5, 2022
a796a5b
Removed unused constants
liyamahendra Sep 6, 2022
d035720
removed empty lines
liyamahendra Sep 6, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@ const CONST = {
// There's a limit of 60k characters in Auth - https://github.com/Expensify/Auth/blob/198d59547f71fdee8121325e8bc9241fc9c3236a/auth/lib/Request.h#L28
MAX_COMMENT_LENGTH: 60000,

FORM_CHARACTER_LIMIT: 50,
AVATAR_CROP_MODAL: {
// The next two constants control what is min and max value of the image crop scale.
// Values define in how many times the image can be bigger than its container.
Expand Down Expand Up @@ -791,6 +792,9 @@ const CONST = {
INVITE: 'invite',
LEAVE_ROOM: 'leaveRoom',
},
PROFILE_SETTINGS_FORM: 'profileSettingsForm',
MAX_64BIT_LEFT_HALF: 9223372036,
MAX_64BIT_RIGHT_HALF: 854775807,
liyamahendra marked this conversation as resolved.
Show resolved Hide resolved

// These split the maximum decimal value of a signed 64-bit number (9,223,372,036,854,775,807) into parts where none of them are too big to fit into a 32-bit number, so that we can
// generate them each with a random number generator with only 32-bits of precision.
Expand Down
15 changes: 14 additions & 1 deletion src/libs/ValidationUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,19 @@ function isValidRoutingNumber(number) {
* @returns {Boolean[]}
*/
function doesFailCharacterLimit(maxLength, valuesToBeValidated) {
liyamahendra marked this conversation as resolved.
Show resolved Hide resolved
return _.map(valuesToBeValidated, value => value.length > maxLength);
return _.map(valuesToBeValidated, value => value && value.length > maxLength);
}

/**
* Checks if each string in array is of valid length and then returns true
* for each string which exceeds the limit. The function trims the passed values.
liyamahendra marked this conversation as resolved.
Show resolved Hide resolved
*
* @param {Number} maxLength
* @param {String[]} valuesToBeValidated
* @returns {Boolean[]}
*/
function doesFailCharacterLimitAfterTrim(maxLength, valuesToBeValidated) {
return _.map(valuesToBeValidated, value => value && value.trim().length > maxLength);
liyamahendra marked this conversation as resolved.
Show resolved Hide resolved
}

/**
Expand Down Expand Up @@ -384,6 +396,7 @@ export {
isValidSSNLastFour,
isValidSSNFullNine,
doesFailCharacterLimit,
doesFailCharacterLimitAfterTrim,
isReservedRoomName,
isExistingRoomName,
isValidTaxID,
Expand Down
16 changes: 1 addition & 15 deletions src/libs/actions/PersonalDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function getDisplayName(login, personalDetail) {
* @returns {String}
*/
function getMaxCharacterError(isError) {
liyamahendra marked this conversation as resolved.
Show resolved Hide resolved
return isError ? Localize.translateLocal('personalDetails.error.characterLimit', {limit: 50}) : '';
return isError ? Localize.translateLocal('personalDetails.error.characterLimit', {limit: CONST.FORM_CHARACTER_LIMIT}) : '';
}

/**
Expand Down Expand Up @@ -263,7 +263,6 @@ function setPersonalDetails(details, shouldGrowl) {
}

function updateProfile(firstName, lastName, pronouns, timezone) {
const myPersonalDetails = personalDetails[currentUserEmail];
API.write('UpdateProfile', {
firstName,
lastName,
Expand All @@ -286,19 +285,6 @@ function updateProfile(firstName, lastName, pronouns, timezone) {
},
},
}],
failureData: [{
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: ONYXKEYS.PERSONAL_DETAILS,
value: {
[currentUserEmail]: {
firstName: myPersonalDetails.firstName,
lastName: myPersonalDetails.lastName,
pronouns: myPersonalDetails.pronouns,
timezone: myPersonalDetails.timeZone,
displayName: myPersonalDetails.displayName,
},
},
}],
});
}

Expand Down
Loading