Skip to content

Commit

Permalink
Merge pull request #9528 from Expensify/update-staging-from-main
Browse files Browse the repository at this point in the history
Update version to 1.1.78-6 on staging
  • Loading branch information
OSBotify authored Jun 22, 2022
2 parents 0778358 + 662ae1e commit 16f1b47
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 30 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001017805
versionName "1.1.78-5"
versionCode 1001017806
versionName "1.1.78-6"
}
splits {
abi {
Expand Down
55 changes: 33 additions & 22 deletions config/webpack/webpack.dev.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,45 @@
const path = require('path');
const portfinder = require('portfinder');
const {DefinePlugin} = require('webpack');
const {merge} = require('webpack-merge');
const getCommonConfig = require('./webpack.common');

const BASE_PORT = 8080;

/**
* Configuration for the local dev server
* @param {Object} env
* @returns {Configuration}
*/
module.exports = (env = {}) => {
// Check if the USE_WEB_PROXY variable has been provided
// and rewrite any requests to the local proxy server
const proxySettings = process.env.USE_WEB_PROXY === 'false'
? {}
: {
proxy: {
'/api': 'http://[::1]:9000',
'/chat-attachments': 'http://[::1]:9000',
},
};
module.exports = (env = {}) => portfinder.getPortPromise({port: BASE_PORT})
.then((port) => {
// Check if the USE_WEB_PROXY variable has been provided
// and rewrite any requests to the local proxy server
const proxySettings = process.env.USE_WEB_PROXY === 'false'
? {}
: {
proxy: {
'/api': 'http://[::1]:9000',
'/chat-attachments': 'http://[::1]:9000',
},
};

const baseConfig = getCommonConfig(env);
const baseConfig = getCommonConfig(env);

return merge(baseConfig, {
mode: 'development',
devtool: 'eval-source-map',
devServer: {
contentBase: path.join(__dirname, '../../dist'),
hot: true,
...proxySettings,
historyApiFallback: true,
},
return merge(baseConfig, {
mode: 'development',
devtool: 'eval-source-map',
devServer: {
contentBase: path.join(__dirname, '../../dist'),
hot: true,
...proxySettings,
historyApiFallback: true,
port,
},
plugins: [
new DefinePlugin({
'process.env.PORT': port,
}),
],
});
});
};
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.1.78.5</string>
<string>1.1.78.6</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.1.78.5</string>
<string>1.1.78.6</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.1.78-5",
"version": "1.1.78-6",
"author": "Expensify, Inc.",
"homepage": "https://new.expensify.com",
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
Expand Down
1 change: 1 addition & 0 deletions src/CONFIG.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,5 @@ export default {
},
CAPTURE_METRICS: lodashGet(Config, 'CAPTURE_METRICS', 'false') === 'true',
ONYX_METRICS: lodashGet(Config, 'ONYX_METRICS', 'false') === 'true',
DEV_PORT: process.env.PORT || 8080,
};
4 changes: 4 additions & 0 deletions src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ const CONST = {
CFPB_PREPAID_URL: 'https://cfpb.gov/prepaid',
STAGING_SECURE_URL: 'https://staging-secure.expensify.com/',
STAGING_NEW_EXPENSIFY_URL: 'https://staging.new.expensify.com',

// Use Environment.getEnvironmentURL to get the complete URL with port number
DEV_NEW_EXPENSIFY_URL: 'http://localhost:',

OPTION_TYPE: {
REPORT: 'report',
PERSONAL_DETAIL: 'personalDetail',
Expand Down
20 changes: 20 additions & 0 deletions src/libs/Environment/Environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ import Config from 'react-native-config';
import lodashGet from 'lodash/get';
import CONST from '../../CONST';
import getEnvironment from './getEnvironment';
import CONFIG from '../../CONFIG';

const ENVIRONMENT_URLS = {
[CONST.ENVIRONMENT.DEV]: CONST.DEV_NEW_EXPENSIFY_URL + CONFIG.DEV_PORT,
[CONST.ENVIRONMENT.STAGING]: CONST.STAGING_NEW_EXPENSIFY_URL,
[CONST.ENVIRONMENT.PRODUCTION]: CONST.NEW_EXPENSIFY_URL,
};

/**
* Are we running the app in development?
Expand All @@ -12,7 +19,20 @@ function isDevelopment() {
return lodashGet(Config, 'ENVIRONMENT', CONST.ENVIRONMENT.DEV) === CONST.ENVIRONMENT.DEV;
}

/**
* Get the URL based on the environment we are in
*
* @returns {Promise}
*/
function getEnvironmentURL() {
return new Promise((resolve) => {
getEnvironment()
.then(environment => resolve(ENVIRONMENT_URLS[environment]));
});
}

export {
getEnvironment,
isDevelopment,
getEnvironmentURL,
};
12 changes: 10 additions & 2 deletions src/pages/home/report/ContextMenu/ContextMenuActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import getAttachmentDetails from '../../../../libs/fileDownload/getAttachmentDet
import fileDownload from '../../../../libs/fileDownload';
import addEncryptedAuthTokenToURL from '../../../../libs/addEncryptedAuthTokenToURL';
import * as ContextMenuUtils from './ContextMenuUtils';
import * as Environment from '../../../../libs/Environment/Environment';

/**
* Gets the HTML version of the message in an action.
Expand Down Expand Up @@ -120,8 +121,15 @@ export default [
{
textTranslateKey: 'reportActionContextMenu.copyLink',
icon: Expensicons.LinkCopy,
shouldShow: () => false,
onPress: () => {},
shouldShow: () => true,
onPress: (closePopover, {reportAction, reportID}) => {
Environment.getEnvironmentURL()
.then((environmentURL) => {
const reportActionID = parseInt(lodashGet(reportAction, 'reportActionID'), 10);
Clipboard.setString(`${environmentURL}/r/${reportID}/${reportActionID}`);
});
hideContextMenu(true, ReportActionComposeFocusManager.focus);
},
getDescription: () => {},
},

Expand Down

0 comments on commit 16f1b47

Please sign in to comment.