From 717e22b98c9642804dfaf9333fc23b6b0d23df17 Mon Sep 17 00:00:00 2001 From: Thiago Brezinski Date: Thu, 22 Jun 2023 16:56:08 +0100 Subject: [PATCH 001/649] chore: wip --- .../BaseSelectionListRadio.js | 29 +++- .../SelectionListRadio/CheckboxListItem.js | 96 +++++++++++ .../selectionListRadioPropTypes.js | 4 + src/pages/workspace/WorkspaceMembersPage.js | 161 +++++++++++++----- 4 files changed, 241 insertions(+), 49 deletions(-) create mode 100644 src/components/SelectionListRadio/CheckboxListItem.js diff --git a/src/components/SelectionListRadio/BaseSelectionListRadio.js b/src/components/SelectionListRadio/BaseSelectionListRadio.js index 2b8f373b987a..ac425771dd96 100644 --- a/src/components/SelectionListRadio/BaseSelectionListRadio.js +++ b/src/components/SelectionListRadio/BaseSelectionListRadio.js @@ -11,6 +11,7 @@ import CONST from '../../CONST'; import variables from '../../styles/variables'; import {propTypes as selectionListRadioPropTypes, defaultProps as selectionListRadioDefaultProps} from './selectionListRadioPropTypes'; import RadioListItem from './RadioListItem'; +import CheckboxListItem from './CheckboxListItem'; import useKeyboardShortcut from '../../hooks/useKeyboardShortcut'; import SafeAreaConsumer from '../SafeAreaConsumer'; import withKeyboardState, {keyboardStatePropTypes} from '../withKeyboardState'; @@ -44,6 +45,8 @@ function BaseSelectionListRadio(props) { let offset = 0; const itemLayouts = [{length: 0, offset}]; + let selectedCount = 0; + _.each(props.sections, (section, sectionIndex) => { // We're not rendering any section header, but we need to push to the array // because React Native accounts for it in getItemLayout @@ -51,16 +54,16 @@ function BaseSelectionListRadio(props) { itemLayouts.push({length: sectionHeaderHeight, offset}); offset += sectionHeaderHeight; - _.each(section.data, (option, optionIndex) => { + _.each(section.data, (item, optionIndex) => { // Add item to the general flattened array allOptions.push({ - ...option, + ...item, sectionIndex, index: optionIndex, }); // If disabled, add to the disabled indexes array - if (section.isDisabled || option.isDisabled) { + if (section.isDisabled || item.isDisabled) { disabledOptionsIndexes.push(disabledIndex); } disabledIndex += 1; @@ -69,6 +72,10 @@ function BaseSelectionListRadio(props) { const fullItemHeight = variables.optionRowHeight; itemLayouts.push({length: fullItemHeight, offset}); offset += fullItemHeight; + + if (item.isSelected) { + selectedCount++; + } }); // We're not rendering any section footer, but we need to push to the array @@ -80,6 +87,12 @@ function BaseSelectionListRadio(props) { // because React Native accounts for it in getItemLayout itemLayouts.push({length: 0, offset}); + if (selectedCount > 1 && !props.canSelectMultiple) { + throw new Error( + 'Dev error: SelectionList - multiple items are selected but prop `canSelectMultiple` is false. Please enable `canSelectMultiple` or make your list have only 1 item with `isSelected: true`.', + ); + } + return { allOptions, disabledOptionsIndexes, @@ -159,6 +172,16 @@ function BaseSelectionListRadio(props) { const renderItem = ({item, index, section}) => { const isFocused = focusedIndex === index + lodashGet(section, 'indexOffset', 0); + if (props.canSelectMultiple) { + return ( + + ); + } + return ( {}, +}; + +function CheckboxListItem(props) { + // TODO: REVIEW ERRORS + + const errors = {}; + + return ( + <> + props.onSelectRow(props.item)} + accessibilityLabel={props.item.text} + accessibilityRole="checkbox" + accessibilityState={{checked: props.item.isSelected}} + hoverDimmingValue={1} + hoverStyle={styles.hoveredComponentBG} + focusStyle={styles.hoveredComponentBG} + > + props.onSelectRow(props.item)} + /> + + + + + {props.item.text} + + + {Boolean(props.item.alternateText) && ( + + {props.item.alternateText} + + )} + + + + {props.item.isAdmin && ( + + {props.translate('common.admin')} + + )} + + {!_.isEmpty(errors[item.accountID]) && ( + + )} + + ); +} + +CheckboxListItem.displayName = 'CheckboxListItem'; +CheckboxListItem.propTypes = propTypes; +CheckboxListItem.defaultProps = defaultProps; + +export default withLocalize(CheckboxListItem); diff --git a/src/components/SelectionListRadio/selectionListRadioPropTypes.js b/src/components/SelectionListRadio/selectionListRadioPropTypes.js index 14e41b195d7b..39081def712b 100644 --- a/src/components/SelectionListRadio/selectionListRadioPropTypes.js +++ b/src/components/SelectionListRadio/selectionListRadioPropTypes.js @@ -33,6 +33,9 @@ const propTypes = { }), ).isRequired, + /** Whether this is a multi-select list */ + canSelectMultiple: PropTypes.bool, + /** Callback to fire when a row is tapped */ onSelectRow: PropTypes.func, @@ -71,6 +74,7 @@ const propTypes = { }; const defaultProps = { + canSelectMultiple: false, onSelectRow: () => {}, textInputLabel: '', textInputPlaceholder: '', diff --git a/src/pages/workspace/WorkspaceMembersPage.js b/src/pages/workspace/WorkspaceMembersPage.js index 2a5cecb1cf94..abf29731ca6d 100644 --- a/src/pages/workspace/WorkspaceMembersPage.js +++ b/src/pages/workspace/WorkspaceMembersPage.js @@ -38,6 +38,7 @@ import PressableWithFeedback from '../../components/Pressable/PressableWithFeedb import usePrevious from '../../hooks/usePrevious'; import Log from '../../libs/Log'; import * as PersonalDetailsUtils from '../../libs/PersonalDetailsUtils'; +import SelectionListRadio from '../../components/SelectionListRadio'; const propTypes = { /** The personal details of the person who is logged in */ @@ -249,9 +250,9 @@ function WorkspaceMembersPage(props) { // Add or remove the user if the checkbox is enabled if (_.contains(selectedEmployees, Number(accountID))) { - removeUser(accountID); + removeUser(Number(accountID)); } else { - addUser(accountID); + addUser(Number(accountID)); } }, [selectedEmployees, addUser, removeUser], @@ -395,6 +396,77 @@ function WorkspaceMembersPage(props) { const policyID = lodashGet(props.route, 'params.policyID'); const policyName = lodashGet(props.policy, 'name'); + const getListData = () => { + let result = []; + + _.each(props.policyMembers, (policyMember, accountID) => { + if (isDeletedPolicyMember(policyMember)) { + return; + } + + const details = props.personalDetails[accountID]; + + if (!details) { + Log.hmmm(`[WorkspaceMembersPage] no personal details found for policy member with accountID: ${accountID}`); + return; + } + + // If search value is provided, filter out members that don't match the search value + if (searchValue.trim()) { + let memberDetails = ''; + if (details.login) { + memberDetails += ` ${details.login.toLowerCase()}`; + } + if (details.firstName) { + memberDetails += ` ${details.firstName.toLowerCase()}`; + } + if (details.lastName) { + memberDetails += ` ${details.lastName.toLowerCase()}`; + } + if (details.displayName) { + memberDetails += ` ${details.displayName.toLowerCase()}`; + } + if (details.phoneNumber) { + memberDetails += ` ${details.phoneNumber.toLowerCase()}`; + } + + if (!OptionsListUtils.isSearchStringMatch(searchValue.trim(), memberDetails)) { + return; + } + } + + // If this policy is owned by Expensify then show all support (expensify.com or team.expensify.com) emails + // We don't want to show guides as policy members unless the user is a guide. Some customers get confused when they + // see random people added to their policy, but guides having access to the policies help set them up. + if (PolicyUtils.isExpensifyTeam(details.login || details.displayName)) { + if (policyOwner && currentUserLogin && !PolicyUtils.isExpensifyTeam(policyOwner) && !PolicyUtils.isExpensifyTeam(currentUserLogin)) { + return; + } + } + + result.push({ + keyForList: accountID, + isSelected: _.contains(selectedEmployees, Number(accountID)), + text: props.formatPhoneNumber(details.displayName), + alternateText: props.formatPhoneNumber(details.login), + isAdmin: props.session.email === details.login || policyMember.role === 'admin', + avatar: { + source: UserUtils.getAvatar(details.avatar, accountID), + name: details.login, + type: CONST.ICON_TYPE_AVATAR, + }, + }); + }); + + result = _.sortBy(result, (value) => value.text.toLowerCase()); + + return result; + }; + + const data2 = getListData(); + + const headerMessage = searchValue.trim() && !data2.length ? props.translate('common.noResultsFound') : ''; + return ( - - */} + {/* */} + {/* */} + {/* {data.length > 0 ? ( */} + + + _.contains(selectedEmployees, Number(accountID)))} + onPress={() => toggleAllUsers(removableMembers)} + /> + + {props.translate('workspace.people.selectAll')} + + + + toggleUser(item.keyForList)} /> + + {/* item.login} */} + {/* showsVerticalScrollIndicator */} + {/* style={[styles.ph5, styles.pb5]} */} + {/* contentContainerStyle={safeAreaPaddingBottomStyle} */} + {/* keyboardShouldPersistTaps="handled" */} + {/* /> */} - {data.length > 0 ? ( - - - toggleAllUsers(removableMembers)} - accessibilityRole={CONST.ACCESSIBILITY_ROLE.CHECKBOX} - accessibilityState={{ - checked: !_.isEmpty(removableMembers) && _.every(_.keys(removableMembers), (accountID) => _.contains(selectedEmployees, Number(accountID))), - }} - accessibilityLabel={props.translate('workspace.people.selectAll')} - hoverDimmingValue={1} - pressDimmingValue={0.7} - > - _.contains(selectedEmployees, Number(accountID)))} - onPress={() => toggleAllUsers(removableMembers)} - accessibilityLabel={props.translate('workspace.people.selectAll')} - /> - - - {props.translate('workspace.people.selectAll')} - - - item.login} - showsVerticalScrollIndicator - style={[styles.ph5, styles.pb5]} - contentContainerStyle={safeAreaPaddingBottomStyle} - keyboardShouldPersistTaps="handled" - /> - - ) : ( - - {props.translate('workspace.common.memberNotFound')} - - )} + {/* ) : ( */} + {/* */} + {/* {props.translate('workspace.common.memberNotFound')} */} + {/* */} + {/* )} */} )} From ae1586483be6e4088bbde35fc554407b6e70ca42 Mon Sep 17 00:00:00 2001 From: Thiago Brezinski Date: Tue, 27 Jun 2023 17:12:21 +0100 Subject: [PATCH 002/649] chore: fix conflicts --- .../BaseSelectionListRadio.js | 21 ++++++++++ .../SelectionListRadio/CheckboxListItem.js | 7 +++- .../selectionListRadioPropTypes.js | 6 ++- src/pages/workspace/WorkspaceMembersPage.js | 39 ++++++++++++------- src/styles/styles.js | 3 +- 5 files changed, 59 insertions(+), 17 deletions(-) diff --git a/src/components/SelectionListRadio/BaseSelectionListRadio.js b/src/components/SelectionListRadio/BaseSelectionListRadio.js index ac425771dd96..f7183be08149 100644 --- a/src/components/SelectionListRadio/BaseSelectionListRadio.js +++ b/src/components/SelectionListRadio/BaseSelectionListRadio.js @@ -15,6 +15,9 @@ import CheckboxListItem from './CheckboxListItem'; import useKeyboardShortcut from '../../hooks/useKeyboardShortcut'; import SafeAreaConsumer from '../SafeAreaConsumer'; import withKeyboardState, {keyboardStatePropTypes} from '../withKeyboardState'; +import Checkbox from '../Checkbox'; +import withLocalize from '../withLocalize'; +import PressableWithFeedback from '../Pressable/PressableWithFeedback'; const propTypes = { ...keyboardStatePropTypes, @@ -97,6 +100,7 @@ function BaseSelectionListRadio(props) { allOptions, disabledOptionsIndexes, itemLayouts, + allSelected: selectedCount === allOptions.length - disabledOptionsIndexes.length, }; }; @@ -258,6 +262,23 @@ function BaseSelectionListRadio(props) { {props.headerMessage} )} + {!props.headerMessage && props.canSelectMultiple && ( + + + + {props.translate('workspace.people.selectAll')} + + + )} props.onSelectRow(props.item)} + disabled={props.item.isDisabled} + disabledStyle={styles.buttonOpacityDisabled} accessibilityLabel={props.item.text} accessibilityRole="checkbox" accessibilityState={{checked: props.item.isSelected}} @@ -49,11 +51,12 @@ function CheckboxListItem(props) { focusStyle={styles.hoveredComponentBG} > props.onSelectRow(props.item)} /> - + {}, + onSelectAll: () => {}, textInputLabel: '', textInputPlaceholder: '', textInputValue: '', diff --git a/src/pages/workspace/WorkspaceMembersPage.js b/src/pages/workspace/WorkspaceMembersPage.js index abf29731ca6d..1c3a5370baa9 100644 --- a/src/pages/workspace/WorkspaceMembersPage.js +++ b/src/pages/workspace/WorkspaceMembersPage.js @@ -30,8 +30,6 @@ import FullPageNotFoundView from '../../components/BlockingViews/FullPageNotFoun import networkPropTypes from '../../components/networkPropTypes'; import * as UserUtils from '../../libs/UserUtils'; import FormHelpMessage from '../../components/FormHelpMessage'; -import TextInput from '../../components/TextInput'; -import KeyboardDismissingFlatList from '../../components/KeyboardDismissingFlatList'; import withCurrentUserPersonalDetails from '../../components/withCurrentUserPersonalDetails'; import * as PolicyUtils from '../../libs/PolicyUtils'; import PressableWithFeedback from '../../components/Pressable/PressableWithFeedback'; @@ -204,8 +202,16 @@ function WorkspaceMembersPage(props) { * @param {Object} memberList */ const toggleAllUsers = (memberList) => { - const accountIDList = _.map(_.keys(memberList), (memberAccountID) => Number(memberAccountID)); - setSelectedEmployees((prevSelected) => (!_.every(accountIDList, (memberAccountID) => _.contains(prevSelected, memberAccountID)) ? accountIDList : [])); + const enabledAccounts = _.filter(memberList, (member) => !member.isDisabled); + const everyoneSelected = _.every(enabledAccounts, (member) => _.contains(selectedEmployees, Number(member.keyForList))); + + if (everyoneSelected) { + setSelectedEmployees([]); + } else { + const everyAccountId = _.map(enabledAccounts, (member) => Number(member.keyForList)); + setSelectedEmployees(everyAccountId); + } + validateSelection(); }; @@ -447,6 +453,7 @@ function WorkspaceMembersPage(props) { result.push({ keyForList: accountID, isSelected: _.contains(selectedEmployees, Number(accountID)), + isDisabled: props.session.email === details.login, text: props.formatPhoneNumber(details.displayName), alternateText: props.formatPhoneNumber(details.login), isAdmin: props.session.email === details.login || policyMember.role === 'admin', @@ -523,15 +530,15 @@ function WorkspaceMembersPage(props) { {/* */} {/* {data.length > 0 ? ( */} - - _.contains(selectedEmployees, Number(accountID)))} - onPress={() => toggleAllUsers(removableMembers)} - /> - - {props.translate('workspace.people.selectAll')} - - + {/* */} + {/* _.contains(selectedEmployees, Number(accountID)))} */} + {/* onPress={() => toggleAllUsers(removableMembers)} */} + {/* /> */} + {/* */} + {/* {props.translate('workspace.people.selectAll')} */} + {/* */} + {/* */} toggleUser(item.keyForList)} + onSelectAll={() => toggleAllUsers(data2)} + initiallyFocusedOptionKey={lodashGet( + _.find(data2, (item) => !item.isDisabled), + 'keyForList', + undefined, + )} /> {/* Date: Tue, 27 Jun 2023 08:47:55 +0100 Subject: [PATCH 003/649] chore: add avatar to checkbox item --- .../SelectionListRadio/CheckboxListItem.js | 42 ++-- src/pages/workspace/WorkspaceMembersPage.js | 233 ++++++------------ src/styles/utilities/spacing.js | 4 + 3 files changed, 96 insertions(+), 183 deletions(-) diff --git a/src/components/SelectionListRadio/CheckboxListItem.js b/src/components/SelectionListRadio/CheckboxListItem.js index 72a52bb9f349..fa193b4cc9ec 100644 --- a/src/components/SelectionListRadio/CheckboxListItem.js +++ b/src/components/SelectionListRadio/CheckboxListItem.js @@ -10,6 +10,7 @@ import Checkbox from '../Checkbox'; import FormHelpMessage from '../FormHelpMessage'; import {propTypes as item} from '../UserDetailsTooltip/userDetailsTooltipPropTypes'; import withLocalize, {withLocalizePropTypes} from '../withLocalize'; +import Avatar from '../Avatar'; const propTypes = { /** The section list item */ @@ -55,26 +56,27 @@ function CheckboxListItem(props) { isChecked={props.item.isSelected} onPress={() => props.onSelectRow(props.item)} /> - - - - - {props.item.text} - - - {Boolean(props.item.alternateText) && ( - - {props.item.alternateText} - - )} - - + + + + {props.item.text} + + {Boolean(props.item.alternateText) && ( + + {props.item.alternateText} + + )} {props.item.isAdmin && ( diff --git a/src/pages/workspace/WorkspaceMembersPage.js b/src/pages/workspace/WorkspaceMembersPage.js index 1c3a5370baa9..176b720c3057 100644 --- a/src/pages/workspace/WorkspaceMembersPage.js +++ b/src/pages/workspace/WorkspaceMembersPage.js @@ -128,41 +128,6 @@ function WorkspaceMembersPage(props) { getWorkspaceMembers(); }, [props.network.isOffline, prevIsOffline, getWorkspaceMembers]); - /** - * This function will iterate through the details of each policy member to check if the - * search string matches with any detail and return that filter. - * @param {Array} policyMembersPersonalDetails - This is the list of policy members - * @param {*} search - This is the string that the user has entered - * @returns {Array} - The list of policy members that have anything similar to the searchValue - */ - const getMemberOptions = (policyMembersPersonalDetails, search) => { - // If no search value, we return all members. - if (_.isEmpty(search)) { - return policyMembersPersonalDetails; - } - - // We will filter through each policy member details to determine if they should be shown - return _.filter(policyMembersPersonalDetails, (member) => { - let memberDetails = ''; - if (member.login) { - memberDetails += ` ${member.login.toLowerCase()}`; - } - if (member.firstName) { - memberDetails += ` ${member.firstName.toLowerCase()}`; - } - if (member.lastName) { - memberDetails += ` ${member.lastName.toLowerCase()}`; - } - if (member.displayName) { - memberDetails += ` ${member.displayName.toLowerCase()}`; - } - if (member.phoneNumber) { - memberDetails += ` ${member.phoneNumber.toLowerCase()}`; - } - return OptionsListUtils.isSearchStringMatch(search, memberDetails); - }); - }; - /** * Open the modal to invite a user */ @@ -367,38 +332,15 @@ function WorkspaceMembersPage(props) { const policyOwner = lodashGet(props.policy, 'owner'); const currentUserLogin = lodashGet(props.currentUserPersonalDetails, 'login'); - const removableMembers = {}; - let data = []; - _.each(props.policyMembers, (policyMember, accountID) => { - if (isDeletedPolicyMember(policyMember)) { - return; - } - const details = props.personalDetails[accountID]; - if (!details) { - Log.hmmm(`[WorkspaceMembersPage] no personal details found for policy member with accountID: ${accountID}`); - return; - } - data.push({ - ...policyMember, - ...details, - }); - }); - data = _.sortBy(data, (value) => value.displayName.toLowerCase()); - data = getMemberOptions(data, searchValue.trim().toLowerCase()); - - // If this policy is owned by Expensify then show all support (expensify.com or team.expensify.com) emails - // We don't want to show guides as policy members unless the user is a guide. Some customers get confused when they - // see random people added to their policy, but guides having access to the policies help set them up. - if (policyOwner && currentUserLogin && !PolicyUtils.isExpensifyTeam(policyOwner) && !PolicyUtils.isExpensifyTeam(currentUserLogin)) { - data = _.reject(data, (member) => PolicyUtils.isExpensifyTeam(member.login || member.displayName)); - } - - _.each(data, (member) => { - if (member.accountID === props.session.accountID || member.login === props.policy.owner || member.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) { - return; - } - removableMembers[member.accountID] = member; - }); + + // const removableMembers = {}; + // _.each(data, (member) => { + // if (member.accountID === props.session.accountID || member.login === props.policy.owner || member.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) { + // return; + // } + // removableMembers[member.accountID] = member; + // }); + const policyID = lodashGet(props.route, 'params.policyID'); const policyName = lodashGet(props.policy, 'name'); @@ -470,110 +412,75 @@ function WorkspaceMembersPage(props) { return result; }; - const data2 = getListData(); + const data = getListData(); - const headerMessage = searchValue.trim() && !data2.length ? props.translate('common.noResultsFound') : ''; + const headerMessage = searchValue.trim() && !data.length ? props.translate('workspace.common.memberNotFound') : ''; return ( - {({safeAreaPaddingBottomStyle}) => ( - Navigation.goBack(ROUTES.SETTINGS_WORKSPACES)} - > - { - setSearchValue(''); - Navigation.goBack(ROUTES.getWorkspaceInitialRoute(policyID)); - }} - shouldShowGetAssistanceButton - guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_MEMBERS} - /> - setRemoveMembersConfirmModalVisible(false)} - prompt={props.translate('workspace.people.removeMembersPrompt')} - confirmText={props.translate('common.remove')} - cancelText={props.translate('common.cancel')} - /> - - - ) : ( diff --git a/src/styles/styles.js b/src/styles/styles.js index 25eb0a055afc..2f95945a0d3f 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -550,9 +550,8 @@ const styles = { buttonDivider: { width: 1, - alignSelf: 'stretch', - backgroundColor: themeColors.appBG, - marginVertical: 1, + backgroundColor: themeColors.text, + height: 28, }, noBorderRadius: { From d8594f5f33db474bbdea94aacea58b6e77e36ffa Mon Sep 17 00:00:00 2001 From: jeet-dhandha Date: Wed, 19 Jul 2023 14:32:06 +0530 Subject: [PATCH 021/649] chore: extract emojis from paste text --- src/CONST.js | 1 + src/libs/EmojiUtils.js | 44 ++++++++++++++++++- src/pages/home/report/ReportActionCompose.js | 2 +- .../report/ReportActionItemMessageEdit.js | 2 +- 4 files changed, 46 insertions(+), 3 deletions(-) diff --git a/src/CONST.js b/src/CONST.js index 9a45cd631a90..85560caf0fd3 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -1148,6 +1148,7 @@ const CONST = { // eslint-disable-next-line max-len, no-misleading-character-class EMOJIS: /[\p{Extended_Pictographic}\u200d\u{1f1e6}-\u{1f1ff}\u{1f3fb}-\u{1f3ff}\u{e0020}-\u{e007f}\u20E3\uFE0F]|[#*0-9]\uFE0F?\u20E3/gu, + CODE_EMOJIS: /(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/gi, TAX_ID: /^\d{9}$/, NON_NUMERIC: /\D/g, diff --git a/src/libs/EmojiUtils.js b/src/libs/EmojiUtils.js index 15f1d5301836..eed3865e3a4b 100644 --- a/src/libs/EmojiUtils.js +++ b/src/libs/EmojiUtils.js @@ -258,6 +258,47 @@ const getEmojiCodeWithSkinColor = (item, preferredSkinToneIndex) => { return code; }; +/** + * Extracts emojis from a given text. + * + * @param {string} text - The text to extract emojis from. + * @returns {string[]} An array of emoji codes. + */ +function extractEmojis(text) { + const emojis = []; + if (!text || typeof text !== 'string') return emojis; + + let parseEmojis = text.match(CONST.REGEX.CODE_EMOJIS); + if (!parseEmojis) return emojis; + + parseEmojis = [...new Set(parseEmojis)]; + + for (let i = 0; i < parseEmojis.length; i++) { + const character = parseEmojis[i]; + const emoji = Emojis.emojiCodeTable[character]; + if (!emoji) continue; + emojis.push(emoji); + } + + return emojis; +} + +/** + * Find all emojis in a text and replace them with their code. + * @param {string} text + * @param {number} preferredSkinTone + * @param {string} lang + * @returns + */ +function replaceAndExtractEmojis(text, preferredSkinTone = CONST.EMOJI_DEFAULT_SKIN_TONE, lang = CONST.LOCALES.DEFAULT) { + const {text: newDraft = '', emojis = []} = replaceEmojis(text, preferredSkinTone, lang); + + return { + text: newDraft, + emojis: emojis.concat(extractEmojis(text)), + }; +} + /** * Replace any emoji name in a text with the emoji icon. * If we're on mobile, we also add a space after the emoji granted there's no text after it. @@ -265,7 +306,7 @@ const getEmojiCodeWithSkinColor = (item, preferredSkinToneIndex) => { * @param {String} text * @param {Number} preferredSkinTone * @param {String} lang - * @returns {Object} + * @returns {{text: String, emojis: Array}} */ function replaceEmojis(text, preferredSkinTone = CONST.EMOJI_DEFAULT_SKIN_TONE, lang = CONST.LOCALES.DEFAULT) { const trie = emojisTrie[lang]; @@ -416,4 +457,5 @@ export { getPreferredSkinToneIndex, getPreferredEmojiCode, getUniqueEmojiCodes, + replaceAndExtractEmojis, }; diff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js index 8155f09b2aac..5794349d809e 100644 --- a/src/pages/home/report/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose.js @@ -789,7 +789,7 @@ class ReportActionCompose extends React.Component { * @param {Boolean} shouldDebounceSaveComment */ updateComment(comment, shouldDebounceSaveComment) { - const {text: newComment = '', emojis = []} = EmojiUtils.replaceEmojis(comment, this.props.preferredSkinTone, this.props.preferredLocale); + const {text: newComment = '', emojis = []} = EmojiUtils.replaceAndExtractEmojis(comment, this.props.preferredSkinTone, this.props.preferredLocale); if (!_.isEmpty(emojis)) { this.insertedEmojis = [...this.insertedEmojis, ...emojis]; diff --git a/src/pages/home/report/ReportActionItemMessageEdit.js b/src/pages/home/report/ReportActionItemMessageEdit.js index c7b39734961f..62f7c0fc1880 100644 --- a/src/pages/home/report/ReportActionItemMessageEdit.js +++ b/src/pages/home/report/ReportActionItemMessageEdit.js @@ -162,7 +162,7 @@ function ReportActionItemMessageEdit(props) { */ const updateDraft = useCallback( (newDraftInput) => { - const {text: newDraft = '', emojis = []} = EmojiUtils.replaceEmojis(newDraftInput, props.preferredSkinTone, props.preferredLocale); + const {text: newDraft = '', emojis = []} = EmojiUtils.replaceAndExtractEmojis(newDraftInput, props.preferredSkinTone, props.preferredLocale); if (!_.isEmpty(emojis)) { insertedEmojis.current = [...insertedEmojis.current, ...emojis]; From 29f0a45618c39333f2b184bcbff2b47c48e32b53 Mon Sep 17 00:00:00 2001 From: jeet-dhandha Date: Wed, 19 Jul 2023 14:52:14 +0530 Subject: [PATCH 022/649] chore: lint issue fix --- src/libs/EmojiUtils.js | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/libs/EmojiUtils.js b/src/libs/EmojiUtils.js index eed3865e3a4b..69b0d6725433 100644 --- a/src/libs/EmojiUtils.js +++ b/src/libs/EmojiUtils.js @@ -276,29 +276,13 @@ function extractEmojis(text) { for (let i = 0; i < parseEmojis.length; i++) { const character = parseEmojis[i]; const emoji = Emojis.emojiCodeTable[character]; - if (!emoji) continue; + if (!emoji) continue; // eslint-disable-line no-continue emojis.push(emoji); } return emojis; } -/** - * Find all emojis in a text and replace them with their code. - * @param {string} text - * @param {number} preferredSkinTone - * @param {string} lang - * @returns - */ -function replaceAndExtractEmojis(text, preferredSkinTone = CONST.EMOJI_DEFAULT_SKIN_TONE, lang = CONST.LOCALES.DEFAULT) { - const {text: newDraft = '', emojis = []} = replaceEmojis(text, preferredSkinTone, lang); - - return { - text: newDraft, - emojis: emojis.concat(extractEmojis(text)), - }; -} - /** * Replace any emoji name in a text with the emoji icon. * If we're on mobile, we also add a space after the emoji granted there's no text after it. @@ -344,6 +328,22 @@ function replaceEmojis(text, preferredSkinTone = CONST.EMOJI_DEFAULT_SKIN_TONE, return {text: newText, emojis}; } +/** + * Find all emojis in a text and replace them with their code. + * @param {string} text + * @param {number} preferredSkinTone + * @param {string} lang + * @returns {{text: string, emojis: string[]}} + */ +function replaceAndExtractEmojis(text, preferredSkinTone = CONST.EMOJI_DEFAULT_SKIN_TONE, lang = CONST.LOCALES.DEFAULT) { + const {text: newDraft = '', emojis = []} = replaceEmojis(text, preferredSkinTone, lang); + + return { + text: newDraft, + emojis: emojis.concat(extractEmojis(text)), + }; +} + /** * Suggest emojis when typing emojis prefix after colon * @param {String} text From 61444f805e5002661ce7729d051acdf1365296e4 Mon Sep 17 00:00:00 2001 From: jeet-dhandha Date: Fri, 21 Jul 2023 02:46:29 +0530 Subject: [PATCH 023/649] chore: change jsdoc and varible names --- src/libs/EmojiUtils.js | 23 +++++++++++-------- src/pages/home/report/ReportActionCompose.js | 2 +- .../report/ReportActionItemMessageEdit.js | 2 +- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/libs/EmojiUtils.js b/src/libs/EmojiUtils.js index 69b0d6725433..b1ad5b936d2e 100644 --- a/src/libs/EmojiUtils.js +++ b/src/libs/EmojiUtils.js @@ -261,15 +261,18 @@ const getEmojiCodeWithSkinColor = (item, preferredSkinToneIndex) => { /** * Extracts emojis from a given text. * - * @param {string} text - The text to extract emojis from. - * @returns {string[]} An array of emoji codes. + * @param {String} text - The text to extract emojis from. + * @returns {Object[]} An array of emoji codes. */ function extractEmojis(text) { const emojis = []; if (!text || typeof text !== 'string') return emojis; let parseEmojis = text.match(CONST.REGEX.CODE_EMOJIS); - if (!parseEmojis) return emojis; + + if (!parseEmojis) { + return emojis; + } parseEmojis = [...new Set(parseEmojis)]; @@ -290,7 +293,7 @@ function extractEmojis(text) { * @param {String} text * @param {Number} preferredSkinTone * @param {String} lang - * @returns {{text: String, emojis: Array}} + * @returns {Object} */ function replaceEmojis(text, preferredSkinTone = CONST.EMOJI_DEFAULT_SKIN_TONE, lang = CONST.LOCALES.DEFAULT) { const trie = emojisTrie[lang]; @@ -330,16 +333,16 @@ function replaceEmojis(text, preferredSkinTone = CONST.EMOJI_DEFAULT_SKIN_TONE, /** * Find all emojis in a text and replace them with their code. - * @param {string} text - * @param {number} preferredSkinTone - * @param {string} lang - * @returns {{text: string, emojis: string[]}} + * @param {String} text + * @param {Number} preferredSkinTone + * @param {String} lang + * @returns {Object} */ function replaceAndExtractEmojis(text, preferredSkinTone = CONST.EMOJI_DEFAULT_SKIN_TONE, lang = CONST.LOCALES.DEFAULT) { - const {text: newDraft = '', emojis = []} = replaceEmojis(text, preferredSkinTone, lang); + const {text: covertedText = '', emojis = []} = replaceEmojis(text, preferredSkinTone, lang); return { - text: newDraft, + text: covertedText, emojis: emojis.concat(extractEmojis(text)), }; } diff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js index 5794349d809e..e59acd640baf 100644 --- a/src/pages/home/report/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose.js @@ -789,7 +789,7 @@ class ReportActionCompose extends React.Component { * @param {Boolean} shouldDebounceSaveComment */ updateComment(comment, shouldDebounceSaveComment) { - const {text: newComment = '', emojis = []} = EmojiUtils.replaceAndExtractEmojis(comment, this.props.preferredSkinTone, this.props.preferredLocale); + const {text: newComment, emojis} = EmojiUtils.replaceAndExtractEmojis(comment, this.props.preferredSkinTone, this.props.preferredLocale); if (!_.isEmpty(emojis)) { this.insertedEmojis = [...this.insertedEmojis, ...emojis]; diff --git a/src/pages/home/report/ReportActionItemMessageEdit.js b/src/pages/home/report/ReportActionItemMessageEdit.js index 62f7c0fc1880..f4231ef50961 100644 --- a/src/pages/home/report/ReportActionItemMessageEdit.js +++ b/src/pages/home/report/ReportActionItemMessageEdit.js @@ -162,7 +162,7 @@ function ReportActionItemMessageEdit(props) { */ const updateDraft = useCallback( (newDraftInput) => { - const {text: newDraft = '', emojis = []} = EmojiUtils.replaceAndExtractEmojis(newDraftInput, props.preferredSkinTone, props.preferredLocale); + const {text: newDraft, emojis} = EmojiUtils.replaceAndExtractEmojis(newDraftInput, props.preferredSkinTone, props.preferredLocale); if (!_.isEmpty(emojis)) { insertedEmojis.current = [...insertedEmojis.current, ...emojis]; From 27f37b824531449f2ac99fc35c29455ea38db1e2 Mon Sep 17 00:00:00 2001 From: jeet-dhandha Date: Fri, 21 Jul 2023 02:47:37 +0530 Subject: [PATCH 024/649] chore: change condition for early return --- src/libs/EmojiUtils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libs/EmojiUtils.js b/src/libs/EmojiUtils.js index b1ad5b936d2e..eeb3774923a5 100644 --- a/src/libs/EmojiUtils.js +++ b/src/libs/EmojiUtils.js @@ -266,7 +266,9 @@ const getEmojiCodeWithSkinColor = (item, preferredSkinToneIndex) => { */ function extractEmojis(text) { const emojis = []; - if (!text || typeof text !== 'string') return emojis; + if (!text) { + return emojis; + } let parseEmojis = text.match(CONST.REGEX.CODE_EMOJIS); From 2758401d1cd7aebc69f4775b50be2707ff6dd38d Mon Sep 17 00:00:00 2001 From: jeet-dhandha Date: Fri, 21 Jul 2023 02:55:32 +0530 Subject: [PATCH 025/649] chore: remove extra regex and use the available one EMOJIS --- src/CONST.js | 1 - src/libs/EmojiUtils.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/CONST.js b/src/CONST.js index 483a87b4a3ce..b7a730821fdb 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -1148,7 +1148,6 @@ const CONST = { // eslint-disable-next-line max-len, no-misleading-character-class EMOJIS: /[\p{Extended_Pictographic}\u200d\u{1f1e6}-\u{1f1ff}\u{1f3fb}-\u{1f3ff}\u{e0020}-\u{e007f}\u20E3\uFE0F]|[#*0-9]\uFE0F?\u20E3/gu, - CODE_EMOJIS: /(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/gi, TAX_ID: /^\d{9}$/, NON_NUMERIC: /\D/g, diff --git a/src/libs/EmojiUtils.js b/src/libs/EmojiUtils.js index eeb3774923a5..56ffed9e1086 100644 --- a/src/libs/EmojiUtils.js +++ b/src/libs/EmojiUtils.js @@ -270,7 +270,7 @@ function extractEmojis(text) { return emojis; } - let parseEmojis = text.match(CONST.REGEX.CODE_EMOJIS); + let parseEmojis = text.match(CONST.REGEX.EMOJIS); if (!parseEmojis) { return emojis; From 8cccc8969d4356ce870c2a2bf7ac85e4bb8119b9 Mon Sep 17 00:00:00 2001 From: jeet-dhandha Date: Fri, 21 Jul 2023 12:37:04 +0530 Subject: [PATCH 026/649] chore: variable name spell fix --- src/libs/EmojiUtils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/EmojiUtils.js b/src/libs/EmojiUtils.js index 56ffed9e1086..dee635089e00 100644 --- a/src/libs/EmojiUtils.js +++ b/src/libs/EmojiUtils.js @@ -341,10 +341,10 @@ function replaceEmojis(text, preferredSkinTone = CONST.EMOJI_DEFAULT_SKIN_TONE, * @returns {Object} */ function replaceAndExtractEmojis(text, preferredSkinTone = CONST.EMOJI_DEFAULT_SKIN_TONE, lang = CONST.LOCALES.DEFAULT) { - const {text: covertedText = '', emojis = []} = replaceEmojis(text, preferredSkinTone, lang); + const {text: convertedText = '', emojis = []} = replaceEmojis(text, preferredSkinTone, lang); return { - text: covertedText, + text: convertedText, emojis: emojis.concat(extractEmojis(text)), }; } From f21a96a1af29b4891bd71d4d00bcbc1ea1b02a43 Mon Sep 17 00:00:00 2001 From: Thiago Brezinski Date: Mon, 24 Jul 2023 09:14:57 +0100 Subject: [PATCH 027/649] chore: fix YearPickerModal propTypes --- src/components/NewDatePicker/CalendarPicker/YearPickerModal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/NewDatePicker/CalendarPicker/YearPickerModal.js b/src/components/NewDatePicker/CalendarPicker/YearPickerModal.js index 1b9db36eac7e..d8e763e64403 100644 --- a/src/components/NewDatePicker/CalendarPicker/YearPickerModal.js +++ b/src/components/NewDatePicker/CalendarPicker/YearPickerModal.js @@ -13,7 +13,7 @@ const propTypes = { isVisible: PropTypes.bool.isRequired, /** The list of years to render */ - years: PropTypes.arrayOf(PropTypes.shape(radioListItemPropTypes)).isRequired, + years: PropTypes.arrayOf(PropTypes.shape(radioListItemPropTypes.item)).isRequired, /** Currently selected year */ currentYear: PropTypes.number, From 35301b5a4ce3699b59b76bc6824ff86719be084b Mon Sep 17 00:00:00 2001 From: Thiago Brezinski Date: Tue, 25 Jul 2023 10:18:02 +0100 Subject: [PATCH 028/649] test: add test for formatMemberForList --- src/libs/OptionsListUtils.js | 2 +- tests/unit/OptionsListUtilsTest.js | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index b56761b9155d..95b67176dadb 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -1009,7 +1009,7 @@ function formatMemberForList(member, isSelected) { login: lodashGet(member, 'login', ''), isAdmin: false, avatar: { - source: lodashGet(member, 'participantsList[0].avatar', '') || lodashGet(member, 'avatar', ''), + source: lodashGet(member, 'participantsList[0].avatar', '') || lodashGet(member, 'avatar', '') || UserUtils.getDefaultAvatar(lodashGet(member, 'accountID', '')), name: lodashGet(member, 'participantsList[0].login', '') || lodashGet(member, 'displayName', ''), type: 'avatar', }, diff --git a/tests/unit/OptionsListUtilsTest.js b/tests/unit/OptionsListUtilsTest.js index 86592e6f1aaf..0a4dc489edac 100644 --- a/tests/unit/OptionsListUtilsTest.js +++ b/tests/unit/OptionsListUtilsTest.js @@ -621,4 +621,28 @@ describe('OptionsListUtils', () => { expect(results.personalDetails.length).toBe(1); expect(results.personalDetails[0].text).toBe('Spider-Man'); }); + + it('formatMemberForList()', () => { + const formattedMembers = _.map(PERSONAL_DETAILS, (personalDetail, key) => OptionsListUtils.formatMemberForList(personalDetail, key === '1')); + + // We're only formatting a single item, so orders should be the same as the original PERSONAL_DETAILS array + expect(formattedMembers[0].text).toBe('Mister Fantastic'); + expect(formattedMembers[1].text).toBe('Iron Man'); + expect(formattedMembers[2].text).toBe('Spider-Man'); + + // We should expect only the first item to be selected + expect(formattedMembers[0].isSelected).toBe(true); + + // And all the others to be unselected + expect(_.every(formattedMembers.slice(1), (personalDetail) => !personalDetail.isSelected)).toBe(true); + + // `isDisabled` is always false + expect(_.every(formattedMembers, (personalDetail) => !personalDetail.isDisabled)).toBe(true); + + // `isAdmin` is always false + expect(_.every(formattedMembers, (personalDetail) => !personalDetail.isAdmin)).toBe(true); + + // The PERSONAL_DETAILS list doesn't specify `participantsList[n].avatar`, so the default one should be used + expect(_.every(formattedMembers, (personalDetail) => Boolean(personalDetail.avatar.source))).toBe(true); + }); }); From 137cff31ee3e68e636e5bed37399b6a4d85e71d2 Mon Sep 17 00:00:00 2001 From: Thiago Brezinski Date: Tue, 25 Jul 2023 10:21:48 +0100 Subject: [PATCH 029/649] test: improve comment --- tests/unit/OptionsListUtilsTest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/OptionsListUtilsTest.js b/tests/unit/OptionsListUtilsTest.js index 0a4dc489edac..48abd4105692 100644 --- a/tests/unit/OptionsListUtilsTest.js +++ b/tests/unit/OptionsListUtilsTest.js @@ -625,7 +625,7 @@ describe('OptionsListUtils', () => { it('formatMemberForList()', () => { const formattedMembers = _.map(PERSONAL_DETAILS, (personalDetail, key) => OptionsListUtils.formatMemberForList(personalDetail, key === '1')); - // We're only formatting a single item, so orders should be the same as the original PERSONAL_DETAILS array + // We're only formatting items inside the array, so the order should be the same as the original PERSONAL_DETAILS array expect(formattedMembers[0].text).toBe('Mister Fantastic'); expect(formattedMembers[1].text).toBe('Iron Man'); expect(formattedMembers[2].text).toBe('Spider-Man'); From e8b2632ad26fe50d1562e8727f5cbceffc1db17e Mon Sep 17 00:00:00 2001 From: jeet-dhandha Date: Wed, 26 Jul 2023 02:22:01 +0530 Subject: [PATCH 030/649] fix: zwj sequences issue --- src/CONST.js | 2 ++ src/libs/EmojiUtils.js | 20 ++++++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/CONST.js b/src/CONST.js index b7a730821fdb..c4fd7a5174eb 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -1148,6 +1148,8 @@ const CONST = { // eslint-disable-next-line max-len, no-misleading-character-class EMOJIS: /[\p{Extended_Pictographic}\u200d\u{1f1e6}-\u{1f1ff}\u{1f3fb}-\u{1f3ff}\u{e0020}-\u{e007f}\u20E3\uFE0F]|[#*0-9]\uFE0F?\u20E3/gu, + EMOJI_ZWJ_SEQUENCES: + /(👨‍❤️‍👨|👨‍❤️‍💋‍👨|👨‍👦|👨‍👦‍👦|👨‍👧|👨‍👧‍👦|👨‍👧‍👧|👨‍👨‍👦|👨‍👨‍👦‍👦|👨‍👨‍👧|👨‍👨‍👧‍👦|👨‍👨‍👧‍👧|👨‍👩‍👦|👨‍👩‍👦‍👦|👨‍👩‍👧|👨‍👩‍👧‍👦|👨‍👩‍👧‍👧|👨🏻‍❤️‍👨🏻|👨🏻‍❤️‍👨🏼|👨🏻‍❤️‍👨🏽|👨🏻‍❤️‍👨🏾|👨🏻‍❤️‍👨🏿|👨🏻‍❤️‍💋‍👨🏻|👨🏻‍❤️‍💋‍👨🏼|👨🏻‍❤️‍💋‍👨🏽|👨🏻‍❤️‍💋‍👨🏾|👨🏻‍❤️‍💋‍👨🏿|👨🏻‍🤝‍👨🏼|👨🏻‍🤝‍👨🏽|👨🏻‍🤝‍👨🏾|👨🏻‍🤝‍👨🏿|👨🏼‍❤️‍👨🏻|👨🏼‍❤️‍👨🏼|👨🏼‍❤️‍👨🏽|👨🏼‍❤️‍👨🏾|👨🏼‍❤️‍👨🏿|👨🏼‍❤️‍💋‍👨🏻|👨🏼‍❤️‍💋‍👨🏼|👨🏼‍❤️‍💋‍👨🏽|👨🏼‍❤️‍💋‍👨🏾|👨🏼‍❤️‍💋‍👨🏿|👨🏼‍🤝‍👨🏻|👨🏼‍🤝‍👨🏽|👨🏼‍🤝‍👨🏾|👨🏼‍🤝‍👨🏿|👨🏽‍❤️‍👨🏻|👨🏽‍❤️‍👨🏼|👨🏽‍❤️‍👨🏽|👨🏽‍❤️‍👨🏾|👨🏽‍❤️‍👨🏿|👨🏽‍❤️‍💋‍👨🏻|👨🏽‍❤️‍💋‍👨🏼|👨🏽‍❤️‍💋‍👨🏽|👨🏽‍❤️‍💋‍👨🏾|👨🏽‍❤️‍💋‍👨🏿|👨🏽‍🤝‍👨🏻|👨🏽‍🤝‍👨🏼|👨🏽‍🤝‍👨🏾|👨🏽‍🤝‍👨🏿|👨🏾‍❤️‍👨🏻|👨🏾‍❤️‍👨🏼|👨🏾‍❤️‍👨🏽|👨🏾‍❤️‍👨🏾|👨🏾‍❤️‍👨🏿|👨🏾‍❤️‍💋‍👨🏻|👨🏾‍❤️‍💋‍👨🏼|👨🏾‍❤️‍💋‍👨🏽|👨🏾‍❤️‍💋‍👨🏾|👨🏾‍❤️‍💋‍👨🏿|👨🏾‍🤝‍👨🏻|👨🏾‍🤝‍👨🏼|👨🏾‍🤝‍👨🏽|👨🏾‍🤝‍👨🏿|👨🏿‍❤️‍👨🏻|👨🏿‍❤️‍👨🏼|👨🏿‍❤️‍👨🏽|👨🏿‍❤️‍👨🏾|👨🏿‍❤️‍👨🏿|👨🏿‍❤️‍💋‍👨🏻|👨🏿‍❤️‍💋‍👨🏼|👨🏿‍❤️‍💋‍👨🏽|👨🏿‍❤️‍💋‍👨🏾|👨🏿‍❤️‍💋‍👨🏿|👨🏿‍🤝‍👨🏻|👨🏿‍🤝‍👨🏼|👨🏿‍🤝‍👨🏽|👨🏿‍🤝‍👨🏾|👩‍❤️‍👨|👩‍❤️‍👩|👩‍❤️‍💋‍👨|👩‍❤️‍💋‍👩|👩‍👦|👩‍👦‍👦|👩‍👧|👩‍👧‍👦|👩‍👧‍👧|👩‍👩‍👦|👩‍👩‍👦‍👦|👩‍👩‍👧|👩‍👩‍👧‍👦|👩‍👩‍👧‍👧|👩🏻‍❤️‍👨🏻|👩🏻‍❤️‍👨🏼|👩🏻‍❤️‍👨🏽|👩🏻‍❤️‍👨🏾|👩🏻‍❤️‍👨🏿|👩🏻‍❤️‍👩🏻|👩🏻‍❤️‍👩🏼|👩🏻‍❤️‍👩🏽|👩🏻‍❤️‍👩🏾|👩🏻‍❤️‍👩🏿|👩🏻‍❤️‍💋‍👨🏻|👩🏻‍❤️‍💋‍👨🏼|👩🏻‍❤️‍💋‍👨🏽|👩🏻‍❤️‍💋‍👨🏾|👩🏻‍❤️‍💋‍👨🏿|👩🏻‍❤️‍💋‍👩🏻|👩🏻‍❤️‍💋‍👩🏼|👩🏻‍❤️‍💋‍👩🏽|👩🏻‍❤️‍💋‍👩🏾|👩🏻‍❤️‍💋‍👩🏿|👩🏻‍🤝‍👨🏼|👩🏻‍🤝‍👨🏽|👩🏻‍🤝‍👨🏾|👩🏻‍🤝‍👨🏿|👩🏻‍🤝‍👩🏼|👩🏻‍🤝‍👩🏽|👩🏻‍🤝‍👩🏾|👩🏻‍🤝‍👩🏿|👩🏼‍❤️‍👨🏻|👩🏼‍❤️‍👨🏼|👩🏼‍❤️‍👨🏽|👩🏼‍❤️‍👨🏾|👩🏼‍❤️‍👨🏿|👩🏼‍❤️‍👩🏻|👩🏼‍❤️‍👩🏼|👩🏼‍❤️‍👩🏽|👩🏼‍❤️‍👩🏾|👩🏼‍❤️‍👩🏿|👩🏼‍❤️‍💋‍👨🏻|👩🏼‍❤️‍💋‍👨🏼|👩🏼‍❤️‍💋‍👨🏽|👩🏼‍❤️‍💋‍👨🏾|👩🏼‍❤️‍💋‍👨🏿|👩🏼‍❤️‍💋‍👩🏻|👩🏼‍❤️‍💋‍👩🏼|👩🏼‍❤️‍💋‍👩🏽|👩🏼‍❤️‍💋‍👩🏾|👩🏼‍❤️‍💋‍👩🏿|👩🏼‍🤝‍👨🏻|👩🏼‍🤝‍👨🏽|👩🏼‍🤝‍👨🏾|👩🏼‍🤝‍👨🏿|👩🏼‍🤝‍👩🏻|👩🏼‍🤝‍👩🏽|👩🏼‍🤝‍👩🏾|👩🏼‍🤝‍👩🏿|👩🏽‍❤️‍👨🏻|👩🏽‍❤️‍👨🏼|👩🏽‍❤️‍👨🏽|👩🏽‍❤️‍👨🏾|👩🏽‍❤️‍👨🏿|👩🏽‍❤️‍👩🏻|👩🏽‍❤️‍👩🏼|👩🏽‍❤️‍👩🏽|👩🏽‍❤️‍👩🏾|👩🏽‍❤️‍👩🏿|👩🏽‍❤️‍💋‍👨🏻|👩🏽‍❤️‍💋‍👨🏼|👩🏽‍❤️‍💋‍👨🏽|👩🏽‍❤️‍💋‍👨🏾|👩🏽‍❤️‍💋‍👨🏿|👩🏽‍❤️‍💋‍👩🏻|👩🏽‍❤️‍💋‍👩🏼|👩🏽‍❤️‍💋‍👩🏽|👩🏽‍❤️‍💋‍👩🏾|👩🏽‍❤️‍💋‍👩🏿|👩🏽‍🤝‍👨🏻|👩🏽‍🤝‍👨🏼|👩🏽‍🤝‍👨🏾|👩🏽‍🤝‍👨🏿|👩🏽‍🤝‍👩🏻|👩🏽‍🤝‍👩🏼|👩🏽‍🤝‍👩🏾|👩🏽‍🤝‍👩🏿|👩🏾‍❤️‍👨🏻|👩🏾‍❤️‍👨🏼|👩🏾‍❤️‍👨🏽|👩🏾‍❤️‍👨🏾|👩🏾‍❤️‍👨🏿|👩🏾‍❤️‍👩🏻|👩🏾‍❤️‍👩🏼|👩🏾‍❤️‍👩🏽|👩🏾‍❤️‍👩🏾|👩🏾‍❤️‍👩🏿|👩🏾‍❤️‍💋‍👨🏻|👩🏾‍❤️‍💋‍👨🏼|👩🏾‍❤️‍💋‍👨🏽|👩🏾‍❤️‍💋‍👨🏾|👩🏾‍❤️‍💋‍👨🏿|👩🏾‍❤️‍💋‍👩🏻|👩🏾‍❤️‍💋‍👩🏼|👩🏾‍❤️‍💋‍👩🏽|👩🏾‍❤️‍💋‍👩🏾|👩🏾‍❤️‍💋‍👩🏿|👩🏾‍🤝‍👨🏻|👩🏾‍🤝‍👨🏼|👩🏾‍🤝‍👨🏽|👩🏾‍🤝‍👨🏿|👩🏾‍🤝‍👩🏻|👩🏾‍🤝‍👩🏼|👩🏾‍🤝‍👩🏽|👩🏾‍🤝‍👩🏿|👩🏿‍❤️‍👨🏻|👩🏿‍❤️‍👨🏼|👩🏿‍❤️‍👨🏽|👩🏿‍❤️‍👨🏾|👩🏿‍❤️‍👨🏿|👩🏿‍❤️‍👩🏻|👩🏿‍❤️‍👩🏼|👩🏿‍❤️‍👩🏽|👩🏿‍❤️‍👩🏾|👩🏿‍❤️‍👩🏿|👩🏿‍❤️‍💋‍👨🏻|👩🏿‍❤️‍💋‍👨🏼|👩🏿‍❤️‍💋‍👨🏽|👩🏿‍❤️‍💋‍👨🏾|👩🏿‍❤️‍💋‍👨🏿|👩🏿‍❤️‍💋‍👩🏻|👩🏿‍❤️‍💋‍👩🏼|👩🏿‍❤️‍💋‍👩🏽|👩🏿‍❤️‍💋‍👩🏾|👩🏿‍❤️‍💋‍👩🏿|👩🏿‍🤝‍👨🏻|👩🏿‍🤝‍👨🏼|👩🏿‍🤝‍👨🏽|👩🏿‍🤝‍👨🏾|👩🏿‍🤝‍👩🏻|👩🏿‍🤝‍👩🏼|👩🏿‍🤝‍👩🏽|👩🏿‍🤝‍👩🏾|🧑‍🤝‍🧑|🧑🏻‍❤️‍💋‍🧑🏼|🧑🏻‍❤️‍💋‍🧑🏽|🧑🏻‍❤️‍💋‍🧑🏾|🧑🏻‍❤️‍💋‍🧑🏿|🧑🏻‍❤️‍🧑🏼|🧑🏻‍❤️‍🧑🏽|🧑🏻‍❤️‍🧑🏾|🧑🏻‍❤️‍🧑🏿|🧑🏻‍🎄|🧑🏻‍🤝‍🧑🏻|🧑🏻‍🤝‍🧑🏼|🧑🏻‍🤝‍🧑🏽|🧑🏻‍🤝‍🧑🏾|🧑🏻‍🤝‍🧑🏿|🧑🏼‍❤️‍💋‍🧑🏻|🧑🏼‍❤️‍💋‍🧑🏽|🧑🏼‍❤️‍💋‍🧑🏾|🧑🏼‍❤️‍💋‍🧑🏿|🧑🏼‍❤️‍🧑🏻|🧑🏼‍❤️‍🧑🏽|🧑🏼‍❤️‍🧑🏾|🧑🏼‍❤️‍🧑🏿|🧑🏼‍🎄|🧑🏼‍🤝‍🧑🏻|🧑🏼‍🤝‍🧑🏼|🧑🏼‍🤝‍🧑🏽|🧑🏼‍🤝‍🧑🏾|🧑🏼‍🤝‍🧑🏿|🧑🏽‍❤️‍💋‍🧑🏻|🧑🏽‍❤️‍💋‍🧑🏼|🧑🏽‍❤️‍💋‍🧑🏾|🧑🏽‍❤️‍💋‍🧑🏿|🧑🏽‍❤️‍🧑🏻|🧑🏽‍❤️‍🧑🏼|🧑🏽‍❤️‍🧑🏾|🧑🏽‍❤️‍🧑🏿|🧑🏽‍🎄|🧑🏽‍🤝‍🧑🏻|🧑🏽‍🤝‍🧑🏼|🧑🏽‍🤝‍🧑🏽|🧑🏽‍🤝‍🧑🏾|🧑🏽‍🤝‍🧑🏿|🧑🏾‍❤️‍💋‍🧑🏻|🧑🏾‍❤️‍💋‍🧑🏼|🧑🏾‍❤️‍💋‍🧑🏽|🧑🏾‍❤️‍💋‍🧑🏿|🧑🏾‍❤️‍🧑🏻|🧑🏾‍❤️‍🧑🏼|🧑🏾‍❤️‍🧑🏽|🧑🏾‍❤️‍🧑🏿|🧑🏾‍🎄|🧑🏾‍🤝‍🧑🏻|🧑🏾‍🤝‍🧑🏼|🧑🏾‍🤝‍🧑🏽|🧑🏾‍🤝‍🧑🏾|🧑🏾‍🤝‍🧑🏿|🧑🏿‍❤️‍💋‍🧑🏻|🧑🏿‍❤️‍💋‍🧑🏼|🧑🏿‍❤️‍💋‍🧑🏽|🧑🏿‍❤️‍💋‍🧑🏾|🧑🏿‍❤️‍🧑🏻|🧑🏿‍❤️‍🧑🏼|🧑🏿‍❤️‍🧑🏽|🧑🏿‍❤️‍🧑🏾|🧑🏿‍🎄|🧑🏿‍🤝‍🧑🏻|🧑🏿‍🤝‍🧑🏼|🧑🏿‍🤝‍🧑🏽|🧑🏿‍🤝‍🧑🏾|🧑🏿‍🤝‍🧑🏿|🫱🏻‍🫲🏼|🫱🏻‍🫲🏽|🫱🏻‍🫲🏾|🫱🏻‍🫲🏿|🫱🏼‍🫲🏻|🫱🏼‍🫲🏽|🫱🏼‍🫲🏾|🫱🏼‍🫲🏿|🫱🏽‍🫲🏻|🫱🏽‍🫲🏼|🫱🏽‍🫲🏾|🫱🏽‍🫲🏿|🫱🏾‍🫲🏻|🫱🏾‍🫲🏼|🫱🏾‍🫲🏽|🫱🏾‍🫲🏿|🫱🏿‍🫲🏻|🫱🏿‍🫲🏼|🫱🏿‍🫲🏽|🫱🏿‍🫲🏾|👨‍⚕️|👨‍⚖️|👨‍✈️|👨‍🌾|👨‍🍳|👨‍🍼|👨‍🎓|👨‍🎤|👨‍🎨|👨‍🏫|👨‍🏭|👨‍💻|👨‍💼|👨‍🔧|👨‍🔬|👨‍🚀|👨‍🚒|👨‍🦯|👨‍🦼|👨‍🦽|👨🏻‍⚕️|👨🏻‍⚖️|👨🏻‍✈️|👨🏻‍🌾|👨🏻‍🍳|👨🏻‍🍼|👨🏻‍🎓|👨🏻‍🎤|👨🏻‍🎨|👨🏻‍🏫|👨🏻‍🏭|👨🏻‍💻|👨🏻‍💼|👨🏻‍🔧|👨🏻‍🔬|👨🏻‍🚀|👨🏻‍🚒|👨🏻‍🦯|👨🏻‍🦼|👨🏻‍🦽|👨🏼‍⚕️|👨🏼‍⚖️|👨🏼‍✈️|👨🏼‍🌾|👨🏼‍🍳|👨🏼‍🍼|👨🏼‍🎓|👨🏼‍🎤|👨🏼‍🎨|👨🏼‍🏫|👨🏼‍🏭|👨🏼‍💻|👨🏼‍💼|👨🏼‍🔧|👨🏼‍🔬|👨🏼‍🚀|👨🏼‍🚒|👨🏼‍🦯|👨🏼‍🦼|👨🏼‍🦽|👨🏽‍⚕️|👨🏽‍⚖️|👨🏽‍✈️|👨🏽‍🌾|👨🏽‍🍳|👨🏽‍🍼|👨🏽‍🎓|👨🏽‍🎤|👨🏽‍🎨|👨🏽‍🏫|👨🏽‍🏭|👨🏽‍💻|👨🏽‍💼|👨🏽‍🔧|👨🏽‍🔬|👨🏽‍🚀|👨🏽‍🚒|👨🏽‍🦯|👨🏽‍🦼|👨🏽‍🦽|👨🏾‍⚕️|👨🏾‍⚖️|👨🏾‍✈️|👨🏾‍🌾|👨🏾‍🍳|👨🏾‍🍼|👨🏾‍🎓|👨🏾‍🎤|👨🏾‍🎨|👨🏾‍🏫|👨🏾‍🏭|👨🏾‍💻|👨🏾‍💼|👨🏾‍🔧|👨🏾‍🔬|👨🏾‍🚀|👨🏾‍🚒|👨🏾‍🦯|👨🏾‍🦼|👨🏾‍🦽|👨🏿‍⚕️|👨🏿‍⚖️|👨🏿‍✈️|👨🏿‍🌾|👨🏿‍🍳|👨🏿‍🍼|👨🏿‍🎓|👨🏿‍🎤|👨🏿‍🎨|👨🏿‍🏫|👨🏿‍🏭|👨🏿‍💻|👨🏿‍💼|👨🏿‍🔧|👨🏿‍🔬|👨🏿‍🚀|👨🏿‍🚒|👨🏿‍🦯|👨🏿‍🦼|👨🏿‍🦽|👩‍⚕️|👩‍⚖️|👩‍✈️|👩‍🌾|👩‍🍳|👩‍🍼|👩‍🎓|👩‍🎤|👩‍🎨|👩‍🏫|👩‍🏭|👩‍💻|👩‍💼|👩‍🔧|👩‍🔬|👩‍🚀|👩‍🚒|👩‍🦯|👩‍🦼|👩‍🦽|👩🏻‍⚕️|👩🏻‍⚖️|👩🏻‍✈️|👩🏻‍🌾|👩🏻‍🍳|👩🏻‍🍼|👩🏻‍🎓|👩🏻‍🎤|👩🏻‍🎨|👩🏻‍🏫|👩🏻‍🏭|👩🏻‍💻|👩🏻‍💼|👩🏻‍🔧|👩🏻‍🔬|👩🏻‍🚀|👩🏻‍🚒|👩🏻‍🦯|👩🏻‍🦼|👩🏻‍🦽|👩🏼‍⚕️|👩🏼‍⚖️|👩🏼‍✈️|👩🏼‍🌾|👩🏼‍🍳|👩🏼‍🍼|👩🏼‍🎓|👩🏼‍🎤|👩🏼‍🎨|👩🏼‍🏫|👩🏼‍🏭|👩🏼‍💻|👩🏼‍💼|👩🏼‍🔧|👩🏼‍🔬|👩🏼‍🚀|👩🏼‍🚒|👩🏼‍🦯|👩🏼‍🦼|👩🏼‍🦽|👩🏽‍⚕️|👩🏽‍⚖️|👩🏽‍✈️|👩🏽‍🌾|👩🏽‍🍳|👩🏽‍🍼|👩🏽‍🎓|👩🏽‍🎤|👩🏽‍🎨|👩🏽‍🏫|👩🏽‍🏭|👩🏽‍💻|👩🏽‍💼|👩🏽‍🔧|👩🏽‍🔬|👩🏽‍🚀|👩🏽‍🚒|👩🏽‍🦯|👩🏽‍🦼|👩🏽‍🦽|👩🏾‍⚕️|👩🏾‍⚖️|👩🏾‍✈️|👩🏾‍🌾|👩🏾‍🍳|👩🏾‍🍼|👩🏾‍🎓|👩🏾‍🎤|👩🏾‍🎨|👩🏾‍🏫|👩🏾‍🏭|👩🏾‍💻|👩🏾‍💼|👩🏾‍🔧|👩🏾‍🔬|👩🏾‍🚀|👩🏾‍🚒|👩🏾‍🦯|👩🏾‍🦼|👩🏾‍🦽|👩🏿‍⚕️|👩🏿‍⚖️|👩🏿‍✈️|👩🏿‍🌾|👩🏿‍🍳|👩🏿‍🍼|👩🏿‍🎓|👩🏿‍🎤|👩🏿‍🎨|👩🏿‍🏫|👩🏿‍🏭|👩🏿‍💻|👩🏿‍💼|👩🏿‍🔧|👩🏿‍🔬|👩🏿‍🚀|👩🏿‍🚒|👩🏿‍🦯|👩🏿‍🦼|👩🏿‍🦽|🧑‍⚕️|🧑‍⚖️|🧑‍✈️|🧑‍🌾|🧑‍🍳|🧑‍🍼|🧑‍🎓|🧑‍🎤|🧑‍🎨|🧑‍🏫|🧑‍🏭|🧑‍💻|🧑‍💼|🧑‍🔧|🧑‍🔬|🧑‍🚀|🧑‍🚒|🧑‍🦯|🧑‍🦼|🧑‍🦽|🧑🏻‍⚕️|🧑🏻‍⚖️|🧑🏻‍✈️|🧑🏻‍🌾|🧑🏻‍🍳|🧑🏻‍🍼|🧑🏻‍🎓|🧑🏻‍🎤|🧑🏻‍🎨|🧑🏻‍🏫|🧑🏻‍🏭|🧑🏻‍💻|🧑🏻‍💼|🧑🏻‍🔧|🧑🏻‍🔬|🧑🏻‍🚀|🧑🏻‍🚒|🧑🏻‍🦯|🧑🏻‍🦼|🧑🏻‍🦽|🧑🏼‍⚕️|🧑🏼‍⚖️|🧑🏼‍✈️|🧑🏼‍🌾|🧑🏼‍🍳|🧑🏼‍🍼|🧑🏼‍🎓|🧑🏼‍🎤|🧑🏼‍🎨|🧑🏼‍🏫|🧑🏼‍🏭|🧑🏼‍💻|🧑🏼‍💼|🧑🏼‍🔧|🧑🏼‍🔬|🧑🏼‍🚀|🧑🏼‍🚒|🧑🏼‍🦯|🧑🏼‍🦼|🧑🏼‍🦽|🧑🏽‍⚕️|🧑🏽‍⚖️|🧑🏽‍✈️|🧑🏽‍🌾|🧑🏽‍🍳|🧑🏽‍🍼|🧑🏽‍🎓|🧑🏽‍🎤|🧑🏽‍🎨|🧑🏽‍🏫|🧑🏽‍🏭|🧑🏽‍💻|🧑🏽‍💼|🧑🏽‍🔧|🧑🏽‍🔬|🧑🏽‍🚀|🧑🏽‍🚒|🧑🏽‍🦯|🧑🏽‍🦼|🧑🏽‍🦽|🧑🏾‍⚕️|🧑🏾‍⚖️|🧑🏾‍✈️|🧑🏾‍🌾|🧑🏾‍🍳|🧑🏾‍🍼|🧑🏾‍🎓|🧑🏾‍🎤|🧑🏾‍🎨|🧑🏾‍🏫|🧑🏾‍🏭|🧑🏾‍💻|🧑🏾‍💼|🧑🏾‍🔧|🧑🏾‍🔬|🧑🏾‍🚀|🧑🏾‍🚒|🧑🏾‍🦯|🧑🏾‍🦼|🧑🏾‍🦽|🧑🏿‍⚕️|🧑🏿‍⚖️|🧑🏿‍✈️|🧑🏿‍🌾|🧑🏿‍🍳|🧑🏿‍🍼|🧑🏿‍🎓|🧑🏿‍🎤|🧑🏿‍🎨|🧑🏿‍🏫|🧑🏿‍🏭|🧑🏿‍💻|🧑🏿‍💼|🧑🏿‍🔧|🧑🏿‍🔬|🧑🏿‍🚀|🧑🏿‍🚒|🧑🏿‍🦯|🧑🏿‍🦼|🧑🏿‍🦽|⛹🏻‍♀️|⛹🏻‍♂️|⛹🏼‍♀️|⛹🏼‍♂️|⛹🏽‍♀️|⛹🏽‍♂️|⛹🏾‍♀️|⛹🏾‍♂️|⛹🏿‍♀️|⛹🏿‍♂️|⛹️‍♀️|⛹️‍♂️|🏃‍♀️|🏃‍♂️|🏃🏻‍♀️|🏃🏻‍♂️|🏃🏼‍♀️|🏃🏼‍♂️|🏃🏽‍♀️|🏃🏽‍♂️|🏃🏾‍♀️|🏃🏾‍♂️|🏃🏿‍♀️|🏃🏿‍♂️|🏄‍♀️|🏄‍♂️|🏄🏻‍♀️|🏄🏻‍♂️|🏄🏼‍♀️|🏄🏼‍♂️|🏄🏽‍♀️|🏄🏽‍♂️|🏄🏾‍♀️|🏄🏾‍♂️|🏄🏿‍♀️|🏄🏿‍♂️|🏊‍♀️|🏊‍♂️|🏊🏻‍♀️|🏊🏻‍♂️|🏊🏼‍♀️|🏊🏼‍♂️|🏊🏽‍♀️|🏊🏽‍♂️|🏊🏾‍♀️|🏊🏾‍♂️|🏊🏿‍♀️|🏊🏿‍♂️|🏋🏻‍♀️|🏋🏻‍♂️|🏋🏼‍♀️|🏋🏼‍♂️|🏋🏽‍♀️|🏋🏽‍♂️|🏋🏾‍♀️|🏋🏾‍♂️|🏋🏿‍♀️|🏋🏿‍♂️|🏋️‍♀️|🏋️‍♂️|🏌🏻‍♀️|🏌🏻‍♂️|🏌🏼‍♀️|🏌🏼‍♂️|🏌🏽‍♀️|🏌🏽‍♂️|🏌🏾‍♀️|🏌🏾‍♂️|🏌🏿‍♀️|🏌🏿‍♂️|🏌️‍♀️|🏌️‍♂️|👮‍♀️|👮‍♂️|👮🏻‍♀️|👮🏻‍♂️|👮🏼‍♀️|👮🏼‍♂️|👮🏽‍♀️|👮🏽‍♂️|👮🏾‍♀️|👮🏾‍♂️|👮🏿‍♀️|👮🏿‍♂️|👯‍♀️|👯‍♂️|👰‍♀️|👰‍♂️|👰🏻‍♀️|👰🏻‍♂️|👰🏼‍♀️|👰🏼‍♂️|👰🏽‍♀️|👰🏽‍♂️|👰🏾‍♀️|👰🏾‍♂️|👰🏿‍♀️|👰🏿‍♂️|👱‍♀️|👱‍♂️|👱🏻‍♀️|👱🏻‍♂️|👱🏼‍♀️|👱🏼‍♂️|👱🏽‍♀️|👱🏽‍♂️|👱🏾‍♀️|👱🏾‍♂️|👱🏿‍♀️|👱🏿‍♂️|👳‍♀️|👳‍♂️|👳🏻‍♀️|👳🏻‍♂️|👳🏼‍♀️|👳🏼‍♂️|👳🏽‍♀️|👳🏽‍♂️|👳🏾‍♀️|👳🏾‍♂️|👳🏿‍♀️|👳🏿‍♂️|👷‍♀️|👷‍♂️|👷🏻‍♀️|👷🏻‍♂️|👷🏼‍♀️|👷🏼‍♂️|👷🏽‍♀️|👷🏽‍♂️|👷🏾‍♀️|👷🏾‍♂️|👷🏿‍♀️|👷🏿‍♂️|💁‍♀️|💁‍♂️|💁🏻‍♀️|💁🏻‍♂️|💁🏼‍♀️|💁🏼‍♂️|💁🏽‍♀️|💁🏽‍♂️|💁🏾‍♀️|💁🏾‍♂️|💁🏿‍♀️|💁🏿‍♂️|💂‍♀️|💂‍♂️|💂🏻‍♀️|💂🏻‍♂️|💂🏼‍♀️|💂🏼‍♂️|💂🏽‍♀️|💂🏽‍♂️|💂🏾‍♀️|💂🏾‍♂️|💂🏿‍♀️|💂🏿‍♂️|💆‍♀️|💆‍♂️|💆🏻‍♀️|💆🏻‍♂️|💆🏼‍♀️|💆🏼‍♂️|💆🏽‍♀️|💆🏽‍♂️|💆🏾‍♀️|💆🏾‍♂️|💆🏿‍♀️|💆🏿‍♂️|💇‍♀️|💇‍♂️|💇🏻‍♀️|💇🏻‍♂️|💇🏼‍♀️|💇🏼‍♂️|💇🏽‍♀️|💇🏽‍♂️|💇🏾‍♀️|💇🏾‍♂️|💇🏿‍♀️|💇🏿‍♂️|🕵🏻‍♀️|🕵🏻‍♂️|🕵🏼‍♀️|🕵🏼‍♂️|🕵🏽‍♀️|🕵🏽‍♂️|🕵🏾‍♀️|🕵🏾‍♂️|🕵🏿‍♀️|🕵🏿‍♂️|🕵️‍♀️|🕵️‍♂️|🙅‍♀️|🙅‍♂️|🙅🏻‍♀️|🙅🏻‍♂️|🙅🏼‍♀️|🙅🏼‍♂️|🙅🏽‍♀️|🙅🏽‍♂️|🙅🏾‍♀️|🙅🏾‍♂️|🙅🏿‍♀️|🙅🏿‍♂️|🙆‍♀️|🙆‍♂️|🙆🏻‍♀️|🙆🏻‍♂️|🙆🏼‍♀️|🙆🏼‍♂️|🙆🏽‍♀️|🙆🏽‍♂️|🙆🏾‍♀️|🙆🏾‍♂️|🙆🏿‍♀️|🙆🏿‍♂️|🙇‍♀️|🙇‍♂️|🙇🏻‍♀️|🙇🏻‍♂️|🙇🏼‍♀️|🙇🏼‍♂️|🙇🏽‍♀️|🙇🏽‍♂️|🙇🏾‍♀️|🙇🏾‍♂️|🙇🏿‍♀️|🙇🏿‍♂️|🙋‍♀️|🙋‍♂️|🙋🏻‍♀️|🙋🏻‍♂️|🙋🏼‍♀️|🙋🏼‍♂️|🙋🏽‍♀️|🙋🏽‍♂️|🙋🏾‍♀️|🙋🏾‍♂️|🙋🏿‍♀️|🙋🏿‍♂️|🙍‍♀️|🙍‍♂️|🙍🏻‍♀️|🙍🏻‍♂️|🙍🏼‍♀️|🙍🏼‍♂️|🙍🏽‍♀️|🙍🏽‍♂️|🙍🏾‍♀️|🙍🏾‍♂️|🙍🏿‍♀️|🙍🏿‍♂️|🙎‍♀️|🙎‍♂️|🙎🏻‍♀️|🙎🏻‍♂️|🙎🏼‍♀️|🙎🏼‍♂️|🙎🏽‍♀️|🙎🏽‍♂️|🙎🏾‍♀️|🙎🏾‍♂️|🙎🏿‍♀️|🙎🏿‍♂️|🚣‍♀️|🚣‍♂️|🚣🏻‍♀️|🚣🏻‍♂️|🚣🏼‍♀️|🚣🏼‍♂️|🚣🏽‍♀️|🚣🏽‍♂️|🚣🏾‍♀️|🚣🏾‍♂️|🚣🏿‍♀️|🚣🏿‍♂️|🚴‍♀️|🚴‍♂️|🚴🏻‍♀️|🚴🏻‍♂️|🚴🏼‍♀️|🚴🏼‍♂️|🚴🏽‍♀️|🚴🏽‍♂️|🚴🏾‍♀️|🚴🏾‍♂️|🚴🏿‍♀️|🚴🏿‍♂️|🚵‍♀️|🚵‍♂️|🚵🏻‍♀️|🚵🏻‍♂️|🚵🏼‍♀️|🚵🏼‍♂️|🚵🏽‍♀️|🚵🏽‍♂️|🚵🏾‍♀️|🚵🏾‍♂️|🚵🏿‍♀️|🚵🏿‍♂️|🚶‍♀️|🚶‍♂️|🚶🏻‍♀️|🚶🏻‍♂️|🚶🏼‍♀️|🚶🏼‍♂️|🚶🏽‍♀️|🚶🏽‍♂️|🚶🏾‍♀️|🚶🏾‍♂️|🚶🏿‍♀️|🚶🏿‍♂️|🤦‍♀️|🤦‍♂️|🤦🏻‍♀️|🤦🏻‍♂️|🤦🏼‍♀️|🤦🏼‍♂️|🤦🏽‍♀️|🤦🏽‍♂️|🤦🏾‍♀️|🤦🏾‍♂️|🤦🏿‍♀️|🤦🏿‍♂️|🤵‍♀️|🤵‍♂️|🤵🏻‍♀️|🤵🏻‍♂️|🤵🏼‍♀️|🤵🏼‍♂️|🤵🏽‍♀️|🤵🏽‍♂️|🤵🏾‍♀️|🤵🏾‍♂️|🤵🏿‍♀️|🤵🏿‍♂️|🤷‍♀️|🤷‍♂️|🤷🏻‍♀️|🤷🏻‍♂️|🤷🏼‍♀️|🤷🏼‍♂️|🤷🏽‍♀️|🤷🏽‍♂️|🤷🏾‍♀️|🤷🏾‍♂️|🤷🏿‍♀️|🤷🏿‍♂️|🤸‍♀️|🤸‍♂️|🤸🏻‍♀️|🤸🏻‍♂️|🤸🏼‍♀️|🤸🏼‍♂️|🤸🏽‍♀️|🤸🏽‍♂️|🤸🏾‍♀️|🤸🏾‍♂️|🤸🏿‍♀️|🤸🏿‍♂️|🤹‍♀️|🤹‍♂️|🤹🏻‍♀️|🤹🏻‍♂️|🤹🏼‍♀️|🤹🏼‍♂️|🤹🏽‍♀️|🤹🏽‍♂️|🤹🏾‍♀️|🤹🏾‍♂️|🤹🏿‍♀️|🤹🏿‍♂️|🤼‍♀️|🤼‍♂️|🤽‍♀️|🤽‍♂️|🤽🏻‍♀️|🤽🏻‍♂️|🤽🏼‍♀️|🤽🏼‍♂️|🤽🏽‍♀️|🤽🏽‍♂️|🤽🏾‍♀️|🤽🏾‍♂️|🤽🏿‍♀️|🤽🏿‍♂️|🤾‍♀️|🤾‍♂️|🤾🏻‍♀️|🤾🏻‍♂️|🤾🏼‍♀️|🤾🏼‍♂️|🤾🏽‍♀️|🤾🏽‍♂️|🤾🏾‍♀️|🤾🏾‍♂️|🤾🏿‍♀️|🤾🏿‍♂️|🦸‍♀️|🦸‍♂️|🦸🏻‍♀️|🦸🏻‍♂️|🦸🏼‍♀️|🦸🏼‍♂️|🦸🏽‍♀️|🦸🏽‍♂️|🦸🏾‍♀️|🦸🏾‍♂️|🦸🏿‍♀️|🦸🏿‍♂️|🦹‍♀️|🦹‍♂️|🦹🏻‍♀️|🦹🏻‍♂️|🦹🏼‍♀️|🦹🏼‍♂️|🦹🏽‍♀️|🦹🏽‍♂️|🦹🏾‍♀️|🦹🏾‍♂️|🦹🏿‍♀️|🦹🏿‍♂️|🧍‍♀️|🧍‍♂️|🧍🏻‍♀️|🧍🏻‍♂️|🧍🏼‍♀️|🧍🏼‍♂️|🧍🏽‍♀️|🧍🏽‍♂️|🧍🏾‍♀️|🧍🏾‍♂️|🧍🏿‍♀️|🧍🏿‍♂️|🧎‍♀️|🧎‍♂️|🧎🏻‍♀️|🧎🏻‍♂️|🧎🏼‍♀️|🧎🏼‍♂️|🧎🏽‍♀️|🧎🏽‍♂️|🧎🏾‍♀️|🧎🏾‍♂️|🧎🏿‍♀️|🧎🏿‍♂️|🧏‍♀️|🧏‍♂️|🧏🏻‍♀️|🧏🏻‍♂️|🧏🏼‍♀️|🧏🏼‍♂️|🧏🏽‍♀️|🧏🏽‍♂️|🧏🏾‍♀️|🧏🏾‍♂️|🧏🏿‍♀️|🧏🏿‍♂️|🧔‍♀️|🧔‍♂️|🧔🏻‍♀️|🧔🏻‍♂️|🧔🏼‍♀️|🧔🏼‍♂️|🧔🏽‍♀️|🧔🏽‍♂️|🧔🏾‍♀️|🧔🏾‍♂️|🧔🏿‍♀️|🧔🏿‍♂️|🧖‍♀️|🧖‍♂️|🧖🏻‍♀️|🧖🏻‍♂️|🧖🏼‍♀️|🧖🏼‍♂️|🧖🏽‍♀️|🧖🏽‍♂️|🧖🏾‍♀️|🧖🏾‍♂️|🧖🏿‍♀️|🧖🏿‍♂️|🧗‍♀️|🧗‍♂️|🧗🏻‍♀️|🧗🏻‍♂️|🧗🏼‍♀️|🧗🏼‍♂️|🧗🏽‍♀️|🧗🏽‍♂️|🧗🏾‍♀️|🧗🏾‍♂️|🧗🏿‍♀️|🧗🏿‍♂️|🧘‍♀️|🧘‍♂️|🧘🏻‍♀️|🧘🏻‍♂️|🧘🏼‍♀️|🧘🏼‍♂️|🧘🏽‍♀️|🧘🏽‍♂️|🧘🏾‍♀️|🧘🏾‍♂️|🧘🏿‍♀️|🧘🏿‍♂️|🧙‍♀️|🧙‍♂️|🧙🏻‍♀️|🧙🏻‍♂️|🧙🏼‍♀️|🧙🏼‍♂️|🧙🏽‍♀️|🧙🏽‍♂️|🧙🏾‍♀️|🧙🏾‍♂️|🧙🏿‍♀️|🧙🏿‍♂️|🧚‍♀️|🧚‍♂️|🧚🏻‍♀️|🧚🏻‍♂️|🧚🏼‍♀️|🧚🏼‍♂️|🧚🏽‍♀️|🧚🏽‍♂️|🧚🏾‍♀️|🧚🏾‍♂️|🧚🏿‍♀️|🧚🏿‍♂️|🧛‍♀️|🧛‍♂️|🧛🏻‍♀️|🧛🏻‍♂️|🧛🏼‍♀️|🧛🏼‍♂️|🧛🏽‍♀️|🧛🏽‍♂️|🧛🏾‍♀️|🧛🏾‍♂️|🧛🏿‍♀️|🧛🏿‍♂️|🧜‍♀️|🧜‍♂️|🧜🏻‍♀️|🧜🏻‍♂️|🧜🏼‍♀️|🧜🏼‍♂️|🧜🏽‍♀️|🧜🏽‍♂️|🧜🏾‍♀️|🧜🏾‍♂️|🧜🏿‍♀️|🧜🏿‍♂️|🧝‍♀️|🧝‍♂️|🧝🏻‍♀️|🧝🏻‍♂️|🧝🏼‍♀️|🧝🏼‍♂️|🧝🏽‍♀️|🧝🏽‍♂️|🧝🏾‍♀️|🧝🏾‍♂️|🧝🏿‍♀️|🧝🏿‍♂️|🧞‍♀️|🧞‍♂️|🧟‍♀️|🧟‍♂️|👨‍🦰|👨‍🦱|👨‍🦲|👨‍🦳|👨🏻‍🦰|👨🏻‍🦱|👨🏻‍🦲|👨🏻‍🦳|👨🏼‍🦰|👨🏼‍🦱|👨🏼‍🦲|👨🏼‍🦳|👨🏽‍🦰|👨🏽‍🦱|👨🏽‍🦲|👨🏽‍🦳|👨🏾‍🦰|👨🏾‍🦱|👨🏾‍🦲|👨🏾‍🦳|👨🏿‍🦰|👨🏿‍🦱|👨🏿‍🦲|👨🏿‍🦳|👩‍🦰|👩‍🦱|👩‍🦲|👩‍🦳|👩🏻‍🦰|👩🏻‍🦱|👩🏻‍🦲|👩🏻‍🦳|👩🏼‍🦰|👩🏼‍🦱|👩🏼‍🦲|👩🏼‍🦳|👩🏽‍🦰|👩🏽‍🦱|👩🏽‍🦲|👩🏽‍🦳|👩🏾‍🦰|👩🏾‍🦱|👩🏾‍🦲|👩🏾‍🦳|👩🏿‍🦰|👩🏿‍🦱|👩🏿‍🦲|👩🏿‍🦳|🧑‍🦰|🧑‍🦱|🧑‍🦲|🧑‍🦳|🧑🏻‍🦰|🧑🏻‍🦱|🧑🏻‍🦲|🧑🏻‍🦳|🧑🏼‍🦰|🧑🏼‍🦱|🧑🏼‍🦲|🧑🏼‍🦳|🧑🏽‍🦰|🧑🏽‍🦱|🧑🏽‍🦲|🧑🏽‍🦳|🧑🏾‍🦰|🧑🏾‍🦱|🧑🏾‍🦲|🧑🏾‍🦳|🧑🏿‍🦰|🧑🏿‍🦱|🧑🏿‍🦲|🧑🏿‍🦳|❤️‍🔥|❤️‍🩹|🏳️‍⚧️|🏳️‍🌈|🏴‍☠️|🐈‍⬛|🐕‍🦺|🐦‍⬛|🐻‍❄️|👁️‍🗨️|😮‍💨|😵‍💫|😶‍🌫️|🧑‍🎄)/gu, TAX_ID: /^\d{9}$/, NON_NUMERIC: /\D/g, diff --git a/src/libs/EmojiUtils.js b/src/libs/EmojiUtils.js index dee635089e00..125e391f12d4 100644 --- a/src/libs/EmojiUtils.js +++ b/src/libs/EmojiUtils.js @@ -265,18 +265,30 @@ const getEmojiCodeWithSkinColor = (item, preferredSkinToneIndex) => { * @returns {Object[]} An array of emoji codes. */ function extractEmojis(text) { + let str = `${text}`; const emojis = []; - if (!text) { + + if (!str) { return emojis; } - let parseEmojis = text.match(CONST.REGEX.EMOJIS); + let sequenceEmojis = str.match(CONST.REGEX.EMOJI_ZWJ_SEQUENCES); + + if (sequenceEmojis) { + sequenceEmojis = [...new Set(sequenceEmojis)]; + for (const sequenceEmoji of sequenceEmojis) { + const regex = new RegExp(sequenceEmoji, 'gu'); + str = str.replace(regex, ''); + } + } + + let parseEmojis = str.match(CONST.REGEX.EMOJIS); - if (!parseEmojis) { + if (!parseEmojis && !sequenceEmojis) { return emojis; } - parseEmojis = [...new Set(parseEmojis)]; + parseEmojis = [...new Set(parseEmojis), ...sequenceEmojis]; for (let i = 0; i < parseEmojis.length; i++) { const character = parseEmojis[i]; From 4a533bd3b902e8134567f825d79e773a32ab80b6 Mon Sep 17 00:00:00 2001 From: jeet-dhandha Date: Wed, 26 Jul 2023 02:36:18 +0530 Subject: [PATCH 031/649] Removed extra emojis --- src/CONST.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CONST.js b/src/CONST.js index c4fd7a5174eb..395967b43e0f 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -1149,7 +1149,7 @@ const CONST = { // eslint-disable-next-line max-len, no-misleading-character-class EMOJIS: /[\p{Extended_Pictographic}\u200d\u{1f1e6}-\u{1f1ff}\u{1f3fb}-\u{1f3ff}\u{e0020}-\u{e007f}\u20E3\uFE0F]|[#*0-9]\uFE0F?\u20E3/gu, EMOJI_ZWJ_SEQUENCES: - /(👨‍❤️‍👨|👨‍❤️‍💋‍👨|👨‍👦|👨‍👦‍👦|👨‍👧|👨‍👧‍👦|👨‍👧‍👧|👨‍👨‍👦|👨‍👨‍👦‍👦|👨‍👨‍👧|👨‍👨‍👧‍👦|👨‍👨‍👧‍👧|👨‍👩‍👦|👨‍👩‍👦‍👦|👨‍👩‍👧|👨‍👩‍👧‍👦|👨‍👩‍👧‍👧|👨🏻‍❤️‍👨🏻|👨🏻‍❤️‍👨🏼|👨🏻‍❤️‍👨🏽|👨🏻‍❤️‍👨🏾|👨🏻‍❤️‍👨🏿|👨🏻‍❤️‍💋‍👨🏻|👨🏻‍❤️‍💋‍👨🏼|👨🏻‍❤️‍💋‍👨🏽|👨🏻‍❤️‍💋‍👨🏾|👨🏻‍❤️‍💋‍👨🏿|👨🏻‍🤝‍👨🏼|👨🏻‍🤝‍👨🏽|👨🏻‍🤝‍👨🏾|👨🏻‍🤝‍👨🏿|👨🏼‍❤️‍👨🏻|👨🏼‍❤️‍👨🏼|👨🏼‍❤️‍👨🏽|👨🏼‍❤️‍👨🏾|👨🏼‍❤️‍👨🏿|👨🏼‍❤️‍💋‍👨🏻|👨🏼‍❤️‍💋‍👨🏼|👨🏼‍❤️‍💋‍👨🏽|👨🏼‍❤️‍💋‍👨🏾|👨🏼‍❤️‍💋‍👨🏿|👨🏼‍🤝‍👨🏻|👨🏼‍🤝‍👨🏽|👨🏼‍🤝‍👨🏾|👨🏼‍🤝‍👨🏿|👨🏽‍❤️‍👨🏻|👨🏽‍❤️‍👨🏼|👨🏽‍❤️‍👨🏽|👨🏽‍❤️‍👨🏾|👨🏽‍❤️‍👨🏿|👨🏽‍❤️‍💋‍👨🏻|👨🏽‍❤️‍💋‍👨🏼|👨🏽‍❤️‍💋‍👨🏽|👨🏽‍❤️‍💋‍👨🏾|👨🏽‍❤️‍💋‍👨🏿|👨🏽‍🤝‍👨🏻|👨🏽‍🤝‍👨🏼|👨🏽‍🤝‍👨🏾|👨🏽‍🤝‍👨🏿|👨🏾‍❤️‍👨🏻|👨🏾‍❤️‍👨🏼|👨🏾‍❤️‍👨🏽|👨🏾‍❤️‍👨🏾|👨🏾‍❤️‍👨🏿|👨🏾‍❤️‍💋‍👨🏻|👨🏾‍❤️‍💋‍👨🏼|👨🏾‍❤️‍💋‍👨🏽|👨🏾‍❤️‍💋‍👨🏾|👨🏾‍❤️‍💋‍👨🏿|👨🏾‍🤝‍👨🏻|👨🏾‍🤝‍👨🏼|👨🏾‍🤝‍👨🏽|👨🏾‍🤝‍👨🏿|👨🏿‍❤️‍👨🏻|👨🏿‍❤️‍👨🏼|👨🏿‍❤️‍👨🏽|👨🏿‍❤️‍👨🏾|👨🏿‍❤️‍👨🏿|👨🏿‍❤️‍💋‍👨🏻|👨🏿‍❤️‍💋‍👨🏼|👨🏿‍❤️‍💋‍👨🏽|👨🏿‍❤️‍💋‍👨🏾|👨🏿‍❤️‍💋‍👨🏿|👨🏿‍🤝‍👨🏻|👨🏿‍🤝‍👨🏼|👨🏿‍🤝‍👨🏽|👨🏿‍🤝‍👨🏾|👩‍❤️‍👨|👩‍❤️‍👩|👩‍❤️‍💋‍👨|👩‍❤️‍💋‍👩|👩‍👦|👩‍👦‍👦|👩‍👧|👩‍👧‍👦|👩‍👧‍👧|👩‍👩‍👦|👩‍👩‍👦‍👦|👩‍👩‍👧|👩‍👩‍👧‍👦|👩‍👩‍👧‍👧|👩🏻‍❤️‍👨🏻|👩🏻‍❤️‍👨🏼|👩🏻‍❤️‍👨🏽|👩🏻‍❤️‍👨🏾|👩🏻‍❤️‍👨🏿|👩🏻‍❤️‍👩🏻|👩🏻‍❤️‍👩🏼|👩🏻‍❤️‍👩🏽|👩🏻‍❤️‍👩🏾|👩🏻‍❤️‍👩🏿|👩🏻‍❤️‍💋‍👨🏻|👩🏻‍❤️‍💋‍👨🏼|👩🏻‍❤️‍💋‍👨🏽|👩🏻‍❤️‍💋‍👨🏾|👩🏻‍❤️‍💋‍👨🏿|👩🏻‍❤️‍💋‍👩🏻|👩🏻‍❤️‍💋‍👩🏼|👩🏻‍❤️‍💋‍👩🏽|👩🏻‍❤️‍💋‍👩🏾|👩🏻‍❤️‍💋‍👩🏿|👩🏻‍🤝‍👨🏼|👩🏻‍🤝‍👨🏽|👩🏻‍🤝‍👨🏾|👩🏻‍🤝‍👨🏿|👩🏻‍🤝‍👩🏼|👩🏻‍🤝‍👩🏽|👩🏻‍🤝‍👩🏾|👩🏻‍🤝‍👩🏿|👩🏼‍❤️‍👨🏻|👩🏼‍❤️‍👨🏼|👩🏼‍❤️‍👨🏽|👩🏼‍❤️‍👨🏾|👩🏼‍❤️‍👨🏿|👩🏼‍❤️‍👩🏻|👩🏼‍❤️‍👩🏼|👩🏼‍❤️‍👩🏽|👩🏼‍❤️‍👩🏾|👩🏼‍❤️‍👩🏿|👩🏼‍❤️‍💋‍👨🏻|👩🏼‍❤️‍💋‍👨🏼|👩🏼‍❤️‍💋‍👨🏽|👩🏼‍❤️‍💋‍👨🏾|👩🏼‍❤️‍💋‍👨🏿|👩🏼‍❤️‍💋‍👩🏻|👩🏼‍❤️‍💋‍👩🏼|👩🏼‍❤️‍💋‍👩🏽|👩🏼‍❤️‍💋‍👩🏾|👩🏼‍❤️‍💋‍👩🏿|👩🏼‍🤝‍👨🏻|👩🏼‍🤝‍👨🏽|👩🏼‍🤝‍👨🏾|👩🏼‍🤝‍👨🏿|👩🏼‍🤝‍👩🏻|👩🏼‍🤝‍👩🏽|👩🏼‍🤝‍👩🏾|👩🏼‍🤝‍👩🏿|👩🏽‍❤️‍👨🏻|👩🏽‍❤️‍👨🏼|👩🏽‍❤️‍👨🏽|👩🏽‍❤️‍👨🏾|👩🏽‍❤️‍👨🏿|👩🏽‍❤️‍👩🏻|👩🏽‍❤️‍👩🏼|👩🏽‍❤️‍👩🏽|👩🏽‍❤️‍👩🏾|👩🏽‍❤️‍👩🏿|👩🏽‍❤️‍💋‍👨🏻|👩🏽‍❤️‍💋‍👨🏼|👩🏽‍❤️‍💋‍👨🏽|👩🏽‍❤️‍💋‍👨🏾|👩🏽‍❤️‍💋‍👨🏿|👩🏽‍❤️‍💋‍👩🏻|👩🏽‍❤️‍💋‍👩🏼|👩🏽‍❤️‍💋‍👩🏽|👩🏽‍❤️‍💋‍👩🏾|👩🏽‍❤️‍💋‍👩🏿|👩🏽‍🤝‍👨🏻|👩🏽‍🤝‍👨🏼|👩🏽‍🤝‍👨🏾|👩🏽‍🤝‍👨🏿|👩🏽‍🤝‍👩🏻|👩🏽‍🤝‍👩🏼|👩🏽‍🤝‍👩🏾|👩🏽‍🤝‍👩🏿|👩🏾‍❤️‍👨🏻|👩🏾‍❤️‍👨🏼|👩🏾‍❤️‍👨🏽|👩🏾‍❤️‍👨🏾|👩🏾‍❤️‍👨🏿|👩🏾‍❤️‍👩🏻|👩🏾‍❤️‍👩🏼|👩🏾‍❤️‍👩🏽|👩🏾‍❤️‍👩🏾|👩🏾‍❤️‍👩🏿|👩🏾‍❤️‍💋‍👨🏻|👩🏾‍❤️‍💋‍👨🏼|👩🏾‍❤️‍💋‍👨🏽|👩🏾‍❤️‍💋‍👨🏾|👩🏾‍❤️‍💋‍👨🏿|👩🏾‍❤️‍💋‍👩🏻|👩🏾‍❤️‍💋‍👩🏼|👩🏾‍❤️‍💋‍👩🏽|👩🏾‍❤️‍💋‍👩🏾|👩🏾‍❤️‍💋‍👩🏿|👩🏾‍🤝‍👨🏻|👩🏾‍🤝‍👨🏼|👩🏾‍🤝‍👨🏽|👩🏾‍🤝‍👨🏿|👩🏾‍🤝‍👩🏻|👩🏾‍🤝‍👩🏼|👩🏾‍🤝‍👩🏽|👩🏾‍🤝‍👩🏿|👩🏿‍❤️‍👨🏻|👩🏿‍❤️‍👨🏼|👩🏿‍❤️‍👨🏽|👩🏿‍❤️‍👨🏾|👩🏿‍❤️‍👨🏿|👩🏿‍❤️‍👩🏻|👩🏿‍❤️‍👩🏼|👩🏿‍❤️‍👩🏽|👩🏿‍❤️‍👩🏾|👩🏿‍❤️‍👩🏿|👩🏿‍❤️‍💋‍👨🏻|👩🏿‍❤️‍💋‍👨🏼|👩🏿‍❤️‍💋‍👨🏽|👩🏿‍❤️‍💋‍👨🏾|👩🏿‍❤️‍💋‍👨🏿|👩🏿‍❤️‍💋‍👩🏻|👩🏿‍❤️‍💋‍👩🏼|👩🏿‍❤️‍💋‍👩🏽|👩🏿‍❤️‍💋‍👩🏾|👩🏿‍❤️‍💋‍👩🏿|👩🏿‍🤝‍👨🏻|👩🏿‍🤝‍👨🏼|👩🏿‍🤝‍👨🏽|👩🏿‍🤝‍👨🏾|👩🏿‍🤝‍👩🏻|👩🏿‍🤝‍👩🏼|👩🏿‍🤝‍👩🏽|👩🏿‍🤝‍👩🏾|🧑‍🤝‍🧑|🧑🏻‍❤️‍💋‍🧑🏼|🧑🏻‍❤️‍💋‍🧑🏽|🧑🏻‍❤️‍💋‍🧑🏾|🧑🏻‍❤️‍💋‍🧑🏿|🧑🏻‍❤️‍🧑🏼|🧑🏻‍❤️‍🧑🏽|🧑🏻‍❤️‍🧑🏾|🧑🏻‍❤️‍🧑🏿|🧑🏻‍🎄|🧑🏻‍🤝‍🧑🏻|🧑🏻‍🤝‍🧑🏼|🧑🏻‍🤝‍🧑🏽|🧑🏻‍🤝‍🧑🏾|🧑🏻‍🤝‍🧑🏿|🧑🏼‍❤️‍💋‍🧑🏻|🧑🏼‍❤️‍💋‍🧑🏽|🧑🏼‍❤️‍💋‍🧑🏾|🧑🏼‍❤️‍💋‍🧑🏿|🧑🏼‍❤️‍🧑🏻|🧑🏼‍❤️‍🧑🏽|🧑🏼‍❤️‍🧑🏾|🧑🏼‍❤️‍🧑🏿|🧑🏼‍🎄|🧑🏼‍🤝‍🧑🏻|🧑🏼‍🤝‍🧑🏼|🧑🏼‍🤝‍🧑🏽|🧑🏼‍🤝‍🧑🏾|🧑🏼‍🤝‍🧑🏿|🧑🏽‍❤️‍💋‍🧑🏻|🧑🏽‍❤️‍💋‍🧑🏼|🧑🏽‍❤️‍💋‍🧑🏾|🧑🏽‍❤️‍💋‍🧑🏿|🧑🏽‍❤️‍🧑🏻|🧑🏽‍❤️‍🧑🏼|🧑🏽‍❤️‍🧑🏾|🧑🏽‍❤️‍🧑🏿|🧑🏽‍🎄|🧑🏽‍🤝‍🧑🏻|🧑🏽‍🤝‍🧑🏼|🧑🏽‍🤝‍🧑🏽|🧑🏽‍🤝‍🧑🏾|🧑🏽‍🤝‍🧑🏿|🧑🏾‍❤️‍💋‍🧑🏻|🧑🏾‍❤️‍💋‍🧑🏼|🧑🏾‍❤️‍💋‍🧑🏽|🧑🏾‍❤️‍💋‍🧑🏿|🧑🏾‍❤️‍🧑🏻|🧑🏾‍❤️‍🧑🏼|🧑🏾‍❤️‍🧑🏽|🧑🏾‍❤️‍🧑🏿|🧑🏾‍🎄|🧑🏾‍🤝‍🧑🏻|🧑🏾‍🤝‍🧑🏼|🧑🏾‍🤝‍🧑🏽|🧑🏾‍🤝‍🧑🏾|🧑🏾‍🤝‍🧑🏿|🧑🏿‍❤️‍💋‍🧑🏻|🧑🏿‍❤️‍💋‍🧑🏼|🧑🏿‍❤️‍💋‍🧑🏽|🧑🏿‍❤️‍💋‍🧑🏾|🧑🏿‍❤️‍🧑🏻|🧑🏿‍❤️‍🧑🏼|🧑🏿‍❤️‍🧑🏽|🧑🏿‍❤️‍🧑🏾|🧑🏿‍🎄|🧑🏿‍🤝‍🧑🏻|🧑🏿‍🤝‍🧑🏼|🧑🏿‍🤝‍🧑🏽|🧑🏿‍🤝‍🧑🏾|🧑🏿‍🤝‍🧑🏿|🫱🏻‍🫲🏼|🫱🏻‍🫲🏽|🫱🏻‍🫲🏾|🫱🏻‍🫲🏿|🫱🏼‍🫲🏻|🫱🏼‍🫲🏽|🫱🏼‍🫲🏾|🫱🏼‍🫲🏿|🫱🏽‍🫲🏻|🫱🏽‍🫲🏼|🫱🏽‍🫲🏾|🫱🏽‍🫲🏿|🫱🏾‍🫲🏻|🫱🏾‍🫲🏼|🫱🏾‍🫲🏽|🫱🏾‍🫲🏿|🫱🏿‍🫲🏻|🫱🏿‍🫲🏼|🫱🏿‍🫲🏽|🫱🏿‍🫲🏾|👨‍⚕️|👨‍⚖️|👨‍✈️|👨‍🌾|👨‍🍳|👨‍🍼|👨‍🎓|👨‍🎤|👨‍🎨|👨‍🏫|👨‍🏭|👨‍💻|👨‍💼|👨‍🔧|👨‍🔬|👨‍🚀|👨‍🚒|👨‍🦯|👨‍🦼|👨‍🦽|👨🏻‍⚕️|👨🏻‍⚖️|👨🏻‍✈️|👨🏻‍🌾|👨🏻‍🍳|👨🏻‍🍼|👨🏻‍🎓|👨🏻‍🎤|👨🏻‍🎨|👨🏻‍🏫|👨🏻‍🏭|👨🏻‍💻|👨🏻‍💼|👨🏻‍🔧|👨🏻‍🔬|👨🏻‍🚀|👨🏻‍🚒|👨🏻‍🦯|👨🏻‍🦼|👨🏻‍🦽|👨🏼‍⚕️|👨🏼‍⚖️|👨🏼‍✈️|👨🏼‍🌾|👨🏼‍🍳|👨🏼‍🍼|👨🏼‍🎓|👨🏼‍🎤|👨🏼‍🎨|👨🏼‍🏫|👨🏼‍🏭|👨🏼‍💻|👨🏼‍💼|👨🏼‍🔧|👨🏼‍🔬|👨🏼‍🚀|👨🏼‍🚒|👨🏼‍🦯|👨🏼‍🦼|👨🏼‍🦽|👨🏽‍⚕️|👨🏽‍⚖️|👨🏽‍✈️|👨🏽‍🌾|👨🏽‍🍳|👨🏽‍🍼|👨🏽‍🎓|👨🏽‍🎤|👨🏽‍🎨|👨🏽‍🏫|👨🏽‍🏭|👨🏽‍💻|👨🏽‍💼|👨🏽‍🔧|👨🏽‍🔬|👨🏽‍🚀|👨🏽‍🚒|👨🏽‍🦯|👨🏽‍🦼|👨🏽‍🦽|👨🏾‍⚕️|👨🏾‍⚖️|👨🏾‍✈️|👨🏾‍🌾|👨🏾‍🍳|👨🏾‍🍼|👨🏾‍🎓|👨🏾‍🎤|👨🏾‍🎨|👨🏾‍🏫|👨🏾‍🏭|👨🏾‍💻|👨🏾‍💼|👨🏾‍🔧|👨🏾‍🔬|👨🏾‍🚀|👨🏾‍🚒|👨🏾‍🦯|👨🏾‍🦼|👨🏾‍🦽|👨🏿‍⚕️|👨🏿‍⚖️|👨🏿‍✈️|👨🏿‍🌾|👨🏿‍🍳|👨🏿‍🍼|👨🏿‍🎓|👨🏿‍🎤|👨🏿‍🎨|👨🏿‍🏫|👨🏿‍🏭|👨🏿‍💻|👨🏿‍💼|👨🏿‍🔧|👨🏿‍🔬|👨🏿‍🚀|👨🏿‍🚒|👨🏿‍🦯|👨🏿‍🦼|👨🏿‍🦽|👩‍⚕️|👩‍⚖️|👩‍✈️|👩‍🌾|👩‍🍳|👩‍🍼|👩‍🎓|👩‍🎤|👩‍🎨|👩‍🏫|👩‍🏭|👩‍💻|👩‍💼|👩‍🔧|👩‍🔬|👩‍🚀|👩‍🚒|👩‍🦯|👩‍🦼|👩‍🦽|👩🏻‍⚕️|👩🏻‍⚖️|👩🏻‍✈️|👩🏻‍🌾|👩🏻‍🍳|👩🏻‍🍼|👩🏻‍🎓|👩🏻‍🎤|👩🏻‍🎨|👩🏻‍🏫|👩🏻‍🏭|👩🏻‍💻|👩🏻‍💼|👩🏻‍🔧|👩🏻‍🔬|👩🏻‍🚀|👩🏻‍🚒|👩🏻‍🦯|👩🏻‍🦼|👩🏻‍🦽|👩🏼‍⚕️|👩🏼‍⚖️|👩🏼‍✈️|👩🏼‍🌾|👩🏼‍🍳|👩🏼‍🍼|👩🏼‍🎓|👩🏼‍🎤|👩🏼‍🎨|👩🏼‍🏫|👩🏼‍🏭|👩🏼‍💻|👩🏼‍💼|👩🏼‍🔧|👩🏼‍🔬|👩🏼‍🚀|👩🏼‍🚒|👩🏼‍🦯|👩🏼‍🦼|👩🏼‍🦽|👩🏽‍⚕️|👩🏽‍⚖️|👩🏽‍✈️|👩🏽‍🌾|👩🏽‍🍳|👩🏽‍🍼|👩🏽‍🎓|👩🏽‍🎤|👩🏽‍🎨|👩🏽‍🏫|👩🏽‍🏭|👩🏽‍💻|👩🏽‍💼|👩🏽‍🔧|👩🏽‍🔬|👩🏽‍🚀|👩🏽‍🚒|👩🏽‍🦯|👩🏽‍🦼|👩🏽‍🦽|👩🏾‍⚕️|👩🏾‍⚖️|👩🏾‍✈️|👩🏾‍🌾|👩🏾‍🍳|👩🏾‍🍼|👩🏾‍🎓|👩🏾‍🎤|👩🏾‍🎨|👩🏾‍🏫|👩🏾‍🏭|👩🏾‍💻|👩🏾‍💼|👩🏾‍🔧|👩🏾‍🔬|👩🏾‍🚀|👩🏾‍🚒|👩🏾‍🦯|👩🏾‍🦼|👩🏾‍🦽|👩🏿‍⚕️|👩🏿‍⚖️|👩🏿‍✈️|👩🏿‍🌾|👩🏿‍🍳|👩🏿‍🍼|👩🏿‍🎓|👩🏿‍🎤|👩🏿‍🎨|👩🏿‍🏫|👩🏿‍🏭|👩🏿‍💻|👩🏿‍💼|👩🏿‍🔧|👩🏿‍🔬|👩🏿‍🚀|👩🏿‍🚒|👩🏿‍🦯|👩🏿‍🦼|👩🏿‍🦽|🧑‍⚕️|🧑‍⚖️|🧑‍✈️|🧑‍🌾|🧑‍🍳|🧑‍🍼|🧑‍🎓|🧑‍🎤|🧑‍🎨|🧑‍🏫|🧑‍🏭|🧑‍💻|🧑‍💼|🧑‍🔧|🧑‍🔬|🧑‍🚀|🧑‍🚒|🧑‍🦯|🧑‍🦼|🧑‍🦽|🧑🏻‍⚕️|🧑🏻‍⚖️|🧑🏻‍✈️|🧑🏻‍🌾|🧑🏻‍🍳|🧑🏻‍🍼|🧑🏻‍🎓|🧑🏻‍🎤|🧑🏻‍🎨|🧑🏻‍🏫|🧑🏻‍🏭|🧑🏻‍💻|🧑🏻‍💼|🧑🏻‍🔧|🧑🏻‍🔬|🧑🏻‍🚀|🧑🏻‍🚒|🧑🏻‍🦯|🧑🏻‍🦼|🧑🏻‍🦽|🧑🏼‍⚕️|🧑🏼‍⚖️|🧑🏼‍✈️|🧑🏼‍🌾|🧑🏼‍🍳|🧑🏼‍🍼|🧑🏼‍🎓|🧑🏼‍🎤|🧑🏼‍🎨|🧑🏼‍🏫|🧑🏼‍🏭|🧑🏼‍💻|🧑🏼‍💼|🧑🏼‍🔧|🧑🏼‍🔬|🧑🏼‍🚀|🧑🏼‍🚒|🧑🏼‍🦯|🧑🏼‍🦼|🧑🏼‍🦽|🧑🏽‍⚕️|🧑🏽‍⚖️|🧑🏽‍✈️|🧑🏽‍🌾|🧑🏽‍🍳|🧑🏽‍🍼|🧑🏽‍🎓|🧑🏽‍🎤|🧑🏽‍🎨|🧑🏽‍🏫|🧑🏽‍🏭|🧑🏽‍💻|🧑🏽‍💼|🧑🏽‍🔧|🧑🏽‍🔬|🧑🏽‍🚀|🧑🏽‍🚒|🧑🏽‍🦯|🧑🏽‍🦼|🧑🏽‍🦽|🧑🏾‍⚕️|🧑🏾‍⚖️|🧑🏾‍✈️|🧑🏾‍🌾|🧑🏾‍🍳|🧑🏾‍🍼|🧑🏾‍🎓|🧑🏾‍🎤|🧑🏾‍🎨|🧑🏾‍🏫|🧑🏾‍🏭|🧑🏾‍💻|🧑🏾‍💼|🧑🏾‍🔧|🧑🏾‍🔬|🧑🏾‍🚀|🧑🏾‍🚒|🧑🏾‍🦯|🧑🏾‍🦼|🧑🏾‍🦽|🧑🏿‍⚕️|🧑🏿‍⚖️|🧑🏿‍✈️|🧑🏿‍🌾|🧑🏿‍🍳|🧑🏿‍🍼|🧑🏿‍🎓|🧑🏿‍🎤|🧑🏿‍🎨|🧑🏿‍🏫|🧑🏿‍🏭|🧑🏿‍💻|🧑🏿‍💼|🧑🏿‍🔧|🧑🏿‍🔬|🧑🏿‍🚀|🧑🏿‍🚒|🧑🏿‍🦯|🧑🏿‍🦼|🧑🏿‍🦽|⛹🏻‍♀️|⛹🏻‍♂️|⛹🏼‍♀️|⛹🏼‍♂️|⛹🏽‍♀️|⛹🏽‍♂️|⛹🏾‍♀️|⛹🏾‍♂️|⛹🏿‍♀️|⛹🏿‍♂️|⛹️‍♀️|⛹️‍♂️|🏃‍♀️|🏃‍♂️|🏃🏻‍♀️|🏃🏻‍♂️|🏃🏼‍♀️|🏃🏼‍♂️|🏃🏽‍♀️|🏃🏽‍♂️|🏃🏾‍♀️|🏃🏾‍♂️|🏃🏿‍♀️|🏃🏿‍♂️|🏄‍♀️|🏄‍♂️|🏄🏻‍♀️|🏄🏻‍♂️|🏄🏼‍♀️|🏄🏼‍♂️|🏄🏽‍♀️|🏄🏽‍♂️|🏄🏾‍♀️|🏄🏾‍♂️|🏄🏿‍♀️|🏄🏿‍♂️|🏊‍♀️|🏊‍♂️|🏊🏻‍♀️|🏊🏻‍♂️|🏊🏼‍♀️|🏊🏼‍♂️|🏊🏽‍♀️|🏊🏽‍♂️|🏊🏾‍♀️|🏊🏾‍♂️|🏊🏿‍♀️|🏊🏿‍♂️|🏋🏻‍♀️|🏋🏻‍♂️|🏋🏼‍♀️|🏋🏼‍♂️|🏋🏽‍♀️|🏋🏽‍♂️|🏋🏾‍♀️|🏋🏾‍♂️|🏋🏿‍♀️|🏋🏿‍♂️|🏋️‍♀️|🏋️‍♂️|🏌🏻‍♀️|🏌🏻‍♂️|🏌🏼‍♀️|🏌🏼‍♂️|🏌🏽‍♀️|🏌🏽‍♂️|🏌🏾‍♀️|🏌🏾‍♂️|🏌🏿‍♀️|🏌🏿‍♂️|🏌️‍♀️|🏌️‍♂️|👮‍♀️|👮‍♂️|👮🏻‍♀️|👮🏻‍♂️|👮🏼‍♀️|👮🏼‍♂️|👮🏽‍♀️|👮🏽‍♂️|👮🏾‍♀️|👮🏾‍♂️|👮🏿‍♀️|👮🏿‍♂️|👯‍♀️|👯‍♂️|👰‍♀️|👰‍♂️|👰🏻‍♀️|👰🏻‍♂️|👰🏼‍♀️|👰🏼‍♂️|👰🏽‍♀️|👰🏽‍♂️|👰🏾‍♀️|👰🏾‍♂️|👰🏿‍♀️|👰🏿‍♂️|👱‍♀️|👱‍♂️|👱🏻‍♀️|👱🏻‍♂️|👱🏼‍♀️|👱🏼‍♂️|👱🏽‍♀️|👱🏽‍♂️|👱🏾‍♀️|👱🏾‍♂️|👱🏿‍♀️|👱🏿‍♂️|👳‍♀️|👳‍♂️|👳🏻‍♀️|👳🏻‍♂️|👳🏼‍♀️|👳🏼‍♂️|👳🏽‍♀️|👳🏽‍♂️|👳🏾‍♀️|👳🏾‍♂️|👳🏿‍♀️|👳🏿‍♂️|👷‍♀️|👷‍♂️|👷🏻‍♀️|👷🏻‍♂️|👷🏼‍♀️|👷🏼‍♂️|👷🏽‍♀️|👷🏽‍♂️|👷🏾‍♀️|👷🏾‍♂️|👷🏿‍♀️|👷🏿‍♂️|💁‍♀️|💁‍♂️|💁🏻‍♀️|💁🏻‍♂️|💁🏼‍♀️|💁🏼‍♂️|💁🏽‍♀️|💁🏽‍♂️|💁🏾‍♀️|💁🏾‍♂️|💁🏿‍♀️|💁🏿‍♂️|💂‍♀️|💂‍♂️|💂🏻‍♀️|💂🏻‍♂️|💂🏼‍♀️|💂🏼‍♂️|💂🏽‍♀️|💂🏽‍♂️|💂🏾‍♀️|💂🏾‍♂️|💂🏿‍♀️|💂🏿‍♂️|💆‍♀️|💆‍♂️|💆🏻‍♀️|💆🏻‍♂️|💆🏼‍♀️|💆🏼‍♂️|💆🏽‍♀️|💆🏽‍♂️|💆🏾‍♀️|💆🏾‍♂️|💆🏿‍♀️|💆🏿‍♂️|💇‍♀️|💇‍♂️|💇🏻‍♀️|💇🏻‍♂️|💇🏼‍♀️|💇🏼‍♂️|💇🏽‍♀️|💇🏽‍♂️|💇🏾‍♀️|💇🏾‍♂️|💇🏿‍♀️|💇🏿‍♂️|🕵🏻‍♀️|🕵🏻‍♂️|🕵🏼‍♀️|🕵🏼‍♂️|🕵🏽‍♀️|🕵🏽‍♂️|🕵🏾‍♀️|🕵🏾‍♂️|🕵🏿‍♀️|🕵🏿‍♂️|🕵️‍♀️|🕵️‍♂️|🙅‍♀️|🙅‍♂️|🙅🏻‍♀️|🙅🏻‍♂️|🙅🏼‍♀️|🙅🏼‍♂️|🙅🏽‍♀️|🙅🏽‍♂️|🙅🏾‍♀️|🙅🏾‍♂️|🙅🏿‍♀️|🙅🏿‍♂️|🙆‍♀️|🙆‍♂️|🙆🏻‍♀️|🙆🏻‍♂️|🙆🏼‍♀️|🙆🏼‍♂️|🙆🏽‍♀️|🙆🏽‍♂️|🙆🏾‍♀️|🙆🏾‍♂️|🙆🏿‍♀️|🙆🏿‍♂️|🙇‍♀️|🙇‍♂️|🙇🏻‍♀️|🙇🏻‍♂️|🙇🏼‍♀️|🙇🏼‍♂️|🙇🏽‍♀️|🙇🏽‍♂️|🙇🏾‍♀️|🙇🏾‍♂️|🙇🏿‍♀️|🙇🏿‍♂️|🙋‍♀️|🙋‍♂️|🙋🏻‍♀️|🙋🏻‍♂️|🙋🏼‍♀️|🙋🏼‍♂️|🙋🏽‍♀️|🙋🏽‍♂️|🙋🏾‍♀️|🙋🏾‍♂️|🙋🏿‍♀️|🙋🏿‍♂️|🙍‍♀️|🙍‍♂️|🙍🏻‍♀️|🙍🏻‍♂️|🙍🏼‍♀️|🙍🏼‍♂️|🙍🏽‍♀️|🙍🏽‍♂️|🙍🏾‍♀️|🙍🏾‍♂️|🙍🏿‍♀️|🙍🏿‍♂️|🙎‍♀️|🙎‍♂️|🙎🏻‍♀️|🙎🏻‍♂️|🙎🏼‍♀️|🙎🏼‍♂️|🙎🏽‍♀️|🙎🏽‍♂️|🙎🏾‍♀️|🙎🏾‍♂️|🙎🏿‍♀️|🙎🏿‍♂️|🚣‍♀️|🚣‍♂️|🚣🏻‍♀️|🚣🏻‍♂️|🚣🏼‍♀️|🚣🏼‍♂️|🚣🏽‍♀️|🚣🏽‍♂️|🚣🏾‍♀️|🚣🏾‍♂️|🚣🏿‍♀️|🚣🏿‍♂️|🚴‍♀️|🚴‍♂️|🚴🏻‍♀️|🚴🏻‍♂️|🚴🏼‍♀️|🚴🏼‍♂️|🚴🏽‍♀️|🚴🏽‍♂️|🚴🏾‍♀️|🚴🏾‍♂️|🚴🏿‍♀️|🚴🏿‍♂️|🚵‍♀️|🚵‍♂️|🚵🏻‍♀️|🚵🏻‍♂️|🚵🏼‍♀️|🚵🏼‍♂️|🚵🏽‍♀️|🚵🏽‍♂️|🚵🏾‍♀️|🚵🏾‍♂️|🚵🏿‍♀️|🚵🏿‍♂️|🚶‍♀️|🚶‍♂️|🚶🏻‍♀️|🚶🏻‍♂️|🚶🏼‍♀️|🚶🏼‍♂️|🚶🏽‍♀️|🚶🏽‍♂️|🚶🏾‍♀️|🚶🏾‍♂️|🚶🏿‍♀️|🚶🏿‍♂️|🤦‍♀️|🤦‍♂️|🤦🏻‍♀️|🤦🏻‍♂️|🤦🏼‍♀️|🤦🏼‍♂️|🤦🏽‍♀️|🤦🏽‍♂️|🤦🏾‍♀️|🤦🏾‍♂️|🤦🏿‍♀️|🤦🏿‍♂️|🤵‍♀️|🤵‍♂️|🤵🏻‍♀️|🤵🏻‍♂️|🤵🏼‍♀️|🤵🏼‍♂️|🤵🏽‍♀️|🤵🏽‍♂️|🤵🏾‍♀️|🤵🏾‍♂️|🤵🏿‍♀️|🤵🏿‍♂️|🤷‍♀️|🤷‍♂️|🤷🏻‍♀️|🤷🏻‍♂️|🤷🏼‍♀️|🤷🏼‍♂️|🤷🏽‍♀️|🤷🏽‍♂️|🤷🏾‍♀️|🤷🏾‍♂️|🤷🏿‍♀️|🤷🏿‍♂️|🤸‍♀️|🤸‍♂️|🤸🏻‍♀️|🤸🏻‍♂️|🤸🏼‍♀️|🤸🏼‍♂️|🤸🏽‍♀️|🤸🏽‍♂️|🤸🏾‍♀️|🤸🏾‍♂️|🤸🏿‍♀️|🤸🏿‍♂️|🤹‍♀️|🤹‍♂️|🤹🏻‍♀️|🤹🏻‍♂️|🤹🏼‍♀️|🤹🏼‍♂️|🤹🏽‍♀️|🤹🏽‍♂️|🤹🏾‍♀️|🤹🏾‍♂️|🤹🏿‍♀️|🤹🏿‍♂️|🤼‍♀️|🤼‍♂️|🤽‍♀️|🤽‍♂️|🤽🏻‍♀️|🤽🏻‍♂️|🤽🏼‍♀️|🤽🏼‍♂️|🤽🏽‍♀️|🤽🏽‍♂️|🤽🏾‍♀️|🤽🏾‍♂️|🤽🏿‍♀️|🤽🏿‍♂️|🤾‍♀️|🤾‍♂️|🤾🏻‍♀️|🤾🏻‍♂️|🤾🏼‍♀️|🤾🏼‍♂️|🤾🏽‍♀️|🤾🏽‍♂️|🤾🏾‍♀️|🤾🏾‍♂️|🤾🏿‍♀️|🤾🏿‍♂️|🦸‍♀️|🦸‍♂️|🦸🏻‍♀️|🦸🏻‍♂️|🦸🏼‍♀️|🦸🏼‍♂️|🦸🏽‍♀️|🦸🏽‍♂️|🦸🏾‍♀️|🦸🏾‍♂️|🦸🏿‍♀️|🦸🏿‍♂️|🦹‍♀️|🦹‍♂️|🦹🏻‍♀️|🦹🏻‍♂️|🦹🏼‍♀️|🦹🏼‍♂️|🦹🏽‍♀️|🦹🏽‍♂️|🦹🏾‍♀️|🦹🏾‍♂️|🦹🏿‍♀️|🦹🏿‍♂️|🧍‍♀️|🧍‍♂️|🧍🏻‍♀️|🧍🏻‍♂️|🧍🏼‍♀️|🧍🏼‍♂️|🧍🏽‍♀️|🧍🏽‍♂️|🧍🏾‍♀️|🧍🏾‍♂️|🧍🏿‍♀️|🧍🏿‍♂️|🧎‍♀️|🧎‍♂️|🧎🏻‍♀️|🧎🏻‍♂️|🧎🏼‍♀️|🧎🏼‍♂️|🧎🏽‍♀️|🧎🏽‍♂️|🧎🏾‍♀️|🧎🏾‍♂️|🧎🏿‍♀️|🧎🏿‍♂️|🧏‍♀️|🧏‍♂️|🧏🏻‍♀️|🧏🏻‍♂️|🧏🏼‍♀️|🧏🏼‍♂️|🧏🏽‍♀️|🧏🏽‍♂️|🧏🏾‍♀️|🧏🏾‍♂️|🧏🏿‍♀️|🧏🏿‍♂️|🧔‍♀️|🧔‍♂️|🧔🏻‍♀️|🧔🏻‍♂️|🧔🏼‍♀️|🧔🏼‍♂️|🧔🏽‍♀️|🧔🏽‍♂️|🧔🏾‍♀️|🧔🏾‍♂️|🧔🏿‍♀️|🧔🏿‍♂️|🧖‍♀️|🧖‍♂️|🧖🏻‍♀️|🧖🏻‍♂️|🧖🏼‍♀️|🧖🏼‍♂️|🧖🏽‍♀️|🧖🏽‍♂️|🧖🏾‍♀️|🧖🏾‍♂️|🧖🏿‍♀️|🧖🏿‍♂️|🧗‍♀️|🧗‍♂️|🧗🏻‍♀️|🧗🏻‍♂️|🧗🏼‍♀️|🧗🏼‍♂️|🧗🏽‍♀️|🧗🏽‍♂️|🧗🏾‍♀️|🧗🏾‍♂️|🧗🏿‍♀️|🧗🏿‍♂️|🧘‍♀️|🧘‍♂️|🧘🏻‍♀️|🧘🏻‍♂️|🧘🏼‍♀️|🧘🏼‍♂️|🧘🏽‍♀️|🧘🏽‍♂️|🧘🏾‍♀️|🧘🏾‍♂️|🧘🏿‍♀️|🧘🏿‍♂️|🧙‍♀️|🧙‍♂️|🧙🏻‍♀️|🧙🏻‍♂️|🧙🏼‍♀️|🧙🏼‍♂️|🧙🏽‍♀️|🧙🏽‍♂️|🧙🏾‍♀️|🧙🏾‍♂️|🧙🏿‍♀️|🧙🏿‍♂️|🧚‍♀️|🧚‍♂️|🧚🏻‍♀️|🧚🏻‍♂️|🧚🏼‍♀️|🧚🏼‍♂️|🧚🏽‍♀️|🧚🏽‍♂️|🧚🏾‍♀️|🧚🏾‍♂️|🧚🏿‍♀️|🧚🏿‍♂️|🧛‍♀️|🧛‍♂️|🧛🏻‍♀️|🧛🏻‍♂️|🧛🏼‍♀️|🧛🏼‍♂️|🧛🏽‍♀️|🧛🏽‍♂️|🧛🏾‍♀️|🧛🏾‍♂️|🧛🏿‍♀️|🧛🏿‍♂️|🧜‍♀️|🧜‍♂️|🧜🏻‍♀️|🧜🏻‍♂️|🧜🏼‍♀️|🧜🏼‍♂️|🧜🏽‍♀️|🧜🏽‍♂️|🧜🏾‍♀️|🧜🏾‍♂️|🧜🏿‍♀️|🧜🏿‍♂️|🧝‍♀️|🧝‍♂️|🧝🏻‍♀️|🧝🏻‍♂️|🧝🏼‍♀️|🧝🏼‍♂️|🧝🏽‍♀️|🧝🏽‍♂️|🧝🏾‍♀️|🧝🏾‍♂️|🧝🏿‍♀️|🧝🏿‍♂️|🧞‍♀️|🧞‍♂️|🧟‍♀️|🧟‍♂️|👨‍🦰|👨‍🦱|👨‍🦲|👨‍🦳|👨🏻‍🦰|👨🏻‍🦱|👨🏻‍🦲|👨🏻‍🦳|👨🏼‍🦰|👨🏼‍🦱|👨🏼‍🦲|👨🏼‍🦳|👨🏽‍🦰|👨🏽‍🦱|👨🏽‍🦲|👨🏽‍🦳|👨🏾‍🦰|👨🏾‍🦱|👨🏾‍🦲|👨🏾‍🦳|👨🏿‍🦰|👨🏿‍🦱|👨🏿‍🦲|👨🏿‍🦳|👩‍🦰|👩‍🦱|👩‍🦲|👩‍🦳|👩🏻‍🦰|👩🏻‍🦱|👩🏻‍🦲|👩🏻‍🦳|👩🏼‍🦰|👩🏼‍🦱|👩🏼‍🦲|👩🏼‍🦳|👩🏽‍🦰|👩🏽‍🦱|👩🏽‍🦲|👩🏽‍🦳|👩🏾‍🦰|👩🏾‍🦱|👩🏾‍🦲|👩🏾‍🦳|👩🏿‍🦰|👩🏿‍🦱|👩🏿‍🦲|👩🏿‍🦳|🧑‍🦰|🧑‍🦱|🧑‍🦲|🧑‍🦳|🧑🏻‍🦰|🧑🏻‍🦱|🧑🏻‍🦲|🧑🏻‍🦳|🧑🏼‍🦰|🧑🏼‍🦱|🧑🏼‍🦲|🧑🏼‍🦳|🧑🏽‍🦰|🧑🏽‍🦱|🧑🏽‍🦲|🧑🏽‍🦳|🧑🏾‍🦰|🧑🏾‍🦱|🧑🏾‍🦲|🧑🏾‍🦳|🧑🏿‍🦰|🧑🏿‍🦱|🧑🏿‍🦲|🧑🏿‍🦳|❤️‍🔥|❤️‍🩹|🏳️‍⚧️|🏳️‍🌈|🏴‍☠️|🐈‍⬛|🐕‍🦺|🐦‍⬛|🐻‍❄️|👁️‍🗨️|😮‍💨|😵‍💫|😶‍🌫️|🧑‍🎄)/gu, + /(😶‍🌫️|😮‍💨|😵‍💫|❤️‍🔥|👁️‍🗨️|🧔‍♂️|🧔🏾‍♂️|🧔🏼‍♂️|🧔‍♀️|🧔🏾‍♀️|🧔🏼‍♀️|👨‍🦰|👨🏾‍🦰|👨🏼‍🦰|👨‍🦱|👨🏾‍🦱|👨🏼‍🦱|👨‍🦳|👨🏾‍🦳|👨🏼‍🦳|👨‍🦲|👨🏾‍🦲|👨🏼‍🦲|👩‍🦰|👩🏾‍🦰|👩🏼‍🦰|🧑‍🦰|🧑🏾‍🦰|🧑🏼‍🦰|👩‍🦱|👩🏾‍🦱|👩🏼‍🦱|🧑‍🦱|🧑🏾‍🦱|🧑🏼‍🦱|👩‍🦳|👩🏾‍🦳|👩🏼‍🦳|🧑‍🦳|🧑🏾‍🦳|🧑🏼‍🦳|👩‍🦲|👩🏾‍🦲|👩🏼‍🦲|🧑‍🦲|🧑🏾‍🦲|🧑🏼‍🦲|👱‍♀️|👱🏾‍♀️|👱🏼‍♀️|👱‍♂️|👱🏾‍♂️|👱🏼‍♂️|🙍‍♂️|🙍🏾‍♂️|🙍🏼‍♂️|🙍‍♀️|🙍🏾‍♀️|🙍🏼‍♀️|🙎‍♂️|🙎🏾‍♂️|🙎🏼‍♂️|🙎‍♀️|🙎🏾‍♀️|🙎🏼‍♀️|🙅‍♂️|🙅🏾‍♂️|🙅🏼‍♂️|🙅‍♀️|🙅🏾‍♀️|🙅🏼‍♀️|🙆‍♂️|🙆🏾‍♂️|🙆🏼‍♂️|🙆‍♀️|🙆🏾‍♀️|🙆🏼‍♀️|💁‍♂️|💁🏾‍♂️|💁🏼‍♂️|💁‍♀️|💁🏾‍♀️|💁🏼‍♀️|🙋‍♂️|🙋🏾‍♂️|🙋🏼‍♂️|🙋‍♀️|🙋🏾‍♀️|🙋🏼‍♀️|🧏‍♂️|🧏🏾‍♂️|🧏🏼‍♂️|🧏‍♀️|🧏🏾‍♀️|🧏🏼‍♀️|🙇‍♂️|🙇🏾‍♂️|🙇🏼‍♂️|🙇‍♀️|🙇🏾‍♀️|🙇🏼‍♀️|🤦‍♂️|🤦🏾‍♂️|🤦🏼‍♂️|🤦‍♀️|🤦🏾‍♀️|🤦🏼‍♀️|🤷‍♂️|🤷🏾‍♂️|🤷🏼‍♂️|🤷‍♀️|🤷🏾‍♀️|🤷🏼‍♀️|🧑‍⚕️|🧑🏾‍⚕️|🧑🏼‍⚕️|👨‍⚕️|👨🏾‍⚕️|👨🏼‍⚕️|👩‍⚕️|👩🏾‍⚕️|👩🏼‍⚕️|🧑‍🎓|🧑🏾‍🎓|🧑🏼‍🎓|👨‍🎓|👨🏾‍🎓|👨🏼‍🎓|👩‍🎓|👩🏾‍🎓|👩🏼‍🎓|🧑‍🏫|🧑🏾‍🏫|🧑🏼‍🏫|👨‍🏫|👨🏾‍🏫|👨🏼‍🏫|👩‍🏫|👩🏾‍🏫|👩🏼‍🏫|🧑‍⚖️|🧑🏾‍⚖️|🧑🏼‍⚖️|👨‍⚖️|👨🏾‍⚖️|👨🏼‍⚖️|👩‍⚖️|👩🏾‍⚖️|👩🏼‍⚖️|🧑‍🌾|🧑🏾‍🌾|🧑🏼‍🌾|👨‍🌾|👨🏾‍🌾|👨🏼‍🌾|👩‍🌾|👩🏾‍🌾|👩🏼‍🌾|🧑‍🍳|🧑🏾‍🍳|🧑🏼‍🍳|👨‍🍳|👨🏾‍🍳|👨🏼‍🍳|👩‍🍳|👩🏾‍🍳|👩🏼‍🍳|🧑‍🔧|🧑🏾‍🔧|🧑🏼‍🔧|👨‍🔧|👨🏾‍🔧|👨🏼‍🔧|👩‍🔧|👩🏾‍🔧|👩🏼‍🔧|🧑‍🏭|🧑🏾‍🏭|🧑🏼‍🏭|👨‍🏭|👨🏾‍🏭|👨🏼‍🏭|👩‍🏭|👩🏾‍🏭|👩🏼‍🏭|🧑‍💼|🧑🏾‍💼|🧑🏼‍💼|👨‍💼|👨🏾‍💼|👨🏼‍💼|👩‍💼|👩🏾‍💼|👩🏼‍💼|🧑‍🔬|🧑🏾‍🔬|🧑🏼‍🔬|👨‍🔬|👨🏾‍🔬|👨🏼‍🔬|👩‍🔬|👩🏾‍🔬|👩🏼‍🔬|🧑‍💻|🧑🏾‍💻|🧑🏼‍💻|👨‍💻|👨🏾‍💻|👨🏼‍💻|👩‍💻|👩🏾‍💻|👩🏼‍💻|🧑‍🎤|🧑🏾‍🎤|🧑🏼‍🎤|👨‍🎤|👨🏾‍🎤|👨🏼‍🎤|👩‍🎤|👩🏾‍🎤|👩🏼‍🎤|🧑‍🎨|🧑🏾‍🎨|🧑🏼‍🎨|👨‍🎨|👨🏾‍🎨|👨🏼‍🎨|👩‍🎨|👩🏾‍🎨|👩🏼‍🎨|🧑‍✈️|🧑🏾‍✈️|🧑🏼‍✈️|👨‍✈️|👨🏾‍✈️|👨🏼‍✈️|👩‍✈️|👩🏾‍✈️|👩🏼‍✈️|🧑‍🚀|🧑🏾‍🚀|🧑🏼‍🚀|👨‍🚀|👨🏾‍🚀|👨🏼‍🚀|👩‍🚀|👩🏾‍🚀|👩🏼‍🚀|🧑‍🚒|🧑🏾‍🚒|🧑🏼‍🚒|👨‍🚒|👨🏾‍🚒|👨🏼‍🚒|👩‍🚒|👩🏾‍🚒|👩🏼‍🚒|👮‍♂️|👮🏾‍♂️|👮🏼‍♂️|👮‍♀️|👮🏾‍♀️|👮🏼‍♀️|🕵️‍♂️|🕵🏾‍♂️|🕵🏼‍♂️|🕵️‍♀️|🕵🏾‍♀️|🕵🏼‍♀️|💂‍♂️|💂🏾‍♂️|💂🏼‍♂️|💂‍♀️|💂🏾‍♀️|💂🏼‍♀️|👷‍♂️|👷🏾‍♂️|👷🏼‍♂️|👷‍♀️|👷🏾‍♀️|👷🏼‍♀️|👳‍♂️|👳🏾‍♂️|👳🏼‍♂️|👳‍♀️|👳🏾‍♀️|👳🏼‍♀️|🤵‍♂️|🤵🏾‍♂️|🤵🏼‍♂️|🤵‍♀️|🤵🏾‍♀️|🤵🏼‍♀️|👰‍♂️|👰🏾‍♂️|👰🏼‍♂️|👰‍♀️|👰🏾‍♀️|👰🏼‍♀️|👩‍🍼|👩🏾‍🍼|👩🏼‍🍼|👨‍🍼|👨🏾‍🍼|👨🏼‍🍼|🧑‍🍼|🧑🏾‍🍼|🧑🏼‍🍼|🧑‍🎄|🧑🏾‍🎄|🧑🏼‍🎄|🦸‍♂️|🦸🏾‍♂️|🦸🏼‍♂️|🦸‍♀️|🦸🏾‍♀️|🦸🏼‍♀️|🦹‍♂️|🦹🏾‍♂️|🦹🏼‍♂️|🦹‍♀️|🦹🏾‍♀️|🦹🏼‍♀️|🧙‍♂️|🧙🏾‍♂️|🧙🏼‍♂️|🧙‍♀️|🧙🏾‍♀️|🧙🏼‍♀️|🧚‍♂️|🧚🏾‍♂️|🧚🏼‍♂️|🧚‍♀️|🧚🏾‍♀️|🧚🏼‍♀️|🧛‍♂️|🧛🏾‍♂️|🧛🏼‍♂️|🧛‍♀️|🧛🏾‍♀️|🧛🏼‍♀️|🧜‍♂️|🧜🏾‍♂️|🧜🏼‍♂️|🧜‍♀️|🧜🏾‍♀️|🧜🏼‍♀️|🧝‍♂️|🧝🏾‍♂️|🧝🏼‍♂️|🧝‍♀️|🧝🏾‍♀️|🧝🏼‍♀️|🧞‍♂️|🧟‍♂️|💆‍♂️|💆🏾‍♂️|💆🏼‍♂️|💆‍♀️|💆🏾‍♀️|💆🏼‍♀️|💇‍♂️|💇🏾‍♂️|💇🏼‍♂️|💇‍♀️|💇🏾‍♀️|💇🏼‍♀️|🚶‍♂️|🚶🏾‍♂️|🚶🏼‍♂️|🚶‍♀️|🚶🏾‍♀️|🚶🏼‍♀️|🧍‍♂️|🧍🏾‍♂️|🧍🏼‍♂️|🧍‍♀️|🧍🏾‍♀️|🧍🏼‍♀️|🧎‍♂️|🧎🏾‍♂️|🧎🏼‍♂️|🧎‍♀️|🧎🏾‍♀️|🧎🏼‍♀️|🧑‍🦯|🧑🏾‍🦯|🧑🏼‍🦯|👨‍🦯|👨🏾‍🦯|👨🏼‍🦯|👩‍🦯|👩🏾‍🦯|👩🏼‍🦯|🧑‍🦼|🧑🏾‍🦼|🧑🏼‍🦼|👨‍🦼|👨🏾‍🦼|👨🏼‍🦼|👩‍🦼|👩🏾‍🦼|👩🏼‍🦼|🧑‍🦽|🧑🏾‍🦽|🧑🏼‍🦽|👨‍🦽|👨🏾‍🦽|👨🏼‍🦽|👩‍🦽|👩🏾‍🦽|👩🏼‍🦽|🏃‍♂️|🏃🏾‍♂️|🏃🏼‍♂️|🏃‍♀️|🏃🏾‍♀️|🏃🏼‍♀️|👯‍♂️|🧖‍♂️|🧖🏾‍♂️|🧖🏼‍♂️|🧖‍♀️|🧖🏾‍♀️|🧖🏼‍♀️|🧗‍♂️|🧗🏾‍♂️|🧗🏼‍♂️|🧗‍♀️|🧗🏾‍♀️|🧗🏼‍♀️|🏌️‍♂️|🏌🏾‍♂️|🏌🏼‍♂️|🏌️‍♀️|🏌🏾‍♀️|🏌🏼‍♀️|🏄‍♂️|🏄🏾‍♂️|🏄🏼‍♂️|🏄‍♀️|🏄🏾‍♀️|🏄🏼‍♀️|🚣‍♂️|🚣🏾‍♂️|🚣🏼‍♂️|🚣‍♀️|🚣🏾‍♀️|🚣🏼‍♀️|🏊‍♂️|🏊🏾‍♂️|🏊🏼‍♂️|🏊‍♀️|🏊🏾‍♀️|🏊🏼‍♀️|⛹️‍♂️|⛹🏾‍♂️|⛹🏼‍♂️|⛹️‍♀️|⛹🏾‍♀️|⛹🏼‍♀️|🏋️‍♂️|🏋🏾‍♂️|🏋🏼‍♂️|🏋️‍♀️|🏋🏾‍♀️|🏋🏼‍♀️|🚴‍♂️|🚴🏾‍♂️|🚴🏼‍♂️|🚴‍♀️|🚴🏾‍♀️|🚴🏼‍♀️|🚵‍♂️|🚵🏾‍♂️|🚵🏼‍♂️|🚵‍♀️|🚵🏾‍♀️|🚵🏼‍♀️|🤸‍♂️|🤸🏾‍♂️|🤸🏼‍♂️|🤸‍♀️|🤸🏾‍♀️|🤸🏼‍♀️|🤼‍♂️|🤽‍♂️|🤽🏾‍♂️|🤽🏼‍♂️|🤽‍♀️|🤽🏾‍♀️|🤽🏼‍♀️|🤾‍♂️|🤾🏾‍♂️|🤾🏼‍♂️|🤾‍♀️|🤾🏾‍♀️|🤾🏼‍♀️|🤹‍♂️|🤹🏾‍♂️|🤹🏼‍♂️|🤹‍♀️|🤹🏾‍♀️|🤹🏼‍♀️|🧘‍♂️|🧘🏾‍♂️|🧘🏼‍♂️|🧘‍♀️|🧘🏾‍♀️|🧘🏼‍♀️|🧑‍🤝‍🧑|🧑🏿‍🤝‍🧑🏾|🧑🏿‍🤝‍🧑🏼|🧑🏾‍🤝‍🧑🏿|🧑🏾‍🤝‍🧑🏽|🧑🏾‍🤝‍🧑🏻|🧑🏽‍🤝‍🧑🏾|🧑🏽‍🤝‍🧑🏼|🧑🏼‍🤝‍🧑🏿|🧑🏼‍🤝‍🧑🏽|🧑🏼‍🤝‍🧑🏻|🧑🏻‍🤝‍🧑🏾|🧑🏻‍🤝‍🧑🏼|👩🏿‍🤝‍👩🏾|👩🏿‍🤝‍👩🏼|👩🏾‍🤝‍👩🏿|👩🏾‍🤝‍👩🏼|👩🏽‍🤝‍👩🏿|👩🏽‍🤝‍👩🏼|👩🏼‍🤝‍👩🏿|👩🏼‍🤝‍👩🏽|👩🏻‍🤝‍👩🏿|👩🏻‍🤝‍👩🏽|👩🏿‍🤝‍👨🏾|👩🏿‍🤝‍👨🏼|👩🏾‍🤝‍👨🏿|👩🏾‍🤝‍👨🏼|👩🏽‍🤝‍👨🏿|👩🏽‍🤝‍👨🏼|👩🏼‍🤝‍👨🏿|👩🏼‍🤝‍👨🏽|👩🏻‍🤝‍👨🏿|👩🏻‍🤝‍👨🏽|👨🏿‍🤝‍👨🏾|👨🏿‍🤝‍👨🏼|👨🏾‍🤝‍👨🏿|👨🏾‍🤝‍👨🏼|👨🏽‍🤝‍👨🏿|👨🏽‍🤝‍👨🏼|👨🏼‍🤝‍👨🏿|👨🏼‍🤝‍👨🏽|👨🏻‍🤝‍👨🏿|👨🏻‍🤝‍👨🏽|🧑🏿‍❤️‍💋‍🧑🏾|🧑🏿‍❤️‍💋‍🧑🏼|🧑🏾‍❤️‍💋‍🧑🏿|🧑🏾‍❤️‍💋‍🧑🏼|🧑🏽‍❤️‍💋‍🧑🏿|🧑🏽‍❤️‍💋‍🧑🏼|🧑🏼‍❤️‍💋‍🧑🏿|🧑🏼‍❤️‍💋‍🧑🏽|🧑🏻‍❤️‍💋‍🧑🏿|🧑🏻‍❤️‍💋‍🧑🏽|👩‍❤️‍💋‍👨|👩🏿‍❤️‍💋‍👨🏾|👩🏿‍❤️‍💋‍👨🏼|👩🏾‍❤️‍💋‍👨🏿|👩🏾‍❤️‍💋‍👨🏽|👩🏾‍❤️‍💋‍👨🏻|👩🏽‍❤️‍💋‍👨🏾|👩🏽‍❤️‍💋‍👨🏼|👩🏼‍❤️‍💋‍👨🏿|👩🏼‍❤️‍💋‍👨🏽|👩🏼‍❤️‍💋‍👨🏻|👩🏻‍❤️‍💋‍👨🏾|👩🏻‍❤️‍💋‍👨🏼|👨‍❤️‍💋‍👨|👨🏿‍❤️‍💋‍👨🏾|👨🏿‍❤️‍💋‍👨🏼|👨🏾‍❤️‍💋‍👨🏿|👨🏾‍❤️‍💋‍👨🏽|👨🏾‍❤️‍💋‍👨🏻|👨🏽‍❤️‍💋‍👨🏾|👨🏽‍❤️‍💋‍👨🏼|👨🏼‍❤️‍💋‍👨🏿|👨🏼‍❤️‍💋‍👨🏽|👨🏼‍❤️‍💋‍👨🏻|👨🏻‍❤️‍💋‍👨🏾|👨🏻‍❤️‍💋‍👨🏼|👩‍❤️‍💋‍👩|👩🏿‍❤️‍💋‍👩🏾|👩🏿‍❤️‍💋‍👩🏼|👩🏾‍❤️‍💋‍👩🏿|👩🏾‍❤️‍💋‍👩🏽|👩🏾‍❤️‍💋‍👩🏻|👩🏽‍❤️‍💋‍👩🏾|👩🏽‍❤️‍💋‍👩🏼|👩🏼‍❤️‍💋‍👩🏿|👩🏼‍❤️‍💋‍👩🏽|👩🏼‍❤️‍💋‍👩🏻|👩🏻‍❤️‍💋‍👩🏾|👩🏻‍❤️‍💋‍👩🏼|🧑🏿‍❤️‍🧑🏾|🧑🏿‍❤️‍🧑🏼|🧑🏾‍❤️‍🧑🏿|🧑🏾‍❤️‍🧑🏼|🧑🏽‍❤️‍🧑🏿|🧑🏽‍❤️‍🧑🏼|🧑🏼‍❤️‍🧑🏿|🧑🏼‍❤️‍🧑🏽|🧑🏻‍❤️‍🧑🏿|🧑🏻‍❤️‍🧑🏽|👩‍❤️‍👨|👩🏿‍❤️‍👨🏾|👩🏿‍❤️‍👨🏼|👩🏾‍❤️‍👨🏿|👩🏾‍❤️‍👨🏽|👩🏾‍❤️‍👨🏻|👩🏽‍❤️‍👨🏾|👩🏽‍❤️‍👨🏼|👩🏼‍❤️‍👨🏿|👩🏼‍❤️‍👨🏽|👩🏼‍❤️‍👨🏻|👩🏻‍❤️‍👨🏾|👩🏻‍❤️‍👨🏼|👨‍❤️‍👨|👨🏿‍❤️‍👨🏾|👨🏿‍❤️‍👨🏼|👨🏾‍❤️‍👨🏿|👨🏾‍❤️‍👨🏽|👨🏾‍❤️‍👨🏻|👨🏽‍❤️‍👨🏾|👨🏽‍❤️‍👨🏼|👨🏼‍❤️‍👨🏿|👨🏼‍❤️‍👨🏽|👨🏼‍❤️‍👨🏻|👨🏻‍❤️‍👨🏾|👨🏻‍❤️‍👨🏼|👩‍❤️‍👩|👩🏿‍❤️‍👩🏾|👩🏿‍❤️‍👩🏼|👩🏾‍❤️‍👩🏿|👩🏾‍❤️‍👩🏽|👩🏾‍❤️‍👩🏻|👩🏽‍❤️‍👩🏾|👩🏽‍❤️‍👩🏼|👩🏼‍❤️‍👩🏿|👩🏼‍❤️‍👩🏽|👩🏼‍❤️‍👩🏻|👩🏻‍❤️‍👩🏾|👩🏻‍❤️‍👩🏼|👨‍👩‍👦|👨‍👩‍👧‍👦|👨‍👩‍👧‍👧|👨‍👨‍👧|👨‍👨‍👦‍👦|👩‍👩‍👦|👩‍👩‍👧‍👦|👩‍👩‍👧‍👧|👨‍👦‍👦|👨‍👧‍👦|👩‍👦|👩‍👧|👩‍👧‍👧|🐕‍🦺|🐈‍⬛|🐻‍❄️|🏳️‍🌈|🏴‍☠️)/gu, TAX_ID: /^\d{9}$/, NON_NUMERIC: /\D/g, From 8b10df286b48785baa1aad005ab2b47bcd1c4f82 Mon Sep 17 00:00:00 2001 From: jeet-dhandha Date: Wed, 26 Jul 2023 11:43:30 +0530 Subject: [PATCH 032/649] fix: lint issue --- src/libs/EmojiUtils.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/EmojiUtils.js b/src/libs/EmojiUtils.js index 125e391f12d4..b2eae17ec8d1 100644 --- a/src/libs/EmojiUtils.js +++ b/src/libs/EmojiUtils.js @@ -276,6 +276,7 @@ function extractEmojis(text) { if (sequenceEmojis) { sequenceEmojis = [...new Set(sequenceEmojis)]; + // eslint-disable-next-line no-restricted-syntax for (const sequenceEmoji of sequenceEmojis) { const regex = new RegExp(sequenceEmoji, 'gu'); str = str.replace(regex, ''); From dc9b8a92a49603bb85f9a8c909ef54f83538d6fa Mon Sep 17 00:00:00 2001 From: Thiago Brezinski Date: Wed, 26 Jul 2023 14:28:39 +0100 Subject: [PATCH 033/649] chore: fix lint issues --- src/pages/workspace/WorkspaceInvitePage.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pages/workspace/WorkspaceInvitePage.js b/src/pages/workspace/WorkspaceInvitePage.js index b91a83f30e03..25afeb4c8b9d 100644 --- a/src/pages/workspace/WorkspaceInvitePage.js +++ b/src/pages/workspace/WorkspaceInvitePage.js @@ -12,14 +12,12 @@ import compose from '../../libs/compose'; import ONYXKEYS from '../../ONYXKEYS'; import * as Policy from '../../libs/actions/Policy'; import FormAlertWithSubmitButton from '../../components/FormAlertWithSubmitButton'; -import OptionsSelector from '../../components/OptionsSelector'; import * as OptionsListUtils from '../../libs/OptionsListUtils'; import CONST from '../../CONST'; import {policyPropTypes, policyDefaultProps} from './withPolicy'; import withPolicyAndFullscreenLoading from './withPolicyAndFullscreenLoading'; import FullPageNotFoundView from '../../components/BlockingViews/FullPageNotFoundView'; import ROUTES from '../../ROUTES'; -import * as Browser from '../../libs/Browser'; import * as PolicyUtils from '../../libs/PolicyUtils'; import useNetwork from '../../hooks/useNetwork'; import useLocalize from '../../hooks/useLocalize'; From 5f6921ebfc19ccd1fc356ad6fa6129e171838971 Mon Sep 17 00:00:00 2001 From: Thiago Brezinski Date: Wed, 26 Jul 2023 14:57:28 +0100 Subject: [PATCH 034/649] chore: fix lint issues --- src/components/CountryPicker/CountrySelectorModal.js | 6 ++---- src/components/StatePicker/StateSelectorModal.js | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/components/CountryPicker/CountrySelectorModal.js b/src/components/CountryPicker/CountrySelectorModal.js index d16d97741d7c..e35e8d614992 100644 --- a/src/components/CountryPicker/CountrySelectorModal.js +++ b/src/components/CountryPicker/CountrySelectorModal.js @@ -4,7 +4,7 @@ import PropTypes from 'prop-types'; import CONST from '../../CONST'; import useLocalize from '../../hooks/useLocalize'; import HeaderWithBackButton from '../HeaderWithBackButton'; -import SelectionListRadio from '../SelectionListRadio'; +import SelectionList from '../SelectionList'; import Modal from '../Modal'; const propTypes = { @@ -72,7 +72,7 @@ function CountrySelectorModal({currentCountry, isVisible, onClose, onCountrySele title={translate('common.country')} onBackButtonPress={onClose} /> - diff --git a/src/components/StatePicker/StateSelectorModal.js b/src/components/StatePicker/StateSelectorModal.js index 4497eab72de8..4b48c11b8109 100644 --- a/src/components/StatePicker/StateSelectorModal.js +++ b/src/components/StatePicker/StateSelectorModal.js @@ -4,7 +4,7 @@ import PropTypes from 'prop-types'; import CONST from '../../CONST'; import Modal from '../Modal'; import HeaderWithBackButton from '../HeaderWithBackButton'; -import SelectionListRadio from '../SelectionListRadio'; +import SelectionList from '../SelectionList'; import useLocalize from '../../hooks/useLocalize'; const propTypes = { @@ -73,7 +73,7 @@ function StateSelectorModal({currentState, isVisible, onClose, onStateSelected, shouldShowBackButton onBackButtonPress={onClose} /> - From af59f1b0535c7a94afde6225d8e15c26592f2945 Mon Sep 17 00:00:00 2001 From: jeet-dhandha Date: Thu, 27 Jul 2023 22:28:23 +0530 Subject: [PATCH 035/649] fix: emoji not adding due to null sequence --- src/libs/EmojiUtils.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libs/EmojiUtils.js b/src/libs/EmojiUtils.js index 064369c54ac4..a54bf00fe8f3 100644 --- a/src/libs/EmojiUtils.js +++ b/src/libs/EmojiUtils.js @@ -282,6 +282,8 @@ function extractEmojis(text) { const regex = new RegExp(sequenceEmoji, 'gu'); str = str.replace(regex, ''); } + } else { + sequenceEmojis = []; } let parseEmojis = str.match(CONST.REGEX.EMOJIS); From 1acf55139be6f970a1a4ba5a88fd7838bacde4f4 Mon Sep 17 00:00:00 2001 From: Thiago Brezinski Date: Fri, 28 Jul 2023 11:21:58 +0100 Subject: [PATCH 036/649] feat(selection-list): focus next available index --- .../SelectionList/BaseSelectionList.js | 20 ++++++++++++++++--- src/pages/workspace/WorkspaceMembersPage.js | 4 ++-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/components/SelectionList/BaseSelectionList.js b/src/components/SelectionList/BaseSelectionList.js index e62ba0cf1637..2a38911b6512 100644 --- a/src/components/SelectionList/BaseSelectionList.js +++ b/src/components/SelectionList/BaseSelectionList.js @@ -172,6 +172,20 @@ function BaseSelectionList({ listRef.current.scrollToLocation({sectionIndex: adjustedSectionIndex, itemIndex, animated}); }; + const selectRow = (item) => { + // Focus next index that is not disabled or already selected + const nextIndex = _.findIndex( + flattenedSections.allOptions, + (option, index) => index > focusedIndex && !flattenedSections.disabledOptionsIndexes.includes(index) && !option.isSelected, + ); + + if (nextIndex >= 0) { + setFocusedIndex(nextIndex); + } + + onSelectRow(item); + }; + /** * This function is used to compute the layout of any given item in our list. * We need to implement it so that we can programmatically scroll to items outside the virtual render window of the SectionList. @@ -222,7 +236,7 @@ function BaseSelectionList({ ); @@ -232,7 +246,7 @@ function BaseSelectionList({ ); }; @@ -265,7 +279,7 @@ function BaseSelectionList({ return; } - onSelectRow(focusedOption); + selectRow(focusedOption); }, { captureOnInputs: true, diff --git a/src/pages/workspace/WorkspaceMembersPage.js b/src/pages/workspace/WorkspaceMembersPage.js index af9c3cd12ad6..3a27d3ad1323 100644 --- a/src/pages/workspace/WorkspaceMembersPage.js +++ b/src/pages/workspace/WorkspaceMembersPage.js @@ -253,7 +253,7 @@ function WorkspaceMembersPage(props) { const policyID = lodashGet(props.route, 'params.policyID'); const policyName = lodashGet(props.policy, 'name'); - const getListData = () => { + const getMemberOptions = () => { let result = []; _.each(props.policyMembers, (policyMember, accountID) => { @@ -323,7 +323,7 @@ function WorkspaceMembersPage(props) { return result; }; - const data = getListData(); + const data = getMemberOptions(); const headerMessage = searchValue.trim() && !data.length ? props.translate('workspace.common.memberNotFound') : ''; return ( From a8b6aaa62487286951eedfe90338578bb950a8f2 Mon Sep 17 00:00:00 2001 From: jeet-dhandha Date: Sat, 29 Jul 2023 04:06:24 +0530 Subject: [PATCH 037/649] fix: used all the emoji constants Ref Link : https://unicode.org/reports/tr18/#RL2.7 --- src/CONST.js | 6 ++++-- src/libs/EmojiUtils.js | 21 ++++----------------- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/src/CONST.js b/src/CONST.js index 6aebc38a165e..0b450d93cbb3 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -1151,8 +1151,10 @@ const CONST = { // eslint-disable-next-line max-len, no-misleading-character-class EMOJIS: /[\p{Extended_Pictographic}\u200d\u{1f1e6}-\u{1f1ff}\u{1f3fb}-\u{1f3ff}\u{e0020}-\u{e007f}\u20E3\uFE0F]|[#*0-9]\uFE0F?\u20E3/gu, - EMOJI_ZWJ_SEQUENCES: - /(😶‍🌫️|😮‍💨|😵‍💫|❤️‍🔥|👁️‍🗨️|🧔‍♂️|🧔🏾‍♂️|🧔🏼‍♂️|🧔‍♀️|🧔🏾‍♀️|🧔🏼‍♀️|👨‍🦰|👨🏾‍🦰|👨🏼‍🦰|👨‍🦱|👨🏾‍🦱|👨🏼‍🦱|👨‍🦳|👨🏾‍🦳|👨🏼‍🦳|👨‍🦲|👨🏾‍🦲|👨🏼‍🦲|👩‍🦰|👩🏾‍🦰|👩🏼‍🦰|🧑‍🦰|🧑🏾‍🦰|🧑🏼‍🦰|👩‍🦱|👩🏾‍🦱|👩🏼‍🦱|🧑‍🦱|🧑🏾‍🦱|🧑🏼‍🦱|👩‍🦳|👩🏾‍🦳|👩🏼‍🦳|🧑‍🦳|🧑🏾‍🦳|🧑🏼‍🦳|👩‍🦲|👩🏾‍🦲|👩🏼‍🦲|🧑‍🦲|🧑🏾‍🦲|🧑🏼‍🦲|👱‍♀️|👱🏾‍♀️|👱🏼‍♀️|👱‍♂️|👱🏾‍♂️|👱🏼‍♂️|🙍‍♂️|🙍🏾‍♂️|🙍🏼‍♂️|🙍‍♀️|🙍🏾‍♀️|🙍🏼‍♀️|🙎‍♂️|🙎🏾‍♂️|🙎🏼‍♂️|🙎‍♀️|🙎🏾‍♀️|🙎🏼‍♀️|🙅‍♂️|🙅🏾‍♂️|🙅🏼‍♂️|🙅‍♀️|🙅🏾‍♀️|🙅🏼‍♀️|🙆‍♂️|🙆🏾‍♂️|🙆🏼‍♂️|🙆‍♀️|🙆🏾‍♀️|🙆🏼‍♀️|💁‍♂️|💁🏾‍♂️|💁🏼‍♂️|💁‍♀️|💁🏾‍♀️|💁🏼‍♀️|🙋‍♂️|🙋🏾‍♂️|🙋🏼‍♂️|🙋‍♀️|🙋🏾‍♀️|🙋🏼‍♀️|🧏‍♂️|🧏🏾‍♂️|🧏🏼‍♂️|🧏‍♀️|🧏🏾‍♀️|🧏🏼‍♀️|🙇‍♂️|🙇🏾‍♂️|🙇🏼‍♂️|🙇‍♀️|🙇🏾‍♀️|🙇🏼‍♀️|🤦‍♂️|🤦🏾‍♂️|🤦🏼‍♂️|🤦‍♀️|🤦🏾‍♀️|🤦🏼‍♀️|🤷‍♂️|🤷🏾‍♂️|🤷🏼‍♂️|🤷‍♀️|🤷🏾‍♀️|🤷🏼‍♀️|🧑‍⚕️|🧑🏾‍⚕️|🧑🏼‍⚕️|👨‍⚕️|👨🏾‍⚕️|👨🏼‍⚕️|👩‍⚕️|👩🏾‍⚕️|👩🏼‍⚕️|🧑‍🎓|🧑🏾‍🎓|🧑🏼‍🎓|👨‍🎓|👨🏾‍🎓|👨🏼‍🎓|👩‍🎓|👩🏾‍🎓|👩🏼‍🎓|🧑‍🏫|🧑🏾‍🏫|🧑🏼‍🏫|👨‍🏫|👨🏾‍🏫|👨🏼‍🏫|👩‍🏫|👩🏾‍🏫|👩🏼‍🏫|🧑‍⚖️|🧑🏾‍⚖️|🧑🏼‍⚖️|👨‍⚖️|👨🏾‍⚖️|👨🏼‍⚖️|👩‍⚖️|👩🏾‍⚖️|👩🏼‍⚖️|🧑‍🌾|🧑🏾‍🌾|🧑🏼‍🌾|👨‍🌾|👨🏾‍🌾|👨🏼‍🌾|👩‍🌾|👩🏾‍🌾|👩🏼‍🌾|🧑‍🍳|🧑🏾‍🍳|🧑🏼‍🍳|👨‍🍳|👨🏾‍🍳|👨🏼‍🍳|👩‍🍳|👩🏾‍🍳|👩🏼‍🍳|🧑‍🔧|🧑🏾‍🔧|🧑🏼‍🔧|👨‍🔧|👨🏾‍🔧|👨🏼‍🔧|👩‍🔧|👩🏾‍🔧|👩🏼‍🔧|🧑‍🏭|🧑🏾‍🏭|🧑🏼‍🏭|👨‍🏭|👨🏾‍🏭|👨🏼‍🏭|👩‍🏭|👩🏾‍🏭|👩🏼‍🏭|🧑‍💼|🧑🏾‍💼|🧑🏼‍💼|👨‍💼|👨🏾‍💼|👨🏼‍💼|👩‍💼|👩🏾‍💼|👩🏼‍💼|🧑‍🔬|🧑🏾‍🔬|🧑🏼‍🔬|👨‍🔬|👨🏾‍🔬|👨🏼‍🔬|👩‍🔬|👩🏾‍🔬|👩🏼‍🔬|🧑‍💻|🧑🏾‍💻|🧑🏼‍💻|👨‍💻|👨🏾‍💻|👨🏼‍💻|👩‍💻|👩🏾‍💻|👩🏼‍💻|🧑‍🎤|🧑🏾‍🎤|🧑🏼‍🎤|👨‍🎤|👨🏾‍🎤|👨🏼‍🎤|👩‍🎤|👩🏾‍🎤|👩🏼‍🎤|🧑‍🎨|🧑🏾‍🎨|🧑🏼‍🎨|👨‍🎨|👨🏾‍🎨|👨🏼‍🎨|👩‍🎨|👩🏾‍🎨|👩🏼‍🎨|🧑‍✈️|🧑🏾‍✈️|🧑🏼‍✈️|👨‍✈️|👨🏾‍✈️|👨🏼‍✈️|👩‍✈️|👩🏾‍✈️|👩🏼‍✈️|🧑‍🚀|🧑🏾‍🚀|🧑🏼‍🚀|👨‍🚀|👨🏾‍🚀|👨🏼‍🚀|👩‍🚀|👩🏾‍🚀|👩🏼‍🚀|🧑‍🚒|🧑🏾‍🚒|🧑🏼‍🚒|👨‍🚒|👨🏾‍🚒|👨🏼‍🚒|👩‍🚒|👩🏾‍🚒|👩🏼‍🚒|👮‍♂️|👮🏾‍♂️|👮🏼‍♂️|👮‍♀️|👮🏾‍♀️|👮🏼‍♀️|🕵️‍♂️|🕵🏾‍♂️|🕵🏼‍♂️|🕵️‍♀️|🕵🏾‍♀️|🕵🏼‍♀️|💂‍♂️|💂🏾‍♂️|💂🏼‍♂️|💂‍♀️|💂🏾‍♀️|💂🏼‍♀️|👷‍♂️|👷🏾‍♂️|👷🏼‍♂️|👷‍♀️|👷🏾‍♀️|👷🏼‍♀️|👳‍♂️|👳🏾‍♂️|👳🏼‍♂️|👳‍♀️|👳🏾‍♀️|👳🏼‍♀️|🤵‍♂️|🤵🏾‍♂️|🤵🏼‍♂️|🤵‍♀️|🤵🏾‍♀️|🤵🏼‍♀️|👰‍♂️|👰🏾‍♂️|👰🏼‍♂️|👰‍♀️|👰🏾‍♀️|👰🏼‍♀️|👩‍🍼|👩🏾‍🍼|👩🏼‍🍼|👨‍🍼|👨🏾‍🍼|👨🏼‍🍼|🧑‍🍼|🧑🏾‍🍼|🧑🏼‍🍼|🧑‍🎄|🧑🏾‍🎄|🧑🏼‍🎄|🦸‍♂️|🦸🏾‍♂️|🦸🏼‍♂️|🦸‍♀️|🦸🏾‍♀️|🦸🏼‍♀️|🦹‍♂️|🦹🏾‍♂️|🦹🏼‍♂️|🦹‍♀️|🦹🏾‍♀️|🦹🏼‍♀️|🧙‍♂️|🧙🏾‍♂️|🧙🏼‍♂️|🧙‍♀️|🧙🏾‍♀️|🧙🏼‍♀️|🧚‍♂️|🧚🏾‍♂️|🧚🏼‍♂️|🧚‍♀️|🧚🏾‍♀️|🧚🏼‍♀️|🧛‍♂️|🧛🏾‍♂️|🧛🏼‍♂️|🧛‍♀️|🧛🏾‍♀️|🧛🏼‍♀️|🧜‍♂️|🧜🏾‍♂️|🧜🏼‍♂️|🧜‍♀️|🧜🏾‍♀️|🧜🏼‍♀️|🧝‍♂️|🧝🏾‍♂️|🧝🏼‍♂️|🧝‍♀️|🧝🏾‍♀️|🧝🏼‍♀️|🧞‍♂️|🧟‍♂️|💆‍♂️|💆🏾‍♂️|💆🏼‍♂️|💆‍♀️|💆🏾‍♀️|💆🏼‍♀️|💇‍♂️|💇🏾‍♂️|💇🏼‍♂️|💇‍♀️|💇🏾‍♀️|💇🏼‍♀️|🚶‍♂️|🚶🏾‍♂️|🚶🏼‍♂️|🚶‍♀️|🚶🏾‍♀️|🚶🏼‍♀️|🧍‍♂️|🧍🏾‍♂️|🧍🏼‍♂️|🧍‍♀️|🧍🏾‍♀️|🧍🏼‍♀️|🧎‍♂️|🧎🏾‍♂️|🧎🏼‍♂️|🧎‍♀️|🧎🏾‍♀️|🧎🏼‍♀️|🧑‍🦯|🧑🏾‍🦯|🧑🏼‍🦯|👨‍🦯|👨🏾‍🦯|👨🏼‍🦯|👩‍🦯|👩🏾‍🦯|👩🏼‍🦯|🧑‍🦼|🧑🏾‍🦼|🧑🏼‍🦼|👨‍🦼|👨🏾‍🦼|👨🏼‍🦼|👩‍🦼|👩🏾‍🦼|👩🏼‍🦼|🧑‍🦽|🧑🏾‍🦽|🧑🏼‍🦽|👨‍🦽|👨🏾‍🦽|👨🏼‍🦽|👩‍🦽|👩🏾‍🦽|👩🏼‍🦽|🏃‍♂️|🏃🏾‍♂️|🏃🏼‍♂️|🏃‍♀️|🏃🏾‍♀️|🏃🏼‍♀️|👯‍♂️|🧖‍♂️|🧖🏾‍♂️|🧖🏼‍♂️|🧖‍♀️|🧖🏾‍♀️|🧖🏼‍♀️|🧗‍♂️|🧗🏾‍♂️|🧗🏼‍♂️|🧗‍♀️|🧗🏾‍♀️|🧗🏼‍♀️|🏌️‍♂️|🏌🏾‍♂️|🏌🏼‍♂️|🏌️‍♀️|🏌🏾‍♀️|🏌🏼‍♀️|🏄‍♂️|🏄🏾‍♂️|🏄🏼‍♂️|🏄‍♀️|🏄🏾‍♀️|🏄🏼‍♀️|🚣‍♂️|🚣🏾‍♂️|🚣🏼‍♂️|🚣‍♀️|🚣🏾‍♀️|🚣🏼‍♀️|🏊‍♂️|🏊🏾‍♂️|🏊🏼‍♂️|🏊‍♀️|🏊🏾‍♀️|🏊🏼‍♀️|⛹️‍♂️|⛹🏾‍♂️|⛹🏼‍♂️|⛹️‍♀️|⛹🏾‍♀️|⛹🏼‍♀️|🏋️‍♂️|🏋🏾‍♂️|🏋🏼‍♂️|🏋️‍♀️|🏋🏾‍♀️|🏋🏼‍♀️|🚴‍♂️|🚴🏾‍♂️|🚴🏼‍♂️|🚴‍♀️|🚴🏾‍♀️|🚴🏼‍♀️|🚵‍♂️|🚵🏾‍♂️|🚵🏼‍♂️|🚵‍♀️|🚵🏾‍♀️|🚵🏼‍♀️|🤸‍♂️|🤸🏾‍♂️|🤸🏼‍♂️|🤸‍♀️|🤸🏾‍♀️|🤸🏼‍♀️|🤼‍♂️|🤽‍♂️|🤽🏾‍♂️|🤽🏼‍♂️|🤽‍♀️|🤽🏾‍♀️|🤽🏼‍♀️|🤾‍♂️|🤾🏾‍♂️|🤾🏼‍♂️|🤾‍♀️|🤾🏾‍♀️|🤾🏼‍♀️|🤹‍♂️|🤹🏾‍♂️|🤹🏼‍♂️|🤹‍♀️|🤹🏾‍♀️|🤹🏼‍♀️|🧘‍♂️|🧘🏾‍♂️|🧘🏼‍♂️|🧘‍♀️|🧘🏾‍♀️|🧘🏼‍♀️|🧑‍🤝‍🧑|🧑🏿‍🤝‍🧑🏾|🧑🏿‍🤝‍🧑🏼|🧑🏾‍🤝‍🧑🏿|🧑🏾‍🤝‍🧑🏽|🧑🏾‍🤝‍🧑🏻|🧑🏽‍🤝‍🧑🏾|🧑🏽‍🤝‍🧑🏼|🧑🏼‍🤝‍🧑🏿|🧑🏼‍🤝‍🧑🏽|🧑🏼‍🤝‍🧑🏻|🧑🏻‍🤝‍🧑🏾|🧑🏻‍🤝‍🧑🏼|👩🏿‍🤝‍👩🏾|👩🏿‍🤝‍👩🏼|👩🏾‍🤝‍👩🏿|👩🏾‍🤝‍👩🏼|👩🏽‍🤝‍👩🏿|👩🏽‍🤝‍👩🏼|👩🏼‍🤝‍👩🏿|👩🏼‍🤝‍👩🏽|👩🏻‍🤝‍👩🏿|👩🏻‍🤝‍👩🏽|👩🏿‍🤝‍👨🏾|👩🏿‍🤝‍👨🏼|👩🏾‍🤝‍👨🏿|👩🏾‍🤝‍👨🏼|👩🏽‍🤝‍👨🏿|👩🏽‍🤝‍👨🏼|👩🏼‍🤝‍👨🏿|👩🏼‍🤝‍👨🏽|👩🏻‍🤝‍👨🏿|👩🏻‍🤝‍👨🏽|👨🏿‍🤝‍👨🏾|👨🏿‍🤝‍👨🏼|👨🏾‍🤝‍👨🏿|👨🏾‍🤝‍👨🏼|👨🏽‍🤝‍👨🏿|👨🏽‍🤝‍👨🏼|👨🏼‍🤝‍👨🏿|👨🏼‍🤝‍👨🏽|👨🏻‍🤝‍👨🏿|👨🏻‍🤝‍👨🏽|🧑🏿‍❤️‍💋‍🧑🏾|🧑🏿‍❤️‍💋‍🧑🏼|🧑🏾‍❤️‍💋‍🧑🏿|🧑🏾‍❤️‍💋‍🧑🏼|🧑🏽‍❤️‍💋‍🧑🏿|🧑🏽‍❤️‍💋‍🧑🏼|🧑🏼‍❤️‍💋‍🧑🏿|🧑🏼‍❤️‍💋‍🧑🏽|🧑🏻‍❤️‍💋‍🧑🏿|🧑🏻‍❤️‍💋‍🧑🏽|👩‍❤️‍💋‍👨|👩🏿‍❤️‍💋‍👨🏾|👩🏿‍❤️‍💋‍👨🏼|👩🏾‍❤️‍💋‍👨🏿|👩🏾‍❤️‍💋‍👨🏽|👩🏾‍❤️‍💋‍👨🏻|👩🏽‍❤️‍💋‍👨🏾|👩🏽‍❤️‍💋‍👨🏼|👩🏼‍❤️‍💋‍👨🏿|👩🏼‍❤️‍💋‍👨🏽|👩🏼‍❤️‍💋‍👨🏻|👩🏻‍❤️‍💋‍👨🏾|👩🏻‍❤️‍💋‍👨🏼|👨‍❤️‍💋‍👨|👨🏿‍❤️‍💋‍👨🏾|👨🏿‍❤️‍💋‍👨🏼|👨🏾‍❤️‍💋‍👨🏿|👨🏾‍❤️‍💋‍👨🏽|👨🏾‍❤️‍💋‍👨🏻|👨🏽‍❤️‍💋‍👨🏾|👨🏽‍❤️‍💋‍👨🏼|👨🏼‍❤️‍💋‍👨🏿|👨🏼‍❤️‍💋‍👨🏽|👨🏼‍❤️‍💋‍👨🏻|👨🏻‍❤️‍💋‍👨🏾|👨🏻‍❤️‍💋‍👨🏼|👩‍❤️‍💋‍👩|👩🏿‍❤️‍💋‍👩🏾|👩🏿‍❤️‍💋‍👩🏼|👩🏾‍❤️‍💋‍👩🏿|👩🏾‍❤️‍💋‍👩🏽|👩🏾‍❤️‍💋‍👩🏻|👩🏽‍❤️‍💋‍👩🏾|👩🏽‍❤️‍💋‍👩🏼|👩🏼‍❤️‍💋‍👩🏿|👩🏼‍❤️‍💋‍👩🏽|👩🏼‍❤️‍💋‍👩🏻|👩🏻‍❤️‍💋‍👩🏾|👩🏻‍❤️‍💋‍👩🏼|🧑🏿‍❤️‍🧑🏾|🧑🏿‍❤️‍🧑🏼|🧑🏾‍❤️‍🧑🏿|🧑🏾‍❤️‍🧑🏼|🧑🏽‍❤️‍🧑🏿|🧑🏽‍❤️‍🧑🏼|🧑🏼‍❤️‍🧑🏿|🧑🏼‍❤️‍🧑🏽|🧑🏻‍❤️‍🧑🏿|🧑🏻‍❤️‍🧑🏽|👩‍❤️‍👨|👩🏿‍❤️‍👨🏾|👩🏿‍❤️‍👨🏼|👩🏾‍❤️‍👨🏿|👩🏾‍❤️‍👨🏽|👩🏾‍❤️‍👨🏻|👩🏽‍❤️‍👨🏾|👩🏽‍❤️‍👨🏼|👩🏼‍❤️‍👨🏿|👩🏼‍❤️‍👨🏽|👩🏼‍❤️‍👨🏻|👩🏻‍❤️‍👨🏾|👩🏻‍❤️‍👨🏼|👨‍❤️‍👨|👨🏿‍❤️‍👨🏾|👨🏿‍❤️‍👨🏼|👨🏾‍❤️‍👨🏿|👨🏾‍❤️‍👨🏽|👨🏾‍❤️‍👨🏻|👨🏽‍❤️‍👨🏾|👨🏽‍❤️‍👨🏼|👨🏼‍❤️‍👨🏿|👨🏼‍❤️‍👨🏽|👨🏼‍❤️‍👨🏻|👨🏻‍❤️‍👨🏾|👨🏻‍❤️‍👨🏼|👩‍❤️‍👩|👩🏿‍❤️‍👩🏾|👩🏿‍❤️‍👩🏼|👩🏾‍❤️‍👩🏿|👩🏾‍❤️‍👩🏽|👩🏾‍❤️‍👩🏻|👩🏽‍❤️‍👩🏾|👩🏽‍❤️‍👩🏼|👩🏼‍❤️‍👩🏿|👩🏼‍❤️‍👩🏽|👩🏼‍❤️‍👩🏻|👩🏻‍❤️‍👩🏾|👩🏻‍❤️‍👩🏼|👨‍👩‍👦|👨‍👩‍👧‍👦|👨‍👩‍👧‍👧|👨‍👨‍👧|👨‍👨‍👦‍👦|👩‍👩‍👦|👩‍👩‍👧‍👦|👩‍👩‍👧‍👧|👨‍👦‍👦|👨‍👧‍👦|👩‍👦|👩‍👧|👩‍👧‍👧|🐕‍🦺|🐈‍⬛|🐻‍❄️|🏳️‍🌈|🏴‍☠️)/gu, + + EMOJIS_AND_ZWJ_SEQUENCE: + /[\p{Emoji}\p{Emoji_Presentation}\p{Emoji_Modifier}\p{Emoji_Modifier_Base}\p{Emoji_Component}\p{Extended_Pictographic}\p{Basic_Emoji}\p{Emoji_Keycap_Sequence}\p{RGI_Emoji_Modifier_Sequence}\p{RGI_Emoji_Flag_Sequence}\p{RGI_Emoji_Tag_Sequence}\p{RGI_Emoji_ZWJ_Sequence}\p{RGI_Emoji}]/gu, + TAX_ID: /^\d{9}$/, NON_NUMERIC: /\D/g, diff --git a/src/libs/EmojiUtils.js b/src/libs/EmojiUtils.js index a54bf00fe8f3..7e227151d1c6 100644 --- a/src/libs/EmojiUtils.js +++ b/src/libs/EmojiUtils.js @@ -266,33 +266,20 @@ const getEmojiCodeWithSkinColor = (item, preferredSkinToneIndex) => { * @returns {Object[]} An array of emoji codes. */ function extractEmojis(text) { - let str = `${text}`; + const str = `${text}`; const emojis = []; if (!str) { return emojis; } - let sequenceEmojis = str.match(CONST.REGEX.EMOJI_ZWJ_SEQUENCES); + let parseEmojis = str.match(CONST.REGEX.EMOJIS_AND_ZWJ_SEQUENCE); - if (sequenceEmojis) { - sequenceEmojis = [...new Set(sequenceEmojis)]; - // eslint-disable-next-line no-restricted-syntax - for (const sequenceEmoji of sequenceEmojis) { - const regex = new RegExp(sequenceEmoji, 'gu'); - str = str.replace(regex, ''); - } - } else { - sequenceEmojis = []; - } - - let parseEmojis = str.match(CONST.REGEX.EMOJIS); - - if (!parseEmojis && !sequenceEmojis) { + if (!parseEmojis) { return emojis; } - parseEmojis = [...new Set(parseEmojis), ...sequenceEmojis]; + parseEmojis = [...new Set(parseEmojis)]; for (let i = 0; i < parseEmojis.length; i++) { const character = parseEmojis[i]; From eb1ec248124767e15209326ab1341b2947a728d3 Mon Sep 17 00:00:00 2001 From: jeet-dhandha Date: Sat, 29 Jul 2023 21:44:09 +0530 Subject: [PATCH 038/649] Update CONST.js --- src/CONST.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CONST.js b/src/CONST.js index 0b450d93cbb3..c9c9a245eae1 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -1153,7 +1153,7 @@ const CONST = { EMOJIS: /[\p{Extended_Pictographic}\u200d\u{1f1e6}-\u{1f1ff}\u{1f3fb}-\u{1f3ff}\u{e0020}-\u{e007f}\u20E3\uFE0F]|[#*0-9]\uFE0F?\u20E3/gu, EMOJIS_AND_ZWJ_SEQUENCE: - /[\p{Emoji}\p{Emoji_Presentation}\p{Emoji_Modifier}\p{Emoji_Modifier_Base}\p{Emoji_Component}\p{Extended_Pictographic}\p{Basic_Emoji}\p{Emoji_Keycap_Sequence}\p{RGI_Emoji_Modifier_Sequence}\p{RGI_Emoji_Flag_Sequence}\p{RGI_Emoji_Tag_Sequence}\p{RGI_Emoji_ZWJ_Sequence}\p{RGI_Emoji}]/gu, + /[\p{Extended_Pictographic}](\u200D[\p{Extended_Pictographic}]|[\u{1F3FB}-\u{1F3FF}]|[\u{E0020}-\u{E007F}]|\uFE0F|\u20E3)*|[\u{1F1E6}-\u{1F1FF}]{2}|[#*0-9]\uFE0F?\u20E3/gu, TAX_ID: /^\d{9}$/, NON_NUMERIC: /\D/g, From d863fef5e3e61202e6c1cf07a48c7a234778ff51 Mon Sep 17 00:00:00 2001 From: jeet-dhandha Date: Mon, 31 Jul 2023 09:55:39 +0530 Subject: [PATCH 039/649] chore: remove extra regex for emoji and use updated one --- src/CONST.js | 5 +---- src/libs/EmojiUtils.js | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/CONST.js b/src/CONST.js index c9c9a245eae1..8d8e384e9647 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -1150,10 +1150,7 @@ const CONST = { ROOM_NAME: /^#[a-z0-9à-ÿ-]{1,80}$/, // eslint-disable-next-line max-len, no-misleading-character-class - EMOJIS: /[\p{Extended_Pictographic}\u200d\u{1f1e6}-\u{1f1ff}\u{1f3fb}-\u{1f3ff}\u{e0020}-\u{e007f}\u20E3\uFE0F]|[#*0-9]\uFE0F?\u20E3/gu, - - EMOJIS_AND_ZWJ_SEQUENCE: - /[\p{Extended_Pictographic}](\u200D[\p{Extended_Pictographic}]|[\u{1F3FB}-\u{1F3FF}]|[\u{E0020}-\u{E007F}]|\uFE0F|\u20E3)*|[\u{1F1E6}-\u{1F1FF}]{2}|[#*0-9]\uFE0F?\u20E3/gu, + EMOJIS: /[\p{Extended_Pictographic}](\u200D[\p{Extended_Pictographic}]|[\u{1F3FB}-\u{1F3FF}]|[\u{E0020}-\u{E007F}]|\uFE0F|\u20E3)*|[\u{1F1E6}-\u{1F1FF}]{2}|[#*0-9]\uFE0F?\u20E3/gu, TAX_ID: /^\d{9}$/, NON_NUMERIC: /\D/g, diff --git a/src/libs/EmojiUtils.js b/src/libs/EmojiUtils.js index 7e227151d1c6..296ce7fa015f 100644 --- a/src/libs/EmojiUtils.js +++ b/src/libs/EmojiUtils.js @@ -273,7 +273,7 @@ function extractEmojis(text) { return emojis; } - let parseEmojis = str.match(CONST.REGEX.EMOJIS_AND_ZWJ_SEQUENCE); + let parseEmojis = str.match(CONST.REGEX.EMOJIS); if (!parseEmojis) { return emojis; From 0989715f1649cdaf24203c20cfd079b5cf72dcd1 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 29 Jun 2023 12:11:58 +0200 Subject: [PATCH 040/649] Initial work on onyx types --- src/{ONYXKEYS.js => ONYXKEYS.ts} | 2 +- src/types/onyx/Account.ts | 29 +++++++++++++++++++++++++++++ src/types/onyx/OnyxValues.ts | 8 ++++++++ src/types/onyx/common.ts | 23 +++++++++++++++++++++++ src/types/utils.ts | 4 ++++ 5 files changed, 65 insertions(+), 1 deletion(-) rename src/{ONYXKEYS.js => ONYXKEYS.ts} (99%) create mode 100644 src/types/onyx/Account.ts create mode 100644 src/types/onyx/OnyxValues.ts create mode 100644 src/types/onyx/common.ts create mode 100644 src/types/utils.ts diff --git a/src/ONYXKEYS.js b/src/ONYXKEYS.ts similarity index 99% rename from src/ONYXKEYS.js rename to src/ONYXKEYS.ts index dd73bde936f9..f878596272ff 100755 --- a/src/ONYXKEYS.js +++ b/src/ONYXKEYS.ts @@ -235,4 +235,4 @@ export default { // Experimental memory only Onyx mode flag IS_USING_MEMORY_ONLY_KEYS: 'isUsingMemoryOnlyKeys', -}; +} as const; diff --git a/src/types/onyx/Account.ts b/src/types/onyx/Account.ts new file mode 100644 index 000000000000..0e4c40b70025 --- /dev/null +++ b/src/types/onyx/Account.ts @@ -0,0 +1,29 @@ +import * as CommonTypes from './common'; + +type Account = CommonTypes.BaseState & { + /** URL to the assigned guide's appointment booking calendar */ + guideCalendarLink: string; + + /** User recovery codes for setting up 2-FA */ + recoveryCodes?: string; + + /** Secret key to enable 2FA within the authenticator app */ + twoFactorAuthSecretKey?: string; + + /** Whether or not two factor authentication is required */ + requiresTwoFactorAuth: boolean; + + /** Whether the account is validated */ + validated: boolean; + + /** The primaryLogin associated with the account */ + primaryLogin: string; + + /** The message to be displayed when code requested */ + message?: string; + + /** Accounts that are on a domain with an Approved Accountant */ + doesDomainHaveApprovedAccountant?: boolean; +}; + +export default Account; diff --git a/src/types/onyx/OnyxValues.ts b/src/types/onyx/OnyxValues.ts new file mode 100644 index 000000000000..db6887dbaca5 --- /dev/null +++ b/src/types/onyx/OnyxValues.ts @@ -0,0 +1,8 @@ +import ONYXKEYS from '../../ONYXKEYS'; +import Account from './Account'; + +type OnyxValues = { + [ONYXKEYS.ACCOUNT]: Account; +}; + +export default OnyxValues; diff --git a/src/types/onyx/common.ts b/src/types/onyx/common.ts new file mode 100644 index 000000000000..9eb8f958afcc --- /dev/null +++ b/src/types/onyx/common.ts @@ -0,0 +1,23 @@ +import * as React from 'react'; + +type RedBrickRoadPendingAction = 'add' | 'delete' | 'update'; + +type BaseState = { + success: string; + + /** An error message to display to the user */ + errors?: Record; + + /** Whether or not data is loading */ + isLoading: boolean; + + pendingAction: RedBrickRoadPendingAction; +}; + +type Icon = { + source: string | React.ReactNode; + type: 'avatar' | 'workspace'; + name: string; +}; + +export type {RedBrickRoadPendingAction, BaseState, Icon}; diff --git a/src/types/utils.ts b/src/types/utils.ts new file mode 100644 index 000000000000..a6dea213f45b --- /dev/null +++ b/src/types/utils.ts @@ -0,0 +1,4 @@ +type NestedValues = T extends object ? NestedValues : T; + +// eslint-disable-next-line import/prefer-default-export +export type {NestedValues}; From 13ee74d8c8dc5635ebcc754df2cb3e2e6ab56e3b Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 29 Jun 2023 16:29:09 +0200 Subject: [PATCH 041/649] Change comments to JSDOC --- src/ONYXKEYS.ts | 135 +++++++++++++++++++++++++----------------------- 1 file changed, 69 insertions(+), 66 deletions(-) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index f878596272ff..5af1f387fd48 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -2,111 +2,111 @@ * This is a file containing constants for all the top level keys in our store */ export default { - // Holds information about the users account that is logging in + /** Holds information about the users account that is logging in */ ACCOUNT: 'account', - // Holds the reportID for the report between the user and their account manager + /** Holds the reportID for the report between the user and their account manager */ ACCOUNT_MANAGER_REPORT_ID: 'accountManagerReportID', - // Boolean flag only true when first set + /** Boolean flag only true when first set */ NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER: 'isFirstTimeNewExpensifyUser', - // Holds an array of client IDs which is used for multi-tabs on web in order to know - // which tab is the leader, and which ones are the followers + /** Holds an array of client IDs which is used for multi-tabs on web in order to know + * which tab is the leader, and which ones are the followers */ ACTIVE_CLIENTS: 'activeClients', - // A unique ID for the device + /** A unique ID for the device */ DEVICE_ID: 'deviceID', - // Boolean flag set whenever the sidebar has loaded + /** Boolean flag set whenever the sidebar has loaded */ IS_SIDEBAR_LOADED: 'isSidebarLoaded', - // Note: These are Persisted Requests - not all requests in the main queue as the key name might lead one to believe + /** Note: These are Persisted Requests - not all requests in the main queue as the key name might lead one to believe */ PERSISTED_REQUESTS: 'networkRequestQueue', - // Onyx updates from a response, or success or failure data from a request. + /** Onyx updates from a response, or success or failure data from a request. */ QUEUED_ONYX_UPDATES: 'queuedOnyxUpdates', - // Stores current date + /** Stores current date */ CURRENT_DATE: 'currentDate', - // Credentials to authenticate the user + /** Credentials to authenticate the user */ CREDENTIALS: 'credentials', - // Contains loading data for the IOU feature (MoneyRequestModal, IOUDetail, & IOUPreview Components) + /** Contains loading data for the IOU feature (MoneyRequestModal, IOUDetail, & IOUPreview Components) */ IOU: 'iou', - // Keeps track if there is modal currently visible or not + /** Keeps track if there is modal currently visible or not */ MODAL: 'modal', - // Has information about the network status (offline/online) + /** Has information about the network status (offline/online) */ NETWORK: 'network', - // Contains all the personalDetails the user has access to, keyed by accountID + /** Contains all the personalDetails the user has access to, keyed by accountID */ PERSONAL_DETAILS_LIST: 'personalDetailsList', - // Contains all the private personal details of the user + /** Contains all the private personal details of the user */ PRIVATE_PERSONAL_DETAILS: 'private_personalDetails', - // Contains all the info for Tasks + /** Contains all the info for Tasks */ TASK: 'task', - // Contains a list of all currencies available to the user - user can - // select a currency based on the list + /** Contains a list of all currencies available to the user - user can + * select a currency based on the list */ CURRENCY_LIST: 'currencyList', - // Indicates whether an update is available and ready to be installed. + /** Indicates whether an update is available and ready to be installed. */ UPDATE_AVAILABLE: 'updateAvailable', - // Indicates that a request to join a screen share with a GuidesPlus agent was received + /** Indicates that a request to join a screen share with a GuidesPlus agent was received */ SCREEN_SHARE_REQUEST: 'screenShareRequest', - // Saves the current country code which is displayed when the user types a phone number without - // an international code + /** Saves the current country code which is displayed when the user types a phone number without + * an international code */ COUNTRY_CODE: 'countryCode', - // Contains all the users settings for the Settings page and sub pages + /** Contains all the users settings for the Settings page and sub pages */ USER: 'user', - // Contains metadata (partner, login, validation date) for all of the user's logins + /** Contains metadata (partner, login, validation date) for all of the user's logins */ LOGIN_LIST: 'loginList', - // Information about the current session (authToken, accountID, email, loading, error) + /** Information about the current session (authToken, accountID, email, loading, error) */ SESSION: 'session', BETAS: 'betas', - // NVP keys - // Contains the user's payPalMe data + /** NVP keys + * Contains the user's payPalMe data */ PAYPAL: 'paypal', - // Contains the user preference for the LHN priority mode + /** Contains the user preference for the LHN priority mode */ NVP_PRIORITY_MODE: 'nvp_priorityMode', - // Contains the users's block expiration (if they have one) + /** Contains the users's block expiration (if they have one) */ NVP_BLOCKED_FROM_CONCIERGE: 'private_blockedFromConcierge', - // A unique identifier that each user has that's used to send notifications + /** A unique identifier that each user has that's used to send notifications */ NVP_PRIVATE_PUSH_NOTIFICATION_ID: 'private_pushNotificationID', - // The NVP with the last payment method used per policy + /** The NVP with the last payment method used per policy */ NVP_LAST_PAYMENT_METHOD: 'nvp_lastPaymentMethod', - // Does this user have push notifications enabled for this device? + /** Does this user have push notifications enabled for this device? */ PUSH_NOTIFICATIONS_ENABLED: 'pushNotificationsEnabled', - // Plaid data (access tokens, bank accounts ...) + /** Plaid data (access tokens, bank accounts ...) */ PLAID_DATA: 'plaidData', - // If we disabled Plaid because of too many attempts + /** If we disabled Plaid because of too many attempts */ IS_PLAID_DISABLED: 'isPlaidDisabled', - // Token needed to initialize Plaid link + /** Token needed to initialize Plaid link */ PLAID_LINK_TOKEN: 'plaidLinkToken', - // Token needed to initialize Onfido + /** Token needed to initialize Onfido */ ONFIDO_TOKEN: 'onfidoToken', - // Collection Keys + /** Collection Keys */ COLLECTION: { DOWNLOAD: 'download_', POLICY: 'policy_', @@ -123,74 +123,74 @@ export default { SECURITY_GROUP: 'securityGroup_', TRANSACTION: 'transactions_', - // This is deprecated, but needed for a migration, so we still need to include it here so that it will be initialized in Onyx.init + /** This is deprecated, but needed for a migration, so we still need to include it here so that it will be initialized in Onyx.init */ DEPRECATED_POLICY_MEMBER_LIST: 'policyMemberList_', }, - // Indicates which locale should be used + /** Indicates which locale should be used */ NVP_PREFERRED_LOCALE: 'preferredLocale', - // List of transactionIDs in process of rejection + /** List of transactionIDs in process of rejection */ TRANSACTIONS_BEING_REJECTED: 'transactionsBeingRejected', - // User's Expensify Wallet + /** User's Expensify Wallet */ USER_WALLET: 'userWallet', - // Object containing Onfido SDK Token + applicantID + /** Object containing Onfido SDK Token + applicantID */ WALLET_ONFIDO: 'walletOnfido', - // Stores information about additional details form entry + /** Stores information about additional details form entry */ WALLET_ADDITIONAL_DETAILS: 'walletAdditionalDetails', - // Object containing Wallet terms step state + /** Object containing Wallet terms step state */ WALLET_TERMS: 'walletTerms', - // The user's bank accounts + /** The user's bank accounts */ BANK_ACCOUNT_LIST: 'bankAccountList', - // The user's credit cards + /** The user's credit cards */ CARD_LIST: 'cardList', - // Stores information about the user's saved statements + /** Stores information about the user's saved statements */ WALLET_STATEMENT: 'walletStatement', - // Stores information about the active personal bank account being set up + /** Stores information about the active personal bank account being set up */ PERSONAL_BANK_ACCOUNT: 'personalBankAccount', - // Stores information about the active reimbursement account being set up + /** Stores information about the active reimbursement account being set up */ REIMBURSEMENT_ACCOUNT: 'reimbursementAccount', - // Stores draft information about the active reimbursement account being set up + /** Stores draft information about the active reimbursement account being set up */ REIMBURSEMENT_ACCOUNT_DRAFT: 'reimbursementAccountDraft', - // Store preferred skintone for emoji + /** Store preferred skintone for emoji */ PREFERRED_EMOJI_SKIN_TONE: 'preferredEmojiSkinTone', - // Store frequently used emojis for this user + /** Store frequently used emojis for this user */ FREQUENTLY_USED_EMOJIS: 'frequentlyUsedEmojis', - // Stores Workspace ID that will be tied to reimbursement account during setup + /** Stores Workspace ID that will be tied to reimbursement account during setup */ REIMBURSEMENT_ACCOUNT_WORKSPACE_ID: 'reimbursementAccountWorkspaceID', - // Set when we are loading payment methods + /** Set when we are loading payment methods */ IS_LOADING_PAYMENT_METHODS: 'isLoadingPaymentMethods', - // Is report data loading? + /** Is report data loading? */ IS_LOADING_REPORT_DATA: 'isLoadingReportData', - // Is Keyboard shortcuts modal open? + /** Is Keyboard shortcuts modal open? */ IS_SHORTCUTS_MODAL_OPEN: 'isShortcutsModalOpen', - // Is the test tools modal open? + /** Is the test tools modal open? */ IS_TEST_TOOLS_MODAL_OPEN: 'isTestToolsModalOpen', - // Stores information about active wallet transfer amount, selectedAccountID, status, etc + /** Stores information about active wallet transfer amount, selectedAccountID, status, etc */ WALLET_TRANSFER: 'walletTransfer', - // The policyID of the last workspace whose settings were accessed by the user + /** The policyID of the last workspace whose settings were accessed by the user */ LAST_ACCESSED_WORKSPACE_POLICY_ID: 'lastAccessedWorkspacePolicyID', - // List of Form ids + /** List of Form ids */ FORMS: { ADD_DEBIT_CARD_FORM: 'addDebitCardForm', REIMBURSEMENT_ACCOUNT_FORM: 'reimbursementAccount', @@ -214,23 +214,26 @@ export default { PAYPAL_FORM: 'payPalForm', }, - // Whether we should show the compose input or not + /** Whether we should show the compose input or not */ SHOULD_SHOW_COMPOSE_INPUT: 'shouldShowComposeInput', - // Is app in beta version + /** Is app in beta version */ IS_BETA: 'isBeta', // The theme setting set by the user in preferences. // This can be either "light", "dark" or "system" PREFERRED_THEME: 'preferredTheme', - // Whether we're checking if the room is public or not + /** Whether the auth token is valid */ + IS_TOKEN_VALID: 'isTokenValid', + + /** Whether we're checking if the room is public or not */ IS_CHECKING_PUBLIC_ROOM: 'isCheckingPublicRoom', - // A map of the user's security group IDs they belong to in specific domains + /** A map of the user's security group IDs they belong to in specific domains */ MY_DOMAIN_SECURITY_GROUPS: 'myDomainSecurityGroups', - // Report ID of the last report the user viewed as anonymous user + /** Report ID of the last report the user viewed as anonymous user */ LAST_OPENED_PUBLIC_ROOM_ID: 'lastOpenedPublicRoomID', // Experimental memory only Onyx mode flag From c8ed8f93555a8b2aa0c624eb98bc9c94845595a8 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 29 Jun 2023 16:30:14 +0200 Subject: [PATCH 042/649] Improve onyx common types + finish account type --- src/types/onyx/Account.ts | 22 ++++++++++++++------- src/types/onyx/{common.ts => OnyxCommon.ts} | 12 +++++------ 2 files changed, 21 insertions(+), 13 deletions(-) rename src/types/onyx/{common.ts => OnyxCommon.ts} (51%) diff --git a/src/types/onyx/Account.ts b/src/types/onyx/Account.ts index 0e4c40b70025..693d658c6380 100644 --- a/src/types/onyx/Account.ts +++ b/src/types/onyx/Account.ts @@ -1,8 +1,10 @@ -import * as CommonTypes from './common'; +import {ValueOf} from 'react-native-gesture-handler/lib/typescript/typeUtils'; +import CONST from '../../CONST'; +import * as OnyxCommon from './OnyxCommon'; -type Account = CommonTypes.BaseState & { +type Account = OnyxCommon.BaseState & { /** URL to the assigned guide's appointment booking calendar */ - guideCalendarLink: string; + guideCalendarLink?: string; /** User recovery codes for setting up 2-FA */ recoveryCodes?: string; @@ -10,20 +12,26 @@ type Account = CommonTypes.BaseState & { /** Secret key to enable 2FA within the authenticator app */ twoFactorAuthSecretKey?: string; - /** Whether or not two factor authentication is required */ - requiresTwoFactorAuth: boolean; + /** Whether this account has 2FA enabled or not */ + requiresTwoFactorAuth?: boolean; /** Whether the account is validated */ - validated: boolean; + validated?: boolean; /** The primaryLogin associated with the account */ - primaryLogin: string; + primaryLogin?: string; /** The message to be displayed when code requested */ message?: string; /** Accounts that are on a domain with an Approved Accountant */ doesDomainHaveApprovedAccountant?: boolean; + + /** Form that is being loaded */ + loadingForm?: ValueOf; + + /** Whether the user forgot their password */ + forgotPassword?: boolean; }; export default Account; diff --git a/src/types/onyx/common.ts b/src/types/onyx/OnyxCommon.ts similarity index 51% rename from src/types/onyx/common.ts rename to src/types/onyx/OnyxCommon.ts index 9eb8f958afcc..fbfe8633f060 100644 --- a/src/types/onyx/common.ts +++ b/src/types/onyx/OnyxCommon.ts @@ -1,23 +1,23 @@ import * as React from 'react'; -type RedBrickRoadPendingAction = 'add' | 'delete' | 'update'; +type PendingAction = 'add' | 'delete' | 'update'; type BaseState = { - success: string; + success?: string; /** An error message to display to the user */ errors?: Record; /** Whether or not data is loading */ - isLoading: boolean; + isLoading?: boolean; - pendingAction: RedBrickRoadPendingAction; + pendingAction?: PendingAction; }; type Icon = { - source: string | React.ReactNode; + source: React.ReactNode | string; type: 'avatar' | 'workspace'; name: string; }; -export type {RedBrickRoadPendingAction, BaseState, Icon}; +export type {BaseState, Icon}; From b8fdc466c96f532817c75df3b92ca618f0e60809 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 29 Jun 2023 16:30:35 +0200 Subject: [PATCH 043/649] Add type for ONYXKEYS.ACCOUNT_MANAGER_REPORT_ID --- src/types/onyx/OnyxValues.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/types/onyx/OnyxValues.ts b/src/types/onyx/OnyxValues.ts index db6887dbaca5..664cb910d05e 100644 --- a/src/types/onyx/OnyxValues.ts +++ b/src/types/onyx/OnyxValues.ts @@ -3,6 +3,7 @@ import Account from './Account'; type OnyxValues = { [ONYXKEYS.ACCOUNT]: Account; + [ONYXKEYS.ACCOUNT_MANAGER_REPORT_ID]: string; }; export default OnyxValues; From 2e2f1e03ec3fd2ad342133988c6e3dfc8ab9b2cf Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 29 Jun 2023 16:36:20 +0200 Subject: [PATCH 044/649] Add type for ONYXKEYS.NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER --- src/types/onyx/OnyxValues.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/types/onyx/OnyxValues.ts b/src/types/onyx/OnyxValues.ts index 664cb910d05e..d7e896a98153 100644 --- a/src/types/onyx/OnyxValues.ts +++ b/src/types/onyx/OnyxValues.ts @@ -3,7 +3,8 @@ import Account from './Account'; type OnyxValues = { [ONYXKEYS.ACCOUNT]: Account; - [ONYXKEYS.ACCOUNT_MANAGER_REPORT_ID]: string; + [ONYXKEYS.ACCOUNT_MANAGER_REPORT_ID]?: string; + [ONYXKEYS.NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER]?: boolean; }; export default OnyxValues; From fe9faf175a67a6aee79deebd452b7597d9cc2d57 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 29 Jun 2023 16:39:18 +0200 Subject: [PATCH 045/649] Add type for ONYXKEYS.ACTIVE_CLIENTS --- src/types/onyx/OnyxValues.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/types/onyx/OnyxValues.ts b/src/types/onyx/OnyxValues.ts index d7e896a98153..a2816fecd20f 100644 --- a/src/types/onyx/OnyxValues.ts +++ b/src/types/onyx/OnyxValues.ts @@ -5,6 +5,7 @@ type OnyxValues = { [ONYXKEYS.ACCOUNT]: Account; [ONYXKEYS.ACCOUNT_MANAGER_REPORT_ID]?: string; [ONYXKEYS.NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER]?: boolean; + [ONYXKEYS.ACTIVE_CLIENTS]: string[]; }; export default OnyxValues; From 6d8223d454faae20a2e788f8115cf63192af849b Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 29 Jun 2023 16:41:03 +0200 Subject: [PATCH 046/649] Add type for ONYXKEYS.DEVICE_ID --- src/types/onyx/OnyxValues.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/types/onyx/OnyxValues.ts b/src/types/onyx/OnyxValues.ts index a2816fecd20f..392f355eaea1 100644 --- a/src/types/onyx/OnyxValues.ts +++ b/src/types/onyx/OnyxValues.ts @@ -6,6 +6,7 @@ type OnyxValues = { [ONYXKEYS.ACCOUNT_MANAGER_REPORT_ID]?: string; [ONYXKEYS.NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER]?: boolean; [ONYXKEYS.ACTIVE_CLIENTS]: string[]; + [ONYXKEYS.DEVICE_ID]: string; }; export default OnyxValues; From 418fd374babdde02cf27abe65c859211b7e5e280 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 29 Jun 2023 16:42:19 +0200 Subject: [PATCH 047/649] Add type for ONYXKEYS.IS_SIDEBAR_LOADED --- src/types/onyx/OnyxValues.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/types/onyx/OnyxValues.ts b/src/types/onyx/OnyxValues.ts index 392f355eaea1..e65442c5316c 100644 --- a/src/types/onyx/OnyxValues.ts +++ b/src/types/onyx/OnyxValues.ts @@ -7,6 +7,7 @@ type OnyxValues = { [ONYXKEYS.NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER]?: boolean; [ONYXKEYS.ACTIVE_CLIENTS]: string[]; [ONYXKEYS.DEVICE_ID]: string; + [ONYXKEYS.IS_SIDEBAR_LOADED]?: boolean; }; export default OnyxValues; From 46a9fd0570da9da96560ed9ab0ead40025ba02bc Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 29 Jun 2023 16:51:22 +0200 Subject: [PATCH 048/649] Add type for ONYXKEYS.QUEUED_ONYX_UPDATES --- src/types/onyx/OnyxValues.ts | 4 ++++ src/types/onyx/QueuedOnyxUpdates.ts | 6 ++++++ 2 files changed, 10 insertions(+) create mode 100644 src/types/onyx/QueuedOnyxUpdates.ts diff --git a/src/types/onyx/OnyxValues.ts b/src/types/onyx/OnyxValues.ts index e65442c5316c..7e008951c1ee 100644 --- a/src/types/onyx/OnyxValues.ts +++ b/src/types/onyx/OnyxValues.ts @@ -1,5 +1,6 @@ import ONYXKEYS from '../../ONYXKEYS'; import Account from './Account'; +import QueuedOnyxUpdates from './QueuedOnyxUpdates'; type OnyxValues = { [ONYXKEYS.ACCOUNT]: Account; @@ -8,6 +9,9 @@ type OnyxValues = { [ONYXKEYS.ACTIVE_CLIENTS]: string[]; [ONYXKEYS.DEVICE_ID]: string; [ONYXKEYS.IS_SIDEBAR_LOADED]?: boolean; + // TODO: Type persisted requests properly + [ONYXKEYS.PERSISTED_REQUESTS]: unknown[]; + [ONYXKEYS.QUEUED_ONYX_UPDATES]: QueuedOnyxUpdates; }; export default OnyxValues; diff --git a/src/types/onyx/QueuedOnyxUpdates.ts b/src/types/onyx/QueuedOnyxUpdates.ts new file mode 100644 index 000000000000..09a6e1a3c509 --- /dev/null +++ b/src/types/onyx/QueuedOnyxUpdates.ts @@ -0,0 +1,6 @@ +// @ts-expect-error TODO: Remove after onyx is typed +import * as Onyx from 'react-native-onyx'; + +type QueuedOnyxUpdates = Array; + +export default QueuedOnyxUpdates; From e66f1f93c34a27ff51e0d67cb9f10c227adbd655 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 29 Jun 2023 16:53:39 +0200 Subject: [PATCH 049/649] Add type for ONYXKEYS.CURRENT_DATE --- src/types/onyx/OnyxValues.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/types/onyx/OnyxValues.ts b/src/types/onyx/OnyxValues.ts index 7e008951c1ee..e942161e2838 100644 --- a/src/types/onyx/OnyxValues.ts +++ b/src/types/onyx/OnyxValues.ts @@ -12,6 +12,7 @@ type OnyxValues = { // TODO: Type persisted requests properly [ONYXKEYS.PERSISTED_REQUESTS]: unknown[]; [ONYXKEYS.QUEUED_ONYX_UPDATES]: QueuedOnyxUpdates; + [ONYXKEYS.CURRENT_DATE]?: string; }; export default OnyxValues; From 82671a0e7a5358eaeeb48cc5122a66a78b6e0db5 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Fri, 30 Jun 2023 14:38:03 +0200 Subject: [PATCH 050/649] Change the structure a bit --- src/ONYXKEYS.ts | 27 ++++++++++++++++++++++++++- src/types/onyx/Account.ts | 2 +- src/types/onyx/OnyxValues.ts | 18 ------------------ src/types/onyx/index.ts | 5 +++++ src/types/utils.ts | 4 ++-- 5 files changed, 34 insertions(+), 22 deletions(-) delete mode 100644 src/types/onyx/OnyxValues.ts create mode 100644 src/types/onyx/index.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 5af1f387fd48..430bd9b61435 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -1,7 +1,11 @@ +import {ValueOf} from 'type-fest'; +import * as UtilTypes from './types/utils'; +import * as OnyxTypes from './types/onyx'; + /** * This is a file containing constants for all the top level keys in our store */ -export default { +const ONYXKEYS = { /** Holds information about the users account that is logging in */ ACCOUNT: 'account', @@ -239,3 +243,24 @@ export default { // Experimental memory only Onyx mode flag IS_USING_MEMORY_ONLY_KEYS: 'isUsingMemoryOnlyKeys', } as const; + +type OnyxKeysMap = typeof ONYXKEYS; +type CollectionKey = `${ValueOf}${string}`; +type OnyxKey = UtilTypes.DeepValueOf> | CollectionKey; + +type OnyxValues = { + [ONYXKEYS.ACCOUNT]: OnyxTypes.Account; + [ONYXKEYS.ACCOUNT_MANAGER_REPORT_ID]?: string; + [ONYXKEYS.NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER]?: boolean; + [ONYXKEYS.ACTIVE_CLIENTS]: string[]; + [ONYXKEYS.DEVICE_ID]: string; + [ONYXKEYS.IS_SIDEBAR_LOADED]?: boolean; + // TODO: Type persisted requests properly + [ONYXKEYS.PERSISTED_REQUESTS]: unknown[]; + [ONYXKEYS.QUEUED_ONYX_UPDATES]: OnyxTypes.QueuedOnyxUpdates; + [ONYXKEYS.CURRENT_DATE]?: string; + [ONYXKEYS.CREDENTIALS]?: OnyxTypes.Credentials; +}; + +export default ONYXKEYS; +export type {OnyxKey, OnyxValues}; diff --git a/src/types/onyx/Account.ts b/src/types/onyx/Account.ts index 693d658c6380..63d294ec71d8 100644 --- a/src/types/onyx/Account.ts +++ b/src/types/onyx/Account.ts @@ -1,4 +1,4 @@ -import {ValueOf} from 'react-native-gesture-handler/lib/typescript/typeUtils'; +import {ValueOf} from 'type-fest'; import CONST from '../../CONST'; import * as OnyxCommon from './OnyxCommon'; diff --git a/src/types/onyx/OnyxValues.ts b/src/types/onyx/OnyxValues.ts deleted file mode 100644 index e942161e2838..000000000000 --- a/src/types/onyx/OnyxValues.ts +++ /dev/null @@ -1,18 +0,0 @@ -import ONYXKEYS from '../../ONYXKEYS'; -import Account from './Account'; -import QueuedOnyxUpdates from './QueuedOnyxUpdates'; - -type OnyxValues = { - [ONYXKEYS.ACCOUNT]: Account; - [ONYXKEYS.ACCOUNT_MANAGER_REPORT_ID]?: string; - [ONYXKEYS.NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER]?: boolean; - [ONYXKEYS.ACTIVE_CLIENTS]: string[]; - [ONYXKEYS.DEVICE_ID]: string; - [ONYXKEYS.IS_SIDEBAR_LOADED]?: boolean; - // TODO: Type persisted requests properly - [ONYXKEYS.PERSISTED_REQUESTS]: unknown[]; - [ONYXKEYS.QUEUED_ONYX_UPDATES]: QueuedOnyxUpdates; - [ONYXKEYS.CURRENT_DATE]?: string; -}; - -export default OnyxValues; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts new file mode 100644 index 000000000000..2807357b6807 --- /dev/null +++ b/src/types/onyx/index.ts @@ -0,0 +1,5 @@ +import Account from './Account'; +import Credentials from './Credentials'; +import QueuedOnyxUpdates from './QueuedOnyxUpdates'; + +export type {Account, Credentials, QueuedOnyxUpdates}; diff --git a/src/types/utils.ts b/src/types/utils.ts index a6dea213f45b..98a658eed56f 100644 --- a/src/types/utils.ts +++ b/src/types/utils.ts @@ -1,4 +1,4 @@ -type NestedValues = T extends object ? NestedValues : T; +type DeepValueOf = T extends object ? DeepValueOf : T; // eslint-disable-next-line import/prefer-default-export -export type {NestedValues}; +export type {DeepValueOf}; From c78cd76de0782d8494b9d32cb3a5e8bdfc8bddbf Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Fri, 30 Jun 2023 16:24:14 +0200 Subject: [PATCH 051/649] Add type for ONYXKEYS.CREDENTIALS --- src/types/onyx/Credentials.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/types/onyx/Credentials.ts diff --git a/src/types/onyx/Credentials.ts b/src/types/onyx/Credentials.ts new file mode 100644 index 000000000000..1f6beb502907 --- /dev/null +++ b/src/types/onyx/Credentials.ts @@ -0,0 +1,14 @@ +type Credentials = { + /** The email/phone the user logged in with */ + login?: string; + password?: string; + twoFactorAuthCode?: string; + + /** The validate code */ + validateCode?: string; + + autoGeneratedLogin?: string; + autoGeneratedPassword?: string; +}; + +export default Credentials; From 47181cd773d68174fe16bdee9a8c6b53fae240a2 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Fri, 30 Jun 2023 17:03:00 +0200 Subject: [PATCH 052/649] Add type for ONYXKEYS.IOU --- src/ONYXKEYS.ts | 1 + src/types/onyx/IOU.ts | 18 ++++++++++++++++++ src/types/onyx/index.ts | 3 ++- 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 src/types/onyx/IOU.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 430bd9b61435..983e620eca2e 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -260,6 +260,7 @@ type OnyxValues = { [ONYXKEYS.QUEUED_ONYX_UPDATES]: OnyxTypes.QueuedOnyxUpdates; [ONYXKEYS.CURRENT_DATE]?: string; [ONYXKEYS.CREDENTIALS]?: OnyxTypes.Credentials; + [ONYXKEYS.IOU]: OnyxTypes.IOU; }; export default ONYXKEYS; diff --git a/src/types/onyx/IOU.ts b/src/types/onyx/IOU.ts new file mode 100644 index 000000000000..031c5791440c --- /dev/null +++ b/src/types/onyx/IOU.ts @@ -0,0 +1,18 @@ +type Participant = { + accountID?: number; + login?: string; + isPolicyExpenseChat?: boolean; + isOwnPolicyExpenseChat?: boolean; + selected?: boolean; +}; + +type IOU = { + id?: string; + amount?: number; + /** Selected Currency Code of the current IOU */ + currency?: string; + comment?: string; + participants?: Participant[]; +}; + +export default IOU; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index 2807357b6807..93488120a4d4 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -1,5 +1,6 @@ import Account from './Account'; import Credentials from './Credentials'; import QueuedOnyxUpdates from './QueuedOnyxUpdates'; +import IOU from './IOU'; -export type {Account, Credentials, QueuedOnyxUpdates}; +export type {Account, Credentials, QueuedOnyxUpdates, IOU}; From 87d7c874b287c085aaccaf5205c8002620abcef6 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Fri, 30 Jun 2023 17:11:21 +0200 Subject: [PATCH 053/649] Add type for ONYXKEYS.MODAL --- src/ONYXKEYS.ts | 1 + src/types/onyx/Modal.ts | 9 +++++++++ src/types/onyx/index.ts | 3 ++- 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 src/types/onyx/Modal.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 983e620eca2e..7281c9ce212b 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -261,6 +261,7 @@ type OnyxValues = { [ONYXKEYS.CURRENT_DATE]?: string; [ONYXKEYS.CREDENTIALS]?: OnyxTypes.Credentials; [ONYXKEYS.IOU]: OnyxTypes.IOU; + [ONYXKEYS.MODAL]: OnyxTypes.Modal; }; export default ONYXKEYS; diff --git a/src/types/onyx/Modal.ts b/src/types/onyx/Modal.ts new file mode 100644 index 000000000000..126b56d4c504 --- /dev/null +++ b/src/types/onyx/Modal.ts @@ -0,0 +1,9 @@ +type Modal = { + /** Indicates when an Alert modal is about to be visible */ + willAlertModalBecomeVisible?: boolean; + + /** Indicates if there is a modal currently visible or not */ + isVisible?: boolean; +}; + +export default Modal; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index 93488120a4d4..0b15f6147669 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -2,5 +2,6 @@ import Account from './Account'; import Credentials from './Credentials'; import QueuedOnyxUpdates from './QueuedOnyxUpdates'; import IOU from './IOU'; +import Modal from './Modal'; -export type {Account, Credentials, QueuedOnyxUpdates, IOU}; +export type {Account, Credentials, QueuedOnyxUpdates, IOU, Modal}; From 08c951a72a4821c3eb644de116fe7b9d8fd9112b Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Tue, 4 Jul 2023 13:21:08 +0200 Subject: [PATCH 054/649] Add type for ONYXKEYS.NETWORK --- src/ONYXKEYS.ts | 1 + src/types/onyx/Network.ts | 12 ++++++++++++ src/types/onyx/index.ts | 3 ++- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 src/types/onyx/Network.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 7281c9ce212b..80167a0fd92b 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -262,6 +262,7 @@ type OnyxValues = { [ONYXKEYS.CREDENTIALS]?: OnyxTypes.Credentials; [ONYXKEYS.IOU]: OnyxTypes.IOU; [ONYXKEYS.MODAL]: OnyxTypes.Modal; + [ONYXKEYS.NETWORK]: OnyxTypes.Network; }; export default ONYXKEYS; diff --git a/src/types/onyx/Network.ts b/src/types/onyx/Network.ts new file mode 100644 index 000000000000..5af4c1170c3f --- /dev/null +++ b/src/types/onyx/Network.ts @@ -0,0 +1,12 @@ +type Network = { + /** Is the network currently offline or not */ + isOffline?: boolean; + + /** Should the network be forced offline */ + shouldForceOffline?: boolean; + + /** Whether we should fail all network requests */ + shouldFailAllRequests?: boolean; +}; + +export default Network; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index 0b15f6147669..b5383e5b4ff9 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -3,5 +3,6 @@ import Credentials from './Credentials'; import QueuedOnyxUpdates from './QueuedOnyxUpdates'; import IOU from './IOU'; import Modal from './Modal'; +import Network from './Network'; -export type {Account, Credentials, QueuedOnyxUpdates, IOU, Modal}; +export type {Account, Credentials, QueuedOnyxUpdates, IOU, Modal, Network}; From 2c117f9e044f377f04c15de72fd0636bfc5355cc Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Tue, 4 Jul 2023 13:36:31 +0200 Subject: [PATCH 055/649] Add type for ONYXKEYS.PERSONAL_DETAILS_LIST --- src/ONYXKEYS.ts | 1 + src/types/onyx/PersonalDetails.ts | 36 +++++++++++++++++++++++++++++++ src/types/onyx/index.ts | 3 ++- 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/types/onyx/PersonalDetails.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 80167a0fd92b..1d32bc4938a7 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -263,6 +263,7 @@ type OnyxValues = { [ONYXKEYS.IOU]: OnyxTypes.IOU; [ONYXKEYS.MODAL]: OnyxTypes.Modal; [ONYXKEYS.NETWORK]: OnyxTypes.Network; + [ONYXKEYS.PERSONAL_DETAILS_LIST]: Record; }; export default ONYXKEYS; diff --git a/src/types/onyx/PersonalDetails.ts b/src/types/onyx/PersonalDetails.ts new file mode 100644 index 000000000000..c401c09b1eec --- /dev/null +++ b/src/types/onyx/PersonalDetails.ts @@ -0,0 +1,36 @@ +type PersonalDetails = { + // First name of the current user from their personal details + firstName?: string; + + // Last name of the current user from their personal details + lastName?: string; + + // Display name of the current user from their personal details + displayName?: string; + + // Avatar URL of the current user from their personal details + avatar?: string; + + // Flag to set when Avatar uploading + avatarUploading?: boolean; + + // login of the current user from their personal details + login?: string; + + // pronouns of the current user from their personal details + pronouns?: string; + + // local currency for the user + localCurrencyCode?: string; + + // timezone of the current user from their personal details + timezone?: { + // Value of selected timezone + selected?: string; + + // Whether timezone is automatically set + automatic?: boolean; + }; +}; + +export default PersonalDetails; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index b5383e5b4ff9..28a77258cc18 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -4,5 +4,6 @@ import QueuedOnyxUpdates from './QueuedOnyxUpdates'; import IOU from './IOU'; import Modal from './Modal'; import Network from './Network'; +import PersonalDetails from './PersonalDetails'; -export type {Account, Credentials, QueuedOnyxUpdates, IOU, Modal, Network}; +export type {Account, Credentials, QueuedOnyxUpdates, IOU, Modal, Network, PersonalDetails}; From 8f28192ac7bb3ce1193f19d30585216ce6073c31 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Tue, 4 Jul 2023 13:39:30 +0200 Subject: [PATCH 056/649] Add type for ONYXKEYS.PRIVATE_PERSONAL_DETAILS --- src/ONYXKEYS.ts | 1 + src/types/onyx/PrivatePersonalDetails.ts | 16 ++++++++++++++++ src/types/onyx/index.ts | 3 ++- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 src/types/onyx/PrivatePersonalDetails.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 1d32bc4938a7..b93b6da96bfc 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -264,6 +264,7 @@ type OnyxValues = { [ONYXKEYS.MODAL]: OnyxTypes.Modal; [ONYXKEYS.NETWORK]: OnyxTypes.Network; [ONYXKEYS.PERSONAL_DETAILS_LIST]: Record; + [ONYXKEYS.PRIVATE_PERSONAL_DETAILS]: OnyxTypes.PrivatePersonalDetails; }; export default ONYXKEYS; diff --git a/src/types/onyx/PrivatePersonalDetails.ts b/src/types/onyx/PrivatePersonalDetails.ts new file mode 100644 index 000000000000..75cc11e3e63e --- /dev/null +++ b/src/types/onyx/PrivatePersonalDetails.ts @@ -0,0 +1,16 @@ +type PrivatePersonalDetails = { + legalFirstName?: string; + legalLastName?: string; + dob?: string; + + /** User's home address */ + address?: { + street?: string; + city?: string; + state?: string; + zip?: string; + country?: string; + }; +}; + +export default PrivatePersonalDetails; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index 28a77258cc18..999e496c2a40 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -5,5 +5,6 @@ import IOU from './IOU'; import Modal from './Modal'; import Network from './Network'; import PersonalDetails from './PersonalDetails'; +import PrivatePersonalDetails from './PrivatePersonalDetails'; -export type {Account, Credentials, QueuedOnyxUpdates, IOU, Modal, Network, PersonalDetails}; +export type {Account, Credentials, QueuedOnyxUpdates, IOU, Modal, Network, PersonalDetails, PrivatePersonalDetails}; From 83d87c62227fb68571f9047aa3063b1713f53f41 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Tue, 4 Jul 2023 13:48:06 +0200 Subject: [PATCH 057/649] Add type for ONYXKEYS.TASK --- src/ONYXKEYS.ts | 1 + src/types/onyx/Report.ts | 79 ++++++++++++++++++++++++++++++++++++++++ src/types/onyx/Task.ts | 26 +++++++++++++ src/types/onyx/index.ts | 3 +- 4 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 src/types/onyx/Report.ts create mode 100644 src/types/onyx/Task.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index b93b6da96bfc..271cc8584cbd 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -265,6 +265,7 @@ type OnyxValues = { [ONYXKEYS.NETWORK]: OnyxTypes.Network; [ONYXKEYS.PERSONAL_DETAILS_LIST]: Record; [ONYXKEYS.PRIVATE_PERSONAL_DETAILS]: OnyxTypes.PrivatePersonalDetails; + [ONYXKEYS.TASK]: OnyxTypes.Task; }; export default ONYXKEYS; diff --git a/src/types/onyx/Report.ts b/src/types/onyx/Report.ts new file mode 100644 index 000000000000..c1dbc76b5dfd --- /dev/null +++ b/src/types/onyx/Report.ts @@ -0,0 +1,79 @@ +import * as CommonTypes from './OnyxCommon'; + +type Report = { + /** The specific type of chat */ + chatType: '' | 'policyAnnounce' | 'policyAdmins' | 'domainAll' | 'policyRoom' | 'policyExpenseChat'; + + /** Whether there is an outstanding amount in IOU */ + hasOutstandingIOU: boolean; + + /** List of icons for report participants */ + icons: CommonTypes.Icon[]; + + /** Are we loading more report actions? */ + isLoadingMoreReportActions: boolean; + + /** Flag to check if the report actions data are loading */ + isLoadingReportActions: boolean; + + /** Whether the user is not an admin of policyExpenseChat chat */ + isOwnPolicyExpenseChat: boolean; + + /** Indicates if the report is pinned to the LHN or not */ + isPinned: boolean; + + /** The email of the last message's actor */ + lastActorEmail: string; + + /** The text of the last message on the report */ + lastMessageText: string; + + /** The time of the last message on the report */ + lastVisibleActionCreated: string; + + /** The last time the report was visited */ + lastReadTime: string; + + /** The current user's notification preference for this report */ + notificationPreference: string | number; + + /** The policy name to use for an archived report */ + oldPolicyName: string; + + /** The email address of the report owner */ + ownerEmail: string; + + /** List of primarylogins of participants of the report */ + participants: string[]; + + /** Linked policy's ID */ + policyID: string; + + /** Name of the report */ + reportName: string; + + /** ID of the report */ + reportID: string; + + /** The state that the report is currently in */ + stateNum: + | 0 // OPEN + | 1 // PROCESSING + | 2; // SUBMITTED + + /** The status of the current report */ + statusNum: + | 0 // OPEN + | 1 // SUBMITTED + | 2 // CLOSED + | 3 // APPROVED + | 4; // REIMBURSED + + /** Which user role is capable of posting messages on the report */ + writeCapability: 'all' | 'admins'; + + /** The report type */ + type: string; +}; + +export default Report; diff --git a/src/types/onyx/Task.ts b/src/types/onyx/Task.ts new file mode 100644 index 000000000000..bebc11901878 --- /dev/null +++ b/src/types/onyx/Task.ts @@ -0,0 +1,26 @@ +import Report from './Report'; + +type Task = { + /** Title of the Task */ + title?: string; + + /** Description of the Task */ + description?: string; + + /** Share destination of the Task */ + shareDestination?: string; + + /** The task report if it's currently being edited */ + report?: Report; + + /** Assignee of the task */ + assignee?: string; + + /** The account id of the assignee */ + assigneeAccountID?: string; + + /** Report id only when a task was created from a report */ + parentReportID?: string; +}; + +export default Task; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index 999e496c2a40..7cc3de44b262 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -6,5 +6,6 @@ import Modal from './Modal'; import Network from './Network'; import PersonalDetails from './PersonalDetails'; import PrivatePersonalDetails from './PrivatePersonalDetails'; +import Task from './Task'; -export type {Account, Credentials, QueuedOnyxUpdates, IOU, Modal, Network, PersonalDetails, PrivatePersonalDetails}; +export type {Account, Credentials, QueuedOnyxUpdates, IOU, Modal, Network, PersonalDetails, PrivatePersonalDetails, Task}; From d9dbcec2423dfa673c1b253af253757951f5256a Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Tue, 4 Jul 2023 13:52:59 +0200 Subject: [PATCH 058/649] Add type for ONYXKEYS.CURRENCY_LIST --- src/ONYXKEYS.ts | 1 + src/types/onyx/Currency.ts | 12 ++++++++++++ src/types/onyx/index.ts | 3 ++- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 src/types/onyx/Currency.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 271cc8584cbd..d5a2d4eb22e2 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -266,6 +266,7 @@ type OnyxValues = { [ONYXKEYS.PERSONAL_DETAILS_LIST]: Record; [ONYXKEYS.PRIVATE_PERSONAL_DETAILS]: OnyxTypes.PrivatePersonalDetails; [ONYXKEYS.TASK]: OnyxTypes.Task; + [ONYXKEYS.CURRENCY_LIST]: Record; }; export default ONYXKEYS; diff --git a/src/types/onyx/Currency.ts b/src/types/onyx/Currency.ts new file mode 100644 index 000000000000..6651fe1d8383 --- /dev/null +++ b/src/types/onyx/Currency.ts @@ -0,0 +1,12 @@ +type Currency = { + // Symbol for the currency + symbol?: string; + + // Name of the currency + name?: string; + + // ISO4217 Code for the currency + ISO4217?: string; +}; + +export default Currency; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index 7cc3de44b262..e700de979dd0 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -7,5 +7,6 @@ import Network from './Network'; import PersonalDetails from './PersonalDetails'; import PrivatePersonalDetails from './PrivatePersonalDetails'; import Task from './Task'; +import Currency from './Currency'; -export type {Account, Credentials, QueuedOnyxUpdates, IOU, Modal, Network, PersonalDetails, PrivatePersonalDetails, Task}; +export type {Account, Credentials, QueuedOnyxUpdates, IOU, Modal, Network, PersonalDetails, PrivatePersonalDetails, Task, Currency}; From dbb9b630cd30af24e3622cf1cd9ea9240a6e44e8 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Tue, 4 Jul 2023 13:54:10 +0200 Subject: [PATCH 059/649] Add type for ONYXKEYS.UPDATE_AVAILABLE --- src/ONYXKEYS.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index d5a2d4eb22e2..c9ffed1e2a3f 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -267,6 +267,7 @@ type OnyxValues = { [ONYXKEYS.PRIVATE_PERSONAL_DETAILS]: OnyxTypes.PrivatePersonalDetails; [ONYXKEYS.TASK]: OnyxTypes.Task; [ONYXKEYS.CURRENCY_LIST]: Record; + [ONYXKEYS.UPDATE_AVAILABLE]: boolean; }; export default ONYXKEYS; From 9d33b9d3240b1c29f0ea214c56816b89cd84783d Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Tue, 4 Jul 2023 13:58:13 +0200 Subject: [PATCH 060/649] Add type for ONYXKEYS.SCREEN_SHARE_REQUEST --- src/ONYXKEYS.ts | 1 + src/types/onyx/ScreenShareRequest.ts | 9 +++++++++ src/types/onyx/index.ts | 3 ++- 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 src/types/onyx/ScreenShareRequest.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index c9ffed1e2a3f..68633905ec2d 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -268,6 +268,7 @@ type OnyxValues = { [ONYXKEYS.TASK]: OnyxTypes.Task; [ONYXKEYS.CURRENCY_LIST]: Record; [ONYXKEYS.UPDATE_AVAILABLE]: boolean; + [ONYXKEYS.SCREEN_SHARE_REQUEST]: OnyxTypes.ScreenShareRequest; }; export default ONYXKEYS; diff --git a/src/types/onyx/ScreenShareRequest.ts b/src/types/onyx/ScreenShareRequest.ts new file mode 100644 index 000000000000..564ba99c22ac --- /dev/null +++ b/src/types/onyx/ScreenShareRequest.ts @@ -0,0 +1,9 @@ +type ScreenShareRequest = { + /** Access token required to join a screen share room, generated by the backend */ + accessToken: string; + + /** Name of the screen share room to join */ + roomName: string; +}; + +export default ScreenShareRequest; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index e700de979dd0..fd6d2e9c7150 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -8,5 +8,6 @@ import PersonalDetails from './PersonalDetails'; import PrivatePersonalDetails from './PrivatePersonalDetails'; import Task from './Task'; import Currency from './Currency'; +import ScreenShareRequest from './ScreenShareRequest'; -export type {Account, Credentials, QueuedOnyxUpdates, IOU, Modal, Network, PersonalDetails, PrivatePersonalDetails, Task, Currency}; +export type {Account, Credentials, QueuedOnyxUpdates, IOU, Modal, Network, PersonalDetails, PrivatePersonalDetails, Task, Currency, ScreenShareRequest}; From 1e0f66bb8099d6a11898b9c39d9ffb3d6d90c562 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Tue, 4 Jul 2023 14:02:27 +0200 Subject: [PATCH 061/649] Add type for ONYXKEYS.COUNTRY_CODE --- src/ONYXKEYS.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 68633905ec2d..eb56bc744e5a 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -269,6 +269,7 @@ type OnyxValues = { [ONYXKEYS.CURRENCY_LIST]: Record; [ONYXKEYS.UPDATE_AVAILABLE]: boolean; [ONYXKEYS.SCREEN_SHARE_REQUEST]: OnyxTypes.ScreenShareRequest; + [ONYXKEYS.COUNTRY_CODE]: number; }; export default ONYXKEYS; From c9c04251829da62de1bb7f7c57733b99bbc5207a Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Tue, 4 Jul 2023 14:11:58 +0200 Subject: [PATCH 062/649] Add type for ONYXKEYS.USER --- src/ONYXKEYS.ts | 1 + src/types/onyx/User.ts | 30 ++++++++++++++++++++++++++++++ src/types/onyx/index.ts | 3 ++- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/types/onyx/User.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index eb56bc744e5a..184cec95640e 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -270,6 +270,7 @@ type OnyxValues = { [ONYXKEYS.UPDATE_AVAILABLE]: boolean; [ONYXKEYS.SCREEN_SHARE_REQUEST]: OnyxTypes.ScreenShareRequest; [ONYXKEYS.COUNTRY_CODE]: number; + [ONYXKEYS.USER]: OnyxTypes.User; }; export default ONYXKEYS; diff --git a/src/types/onyx/User.ts b/src/types/onyx/User.ts new file mode 100644 index 000000000000..cb5cd1d8c29a --- /dev/null +++ b/src/types/onyx/User.ts @@ -0,0 +1,30 @@ +type User = { + /** Whether or not the user is subscribed to news updates */ + isSubscribedToNewsletter?: boolean; + + /** Whether we should use the staging version of the secure API server */ + shouldUseStagingServer?: boolean; + + /** Is the user account validated? */ + validated?: boolean; + + /** Whether or not the user is on a public domain email account or not */ + isFromPublicDomain?: boolean; + + /** Whether or not the user use expensify card */ + isUsingExpensifyCard?: boolean; + + /** Whever Expensify Card approval flow is ongoing - checking loginList for private domains */ + isCheckingDomain?: boolean; + + /** Whether or not the user has lounge access */ + hasLoungeAccess?: boolean; + + /** error associated with adding a secondary login */ + error?: string; + + /** Whether the form is being submitted */ + loading?: boolean; +}; + +export default User; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index fd6d2e9c7150..c5bfb9de219a 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -9,5 +9,6 @@ import PrivatePersonalDetails from './PrivatePersonalDetails'; import Task from './Task'; import Currency from './Currency'; import ScreenShareRequest from './ScreenShareRequest'; +import User from './User'; -export type {Account, Credentials, QueuedOnyxUpdates, IOU, Modal, Network, PersonalDetails, PrivatePersonalDetails, Task, Currency, ScreenShareRequest}; +export type {Account, Credentials, QueuedOnyxUpdates, IOU, Modal, Network, PersonalDetails, PrivatePersonalDetails, Task, Currency, ScreenShareRequest, User}; From f9976ede428928979ea2a9c067f5d3b612f60dd9 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Tue, 4 Jul 2023 14:27:33 +0200 Subject: [PATCH 063/649] Add type for ONYXKEYS.LOGIN --- src/ONYXKEYS.ts | 11 ++++++----- src/types/onyx/Login.ts | 18 ++++++++++++++++++ src/types/onyx/index.ts | 3 ++- 3 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 src/types/onyx/Login.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 184cec95640e..ce1e6e054902 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -250,16 +250,16 @@ type OnyxKey = UtilTypes.DeepValueOf> | Collecti type OnyxValues = { [ONYXKEYS.ACCOUNT]: OnyxTypes.Account; - [ONYXKEYS.ACCOUNT_MANAGER_REPORT_ID]?: string; - [ONYXKEYS.NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER]?: boolean; + [ONYXKEYS.ACCOUNT_MANAGER_REPORT_ID]: string; + [ONYXKEYS.NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER]: boolean; [ONYXKEYS.ACTIVE_CLIENTS]: string[]; [ONYXKEYS.DEVICE_ID]: string; - [ONYXKEYS.IS_SIDEBAR_LOADED]?: boolean; + [ONYXKEYS.IS_SIDEBAR_LOADED]: boolean; // TODO: Type persisted requests properly [ONYXKEYS.PERSISTED_REQUESTS]: unknown[]; [ONYXKEYS.QUEUED_ONYX_UPDATES]: OnyxTypes.QueuedOnyxUpdates; - [ONYXKEYS.CURRENT_DATE]?: string; - [ONYXKEYS.CREDENTIALS]?: OnyxTypes.Credentials; + [ONYXKEYS.CURRENT_DATE]: string; + [ONYXKEYS.CREDENTIALS]: OnyxTypes.Credentials; [ONYXKEYS.IOU]: OnyxTypes.IOU; [ONYXKEYS.MODAL]: OnyxTypes.Modal; [ONYXKEYS.NETWORK]: OnyxTypes.Network; @@ -271,6 +271,7 @@ type OnyxValues = { [ONYXKEYS.SCREEN_SHARE_REQUEST]: OnyxTypes.ScreenShareRequest; [ONYXKEYS.COUNTRY_CODE]: number; [ONYXKEYS.USER]: OnyxTypes.User; + [ONYXKEYS.LOGIN_LIST]: OnyxTypes.Login; }; export default ONYXKEYS; diff --git a/src/types/onyx/Login.ts b/src/types/onyx/Login.ts new file mode 100644 index 000000000000..80f94defc201 --- /dev/null +++ b/src/types/onyx/Login.ts @@ -0,0 +1,18 @@ +type Login = { + /** Phone/Email associated with user */ + partnerUserID?: string; + + /** Value of partner name */ + partnerName?: string; + + /** Date login was validated, used to show info indicator status */ + validatedDate?: string; + + /** Field-specific server side errors keyed by microtime */ + errorFields?: Record>; + + /** Field-specific pending states for offline UI status */ + pendingFields?: Record>; +}; + +export default Login; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index c5bfb9de219a..ec2a0cdc98ca 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -10,5 +10,6 @@ import Task from './Task'; import Currency from './Currency'; import ScreenShareRequest from './ScreenShareRequest'; import User from './User'; +import Login from './Login'; -export type {Account, Credentials, QueuedOnyxUpdates, IOU, Modal, Network, PersonalDetails, PrivatePersonalDetails, Task, Currency, ScreenShareRequest, User}; +export type {Account, Credentials, QueuedOnyxUpdates, IOU, Modal, Network, PersonalDetails, PrivatePersonalDetails, Task, Currency, ScreenShareRequest, User, Login}; From 6990be1ef9da79384f76cf3e584a7a88da4b3ea7 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Tue, 4 Jul 2023 14:55:33 +0200 Subject: [PATCH 064/649] Add type for ONYXKEYS.SESSION --- src/ONYXKEYS.ts | 1 + src/types/onyx/Report.ts | 4 ++-- src/types/onyx/Session.ts | 15 +++++++++++++++ src/types/onyx/index.ts | 3 ++- 4 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 src/types/onyx/Session.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index ce1e6e054902..4767860a127b 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -272,6 +272,7 @@ type OnyxValues = { [ONYXKEYS.COUNTRY_CODE]: number; [ONYXKEYS.USER]: OnyxTypes.User; [ONYXKEYS.LOGIN_LIST]: OnyxTypes.Login; + [ONYXKEYS.SESSION]: OnyxTypes.Session; }; export default ONYXKEYS; diff --git a/src/types/onyx/Report.ts b/src/types/onyx/Report.ts index c1dbc76b5dfd..8f484ba2271c 100644 --- a/src/types/onyx/Report.ts +++ b/src/types/onyx/Report.ts @@ -1,4 +1,4 @@ -import * as CommonTypes from './OnyxCommon'; +import * as OnyxCommon from './OnyxCommon'; type Report = { /** The specific type of chat */ @@ -8,7 +8,7 @@ type Report = { hasOutstandingIOU: boolean; /** List of icons for report participants */ - icons: CommonTypes.Icon[]; + icons: OnyxCommon.Icon[]; /** Are we loading more report actions? */ isLoadingMoreReportActions: boolean; diff --git a/src/types/onyx/Session.ts b/src/types/onyx/Session.ts new file mode 100644 index 000000000000..2e8296271687 --- /dev/null +++ b/src/types/onyx/Session.ts @@ -0,0 +1,15 @@ +type Session = { + /** The user's email for the current session */ + email?: string; + + /** Currently logged in user authToken */ + authToken?: string; + + /** Currently logged in user encrypted authToken */ + encryptedAuthToken?: string; + + /** Currently logged in user accountID */ + accountID?: number; +}; + +export default Session; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index ec2a0cdc98ca..b7056c01e50a 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -11,5 +11,6 @@ import Currency from './Currency'; import ScreenShareRequest from './ScreenShareRequest'; import User from './User'; import Login from './Login'; +import Session from './Session'; -export type {Account, Credentials, QueuedOnyxUpdates, IOU, Modal, Network, PersonalDetails, PrivatePersonalDetails, Task, Currency, ScreenShareRequest, User, Login}; +export type {Account, Credentials, QueuedOnyxUpdates, IOU, Modal, Network, PersonalDetails, PrivatePersonalDetails, Task, Currency, ScreenShareRequest, User, Login, Session}; From 40e7bdc1953ceeb189e83d7d137dbe7062ef8e00 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Tue, 4 Jul 2023 15:03:26 +0200 Subject: [PATCH 065/649] Add type for ONYXKEYS.BETAS --- src/ONYXKEYS.ts | 2 ++ src/types/onyx/Beta.ts | 6 ++++++ src/types/onyx/index.ts | 3 ++- 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 src/types/onyx/Beta.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 4767860a127b..0334fddf1479 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -1,6 +1,7 @@ import {ValueOf} from 'type-fest'; import * as UtilTypes from './types/utils'; import * as OnyxTypes from './types/onyx'; +import CONST from './CONST'; /** * This is a file containing constants for all the top level keys in our store @@ -273,6 +274,7 @@ type OnyxValues = { [ONYXKEYS.USER]: OnyxTypes.User; [ONYXKEYS.LOGIN_LIST]: OnyxTypes.Login; [ONYXKEYS.SESSION]: OnyxTypes.Session; + [ONYXKEYS.BETAS]: OnyxTypes.Beta[]; }; export default ONYXKEYS; diff --git a/src/types/onyx/Beta.ts b/src/types/onyx/Beta.ts new file mode 100644 index 000000000000..d40d05a9ed3d --- /dev/null +++ b/src/types/onyx/Beta.ts @@ -0,0 +1,6 @@ +import {ValueOf} from 'type-fest'; +import CONST from '../../CONST'; + +type Beta = ValueOf; + +export default Beta; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index b7056c01e50a..0f06298297b2 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -12,5 +12,6 @@ import ScreenShareRequest from './ScreenShareRequest'; import User from './User'; import Login from './Login'; import Session from './Session'; +import Beta from './Beta'; -export type {Account, Credentials, QueuedOnyxUpdates, IOU, Modal, Network, PersonalDetails, PrivatePersonalDetails, Task, Currency, ScreenShareRequest, User, Login, Session}; +export type {Account, Credentials, QueuedOnyxUpdates, IOU, Modal, Network, PersonalDetails, PrivatePersonalDetails, Task, Currency, ScreenShareRequest, User, Login, Session, Beta}; From c98189afb5ff4513c2650f6b7e36b3eb6ee30774 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 11:12:02 +0200 Subject: [PATCH 066/649] Add type for ONYXKEYS.PAYPAL --- src/ONYXKEYS.ts | 1 + src/types/onyx/OnyxCommon.ts | 6 ++++-- src/types/onyx/Paypal.ts | 27 +++++++++++++++++++++++++++ src/types/onyx/index.ts | 3 ++- 4 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 src/types/onyx/Paypal.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 0334fddf1479..97623409b8e1 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -275,6 +275,7 @@ type OnyxValues = { [ONYXKEYS.LOGIN_LIST]: OnyxTypes.Login; [ONYXKEYS.SESSION]: OnyxTypes.Session; [ONYXKEYS.BETAS]: OnyxTypes.Beta[]; + [ONYXKEYS.PAYPAL]: OnyxTypes.Paypal; }; export default ONYXKEYS; diff --git a/src/types/onyx/OnyxCommon.ts b/src/types/onyx/OnyxCommon.ts index fbfe8633f060..260012849865 100644 --- a/src/types/onyx/OnyxCommon.ts +++ b/src/types/onyx/OnyxCommon.ts @@ -1,6 +1,8 @@ +import {ValueOf} from 'type-fest'; import * as React from 'react'; +import CONST from '../../CONST'; -type PendingAction = 'add' | 'delete' | 'update'; +type PendingAction = ValueOf; type BaseState = { success?: string; @@ -20,4 +22,4 @@ type Icon = { name: string; }; -export type {BaseState, Icon}; +export type {BaseState, Icon, PendingAction}; diff --git a/src/types/onyx/Paypal.ts b/src/types/onyx/Paypal.ts new file mode 100644 index 000000000000..61130723ddb1 --- /dev/null +++ b/src/types/onyx/Paypal.ts @@ -0,0 +1,27 @@ +import CONST from '../../CONST'; +import * as OnyxCommon from './OnyxCommon'; + +type PaypalAccountData = { + username?: string; +}; + +type Paypal = { + /** This is always 'PayPal.me' */ + title?: string; + + /** The paypalMe address */ + description?: string; + + /** This is always 'payPalMe' */ + methodID?: typeof CONST.PAYMENT_METHODS.PAYPAL; + + /** This is always 'payPalMe' */ + accountType?: typeof CONST.PAYMENT_METHODS.PAYPAL; + + key?: string; + isDefault?: boolean; + pendingAction?: OnyxCommon.PendingAction; + accountData?: PaypalAccountData; +}; + +export default Paypal; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index 0f06298297b2..45ae86c9f677 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -13,5 +13,6 @@ import User from './User'; import Login from './Login'; import Session from './Session'; import Beta from './Beta'; +import Paypal from './Paypal'; -export type {Account, Credentials, QueuedOnyxUpdates, IOU, Modal, Network, PersonalDetails, PrivatePersonalDetails, Task, Currency, ScreenShareRequest, User, Login, Session, Beta}; +export type {Account, Credentials, QueuedOnyxUpdates, IOU, Modal, Network, PersonalDetails, PrivatePersonalDetails, Task, Currency, ScreenShareRequest, User, Login, Session, Beta, Paypal}; From 85bfc4ea77a4cf8a2429b2ca872a0da2f2118cbd Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 12:34:28 +0200 Subject: [PATCH 067/649] Add type for ONYXKEYS.NVP_PRIORITY_MODE --- src/ONYXKEYS.ts | 86 +++++++++++++++++++++++-------------------------- 1 file changed, 40 insertions(+), 46 deletions(-) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 97623409b8e1..ed346f95e7fc 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -111,27 +111,6 @@ const ONYXKEYS = { /** Token needed to initialize Onfido */ ONFIDO_TOKEN: 'onfidoToken', - /** Collection Keys */ - COLLECTION: { - DOWNLOAD: 'download_', - POLICY: 'policy_', - POLICY_MEMBERS: 'policyMembers_', - WORKSPACE_INVITE_MEMBERS_DRAFT: 'workspaceInviteMembersDraft_', - REPORT: 'report_', - REPORT_ACTIONS: 'reportActions_', - REPORT_ACTIONS_DRAFTS: 'reportActionsDrafts_', - REPORT_ACTIONS_REACTIONS: 'reportActionsReactions_', - REPORT_DRAFT_COMMENT: 'reportDraftComment_', - REPORT_DRAFT_COMMENT_NUMBER_OF_LINES: 'reportDraftCommentNumberOfLines_', - REPORT_IS_COMPOSER_FULL_SIZE: 'reportIsComposerFullSize_', - REPORT_USER_IS_TYPING: 'reportUserIsTyping_', - SECURITY_GROUP: 'securityGroup_', - TRANSACTION: 'transactions_', - - /** This is deprecated, but needed for a migration, so we still need to include it here so that it will be initialized in Onyx.init */ - DEPRECATED_POLICY_MEMBER_LIST: 'policyMemberList_', - }, - /** Indicates which locale should be used */ NVP_PREFERRED_LOCALE: 'preferredLocale', @@ -195,6 +174,45 @@ const ONYXKEYS = { /** The policyID of the last workspace whose settings were accessed by the user */ LAST_ACCESSED_WORKSPACE_POLICY_ID: 'lastAccessedWorkspacePolicyID', + /** Whether we should show the compose input or not */ + SHOULD_SHOW_COMPOSE_INPUT: 'shouldShowComposeInput', + + /** Is app in beta version */ + IS_BETA: 'isBeta', + + /** Whether the auth token is valid */ + IS_TOKEN_VALID: 'isTokenValid', + + /** Whether we're checking if the room is public or not */ + IS_CHECKING_PUBLIC_ROOM: 'isCheckingPublicRoom', + + /** A map of the user's security group IDs they belong to in specific domains */ + MY_DOMAIN_SECURITY_GROUPS: 'myDomainSecurityGroups', + + /** Report ID of the last report the user viewed as anonymous user */ + LAST_OPENED_PUBLIC_ROOM_ID: 'lastOpenedPublicRoomID', + + /** Collection Keys */ + COLLECTION: { + DOWNLOAD: 'download_', + POLICY: 'policy_', + POLICY_MEMBERS: 'policyMembers_', + WORKSPACE_INVITE_MEMBERS_DRAFT: 'workspaceInviteMembersDraft_', + REPORT: 'report_', + REPORT_ACTIONS: 'reportActions_', + REPORT_ACTIONS_DRAFTS: 'reportActionsDrafts_', + REPORT_ACTIONS_REACTIONS: 'reportActionsReactions_', + REPORT_DRAFT_COMMENT: 'reportDraftComment_', + REPORT_DRAFT_COMMENT_NUMBER_OF_LINES: 'reportDraftCommentNumberOfLines_', + REPORT_IS_COMPOSER_FULL_SIZE: 'reportIsComposerFullSize_', + REPORT_USER_IS_TYPING: 'reportUserIsTyping_', + SECURITY_GROUP: 'securityGroup_', + TRANSACTION: 'transactions_', + + /** This is deprecated, but needed for a migration, so we still need to include it here so that it will be initialized in Onyx.init */ + DEPRECATED_POLICY_MEMBER_LIST: 'policyMemberList_', + }, + /** List of Form ids */ FORMS: { ADD_DEBIT_CARD_FORM: 'addDebitCardForm', @@ -218,31 +236,6 @@ const ONYXKEYS = { NEW_CONTACT_METHOD_FORM: 'newContactMethodForm', PAYPAL_FORM: 'payPalForm', }, - - /** Whether we should show the compose input or not */ - SHOULD_SHOW_COMPOSE_INPUT: 'shouldShowComposeInput', - - /** Is app in beta version */ - IS_BETA: 'isBeta', - - // The theme setting set by the user in preferences. - // This can be either "light", "dark" or "system" - PREFERRED_THEME: 'preferredTheme', - - /** Whether the auth token is valid */ - IS_TOKEN_VALID: 'isTokenValid', - - /** Whether we're checking if the room is public or not */ - IS_CHECKING_PUBLIC_ROOM: 'isCheckingPublicRoom', - - /** A map of the user's security group IDs they belong to in specific domains */ - MY_DOMAIN_SECURITY_GROUPS: 'myDomainSecurityGroups', - - /** Report ID of the last report the user viewed as anonymous user */ - LAST_OPENED_PUBLIC_ROOM_ID: 'lastOpenedPublicRoomID', - - // Experimental memory only Onyx mode flag - IS_USING_MEMORY_ONLY_KEYS: 'isUsingMemoryOnlyKeys', } as const; type OnyxKeysMap = typeof ONYXKEYS; @@ -276,6 +269,7 @@ type OnyxValues = { [ONYXKEYS.SESSION]: OnyxTypes.Session; [ONYXKEYS.BETAS]: OnyxTypes.Beta[]; [ONYXKEYS.PAYPAL]: OnyxTypes.Paypal; + [ONYXKEYS.NVP_PRIORITY_MODE]: ValueOf; }; export default ONYXKEYS; From 548fd4ac46292bbec7fc8710526611aa0fb892c1 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 12:38:25 +0200 Subject: [PATCH 068/649] Add type for ONYXKEYS.NVP_BLOCKED_FROM_CONCIERGE --- src/ONYXKEYS.ts | 1 + src/types/onyx/BlockedFromConcierge.ts | 6 ++++++ src/types/onyx/index.ts | 21 ++++++++++++++++++++- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/types/onyx/BlockedFromConcierge.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index ed346f95e7fc..15533ac75273 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -270,6 +270,7 @@ type OnyxValues = { [ONYXKEYS.BETAS]: OnyxTypes.Beta[]; [ONYXKEYS.PAYPAL]: OnyxTypes.Paypal; [ONYXKEYS.NVP_PRIORITY_MODE]: ValueOf; + [ONYXKEYS.NVP_BLOCKED_FROM_CONCIERGE]: OnyxTypes.BlockedFromConcierge; }; export default ONYXKEYS; diff --git a/src/types/onyx/BlockedFromConcierge.ts b/src/types/onyx/BlockedFromConcierge.ts new file mode 100644 index 000000000000..faa0681b79cf --- /dev/null +++ b/src/types/onyx/BlockedFromConcierge.ts @@ -0,0 +1,6 @@ +type BlockedFromConcierge = { + /** The date that the user will be unblocked */ + expiresAt?: string; +}; + +export default BlockedFromConcierge; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index 45ae86c9f677..370e9cc7315b 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -14,5 +14,24 @@ import Login from './Login'; import Session from './Session'; import Beta from './Beta'; import Paypal from './Paypal'; +import BlockedFromConcierge from './BlockedFromConcierge'; -export type {Account, Credentials, QueuedOnyxUpdates, IOU, Modal, Network, PersonalDetails, PrivatePersonalDetails, Task, Currency, ScreenShareRequest, User, Login, Session, Beta, Paypal}; +export type { + Account, + Credentials, + QueuedOnyxUpdates, + IOU, + Modal, + Network, + PersonalDetails, + PrivatePersonalDetails, + Task, + Currency, + ScreenShareRequest, + User, + Login, + Session, + Beta, + Paypal, + BlockedFromConcierge, +}; From 53b466f7c17b2e611ab877d5c432f05c2edfe9c8 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 12:39:56 +0200 Subject: [PATCH 069/649] Add type for ONYXKEYS.NVP_PRIVATE_PUSH_NOTIFICATION_ID --- src/ONYXKEYS.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 15533ac75273..f14deb5101fd 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -271,6 +271,7 @@ type OnyxValues = { [ONYXKEYS.PAYPAL]: OnyxTypes.Paypal; [ONYXKEYS.NVP_PRIORITY_MODE]: ValueOf; [ONYXKEYS.NVP_BLOCKED_FROM_CONCIERGE]: OnyxTypes.BlockedFromConcierge; + [ONYXKEYS.NVP_PRIVATE_PUSH_NOTIFICATION_ID]: string; }; export default ONYXKEYS; From a748462768052b7486b1a2063e8314a34a1fa573 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 12:41:01 +0200 Subject: [PATCH 070/649] Add type for ONYXKEYS.NVP_LAST_PAYMENT_METHOD --- src/ONYXKEYS.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index f14deb5101fd..dd482cfdbeb1 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -272,6 +272,7 @@ type OnyxValues = { [ONYXKEYS.NVP_PRIORITY_MODE]: ValueOf; [ONYXKEYS.NVP_BLOCKED_FROM_CONCIERGE]: OnyxTypes.BlockedFromConcierge; [ONYXKEYS.NVP_PRIVATE_PUSH_NOTIFICATION_ID]: string; + [ONYXKEYS.NVP_LAST_PAYMENT_METHOD]: Record; }; export default ONYXKEYS; From 3c73f40a2c8e9c493be66b8ea4633229a6c998da Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 12:42:09 +0200 Subject: [PATCH 071/649] Add type for ONYXKEYS.PUSH_NOTIFICATIONS_ENABLED --- src/ONYXKEYS.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index dd482cfdbeb1..1e1773faa826 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -273,6 +273,7 @@ type OnyxValues = { [ONYXKEYS.NVP_BLOCKED_FROM_CONCIERGE]: OnyxTypes.BlockedFromConcierge; [ONYXKEYS.NVP_PRIVATE_PUSH_NOTIFICATION_ID]: string; [ONYXKEYS.NVP_LAST_PAYMENT_METHOD]: Record; + [ONYXKEYS.PUSH_NOTIFICATIONS_ENABLED]: boolean; }; export default ONYXKEYS; From d53b28df54e6a562fc7de1de59cfc19bc471e8e9 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 12:51:19 +0200 Subject: [PATCH 072/649] Add type for ONYXKEYS.PLAID_DATA --- src/ONYXKEYS.ts | 1 + src/types/onyx/BankAccount.ts | 24 ++++++++++++++++++++++++ src/types/onyx/PlaidData.ts | 18 ++++++++++++++++++ src/types/onyx/index.ts | 2 ++ 4 files changed, 45 insertions(+) create mode 100644 src/types/onyx/BankAccount.ts create mode 100644 src/types/onyx/PlaidData.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 1e1773faa826..053abfd17e03 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -274,6 +274,7 @@ type OnyxValues = { [ONYXKEYS.NVP_PRIVATE_PUSH_NOTIFICATION_ID]: string; [ONYXKEYS.NVP_LAST_PAYMENT_METHOD]: Record; [ONYXKEYS.PUSH_NOTIFICATIONS_ENABLED]: boolean; + [ONYXKEYS.PLAID_DATA]: OnyxTypes.PlaidData; }; export default ONYXKEYS; diff --git a/src/types/onyx/BankAccount.ts b/src/types/onyx/BankAccount.ts new file mode 100644 index 000000000000..b83f8ee8c68d --- /dev/null +++ b/src/types/onyx/BankAccount.ts @@ -0,0 +1,24 @@ +type BankAccount = { + /** Masked account number */ + accountNumber: string; + + /** Name of account */ + addressName: string; + + /** Is the account a savings account? */ + isSavings: boolean; + + /** Unique identifier for this account in Plaid */ + plaidAccountID: string; + + /** Routing number for the account */ + routingNumber: string; + + /** last 4 digits of the account number */ + mask: string; + + /** Plaid access token, used to then retrieve Assets and Balances */ + plaidAccessToken: string; +}; + +export default BankAccount; diff --git a/src/types/onyx/PlaidData.ts b/src/types/onyx/PlaidData.ts new file mode 100644 index 000000000000..764bdda0abc2 --- /dev/null +++ b/src/types/onyx/PlaidData.ts @@ -0,0 +1,18 @@ +import BankAccount from './BankAccount'; +import * as OnyxCommon from './OnyxCommon'; + +type PlaidData = OnyxCommon.BaseState & { + /** Name of the bank */ + bankName?: string; + + /** + * Access token returned by Plaid once the user has logged into their bank. + * This token can be used along with internal credentials to query for Plaid Balance or Assets + */ + plaidAccessToken?: string; + + /** List of plaid bank accounts */ + bankAccounts?: BankAccount[]; +}; + +export default PlaidData; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index 370e9cc7315b..d7cc9fc9ad38 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -15,6 +15,7 @@ import Session from './Session'; import Beta from './Beta'; import Paypal from './Paypal'; import BlockedFromConcierge from './BlockedFromConcierge'; +import PlaidData from './PlaidData'; export type { Account, @@ -34,4 +35,5 @@ export type { Beta, Paypal, BlockedFromConcierge, + PlaidData, }; From 68350a00f6a0613947a82184a59d7c859c72a269 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 12:53:43 +0200 Subject: [PATCH 073/649] Add all values and type booleans --- src/ONYXKEYS.ts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 053abfd17e03..bfd818e5caba 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -275,6 +275,36 @@ type OnyxValues = { [ONYXKEYS.NVP_LAST_PAYMENT_METHOD]: Record; [ONYXKEYS.PUSH_NOTIFICATIONS_ENABLED]: boolean; [ONYXKEYS.PLAID_DATA]: OnyxTypes.PlaidData; + [ONYXKEYS.IS_PLAID_DISABLED]: boolean; + // [ONYXKEYS.PLAID_LINK_TOKEN]: OnyxTypes; + // [ONYXKEYS.ONFIDO_TOKEN]: OnyxTypes; + // [ONYXKEYS.NVP_PREFERRED_LOCALE]: OnyxTypes; + // [ONYXKEYS.TRANSACTIONS_BEING_REJECTED]: OnyxTypes; + // [ONYXKEYS.USER_WALLET]: OnyxTypes; + // [ONYXKEYS.WALLET_ONFIDO]: OnyxTypes; + // [ONYXKEYS.WALLET_ADDITIONAL_DETAILS]: OnyxTypes; + // [ONYXKEYS.WALLET_TERMS]: OnyxTypes; + // [ONYXKEYS.BANK_ACCOUNT_LIST]: OnyxTypes; + // [ONYXKEYS.CARD_LIST]: OnyxTypes; + // [ONYXKEYS.WALLET_STATEMENT]: OnyxTypes; + // [ONYXKEYS.PERSONAL_BANK_ACCOUNT]: OnyxTypes; + // [ONYXKEYS.REIMBURSEMENT_ACCOUNT]: OnyxTypes; + // [ONYXKEYS.REIMBURSEMENT_ACCOUNT_DRAFT]: OnyxTypes; + // [ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE]: OnyxTypes; + // [ONYXKEYS.FREQUENTLY_USED_EMOJIS]: OnyxTypes; + // [ONYXKEYS.REIMBURSEMENT_ACCOUNT_WORKSPACE_ID]: OnyxTypes; + [ONYXKEYS.IS_LOADING_PAYMENT_METHODS]: boolean; + [ONYXKEYS.IS_LOADING_REPORT_DATA]: boolean; + [ONYXKEYS.IS_SHORTCUTS_MODAL_OPEN]: boolean; + [ONYXKEYS.IS_TEST_TOOLS_MODAL_OPEN]: boolean; + // [ONYXKEYS.WALLET_TRANSFER]: OnyxTypes; + // [ONYXKEYS.LAST_ACCESSED_WORKSPACE_POLICY_ID]: OnyxTypes; + // [ONYXKEYS.SHOULD_SHOW_COMPOSE_INPUT]: OnyxTypes; + [ONYXKEYS.IS_BETA]: boolean; + [ONYXKEYS.IS_TOKEN_VALID]: boolean; + [ONYXKEYS.IS_CHECKING_PUBLIC_ROOM]: boolean; + // [ONYXKEYS.MY_DOMAIN_SECURITY_GROUPS]: OnyxTypes; + // [ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID]: OnyxTypes; }; export default ONYXKEYS; From c17349aa8d63a5c6cf25266d6594616365e74390 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 12:55:19 +0200 Subject: [PATCH 074/649] Add type for ONYXKEYS.PLAID_LINK_TOKEN --- src/ONYXKEYS.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index bfd818e5caba..5a2bfef68507 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -276,7 +276,7 @@ type OnyxValues = { [ONYXKEYS.PUSH_NOTIFICATIONS_ENABLED]: boolean; [ONYXKEYS.PLAID_DATA]: OnyxTypes.PlaidData; [ONYXKEYS.IS_PLAID_DISABLED]: boolean; - // [ONYXKEYS.PLAID_LINK_TOKEN]: OnyxTypes; + [ONYXKEYS.PLAID_LINK_TOKEN]: string; // [ONYXKEYS.ONFIDO_TOKEN]: OnyxTypes; // [ONYXKEYS.NVP_PREFERRED_LOCALE]: OnyxTypes; // [ONYXKEYS.TRANSACTIONS_BEING_REJECTED]: OnyxTypes; From 358bd6edff27ad893d752cc844d6b25cc54e0b6c Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 12:55:44 +0200 Subject: [PATCH 075/649] Add type for ONYXKEYS.ONFIDO_TOKEN --- src/ONYXKEYS.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 5a2bfef68507..7534bf2b31e6 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -277,7 +277,7 @@ type OnyxValues = { [ONYXKEYS.PLAID_DATA]: OnyxTypes.PlaidData; [ONYXKEYS.IS_PLAID_DISABLED]: boolean; [ONYXKEYS.PLAID_LINK_TOKEN]: string; - // [ONYXKEYS.ONFIDO_TOKEN]: OnyxTypes; + [ONYXKEYS.ONFIDO_TOKEN]: string; // [ONYXKEYS.NVP_PREFERRED_LOCALE]: OnyxTypes; // [ONYXKEYS.TRANSACTIONS_BEING_REJECTED]: OnyxTypes; // [ONYXKEYS.USER_WALLET]: OnyxTypes; From 4e0728ad5d50f500d07f2231e9d918af42d1061b Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 12:57:31 +0200 Subject: [PATCH 076/649] Add type for ONYXKEYS.NVP_PREFERRED_LOCALE --- src/ONYXKEYS.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 7534bf2b31e6..41aa4edfc60d 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -278,7 +278,7 @@ type OnyxValues = { [ONYXKEYS.IS_PLAID_DISABLED]: boolean; [ONYXKEYS.PLAID_LINK_TOKEN]: string; [ONYXKEYS.ONFIDO_TOKEN]: string; - // [ONYXKEYS.NVP_PREFERRED_LOCALE]: OnyxTypes; + [ONYXKEYS.NVP_PREFERRED_LOCALE]: ValueOf; // [ONYXKEYS.TRANSACTIONS_BEING_REJECTED]: OnyxTypes; // [ONYXKEYS.USER_WALLET]: OnyxTypes; // [ONYXKEYS.WALLET_ONFIDO]: OnyxTypes; From 8d0712caa3f6bbadb14ac0f5a2e63d013b00eb2f Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 12:58:16 +0200 Subject: [PATCH 077/649] Remove TRANSACTIONS_BEING_REJECTED as it is not used --- src/ONYXKEYS.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 41aa4edfc60d..2e0d999ee55c 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -114,9 +114,6 @@ const ONYXKEYS = { /** Indicates which locale should be used */ NVP_PREFERRED_LOCALE: 'preferredLocale', - /** List of transactionIDs in process of rejection */ - TRANSACTIONS_BEING_REJECTED: 'transactionsBeingRejected', - /** User's Expensify Wallet */ USER_WALLET: 'userWallet', @@ -279,7 +276,6 @@ type OnyxValues = { [ONYXKEYS.PLAID_LINK_TOKEN]: string; [ONYXKEYS.ONFIDO_TOKEN]: string; [ONYXKEYS.NVP_PREFERRED_LOCALE]: ValueOf; - // [ONYXKEYS.TRANSACTIONS_BEING_REJECTED]: OnyxTypes; // [ONYXKEYS.USER_WALLET]: OnyxTypes; // [ONYXKEYS.WALLET_ONFIDO]: OnyxTypes; // [ONYXKEYS.WALLET_ADDITIONAL_DETAILS]: OnyxTypes; From 439e2e346b095862245918bd02cefd48dda4cc70 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 13:03:48 +0200 Subject: [PATCH 078/649] Add type for ONYXKEYS.USER_WALLET --- src/ONYXKEYS.ts | 2 +- src/types/onyx/UserWallet.ts | 33 +++++++++++++++++++++++++++++++++ src/types/onyx/index.ts | 2 ++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 src/types/onyx/UserWallet.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 2e0d999ee55c..008be8d539ea 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -276,7 +276,7 @@ type OnyxValues = { [ONYXKEYS.PLAID_LINK_TOKEN]: string; [ONYXKEYS.ONFIDO_TOKEN]: string; [ONYXKEYS.NVP_PREFERRED_LOCALE]: ValueOf; - // [ONYXKEYS.USER_WALLET]: OnyxTypes; + [ONYXKEYS.USER_WALLET]: OnyxTypes.UserWallet; // [ONYXKEYS.WALLET_ONFIDO]: OnyxTypes; // [ONYXKEYS.WALLET_ADDITIONAL_DETAILS]: OnyxTypes; // [ONYXKEYS.WALLET_TERMS]: OnyxTypes; diff --git a/src/types/onyx/UserWallet.ts b/src/types/onyx/UserWallet.ts new file mode 100644 index 000000000000..652e05663a9e --- /dev/null +++ b/src/types/onyx/UserWallet.ts @@ -0,0 +1,33 @@ +import {ValueOf} from 'type-fest'; +import CONST from '../../CONST'; + +type UserWallet = { + /** The user's available wallet balance */ + availableBalance?: number; + + /** The user's current wallet balance */ + currentBalance?: number; + + /** What step in the activation flow are we on? */ + currentStep?: ValueOf; + + /** Error code returned by the server */ + errorCode?: string; + + /** If we should show the FailedKYC view after the user submitted their info with a non fixable error */ + shouldShowFailedKYC?: boolean; + + /** Status of wallet - e.g. SILVER or GOLD */ + tierName?: ValueOf; + + /** Whether we should show the ActivateStep success view after the user finished the KYC flow */ + shouldShowWalletActivationSuccess?: boolean; + + /** The ID of the linked account */ + walletLinkedAccountID?: number; + + /** The type of the linked account (debitCard or bankAccount) */ + walletLinkedAccountType?: string; +}; + +export default UserWallet; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index d7cc9fc9ad38..9866bc5a0050 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -16,6 +16,7 @@ import Beta from './Beta'; import Paypal from './Paypal'; import BlockedFromConcierge from './BlockedFromConcierge'; import PlaidData from './PlaidData'; +import UserWallet from './UserWallet'; export type { Account, @@ -36,4 +37,5 @@ export type { Paypal, BlockedFromConcierge, PlaidData, + UserWallet, }; From 3631ceb6d5b276520ce94a590f47247bd14a28eb Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 13:08:44 +0200 Subject: [PATCH 079/649] Add type for ONYXKEYS.WALLET_ONFIDO --- src/ONYXKEYS.ts | 2 +- src/types/onyx/OnfidoWallet.ts | 21 +++++++++++++++++++++ src/types/onyx/index.ts | 2 ++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 src/types/onyx/OnfidoWallet.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 008be8d539ea..09d1eef7acbe 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -277,7 +277,7 @@ type OnyxValues = { [ONYXKEYS.ONFIDO_TOKEN]: string; [ONYXKEYS.NVP_PREFERRED_LOCALE]: ValueOf; [ONYXKEYS.USER_WALLET]: OnyxTypes.UserWallet; - // [ONYXKEYS.WALLET_ONFIDO]: OnyxTypes; + [ONYXKEYS.WALLET_ONFIDO]: OnyxTypes.OnfidoWallet; // [ONYXKEYS.WALLET_ADDITIONAL_DETAILS]: OnyxTypes; // [ONYXKEYS.WALLET_TERMS]: OnyxTypes; // [ONYXKEYS.BANK_ACCOUNT_LIST]: OnyxTypes; diff --git a/src/types/onyx/OnfidoWallet.ts b/src/types/onyx/OnfidoWallet.ts new file mode 100644 index 000000000000..e9cfedee7120 --- /dev/null +++ b/src/types/onyx/OnfidoWallet.ts @@ -0,0 +1,21 @@ +type OnfidoWallet = { + /** Unique identifier returned from openOnfidoFlow then re-sent to ActivateWallet with Onfido response data */ + applicantID?: string; + + /** Token used to initialize the Onfido SDK token */ + sdkToken?: string; + + /** Loading state to provide feedback when we are waiting for a request to finish */ + loading?: boolean; + + /** Error message to inform the user of any problem that might occur */ + error?: string; + + /** A list of Onfido errors that the user can fix in order to attempt the Onfido flow again */ + fixableErrors?: string[]; + + /** Whether the user has accepted the privacy policy of Onfido or not */ + hasAcceptedPrivacyPolicy?: boolean; +}; + +export default OnfidoWallet; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index 9866bc5a0050..db6cdc54b357 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -17,6 +17,7 @@ import Paypal from './Paypal'; import BlockedFromConcierge from './BlockedFromConcierge'; import PlaidData from './PlaidData'; import UserWallet from './UserWallet'; +import OnfidoWallet from './OnfidoWallet'; export type { Account, @@ -38,4 +39,5 @@ export type { BlockedFromConcierge, PlaidData, UserWallet, + OnfidoWallet, }; From 77840a3d8f59cade0d6df17e68668fa2caad2080 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 13:13:05 +0200 Subject: [PATCH 080/649] Add type for ONYXKEYS.WALLET_ADDITIONAL_DETAILS --- src/ONYXKEYS.ts | 2 +- src/types/onyx/WalletAdditionalDetails.ts | 23 +++++++++++++++++++++++ src/types/onyx/index.ts | 2 ++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 src/types/onyx/WalletAdditionalDetails.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 09d1eef7acbe..510c508fb010 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -278,7 +278,7 @@ type OnyxValues = { [ONYXKEYS.NVP_PREFERRED_LOCALE]: ValueOf; [ONYXKEYS.USER_WALLET]: OnyxTypes.UserWallet; [ONYXKEYS.WALLET_ONFIDO]: OnyxTypes.OnfidoWallet; - // [ONYXKEYS.WALLET_ADDITIONAL_DETAILS]: OnyxTypes; + [ONYXKEYS.WALLET_ADDITIONAL_DETAILS]: OnyxTypes.WalletAdditionalDetails; // [ONYXKEYS.WALLET_TERMS]: OnyxTypes; // [ONYXKEYS.BANK_ACCOUNT_LIST]: OnyxTypes; // [ONYXKEYS.CARD_LIST]: OnyxTypes; diff --git a/src/types/onyx/WalletAdditionalDetails.ts b/src/types/onyx/WalletAdditionalDetails.ts new file mode 100644 index 000000000000..4b7012d23738 --- /dev/null +++ b/src/types/onyx/WalletAdditionalDetails.ts @@ -0,0 +1,23 @@ +import * as OnyxCommon from './OnyxCommon'; + +type WalletAdditionalDetails = OnyxCommon.BaseState & { + /** Questions returned by Ideology */ + questions?: { + prompt: string; + type: string; + answer: string[]; + }; + + /** ExpectID ID number related to those questions */ + idNumber?: string; + + /** Error code to determine additional behavior */ + errorCode?: string; + + /** Which field needs attention? */ + errorFields?: { + [fieldName: string]: boolean; + }; +}; + +export default WalletAdditionalDetails; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index db6cdc54b357..c3358eab4aae 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -18,6 +18,7 @@ import BlockedFromConcierge from './BlockedFromConcierge'; import PlaidData from './PlaidData'; import UserWallet from './UserWallet'; import OnfidoWallet from './OnfidoWallet'; +import WalletAdditionalDetails from './WalletAdditionalDetails'; export type { Account, @@ -40,4 +41,5 @@ export type { PlaidData, UserWallet, OnfidoWallet, + WalletAdditionalDetails, }; From 49a0be196fa8d4962488a2c9e5a244309b67baf7 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 13:17:02 +0200 Subject: [PATCH 081/649] Add type for ONYXKEYS.WALLET_TERMS --- src/ONYXKEYS.ts | 2 +- src/types/onyx/WalletTerms.ts | 9 +++++++++ src/types/onyx/index.ts | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 src/types/onyx/WalletTerms.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 510c508fb010..8057cdc29b7e 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -279,7 +279,7 @@ type OnyxValues = { [ONYXKEYS.USER_WALLET]: OnyxTypes.UserWallet; [ONYXKEYS.WALLET_ONFIDO]: OnyxTypes.OnfidoWallet; [ONYXKEYS.WALLET_ADDITIONAL_DETAILS]: OnyxTypes.WalletAdditionalDetails; - // [ONYXKEYS.WALLET_TERMS]: OnyxTypes; + [ONYXKEYS.WALLET_TERMS]: OnyxTypes.WalletTerms; // [ONYXKEYS.BANK_ACCOUNT_LIST]: OnyxTypes; // [ONYXKEYS.CARD_LIST]: OnyxTypes; // [ONYXKEYS.WALLET_STATEMENT]: OnyxTypes; diff --git a/src/types/onyx/WalletTerms.ts b/src/types/onyx/WalletTerms.ts new file mode 100644 index 000000000000..4f020051b531 --- /dev/null +++ b/src/types/onyx/WalletTerms.ts @@ -0,0 +1,9 @@ +type WalletTerms = { + /** Any error message to show */ + errors?: string[]; + + /** When the user accepts the Wallet's terms in order to pay an IOU, this is the ID of the chatReport the IOU is linked to */ + chatReportID?: string; +}; + +export default WalletTerms; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index c3358eab4aae..3246d943b203 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -19,6 +19,7 @@ import PlaidData from './PlaidData'; import UserWallet from './UserWallet'; import OnfidoWallet from './OnfidoWallet'; import WalletAdditionalDetails from './WalletAdditionalDetails'; +import WalletTerms from './WalletTerms'; export type { Account, @@ -42,4 +43,5 @@ export type { UserWallet, OnfidoWallet, WalletAdditionalDetails, + WalletTerms, }; From 96ddb62af31676ad77c1e68a6a885c419fd85125 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 13:21:06 +0200 Subject: [PATCH 082/649] Add type for ONYXKEYS.BANK_ACCOUNT_LIST --- src/ONYXKEYS.ts | 2 +- src/types/onyx/BankAccount.ts | 25 ++++++++----------------- src/types/onyx/PlaidBankAccount.ts | 24 ++++++++++++++++++++++++ src/types/onyx/PlaidData.ts | 4 ++-- src/types/onyx/index.ts | 2 ++ 5 files changed, 37 insertions(+), 20 deletions(-) create mode 100644 src/types/onyx/PlaidBankAccount.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 8057cdc29b7e..f90014b6a44c 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -280,7 +280,7 @@ type OnyxValues = { [ONYXKEYS.WALLET_ONFIDO]: OnyxTypes.OnfidoWallet; [ONYXKEYS.WALLET_ADDITIONAL_DETAILS]: OnyxTypes.WalletAdditionalDetails; [ONYXKEYS.WALLET_TERMS]: OnyxTypes.WalletTerms; - // [ONYXKEYS.BANK_ACCOUNT_LIST]: OnyxTypes; + [ONYXKEYS.BANK_ACCOUNT_LIST]: Record; // [ONYXKEYS.CARD_LIST]: OnyxTypes; // [ONYXKEYS.WALLET_STATEMENT]: OnyxTypes; // [ONYXKEYS.PERSONAL_BANK_ACCOUNT]: OnyxTypes; diff --git a/src/types/onyx/BankAccount.ts b/src/types/onyx/BankAccount.ts index b83f8ee8c68d..bf43b28d8438 100644 --- a/src/types/onyx/BankAccount.ts +++ b/src/types/onyx/BankAccount.ts @@ -1,24 +1,15 @@ type BankAccount = { - /** Masked account number */ - accountNumber: string; + /** The name of the institution (bank of america, etc */ + addressName?: string; - /** Name of account */ - addressName: string; + /** The masked bank account number */ + accountNumber?: string; - /** Is the account a savings account? */ - isSavings: boolean; + /** The bankAccountID in the bankAccounts db */ + bankAccountID?: number; - /** Unique identifier for this account in Plaid */ - plaidAccountID: string; - - /** Routing number for the account */ - routingNumber: string; - - /** last 4 digits of the account number */ - mask: string; - - /** Plaid access token, used to then retrieve Assets and Balances */ - plaidAccessToken: string; + /** The bank account type */ + type?: string; }; export default BankAccount; diff --git a/src/types/onyx/PlaidBankAccount.ts b/src/types/onyx/PlaidBankAccount.ts new file mode 100644 index 000000000000..7710effeb751 --- /dev/null +++ b/src/types/onyx/PlaidBankAccount.ts @@ -0,0 +1,24 @@ +type PlaidBankAccount = { + /** Masked account number */ + accountNumber: string; + + /** Name of account */ + addressName: string; + + /** Is the account a savings account? */ + isSavings: boolean; + + /** Unique identifier for this account in Plaid */ + plaidAccountID: string; + + /** Routing number for the account */ + routingNumber: string; + + /** last 4 digits of the account number */ + mask: string; + + /** Plaid access token, used to then retrieve Assets and Balances */ + plaidAccessToken: string; +}; + +export default PlaidBankAccount; diff --git a/src/types/onyx/PlaidData.ts b/src/types/onyx/PlaidData.ts index 764bdda0abc2..f4b8239597c5 100644 --- a/src/types/onyx/PlaidData.ts +++ b/src/types/onyx/PlaidData.ts @@ -1,4 +1,4 @@ -import BankAccount from './BankAccount'; +import PlaidBankAccount from './PlaidBankAccount'; import * as OnyxCommon from './OnyxCommon'; type PlaidData = OnyxCommon.BaseState & { @@ -12,7 +12,7 @@ type PlaidData = OnyxCommon.BaseState & { plaidAccessToken?: string; /** List of plaid bank accounts */ - bankAccounts?: BankAccount[]; + bankAccounts?: PlaidBankAccount[]; }; export default PlaidData; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index 3246d943b203..47cd60149abb 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -20,6 +20,7 @@ import UserWallet from './UserWallet'; import OnfidoWallet from './OnfidoWallet'; import WalletAdditionalDetails from './WalletAdditionalDetails'; import WalletTerms from './WalletTerms'; +import BankAccount from './BankAccount'; export type { Account, @@ -44,4 +45,5 @@ export type { OnfidoWallet, WalletAdditionalDetails, WalletTerms, + BankAccount, }; From 7ad0a1c25a50b2e001e76d78c1917f3e8ad62928 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 13:39:22 +0200 Subject: [PATCH 083/649] Add type for ONYXKEYS.CARD_LIST --- src/ONYXKEYS.ts | 2 +- src/types/onyx/Card.ts | 12 ++++++++++++ src/types/onyx/index.ts | 2 ++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 src/types/onyx/Card.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index f90014b6a44c..d903b6962429 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -281,7 +281,7 @@ type OnyxValues = { [ONYXKEYS.WALLET_ADDITIONAL_DETAILS]: OnyxTypes.WalletAdditionalDetails; [ONYXKEYS.WALLET_TERMS]: OnyxTypes.WalletTerms; [ONYXKEYS.BANK_ACCOUNT_LIST]: Record; - // [ONYXKEYS.CARD_LIST]: OnyxTypes; + [ONYXKEYS.CARD_LIST]: Record; // [ONYXKEYS.WALLET_STATEMENT]: OnyxTypes; // [ONYXKEYS.PERSONAL_BANK_ACCOUNT]: OnyxTypes; // [ONYXKEYS.REIMBURSEMENT_ACCOUNT]: OnyxTypes; diff --git a/src/types/onyx/Card.ts b/src/types/onyx/Card.ts new file mode 100644 index 000000000000..3c3111510da1 --- /dev/null +++ b/src/types/onyx/Card.ts @@ -0,0 +1,12 @@ +type Card = { + /** The name of the institution (bank of america, etc) */ + cardName?: string; + + /** The masked credit card number */ + cardNumber?: string; + + /** The ID of the card in the cards DB */ + cardID?: number; +}; + +export default Card; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index 47cd60149abb..53a48ee24318 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -21,6 +21,7 @@ import OnfidoWallet from './OnfidoWallet'; import WalletAdditionalDetails from './WalletAdditionalDetails'; import WalletTerms from './WalletTerms'; import BankAccount from './BankAccount'; +import Card from './Card'; export type { Account, @@ -46,4 +47,5 @@ export type { WalletAdditionalDetails, WalletTerms, BankAccount, + Card, }; From 8beae0837164ef224151129b8001387096c221c0 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 13:40:38 +0200 Subject: [PATCH 084/649] Add type for ONYXKEYS.WALLET_STATEMENT --- src/ONYXKEYS.ts | 2 +- src/types/onyx/WalletStatement.ts | 6 ++++++ src/types/onyx/index.ts | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 src/types/onyx/WalletStatement.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index d903b6962429..07d010ff8b42 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -282,7 +282,7 @@ type OnyxValues = { [ONYXKEYS.WALLET_TERMS]: OnyxTypes.WalletTerms; [ONYXKEYS.BANK_ACCOUNT_LIST]: Record; [ONYXKEYS.CARD_LIST]: Record; - // [ONYXKEYS.WALLET_STATEMENT]: OnyxTypes; + [ONYXKEYS.WALLET_STATEMENT]: OnyxTypes.WalletStatement; // [ONYXKEYS.PERSONAL_BANK_ACCOUNT]: OnyxTypes; // [ONYXKEYS.REIMBURSEMENT_ACCOUNT]: OnyxTypes; // [ONYXKEYS.REIMBURSEMENT_ACCOUNT_DRAFT]: OnyxTypes; diff --git a/src/types/onyx/WalletStatement.ts b/src/types/onyx/WalletStatement.ts new file mode 100644 index 000000000000..d42aae32a823 --- /dev/null +++ b/src/types/onyx/WalletStatement.ts @@ -0,0 +1,6 @@ +type WalletStatement = { + /** Whether we are currently generating a PDF version of the statement */ + isGenerating: boolean; +}; + +export default WalletStatement; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index 53a48ee24318..97247df8850d 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -22,6 +22,7 @@ import WalletAdditionalDetails from './WalletAdditionalDetails'; import WalletTerms from './WalletTerms'; import BankAccount from './BankAccount'; import Card from './Card'; +import WalletStatement from './WalletStatement'; export type { Account, @@ -48,4 +49,5 @@ export type { WalletTerms, BankAccount, Card, + WalletStatement, }; From 2efd61d9e0b6d5151d79d88b921a7f3eae971534 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 13:43:36 +0200 Subject: [PATCH 085/649] Add type for ONYXKEYS.PERSONAL_BANK_ACCOUNT --- src/ONYXKEYS.ts | 2 +- src/types/onyx/PersonalBankAccount.ts | 15 +++++++++++++++ src/types/onyx/index.ts | 2 ++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 src/types/onyx/PersonalBankAccount.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 07d010ff8b42..fffc4cd8d45b 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -283,7 +283,7 @@ type OnyxValues = { [ONYXKEYS.BANK_ACCOUNT_LIST]: Record; [ONYXKEYS.CARD_LIST]: Record; [ONYXKEYS.WALLET_STATEMENT]: OnyxTypes.WalletStatement; - // [ONYXKEYS.PERSONAL_BANK_ACCOUNT]: OnyxTypes; + [ONYXKEYS.PERSONAL_BANK_ACCOUNT]: OnyxTypes.PersonalBankAccount; // [ONYXKEYS.REIMBURSEMENT_ACCOUNT]: OnyxTypes; // [ONYXKEYS.REIMBURSEMENT_ACCOUNT_DRAFT]: OnyxTypes; // [ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE]: OnyxTypes; diff --git a/src/types/onyx/PersonalBankAccount.ts b/src/types/onyx/PersonalBankAccount.ts new file mode 100644 index 000000000000..06f505a04196 --- /dev/null +++ b/src/types/onyx/PersonalBankAccount.ts @@ -0,0 +1,15 @@ +type PersonalBankAccount = { + /** An error message to display to the user */ + error?: string; + + /** Whether we should show the view that the bank account was successfully added */ + shouldShowSuccess?: boolean; + + /** Whether the form is loading */ + isLoading?: boolean; + + /** The account ID of the selected bank account from Plaid */ + plaidAccountID?: string; +}; + +export default PersonalBankAccount; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index 97247df8850d..5d3956ddf3e4 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -23,6 +23,7 @@ import WalletTerms from './WalletTerms'; import BankAccount from './BankAccount'; import Card from './Card'; import WalletStatement from './WalletStatement'; +import PersonalBankAccount from './PersonalBankAccount'; export type { Account, @@ -50,4 +51,5 @@ export type { BankAccount, Card, WalletStatement, + PersonalBankAccount, }; From 61adcc2bd57b6aa4026cd9db20bb8474f49fe515 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 13:44:35 +0200 Subject: [PATCH 086/649] Add type for ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID --- src/ONYXKEYS.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index fffc4cd8d45b..183ac59e1dc3 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -300,7 +300,7 @@ type OnyxValues = { [ONYXKEYS.IS_TOKEN_VALID]: boolean; [ONYXKEYS.IS_CHECKING_PUBLIC_ROOM]: boolean; // [ONYXKEYS.MY_DOMAIN_SECURITY_GROUPS]: OnyxTypes; - // [ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID]: OnyxTypes; + [ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID]: string; }; export default ONYXKEYS; From fa5da57aaa570ca4d6ee24b7481e3865167b43f5 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 13:45:32 +0200 Subject: [PATCH 087/649] Add type for ONYXKEYS.MY_DOMAIN_SECURITY_GROUPS --- src/ONYXKEYS.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 183ac59e1dc3..9e0049f59ed6 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -299,7 +299,7 @@ type OnyxValues = { [ONYXKEYS.IS_BETA]: boolean; [ONYXKEYS.IS_TOKEN_VALID]: boolean; [ONYXKEYS.IS_CHECKING_PUBLIC_ROOM]: boolean; - // [ONYXKEYS.MY_DOMAIN_SECURITY_GROUPS]: OnyxTypes; + [ONYXKEYS.MY_DOMAIN_SECURITY_GROUPS]: Record; [ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID]: string; }; From 065b49af20f2922a8565890becad9cd6a7b4cf21 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 13:45:57 +0200 Subject: [PATCH 088/649] Add type for ONYXKEYS.SHOULD_SHOW_COMPOSE_INPUT --- src/ONYXKEYS.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 9e0049f59ed6..7a818034a8c9 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -295,7 +295,7 @@ type OnyxValues = { [ONYXKEYS.IS_TEST_TOOLS_MODAL_OPEN]: boolean; // [ONYXKEYS.WALLET_TRANSFER]: OnyxTypes; // [ONYXKEYS.LAST_ACCESSED_WORKSPACE_POLICY_ID]: OnyxTypes; - // [ONYXKEYS.SHOULD_SHOW_COMPOSE_INPUT]: OnyxTypes; + [ONYXKEYS.SHOULD_SHOW_COMPOSE_INPUT]: boolean; [ONYXKEYS.IS_BETA]: boolean; [ONYXKEYS.IS_TOKEN_VALID]: boolean; [ONYXKEYS.IS_CHECKING_PUBLIC_ROOM]: boolean; From d86d350dd46405a3e1940cf4ce96943c9e6ea199 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 13:46:26 +0200 Subject: [PATCH 089/649] Add type for ONYXKEYS.LAST_ACCESSED_WORKSPACE_POLICY_ID --- src/ONYXKEYS.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 7a818034a8c9..9b1c437c01d4 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -294,7 +294,7 @@ type OnyxValues = { [ONYXKEYS.IS_SHORTCUTS_MODAL_OPEN]: boolean; [ONYXKEYS.IS_TEST_TOOLS_MODAL_OPEN]: boolean; // [ONYXKEYS.WALLET_TRANSFER]: OnyxTypes; - // [ONYXKEYS.LAST_ACCESSED_WORKSPACE_POLICY_ID]: OnyxTypes; + [ONYXKEYS.LAST_ACCESSED_WORKSPACE_POLICY_ID]: string; [ONYXKEYS.SHOULD_SHOW_COMPOSE_INPUT]: boolean; [ONYXKEYS.IS_BETA]: boolean; [ONYXKEYS.IS_TOKEN_VALID]: boolean; From e7be14731e6468de56b317058dd75717746ee648 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 13:47:29 +0200 Subject: [PATCH 090/649] Add type for ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE --- src/ONYXKEYS.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 9b1c437c01d4..a2407fd7ec4c 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -286,7 +286,7 @@ type OnyxValues = { [ONYXKEYS.PERSONAL_BANK_ACCOUNT]: OnyxTypes.PersonalBankAccount; // [ONYXKEYS.REIMBURSEMENT_ACCOUNT]: OnyxTypes; // [ONYXKEYS.REIMBURSEMENT_ACCOUNT_DRAFT]: OnyxTypes; - // [ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE]: OnyxTypes; + [ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE]: string | number; // [ONYXKEYS.FREQUENTLY_USED_EMOJIS]: OnyxTypes; // [ONYXKEYS.REIMBURSEMENT_ACCOUNT_WORKSPACE_ID]: OnyxTypes; [ONYXKEYS.IS_LOADING_PAYMENT_METHODS]: boolean; From 084e6e3e77c405d20f79ccd31d8c962f48718e13 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 13:56:06 +0200 Subject: [PATCH 091/649] Add type for ONYXKEYS.FREQUENTLY_USED_EMOJIS --- src/ONYXKEYS.ts | 2 +- src/types/onyx/FrequentlyUsedEmoji.ts | 15 +++++++++++++++ src/types/onyx/index.ts | 2 ++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 src/types/onyx/FrequentlyUsedEmoji.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index a2407fd7ec4c..afa7d67d2432 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -287,7 +287,7 @@ type OnyxValues = { // [ONYXKEYS.REIMBURSEMENT_ACCOUNT]: OnyxTypes; // [ONYXKEYS.REIMBURSEMENT_ACCOUNT_DRAFT]: OnyxTypes; [ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE]: string | number; - // [ONYXKEYS.FREQUENTLY_USED_EMOJIS]: OnyxTypes; + [ONYXKEYS.FREQUENTLY_USED_EMOJIS]: OnyxTypes.FrequentlyUsedEmoji[]; // [ONYXKEYS.REIMBURSEMENT_ACCOUNT_WORKSPACE_ID]: OnyxTypes; [ONYXKEYS.IS_LOADING_PAYMENT_METHODS]: boolean; [ONYXKEYS.IS_LOADING_REPORT_DATA]: boolean; diff --git a/src/types/onyx/FrequentlyUsedEmoji.ts b/src/types/onyx/FrequentlyUsedEmoji.ts new file mode 100644 index 000000000000..ff4dd774ef0f --- /dev/null +++ b/src/types/onyx/FrequentlyUsedEmoji.ts @@ -0,0 +1,15 @@ +type FrequentlyUsedEmoji = { + /** The emoji code */ + code: string; + + /** The name of the emoji */ + name: string; + + /** The number of times the emoji has been used */ + count: number; + + /** The timestamp of when the emoji was last used */ + lastUpdatedAt: number; +}; + +export default FrequentlyUsedEmoji; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index 5d3956ddf3e4..f568fbf9a2a7 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -24,6 +24,7 @@ import BankAccount from './BankAccount'; import Card from './Card'; import WalletStatement from './WalletStatement'; import PersonalBankAccount from './PersonalBankAccount'; +import FrequentlyUsedEmoji from './FrequentlyUsedEmoji'; export type { Account, @@ -52,4 +53,5 @@ export type { Card, WalletStatement, PersonalBankAccount, + FrequentlyUsedEmoji, }; From 77a00474fa11056bac09c41e689afacfce903944 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 14:04:22 +0200 Subject: [PATCH 092/649] Add type for ONYXKEYS.REIMBURSEMENT_ACCOUNT & REIMBURSEMENT_ACCOUNT_DRAFT --- src/ONYXKEYS.ts | 6 +-- src/types/onyx/ReimbursementAccount.ts | 35 ++++++++++++++++ src/types/onyx/ReimbursementAccountDraft.ts | 45 +++++++++++++++++++++ src/types/onyx/index.ts | 4 ++ 4 files changed, 87 insertions(+), 3 deletions(-) create mode 100644 src/types/onyx/ReimbursementAccount.ts create mode 100644 src/types/onyx/ReimbursementAccountDraft.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index afa7d67d2432..39b295a44fde 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -284,11 +284,11 @@ type OnyxValues = { [ONYXKEYS.CARD_LIST]: Record; [ONYXKEYS.WALLET_STATEMENT]: OnyxTypes.WalletStatement; [ONYXKEYS.PERSONAL_BANK_ACCOUNT]: OnyxTypes.PersonalBankAccount; - // [ONYXKEYS.REIMBURSEMENT_ACCOUNT]: OnyxTypes; - // [ONYXKEYS.REIMBURSEMENT_ACCOUNT_DRAFT]: OnyxTypes; + [ONYXKEYS.REIMBURSEMENT_ACCOUNT]: OnyxTypes.ReimbursementAccount; + [ONYXKEYS.REIMBURSEMENT_ACCOUNT_DRAFT]: OnyxTypes.ReimbursementAccountDraft; [ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE]: string | number; [ONYXKEYS.FREQUENTLY_USED_EMOJIS]: OnyxTypes.FrequentlyUsedEmoji[]; - // [ONYXKEYS.REIMBURSEMENT_ACCOUNT_WORKSPACE_ID]: OnyxTypes; + [ONYXKEYS.REIMBURSEMENT_ACCOUNT_WORKSPACE_ID]: string; [ONYXKEYS.IS_LOADING_PAYMENT_METHODS]: boolean; [ONYXKEYS.IS_LOADING_REPORT_DATA]: boolean; [ONYXKEYS.IS_SHORTCUTS_MODAL_OPEN]: boolean; diff --git a/src/types/onyx/ReimbursementAccount.ts b/src/types/onyx/ReimbursementAccount.ts new file mode 100644 index 000000000000..002d6265951c --- /dev/null +++ b/src/types/onyx/ReimbursementAccount.ts @@ -0,0 +1,35 @@ +type AchData = { + /** Step of the setup flow that we are on. Determines which view is presented. */ + currentStep?: string; + + /** Bank account state */ + state?: string; + + /** Bank account ID of the VBA that we are validating is required */ + bankAccountID?: number; +}; + +type ReimbursementAccount = { + /** Whether we are loading the data via the API */ + isLoading?: boolean; + + /** A date that indicates the user has been throttled */ + throttledDate?: string; + + /** Additional data for the account in setup */ + achData?: AchData; + + /** Disable validation button if max attempts exceeded */ + maxAttemptsReached?: boolean; + + /** Alert message to display above submit button */ + error?: string; + + /** Which field needs attention? */ + errorFields?: Record; + + /** Any additional error message to show */ + errors?: Record; +}; + +export default ReimbursementAccount; diff --git a/src/types/onyx/ReimbursementAccountDraft.ts b/src/types/onyx/ReimbursementAccountDraft.ts new file mode 100644 index 000000000000..281ea497f530 --- /dev/null +++ b/src/types/onyx/ReimbursementAccountDraft.ts @@ -0,0 +1,45 @@ +type ReimbursementAccountDraft = { + bankAccountID?: number; + + /** Props needed for BankAccountStep */ + accountNumber?: string; + routingNumber?: string; + acceptTerms?: boolean; + plaidAccountID?: string; + plaidMask?: string; + + /** Props needed for CompanyStep */ + companyName?: string; + addressStreet?: string; + addressCity?: string; + addressState?: string; + addressZipCode?: string; + companyPhone?: string; + website?: string; + companyTaxID?: string; + incorporationType?: string; + incorporationDate?: string | Date; + incorporationState?: string; + hasNoConnectionToCannabis?: boolean; + + /** Props needed for RequestorStep */ + firstName?: string; + lastName?: string; + requestorAddressStreet?: string; + requestorAddressCity?: string; + requestorAddressState?: string; + requestorAddressZipCode?: string; + dob?: string | Date; + ssnLast4?: string; + isControllingOfficer?: boolean; + isOnfidoSetupComplete?: boolean; + + /** Props needed for ACHContractStep */ + ownsMoreThan25Percent?: boolean; + hasOtherBeneficialOwners?: boolean; + acceptTermsAndConditions?: boolean; + certifyTrueInformation?: boolean; + beneficialOwners?: string[]; +}; + +export default ReimbursementAccountDraft; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index f568fbf9a2a7..9441ecbc0c2d 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -25,6 +25,8 @@ import Card from './Card'; import WalletStatement from './WalletStatement'; import PersonalBankAccount from './PersonalBankAccount'; import FrequentlyUsedEmoji from './FrequentlyUsedEmoji'; +import ReimbursementAccount from './ReimbursementAccount'; +import ReimbursementAccountDraft from './ReimbursementAccountDraft'; export type { Account, @@ -54,4 +56,6 @@ export type { WalletStatement, PersonalBankAccount, FrequentlyUsedEmoji, + ReimbursementAccount, + ReimbursementAccountDraft, }; From 5d3877adcd2322ce749248a319467ca01fa2f3c0 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 14:08:49 +0200 Subject: [PATCH 093/649] Add type for ONYXKEYS.WALLET_TRANSFER --- src/ONYXKEYS.ts | 2 +- src/types/onyx/WalletTransfer.ts | 23 +++++++++++++++++++++++ src/types/onyx/index.ts | 4 +++- 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 src/types/onyx/WalletTransfer.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 39b295a44fde..708323ca4d76 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -293,7 +293,7 @@ type OnyxValues = { [ONYXKEYS.IS_LOADING_REPORT_DATA]: boolean; [ONYXKEYS.IS_SHORTCUTS_MODAL_OPEN]: boolean; [ONYXKEYS.IS_TEST_TOOLS_MODAL_OPEN]: boolean; - // [ONYXKEYS.WALLET_TRANSFER]: OnyxTypes; + [ONYXKEYS.WALLET_TRANSFER]: OnyxTypes.WalletTransfer; [ONYXKEYS.LAST_ACCESSED_WORKSPACE_POLICY_ID]: string; [ONYXKEYS.SHOULD_SHOW_COMPOSE_INPUT]: boolean; [ONYXKEYS.IS_BETA]: boolean; diff --git a/src/types/onyx/WalletTransfer.ts b/src/types/onyx/WalletTransfer.ts new file mode 100644 index 000000000000..c64b01fcdebf --- /dev/null +++ b/src/types/onyx/WalletTransfer.ts @@ -0,0 +1,23 @@ +import CONST from '../../CONST'; + +type WalletTransfer = { + /** Selected accountID for transfer */ + selectedAccountID?: string; + + /** Selected accountType for transfer */ + selectedAccountType?: string; + + /** Type to filter the payment Method list */ + filterPaymentMethodType?: typeof CONST.PAYMENT_METHODS.DEBIT_CARD | typeof CONST.PAYMENT_METHODS.BANK_ACCOUNT; + + /** Whether the success screen is shown to user. */ + shouldShowSuccess?: boolean; + + /** An error message to display to the user */ + errors?: Record; + + /** Whether or not data is loading */ + loading?: boolean; +}; + +export default WalletTransfer; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index 9441ecbc0c2d..7c4b639e2abf 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -27,6 +27,7 @@ import PersonalBankAccount from './PersonalBankAccount'; import FrequentlyUsedEmoji from './FrequentlyUsedEmoji'; import ReimbursementAccount from './ReimbursementAccount'; import ReimbursementAccountDraft from './ReimbursementAccountDraft'; +import WalletTransfer from './WalletTransfer'; export type { Account, @@ -55,7 +56,8 @@ export type { Card, WalletStatement, PersonalBankAccount, - FrequentlyUsedEmoji, ReimbursementAccount, ReimbursementAccountDraft, + FrequentlyUsedEmoji, + WalletTransfer, }; From e7b0ae54f2a6e63414a3ee83dd8258519d55c2ae Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 14:42:30 +0200 Subject: [PATCH 094/649] Add type for FORMS --- src/ONYXKEYS.ts | 21 +++++++++++++++++++++ src/types/onyx/Form.ts | 19 +++++++++++++++++++ src/types/onyx/WalletAdditionalDetails.ts | 4 +--- src/types/onyx/index.ts | 3 +++ 4 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 src/types/onyx/Form.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 708323ca4d76..f45a804a9135 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -301,6 +301,27 @@ type OnyxValues = { [ONYXKEYS.IS_CHECKING_PUBLIC_ROOM]: boolean; [ONYXKEYS.MY_DOMAIN_SECURITY_GROUPS]: Record; [ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID]: string; + + // Forms + [ONYXKEYS.FORMS.ADD_DEBIT_CARD_FORM]: OnyxTypes.AddDebitCardForm; + // [ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM]: OnyxTypes.Form; // TODO: REIMBURSEMENT_ACCOUNT_FORM has the same value as REIMBURSEMENT_ACCOUNT + [ONYXKEYS.FORMS.WORKSPACE_SETTINGS_FORM]: OnyxTypes.Form; + [ONYXKEYS.FORMS.WORKSPACE_RATE_AND_UNIT_FORM]: OnyxTypes.Form; + [ONYXKEYS.FORMS.CLOSE_ACCOUNT_FORM]: OnyxTypes.Form; + [ONYXKEYS.FORMS.PROFILE_SETTINGS_FORM]: OnyxTypes.Form; + [ONYXKEYS.FORMS.DISPLAY_NAME_FORM]: OnyxTypes.Form; + [ONYXKEYS.FORMS.ROOM_NAME_FORM]: OnyxTypes.Form; + [ONYXKEYS.FORMS.WELCOME_MESSAGE_FORM]: OnyxTypes.Form; + [ONYXKEYS.FORMS.LEGAL_NAME_FORM]: OnyxTypes.Form; + [ONYXKEYS.FORMS.WORKSPACE_INVITE_MESSAGE_FORM]: OnyxTypes.Form; + [ONYXKEYS.FORMS.DATE_OF_BIRTH_FORM]: OnyxTypes.Form; + [ONYXKEYS.FORMS.HOME_ADDRESS_FORM]: OnyxTypes.Form; + [ONYXKEYS.FORMS.NEW_ROOM_FORM]: OnyxTypes.Form; + [ONYXKEYS.FORMS.ROOM_SETTINGS_FORM]: OnyxTypes.Form; + [ONYXKEYS.FORMS.NEW_TASK_FORM]: OnyxTypes.Form; + [ONYXKEYS.FORMS.EDIT_TASK_FORM]: OnyxTypes.Form; + [ONYXKEYS.FORMS.MONEY_REQUEST_DESCRIPTION_FORM]: OnyxTypes.Form; + [ONYXKEYS.FORMS.NEW_CONTACT_METHOD_FORM]: OnyxTypes.Form; }; export default ONYXKEYS; diff --git a/src/types/onyx/Form.ts b/src/types/onyx/Form.ts new file mode 100644 index 000000000000..f7fe7d7a4f38 --- /dev/null +++ b/src/types/onyx/Form.ts @@ -0,0 +1,19 @@ +type Form = { + /** Controls the loading state of the form */ + isLoading?: boolean; + + /** Server side errors keyed by microtime */ + errors?: Record; + + /** Field-specific server side errors keyed by microtime */ + errorFields?: Record>; +}; + +type AddDebitCardForm = Form & { + /** Whether or not the form has been submitted */ + setupComplete: boolean; +}; + +export default Form; + +export type {AddDebitCardForm}; diff --git a/src/types/onyx/WalletAdditionalDetails.ts b/src/types/onyx/WalletAdditionalDetails.ts index 4b7012d23738..6c975e193b9e 100644 --- a/src/types/onyx/WalletAdditionalDetails.ts +++ b/src/types/onyx/WalletAdditionalDetails.ts @@ -15,9 +15,7 @@ type WalletAdditionalDetails = OnyxCommon.BaseState & { errorCode?: string; /** Which field needs attention? */ - errorFields?: { - [fieldName: string]: boolean; - }; + errorFields?: Record; }; export default WalletAdditionalDetails; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index 7c4b639e2abf..4caa9b84250b 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -28,6 +28,7 @@ import FrequentlyUsedEmoji from './FrequentlyUsedEmoji'; import ReimbursementAccount from './ReimbursementAccount'; import ReimbursementAccountDraft from './ReimbursementAccountDraft'; import WalletTransfer from './WalletTransfer'; +import Form, {AddDebitCardForm} from './Form'; export type { Account, @@ -60,4 +61,6 @@ export type { ReimbursementAccountDraft, FrequentlyUsedEmoji, WalletTransfer, + Form, + AddDebitCardForm, }; From 4f0ea3ee43f860bcd61555bf3c9506e6378d48b1 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 14:49:17 +0200 Subject: [PATCH 095/649] Add types for ONYXKEYS.COLLECTIONS --- src/ONYXKEYS.ts | 19 +++++++++++++++++++ .../BaseAnchorForAttachmentsOnly.js | 2 +- src/types/onyx/Download.ts | 6 ++++++ src/types/onyx/index.ts | 2 ++ 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 src/types/onyx/Download.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index f45a804a9135..d672ced1f67b 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -302,6 +302,25 @@ type OnyxValues = { [ONYXKEYS.MY_DOMAIN_SECURITY_GROUPS]: Record; [ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID]: string; + // Collections + [download: `${typeof ONYXKEYS.COLLECTION.DOWNLOAD}${string}`]: OnyxTypes.Download; + // [policy: `${typeof ONYXKEYS.COLLECTION.POLICY}${string}`]: OnyxTypes; + // [policyMembers: `${typeof ONYXKEYS.COLLECTION.POLICY_MEMBERS}${string}`]: OnyxTypes; + // [workspaceInviteMembersDraft: `${typeof ONYXKEYS.COLLECTION.WORKSPACE_INVITE_MEMBERS_DRAFT}${string}`]: OnyxTypes; + // [report: `${typeof ONYXKEYS.COLLECTION.REPORT}${string}`]: OnyxTypes; + // [ReportActions: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS}${string}`]: OnyxTypes; + // [ReportActionsDrafts: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS}${string}`]: OnyxTypes; + // [ReportActionsReactions: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS_REACTIONS}${string}`]: OnyxTypes; + // [ReportDraftComment: `${typeof ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${string}`]: OnyxTypes; + // [reportDraftCommentNumberOfLines: `${typeof ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT_NUMBER_OF_LINES}${string}`]: OnyxTypes; + // [reportIsComposerFull: `${typeof ONYXKEYS.COLLECTION.REPORT_IS_COMPOSER_FULL_SIZE}${string}`]: OnyxTypes; + // [reportUserIsTyping: `${typeof ONYXKEYS.COLLECTION.REPORT_USER_IS_TYPING}${string}`]: OnyxTypes; + // [securityGroup: `${typeof ONYXKEYS.COLLECTION.SECURITY_GROUP}${string}`]: OnyxTypes; + // [transaction: `${typeof ONYXKEYS.COLLECTION.TRANSACTION}${string}`]: OnyxTypes; + + /** This is deprecated, but needed for a migration, so we still need to include it here so that it will be initialized in Onyx.init */ + DEPRECATED_POLICY_MEMBER_LIST: 'policyMemberList_'; + // Forms [ONYXKEYS.FORMS.ADD_DEBIT_CARD_FORM]: OnyxTypes.AddDebitCardForm; // [ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM]: OnyxTypes.Form; // TODO: REIMBURSEMENT_ACCOUNT_FORM has the same value as REIMBURSEMENT_ACCOUNT diff --git a/src/components/AnchorForAttachmentsOnly/BaseAnchorForAttachmentsOnly.js b/src/components/AnchorForAttachmentsOnly/BaseAnchorForAttachmentsOnly.js index 8507713c887e..bbf6def70a33 100644 --- a/src/components/AnchorForAttachmentsOnly/BaseAnchorForAttachmentsOnly.js +++ b/src/components/AnchorForAttachmentsOnly/BaseAnchorForAttachmentsOnly.js @@ -19,8 +19,8 @@ const propTypes = { /** Press out handler for the link */ onPressOut: PropTypes.func, - /** If a file download is happening */ download: PropTypes.shape({ + /** If a file download is happening */ isDownloading: PropTypes.bool.isRequired, }), diff --git a/src/types/onyx/Download.ts b/src/types/onyx/Download.ts new file mode 100644 index 000000000000..9c6c2f61f716 --- /dev/null +++ b/src/types/onyx/Download.ts @@ -0,0 +1,6 @@ +type Download = { + /** If a file download is happening */ + isDownloading: boolean; +}; + +export default Download; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index 4caa9b84250b..ea4ea5fad740 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -28,6 +28,7 @@ import FrequentlyUsedEmoji from './FrequentlyUsedEmoji'; import ReimbursementAccount from './ReimbursementAccount'; import ReimbursementAccountDraft from './ReimbursementAccountDraft'; import WalletTransfer from './WalletTransfer'; +import Download from './Download'; import Form, {AddDebitCardForm} from './Form'; export type { @@ -63,4 +64,5 @@ export type { WalletTransfer, Form, AddDebitCardForm, + Download, }; From dec3f7af8ec96277038cb40b96ae3f37470d63ad Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 14:52:22 +0200 Subject: [PATCH 096/649] Add types for ONYXKEYS.COLLECTION.DEPRECATED_POLICY_MEMBER_LIST --- src/ONYXKEYS.ts | 4 +--- src/types/onyx/PolicyMember.ts | 5 +++++ src/types/onyx/index.ts | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 src/types/onyx/PolicyMember.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index d672ced1f67b..599c4e19cd61 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -317,9 +317,7 @@ type OnyxValues = { // [reportUserIsTyping: `${typeof ONYXKEYS.COLLECTION.REPORT_USER_IS_TYPING}${string}`]: OnyxTypes; // [securityGroup: `${typeof ONYXKEYS.COLLECTION.SECURITY_GROUP}${string}`]: OnyxTypes; // [transaction: `${typeof ONYXKEYS.COLLECTION.TRANSACTION}${string}`]: OnyxTypes; - - /** This is deprecated, but needed for a migration, so we still need to include it here so that it will be initialized in Onyx.init */ - DEPRECATED_POLICY_MEMBER_LIST: 'policyMemberList_'; + [deprecatedPolicyMemberList: `${typeof ONYXKEYS.COLLECTION.DEPRECATED_POLICY_MEMBER_LIST}${string}`]: OnyxTypes.PolicyMember; // Forms [ONYXKEYS.FORMS.ADD_DEBIT_CARD_FORM]: OnyxTypes.AddDebitCardForm; diff --git a/src/types/onyx/PolicyMember.ts b/src/types/onyx/PolicyMember.ts new file mode 100644 index 000000000000..b6eacb482bba --- /dev/null +++ b/src/types/onyx/PolicyMember.ts @@ -0,0 +1,5 @@ +type PolicyMember = { + role?: string; +}; + +export default PolicyMember; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index ea4ea5fad740..1df4a88a692d 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -29,6 +29,7 @@ import ReimbursementAccount from './ReimbursementAccount'; import ReimbursementAccountDraft from './ReimbursementAccountDraft'; import WalletTransfer from './WalletTransfer'; import Download from './Download'; +import PolicyMember from './PolicyMember'; import Form, {AddDebitCardForm} from './Form'; export type { @@ -62,7 +63,8 @@ export type { ReimbursementAccountDraft, FrequentlyUsedEmoji, WalletTransfer, + Download, + PolicyMember, Form, AddDebitCardForm, - Download, }; From 8b1dfb49231dfb4fea3c0066272a375b9c85305f Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 15:10:15 +0200 Subject: [PATCH 097/649] Move comment back to original place --- .../AnchorForAttachmentsOnly/BaseAnchorForAttachmentsOnly.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/AnchorForAttachmentsOnly/BaseAnchorForAttachmentsOnly.js b/src/components/AnchorForAttachmentsOnly/BaseAnchorForAttachmentsOnly.js index bbf6def70a33..8507713c887e 100644 --- a/src/components/AnchorForAttachmentsOnly/BaseAnchorForAttachmentsOnly.js +++ b/src/components/AnchorForAttachmentsOnly/BaseAnchorForAttachmentsOnly.js @@ -19,8 +19,8 @@ const propTypes = { /** Press out handler for the link */ onPressOut: PropTypes.func, + /** If a file download is happening */ download: PropTypes.shape({ - /** If a file download is happening */ isDownloading: PropTypes.bool.isRequired, }), From 56b79d00450b142b5daf488885d808f46d7b7aa7 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 16:17:00 +0200 Subject: [PATCH 098/649] Add types for ONYXKEYS.COLLECTION.POLICY --- src/ONYXKEYS.ts | 6 +++--- src/types/onyx/Policy.ts | 32 ++++++++++++++++++++++++++++++++ src/types/onyx/PolicyMember.ts | 10 ++++++++++ src/types/onyx/index.ts | 2 ++ 4 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 src/types/onyx/Policy.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 599c4e19cd61..08facfc10ea3 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -304,8 +304,9 @@ type OnyxValues = { // Collections [download: `${typeof ONYXKEYS.COLLECTION.DOWNLOAD}${string}`]: OnyxTypes.Download; - // [policy: `${typeof ONYXKEYS.COLLECTION.POLICY}${string}`]: OnyxTypes; - // [policyMembers: `${typeof ONYXKEYS.COLLECTION.POLICY_MEMBERS}${string}`]: OnyxTypes; + [policy: `${typeof ONYXKEYS.COLLECTION.POLICY}${string}`]: OnyxTypes.Policy; + [policyMembers: `${typeof ONYXKEYS.COLLECTION.POLICY_MEMBERS}${string}`]: OnyxTypes.PolicyMember; + [deprecatedPolicyMemberList: `${typeof ONYXKEYS.COLLECTION.DEPRECATED_POLICY_MEMBER_LIST}${string}`]: OnyxTypes.PolicyMember; // [workspaceInviteMembersDraft: `${typeof ONYXKEYS.COLLECTION.WORKSPACE_INVITE_MEMBERS_DRAFT}${string}`]: OnyxTypes; // [report: `${typeof ONYXKEYS.COLLECTION.REPORT}${string}`]: OnyxTypes; // [ReportActions: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS}${string}`]: OnyxTypes; @@ -317,7 +318,6 @@ type OnyxValues = { // [reportUserIsTyping: `${typeof ONYXKEYS.COLLECTION.REPORT_USER_IS_TYPING}${string}`]: OnyxTypes; // [securityGroup: `${typeof ONYXKEYS.COLLECTION.SECURITY_GROUP}${string}`]: OnyxTypes; // [transaction: `${typeof ONYXKEYS.COLLECTION.TRANSACTION}${string}`]: OnyxTypes; - [deprecatedPolicyMemberList: `${typeof ONYXKEYS.COLLECTION.DEPRECATED_POLICY_MEMBER_LIST}${string}`]: OnyxTypes.PolicyMember; // Forms [ONYXKEYS.FORMS.ADD_DEBIT_CARD_FORM]: OnyxTypes.AddDebitCardForm; diff --git a/src/types/onyx/Policy.ts b/src/types/onyx/Policy.ts new file mode 100644 index 000000000000..03b05daa86ab --- /dev/null +++ b/src/types/onyx/Policy.ts @@ -0,0 +1,32 @@ +import {ValueOf} from 'type-fest'; +import CONST from '../../CONST'; +import * as OnyxCommon from './OnyxCommon'; + +type Policy = { + /** The ID of the policy */ + id?: string; + + /** The name of the policy */ + name?: string; + + /** The current user's role in the policy */ + role?: ValueOf; + + /** The policy type */ + type?: ValueOf; + + /** The email of the policy owner */ + owner?: string; + + /** The output currency for the policy */ + outputCurrency?: string; + + /** The URL for the policy avatar */ + avatar?: string; + + /** Error objects keyed by field name containing errors keyed by microtime */ + errorFields?: Record>; + pendingAction?: OnyxCommon.PendingAction; +}; + +export default Policy; diff --git a/src/types/onyx/PolicyMember.ts b/src/types/onyx/PolicyMember.ts index b6eacb482bba..6f3995fda4cf 100644 --- a/src/types/onyx/PolicyMember.ts +++ b/src/types/onyx/PolicyMember.ts @@ -1,5 +1,15 @@ type PolicyMember = { + /** Role of the user in the policy */ role?: string; + + /** + * Errors from api calls on the specific user + * {: 'error message', : 'error message 2'} + */ + errors?: Record; + + /** Is this action pending? */ + pendingAction?: string; }; export default PolicyMember; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index 1df4a88a692d..44bccf23f467 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -30,6 +30,7 @@ import ReimbursementAccountDraft from './ReimbursementAccountDraft'; import WalletTransfer from './WalletTransfer'; import Download from './Download'; import PolicyMember from './PolicyMember'; +import Policy from './Policy'; import Form, {AddDebitCardForm} from './Form'; export type { @@ -65,6 +66,7 @@ export type { WalletTransfer, Download, PolicyMember, + Policy, Form, AddDebitCardForm, }; From 629165158679667905aff4b445216e9630562e8a Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 16:18:32 +0200 Subject: [PATCH 099/649] Add types for ONYXKEYS.COLLECTION.WORKSPACE_INVITE_MEMBERS_DRAFT --- src/ONYXKEYS.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 08facfc10ea3..e1291ccf4223 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -307,7 +307,7 @@ type OnyxValues = { [policy: `${typeof ONYXKEYS.COLLECTION.POLICY}${string}`]: OnyxTypes.Policy; [policyMembers: `${typeof ONYXKEYS.COLLECTION.POLICY_MEMBERS}${string}`]: OnyxTypes.PolicyMember; [deprecatedPolicyMemberList: `${typeof ONYXKEYS.COLLECTION.DEPRECATED_POLICY_MEMBER_LIST}${string}`]: OnyxTypes.PolicyMember; - // [workspaceInviteMembersDraft: `${typeof ONYXKEYS.COLLECTION.WORKSPACE_INVITE_MEMBERS_DRAFT}${string}`]: OnyxTypes; + [workspaceInviteMembersDraft: `${typeof ONYXKEYS.COLLECTION.WORKSPACE_INVITE_MEMBERS_DRAFT}${string}`]: Record; // [report: `${typeof ONYXKEYS.COLLECTION.REPORT}${string}`]: OnyxTypes; // [ReportActions: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS}${string}`]: OnyxTypes; // [ReportActionsDrafts: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS}${string}`]: OnyxTypes; From c875d5a680683c96635b880e4d3f06f1e78276e4 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 16:21:54 +0200 Subject: [PATCH 100/649] Add types for ONYXKEYS.COLLECTION.REPORT --- src/ONYXKEYS.ts | 2 +- src/types/onyx/Report.ts | 54 ++++++++++++++++++---------------------- src/types/onyx/index.ts | 2 ++ 3 files changed, 27 insertions(+), 31 deletions(-) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index e1291ccf4223..6ed54b53b1e6 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -308,7 +308,7 @@ type OnyxValues = { [policyMembers: `${typeof ONYXKEYS.COLLECTION.POLICY_MEMBERS}${string}`]: OnyxTypes.PolicyMember; [deprecatedPolicyMemberList: `${typeof ONYXKEYS.COLLECTION.DEPRECATED_POLICY_MEMBER_LIST}${string}`]: OnyxTypes.PolicyMember; [workspaceInviteMembersDraft: `${typeof ONYXKEYS.COLLECTION.WORKSPACE_INVITE_MEMBERS_DRAFT}${string}`]: Record; - // [report: `${typeof ONYXKEYS.COLLECTION.REPORT}${string}`]: OnyxTypes; + [report: `${typeof ONYXKEYS.COLLECTION.REPORT}${string}`]: OnyxTypes.Report; // [ReportActions: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS}${string}`]: OnyxTypes; // [ReportActionsDrafts: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS}${string}`]: OnyxTypes; // [ReportActionsReactions: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS_REACTIONS}${string}`]: OnyxTypes; diff --git a/src/types/onyx/Report.ts b/src/types/onyx/Report.ts index 8f484ba2271c..c800686e588f 100644 --- a/src/types/onyx/Report.ts +++ b/src/types/onyx/Report.ts @@ -1,79 +1,73 @@ +import {ValueOf} from 'type-fest'; +import CONST from '../../CONST'; import * as OnyxCommon from './OnyxCommon'; type Report = { /** The specific type of chat */ - chatType: '' | 'policyAnnounce' | 'policyAdmins' | 'domainAll' | 'policyRoom' | 'policyExpenseChat'; + chatType?: ValueOf; /** Whether there is an outstanding amount in IOU */ - hasOutstandingIOU: boolean; + hasOutstandingIOU?: boolean; /** List of icons for report participants */ - icons: OnyxCommon.Icon[]; + icons?: OnyxCommon.Icon[]; /** Are we loading more report actions? */ - isLoadingMoreReportActions: boolean; + isLoadingMoreReportActions?: boolean; /** Flag to check if the report actions data are loading */ - isLoadingReportActions: boolean; + isLoadingReportActions?: boolean; /** Whether the user is not an admin of policyExpenseChat chat */ - isOwnPolicyExpenseChat: boolean; + isOwnPolicyExpenseChat?: boolean; /** Indicates if the report is pinned to the LHN or not */ - isPinned: boolean; + isPinned?: boolean; /** The email of the last message's actor */ - lastActorEmail: string; + lastActorEmail?: string; /** The text of the last message on the report */ - lastMessageText: string; + lastMessageText?: string; /** The time of the last message on the report */ - lastVisibleActionCreated: string; + lastVisibleActionCreated?: string; /** The last time the report was visited */ - lastReadTime: string; + lastReadTime?: string; /** The current user's notification preference for this report */ - notificationPreference: string | number; + notificationPreference?: string | number; /** The policy name to use for an archived report */ - oldPolicyName: string; + oldPolicyName?: string; /** The email address of the report owner */ - ownerEmail: string; + ownerEmail?: string; /** List of primarylogins of participants of the report */ - participants: string[]; + participants?: Array; /** Linked policy's ID */ - policyID: string; + policyID?: string; /** Name of the report */ - reportName: string; + reportName?: string; /** ID of the report */ - reportID: string; + reportID?: string; /** The state that the report is currently in */ - stateNum: - | 0 // OPEN - | 1 // PROCESSING - | 2; // SUBMITTED + stateNum?: ValueOf; /** The status of the current report */ - statusNum: - | 0 // OPEN - | 1 // SUBMITTED - | 2 // CLOSED - | 3 // APPROVED - | 4; // REIMBURSED + statusNum?: ValueOf; /** Which user role is capable of posting messages on the report */ - writeCapability: 'all' | 'admins'; + writeCapability?: ValueOf; /** The report type */ - type: string; + type?: string; }; export default Report; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index 44bccf23f467..010c9923e0cc 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -31,6 +31,7 @@ import WalletTransfer from './WalletTransfer'; import Download from './Download'; import PolicyMember from './PolicyMember'; import Policy from './Policy'; +import Report from './Report'; import Form, {AddDebitCardForm} from './Form'; export type { @@ -67,6 +68,7 @@ export type { Download, PolicyMember, Policy, + Report, Form, AddDebitCardForm, }; From 0a522fa9595a6958f875d8a2d59586157b4fa225 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 16:31:26 +0200 Subject: [PATCH 101/649] Add types for ONYXKEYS.COLLECTION.REPORT_ACTIONS --- src/ONYXKEYS.ts | 2 +- src/types/onyx/ReportAction.ts | 35 ++++++++++++++++++++++++++ src/types/onyx/ReportActionFragment.ts | 32 +++++++++++++++++++++++ src/types/onyx/index.ts | 2 ++ 4 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 src/types/onyx/ReportAction.ts create mode 100644 src/types/onyx/ReportActionFragment.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 6ed54b53b1e6..967a3d0bc04e 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -309,7 +309,7 @@ type OnyxValues = { [deprecatedPolicyMemberList: `${typeof ONYXKEYS.COLLECTION.DEPRECATED_POLICY_MEMBER_LIST}${string}`]: OnyxTypes.PolicyMember; [workspaceInviteMembersDraft: `${typeof ONYXKEYS.COLLECTION.WORKSPACE_INVITE_MEMBERS_DRAFT}${string}`]: Record; [report: `${typeof ONYXKEYS.COLLECTION.REPORT}${string}`]: OnyxTypes.Report; - // [ReportActions: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS}${string}`]: OnyxTypes; + [ReportActions: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS}${string}`]: OnyxTypes.ReportAction; // [ReportActionsDrafts: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS}${string}`]: OnyxTypes; // [ReportActionsReactions: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS_REACTIONS}${string}`]: OnyxTypes; // [ReportDraftComment: `${typeof ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${string}`]: OnyxTypes; diff --git a/src/types/onyx/ReportAction.ts b/src/types/onyx/ReportAction.ts new file mode 100644 index 000000000000..e41faf7c359f --- /dev/null +++ b/src/types/onyx/ReportAction.ts @@ -0,0 +1,35 @@ +import ReportActionFragment from './ReportActionFragment'; + +type ReportAction = { + /** The ID of the reportAction. It is the string representation of the a 64-bit integer. */ + reportActionID?: string; + + /** Name of the action e.g. ADDCOMMENT */ + actionName?: string; + + /** Person who created the action */ + person?: ReportActionFragment[]; + + /** ISO-formatted datetime */ + created?: string; + + /** report action message */ + message?: ReportActionFragment[]; + + /** Original message associated with this action */ + originalMessage?: { + // The ID of the iou transaction + IOUTransactionID?: string; + }; + + /** Whether we have received a response back from the server */ + isLoading?: boolean; + + /** Error message that's come back from the server. */ + error?: string; + + /** accountIDs of the people to which the whisper was sent to (if any). Returns empty array if it is not a whisper */ + whisperedToAccountIDs: number[]; +}; + +export default ReportAction; diff --git a/src/types/onyx/ReportActionFragment.ts b/src/types/onyx/ReportActionFragment.ts new file mode 100644 index 000000000000..df3e3a66633f --- /dev/null +++ b/src/types/onyx/ReportActionFragment.ts @@ -0,0 +1,32 @@ +type ReportActionFragment = { + /** The type of the action item fragment. Used to render a corresponding component */ + type: string; + + /** The text content of the fragment. */ + text: string; + + /** Used to apply additional styling. Style refers to a predetermined constant and not a class name. e.g. 'normal' + * or 'strong' + */ + style: string; + + /** ID of a report */ + reportID: string; + + /** ID of a policy */ + policyID: string; + + /** The target of a link fragment e.g. '_blank' */ + target: string; + + /** The destination of a link fragment e.g. 'https://www.expensify.com' */ + href: string; + + /** An additional avatar url - not the main avatar url but used within a message. */ + iconUrl: string; + + /** Fragment edited flag */ + isEdited: boolean; +}; + +export default ReportActionFragment; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index 010c9923e0cc..3c13e5e671a8 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -32,6 +32,7 @@ import Download from './Download'; import PolicyMember from './PolicyMember'; import Policy from './Policy'; import Report from './Report'; +import ReportAction from './ReportAction'; import Form, {AddDebitCardForm} from './Form'; export type { @@ -69,6 +70,7 @@ export type { PolicyMember, Policy, Report, + ReportAction, Form, AddDebitCardForm, }; From f21bb7014c9b4c2b814024e48d445c63463e519f Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 16:32:56 +0200 Subject: [PATCH 102/649] Add types for ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS --- src/ONYXKEYS.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 967a3d0bc04e..4c05c243e5c0 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -310,7 +310,7 @@ type OnyxValues = { [workspaceInviteMembersDraft: `${typeof ONYXKEYS.COLLECTION.WORKSPACE_INVITE_MEMBERS_DRAFT}${string}`]: Record; [report: `${typeof ONYXKEYS.COLLECTION.REPORT}${string}`]: OnyxTypes.Report; [ReportActions: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS}${string}`]: OnyxTypes.ReportAction; - // [ReportActionsDrafts: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS}${string}`]: OnyxTypes; + [ReportActionsDrafts: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS}${string}`]: string; // [ReportActionsReactions: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS_REACTIONS}${string}`]: OnyxTypes; // [ReportDraftComment: `${typeof ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${string}`]: OnyxTypes; // [reportDraftCommentNumberOfLines: `${typeof ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT_NUMBER_OF_LINES}${string}`]: OnyxTypes; From 3dbccd964b0d150a3384da643b6089a0229fecbb Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 16:33:44 +0200 Subject: [PATCH 103/649] Remove COLLECTION.REPORT_ACTIONS_REACTIONS as it is not used --- src/ONYXKEYS.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 4c05c243e5c0..25a20dabb101 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -198,7 +198,6 @@ const ONYXKEYS = { REPORT: 'report_', REPORT_ACTIONS: 'reportActions_', REPORT_ACTIONS_DRAFTS: 'reportActionsDrafts_', - REPORT_ACTIONS_REACTIONS: 'reportActionsReactions_', REPORT_DRAFT_COMMENT: 'reportDraftComment_', REPORT_DRAFT_COMMENT_NUMBER_OF_LINES: 'reportDraftCommentNumberOfLines_', REPORT_IS_COMPOSER_FULL_SIZE: 'reportIsComposerFullSize_', @@ -311,7 +310,6 @@ type OnyxValues = { [report: `${typeof ONYXKEYS.COLLECTION.REPORT}${string}`]: OnyxTypes.Report; [ReportActions: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS}${string}`]: OnyxTypes.ReportAction; [ReportActionsDrafts: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS}${string}`]: string; - // [ReportActionsReactions: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS_REACTIONS}${string}`]: OnyxTypes; // [ReportDraftComment: `${typeof ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${string}`]: OnyxTypes; // [reportDraftCommentNumberOfLines: `${typeof ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT_NUMBER_OF_LINES}${string}`]: OnyxTypes; // [reportIsComposerFull: `${typeof ONYXKEYS.COLLECTION.REPORT_IS_COMPOSER_FULL_SIZE}${string}`]: OnyxTypes; From 422a1fc84a1cc8e03f571ef52e051c6c018b316f Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 16:35:43 +0200 Subject: [PATCH 104/649] Add types for ONYXKEYS.COLLECTION.REPORT related collections --- src/ONYXKEYS.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 25a20dabb101..936ba66b3ca1 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -310,10 +310,10 @@ type OnyxValues = { [report: `${typeof ONYXKEYS.COLLECTION.REPORT}${string}`]: OnyxTypes.Report; [ReportActions: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS}${string}`]: OnyxTypes.ReportAction; [ReportActionsDrafts: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS}${string}`]: string; - // [ReportDraftComment: `${typeof ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${string}`]: OnyxTypes; - // [reportDraftCommentNumberOfLines: `${typeof ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT_NUMBER_OF_LINES}${string}`]: OnyxTypes; - // [reportIsComposerFull: `${typeof ONYXKEYS.COLLECTION.REPORT_IS_COMPOSER_FULL_SIZE}${string}`]: OnyxTypes; - // [reportUserIsTyping: `${typeof ONYXKEYS.COLLECTION.REPORT_USER_IS_TYPING}${string}`]: OnyxTypes; + [ReportDraftComment: `${typeof ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${string}`]: string; + [reportDraftCommentNumberOfLines: `${typeof ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT_NUMBER_OF_LINES}${string}`]: number; + [reportIsComposerFull: `${typeof ONYXKEYS.COLLECTION.REPORT_IS_COMPOSER_FULL_SIZE}${string}`]: boolean; + [reportUserIsTyping: `${typeof ONYXKEYS.COLLECTION.REPORT_USER_IS_TYPING}${string}`]: boolean; // [securityGroup: `${typeof ONYXKEYS.COLLECTION.SECURITY_GROUP}${string}`]: OnyxTypes; // [transaction: `${typeof ONYXKEYS.COLLECTION.TRANSACTION}${string}`]: OnyxTypes; From 854a8f98b41060c40c5bffd2ff1c32a69e11a818 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 16:37:44 +0200 Subject: [PATCH 105/649] Add types for ONYXKEYS.COLLECTION.SECURITY_GROUP --- src/ONYXKEYS.ts | 2 +- src/types/onyx/SecurityGroup.ts | 5 +++++ src/types/onyx/index.ts | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 src/types/onyx/SecurityGroup.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 936ba66b3ca1..53672a014f9d 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -314,7 +314,7 @@ type OnyxValues = { [reportDraftCommentNumberOfLines: `${typeof ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT_NUMBER_OF_LINES}${string}`]: number; [reportIsComposerFull: `${typeof ONYXKEYS.COLLECTION.REPORT_IS_COMPOSER_FULL_SIZE}${string}`]: boolean; [reportUserIsTyping: `${typeof ONYXKEYS.COLLECTION.REPORT_USER_IS_TYPING}${string}`]: boolean; - // [securityGroup: `${typeof ONYXKEYS.COLLECTION.SECURITY_GROUP}${string}`]: OnyxTypes; + [securityGroup: `${typeof ONYXKEYS.COLLECTION.SECURITY_GROUP}${string}`]: OnyxTypes.SecurityGroup; // [transaction: `${typeof ONYXKEYS.COLLECTION.TRANSACTION}${string}`]: OnyxTypes; // Forms diff --git a/src/types/onyx/SecurityGroup.ts b/src/types/onyx/SecurityGroup.ts new file mode 100644 index 000000000000..b2362c1eb628 --- /dev/null +++ b/src/types/onyx/SecurityGroup.ts @@ -0,0 +1,5 @@ +type SecurityGroup = { + hasRestrictedPrimaryLogin: boolean; +}; + +export default SecurityGroup; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index 3c13e5e671a8..99aa17302d4c 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -33,6 +33,7 @@ import PolicyMember from './PolicyMember'; import Policy from './Policy'; import Report from './Report'; import ReportAction from './ReportAction'; +import SecurityGroup from './SecurityGroup'; import Form, {AddDebitCardForm} from './Form'; export type { @@ -71,6 +72,7 @@ export type { Policy, Report, ReportAction, + SecurityGroup, Form, AddDebitCardForm, }; From 9276a2221a44220a6aef84c0528464a8a3e40dfe Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 5 Jul 2023 16:44:14 +0200 Subject: [PATCH 106/649] Add types for ONYXKEYS.COLLECTION.TRANSACTION --- src/ONYXKEYS.ts | 2 +- src/types/onyx/Transaction.ts | 19 +++++++++++++++++++ src/types/onyx/index.ts | 2 ++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 src/types/onyx/Transaction.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 53672a014f9d..8f1327499b27 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -315,7 +315,7 @@ type OnyxValues = { [reportIsComposerFull: `${typeof ONYXKEYS.COLLECTION.REPORT_IS_COMPOSER_FULL_SIZE}${string}`]: boolean; [reportUserIsTyping: `${typeof ONYXKEYS.COLLECTION.REPORT_USER_IS_TYPING}${string}`]: boolean; [securityGroup: `${typeof ONYXKEYS.COLLECTION.SECURITY_GROUP}${string}`]: OnyxTypes.SecurityGroup; - // [transaction: `${typeof ONYXKEYS.COLLECTION.TRANSACTION}${string}`]: OnyxTypes; + [transaction: `${typeof ONYXKEYS.COLLECTION.TRANSACTION}${string}`]: OnyxTypes.Transaction; // Forms [ONYXKEYS.FORMS.ADD_DEBIT_CARD_FORM]: OnyxTypes.AddDebitCardForm; diff --git a/src/types/onyx/Transaction.ts b/src/types/onyx/Transaction.ts new file mode 100644 index 000000000000..f1bdd6a72089 --- /dev/null +++ b/src/types/onyx/Transaction.ts @@ -0,0 +1,19 @@ +import * as OnyxCommon from './OnyxCommon'; + +type Comment = { + comment?: string; +}; + +type Transaction = { + transactionID?: string; + amount?: number; + currency?: string; + reportID?: string; + comment?: Comment; + merchant?: string; + created?: string; + pendingAction?: OnyxCommon.PendingAction; + errors?: Record; +}; + +export default Transaction; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index 99aa17302d4c..1c518c47d396 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -34,6 +34,7 @@ import Policy from './Policy'; import Report from './Report'; import ReportAction from './ReportAction'; import SecurityGroup from './SecurityGroup'; +import Transaction from './Transaction'; import Form, {AddDebitCardForm} from './Form'; export type { @@ -73,6 +74,7 @@ export type { Report, ReportAction, SecurityGroup, + Transaction, Form, AddDebitCardForm, }; From 0b4146a107e96194becfc23578d817cba6e72b77 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 6 Jul 2023 16:03:12 +0200 Subject: [PATCH 107/649] Changes after initial review --- src/types/onyx/PersonalDetails.ts | 31 ++++++++++++++++++++----------- src/types/onyx/PolicyMember.ts | 4 +++- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/src/types/onyx/PersonalDetails.ts b/src/types/onyx/PersonalDetails.ts index c401c09b1eec..01df176b687f 100644 --- a/src/types/onyx/PersonalDetails.ts +++ b/src/types/onyx/PersonalDetails.ts @@ -1,34 +1,43 @@ type PersonalDetails = { - // First name of the current user from their personal details + /** ID of the current user from their personal details */ + accountID: number; + + /** First name of the current user from their personal details */ firstName?: string; - // Last name of the current user from their personal details + /** Last name of the current user from their personal details */ lastName?: string; - // Display name of the current user from their personal details + /** Display name of the current user from their personal details */ displayName?: string; - // Avatar URL of the current user from their personal details + /** Is current user validated */ + validated?: boolean; + + /** Phone number of the current user from their personal details */ + phoneNumber?: string; + + /** Avatar URL of the current user from their personal details */ avatar?: string; - // Flag to set when Avatar uploading + /** Flag to set when Avatar uploading */ avatarUploading?: boolean; - // login of the current user from their personal details + /** login of the current user from their personal details */ login?: string; - // pronouns of the current user from their personal details + /** pronouns of the current user from their personal details */ pronouns?: string; - // local currency for the user + /** local currency for the user */ localCurrencyCode?: string; - // timezone of the current user from their personal details + /** timezone of the current user from their personal details */ timezone?: { - // Value of selected timezone + /** Value of selected timezone */ selected?: string; - // Whether timezone is automatically set + /** Whether timezone is automatically set */ automatic?: boolean; }; }; diff --git a/src/types/onyx/PolicyMember.ts b/src/types/onyx/PolicyMember.ts index 6f3995fda4cf..4503ca829e18 100644 --- a/src/types/onyx/PolicyMember.ts +++ b/src/types/onyx/PolicyMember.ts @@ -1,3 +1,5 @@ +import * as OnyxCommon from './OnyxCommon'; + type PolicyMember = { /** Role of the user in the policy */ role?: string; @@ -9,7 +11,7 @@ type PolicyMember = { errors?: Record; /** Is this action pending? */ - pendingAction?: string; + pendingAction?: OnyxCommon.PendingAction; }; export default PolicyMember; From c3a7a87bd75aa3b5e854cfb77193d14a99fb9ddd Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Fri, 7 Jul 2023 16:42:06 +0200 Subject: [PATCH 108/649] Type errors better --- src/types/onyx/Form.ts | 4 +++- src/types/onyx/Login.ts | 6 ++++-- src/types/onyx/OnyxCommon.ts | 4 +++- src/types/onyx/Policy.ts | 2 +- src/types/onyx/ReimbursementAccount.ts | 4 +++- src/types/onyx/WalletAdditionalDetails.ts | 2 +- src/types/onyx/WalletTerms.ts | 2 +- 7 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/types/onyx/Form.ts b/src/types/onyx/Form.ts index f7fe7d7a4f38..da71eab9d819 100644 --- a/src/types/onyx/Form.ts +++ b/src/types/onyx/Form.ts @@ -1,3 +1,5 @@ +import * as OnyxCommon from './OnyxCommon'; + type Form = { /** Controls the loading state of the form */ isLoading?: boolean; @@ -6,7 +8,7 @@ type Form = { errors?: Record; /** Field-specific server side errors keyed by microtime */ - errorFields?: Record>; + errorFields?: OnyxCommon.FieldErrors; }; type AddDebitCardForm = Form & { diff --git a/src/types/onyx/Login.ts b/src/types/onyx/Login.ts index 80f94defc201..6283f38a9ec2 100644 --- a/src/types/onyx/Login.ts +++ b/src/types/onyx/Login.ts @@ -1,3 +1,5 @@ +import * as OnyxCommon from './OnyxCommon'; + type Login = { /** Phone/Email associated with user */ partnerUserID?: string; @@ -9,10 +11,10 @@ type Login = { validatedDate?: string; /** Field-specific server side errors keyed by microtime */ - errorFields?: Record>; + errorFields?: OnyxCommon.FieldErrors; /** Field-specific pending states for offline UI status */ - pendingFields?: Record>; + pendingFields?: OnyxCommon.FieldErrors; }; export default Login; diff --git a/src/types/onyx/OnyxCommon.ts b/src/types/onyx/OnyxCommon.ts index 260012849865..b010d652ff91 100644 --- a/src/types/onyx/OnyxCommon.ts +++ b/src/types/onyx/OnyxCommon.ts @@ -4,6 +4,8 @@ import CONST from '../../CONST'; type PendingAction = ValueOf; +type FieldErrors = Record>; + type BaseState = { success?: string; @@ -22,4 +24,4 @@ type Icon = { name: string; }; -export type {BaseState, Icon, PendingAction}; +export type {BaseState, Icon, PendingAction, FieldErrors}; diff --git a/src/types/onyx/Policy.ts b/src/types/onyx/Policy.ts index 03b05daa86ab..437925317cf3 100644 --- a/src/types/onyx/Policy.ts +++ b/src/types/onyx/Policy.ts @@ -25,7 +25,7 @@ type Policy = { avatar?: string; /** Error objects keyed by field name containing errors keyed by microtime */ - errorFields?: Record>; + errorFields?: OnyxCommon.FieldErrors; pendingAction?: OnyxCommon.PendingAction; }; diff --git a/src/types/onyx/ReimbursementAccount.ts b/src/types/onyx/ReimbursementAccount.ts index 002d6265951c..ff3ed374e213 100644 --- a/src/types/onyx/ReimbursementAccount.ts +++ b/src/types/onyx/ReimbursementAccount.ts @@ -1,3 +1,5 @@ +import * as OnyxCommon from './OnyxCommon'; + type AchData = { /** Step of the setup flow that we are on. Determines which view is presented. */ currentStep?: string; @@ -26,7 +28,7 @@ type ReimbursementAccount = { error?: string; /** Which field needs attention? */ - errorFields?: Record; + errorFields?: OnyxCommon.FieldErrors; /** Any additional error message to show */ errors?: Record; diff --git a/src/types/onyx/WalletAdditionalDetails.ts b/src/types/onyx/WalletAdditionalDetails.ts index 6c975e193b9e..512e253000ce 100644 --- a/src/types/onyx/WalletAdditionalDetails.ts +++ b/src/types/onyx/WalletAdditionalDetails.ts @@ -15,7 +15,7 @@ type WalletAdditionalDetails = OnyxCommon.BaseState & { errorCode?: string; /** Which field needs attention? */ - errorFields?: Record; + errorFields?: OnyxCommon.FieldErrors; }; export default WalletAdditionalDetails; diff --git a/src/types/onyx/WalletTerms.ts b/src/types/onyx/WalletTerms.ts index 4f020051b531..34b78a07194e 100644 --- a/src/types/onyx/WalletTerms.ts +++ b/src/types/onyx/WalletTerms.ts @@ -1,6 +1,6 @@ type WalletTerms = { /** Any error message to show */ - errors?: string[]; + errors?: Record; /** When the user accepts the Wallet's terms in order to pay an IOU, this is the ID of the chatReport the IOU is linked to */ chatReportID?: string; From 00ec1a40f04f7668ae308a46c3aa2042a5df8388 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Fri, 7 Jul 2023 16:42:20 +0200 Subject: [PATCH 109/649] Add missing types from ReportAction --- src/types/onyx/ReportAction.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/types/onyx/ReportAction.ts b/src/types/onyx/ReportAction.ts index e41faf7c359f..839337b7ff4c 100644 --- a/src/types/onyx/ReportAction.ts +++ b/src/types/onyx/ReportAction.ts @@ -30,6 +30,14 @@ type ReportAction = { /** accountIDs of the people to which the whisper was sent to (if any). Returns empty array if it is not a whisper */ whisperedToAccountIDs: number[]; + + childReportID?: number + childType?: string + childOldestFourEmails?: string + childOldestFourAccountIDs?: string + childCommenterCount?: number, + childLastVisibleActionCreated?: string + childVisibleActionCount?: number }; export default ReportAction; From 243377b97c684aca8bb6c8f05bacf37e6803f2e3 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Fri, 7 Jul 2023 16:43:19 +0200 Subject: [PATCH 110/649] Replace REIMBURSEMENT_ACCOUNT_FORM with REIMBURSEMENT_ACCOUNT --- src/ONYXKEYS.ts | 2 -- src/pages/ReimbursementAccount/ACHContractStep.js | 2 +- src/pages/ReimbursementAccount/BankAccountManualStep.js | 2 +- src/pages/ReimbursementAccount/BankAccountPlaidStep.js | 2 +- src/pages/ReimbursementAccount/CompanyStep.js | 2 +- src/pages/ReimbursementAccount/RequestorStep.js | 2 +- 6 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 8f1327499b27..5fe280f1ce78 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -212,7 +212,6 @@ const ONYXKEYS = { /** List of Form ids */ FORMS: { ADD_DEBIT_CARD_FORM: 'addDebitCardForm', - REIMBURSEMENT_ACCOUNT_FORM: 'reimbursementAccount', WORKSPACE_SETTINGS_FORM: 'workspaceSettingsForm', WORKSPACE_RATE_AND_UNIT_FORM: 'workspaceRateAndUnitForm', CLOSE_ACCOUNT_FORM: 'closeAccount', @@ -319,7 +318,6 @@ type OnyxValues = { // Forms [ONYXKEYS.FORMS.ADD_DEBIT_CARD_FORM]: OnyxTypes.AddDebitCardForm; - // [ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM]: OnyxTypes.Form; // TODO: REIMBURSEMENT_ACCOUNT_FORM has the same value as REIMBURSEMENT_ACCOUNT [ONYXKEYS.FORMS.WORKSPACE_SETTINGS_FORM]: OnyxTypes.Form; [ONYXKEYS.FORMS.WORKSPACE_RATE_AND_UNIT_FORM]: OnyxTypes.Form; [ONYXKEYS.FORMS.CLOSE_ACCOUNT_FORM]: OnyxTypes.Form; diff --git a/src/pages/ReimbursementAccount/ACHContractStep.js b/src/pages/ReimbursementAccount/ACHContractStep.js index 6083661b0d0d..1ef43843571c 100644 --- a/src/pages/ReimbursementAccount/ACHContractStep.js +++ b/src/pages/ReimbursementAccount/ACHContractStep.js @@ -154,7 +154,7 @@ function ACHContractStep(props) { guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_BANK_ACCOUNT} />
Date: Fri, 7 Jul 2023 16:51:19 +0200 Subject: [PATCH 111/649] Add missing Report types --- src/types/onyx/Report.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/types/onyx/Report.ts b/src/types/onyx/Report.ts index c800686e588f..52189b468fc2 100644 --- a/src/types/onyx/Report.ts +++ b/src/types/onyx/Report.ts @@ -68,6 +68,19 @@ type Report = { /** The report type */ type?: string; + + parentReportID?: number; + parentReportActionID?: string; + isOptimisticReport?: boolean; + hasDraft?: boolean; + managerID?: number; + lastVisibleActionLastModified?: string; + displayName?: string; + lastMessageHtml?: string; + welcomeMessage?: string; + lastActorAccountID?: string; + ownerAccountID?: number; + participantAccountIDs?: number[]; }; export default Report; From ac27dd3de8b4575c0bf84dbc4259c34f17168a3f Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Fri, 7 Jul 2023 16:57:54 +0200 Subject: [PATCH 112/649] Rename FieldErrors to ErrorFields --- src/types/onyx/Form.ts | 2 +- src/types/onyx/Login.ts | 4 ++-- src/types/onyx/OnyxCommon.ts | 5 +++-- src/types/onyx/Policy.ts | 2 +- src/types/onyx/ReimbursementAccount.ts | 2 +- src/types/onyx/WalletAdditionalDetails.ts | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/types/onyx/Form.ts b/src/types/onyx/Form.ts index da71eab9d819..2a23d489a146 100644 --- a/src/types/onyx/Form.ts +++ b/src/types/onyx/Form.ts @@ -8,7 +8,7 @@ type Form = { errors?: Record; /** Field-specific server side errors keyed by microtime */ - errorFields?: OnyxCommon.FieldErrors; + errorFields?: OnyxCommon.ErrorFields; }; type AddDebitCardForm = Form & { diff --git a/src/types/onyx/Login.ts b/src/types/onyx/Login.ts index 6283f38a9ec2..60ea5985315e 100644 --- a/src/types/onyx/Login.ts +++ b/src/types/onyx/Login.ts @@ -11,10 +11,10 @@ type Login = { validatedDate?: string; /** Field-specific server side errors keyed by microtime */ - errorFields?: OnyxCommon.FieldErrors; + errorFields?: OnyxCommon.ErrorFields; /** Field-specific pending states for offline UI status */ - pendingFields?: OnyxCommon.FieldErrors; + pendingFields?: OnyxCommon.ErrorFields; }; export default Login; diff --git a/src/types/onyx/OnyxCommon.ts b/src/types/onyx/OnyxCommon.ts index b010d652ff91..272bce7cadcf 100644 --- a/src/types/onyx/OnyxCommon.ts +++ b/src/types/onyx/OnyxCommon.ts @@ -4,13 +4,14 @@ import CONST from '../../CONST'; type PendingAction = ValueOf; -type FieldErrors = Record>; +type ErrorFields = Record>; type BaseState = { success?: string; /** An error message to display to the user */ errors?: Record; + errorFields?: ErrorFields; /** Whether or not data is loading */ isLoading?: boolean; @@ -24,4 +25,4 @@ type Icon = { name: string; }; -export type {BaseState, Icon, PendingAction, FieldErrors}; +export type {BaseState, Icon, PendingAction, ErrorFields}; diff --git a/src/types/onyx/Policy.ts b/src/types/onyx/Policy.ts index 437925317cf3..382495ae6e22 100644 --- a/src/types/onyx/Policy.ts +++ b/src/types/onyx/Policy.ts @@ -25,7 +25,7 @@ type Policy = { avatar?: string; /** Error objects keyed by field name containing errors keyed by microtime */ - errorFields?: OnyxCommon.FieldErrors; + errorFields?: OnyxCommon.ErrorFields; pendingAction?: OnyxCommon.PendingAction; }; diff --git a/src/types/onyx/ReimbursementAccount.ts b/src/types/onyx/ReimbursementAccount.ts index ff3ed374e213..08c3bd5a759f 100644 --- a/src/types/onyx/ReimbursementAccount.ts +++ b/src/types/onyx/ReimbursementAccount.ts @@ -28,7 +28,7 @@ type ReimbursementAccount = { error?: string; /** Which field needs attention? */ - errorFields?: OnyxCommon.FieldErrors; + errorFields?: OnyxCommon.ErrorFields; /** Any additional error message to show */ errors?: Record; diff --git a/src/types/onyx/WalletAdditionalDetails.ts b/src/types/onyx/WalletAdditionalDetails.ts index 512e253000ce..bd6db725cdbd 100644 --- a/src/types/onyx/WalletAdditionalDetails.ts +++ b/src/types/onyx/WalletAdditionalDetails.ts @@ -15,7 +15,7 @@ type WalletAdditionalDetails = OnyxCommon.BaseState & { errorCode?: string; /** Which field needs attention? */ - errorFields?: OnyxCommon.FieldErrors; + errorFields?: OnyxCommon.ErrorFields; }; export default WalletAdditionalDetails; From d21862929c7adb535bd8f31321b1ec1047f597f5 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Fri, 7 Jul 2023 17:01:24 +0200 Subject: [PATCH 113/649] Correct types after review --- src/types/onyx/BankAccount.ts | 17 +++++++++++++++++ src/types/onyx/Task.ts | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/types/onyx/BankAccount.ts b/src/types/onyx/BankAccount.ts index bf43b28d8438..f31720ce4469 100644 --- a/src/types/onyx/BankAccount.ts +++ b/src/types/onyx/BankAccount.ts @@ -2,14 +2,31 @@ type BankAccount = { /** The name of the institution (bank of america, etc */ addressName?: string; + /** Alias for addressName */ + title?: string; + /** The masked bank account number */ accountNumber?: string; /** The bankAccountID in the bankAccounts db */ bankAccountID?: number; + /** Alias for bankAccountID */ + methodID?: number; + /** The bank account type */ type?: string; + + isDefault?: boolean; + + /** string like 'Account ending in XXXX' */ + description?: string; + + /** string like 'bankAccount-{}' where is the bankAccountID */ + key?: string; + + /** All data related to the bank account */ + accountData?: Record; }; export default BankAccount; diff --git a/src/types/onyx/Task.ts b/src/types/onyx/Task.ts index bebc11901878..f773677515e2 100644 --- a/src/types/onyx/Task.ts +++ b/src/types/onyx/Task.ts @@ -2,7 +2,7 @@ import Report from './Report'; type Task = { /** Title of the Task */ - title?: string; + title: string; /** Description of the Task */ description?: string; From 842985e9ef98c27625fd3c7e86e068f198d460f6 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Fri, 7 Jul 2023 17:08:41 +0200 Subject: [PATCH 114/649] Type persisted requests --- src/ONYXKEYS.ts | 3 +-- src/types/onyx/Request.ts | 8 ++++++++ src/types/onyx/index.ts | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 src/types/onyx/Request.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 5fe280f1ce78..5053b984e34a 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -244,8 +244,7 @@ type OnyxValues = { [ONYXKEYS.ACTIVE_CLIENTS]: string[]; [ONYXKEYS.DEVICE_ID]: string; [ONYXKEYS.IS_SIDEBAR_LOADED]: boolean; - // TODO: Type persisted requests properly - [ONYXKEYS.PERSISTED_REQUESTS]: unknown[]; + [ONYXKEYS.PERSISTED_REQUESTS]: OnyxTypes.Request[]; [ONYXKEYS.QUEUED_ONYX_UPDATES]: OnyxTypes.QueuedOnyxUpdates; [ONYXKEYS.CURRENT_DATE]: string; [ONYXKEYS.CREDENTIALS]: OnyxTypes.Credentials; diff --git a/src/types/onyx/Request.ts b/src/types/onyx/Request.ts new file mode 100644 index 000000000000..e730dfd807fb --- /dev/null +++ b/src/types/onyx/Request.ts @@ -0,0 +1,8 @@ +type Request = { + command?: string; + data?: Record; + type?: string; + shouldUseSecure?: boolean; +}; + +export default Request; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index 1c518c47d396..9c60262f0cc4 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -1,4 +1,5 @@ import Account from './Account'; +import Request from './Request'; import Credentials from './Credentials'; import QueuedOnyxUpdates from './QueuedOnyxUpdates'; import IOU from './IOU'; @@ -39,6 +40,7 @@ import Form, {AddDebitCardForm} from './Form'; export type { Account, + Request, Credentials, QueuedOnyxUpdates, IOU, From 6321e346f4aff72d9bea205a1ecbde15a26dcbfb Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Mon, 10 Jul 2023 11:30:50 +0200 Subject: [PATCH 115/649] Fix namings and comments --- src/types/onyx/Currency.ts | 6 +++--- src/types/onyx/PersonalDetails.ts | 8 ++++---- src/types/onyx/PlaidBankAccount.ts | 2 +- src/types/onyx/ReimbursementAccount.ts | 4 ++-- src/types/onyx/ReportAction.ts | 16 ++++++++-------- src/types/utils.ts | 3 ++- 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/types/onyx/Currency.ts b/src/types/onyx/Currency.ts index 6651fe1d8383..dee964334ade 100644 --- a/src/types/onyx/Currency.ts +++ b/src/types/onyx/Currency.ts @@ -1,11 +1,11 @@ type Currency = { - // Symbol for the currency + /** Symbol for the currency */ symbol?: string; - // Name of the currency + /** Name of the currency */ name?: string; - // ISO4217 Code for the currency + /** ISO4217 Code for the currency */ ISO4217?: string; }; diff --git a/src/types/onyx/PersonalDetails.ts b/src/types/onyx/PersonalDetails.ts index 01df176b687f..f50592f2f597 100644 --- a/src/types/onyx/PersonalDetails.ts +++ b/src/types/onyx/PersonalDetails.ts @@ -23,16 +23,16 @@ type PersonalDetails = { /** Flag to set when Avatar uploading */ avatarUploading?: boolean; - /** login of the current user from their personal details */ + /** Login of the current user from their personal details */ login?: string; - /** pronouns of the current user from their personal details */ + /** Pronouns of the current user from their personal details */ pronouns?: string; - /** local currency for the user */ + /** Local currency for the user */ localCurrencyCode?: string; - /** timezone of the current user from their personal details */ + /** Timezone of the current user from their personal details */ timezone?: { /** Value of selected timezone */ selected?: string; diff --git a/src/types/onyx/PlaidBankAccount.ts b/src/types/onyx/PlaidBankAccount.ts index 7710effeb751..d89e8ac3082d 100644 --- a/src/types/onyx/PlaidBankAccount.ts +++ b/src/types/onyx/PlaidBankAccount.ts @@ -14,7 +14,7 @@ type PlaidBankAccount = { /** Routing number for the account */ routingNumber: string; - /** last 4 digits of the account number */ + /** Last 4 digits of the account number */ mask: string; /** Plaid access token, used to then retrieve Assets and Balances */ diff --git a/src/types/onyx/ReimbursementAccount.ts b/src/types/onyx/ReimbursementAccount.ts index 08c3bd5a759f..804a30013334 100644 --- a/src/types/onyx/ReimbursementAccount.ts +++ b/src/types/onyx/ReimbursementAccount.ts @@ -1,6 +1,6 @@ import * as OnyxCommon from './OnyxCommon'; -type AchData = { +type ACHData = { /** Step of the setup flow that we are on. Determines which view is presented. */ currentStep?: string; @@ -19,7 +19,7 @@ type ReimbursementAccount = { throttledDate?: string; /** Additional data for the account in setup */ - achData?: AchData; + achData?: ACHData; /** Disable validation button if max attempts exceeded */ maxAttemptsReached?: boolean; diff --git a/src/types/onyx/ReportAction.ts b/src/types/onyx/ReportAction.ts index 839337b7ff4c..2c4e41c8e3a7 100644 --- a/src/types/onyx/ReportAction.ts +++ b/src/types/onyx/ReportAction.ts @@ -18,7 +18,7 @@ type ReportAction = { /** Original message associated with this action */ originalMessage?: { - // The ID of the iou transaction + /** The ID of the iou transaction */ IOUTransactionID?: string; }; @@ -31,13 +31,13 @@ type ReportAction = { /** accountIDs of the people to which the whisper was sent to (if any). Returns empty array if it is not a whisper */ whisperedToAccountIDs: number[]; - childReportID?: number - childType?: string - childOldestFourEmails?: string - childOldestFourAccountIDs?: string - childCommenterCount?: number, - childLastVisibleActionCreated?: string - childVisibleActionCount?: number + childReportID?: number; + childType?: string; + childOldestFourEmails?: string; + childOldestFourAccountIDs?: string; + childCommenterCount?: number; + childLastVisibleActionCreated?: string; + childVisibleActionCount?: number; }; export default ReportAction; diff --git a/src/types/utils.ts b/src/types/utils.ts index 98a658eed56f..d7b427d70fab 100644 --- a/src/types/utils.ts +++ b/src/types/utils.ts @@ -1,4 +1,5 @@ +/* eslint-disable @typescript-eslint/ban-types */ +/* eslint-disable import/prefer-default-export */ type DeepValueOf = T extends object ? DeepValueOf : T; -// eslint-disable-next-line import/prefer-default-export export type {DeepValueOf}; From b5646714f63abe91073567cb68beadc92d237c81 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 12 Jul 2023 14:19:56 +0200 Subject: [PATCH 116/649] Add changes to UserWallet --- src/types/onyx/UserWallet.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/types/onyx/UserWallet.ts b/src/types/onyx/UserWallet.ts index 652e05663a9e..39555c9e9348 100644 --- a/src/types/onyx/UserWallet.ts +++ b/src/types/onyx/UserWallet.ts @@ -20,6 +20,9 @@ type UserWallet = { /** Status of wallet - e.g. SILVER or GOLD */ tierName?: ValueOf; + /** The user's wallet tier */ + tier?: number; + /** Whether we should show the ActivateStep success view after the user finished the KYC flow */ shouldShowWalletActivationSuccess?: boolean; @@ -28,6 +31,18 @@ type UserWallet = { /** The type of the linked account (debitCard or bankAccount) */ walletLinkedAccountType?: string; + + /** An error message to display to the user */ + errors?: Record; + + /** The user's bank account ID */ + bankAccountID?: number; + + /** The user's current wallet limit */ + walletLimit?: number; + + /** The user's current wallet limit enforcement period */ + walletLimitEnforcementPeriod?: number; }; export default UserWallet; From 96b72c905d60952f876dd05dff78846396fd13d4 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 12 Jul 2023 14:20:23 +0200 Subject: [PATCH 117/649] Fix type utils structure --- src/ONYXKEYS.ts | 4 ++-- src/types/utils.ts | 5 ----- src/types/utils/DeepValueOf.ts | 4 ++++ 3 files changed, 6 insertions(+), 7 deletions(-) delete mode 100644 src/types/utils.ts create mode 100644 src/types/utils/DeepValueOf.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 5053b984e34a..ffceff36d465 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -1,5 +1,5 @@ import {ValueOf} from 'type-fest'; -import * as UtilTypes from './types/utils'; +import DeepValueOf from './types/utils/DeepValueOf'; import * as OnyxTypes from './types/onyx'; import CONST from './CONST'; @@ -235,7 +235,7 @@ const ONYXKEYS = { type OnyxKeysMap = typeof ONYXKEYS; type CollectionKey = `${ValueOf}${string}`; -type OnyxKey = UtilTypes.DeepValueOf> | CollectionKey; +type OnyxKey = DeepValueOf> | CollectionKey; type OnyxValues = { [ONYXKEYS.ACCOUNT]: OnyxTypes.Account; diff --git a/src/types/utils.ts b/src/types/utils.ts deleted file mode 100644 index d7b427d70fab..000000000000 --- a/src/types/utils.ts +++ /dev/null @@ -1,5 +0,0 @@ -/* eslint-disable @typescript-eslint/ban-types */ -/* eslint-disable import/prefer-default-export */ -type DeepValueOf = T extends object ? DeepValueOf : T; - -export type {DeepValueOf}; diff --git a/src/types/utils/DeepValueOf.ts b/src/types/utils/DeepValueOf.ts new file mode 100644 index 000000000000..eb44eac7e751 --- /dev/null +++ b/src/types/utils/DeepValueOf.ts @@ -0,0 +1,4 @@ +// eslint-disable-next-line @typescript-eslint/ban-types +type DeepValueOf = T extends object ? DeepValueOf : T; + +export default DeepValueOf; From 88b548d68509bb753f848a1d4da8ed5212865ffb Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 12 Jul 2023 14:26:19 +0200 Subject: [PATCH 118/649] Add more changes to UserWallet --- src/types/onyx/UserWallet.ts | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/types/onyx/UserWallet.ts b/src/types/onyx/UserWallet.ts index 39555c9e9348..151eefd15be2 100644 --- a/src/types/onyx/UserWallet.ts +++ b/src/types/onyx/UserWallet.ts @@ -1,24 +1,25 @@ import {ValueOf} from 'type-fest'; import CONST from '../../CONST'; +type WalletLinkedAccountType = 'debitCard' | 'bankAccount'; + +type ErrorCode = 'ssnError' | 'kbaNeeded' | 'kycFailed'; + type UserWallet = { /** The user's available wallet balance */ - availableBalance?: number; + availableBalance: number; /** The user's current wallet balance */ - currentBalance?: number; + currentBalance: number; /** What step in the activation flow are we on? */ - currentStep?: ValueOf; - - /** Error code returned by the server */ - errorCode?: string; + currentStep: ValueOf; /** If we should show the FailedKYC view after the user submitted their info with a non fixable error */ shouldShowFailedKYC?: boolean; /** Status of wallet - e.g. SILVER or GOLD */ - tierName?: ValueOf; + tierName: ValueOf; /** The user's wallet tier */ tier?: number; @@ -27,13 +28,10 @@ type UserWallet = { shouldShowWalletActivationSuccess?: boolean; /** The ID of the linked account */ - walletLinkedAccountID?: number; + walletLinkedAccountID: number; /** The type of the linked account (debitCard or bankAccount) */ - walletLinkedAccountType?: string; - - /** An error message to display to the user */ - errors?: Record; + walletLinkedAccountType: WalletLinkedAccountType; /** The user's bank account ID */ bankAccountID?: number; @@ -43,6 +41,12 @@ type UserWallet = { /** The user's current wallet limit enforcement period */ walletLimitEnforcementPeriod?: number; + + /** Error code returned by the server */ + errorCode?: ErrorCode; + + /** An error message to display to the user */ + errors?: Record; }; export default UserWallet; From 178b6977a7d2177bf7b7c2d78e2ed5b0c9f9cf90 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 12 Jul 2023 14:28:02 +0200 Subject: [PATCH 119/649] Add accountId to Credentials --- src/types/onyx/Credentials.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/types/onyx/Credentials.ts b/src/types/onyx/Credentials.ts index 1f6beb502907..f6a9ce669ad0 100644 --- a/src/types/onyx/Credentials.ts +++ b/src/types/onyx/Credentials.ts @@ -9,6 +9,7 @@ type Credentials = { autoGeneratedLogin?: string; autoGeneratedPassword?: string; + accountID?: number; }; export default Credentials; From c258aaf79ec7a3691cc22f1be2fa94b7d26a1f91 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 12 Jul 2023 15:40:47 +0200 Subject: [PATCH 120/649] Update Account type --- src/types/onyx/Account.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/types/onyx/Account.ts b/src/types/onyx/Account.ts index 63d294ec71d8..24986fc7a2fe 100644 --- a/src/types/onyx/Account.ts +++ b/src/types/onyx/Account.ts @@ -32,6 +32,15 @@ type Account = OnyxCommon.BaseState & { /** Whether the user forgot their password */ forgotPassword?: boolean; + + /** Whether the account exists */ + accountExists?: boolean; + + /** Is the account / domain under domain control? */ + domainControlled?: boolean; + + /** Whether the validation code has expired */ + validateCodeExpired?: boolean; }; export default Account; From e2d2edb1b85d6594330dfbd65cb7e62ea1860058 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 12 Jul 2023 16:24:04 +0200 Subject: [PATCH 121/649] Update ACHData type --- src/types/onyx/ReimbursementAccount.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/types/onyx/ReimbursementAccount.ts b/src/types/onyx/ReimbursementAccount.ts index 804a30013334..7a65045338c5 100644 --- a/src/types/onyx/ReimbursementAccount.ts +++ b/src/types/onyx/ReimbursementAccount.ts @@ -1,8 +1,10 @@ +import {ValueOf} from 'type-fest'; import * as OnyxCommon from './OnyxCommon'; +import CONST from '../../CONST'; type ACHData = { /** Step of the setup flow that we are on. Determines which view is presented. */ - currentStep?: string; + currentStep?: ValueOf; /** Bank account state */ state?: string; From 4568e0e8fe35aede8588cfae976a8458c8506872 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 12 Jul 2023 16:34:05 +0200 Subject: [PATCH 122/649] Update Currency type --- src/types/onyx/Currency.ts | 9 ++++++--- src/types/onyx/Task.ts | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/types/onyx/Currency.ts b/src/types/onyx/Currency.ts index dee964334ade..770fcc33a9a9 100644 --- a/src/types/onyx/Currency.ts +++ b/src/types/onyx/Currency.ts @@ -1,12 +1,15 @@ type Currency = { /** Symbol for the currency */ - symbol?: string; + symbol: string; /** Name of the currency */ - name?: string; + name: string; /** ISO4217 Code for the currency */ - ISO4217?: string; + ISO4217: string; + + /** Number of decimals the currency can have, if this is missing, we assume it has 2 decimals */ + decimals?: number; }; export default Currency; diff --git a/src/types/onyx/Task.ts b/src/types/onyx/Task.ts index f773677515e2..34f5643d2f6f 100644 --- a/src/types/onyx/Task.ts +++ b/src/types/onyx/Task.ts @@ -7,6 +7,7 @@ type Task = { /** Description of the Task */ description?: string; + // TODO: Make sure this field exists in the API /** Share destination of the Task */ shareDestination?: string; From 38b628064e3ee6b873aacb86246c30153e081294 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 12 Jul 2023 16:35:43 +0200 Subject: [PATCH 123/649] Update User type --- src/types/onyx/User.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/types/onyx/User.ts b/src/types/onyx/User.ts index cb5cd1d8c29a..f770b22b2272 100644 --- a/src/types/onyx/User.ts +++ b/src/types/onyx/User.ts @@ -1,18 +1,18 @@ type User = { /** Whether or not the user is subscribed to news updates */ - isSubscribedToNewsletter?: boolean; + isSubscribedToNewsletter: boolean; /** Whether we should use the staging version of the secure API server */ shouldUseStagingServer?: boolean; /** Is the user account validated? */ - validated?: boolean; + validated: boolean; /** Whether or not the user is on a public domain email account or not */ - isFromPublicDomain?: boolean; + isFromPublicDomain: boolean; /** Whether or not the user use expensify card */ - isUsingExpensifyCard?: boolean; + isUsingExpensifyCard: boolean; /** Whever Expensify Card approval flow is ongoing - checking loginList for private domains */ isCheckingDomain?: boolean; From e511910216147568337a922ebb110a1f9243e2fb Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 13 Jul 2023 09:45:21 +0200 Subject: [PATCH 124/649] Add new onyx keys: PREFERRED_THEME and IS_USING_MEMORY_ONLY_KEYS --- src/ONYXKEYS.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index ffceff36d465..d4a7b696e582 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -189,6 +189,13 @@ const ONYXKEYS = { /** Report ID of the last report the user viewed as anonymous user */ LAST_OPENED_PUBLIC_ROOM_ID: 'lastOpenedPublicRoomID', + // The theme setting set by the user in preferences. + // This can be either "light", "dark" or "system" + PREFERRED_THEME: 'preferredTheme', + + // Experimental memory only Onyx mode flag + IS_USING_MEMORY_ONLY_KEYS: 'isUsingMemoryOnlyKeys', + /** Collection Keys */ COLLECTION: { DOWNLOAD: 'download_', @@ -298,6 +305,8 @@ type OnyxValues = { [ONYXKEYS.IS_CHECKING_PUBLIC_ROOM]: boolean; [ONYXKEYS.MY_DOMAIN_SECURITY_GROUPS]: Record; [ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID]: string; + [ONYXKEYS.PREFERRED_THEME]: ValueOf; + [ONYXKEYS.IS_USING_MEMORY_ONLY_KEYS]: boolean; // Collections [download: `${typeof ONYXKEYS.COLLECTION.DOWNLOAD}${string}`]: OnyxTypes.Download; From e97b29c7965eb1703f3a2ebb658486b4add8bb26 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 13 Jul 2023 09:54:08 +0200 Subject: [PATCH 125/649] Change OnfidoWallet to WalletOnfido --- src/ONYXKEYS.ts | 2 +- src/types/onyx/Session.ts | 2 ++ src/types/onyx/{OnfidoWallet.ts => WalletOnfido.ts} | 4 ++-- src/types/onyx/index.ts | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) rename src/types/onyx/{OnfidoWallet.ts => WalletOnfido.ts} (93%) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index d4a7b696e582..3c22b67799cd 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -281,7 +281,7 @@ type OnyxValues = { [ONYXKEYS.ONFIDO_TOKEN]: string; [ONYXKEYS.NVP_PREFERRED_LOCALE]: ValueOf; [ONYXKEYS.USER_WALLET]: OnyxTypes.UserWallet; - [ONYXKEYS.WALLET_ONFIDO]: OnyxTypes.OnfidoWallet; + [ONYXKEYS.WALLET_ONFIDO]: OnyxTypes.WalletOnfido; [ONYXKEYS.WALLET_ADDITIONAL_DETAILS]: OnyxTypes.WalletAdditionalDetails; [ONYXKEYS.WALLET_TERMS]: OnyxTypes.WalletTerms; [ONYXKEYS.BANK_ACCOUNT_LIST]: Record; diff --git a/src/types/onyx/Session.ts b/src/types/onyx/Session.ts index 2e8296271687..75cb4f4818ad 100644 --- a/src/types/onyx/Session.ts +++ b/src/types/onyx/Session.ts @@ -10,6 +10,8 @@ type Session = { /** Currently logged in user accountID */ accountID?: number; + + autoAuthState?: string; }; export default Session; diff --git a/src/types/onyx/OnfidoWallet.ts b/src/types/onyx/WalletOnfido.ts similarity index 93% rename from src/types/onyx/OnfidoWallet.ts rename to src/types/onyx/WalletOnfido.ts index e9cfedee7120..78f60e233aa7 100644 --- a/src/types/onyx/OnfidoWallet.ts +++ b/src/types/onyx/WalletOnfido.ts @@ -1,4 +1,4 @@ -type OnfidoWallet = { +type WalletOnfido = { /** Unique identifier returned from openOnfidoFlow then re-sent to ActivateWallet with Onfido response data */ applicantID?: string; @@ -18,4 +18,4 @@ type OnfidoWallet = { hasAcceptedPrivacyPolicy?: boolean; }; -export default OnfidoWallet; +export default WalletOnfido; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index 9c60262f0cc4..ddcc728fb437 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -18,7 +18,7 @@ import Paypal from './Paypal'; import BlockedFromConcierge from './BlockedFromConcierge'; import PlaidData from './PlaidData'; import UserWallet from './UserWallet'; -import OnfidoWallet from './OnfidoWallet'; +import WalletOnfido from './WalletOnfido'; import WalletAdditionalDetails from './WalletAdditionalDetails'; import WalletTerms from './WalletTerms'; import BankAccount from './BankAccount'; @@ -59,7 +59,7 @@ export type { BlockedFromConcierge, PlaidData, UserWallet, - OnfidoWallet, + WalletOnfido, WalletAdditionalDetails, WalletTerms, BankAccount, From 3ad2a94fdc91fe9571e1ccfe60cdffd51b7285d8 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 13 Jul 2023 09:56:26 +0200 Subject: [PATCH 126/649] Adjust WalletOnfido --- src/types/onyx/WalletOnfido.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/types/onyx/WalletOnfido.ts b/src/types/onyx/WalletOnfido.ts index 78f60e233aa7..827be5b99c21 100644 --- a/src/types/onyx/WalletOnfido.ts +++ b/src/types/onyx/WalletOnfido.ts @@ -1,21 +1,24 @@ type WalletOnfido = { /** Unique identifier returned from openOnfidoFlow then re-sent to ActivateWallet with Onfido response data */ - applicantID?: string; + applicantID: string; /** Token used to initialize the Onfido SDK token */ - sdkToken?: string; + sdkToken: string; /** Loading state to provide feedback when we are waiting for a request to finish */ - loading?: boolean; + isLoading?: boolean; /** Error message to inform the user of any problem that might occur */ - error?: string; + errors?: Record; /** A list of Onfido errors that the user can fix in order to attempt the Onfido flow again */ fixableErrors?: string[]; /** Whether the user has accepted the privacy policy of Onfido or not */ hasAcceptedPrivacyPolicy?: boolean; + + /** If we should show the FailedKYC view after the user submitted their info with a non fixable error */ + shouldShowFailedKYC?: boolean; }; export default WalletOnfido; From af9ec420d508e9523247aba10681da9fa4b27ea0 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 13 Jul 2023 10:03:07 +0200 Subject: [PATCH 127/649] Adjust PersonalDetails --- src/types/onyx/PersonalDetails.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/onyx/PersonalDetails.ts b/src/types/onyx/PersonalDetails.ts index f50592f2f597..64911dbfecb1 100644 --- a/src/types/onyx/PersonalDetails.ts +++ b/src/types/onyx/PersonalDetails.ts @@ -9,7 +9,7 @@ type PersonalDetails = { lastName?: string; /** Display name of the current user from their personal details */ - displayName?: string; + displayName: string; /** Is current user validated */ validated?: boolean; @@ -18,7 +18,7 @@ type PersonalDetails = { phoneNumber?: string; /** Avatar URL of the current user from their personal details */ - avatar?: string; + avatar: string; /** Flag to set when Avatar uploading */ avatarUploading?: boolean; From 9854cdfe3ab440da25a4329db08d64b4bb7cd25a Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 13 Jul 2023 10:03:14 +0200 Subject: [PATCH 128/649] Adjust IOU --- src/types/onyx/IOU.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/types/onyx/IOU.ts b/src/types/onyx/IOU.ts index 031c5791440c..373b5d990160 100644 --- a/src/types/onyx/IOU.ts +++ b/src/types/onyx/IOU.ts @@ -1,13 +1,14 @@ type Participant = { - accountID?: number; + accountID: number; login?: string; isPolicyExpenseChat?: boolean; isOwnPolicyExpenseChat?: boolean; selected?: boolean; + reportID?: string; }; type IOU = { - id?: string; + id: string; amount?: number; /** Selected Currency Code of the current IOU */ currency?: string; From ce377f99b5bf76c3b7e9d8a3835e7a45455c3373 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Mon, 17 Jul 2023 12:27:45 +0200 Subject: [PATCH 129/649] Adjust BlockedFromConcierge --- src/types/onyx/BlockedFromConcierge.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/types/onyx/BlockedFromConcierge.ts b/src/types/onyx/BlockedFromConcierge.ts index faa0681b79cf..0e8ac3699584 100644 --- a/src/types/onyx/BlockedFromConcierge.ts +++ b/src/types/onyx/BlockedFromConcierge.ts @@ -1,6 +1,8 @@ type BlockedFromConcierge = { /** The date that the user will be unblocked */ - expiresAt?: string; + expiresAt: string; + + count: 1 | 2 | 3; }; export default BlockedFromConcierge; From 3197d7b43271f13d608b6d3fc3219fa85e420819 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Mon, 17 Jul 2023 12:53:51 +0200 Subject: [PATCH 130/649] Adjust FrequentlyUsedEmoji --- src/types/onyx/FrequentlyUsedEmoji.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/types/onyx/FrequentlyUsedEmoji.ts b/src/types/onyx/FrequentlyUsedEmoji.ts index ff4dd774ef0f..2276095df9b5 100644 --- a/src/types/onyx/FrequentlyUsedEmoji.ts +++ b/src/types/onyx/FrequentlyUsedEmoji.ts @@ -8,8 +8,11 @@ type FrequentlyUsedEmoji = { /** The number of times the emoji has been used */ count: number; - /** The timestamp of when the emoji was last used */ + /** The timestamp in UNIX format when the emoji was last used */ lastUpdatedAt: number; + + /** The emoji skin tone type */ + types?: string[]; }; export default FrequentlyUsedEmoji; From bd127d37bfd8c63319e9d4fc9974d524850d46d7 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Mon, 17 Jul 2023 13:01:59 +0200 Subject: [PATCH 131/649] Adjust Paypal --- src/types/onyx/Paypal.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/types/onyx/Paypal.ts b/src/types/onyx/Paypal.ts index 61130723ddb1..26236a63b7fc 100644 --- a/src/types/onyx/Paypal.ts +++ b/src/types/onyx/Paypal.ts @@ -2,26 +2,26 @@ import CONST from '../../CONST'; import * as OnyxCommon from './OnyxCommon'; type PaypalAccountData = { - username?: string; + username: string; }; type Paypal = { /** This is always 'PayPal.me' */ - title?: string; + title: string; /** The paypalMe address */ - description?: string; + description: string; /** This is always 'payPalMe' */ - methodID?: typeof CONST.PAYMENT_METHODS.PAYPAL; + methodID: typeof CONST.PAYMENT_METHODS.PAYPAL; /** This is always 'payPalMe' */ - accountType?: typeof CONST.PAYMENT_METHODS.PAYPAL; + accountType: typeof CONST.PAYMENT_METHODS.PAYPAL; - key?: string; - isDefault?: boolean; + key: string; + isDefault: boolean; pendingAction?: OnyxCommon.PendingAction; - accountData?: PaypalAccountData; + accountData: PaypalAccountData; }; export default Paypal; From 436e009c68169f729bec64541a3b93058a6fa86b Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Mon, 17 Jul 2023 16:38:18 +0200 Subject: [PATCH 132/649] Fix a typo --- src/types/onyx/WalletAdditionalDetails.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/onyx/WalletAdditionalDetails.ts b/src/types/onyx/WalletAdditionalDetails.ts index bd6db725cdbd..8176475f622b 100644 --- a/src/types/onyx/WalletAdditionalDetails.ts +++ b/src/types/onyx/WalletAdditionalDetails.ts @@ -1,7 +1,7 @@ import * as OnyxCommon from './OnyxCommon'; type WalletAdditionalDetails = OnyxCommon.BaseState & { - /** Questions returned by Ideology */ + /** Questions returned by Idology */ questions?: { prompt: string; type: string; From 6da3ffb38b5547f00f6a13d2583ca8baa3baf4ff Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Tue, 18 Jul 2023 13:12:16 +0200 Subject: [PATCH 133/649] Adjust BankAccount --- src/types/onyx/BankAccount.ts | 58 +++++++++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 9 deletions(-) diff --git a/src/types/onyx/BankAccount.ts b/src/types/onyx/BankAccount.ts index f31720ce4469..ccaaa7ebab78 100644 --- a/src/types/onyx/BankAccount.ts +++ b/src/types/onyx/BankAccount.ts @@ -1,32 +1,72 @@ -type BankAccount = { +type AdditionalData = { + isP2PDebitCard?: boolean; + beneficialOwners?: string[]; + currency?: string; + bankName?: string; + fieldsType?: string; + country?: string; +}; + +type AccountData = { + /** The masked bank account number */ + accountNumber?: string; + /** The name of the institution (bank of america, etc */ addressName?: string; - /** Alias for addressName */ - title?: string; + /** Can we use this account to pay other people? */ + allowDebit?: boolean; - /** The masked bank account number */ - accountNumber?: string; + /** Can we use this account to receive money from other people? */ + defaultCredit?: boolean; + + /** Is a saving account */ + isSavings?: boolean; + + /** Return whether or not this bank account has been risk checked */ + riskChecked?: boolean; + + /** Account routing number */ + routingNumber?: string; + + /** The status of the bank account */ + state?: string; + + /** All user emails that have access to this bank account */ + sharees?: string[]; + + processor?: string; /** The bankAccountID in the bankAccounts db */ bankAccountID?: number; - /** Alias for bankAccountID */ - methodID?: number; + /** All data related to the bank account */ + additionalData?: AdditionalData; /** The bank account type */ type?: string; +}; - isDefault?: boolean; +type BankAccount = { + /** The bank account type */ + accountType?: string; /** string like 'Account ending in XXXX' */ description?: string; + isDefault?: boolean; + /** string like 'bankAccount-{}' where is the bankAccountID */ key?: string; + /** Alias for bankAccountID */ + methodID?: number; + + /** Alias for addressName */ + title?: string; + /** All data related to the bank account */ - accountData?: Record; + accountData?: AccountData; }; export default BankAccount; From c5e745eb36228021876c98565ce26765bcdc8cac Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Tue, 18 Jul 2023 13:55:01 +0200 Subject: [PATCH 134/649] Adjust ReportAction --- src/types/onyx/ReportAction.ts | 65 +++++++++++++++++++++++--- src/types/onyx/ReportActionFragment.ts | 32 ------------- 2 files changed, 58 insertions(+), 39 deletions(-) delete mode 100644 src/types/onyx/ReportActionFragment.ts diff --git a/src/types/onyx/ReportAction.ts b/src/types/onyx/ReportAction.ts index 2c4e41c8e3a7..fc0b663dc1ce 100644 --- a/src/types/onyx/ReportAction.ts +++ b/src/types/onyx/ReportAction.ts @@ -1,26 +1,74 @@ -import ReportActionFragment from './ReportActionFragment'; +type Message = { + /** The type of the action item fragment. Used to render a corresponding component */ + type: string; + + /** The text content of the fragment. */ + text: string; + + /** Used to apply additional styling. Style refers to a predetermined constant and not a class name. e.g. 'normal' + * or 'strong' + */ + style: string; + + /** ID of a report */ + reportID: string; + + /** ID of a policy */ + policyID: string; + + /** The target of a link fragment e.g. '_blank' */ + target: string; + + /** The destination of a link fragment e.g. 'https://www.expensify.com' */ + href: string; + + /** An additional avatar url - not the main avatar url but used within a message. */ + iconUrl: string; + + /** Fragment edited flag */ + isEdited: boolean; +}; + +type OriginalMessage = { + /** The ID of the iou transaction */ + IOUTransactionID?: string; + + IOUReportID?: number; + amount?: number; + comment?: string; + currency?: string; + lastModified?: string; + participantAccountIDs?: number[]; + participants?: string[]; + type?: string; +}; + +type Person = { + type?: string; + style?: string; + text?: string; +}; type ReportAction = { /** The ID of the reportAction. It is the string representation of the a 64-bit integer. */ reportActionID?: string; + actorAccountID?: number; + /** Name of the action e.g. ADDCOMMENT */ actionName?: string; /** Person who created the action */ - person?: ReportActionFragment[]; + person?: Person[]; /** ISO-formatted datetime */ created?: string; /** report action message */ - message?: ReportActionFragment[]; + message?: Message[]; /** Original message associated with this action */ - originalMessage?: { - /** The ID of the iou transaction */ - IOUTransactionID?: string; - }; + originalMessage?: OriginalMessage; /** Whether we have received a response back from the server */ isLoading?: boolean; @@ -31,6 +79,9 @@ type ReportAction = { /** accountIDs of the people to which the whisper was sent to (if any). Returns empty array if it is not a whisper */ whisperedToAccountIDs: number[]; + avatar?: string; + automatic?: boolean; + shouldShow?: boolean; childReportID?: number; childType?: string; childOldestFourEmails?: string; diff --git a/src/types/onyx/ReportActionFragment.ts b/src/types/onyx/ReportActionFragment.ts deleted file mode 100644 index df3e3a66633f..000000000000 --- a/src/types/onyx/ReportActionFragment.ts +++ /dev/null @@ -1,32 +0,0 @@ -type ReportActionFragment = { - /** The type of the action item fragment. Used to render a corresponding component */ - type: string; - - /** The text content of the fragment. */ - text: string; - - /** Used to apply additional styling. Style refers to a predetermined constant and not a class name. e.g. 'normal' - * or 'strong' - */ - style: string; - - /** ID of a report */ - reportID: string; - - /** ID of a policy */ - policyID: string; - - /** The target of a link fragment e.g. '_blank' */ - target: string; - - /** The destination of a link fragment e.g. 'https://www.expensify.com' */ - href: string; - - /** An additional avatar url - not the main avatar url but used within a message. */ - iconUrl: string; - - /** Fragment edited flag */ - isEdited: boolean; -}; - -export default ReportActionFragment; From 43e281296ea78daaea7d550a27491b4d58e57ff0 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Tue, 18 Jul 2023 13:56:24 +0200 Subject: [PATCH 135/649] Adjust Transaction --- src/types/onyx/Transaction.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/types/onyx/Transaction.ts b/src/types/onyx/Transaction.ts index f1bdd6a72089..916570b185ff 100644 --- a/src/types/onyx/Transaction.ts +++ b/src/types/onyx/Transaction.ts @@ -14,6 +14,9 @@ type Transaction = { created?: string; pendingAction?: OnyxCommon.PendingAction; errors?: Record; + modifiedAmount?: number; + modifiedCreated?: string; + modifiedCurrency?: string; }; export default Transaction; From 9e1743023c4b81198ff2a8da4d250202815cfb11 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Tue, 18 Jul 2023 14:45:02 +0200 Subject: [PATCH 136/649] Adjust Card --- src/types/onyx/Card.ts | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/src/types/onyx/Card.ts b/src/types/onyx/Card.ts index 3c3111510da1..71ef3d4d98e7 100644 --- a/src/types/onyx/Card.ts +++ b/src/types/onyx/Card.ts @@ -1,12 +1,32 @@ -type Card = { - /** The name of the institution (bank of america, etc) */ - cardName?: string; +type AdditionalData = { + isBillingCard?: boolean; + isP2PDebitCard?: boolean; +}; + +type AccountData = { + additionalData?: AdditionalData; + addressName?: string; + addressState?: string; + addressStreet?: string; + addressZip?: number; + cardMonth?: number; /** The masked credit card number */ cardNumber?: string; - /** The ID of the card in the cards DB */ - cardID?: number; + cardYear?: number; + created?: string; + currency?: string; + fundID?: number; +}; + +type Card = { + accountData?: AccountData; + accountType?: string; + description?: string; + key?: string; + methodID?: number; + title?: string; }; export default Card; From f81d0671cff5d423c6eb23841c7fc98e70f50d65 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Tue, 18 Jul 2023 14:45:11 +0200 Subject: [PATCH 137/649] Adjust BlockedFromConcierge --- src/types/onyx/BlockedFromConcierge.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/types/onyx/BlockedFromConcierge.ts b/src/types/onyx/BlockedFromConcierge.ts index 0e8ac3699584..4eebd537604c 100644 --- a/src/types/onyx/BlockedFromConcierge.ts +++ b/src/types/onyx/BlockedFromConcierge.ts @@ -2,6 +2,7 @@ type BlockedFromConcierge = { /** The date that the user will be unblocked */ expiresAt: string; + /** Number of times the user has been blocked. */ count: 1 | 2 | 3; }; From aba2593ff05026ae0d526ad8bd9fd991cd943328 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Tue, 18 Jul 2023 14:48:23 +0200 Subject: [PATCH 138/649] Adjust Transaction --- src/types/onyx/Transaction.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/types/onyx/Transaction.ts b/src/types/onyx/Transaction.ts index 916570b185ff..05c0f9ae3f6d 100644 --- a/src/types/onyx/Transaction.ts +++ b/src/types/onyx/Transaction.ts @@ -5,18 +5,18 @@ type Comment = { }; type Transaction = { - transactionID?: string; - amount?: number; - currency?: string; - reportID?: string; - comment?: Comment; - merchant?: string; - created?: string; - pendingAction?: OnyxCommon.PendingAction; - errors?: Record; - modifiedAmount?: number; - modifiedCreated?: string; - modifiedCurrency?: string; + transactionID: string; + amount: number; + currency: string; + reportID: string; + comment: Comment; + merchant: string; + created: string; + pendingAction: OnyxCommon.PendingAction; + errors: Record; + modifiedAmount: number; + modifiedCreated: string; + modifiedCurrency: string; }; export default Transaction; From 0824e2c681350a8e1199407c42268a88b3133a24 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Tue, 18 Jul 2023 14:52:27 +0200 Subject: [PATCH 139/649] Adjust ReimbursementAccountDraft --- src/types/onyx/ReimbursementAccountDraft.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/types/onyx/ReimbursementAccountDraft.ts b/src/types/onyx/ReimbursementAccountDraft.ts index 281ea497f530..2f873333285e 100644 --- a/src/types/onyx/ReimbursementAccountDraft.ts +++ b/src/types/onyx/ReimbursementAccountDraft.ts @@ -21,6 +21,7 @@ type ReimbursementAccountDraft = { incorporationDate?: string | Date; incorporationState?: string; hasNoConnectionToCannabis?: boolean; + bank?: string; /** Props needed for RequestorStep */ firstName?: string; From 7fb38e8c1108a1cfb99ca77b74778dfb8fc191e0 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Tue, 18 Jul 2023 16:06:22 +0200 Subject: [PATCH 140/649] Adjust ReimbursementAccount --- src/types/onyx/ReimbursementAccount.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/types/onyx/ReimbursementAccount.ts b/src/types/onyx/ReimbursementAccount.ts index 7a65045338c5..ee22e98c9add 100644 --- a/src/types/onyx/ReimbursementAccount.ts +++ b/src/types/onyx/ReimbursementAccount.ts @@ -4,7 +4,9 @@ import CONST from '../../CONST'; type ACHData = { /** Step of the setup flow that we are on. Determines which view is presented. */ - currentStep?: ValueOf; + currentStep: ValueOf; + + subStep?: ValueOf; /** Bank account state */ state?: string; From 70d24437db7168d6f06c6bee199c0e30253ab44b Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Tue, 18 Jul 2023 16:11:21 +0200 Subject: [PATCH 141/649] Adjust PrivatePersonalDetails --- src/types/onyx/PrivatePersonalDetails.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/types/onyx/PrivatePersonalDetails.ts b/src/types/onyx/PrivatePersonalDetails.ts index 75cc11e3e63e..50ec77212efd 100644 --- a/src/types/onyx/PrivatePersonalDetails.ts +++ b/src/types/onyx/PrivatePersonalDetails.ts @@ -1,16 +1,18 @@ +type Address = { + street: string; + city: string; + state: string; + zip: string; + country: string; +}; + type PrivatePersonalDetails = { legalFirstName?: string; legalLastName?: string; dob?: string; /** User's home address */ - address?: { - street?: string; - city?: string; - state?: string; - zip?: string; - country?: string; - }; + address?: Address; }; export default PrivatePersonalDetails; From 2e3265705eebefec7629f67ba3a93e5d0d434b46 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 19 Jul 2023 15:27:59 +0200 Subject: [PATCH 142/649] Adjust Policy --- src/types/onyx/Policy.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/types/onyx/Policy.ts b/src/types/onyx/Policy.ts index 382495ae6e22..f0fd2b2eabff 100644 --- a/src/types/onyx/Policy.ts +++ b/src/types/onyx/Policy.ts @@ -26,7 +26,12 @@ type Policy = { /** Error objects keyed by field name containing errors keyed by microtime */ errorFields?: OnyxCommon.ErrorFields; + pendingAction?: OnyxCommon.PendingAction; + errors: Record; + isFromFullPolicy?: boolean; + lastModified?: string; + customUnits?: Record; }; export default Policy; From 2f736a1d35845cd171aab632a68313d6066353e7 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 19 Jul 2023 15:37:54 +0200 Subject: [PATCH 143/649] Adjust types after feedback --- src/types/onyx/PlaidData.ts | 2 +- src/types/onyx/ReportAction.ts | 32 +++++++++++++++++++++++--------- src/types/onyx/Transaction.ts | 6 +++--- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/src/types/onyx/PlaidData.ts b/src/types/onyx/PlaidData.ts index f4b8239597c5..b3e28fa7ce4a 100644 --- a/src/types/onyx/PlaidData.ts +++ b/src/types/onyx/PlaidData.ts @@ -9,7 +9,7 @@ type PlaidData = OnyxCommon.BaseState & { * Access token returned by Plaid once the user has logged into their bank. * This token can be used along with internal credentials to query for Plaid Balance or Assets */ - plaidAccessToken?: string; + plaidAccessToken: string; /** List of plaid bank accounts */ bankAccounts?: PlaidBankAccount[]; diff --git a/src/types/onyx/ReportAction.ts b/src/types/onyx/ReportAction.ts index fc0b663dc1ce..28a901f67cf4 100644 --- a/src/types/onyx/ReportAction.ts +++ b/src/types/onyx/ReportAction.ts @@ -1,3 +1,13 @@ +type User = { + accountID: number; + skinTone: number; +}; + +type Reaction = { + emoji: string; + users: User[]; +}; + type Message = { /** The type of the action item fragment. Used to render a corresponding component */ type: string; @@ -8,25 +18,29 @@ type Message = { /** Used to apply additional styling. Style refers to a predetermined constant and not a class name. e.g. 'normal' * or 'strong' */ - style: string; + style?: string; /** ID of a report */ - reportID: string; + reportID?: string; /** ID of a policy */ - policyID: string; + policyID?: string; /** The target of a link fragment e.g. '_blank' */ - target: string; + target?: string; /** The destination of a link fragment e.g. 'https://www.expensify.com' */ - href: string; + href?: string; /** An additional avatar url - not the main avatar url but used within a message. */ - iconUrl: string; + iconUrl?: string; /** Fragment edited flag */ isEdited: boolean; + + isDeletedParentAction: boolean; + whisperedTo: number[]; + reactions: Reaction[]; }; type OriginalMessage = { @@ -34,13 +48,13 @@ type OriginalMessage = { IOUTransactionID?: string; IOUReportID?: number; - amount?: number; + amount: number; comment?: string; - currency?: string; + currency: string; lastModified?: string; participantAccountIDs?: number[]; participants?: string[]; - type?: string; + type: string; }; type Person = { diff --git a/src/types/onyx/Transaction.ts b/src/types/onyx/Transaction.ts index 05c0f9ae3f6d..810ff55a4fcd 100644 --- a/src/types/onyx/Transaction.ts +++ b/src/types/onyx/Transaction.ts @@ -14,9 +14,9 @@ type Transaction = { created: string; pendingAction: OnyxCommon.PendingAction; errors: Record; - modifiedAmount: number; - modifiedCreated: string; - modifiedCurrency: string; + modifiedAmount?: number; + modifiedCreated?: string; + modifiedCurrency?: string; }; export default Transaction; From 0c9e3bc8a4d51845921ffea80e5e7505a610f2a9 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 20 Jul 2023 15:09:22 +0200 Subject: [PATCH 144/649] Extract original message to a separate file --- src/types/onyx/OriginalMessage.ts | 123 ++++++++++++++++++++++++++++++ src/types/onyx/ReportAction.ts | 26 ++----- 2 files changed, 128 insertions(+), 21 deletions(-) create mode 100644 src/types/onyx/OriginalMessage.ts diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts new file mode 100644 index 000000000000..5304864b7829 --- /dev/null +++ b/src/types/onyx/OriginalMessage.ts @@ -0,0 +1,123 @@ +import {ValueOf} from 'type-fest'; +import CONST from '../../CONST'; + +type OriginalMessageIOU = { + actionName: ValueOf; + originalMessage: { + /** The ID of the iou transaction */ + IOUTransactionID?: string; + + IOUReportID?: number; + amount: number; + comment?: string; + currency: string; + lastModified?: string; + participantAccountIDs?: number[]; + participants?: string[]; + type: string; + }; +}; + +type FlagSeverityName = 'spam' | 'inconsiderate' | 'bullying' | 'intimidation' | 'harassment' | 'assault'; +type FlagSeverity = { + accountID: number; + timestamp: string; +}; + +type Decision = { + decision: string; + timestamp: string; +}; + +type User = { + accountID: number; + skinTone: number; +}; + +type Reaction = { + emoji: string; + users: User[]; +}; + +type OriginalMessageAddComment = { + actionName: ValueOf; + originalMessage: { + html: string; + lastModified?: string; + taskReportID?: string; + edits?: string[]; + childReportID?: string; + isDeletedParentAction?: boolean; + flags?: Record; + moderationDecisions?: Decision[]; + whisperedTo: number[]; + reactions: Reaction[]; + }; +}; + +type OriginalMessageClosed = { + actionName: ValueOf; + originalMessage: { + policyName: string; + reason: 'default' | 'accountClosed' | 'accountMerged' | 'removedPolicy' | 'policyDeleted'; + lastModified?: string; + }; +}; + +type OriginalMessageCreated = { + actionName: ValueOf; + originalMessage: undefined; +}; + +type OriginalMessageRenamed = { + actionName: ValueOf; + originalMessage: { + html: string; + lastModified: string; + oldName: string; + newName: string; + }; +}; + +type ChronosOOOTimestamp = { + date: string; + timezone: string; + // eslint-disable-next-line @typescript-eslint/naming-convention + timezone_type: number; +}; + +type ChronosOOOEvent = { + id: string; + lengthInDays: number; + summary: string; + start: ChronosOOOTimestamp; + end: ChronosOOOTimestamp; +}; + +type OriginalMessageChronosOOOList = { + actionName: ValueOf; + originalMessage: { + edits: string[]; + events: ChronosOOOEvent[]; + html: string; + lastModified: string; + }; +}; + +type OriginalMessageReportPreview = { + actionName: ValueOf; + originalMessage: { + linkedReportID: string; + }; +}; + +type OriginalMessage = + | OriginalMessageIOU + | OriginalMessageAddComment + | OriginalMessageClosed + | OriginalMessageCreated + | OriginalMessageRenamed + | OriginalMessageChronosOOOList + | OriginalMessageReportPreview; + +export default OriginalMessage; diff --git a/src/types/onyx/ReportAction.ts b/src/types/onyx/ReportAction.ts index 28a901f67cf4..44a942e84721 100644 --- a/src/types/onyx/ReportAction.ts +++ b/src/types/onyx/ReportAction.ts @@ -1,3 +1,5 @@ +import OriginalMessage from './OriginalMessage'; + type User = { accountID: number; skinTone: number; @@ -43,35 +45,18 @@ type Message = { reactions: Reaction[]; }; -type OriginalMessage = { - /** The ID of the iou transaction */ - IOUTransactionID?: string; - - IOUReportID?: number; - amount: number; - comment?: string; - currency: string; - lastModified?: string; - participantAccountIDs?: number[]; - participants?: string[]; - type: string; -}; - type Person = { type?: string; style?: string; text?: string; }; -type ReportAction = { +type ReportActionBase = { /** The ID of the reportAction. It is the string representation of the a 64-bit integer. */ reportActionID?: string; actorAccountID?: number; - /** Name of the action e.g. ADDCOMMENT */ - actionName?: string; - /** Person who created the action */ person?: Person[]; @@ -81,9 +66,6 @@ type ReportAction = { /** report action message */ message?: Message[]; - /** Original message associated with this action */ - originalMessage?: OriginalMessage; - /** Whether we have received a response back from the server */ isLoading?: boolean; @@ -105,4 +87,6 @@ type ReportAction = { childVisibleActionCount?: number; }; +type ReportAction = ReportActionBase & OriginalMessage; + export default ReportAction; From 0f8b1dd68b3b6c2d3139d2d51293396d0254f299 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 20 Jul 2023 16:46:39 +0200 Subject: [PATCH 145/649] Add remaining original messages types --- src/types/onyx/OriginalMessage.ts | 32 +++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index 5304864b7829..e000fe52431a 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -2,7 +2,7 @@ import {ValueOf} from 'type-fest'; import CONST from '../../CONST'; type OriginalMessageIOU = { - actionName: ValueOf; + actionName: typeof CONST.REPORT.ACTIONS.TYPE.IOU; originalMessage: { /** The ID of the iou transaction */ IOUTransactionID?: string; @@ -40,7 +40,7 @@ type Reaction = { }; type OriginalMessageAddComment = { - actionName: ValueOf; + actionName: typeof CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT; originalMessage: { html: string; lastModified?: string; @@ -56,7 +56,7 @@ type OriginalMessageAddComment = { }; type OriginalMessageClosed = { - actionName: ValueOf; + actionName: typeof CONST.REPORT.ACTIONS.TYPE.CLOSED; originalMessage: { policyName: string; reason: 'default' | 'accountClosed' | 'accountMerged' | 'removedPolicy' | 'policyDeleted'; @@ -65,12 +65,12 @@ type OriginalMessageClosed = { }; type OriginalMessageCreated = { - actionName: ValueOf; + actionName: typeof CONST.REPORT.ACTIONS.TYPE.CREATED; originalMessage: undefined; }; type OriginalMessageRenamed = { - actionName: ValueOf; + actionName: typeof CONST.REPORT.ACTIONS.TYPE.RENAMED; originalMessage: { html: string; lastModified: string; @@ -95,7 +95,7 @@ type ChronosOOOEvent = { }; type OriginalMessageChronosOOOList = { - actionName: ValueOf; + actionName: typeof CONST.REPORT.ACTIONS.TYPE.CHRONOSOOOLIST; originalMessage: { edits: string[]; events: ChronosOOOEvent[]; @@ -105,12 +105,26 @@ type OriginalMessageChronosOOOList = { }; type OriginalMessageReportPreview = { - actionName: ValueOf; + actionName: typeof CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW; originalMessage: { linkedReportID: string; }; }; +type OriginalMessagePolicyChangeLog = { + actionName: ValueOf; + originalMessage: unknown; +}; + +type OriginalMessagePolicyTask = { + actionName: + | typeof CONST.REPORT.ACTIONS.TYPE.TASKEDITED + | typeof CONST.REPORT.ACTIONS.TYPE.TASKCANCELED + | typeof CONST.REPORT.ACTIONS.TYPE.TASKCOMPLETED + | typeof CONST.REPORT.ACTIONS.TYPE.TASKREOPENED; + originalMessage: unknown; +}; + type OriginalMessage = | OriginalMessageIOU | OriginalMessageAddComment @@ -118,6 +132,8 @@ type OriginalMessage = | OriginalMessageCreated | OriginalMessageRenamed | OriginalMessageChronosOOOList - | OriginalMessageReportPreview; + | OriginalMessageReportPreview + | OriginalMessagePolicyChangeLog + | OriginalMessagePolicyTask; export default OriginalMessage; From ae25eb47671067e79325e20f73be6450d3184760 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Fri, 21 Jul 2023 15:12:52 +0200 Subject: [PATCH 146/649] Make fields optional --- src/types/onyx/OriginalMessage.ts | 2 +- src/types/onyx/ReportAction.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index e000fe52431a..fa21e2339083 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -51,7 +51,7 @@ type OriginalMessageAddComment = { flags?: Record; moderationDecisions?: Decision[]; whisperedTo: number[]; - reactions: Reaction[]; + reactions?: Reaction[]; }; }; diff --git a/src/types/onyx/ReportAction.ts b/src/types/onyx/ReportAction.ts index 44a942e84721..174b08265272 100644 --- a/src/types/onyx/ReportAction.ts +++ b/src/types/onyx/ReportAction.ts @@ -73,7 +73,7 @@ type ReportActionBase = { error?: string; /** accountIDs of the people to which the whisper was sent to (if any). Returns empty array if it is not a whisper */ - whisperedToAccountIDs: number[]; + whisperedToAccountIDs?: number[]; avatar?: string; automatic?: boolean; From 539f77590ecd796f35a90000727e1371a1160081 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Mon, 24 Jul 2023 11:38:14 +0200 Subject: [PATCH 147/649] Adjust ReimbursementAccountDraft --- src/types/onyx/OriginalMessage.ts | 2 +- src/types/onyx/ReimbursementAccountDraft.ts | 28 +++++---------------- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index fa21e2339083..c16ca6751a1e 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -66,7 +66,7 @@ type OriginalMessageClosed = { type OriginalMessageCreated = { actionName: typeof CONST.REPORT.ACTIONS.TYPE.CREATED; - originalMessage: undefined; + originalMessage: unknown; }; type OriginalMessageRenamed = { diff --git a/src/types/onyx/ReimbursementAccountDraft.ts b/src/types/onyx/ReimbursementAccountDraft.ts index 2f873333285e..d55c2b5b3567 100644 --- a/src/types/onyx/ReimbursementAccountDraft.ts +++ b/src/types/onyx/ReimbursementAccountDraft.ts @@ -1,19 +1,10 @@ type ReimbursementAccountDraft = { - bankAccountID?: number; - - /** Props needed for BankAccountStep */ accountNumber?: string; routingNumber?: string; acceptTerms?: boolean; plaidAccountID?: string; plaidMask?: string; - - /** Props needed for CompanyStep */ companyName?: string; - addressStreet?: string; - addressCity?: string; - addressState?: string; - addressZipCode?: string; companyPhone?: string; website?: string; companyTaxID?: string; @@ -21,26 +12,19 @@ type ReimbursementAccountDraft = { incorporationDate?: string | Date; incorporationState?: string; hasNoConnectionToCannabis?: boolean; - bank?: string; - - /** Props needed for RequestorStep */ - firstName?: string; - lastName?: string; - requestorAddressStreet?: string; - requestorAddressCity?: string; - requestorAddressState?: string; - requestorAddressZipCode?: string; - dob?: string | Date; - ssnLast4?: string; isControllingOfficer?: boolean; isOnfidoSetupComplete?: boolean; - - /** Props needed for ACHContractStep */ ownsMoreThan25Percent?: boolean; hasOtherBeneficialOwners?: boolean; acceptTermsAndConditions?: boolean; certifyTrueInformation?: boolean; beneficialOwners?: string[]; + isSavings?: boolean; + bankName?: string; + plaidAccessToken?: string; + amount1?: string; + amount2?: string; + amount3?: string; }; export default ReimbursementAccountDraft; From e25861fa1eefada03c79d3daad2a5e0bb543d878 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Mon, 24 Jul 2023 18:06:27 +0200 Subject: [PATCH 148/649] Remove BaseState completely --- src/types/onyx/Account.ts | 8 +++++++- src/types/onyx/OnyxCommon.ts | 15 ++------------- src/types/onyx/PlaidData.ts | 5 ++++- src/types/onyx/Policy.ts | 2 +- src/types/onyx/Transaction.ts | 2 +- src/types/onyx/WalletAdditionalDetails.ts | 4 +++- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/types/onyx/Account.ts b/src/types/onyx/Account.ts index 24986fc7a2fe..29f21d703466 100644 --- a/src/types/onyx/Account.ts +++ b/src/types/onyx/Account.ts @@ -2,7 +2,7 @@ import {ValueOf} from 'type-fest'; import CONST from '../../CONST'; import * as OnyxCommon from './OnyxCommon'; -type Account = OnyxCommon.BaseState & { +type Account = { /** URL to the assigned guide's appointment booking calendar */ guideCalendarLink?: string; @@ -41,6 +41,12 @@ type Account = OnyxCommon.BaseState & { /** Whether the validation code has expired */ validateCodeExpired?: boolean; + + /** Whether a sign is loading */ + isLoading?: boolean; + + errors?: OnyxCommon.Errors; + success?: string; }; export default Account; diff --git a/src/types/onyx/OnyxCommon.ts b/src/types/onyx/OnyxCommon.ts index 272bce7cadcf..36e9c6ae74ea 100644 --- a/src/types/onyx/OnyxCommon.ts +++ b/src/types/onyx/OnyxCommon.ts @@ -6,18 +6,7 @@ type PendingAction = ValueOf; type ErrorFields = Record>; -type BaseState = { - success?: string; - - /** An error message to display to the user */ - errors?: Record; - errorFields?: ErrorFields; - - /** Whether or not data is loading */ - isLoading?: boolean; - - pendingAction?: PendingAction; -}; +type Errors = Record; type Icon = { source: React.ReactNode | string; @@ -25,4 +14,4 @@ type Icon = { name: string; }; -export type {BaseState, Icon, PendingAction, ErrorFields}; +export type {Icon, PendingAction, ErrorFields, Errors}; diff --git a/src/types/onyx/PlaidData.ts b/src/types/onyx/PlaidData.ts index b3e28fa7ce4a..a4a6d8e6fe8c 100644 --- a/src/types/onyx/PlaidData.ts +++ b/src/types/onyx/PlaidData.ts @@ -1,7 +1,7 @@ import PlaidBankAccount from './PlaidBankAccount'; import * as OnyxCommon from './OnyxCommon'; -type PlaidData = OnyxCommon.BaseState & { +type PlaidData = { /** Name of the bank */ bankName?: string; @@ -13,6 +13,9 @@ type PlaidData = OnyxCommon.BaseState & { /** List of plaid bank accounts */ bankAccounts?: PlaidBankAccount[]; + + isLoading?: boolean; + errors: OnyxCommon.Errors; }; export default PlaidData; diff --git a/src/types/onyx/Policy.ts b/src/types/onyx/Policy.ts index f0fd2b2eabff..cacbb5d15199 100644 --- a/src/types/onyx/Policy.ts +++ b/src/types/onyx/Policy.ts @@ -28,7 +28,7 @@ type Policy = { errorFields?: OnyxCommon.ErrorFields; pendingAction?: OnyxCommon.PendingAction; - errors: Record; + errors: OnyxCommon.Errors; isFromFullPolicy?: boolean; lastModified?: string; customUnits?: Record; diff --git a/src/types/onyx/Transaction.ts b/src/types/onyx/Transaction.ts index 810ff55a4fcd..0e0c7a423829 100644 --- a/src/types/onyx/Transaction.ts +++ b/src/types/onyx/Transaction.ts @@ -13,7 +13,7 @@ type Transaction = { merchant: string; created: string; pendingAction: OnyxCommon.PendingAction; - errors: Record; + errors: OnyxCommon.Errors; modifiedAmount?: number; modifiedCreated?: string; modifiedCurrency?: string; diff --git a/src/types/onyx/WalletAdditionalDetails.ts b/src/types/onyx/WalletAdditionalDetails.ts index 8176475f622b..e766ba4cfe50 100644 --- a/src/types/onyx/WalletAdditionalDetails.ts +++ b/src/types/onyx/WalletAdditionalDetails.ts @@ -1,6 +1,6 @@ import * as OnyxCommon from './OnyxCommon'; -type WalletAdditionalDetails = OnyxCommon.BaseState & { +type WalletAdditionalDetails = { /** Questions returned by Idology */ questions?: { prompt: string; @@ -16,6 +16,8 @@ type WalletAdditionalDetails = OnyxCommon.BaseState & { /** Which field needs attention? */ errorFields?: OnyxCommon.ErrorFields; + isLoading?: boolean; + errors?: OnyxCommon.Errors; }; export default WalletAdditionalDetails; From ba79ba624adad965b18cca1d7f3b8776dac9fa59 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Tue, 25 Jul 2023 16:44:42 +0200 Subject: [PATCH 149/649] Last adjustmnets to types --- src/types/onyx/Form.ts | 2 +- src/types/onyx/PolicyMember.ts | 2 +- src/types/onyx/ReimbursementAccount.ts | 4 +++- src/types/onyx/ReportAction.ts | 1 + src/types/onyx/UserWallet.ts | 3 ++- src/types/onyx/WalletOnfido.ts | 4 +++- src/types/onyx/WalletTerms.ts | 4 +++- src/types/onyx/WalletTransfer.ts | 3 ++- 8 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/types/onyx/Form.ts b/src/types/onyx/Form.ts index 2a23d489a146..cda8c3c1017e 100644 --- a/src/types/onyx/Form.ts +++ b/src/types/onyx/Form.ts @@ -5,7 +5,7 @@ type Form = { isLoading?: boolean; /** Server side errors keyed by microtime */ - errors?: Record; + errors?: OnyxCommon.Errors; /** Field-specific server side errors keyed by microtime */ errorFields?: OnyxCommon.ErrorFields; diff --git a/src/types/onyx/PolicyMember.ts b/src/types/onyx/PolicyMember.ts index 4503ca829e18..055465020c36 100644 --- a/src/types/onyx/PolicyMember.ts +++ b/src/types/onyx/PolicyMember.ts @@ -8,7 +8,7 @@ type PolicyMember = { * Errors from api calls on the specific user * {: 'error message', : 'error message 2'} */ - errors?: Record; + errors?: OnyxCommon.Errors; /** Is this action pending? */ pendingAction?: OnyxCommon.PendingAction; diff --git a/src/types/onyx/ReimbursementAccount.ts b/src/types/onyx/ReimbursementAccount.ts index ee22e98c9add..048cc3409466 100644 --- a/src/types/onyx/ReimbursementAccount.ts +++ b/src/types/onyx/ReimbursementAccount.ts @@ -35,7 +35,9 @@ type ReimbursementAccount = { errorFields?: OnyxCommon.ErrorFields; /** Any additional error message to show */ - errors?: Record; + errors?: OnyxCommon.Errors; + + pendingAction?: boolean; }; export default ReimbursementAccount; diff --git a/src/types/onyx/ReportAction.ts b/src/types/onyx/ReportAction.ts index 174b08265272..80ebc368a1b6 100644 --- a/src/types/onyx/ReportAction.ts +++ b/src/types/onyx/ReportAction.ts @@ -85,6 +85,7 @@ type ReportActionBase = { childCommenterCount?: number; childLastVisibleActionCreated?: string; childVisibleActionCount?: number; + pendingAction?: boolean; }; type ReportAction = ReportActionBase & OriginalMessage; diff --git a/src/types/onyx/UserWallet.ts b/src/types/onyx/UserWallet.ts index 151eefd15be2..8624f16000c9 100644 --- a/src/types/onyx/UserWallet.ts +++ b/src/types/onyx/UserWallet.ts @@ -1,5 +1,6 @@ import {ValueOf} from 'type-fest'; import CONST from '../../CONST'; +import * as OnyxCommon from './OnyxCommon'; type WalletLinkedAccountType = 'debitCard' | 'bankAccount'; @@ -46,7 +47,7 @@ type UserWallet = { errorCode?: ErrorCode; /** An error message to display to the user */ - errors?: Record; + errors?: OnyxCommon.Errors; }; export default UserWallet; diff --git a/src/types/onyx/WalletOnfido.ts b/src/types/onyx/WalletOnfido.ts index 827be5b99c21..7a65c0f710ef 100644 --- a/src/types/onyx/WalletOnfido.ts +++ b/src/types/onyx/WalletOnfido.ts @@ -1,3 +1,5 @@ +import * as OnyxCommon from './OnyxCommon'; + type WalletOnfido = { /** Unique identifier returned from openOnfidoFlow then re-sent to ActivateWallet with Onfido response data */ applicantID: string; @@ -9,7 +11,7 @@ type WalletOnfido = { isLoading?: boolean; /** Error message to inform the user of any problem that might occur */ - errors?: Record; + errors?: OnyxCommon.Errors; /** A list of Onfido errors that the user can fix in order to attempt the Onfido flow again */ fixableErrors?: string[]; diff --git a/src/types/onyx/WalletTerms.ts b/src/types/onyx/WalletTerms.ts index 34b78a07194e..5394f126c33c 100644 --- a/src/types/onyx/WalletTerms.ts +++ b/src/types/onyx/WalletTerms.ts @@ -1,6 +1,8 @@ +import * as OnyxCommon from './OnyxCommon'; + type WalletTerms = { /** Any error message to show */ - errors?: Record; + errors?: OnyxCommon.Errors; /** When the user accepts the Wallet's terms in order to pay an IOU, this is the ID of the chatReport the IOU is linked to */ chatReportID?: string; diff --git a/src/types/onyx/WalletTransfer.ts b/src/types/onyx/WalletTransfer.ts index c64b01fcdebf..d5214869d2fd 100644 --- a/src/types/onyx/WalletTransfer.ts +++ b/src/types/onyx/WalletTransfer.ts @@ -1,4 +1,5 @@ import CONST from '../../CONST'; +import * as OnyxCommon from './OnyxCommon'; type WalletTransfer = { /** Selected accountID for transfer */ @@ -14,7 +15,7 @@ type WalletTransfer = { shouldShowSuccess?: boolean; /** An error message to display to the user */ - errors?: Record; + errors?: OnyxCommon.Errors; /** Whether or not data is loading */ loading?: boolean; From 68e82559ed05ab573f292aaef27f4db2824f93e9 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 27 Jul 2023 09:27:03 +0200 Subject: [PATCH 150/649] Fix a typo --- src/types/onyx/OriginalMessage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index c16ca6751a1e..167542a9f49e 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -119,7 +119,7 @@ type OriginalMessagePolicyChangeLog = { type OriginalMessagePolicyTask = { actionName: | typeof CONST.REPORT.ACTIONS.TYPE.TASKEDITED - | typeof CONST.REPORT.ACTIONS.TYPE.TASKCANCELED + | typeof CONST.REPORT.ACTIONS.TYPE.TASKCANCELLED | typeof CONST.REPORT.ACTIONS.TYPE.TASKCOMPLETED | typeof CONST.REPORT.ACTIONS.TYPE.TASKREOPENED; originalMessage: unknown; From c463bf97076452d3cf6272dbfb8044ade8111aea Mon Sep 17 00:00:00 2001 From: ojasjadhav2 <140224450+ojasjadhav2@users.noreply.github.com> Date: Mon, 31 Jul 2023 20:40:40 +0530 Subject: [PATCH 151/649] migrated SwipableView > index.native.js --- src/components/SwipeableView/index.native.js | 36 +++++++++----------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/src/components/SwipeableView/index.native.js b/src/components/SwipeableView/index.native.js index b4751789fcfe..f4a67ae1c059 100644 --- a/src/components/SwipeableView/index.native.js +++ b/src/components/SwipeableView/index.native.js @@ -1,4 +1,4 @@ -import React, {PureComponent} from 'react'; +import React, {useRef} from 'react'; import {PanResponder, View} from 'react-native'; import PropTypes from 'prop-types'; import CONST from '../../CONST'; @@ -10,33 +10,29 @@ const propTypes = { onSwipeDown: PropTypes.func.isRequired, }; -class SwipeableView extends PureComponent { - constructor(props) { - super(props); - - const minimumPixelDistance = CONST.COMPOSER_MAX_HEIGHT; - this.oldY = 0; - this.panResponder = PanResponder.create({ +function SwipeableView({children, onSwipeDown}) { + const minimumPixelDistance = CONST.COMPOSER_MAX_HEIGHT; + const oldYRef = useRef(0); + const panResponder = useRef( + PanResponder.create({ // The PanResponder gets focus only when the y-axis movement is over minimumPixelDistance // & swip direction is downwards onMoveShouldSetPanResponderCapture: (_event, gestureState) => { - if (gestureState.dy - this.oldY > 0 && gestureState.dy > minimumPixelDistance) { + if (gestureState.dy - oldYRef.current > 0 && gestureState.dy > minimumPixelDistance) { return true; } - this.oldY = gestureState.dy; + oldYRef.current = gestureState.dy; }, // Calls the callback when the swipe down is released; after the completion of the gesture - onPanResponderRelease: this.props.onSwipeDown, - }); - } - - render() { - return ( - // eslint-disable-next-line react/jsx-props-no-spreading - {this.props.children} - ); - } + onPanResponderRelease: onSwipeDown, + }), + ).current; + + return ( + // eslint-disable-next-line react/jsx-props-no-spreading + {children} + ); } SwipeableView.propTypes = propTypes; From 5b982125dc25c7086bb3d1c862274636f04a4154 Mon Sep 17 00:00:00 2001 From: jeet-dhandha Date: Tue, 1 Aug 2023 00:53:51 +0530 Subject: [PATCH 152/649] chore: remove extra str and change continue code --- src/libs/EmojiUtils.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libs/EmojiUtils.js b/src/libs/EmojiUtils.js index 296ce7fa015f..eda27513205e 100644 --- a/src/libs/EmojiUtils.js +++ b/src/libs/EmojiUtils.js @@ -266,14 +266,13 @@ const getEmojiCodeWithSkinColor = (item, preferredSkinToneIndex) => { * @returns {Object[]} An array of emoji codes. */ function extractEmojis(text) { - const str = `${text}`; const emojis = []; - if (!str) { + if (!text) { return emojis; } - let parseEmojis = str.match(CONST.REGEX.EMOJIS); + let parseEmojis = text.match(CONST.REGEX.EMOJIS); if (!parseEmojis) { return emojis; @@ -284,8 +283,9 @@ function extractEmojis(text) { for (let i = 0; i < parseEmojis.length; i++) { const character = parseEmojis[i]; const emoji = Emojis.emojiCodeTable[character]; - if (!emoji) continue; // eslint-disable-line no-continue - emojis.push(emoji); + if (emoji) { + emojis.push(emoji); + } } return emojis; From 81845f4a271584e154cdf124d24a077cc099dbfe Mon Sep 17 00:00:00 2001 From: David Cardoza Date: Mon, 31 Jul 2023 19:17:36 -0700 Subject: [PATCH 153/649] Create Card-Rev-Share-for-Approved-Partners.md Added new ExpensifyHelp page. Tracking issue is here - https://github.com/Expensify/Expensify/issues/304373 --- docs/Card-Rev-Share-for-Approved-Partners.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 docs/Card-Rev-Share-for-Approved-Partners.md diff --git a/docs/Card-Rev-Share-for-Approved-Partners.md b/docs/Card-Rev-Share-for-Approved-Partners.md new file mode 100644 index 000000000000..9b5647a004d3 --- /dev/null +++ b/docs/Card-Rev-Share-for-Approved-Partners.md @@ -0,0 +1,17 @@ +--- +title: Expensify Card revenue share for ExpensifyApproved! partners +description: Earn money when your clients adopt the Expensify Card +--- + + +# About +Start making more with us! We're thrilled to announce a new incentive for our US-based ExpensifyApproved! partner accountants. You can now earn additional income for your firm every time your client uses their Expensify Card. We're offering 0.5% of the total Expensify Card spend of your clients in cashback returned to your firm. The more your clients spend, the more cashback your firm receives!
+
This program is currently only available to US-based ExpensifyApproved! partner accountants. + +# How-to +To benefit from this program, all you need to do is ensure that you are listed as a domain admin on your client's Expensify account. If you're not currently a domain admin, your client can follow the instructions outlined in [our help article](https://community.expensify.com/discussion/5749/how-to-add-and-remove-domain-admins#:~:text=Domain%20Admins%20have%20total%20control,a%20member%20of%20the%20domain.) to assign you this role. +# FAQ +- What if my firm is not permitted to accept revenue share from our clients?
+
We understand that different firms may have different policies. If your firm is unable to accept this revenue share, you can pass the revenue share back to your client to give them an additional 0.5% of cash back using your own internal payment tools.

+- What if my firm does not wish to participate in the program?
+
Please reach out to your assigned partner manager at new.expensify.com to inform them you would not like to accept the revenue share nor do you want to pass the revenue share to your clients. From 2e14ef0a9345c4cf0ee9f1daf99731ca569d99c1 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Tue, 1 Aug 2023 14:13:38 +0200 Subject: [PATCH 154/649] Fix eslint errors --- src/types/onyx/OriginalMessage.ts | 2 ++ src/types/onyx/WalletTransfer.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index 167542a9f49e..f15ca9963db9 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -1,3 +1,5 @@ +// TODO: Remove this after CONST.ts is migrated to TS +/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */ import {ValueOf} from 'type-fest'; import CONST from '../../CONST'; diff --git a/src/types/onyx/WalletTransfer.ts b/src/types/onyx/WalletTransfer.ts index d5214869d2fd..ea0878d9cc4d 100644 --- a/src/types/onyx/WalletTransfer.ts +++ b/src/types/onyx/WalletTransfer.ts @@ -9,6 +9,8 @@ type WalletTransfer = { selectedAccountType?: string; /** Type to filter the payment Method list */ + // TODO: Remove this after CONST.ts is migrated to TS + // eslint-disable-next-line @typescript-eslint/no-duplicate-type-constituents filterPaymentMethodType?: typeof CONST.PAYMENT_METHODS.DEBIT_CARD | typeof CONST.PAYMENT_METHODS.BANK_ACCOUNT; /** Whether the success screen is shown to user. */ From 11717c5772c631af6629d443270b8fbf107bf875 Mon Sep 17 00:00:00 2001 From: ntdiary <2471314@gmail.com> Date: Tue, 1 Aug 2023 20:41:32 +0800 Subject: [PATCH 155/649] fix keyboard flashing while clicking "Add attachment" --- patches/react-native+0.71.2-alpha.3.patch | 17 +++++++++- src/components/AttachmentPicker/index.js | 13 ++++++-- .../AttachmentPicker/index.native.js | 12 +++++-- src/components/Modal/BaseModal.js | 8 +++++ src/components/Modal/index.android.js | 10 ++++++ src/libs/ComposerFocusManager.js | 23 +++++++++++++ src/pages/home/report/ReportActionCompose.js | 32 ++++++++++++++----- 7 files changed, 102 insertions(+), 13 deletions(-) create mode 100644 src/libs/ComposerFocusManager.js diff --git a/patches/react-native+0.71.2-alpha.3.patch b/patches/react-native+0.71.2-alpha.3.patch index 822ca9daec9c..e48c71bb2151 100644 --- a/patches/react-native+0.71.2-alpha.3.patch +++ b/patches/react-native+0.71.2-alpha.3.patch @@ -1,5 +1,5 @@ diff --git a/node_modules/react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js b/node_modules/react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js -index 2f48f9e..ac7a416 100644 +index 2f48f9e..e26d677 100644 --- a/node_modules/react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js +++ b/node_modules/react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js @@ -65,6 +65,7 @@ class KeyboardAvoidingView extends React.Component { @@ -86,3 +86,18 @@ index 2f48f9e..ac7a416 100644 componentDidMount(): void { if (Platform.OS === 'ios') { this._subscriptions = [ +diff --git a/node_modules/react-native/React/Views/RCTModalHostViewManager.m b/node_modules/react-native/React/Views/RCTModalHostViewManager.m +index 4b9f9ad..4992874 100644 +--- a/node_modules/react-native/React/Views/RCTModalHostViewManager.m ++++ b/node_modules/react-native/React/Views/RCTModalHostViewManager.m +@@ -79,6 +79,10 @@ RCT_EXPORT_MODULE() + if (self->_presentationBlock) { + self->_presentationBlock([modalHostView reactViewController], viewController, animated, completionBlock); + } else { ++ UIWindow *window = RCTKeyWindow(); ++ if (window && window.rootViewController && [window.rootViewController.view isFirstResponder]) { ++ [window.rootViewController.view resignFirstResponder]; ++ } + [[modalHostView reactViewController] presentViewController:viewController + animated:animated + completion:completionBlock]; diff --git a/src/components/AttachmentPicker/index.js b/src/components/AttachmentPicker/index.js index e7653df2b4d0..d18165ab57ab 100644 --- a/src/components/AttachmentPicker/index.js +++ b/src/components/AttachmentPicker/index.js @@ -27,6 +27,8 @@ function getAcceptableFileTypes(type) { function AttachmentPicker(props) { const fileInput = useRef(); const onPicked = useRef(); + const onCanceled = useRef(() => {}); + return ( <> e.stopPropagation()} + onClick={(e) => { + e.stopPropagation(); + if (!fileInput.current) { + return; + } + fileInput.current.addEventListener('cancel', () => onCanceled.current(), { once: true}); + }} accept={getAcceptableFileTypes(props.type)} /> {props.children({ - openPicker: ({onPicked: newOnPicked}) => { + openPicker: ({onPicked: newOnPicked, onCanceled: newOnCanceled = () => {}}) => { onPicked.current = newOnPicked; fileInput.current.click(); + onCanceled.current = newOnCanceled; }, })} diff --git a/src/components/AttachmentPicker/index.native.js b/src/components/AttachmentPicker/index.native.js index b4b7d0b04c4e..a8f3b8d35c16 100644 --- a/src/components/AttachmentPicker/index.native.js +++ b/src/components/AttachmentPicker/index.native.js @@ -126,6 +126,7 @@ class AttachmentPicker extends Component { }); } + this.cancel = () => {}; this.close = this.close.bind(this); this.pickAttachment = this.pickAttachment.bind(this); this.removeKeyboardListener = this.removeKeyboardListener.bind(this); @@ -181,6 +182,7 @@ class AttachmentPicker extends Component { */ pickAttachment(attachments = []) { if (attachments.length === 0) { + this.cancel(); return; } @@ -342,7 +344,10 @@ class AttachmentPicker extends Component { */ renderChildren() { return this.props.children({ - openPicker: ({onPicked}) => this.open(onPicked), + openPicker: ({onPicked, onCanceled = () => {}}) => { + this.open(onPicked); + this.cancel = onCanceled; + }, }); } @@ -350,7 +355,10 @@ class AttachmentPicker extends Component { return ( <> { + this.close(); + this.cancel(); + }} isVisible={this.state.isVisible} anchorPosition={styles.createMenuPosition} onModalHide={this.onModalHide} diff --git a/src/components/Modal/BaseModal.js b/src/components/Modal/BaseModal.js index 6d5bd5390416..155e80acab84 100644 --- a/src/components/Modal/BaseModal.js +++ b/src/components/Modal/BaseModal.js @@ -10,6 +10,7 @@ import {propTypes as modalPropTypes, defaultProps as modalDefaultProps} from './ import * as Modal from '../../libs/actions/Modal'; import getModalStyles from '../../styles/getModalStyles'; import variables from '../../styles/variables'; +import ComposerFocusManager from '../../libs/ComposerFocusManager'; const propTypes = { ...modalPropTypes, @@ -73,6 +74,9 @@ class BaseModal extends PureComponent { this.props.onModalHide(); } Modal.onModalDidClose(); + if (!this.props.fullscreen) { + ComposerFocusManager.setReadyToFocus(); + } } render() { @@ -109,6 +113,9 @@ class BaseModal extends PureComponent { // Note: Escape key on web/desktop will trigger onBackButtonPress callback // eslint-disable-next-line react/jsx-props-no-multi-spaces onBackButtonPress={this.props.onClose} + onModalWillShow={() => { + ComposerFocusManager.resetReadyToFocus(); + }} onModalShow={() => { if (this.props.shouldSetModalVisibility) { Modal.setModalVisibility(true); @@ -117,6 +124,7 @@ class BaseModal extends PureComponent { }} propagateSwipe={this.props.propagateSwipe} onModalHide={this.hideModal} + onDismiss={() => ComposerFocusManager.setReadyToFocus()} onSwipeComplete={this.props.onClose} swipeDirection={swipeDirection} isVisible={this.props.isVisible} diff --git a/src/components/Modal/index.android.js b/src/components/Modal/index.android.js index 09df74329b20..b5f11a02650a 100644 --- a/src/components/Modal/index.android.js +++ b/src/components/Modal/index.android.js @@ -1,7 +1,17 @@ import React from 'react'; +import {AppState} from 'react-native'; import withWindowDimensions from '../withWindowDimensions'; import BaseModal from './BaseModal'; import {propTypes, defaultProps} from './modalPropTypes'; +import ComposerFocusManager from '../../libs/ComposerFocusManager'; + +AppState.addEventListener('focus', () => { + ComposerFocusManager.setReadyToFocus(); +}); + +AppState.addEventListener('blur', () => { + ComposerFocusManager.resetReadyToFocus(); +}); // Only want to use useNativeDriver on Android. It has strange flashes issue on IOS // https://github.com/react-native-modal/react-native-modal#the-modal-flashes-in-a-weird-way-when-animating diff --git a/src/libs/ComposerFocusManager.js b/src/libs/ComposerFocusManager.js new file mode 100644 index 000000000000..1f5f9d2d6f97 --- /dev/null +++ b/src/libs/ComposerFocusManager.js @@ -0,0 +1,23 @@ +let isReadyToFocusPromise = Promise.resolve(); +let resolveIsReadyToFocus; + +function resetReadyToFocus() { + isReadyToFocusPromise = new Promise(resolve => { + resolveIsReadyToFocus = resolve; + }); +} +function setReadyToFocus() { + if (!resolveIsReadyToFocus) { + return; + } + resolveIsReadyToFocus() +} +function isReadyToFocus() { + return isReadyToFocusPromise; +} + +export default { + resetReadyToFocus, + setReadyToFocus, + isReadyToFocus, +}; diff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js index 644a90216091..6766cbb0e8b4 100644 --- a/src/pages/home/report/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose.js @@ -59,6 +59,7 @@ import * as KeyDownListener from '../../../libs/KeyboardShortcut/KeyDownPressLis import * as EmojiPickerActions from '../../../libs/actions/EmojiPickerAction'; import withAnimatedRef from '../../../components/withAnimatedRef'; import updatePropsPaperWorklet from '../../../libs/updatePropsPaperWorklet'; +import ComposerFocusManager from '../../../libs/ComposerFocusManager'; const propTypes = { /** Beta features list */ @@ -221,6 +222,8 @@ class ReportActionCompose extends React.Component { this.unsubscribeNavigationBlur = () => null; this.unsubscribeNavigationFocus = () => null; + + this.shouldFocusAfterClosingModal = true; this.state = { isFocused: this.shouldFocusInputOnScreenFocus && !this.props.modal.isVisible && !this.props.modal.willAlertModalBecomeVisible && this.props.shouldShowComposeInput, @@ -268,10 +271,13 @@ class ReportActionCompose extends React.Component { } componentDidUpdate(prevProps) { + if (this.props.modal.isVisible && !prevProps.modal.isVisible) { + this.shouldFocusAfterClosingModal = true; + } // We want to focus or refocus the input when a modal has been closed or the underlying screen is refocused. // We avoid doing this on native platforms since the software keyboard popping // open creates a jarring and broken UX. - if (this.willBlurTextInputOnTapOutside && !this.props.modal.isVisible && this.props.isFocused && (prevProps.modal.isVisible || !prevProps.isFocused)) { + if (this.willBlurTextInputOnTapOutside && this.shouldFocusAfterClosingModal && !this.props.modal.isVisible && this.props.isFocused && (prevProps.modal.isVisible || !prevProps.isFocused)) { this.focus(); } @@ -757,13 +763,14 @@ class ReportActionCompose extends React.Component { if (!shouldelay) { this.textInput.focus(); - } else { - // Keyboard is not opened after Emoji Picker is closed - // SetTimeout is used as a workaround - // https://github.com/react-native-modal/react-native-modal/issues/114 - // We carefully choose a delay. 100ms is found enough for keyboard to open. - setTimeout(() => this.textInput.focus(), 100); + return; } + ComposerFocusManager.isReadyToFocus().then(() => { + if (!this.textInput) { + return; + } + this.textInput.focus(); + }); }); } @@ -1036,6 +1043,7 @@ class ReportActionCompose extends React.Component { this.shouldBlockEmojiCalc = false; this.shouldBlockMentionCalc = false; this.setState({isAttachmentPreviewActive: false}); + this.focus(true); }} > {({displayFileInModal}) => ( @@ -1095,6 +1103,7 @@ class ReportActionCompose extends React.Component { e.preventDefault(); // Drop focus to avoid blue focus ring. + this.textInput.blur(); this.actionButton.blur(); this.setMenuVisibility(true); }} @@ -1110,7 +1119,10 @@ class ReportActionCompose extends React.Component { this.setMenuVisibility(false)} + onClose={() => { + this.setMenuVisibility(false); + this.focus(true); + }} onItemSelected={() => this.setMenuVisibility(false)} anchorPosition={styles.createMenuPositionReportActionCompose(this.props.windowHeight)} anchorAlignment={{horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.LEFT, vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.BOTTOM}} @@ -1128,8 +1140,12 @@ class ReportActionCompose extends React.Component { this.shouldBlockMentionCalc = true; } + this.shouldFocusAfterClosingModal = false; openPicker({ onPicked: displayFileInModal, + onCanceled: () => { + this.focus(true); + }, }); }, }, From e8b27af8568b2133a620f5847197f3b71a54304b Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Tue, 1 Aug 2023 14:46:37 +0200 Subject: [PATCH 156/649] Adjust the PR after last review --- src/types/onyx/ReimbursementAccount.ts | 3 ++- src/types/onyx/ReportAction.ts | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/types/onyx/ReimbursementAccount.ts b/src/types/onyx/ReimbursementAccount.ts index 048cc3409466..4f2a05d7f4e1 100644 --- a/src/types/onyx/ReimbursementAccount.ts +++ b/src/types/onyx/ReimbursementAccount.ts @@ -6,6 +6,7 @@ type ACHData = { /** Step of the setup flow that we are on. Determines which view is presented. */ currentStep: ValueOf; + /** Optional subStep we would like the user to start back on */ subStep?: ValueOf; /** Bank account state */ @@ -37,7 +38,7 @@ type ReimbursementAccount = { /** Any additional error message to show */ errors?: OnyxCommon.Errors; - pendingAction?: boolean; + pendingAction?: OnyxCommon.PendingAction; }; export default ReimbursementAccount; diff --git a/src/types/onyx/ReportAction.ts b/src/types/onyx/ReportAction.ts index 80ebc368a1b6..ab517bb8705a 100644 --- a/src/types/onyx/ReportAction.ts +++ b/src/types/onyx/ReportAction.ts @@ -1,4 +1,5 @@ import OriginalMessage from './OriginalMessage'; +import * as OnyxCommon from './OnyxCommon'; type User = { accountID: number; @@ -85,7 +86,8 @@ type ReportActionBase = { childCommenterCount?: number; childLastVisibleActionCreated?: string; childVisibleActionCount?: number; - pendingAction?: boolean; + + pendingAction?: OnyxCommon.PendingAction; }; type ReportAction = ReportActionBase & OriginalMessage; From 6b34e190c18b89323f4611a73fe1660d6c16efac Mon Sep 17 00:00:00 2001 From: Thiago Brezinski Date: Tue, 1 Aug 2023 14:47:06 +0100 Subject: [PATCH 157/649] fix(selection-list): highlight position on select --- .../SelectionList/BaseSelectionList.js | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/components/SelectionList/BaseSelectionList.js b/src/components/SelectionList/BaseSelectionList.js index 2a38911b6512..64a3d9faaf74 100644 --- a/src/components/SelectionList/BaseSelectionList.js +++ b/src/components/SelectionList/BaseSelectionList.js @@ -173,14 +173,23 @@ function BaseSelectionList({ }; const selectRow = (item) => { - // Focus next index that is not disabled or already selected - const nextIndex = _.findIndex( - flattenedSections.allOptions, - (option, index) => index > focusedIndex && !flattenedSections.disabledOptionsIndexes.includes(index) && !option.isSelected, - ); + if (canSelectMultiple && (!item.isSelected || sections.length === 1)) { + // 1. Focusing the next item when selecting a row only makes sense in multiple selection lists, + // because in single selection lists we're closing the list after selecting an item. + + // 2. If `item` is not selected, it means we're selecting it, so we ALWAYS focus the next available item. + + // 3. If `item` is selected, it means we're unselecting it. + // There's 2 types of lists. Lists with only 1 section (e.g. Workspace Members) and lists with multiple sections (e.g. Workspace Invite Members): + // - For lists with only 1 section, we still want to focus the next item, even if the one we're pressing is being unselected. + // - For lists with multiple sections, we want to do nothing - just keep the `focusedIndex` where it is. The list will already reorder the items, so also changing the focus might be confusing. - if (nextIndex >= 0) { - setFocusedIndex(nextIndex); + const pressedIndex = _.findIndex(flattenedSections.allOptions, (option) => option.keyForList === item.keyForList); + const nextIndex = _.findIndex(flattenedSections.allOptions, (option, index) => index > pressedIndex && !flattenedSections.disabledOptionsIndexes.includes(index)); + + if (nextIndex >= 0) { + setFocusedIndex(nextIndex); + } } onSelectRow(item); From e0764460e2910a2cc247ac2568282c8d7d78f049 Mon Sep 17 00:00:00 2001 From: ntdiary <2471314@gmail.com> Date: Tue, 1 Aug 2023 22:08:01 +0800 Subject: [PATCH 158/649] fix lint style --- src/components/AttachmentPicker/index.js | 2 +- src/libs/ComposerFocusManager.js | 4 ++-- src/pages/home/report/ReportActionCompose.js | 10 ++++++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/components/AttachmentPicker/index.js b/src/components/AttachmentPicker/index.js index d18165ab57ab..9ea94ae53d42 100644 --- a/src/components/AttachmentPicker/index.js +++ b/src/components/AttachmentPicker/index.js @@ -53,7 +53,7 @@ function AttachmentPicker(props) { if (!fileInput.current) { return; } - fileInput.current.addEventListener('cancel', () => onCanceled.current(), { once: true}); + fileInput.current.addEventListener('cancel', () => onCanceled.current(), {once: true}); }} accept={getAcceptableFileTypes(props.type)} /> diff --git a/src/libs/ComposerFocusManager.js b/src/libs/ComposerFocusManager.js index 1f5f9d2d6f97..569e165da962 100644 --- a/src/libs/ComposerFocusManager.js +++ b/src/libs/ComposerFocusManager.js @@ -2,7 +2,7 @@ let isReadyToFocusPromise = Promise.resolve(); let resolveIsReadyToFocus; function resetReadyToFocus() { - isReadyToFocusPromise = new Promise(resolve => { + isReadyToFocusPromise = new Promise((resolve) => { resolveIsReadyToFocus = resolve; }); } @@ -10,7 +10,7 @@ function setReadyToFocus() { if (!resolveIsReadyToFocus) { return; } - resolveIsReadyToFocus() + resolveIsReadyToFocus(); } function isReadyToFocus() { return isReadyToFocusPromise; diff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js index 6766cbb0e8b4..27257805244f 100644 --- a/src/pages/home/report/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose.js @@ -222,7 +222,7 @@ class ReportActionCompose extends React.Component { this.unsubscribeNavigationBlur = () => null; this.unsubscribeNavigationFocus = () => null; - + this.shouldFocusAfterClosingModal = true; this.state = { @@ -277,7 +277,13 @@ class ReportActionCompose extends React.Component { // We want to focus or refocus the input when a modal has been closed or the underlying screen is refocused. // We avoid doing this on native platforms since the software keyboard popping // open creates a jarring and broken UX. - if (this.willBlurTextInputOnTapOutside && this.shouldFocusAfterClosingModal && !this.props.modal.isVisible && this.props.isFocused && (prevProps.modal.isVisible || !prevProps.isFocused)) { + if ( + this.willBlurTextInputOnTapOutside && + this.shouldFocusAfterClosingModal && + !this.props.modal.isVisible && + this.props.isFocused && + (prevProps.modal.isVisible || !prevProps.isFocused) + ) { this.focus(); } From 399fa555ca46cf303048dba1fecfbba3825e579f Mon Sep 17 00:00:00 2001 From: dhairyasenjaliya Date: Tue, 1 Aug 2023 19:59:09 +0530 Subject: [PATCH 159/649] Adjust styling as per new design --- src/components/ButtonWithDropdownMenu.js | 18 +++++++++++------- src/styles/styles.js | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/components/ButtonWithDropdownMenu.js b/src/components/ButtonWithDropdownMenu.js index bdf05fbc93b3..195941ce307d 100644 --- a/src/components/ButtonWithDropdownMenu.js +++ b/src/components/ButtonWithDropdownMenu.js @@ -86,7 +86,7 @@ function ButtonWithDropdownMenu(props) { style={[styles.flex1, styles.pr0]} pressOnEnter medium - innerStyles={[{height: 40}]} + innerStyles={[styles.dropButtonHeight]} /> @@ -117,6 +119,8 @@ function ButtonWithDropdownMenu(props) { text={selectedItem.text} onPress={(event) => props.onPress(event, props.options[0].value)} pressOnEnter + medium + innerStyles={[styles.dropButtonHeight]} /> )} {props.options.length > 1 && !_.isEmpty(popoverAnchorPosition) && ( diff --git a/src/styles/styles.js b/src/styles/styles.js index 673f73a70c5a..c6c63bb856fd 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -3554,6 +3554,24 @@ const styles = { willChangeTransform: { willChange: 'transform', }, + + dropButtonHeight: { + height: variables.componentSizeNormal, + }, + + cartIconContainer: { + height: variables.componentSizeNormal, + paddingRight: 0, + paddingLeft: 0, + }, + + cartIconView: { + borderTopRightRadius: variables.buttonBorderRadius, + borderBottomRightRadius: variables.buttonBorderRadius, + height: variables.componentSizeNormal, + ...flex.flexRow, + ...flex.alignItemsCenter, + }, }; export default styles; From cd58d75bcbfd8f2d8f60b782626d04f6c5bdcb14 Mon Sep 17 00:00:00 2001 From: dhairyasenjaliya Date: Tue, 1 Aug 2023 20:39:11 +0530 Subject: [PATCH 160/649] remove height from another button --- src/components/ButtonWithDropdownMenu.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/ButtonWithDropdownMenu.js b/src/components/ButtonWithDropdownMenu.js index 195941ce307d..ee8b7812cebf 100644 --- a/src/components/ButtonWithDropdownMenu.js +++ b/src/components/ButtonWithDropdownMenu.js @@ -119,8 +119,6 @@ function ButtonWithDropdownMenu(props) { text={selectedItem.text} onPress={(event) => props.onPress(event, props.options[0].value)} pressOnEnter - medium - innerStyles={[styles.dropButtonHeight]} /> )} {props.options.length > 1 && !_.isEmpty(popoverAnchorPosition) && ( From 68a6ec66215c6bf3943a2df8252ea69d802c74de Mon Sep 17 00:00:00 2001 From: ojasjadhav2 <140224450+ojasjadhav2@users.noreply.github.com> Date: Tue, 1 Aug 2023 23:28:48 +0530 Subject: [PATCH 161/649] added displayName --- src/components/SwipeableView/index.native.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/SwipeableView/index.native.js b/src/components/SwipeableView/index.native.js index f4a67ae1c059..6e96cfbbbc45 100644 --- a/src/components/SwipeableView/index.native.js +++ b/src/components/SwipeableView/index.native.js @@ -36,5 +36,6 @@ function SwipeableView({children, onSwipeDown}) { } SwipeableView.propTypes = propTypes; +SwipeableView.displayName = 'SwipeableView'; export default SwipeableView; From da12fd001396e6256d647e7a78cb2d99d4cce04e Mon Sep 17 00:00:00 2001 From: dhairyasenjaliya Date: Wed, 2 Aug 2023 11:22:01 +0530 Subject: [PATCH 162/649] use borderwidth instead of normal width --- src/styles/styles.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/styles/styles.js b/src/styles/styles.js index c6c63bb856fd..3a83ba253efb 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -560,9 +560,9 @@ const styles = { }, buttonDivider: { - width: 1, - backgroundColor: themeColors.text, height: 28, + borderWidth: 1, + borderColor: themeColors.text, }, noBorderRadius: { From 76ace6f7266315c714446366aaceef421ad4ecc5 Mon Sep 17 00:00:00 2001 From: dhairyasenjaliya Date: Wed, 2 Aug 2023 11:28:30 +0530 Subject: [PATCH 163/649] remove unused import --- src/components/ButtonWithDropdownMenu.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/ButtonWithDropdownMenu.js b/src/components/ButtonWithDropdownMenu.js index ee8b7812cebf..e591099bdc39 100644 --- a/src/components/ButtonWithDropdownMenu.js +++ b/src/components/ButtonWithDropdownMenu.js @@ -10,7 +10,6 @@ import Icon from './Icon'; import * as Expensicons from './Icon/Expensicons'; import themeColors from '../styles/themes/default'; import CONST from '../CONST'; -import variables from '../styles/variables'; const propTypes = { /** Text to display for the menu header */ From 0321599dfbcad2c62fdf437bd0a8fee9e68cc591 Mon Sep 17 00:00:00 2001 From: Thiago Brezinski Date: Wed, 2 Aug 2023 13:48:21 +0100 Subject: [PATCH 164/649] fix(selection-list): highlight position on select --- .../SelectionList/BaseSelectionList.js | 51 ++++++------------- 1 file changed, 16 insertions(+), 35 deletions(-) diff --git a/src/components/SelectionList/BaseSelectionList.js b/src/components/SelectionList/BaseSelectionList.js index 64a3d9faaf74..82293d44f655 100644 --- a/src/components/SelectionList/BaseSelectionList.js +++ b/src/components/SelectionList/BaseSelectionList.js @@ -1,4 +1,4 @@ -import React, {useEffect, useRef, useState} from 'react'; +import React, {useEffect, useMemo, useRef, useState} from 'react'; import {View} from 'react-native'; import _ from 'underscore'; import lodashGet from 'lodash/get'; @@ -66,7 +66,7 @@ function BaseSelectionList({ * * @return {{itemLayouts: [{offset: number, length: number}], disabledOptionsIndexes: *[], allOptions: *[]}} */ - const getFlattenedSections = () => { + const flattenedSections = useMemo(() => { const allOptions = []; const disabledOptionsIndexes = []; @@ -75,7 +75,7 @@ function BaseSelectionList({ let offset = 0; const itemLayouts = [{length: 0, offset}]; - let selectedCount = 0; + const selectedOptions = []; _.each(sections, (section, sectionIndex) => { const sectionHeaderHeight = variables.optionsListSectionHeaderHeight; @@ -102,7 +102,7 @@ function BaseSelectionList({ offset += fullItemHeight; if (item.isSelected) { - selectedCount++; + selectedOptions.push(item); } }); @@ -115,7 +115,7 @@ function BaseSelectionList({ // because React Native accounts for it in getItemLayout itemLayouts.push({length: 0, offset}); - if (selectedCount > 1 && !canSelectMultiple) { + if (selectedOptions.length > 1 && !canSelectMultiple) { Log.alert( 'Dev error: SelectionList - multiple items are selected but prop `canSelectMultiple` is false. Please enable `canSelectMultiple` or make your list have only 1 item with `isSelected: true`.', ); @@ -123,13 +123,12 @@ function BaseSelectionList({ return { allOptions, + selectedOptions, disabledOptionsIndexes, itemLayouts, - allSelected: selectedCount > 0 && selectedCount === allOptions.length - disabledOptionsIndexes.length, + allSelected: selectedOptions.length > 0 && selectedOptions.length === allOptions.length - disabledOptionsIndexes.length, }; - }; - - const flattenedSections = getFlattenedSections(); + }, [canSelectMultiple, sections]); const [focusedIndex, setFocusedIndex] = useState(() => { const defaultIndex = 0; @@ -172,29 +171,6 @@ function BaseSelectionList({ listRef.current.scrollToLocation({sectionIndex: adjustedSectionIndex, itemIndex, animated}); }; - const selectRow = (item) => { - if (canSelectMultiple && (!item.isSelected || sections.length === 1)) { - // 1. Focusing the next item when selecting a row only makes sense in multiple selection lists, - // because in single selection lists we're closing the list after selecting an item. - - // 2. If `item` is not selected, it means we're selecting it, so we ALWAYS focus the next available item. - - // 3. If `item` is selected, it means we're unselecting it. - // There's 2 types of lists. Lists with only 1 section (e.g. Workspace Members) and lists with multiple sections (e.g. Workspace Invite Members): - // - For lists with only 1 section, we still want to focus the next item, even if the one we're pressing is being unselected. - // - For lists with multiple sections, we want to do nothing - just keep the `focusedIndex` where it is. The list will already reorder the items, so also changing the focus might be confusing. - - const pressedIndex = _.findIndex(flattenedSections.allOptions, (option) => option.keyForList === item.keyForList); - const nextIndex = _.findIndex(flattenedSections.allOptions, (option, index) => index > pressedIndex && !flattenedSections.disabledOptionsIndexes.includes(index)); - - if (nextIndex >= 0) { - setFocusedIndex(nextIndex); - } - } - - onSelectRow(item); - }; - /** * This function is used to compute the layout of any given item in our list. * We need to implement it so that we can programmatically scroll to items outside the virtual render window of the SectionList. @@ -245,7 +221,7 @@ function BaseSelectionList({ ); @@ -255,11 +231,16 @@ function BaseSelectionList({ ); }; + /** Focuses the next available index after selecting a row */ + useEffect(() => { + setFocusedIndex(flattenedSections.selectedOptions.length); + }, [flattenedSections.selectedOptions]); + /** Focuses the text input when the component mounts. If `props.shouldDelayFocus` is true, we wait for the animation to finish */ useEffect(() => { if (shouldShowTextInput) { @@ -288,7 +269,7 @@ function BaseSelectionList({ return; } - selectRow(focusedOption); + onSelectRow(focusedOption); }, { captureOnInputs: true, From bcd4a901b287851e3af43f66529cc3b4847d6cd8 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Wed, 2 Aug 2023 16:42:19 +0200 Subject: [PATCH 165/649] Add types for ONYXKEYS.COLLECTION.REPORT_ACTIONS_REACTIONS --- src/ONYXKEYS.ts | 14 ++++++-------- src/types/onyx/ReportActionReactions.ts | 15 +++++++++++++++ src/types/onyx/index.ts | 2 ++ 3 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 src/types/onyx/ReportActionReactions.ts diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 058eccf9c626..d6839d7d2876 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -132,7 +132,7 @@ const ONYXKEYS = { /** The user's credit cards */ CARD_LIST: 'cardList', - // The user's credit cards (renamed from cardList) + /** The user's credit cards (renamed from cardList) */ FUND_LIST: 'fundList', /** Stores information about the user's saved statements */ @@ -180,9 +180,6 @@ const ONYXKEYS = { /** Is app in beta version */ IS_BETA: 'isBeta', - /** Whether the auth token is valid */ - IS_TOKEN_VALID: 'isTokenValid', - /** Whether we're checking if the room is public or not */ IS_CHECKING_PUBLIC_ROOM: 'isCheckingPublicRoom', @@ -208,6 +205,7 @@ const ONYXKEYS = { REPORT: 'report_', REPORT_ACTIONS: 'reportActions_', REPORT_ACTIONS_DRAFTS: 'reportActionsDrafts_', + REPORT_ACTIONS_REACTIONS: 'reportActionsReactions_', REPORT_DRAFT_COMMENT: 'reportDraftComment_', REPORT_DRAFT_COMMENT_NUMBER_OF_LINES: 'reportDraftCommentNumberOfLines_', REPORT_IS_COMPOSER_FULL_SIZE: 'reportIsComposerFullSize_', @@ -305,7 +303,6 @@ type OnyxValues = { [ONYXKEYS.LAST_ACCESSED_WORKSPACE_POLICY_ID]: string; [ONYXKEYS.SHOULD_SHOW_COMPOSE_INPUT]: boolean; [ONYXKEYS.IS_BETA]: boolean; - [ONYXKEYS.IS_TOKEN_VALID]: boolean; [ONYXKEYS.IS_CHECKING_PUBLIC_ROOM]: boolean; [ONYXKEYS.MY_DOMAIN_SECURITY_GROUPS]: Record; [ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID]: string; @@ -319,9 +316,10 @@ type OnyxValues = { [deprecatedPolicyMemberList: `${typeof ONYXKEYS.COLLECTION.DEPRECATED_POLICY_MEMBER_LIST}${string}`]: OnyxTypes.PolicyMember; [workspaceInviteMembersDraft: `${typeof ONYXKEYS.COLLECTION.WORKSPACE_INVITE_MEMBERS_DRAFT}${string}`]: Record; [report: `${typeof ONYXKEYS.COLLECTION.REPORT}${string}`]: OnyxTypes.Report; - [ReportActions: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS}${string}`]: OnyxTypes.ReportAction; - [ReportActionsDrafts: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS}${string}`]: string; - [ReportDraftComment: `${typeof ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${string}`]: string; + [reportActions: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS}${string}`]: OnyxTypes.ReportAction; + [reportActionsDrafts: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS}${string}`]: string; + [reportActionsReactions: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS_REACTIONS}${string}`]: OnyxTypes.ReportActionReactions; + [reportDraftComment: `${typeof ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${string}`]: string; [reportDraftCommentNumberOfLines: `${typeof ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT_NUMBER_OF_LINES}${string}`]: number; [reportIsComposerFull: `${typeof ONYXKEYS.COLLECTION.REPORT_IS_COMPOSER_FULL_SIZE}${string}`]: boolean; [reportUserIsTyping: `${typeof ONYXKEYS.COLLECTION.REPORT_USER_IS_TYPING}${string}`]: boolean; diff --git a/src/types/onyx/ReportActionReactions.ts b/src/types/onyx/ReportActionReactions.ts new file mode 100644 index 000000000000..196e2707bbd2 --- /dev/null +++ b/src/types/onyx/ReportActionReactions.ts @@ -0,0 +1,15 @@ +type User = { + /** The skin tone which was used and also the timestamp of when it was added */ + skinTones: Record; +}; + +type ReportActionReaction = { + /** The time the emoji was added */ + createdAt: string; + /** All the users who have added this emoji */ + users: Record; +}; + +type ReportActionReactions = Record; + +export default ReportActionReactions; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index ddcc728fb437..7c92f1da6fb0 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -34,6 +34,7 @@ import PolicyMember from './PolicyMember'; import Policy from './Policy'; import Report from './Report'; import ReportAction from './ReportAction'; +import ReportActionReactions from './ReportActionReactions'; import SecurityGroup from './SecurityGroup'; import Transaction from './Transaction'; import Form, {AddDebitCardForm} from './Form'; @@ -75,6 +76,7 @@ export type { Policy, Report, ReportAction, + ReportActionReactions, SecurityGroup, Transaction, Form, From fdc04d3252c344e9f728fd1e2841c89186937f3f Mon Sep 17 00:00:00 2001 From: Thiago Brezinski Date: Wed, 2 Aug 2023 17:45:08 +0100 Subject: [PATCH 166/649] fix(selection-list): highlight for single section --- .../SelectionList/BaseSelectionList.js | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src/components/SelectionList/BaseSelectionList.js b/src/components/SelectionList/BaseSelectionList.js index 2fca8bcb1493..618d121739fa 100644 --- a/src/components/SelectionList/BaseSelectionList.js +++ b/src/components/SelectionList/BaseSelectionList.js @@ -171,6 +171,23 @@ function BaseSelectionList({ listRef.current.scrollToLocation({sectionIndex: adjustedSectionIndex, itemIndex, animated}); }; + const selectRow = (item, index) => { + // In single-selection lists we don't care about updating the focused index, because the list is closed after selecting an item + if (canSelectMultiple) { + if (sections.length === 1) { + // If the list has only 1 section (e.g. Workspace Members list), we always focus the next available item + const nextAvailableIndex = _.findIndex(flattenedSections.allOptions, (option, i) => i > index && !option.isDisabled); + setFocusedIndex(nextAvailableIndex); + } else { + // If the list has multiple sections (e.g. Workspace Invite list), we focus the first one after all the selected (selected items are always at the top) + const selectedOptionsCount = item.isSelected ? flattenedSections.selectedOptions.length - 1 : flattenedSections.selectedOptions.length + 1; + setFocusedIndex(selectedOptionsCount); + } + } + + onSelectRow(item); + }; + /** * This function is used to compute the layout of any given item in our list. * We need to implement it so that we can programmatically scroll to items outside the virtual render window of the SectionList. @@ -221,7 +238,7 @@ function BaseSelectionList({ selectRow(item, index)} onDismissError={onDismissError} /> ); @@ -231,16 +248,11 @@ function BaseSelectionList({ selectRow(item, index)} /> ); }; - /** Focuses the next available index after selecting a row */ - useEffect(() => { - setFocusedIndex(flattenedSections.selectedOptions.length); - }, [flattenedSections.selectedOptions]); - /** Focuses the text input when the component mounts. If `props.shouldDelayFocus` is true, we wait for the animation to finish */ useEffect(() => { if (shouldShowTextInput) { @@ -265,11 +277,11 @@ function BaseSelectionList({ () => { const focusedOption = flattenedSections.allOptions[focusedIndex]; - if (!focusedOption) { + if (!focusedOption || focusedOption.isDisabled) { return; } - onSelectRow(focusedOption); + selectRow(focusedOption, focusedIndex); }, { captureOnInputs: true, From 7ac72b55865e8fd4ceb7147137c3dd5c5b07d1cc Mon Sep 17 00:00:00 2001 From: ntdiary <2471314@gmail.com> Date: Thu, 3 Aug 2023 16:08:12 +0800 Subject: [PATCH 167/649] upgrade patch approach for modal --- ...-native+0.72.1+004+ModalKeyboardFlashing.patch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 patches/react-native+0.72.1+004+ModalKeyboardFlashing.patch diff --git a/patches/react-native+0.72.1+004+ModalKeyboardFlashing.patch b/patches/react-native+0.72.1+004+ModalKeyboardFlashing.patch new file mode 100644 index 000000000000..4f239084b4ec --- /dev/null +++ b/patches/react-native+0.72.1+004+ModalKeyboardFlashing.patch @@ -0,0 +1,15 @@ +diff --git a/node_modules/react-native/React/Views/RCTModalHostViewManager.m b/node_modules/react-native/React/Views/RCTModalHostViewManager.m +index 4b9f9ad..4992874 100644 +--- a/node_modules/react-native/React/Views/RCTModalHostViewManager.m ++++ b/node_modules/react-native/React/Views/RCTModalHostViewManager.m +@@ -79,6 +79,10 @@ RCT_EXPORT_MODULE() + if (self->_presentationBlock) { + self->_presentationBlock([modalHostView reactViewController], viewController, animated, completionBlock); + } else { ++ UIWindow *window = RCTKeyWindow(); ++ if (window && window.rootViewController && [window.rootViewController.view isFirstResponder]) { ++ [window.rootViewController.view resignFirstResponder]; ++ } + [[modalHostView reactViewController] presentViewController:viewController + animated:animated + completion:completionBlock]; From c7fb74a2115ccf03847f308eb8a94d5e426b6331 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 3 Aug 2023 10:14:13 +0200 Subject: [PATCH 168/649] Overwrite react-native-onyx in global.d.ts --- src/global.d.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/global.d.ts b/src/global.d.ts index 0e32eb6f7457..0dc745d5e0ea 100644 --- a/src/global.d.ts +++ b/src/global.d.ts @@ -1,3 +1,5 @@ +import {OnyxKey, OnyxCollectionKey, OnyxValues} from './ONYXKEYS'; + declare module '*.png' { const value: import('react-native').ImageSourcePropType; export default value; @@ -15,3 +17,12 @@ declare module '*.svg' { } declare module 'react-native-device-info/jest/react-native-device-info-mock'; + +declare module 'react-native-onyx' { + // eslint-disable-next-line @typescript-eslint/consistent-type-definitions + interface CustomTypeOptions { + keys: OnyxKey; + collectionKeys: OnyxCollectionKey; + values: OnyxValues; + } +} From 1cee790ecf43e91e2ad1a8b361a2ae94a0e3fc1b Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 3 Aug 2023 10:15:17 +0200 Subject: [PATCH 169/649] Change how onyx collection values are defined --- src/ONYXKEYS.ts | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index d6839d7d2876..92271bd4c368 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -242,8 +242,8 @@ const ONYXKEYS = { } as const; type OnyxKeysMap = typeof ONYXKEYS; -type CollectionKey = `${ValueOf}${string}`; -type OnyxKey = DeepValueOf> | CollectionKey; +type OnyxCollectionKey = ValueOf; +type OnyxKey = DeepValueOf>; type OnyxValues = { [ONYXKEYS.ACCOUNT]: OnyxTypes.Account; @@ -310,21 +310,21 @@ type OnyxValues = { [ONYXKEYS.IS_USING_MEMORY_ONLY_KEYS]: boolean; // Collections - [download: `${typeof ONYXKEYS.COLLECTION.DOWNLOAD}${string}`]: OnyxTypes.Download; - [policy: `${typeof ONYXKEYS.COLLECTION.POLICY}${string}`]: OnyxTypes.Policy; - [policyMembers: `${typeof ONYXKEYS.COLLECTION.POLICY_MEMBERS}${string}`]: OnyxTypes.PolicyMember; - [deprecatedPolicyMemberList: `${typeof ONYXKEYS.COLLECTION.DEPRECATED_POLICY_MEMBER_LIST}${string}`]: OnyxTypes.PolicyMember; - [workspaceInviteMembersDraft: `${typeof ONYXKEYS.COLLECTION.WORKSPACE_INVITE_MEMBERS_DRAFT}${string}`]: Record; - [report: `${typeof ONYXKEYS.COLLECTION.REPORT}${string}`]: OnyxTypes.Report; - [reportActions: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS}${string}`]: OnyxTypes.ReportAction; - [reportActionsDrafts: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS}${string}`]: string; - [reportActionsReactions: `${typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS_REACTIONS}${string}`]: OnyxTypes.ReportActionReactions; - [reportDraftComment: `${typeof ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${string}`]: string; - [reportDraftCommentNumberOfLines: `${typeof ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT_NUMBER_OF_LINES}${string}`]: number; - [reportIsComposerFull: `${typeof ONYXKEYS.COLLECTION.REPORT_IS_COMPOSER_FULL_SIZE}${string}`]: boolean; - [reportUserIsTyping: `${typeof ONYXKEYS.COLLECTION.REPORT_USER_IS_TYPING}${string}`]: boolean; - [securityGroup: `${typeof ONYXKEYS.COLLECTION.SECURITY_GROUP}${string}`]: OnyxTypes.SecurityGroup; - [transaction: `${typeof ONYXKEYS.COLLECTION.TRANSACTION}${string}`]: OnyxTypes.Transaction; + [ONYXKEYS.COLLECTION.DOWNLOAD]: OnyxTypes.Download; + [ONYXKEYS.COLLECTION.POLICY]: OnyxTypes.Policy; + [ONYXKEYS.COLLECTION.POLICY_MEMBERS]: OnyxTypes.PolicyMember; + [ONYXKEYS.COLLECTION.DEPRECATED_POLICY_MEMBER_LIST]: OnyxTypes.PolicyMember; + [ONYXKEYS.COLLECTION.WORKSPACE_INVITE_MEMBERS_DRAFT]: Record; + [ONYXKEYS.COLLECTION.REPORT]: OnyxTypes.Report; + [ONYXKEYS.COLLECTION.REPORT_ACTIONS]: OnyxTypes.ReportAction; + [ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS]: string; + [ONYXKEYS.COLLECTION.REPORT_ACTIONS_REACTIONS]: OnyxTypes.ReportActionReactions; + [ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT]: string; + [ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT_NUMBER_OF_LINES]: number; + [ONYXKEYS.COLLECTION.REPORT_IS_COMPOSER_FULL_SIZE]: boolean; + [ONYXKEYS.COLLECTION.REPORT_USER_IS_TYPING]: boolean; + [ONYXKEYS.COLLECTION.SECURITY_GROUP]: OnyxTypes.SecurityGroup; + [ONYXKEYS.COLLECTION.TRANSACTION]: OnyxTypes.Transaction; // Forms [ONYXKEYS.FORMS.ADD_DEBIT_CARD_FORM]: OnyxTypes.AddDebitCardForm; @@ -348,4 +348,4 @@ type OnyxValues = { }; export default ONYXKEYS; -export type {OnyxKey, OnyxValues}; +export type {OnyxKey, OnyxCollectionKey, OnyxValues}; From 4655faa43a27530eaa8f374fe6730d7d6e47346e Mon Sep 17 00:00:00 2001 From: dhairyasenjaliya Date: Thu, 3 Aug 2023 21:49:52 +0530 Subject: [PATCH 170/649] adjust border as per design --- src/styles/styles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/styles.js b/src/styles/styles.js index 108144e4afe6..29af3fdd7f74 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -565,7 +565,7 @@ const styles = { buttonDivider: { height: 28, - borderWidth: 1, + borderWidth: 0.7, borderColor: themeColors.text, }, From ca83e138eedfe0ca3ca57f55299e5b8ab7495e36 Mon Sep 17 00:00:00 2001 From: ginsuma <13113013+ginsuma@users.noreply.github.com> Date: Fri, 4 Aug 2023 14:57:26 +0700 Subject: [PATCH 171/649] Fix drop drag zone --- src/hooks/useDragAndDrop.js | 1 + .../ThreePaneView.js | 40 +++++++++---------- web/index.html | 10 +++++ 3 files changed, 30 insertions(+), 21 deletions(-) diff --git a/src/hooks/useDragAndDrop.js b/src/hooks/useDragAndDrop.js index 98df70085a72..bc8ab517731b 100644 --- a/src/hooks/useDragAndDrop.js +++ b/src/hooks/useDragAndDrop.js @@ -58,6 +58,7 @@ export default function useDragAndDrop({dropZone, onDrop = () => {}, shouldAllow } event.preventDefault(); + event.stopPropagation(); switch (event.type) { case DRAG_OVER_EVENT: diff --git a/src/libs/Navigation/AppNavigator/createResponsiveStackNavigator/ThreePaneView.js b/src/libs/Navigation/AppNavigator/createResponsiveStackNavigator/ThreePaneView.js index 2f9a899191bf..14b78752e62f 100644 --- a/src/libs/Navigation/AppNavigator/createResponsiveStackNavigator/ThreePaneView.js +++ b/src/libs/Navigation/AppNavigator/createResponsiveStackNavigator/ThreePaneView.js @@ -53,28 +53,26 @@ function ThreePaneView(props) { ); } if (route.name === NAVIGATORS.RIGHT_MODAL_NAVIGATOR) { - const Wrapper = props.state.index === i ? NoDropZone : React.Fragment; return ( - - - props.navigation.goBack()} - accessibilityLabel={translate('common.close')} - accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON} - /> - {props.descriptors[route.key].render()} - - + + props.navigation.goBack()} + accessibilityLabel={translate('common.close')} + accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON} + /> + {props.descriptors[route.key].render()} + ); } return ( diff --git a/web/index.html b/web/index.html index d207fa54b97a..16c907fe441b 100644 --- a/web/index.html +++ b/web/index.html @@ -136,4 +136,14 @@ + From ef896f7c17337061de04034b046bbc637ba7ffbc Mon Sep 17 00:00:00 2001 From: ojasjadhav2 <140224450+ojasjadhav2@users.noreply.github.com> Date: Sun, 6 Aug 2023 23:03:27 +0530 Subject: [PATCH 172/649] using props instead of spreading --- src/components/SwipeableView/index.native.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/SwipeableView/index.native.js b/src/components/SwipeableView/index.native.js index 6e96cfbbbc45..2f1148721af1 100644 --- a/src/components/SwipeableView/index.native.js +++ b/src/components/SwipeableView/index.native.js @@ -10,13 +10,13 @@ const propTypes = { onSwipeDown: PropTypes.func.isRequired, }; -function SwipeableView({children, onSwipeDown}) { +function SwipeableView(props) { const minimumPixelDistance = CONST.COMPOSER_MAX_HEIGHT; const oldYRef = useRef(0); const panResponder = useRef( PanResponder.create({ // The PanResponder gets focus only when the y-axis movement is over minimumPixelDistance - // & swip direction is downwards + // & swipe direction is downwards onMoveShouldSetPanResponderCapture: (_event, gestureState) => { if (gestureState.dy - oldYRef.current > 0 && gestureState.dy > minimumPixelDistance) { return true; @@ -25,13 +25,13 @@ function SwipeableView({children, onSwipeDown}) { }, // Calls the callback when the swipe down is released; after the completion of the gesture - onPanResponderRelease: onSwipeDown, + onPanResponderRelease: props.onSwipeDown, }), ).current; return ( // eslint-disable-next-line react/jsx-props-no-spreading - {children} + {props.children} ); } From 4eb4797e728fe644814f79d146ba6b8bad15582c Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Mon, 7 Aug 2023 10:32:33 +0200 Subject: [PATCH 173/649] Remove flipper-plugin-bridgespy-client package --- package-lock.json | 53 ++++++++++++++----------- package.json | 7 ++-- src/setup/platformSetup/index.native.js | 5 --- 3 files changed, 32 insertions(+), 33 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0ef6f796166d..6373f12ad672 100644 --- a/package-lock.json +++ b/package-lock.json @@ -183,7 +183,6 @@ "eslint-plugin-react-native-a11y": "^3.3.0", "eslint-plugin-storybook": "^0.5.13", "eslint-plugin-you-dont-need-lodash-underscore": "^6.12.0", - "flipper-plugin-bridgespy-client": "^0.1.9", "html-webpack-plugin": "^5.5.0", "jest": "29.4.1", "jest-circus": "29.4.1", @@ -206,7 +205,7 @@ "style-loader": "^2.0.0", "time-analytics-webpack-plugin": "^0.1.17", "type-fest": "^3.12.0", - "typescript": "^4.8.4", + "typescript": "^5.1.6", "wait-port": "^0.2.9", "webpack": "^5.76.0", "webpack-bundle-analyzer": "^4.5.0", @@ -21578,6 +21577,19 @@ "typescript": "^4.0.2" } }, + "node_modules/config-file-ts/node_modules/typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, "node_modules/confusing-browser-globals": { "version": "1.0.11", "dev": true, @@ -26519,16 +26531,6 @@ "dev": true, "license": "ISC" }, - "node_modules/flipper-plugin-bridgespy-client": { - "version": "0.1.9", - "dev": true, - "license": "MIT", - "peerDependencies": { - "react-native": ">=0.62.0", - "react-native-flipper": ">=0.54.0 <1.0.0", - "typescript": ">=3.5.0 <5.0.0" - } - }, "node_modules/flow-enums-runtime": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/flow-enums-runtime/-/flow-enums-runtime-0.0.5.tgz", @@ -42905,16 +42907,16 @@ } }, "node_modules/typescript": { - "version": "4.8.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", - "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/ua-parser-js": { @@ -59831,6 +59833,14 @@ "requires": { "glob": "^7.1.6", "typescript": "^4.0.2" + }, + "dependencies": { + "typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true + } } }, "confusing-browser-globals": { @@ -63185,11 +63195,6 @@ "version": "3.2.6", "dev": true }, - "flipper-plugin-bridgespy-client": { - "version": "0.1.9", - "dev": true, - "requires": {} - }, "flow-enums-runtime": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/flow-enums-runtime/-/flow-enums-runtime-0.0.5.tgz", @@ -74135,9 +74140,9 @@ } }, "typescript": { - "version": "4.8.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", - "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "dev": true }, "ua-parser-js": { diff --git a/package.json b/package.json index 1241875c10b9..2b6fd58ff47f 100644 --- a/package.json +++ b/package.json @@ -154,8 +154,8 @@ "@babel/preset-env": "^7.20.0", "@babel/preset-flow": "^7.12.13", "@babel/preset-react": "^7.10.4", - "@babel/runtime": "^7.20.0", "@babel/preset-typescript": "^7.21.5", + "@babel/runtime": "^7.20.0", "@electron/notarize": "^1.2.3", "@jest/globals": "^29.5.0", "@octokit/core": "4.0.4", @@ -175,12 +175,12 @@ "@svgr/webpack": "^6.0.0", "@testing-library/jest-native": "5.4.1", "@testing-library/react-native": "11.5.1", - "@types/metro-config": "^0.76.3", "@types/concurrently": "^7.0.0", "@types/jest": "^29.5.2", "@types/jest-when": "^3.5.2", "@types/js-yaml": "^4.0.5", "@types/lodash": "^4.14.195", + "@types/metro-config": "^0.76.3", "@types/mock-fs": "^4.13.1", "@types/pusher-js": "^5.1.0", "@types/react": "^18.2.12", @@ -222,7 +222,6 @@ "eslint-plugin-react-native-a11y": "^3.3.0", "eslint-plugin-storybook": "^0.5.13", "eslint-plugin-you-dont-need-lodash-underscore": "^6.12.0", - "flipper-plugin-bridgespy-client": "^0.1.9", "html-webpack-plugin": "^5.5.0", "jest": "29.4.1", "jest-circus": "29.4.1", @@ -245,7 +244,7 @@ "style-loader": "^2.0.0", "time-analytics-webpack-plugin": "^0.1.17", "type-fest": "^3.12.0", - "typescript": "^4.8.4", + "typescript": "^5.1.6", "wait-port": "^0.2.9", "webpack": "^5.76.0", "webpack-bundle-analyzer": "^4.5.0", diff --git a/src/setup/platformSetup/index.native.js b/src/setup/platformSetup/index.native.js index d164600c7706..470bef78848f 100644 --- a/src/setup/platformSetup/index.native.js +++ b/src/setup/platformSetup/index.native.js @@ -21,10 +21,5 @@ export default function () { PushNotification.init(); subscribeToReportCommentPushNotifications(); - // Setup Flipper plugins when on dev - if (__DEV__ && typeof jest === 'undefined') { - require('flipper-plugin-bridgespy-client'); - } - Performance.setupPerformanceObserver(); } From be53f5583b57c3793213049ad5525439a13b0290 Mon Sep 17 00:00:00 2001 From: Thiago Brezinski Date: Mon, 7 Aug 2023 15:00:29 +0100 Subject: [PATCH 174/649] fix(selection-list): add fallback to avatar --- src/components/SelectionList/CheckboxListItem.js | 10 ++++++---- src/components/SelectionList/selectionListPropTypes.js | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/SelectionList/CheckboxListItem.js b/src/components/SelectionList/CheckboxListItem.js index 5db163099625..77939a789640 100644 --- a/src/components/SelectionList/CheckboxListItem.js +++ b/src/components/SelectionList/CheckboxListItem.js @@ -1,6 +1,7 @@ import React from 'react'; import {View} from 'react-native'; import _ from 'underscore'; +import lodashGet from 'lodash/get'; import PressableWithFeedback from '../Pressable/PressableWithFeedback'; import styles from '../../styles/styles'; import Text from '../Text'; @@ -9,6 +10,7 @@ import Checkbox from '../Checkbox'; import Avatar from '../Avatar'; import OfflineWithFeedback from '../OfflineWithFeedback'; import useLocalize from '../../hooks/useLocalize'; +import CONST from '../../CONST'; function CheckboxListItem({item, isFocused = false, onSelectRow, onDismissError = () => {}}) { const {translate} = useLocalize(); @@ -39,12 +41,12 @@ function CheckboxListItem({item, isFocused = false, onSelectRow, onDismissError onPress={() => onSelectRow(item)} style={item.isDisabled ? styles.buttonOpacityDisabled : {}} /> - {item.avatar && ( + {Boolean(item.avatar) && ( )} diff --git a/src/components/SelectionList/selectionListPropTypes.js b/src/components/SelectionList/selectionListPropTypes.js index 2c65c9ce456c..eec81010c590 100644 --- a/src/components/SelectionList/selectionListPropTypes.js +++ b/src/components/SelectionList/selectionListPropTypes.js @@ -31,7 +31,7 @@ const checkboxListItemPropTypes = { /** Avatar for the user */ avatar: PropTypes.shape({ - source: PropTypes.oneOfType([PropTypes.string, PropTypes.func]), + source: PropTypes.oneOfType([PropTypes.string, PropTypes.func]).isRequired, name: PropTypes.string, type: PropTypes.string, }), From da61781850adafbec6cb6a9642bafee6b09c28ff Mon Sep 17 00:00:00 2001 From: Thiago Brezinski Date: Mon, 7 Aug 2023 15:49:43 +0100 Subject: [PATCH 175/649] feat(selection-list): add scroll indicator support --- src/components/SelectionList/BaseSelectionList.js | 3 ++- src/components/SelectionList/selectionListPropTypes.js | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/SelectionList/BaseSelectionList.js b/src/components/SelectionList/BaseSelectionList.js index 618d121739fa..5637d0f2eb63 100644 --- a/src/components/SelectionList/BaseSelectionList.js +++ b/src/components/SelectionList/BaseSelectionList.js @@ -46,6 +46,7 @@ function BaseSelectionList({ headerMessage = '', confirmButtonText = '', onConfirm, + showScrollIndicator = false, isKeyboardShown = false, }) { const {translate} = useLocalize(); @@ -354,7 +355,7 @@ function BaseSelectionList({ extraData={focusedIndex} indicatorStyle="white" keyboardShouldPersistTaps="always" - showsVerticalScrollIndicator={false} + showsVerticalScrollIndicator={showScrollIndicator} initialNumToRender={12} maxToRenderPerBatch={5} windowSize={5} diff --git a/src/components/SelectionList/selectionListPropTypes.js b/src/components/SelectionList/selectionListPropTypes.js index eec81010c590..f8d11e73c218 100644 --- a/src/components/SelectionList/selectionListPropTypes.js +++ b/src/components/SelectionList/selectionListPropTypes.js @@ -144,6 +144,9 @@ const propTypes = { /** Callback to fire when the confirm button is pressed */ onConfirm: PropTypes.func, + + /** Whether to show the vertical scroll indicator */ + showScrollIndicator: PropTypes.bool, }; export {propTypes, radioListItemPropTypes, checkboxListItemPropTypes}; From 98a5c4a0a362e45a22b77424f8e2fd599db3cc0f Mon Sep 17 00:00:00 2001 From: ntdiary <2471314@gmail.com> Date: Tue, 8 Aug 2023 02:49:20 +0800 Subject: [PATCH 176/649] rename patch filename --- ....patch => react-native+0.72.1+005+ModalKeyboardFlashing.patch} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename patches/{react-native+0.72.1+004+ModalKeyboardFlashing.patch => react-native+0.72.1+005+ModalKeyboardFlashing.patch} (100%) diff --git a/patches/react-native+0.72.1+004+ModalKeyboardFlashing.patch b/patches/react-native+0.72.1+005+ModalKeyboardFlashing.patch similarity index 100% rename from patches/react-native+0.72.1+004+ModalKeyboardFlashing.patch rename to patches/react-native+0.72.1+005+ModalKeyboardFlashing.patch From 638d0326c631c60838e75d6b8c29d67b36e22c22 Mon Sep 17 00:00:00 2001 From: dhairyasenjaliya Date: Tue, 8 Aug 2023 01:29:35 +0530 Subject: [PATCH 177/649] Added both size for dropDown option --- src/components/ButtonWithDropdownMenu.js | 25 +++++++++++++------ .../MoneyRequestConfirmationList.js | 2 ++ src/components/SettlementButton.js | 5 ++++ src/styles/StyleUtils.js | 17 +++++++++++++ src/styles/styles.js | 8 +----- 5 files changed, 43 insertions(+), 14 deletions(-) diff --git a/src/components/ButtonWithDropdownMenu.js b/src/components/ButtonWithDropdownMenu.js index e591099bdc39..4fd8c47f690e 100644 --- a/src/components/ButtonWithDropdownMenu.js +++ b/src/components/ButtonWithDropdownMenu.js @@ -10,6 +10,7 @@ import Icon from './Icon'; import * as Expensicons from './Icon/Expensicons'; import themeColors from '../styles/themes/default'; import CONST from '../CONST'; +import * as StyleUtils from '../styles/StyleUtils'; const propTypes = { /** Text to display for the menu header */ @@ -21,6 +22,9 @@ const propTypes = { /** Whether we should show a loading state for the main button */ isLoading: PropTypes.bool, + /** Whether the button size should be large */ + buttonsizelarge: PropTypes.bool, + /** Should the confirmation button be disabled? */ isDisabled: PropTypes.bool, @@ -46,6 +50,7 @@ const defaultProps = { isDisabled: false, menuHeaderText: '', style: [], + buttonsizelarge: false, }; function ButtonWithDropdownMenu(props) { @@ -55,6 +60,7 @@ function ButtonWithDropdownMenu(props) { const {windowWidth, windowHeight} = useWindowDimensions(); const caretButton = useRef(null); const selectedItem = props.options[selectedItemIndex]; + const innerStyleDropButton = StyleUtils.getButtonHeight(props.buttonsizelarge); useEffect(() => { if (!caretButton.current) { @@ -84,8 +90,9 @@ function ButtonWithDropdownMenu(props) { shouldRemoveRightBorderRadius style={[styles.flex1, styles.pr0]} pressOnEnter - medium - innerStyles={[styles.dropButtonHeight]} + large={props.buttonsizelarge} + medium={!props.buttonsizelarge} + innerStyles={[innerStyleDropButton]} />