Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/dukenv0307/App into fix/21392
Browse files Browse the repository at this point in the history
  • Loading branch information
dukenv0307 committed Jan 11, 2024
2 parents a6c1687 + 7517d74 commit 3b93bf2
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 13 deletions.
8 changes: 5 additions & 3 deletions src/components/SignInButtons/AppleSignIn/index.website.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React, {useEffect, useState} from 'react';
import Config, {NativeConfig} from 'react-native-config';
import type {NativeConfig} from 'react-native-config';
import Config from 'react-native-config';
import getUserLanguage from '@components/SignInButtons/GetUserLanguage';
import withNavigationFocus, {WithNavigationFocusProps} from '@components/withNavigationFocus';
import type {WithNavigationFocusProps} from '@components/withNavigationFocus';
import withNavigationFocus from '@components/withNavigationFocus';
import Log from '@libs/Log';
import * as Session from '@userActions/Session';
import CONFIG from '@src/CONFIG';
import CONST from '@src/CONST';
import {AppleIDSignInOnFailureEvent, AppleIDSignInOnSuccessEvent} from '@src/types/modules/dom';
import type {AppleIDSignInOnFailureEvent, AppleIDSignInOnSuccessEvent} from '@src/types/modules/dom';

// react-native-config doesn't trim whitespace on iOS for some reason so we
// add a trim() call to lodashGet here to prevent headaches.
Expand Down
2 changes: 1 addition & 1 deletion src/components/SignInButtons/GetUserLanguage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ValueOf} from 'type-fest';
import type {ValueOf} from 'type-fest';

const localeCodes = {
en: 'en_US',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import useThemeStyles from '@hooks/useThemeStyles';
import * as Session from '@userActions/Session';
import CONFIG from '@src/CONFIG';
import CONST from '@src/CONST';
import Response from '@src/types/modules/google';
import type Response from '@src/types/modules/google';

type GoogleSignInProps = {
isDesktopFlow?: boolean;
Expand Down
6 changes: 3 additions & 3 deletions src/components/SignInButtons/IconButton.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react';
import {ValueOf} from 'type-fest';
import type {ValueOf} from 'type-fest';
import Icon from '@components/Icon';
import * as Expensicons from '@components/Icon/Expensicons';
import PressableWithoutFeedback from '@components/Pressable/PressableWithoutFeedback';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import CONST from '@src/CONST';
import {TranslationPaths} from '@src/languages/types';
import IconAsset from '@src/types/utils/IconAsset';
import type {TranslationPaths} from '@src/languages/types';
import type IconAsset from '@src/types/utils/IconAsset';

const providerData = {
[CONST.SIGN_IN_METHOD.APPLE]: {
Expand Down
4 changes: 2 additions & 2 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1778,7 +1778,7 @@ export default {
messages: {
created: ({title}: TaskCreatedActionParams) => `tarea para ${title}`,
completed: 'marcada como completa',
canceled: 'tarea eliminado',
canceled: 'tarea eliminada',
reopened: 'marcada como incompleta',
error: 'No tiene permiso para realizar la acción solicitada.',
},
Expand Down Expand Up @@ -2416,7 +2416,7 @@ export default {
deletedMessage: '[Mensaje eliminado]',
deletedRequest: '[Pedido eliminado]',
reversedTransaction: '[Transacción anulada]',
deletedTask: '[Tarea eliminado]',
deletedTask: '[Tarea eliminada]',
hiddenMessage: '[Mensaje oculto]',
},
threads: {
Expand Down
8 changes: 6 additions & 2 deletions src/pages/RoomInvitePage.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import {parsePhoneNumber} from 'awesome-phonenumber';

Check failure on line 1 in src/pages/RoomInvitePage.js

View workflow job for this annotation

GitHub Actions / lint

'parsePhoneNumber' import from 'awesome-phonenumber' is restricted. Please use '@libs/PhoneNumber' instead
import Str from 'expensify-common/lib/str';
import lodashGet from 'lodash/get';
import PropTypes from 'prop-types';
import React, {useCallback, useEffect, useMemo, useState} from 'react';
Expand All @@ -13,6 +15,7 @@ import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import compose from '@libs/compose';
import * as DeviceCapabilities from '@libs/DeviceCapabilities';
import * as LoginUtils from '@libs/LoginUtils';
import Navigation from '@libs/Navigation/Navigation';
import * as OptionsListUtils from '@libs/OptionsListUtils';
import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils';
Expand Down Expand Up @@ -102,8 +105,9 @@ function RoomInvitePage(props) {
filterSelectedOptions = _.filter(selectedOptions, (option) => {
const accountID = lodashGet(option, 'accountID', null);
const isOptionInPersonalDetails = _.some(personalDetails, (personalDetail) => personalDetail.accountID === accountID);

const isPartOfSearchTerm = option.text.toLowerCase().includes(searchTerm.trim().toLowerCase());
const parsedPhoneNumber = parsePhoneNumber(LoginUtils.appendCountryCode(Str.removeSMSDomain(searchTerm)));
const searchValue = parsedPhoneNumber.possible ? parsedPhoneNumber.number.e164 : searchTerm.toLowerCase();
const isPartOfSearchTerm = option.text.toLowerCase().includes(searchValue) || option.login.toLowerCase().includes(searchValue);
return isPartOfSearchTerm || isOptionInPersonalDetails;
});
}
Expand Down
7 changes: 6 additions & 1 deletion src/pages/workspace/WorkspaceInvitePage.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import {parsePhoneNumber} from 'awesome-phonenumber';

Check failure on line 1 in src/pages/workspace/WorkspaceInvitePage.js

View workflow job for this annotation

GitHub Actions / lint

'parsePhoneNumber' import from 'awesome-phonenumber' is restricted. Please use '@libs/PhoneNumber' instead
import Str from 'expensify-common/lib/str';
import lodashGet from 'lodash/get';
import PropTypes from 'prop-types';
import React, {useEffect, useMemo, useState} from 'react';
Expand All @@ -14,6 +16,7 @@ import useNetwork from '@hooks/useNetwork';
import useThemeStyles from '@hooks/useThemeStyles';
import compose from '@libs/compose';
import * as DeviceCapabilities from '@libs/DeviceCapabilities';
import * as LoginUtils from '@libs/LoginUtils';
import Navigation from '@libs/Navigation/Navigation';
import * as OptionsListUtils from '@libs/OptionsListUtils';
import * as PolicyUtils from '@libs/PolicyUtils';
Expand Down Expand Up @@ -141,8 +144,10 @@ function WorkspaceInvitePage(props) {
filterSelectedOptions = _.filter(selectedOptions, (option) => {
const accountID = lodashGet(option, 'accountID', null);
const isOptionInPersonalDetails = _.some(personalDetails, (personalDetail) => personalDetail.accountID === accountID);
const parsedPhoneNumber = parsePhoneNumber(LoginUtils.appendCountryCode(Str.removeSMSDomain(searchTerm)));
const searchValue = parsedPhoneNumber.possible ? parsedPhoneNumber.number.e164 : searchTerm.toLowerCase();

const isPartOfSearchTerm = option.text.toLowerCase().includes(searchTerm.trim().toLowerCase());
const isPartOfSearchTerm = option.text.toLowerCase().includes(searchValue) || option.login.toLowerCase().includes(searchValue);
return isPartOfSearchTerm || isOptionInPersonalDetails;
});
}
Expand Down

0 comments on commit 3b93bf2

Please sign in to comment.