From 34b37213fa62684e6166406963f4cb754e0498d8 Mon Sep 17 00:00:00 2001 From: Andrew Rosiclair Date: Mon, 8 Aug 2022 15:40:37 -0400 Subject: [PATCH 1/2] added concierge url to config --- src/CONFIG.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/CONFIG.js b/src/CONFIG.js index df13eb629ec0..a60b17e1e75b 100644 --- a/src/CONFIG.js +++ b/src/CONFIG.js @@ -17,6 +17,7 @@ const secureExpensifyUrl = Url.addTrailingForwardSlash(lodashGet( const useNgrok = lodashGet(Config, 'USE_NGROK', 'false') === 'true'; const useWebProxy = lodashGet(Config, 'USE_WEB_PROXY', 'true') === 'true'; const expensifyComWithProxy = getPlatform() === 'web' && useWebProxy ? '/' : expensifyURL; +const conciergeUrl = `${expensifyURL}concierge/`; // Throw errors on dev if config variables are not set correctly if (ENVIRONMENT === CONST.ENVIRONMENT.DEV) { @@ -48,6 +49,7 @@ export default { PARTNER_NAME: lodashGet(Config, 'EXPENSIFY_PARTNER_NAME', 'chat-expensify-com'), PARTNER_PASSWORD: lodashGet(Config, 'EXPENSIFY_PARTNER_PASSWORD', 'e21965746fd75f82bb66'), EXPENSIFY_CASH_REFERER: 'ecash', + CONCIERGE_URL: conciergeUrl, }, IS_IN_PRODUCTION: Platform.OS === 'web' ? process.env.NODE_ENV === 'production' : !__DEV__, IS_USING_LOCAL_WEB: useNgrok || expensifyURLRoot.includes('dev'), From 3f9f8a869ef02e5e3c08edb8c64bf3cc5afe354f Mon Sep 17 00:00:00 2001 From: Andrew Rosiclair Date: Mon, 8 Aug 2022 15:41:32 -0400 Subject: [PATCH 2/2] stopped using old dot link handling for concierge links --- .../HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js b/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js index 0553b51cf650..e93ba851d996 100644 --- a/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js +++ b/src/components/HTMLEngineProvider/HTMLRenderers/AnchorRenderer.js @@ -24,7 +24,9 @@ const AnchorRenderer = (props) => { const attrHref = htmlAttribs.href || ''; const internalNewExpensifyPath = (attrHref.startsWith(CONST.NEW_EXPENSIFY_URL) && attrHref.replace(CONST.NEW_EXPENSIFY_URL, '')) || (attrHref.startsWith(CONST.STAGING_NEW_EXPENSIFY_URL) && attrHref.replace(CONST.STAGING_NEW_EXPENSIFY_URL, '')); - const internalExpensifyPath = attrHref.startsWith(CONFIG.EXPENSIFY.EXPENSIFY_URL) && attrHref.replace(CONFIG.EXPENSIFY.EXPENSIFY_URL, ''); + const internalExpensifyPath = attrHref.startsWith(CONFIG.EXPENSIFY.EXPENSIFY_URL) + && !attrHref.startsWith(CONFIG.EXPENSIFY.CONCIERGE_URL) + && attrHref.replace(CONFIG.EXPENSIFY.EXPENSIFY_URL, ''); // If we are handling a New Expensify link then we will assume this should be opened by the app internally. This ensures that the links are opened internally via react-navigation // instead of in a new tab or with a page refresh (which is the default behavior of an anchor tag) @@ -39,7 +41,7 @@ const AnchorRenderer = (props) => { ); } - // If we are handling an old dot Expensify link we need to open it with openOldDotLink() so we can navigate to it with the user already logged in. + // If we are handling an old dot Expensify link (excluding Concierge) we need to open it with openOldDotLink() so we can navigate to it with the user already logged in. // As attachments also use expensify.com we don't want it working the same as links. if (internalExpensifyPath && !isAttachment) { return (