Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/tienifr/App into fix/43064
Browse files Browse the repository at this point in the history
  • Loading branch information
tienifr committed Jun 10, 2024
2 parents d7f1ae6 + 7540b95 commit 02a44ff
Show file tree
Hide file tree
Showing 360 changed files with 5,202 additions and 2,290 deletions.
15 changes: 14 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,21 @@ module.exports = {
],
},

// Remove once no JS files are left
overrides: [
// Enforces every Onyx type and its properties to have a comment explaining its purpose.
{
files: ['src/types/onyx/**/*.ts'],
rules: {
'jsdoc/require-jsdoc': [
'error',
{
contexts: ['TSInterfaceDeclaration', 'TSTypeAliasDeclaration', 'TSPropertySignature'],
},
],
},
},

// Remove once no JS files are left
{
files: ['*.js', '*.jsx'],
rules: {
Expand Down
35 changes: 35 additions & 0 deletions .github/scripts/printPodspec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env ruby

# This file is a lightweight port of the `pod ipc spec` command.
# It was built from scratch to imports some 3rd party functions before reading podspecs

require 'cocoapods'
require 'json'

# Require 3rd party functions needed to parse podspecs. This code is copied from ios/Podfile
def node_require(script)
# Resolve script with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
"require.resolve(
'#{script}',
{paths: [process.argv[1]]},
)", __dir__]).strip
end
node_require('react-native/scripts/react_native_pods.rb')
node_require('react-native-permissions/scripts/setup.rb')

# Configure pod in silent mode
Pod::Config.instance.silent = true

# Process command-line arguments
podspec_files = ARGV

# Validate each podspec file
podspec_files.each do |podspec_file|
begin
spec = Pod::Specification.from_file(podspec_file)
puts(spec.to_pretty_json)
rescue => e
STDERR.puts "Failed to validate #{podspec_file}: #{e.message}"
end
end
50 changes: 28 additions & 22 deletions .github/scripts/verifyPodfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@ source scripts/shellUtils.sh

title "Verifying that Podfile.lock is synced with the project"

declare EXIT_CODE=0
# Cleanup and exit
# param - status code
function cleanupAndExit {
cd "$START_DIR" || exit 1
exit "$1"
}

# Check Provisioning Style. If automatic signing is enabled, iOS builds will fail, so ensure we always have the proper profile specified
info "Verifying that automatic signing is not enabled"
if grep -q 'PROVISIONING_PROFILE_SPECIFIER = "(NewApp) AppStore"' ios/NewExpensify.xcodeproj/project.pbxproj; then
success "Automatic signing not enabled"
else
error "Error: Automatic provisioning style is not allowed!"
EXIT_CODE=1
cleanupAndExit 1
fi

PODFILE_SHA=$(openssl sha1 ios/Podfile | awk '{print $2}')
Expand All @@ -29,7 +34,7 @@ if [[ "$PODFILE_SHA" == "$PODFILE_LOCK_SHA" ]]; then
success "Podfile checksum verified!"
else
error "Podfile.lock checksum mismatch. Did you forget to run \`npx pod-install\`?"
EXIT_CODE=1
cleanupAndExit 1
fi

info "Ensuring correct version of cocoapods is used..."
Expand All @@ -45,45 +50,46 @@ if [[ "$POD_VERSION_FROM_GEMFILE" == "$POD_VERSION_FROM_PODFILE_LOCK" ]]; then
success "Cocoapods version from Podfile.lock matches cocoapods version from Gemfile"
else
error "Cocoapods version from Podfile.lock does not match cocoapods version from Gemfile. Please use \`npm run pod-install\` or \`bundle exec pod install\` instead of \`pod install\` to install pods."
EXIT_CODE=1
cleanupAndExit 1
fi

info "Comparing Podfile.lock with node packages..."

# Retrieve a list of podspec directories as listed in the Podfile.lock
SPEC_DIRS=$(yq '.["EXTERNAL SOURCES"].[].":path" | select( . == "*node_modules*")' < ios/Podfile.lock)
if ! SPEC_DIRS=$(yq '.["EXTERNAL SOURCES"].[].":path" | select( . == "*node_modules*")' < ios/Podfile.lock); then
error "Error: Could not parse podspec directories from Podfile.lock"
cleanupAndExit 1
fi

if ! read_lines_into_array PODSPEC_PATHS < <(npx react-native config | jq --raw-output '.dependencies[].platforms.ios.podspecPath | select ( . != null)'); then
error "Error: could not parse podspec paths from react-native config command"
cleanupAndExit 1
fi

# Format a list of Pods based on the output of the config command
FORMATTED_PODS=$( \
jq --raw-output --slurp 'map((.name + " (" + .version + ")")) | .[]' <<< "$( \
npx react-native config | \
jq '.dependencies[].platforms.ios.podspecPath | select( . != null )' | \
xargs -L 1 pod ipc spec --silent
)"
)
if ! FORMATTED_PODS=$( \
jq --raw-output --slurp 'map((.name + " (" + .version + ")")) | .[]' <<< "$(./.github/scripts/printPodspec.rb "${PODSPEC_PATHS[@]}")" \
); then
error "Error: could not parse podspecs at paths parsed from react-native config"
cleanupAndExit 1
fi

# Check for uncommitted package removals
# If they are listed in Podfile.lock but the directories don't exist they have been removed
while read -r DIR; do
if [[ ! -d "${DIR#../}" ]]; then
error "Directory \`${DIR#../node_modules/}\` not found in node_modules. Did you forget to run \`npx pod-install\` after removing the package?"
EXIT_CODE=1
cleanupAndExit 1
fi
done <<< "$SPEC_DIRS"

# Check for uncommitted package additions/updates
while read -r POD; do
if ! grep -q "$POD" ./ios/Podfile.lock; then
error "$POD not found in Podfile.lock. Did you forget to run \`npx pod-install\`?"
EXIT_CODE=1
cleanupAndExit 1
fi
done <<< "$FORMATTED_PODS"

if [[ "$EXIT_CODE" == 0 ]]; then
success "Podfile.lock is up to date."
fi

# Cleanup
cd "$START_DIR" || exit 1

exit $EXIT_CODE
success "Podfile.lock is up to date."
cleanupAndExit 0
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ local.properties
android/app/src/main/java/com/expensify/chat/generated/
.cxx/

# VIM
*.swp
*.swo
*~

# Vscode
.vscode

Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.13.0
20.14.0
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001047910
versionName "1.4.79-10"
versionCode 1001048017
versionName "1.4.80-17"
// Supported language variants must be declared here to avoid from being removed during the compilation.
// This also helps us to not include unnecessary language variants in the APK.
resConfigs "en", "es"
Expand Down
14 changes: 14 additions & 0 deletions assets/images/credit-card-exclamation.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 18 additions & 1 deletion assets/images/emptystate__routepending.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions assets/images/inbox.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions assets/images/money-search.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,18 @@ Just update the content for each variable accordingly or remove it if the inform
Assume that we want to rename the article `The Free Plan` to `Freemium Features` for the hub `billing and plan types` in New Expensify platform.
1. Go to `docs/articles/new-expensify/billing-and-plan-types`
2. Rename `The-Free-Plan.md` to `Freemium-Features.md`. Use dashes for spaces in the file name.
3. Add an entry in redirects.csv for the old article pointing to the new article.

Note: It is important that the file has `.md` extension.

# How to hide an article temporarily
Video demo available [here 🧵](https://expensify.slack.com/archives/C02NK2DQWUX/p1717772272605829?thread_ts=1717523271.137469&cid=C02NK2DQWUX).
1. Open github's in built code editor by pressing `.` on your keyboard. ([instructions here](https://docs.github.com/en/codespaces/the-githubdev-web-based-editor#opening-the-githubdev-editor))
2. Go to the article that you want to hide `docs/articles/...`.
3. Drag and drop the article inside the hidden folder `docs/Hidden/`.
4. Add a redirect for it in `docs/redirects.csv` to ensure that we don't have broken links. You can choose to point it to the home page or the article's hub.
5. Commit the changes and raise a PR.

# How the site is deployed
This site is hosted on Cloudflare pages. Whenever code is merged to main, the github action `deployExpensifyHelp` will run.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: Add custom fields to reports and invoices
description: Customize the fields that appear on a report or an invoice
---
<div id="expensify-classic" markdown="1">

Workspace Admins can add additional required fields to a report to include selections for project names, locations, trip information, and more.

{% include info.html %}
You cannot create these report fields directly in Expensify if you are connected to an accounting integration (QuickBooks Online, QuickBooks Desktop, Intacct, Xero, or NetSuite). Please refer to the relevant article for instructions on creating fields within that system.
{% include end-info.html %}

To create a custom field for a report,

1. Hover over Settings and select **Workspaces**.
2. Select the desired workspace.
3. Click the **Reports** tab on the left.
4. Scroll down to the Report and Invoice Fields section.
5. Under Add New Field, enter a Field Title.
6. Click the dropdown for the Type field and select the desired selection method:
- **Text**: Provides a text box to type in the requested information.
- **Dropdown**: Provides a dropdown of options to choose from.
- **Date**: Opens a calendar to select a date.
7. Select the report type: **Expense Report** or **Invoice**.
8. Click **Add**.

</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: Set default report title
description: Set an automatic title for all reports
---
<div id="expensify-classic" markdown="1">

Workspace Admins can set a default report title for all reports created under a specific workspace. If desired, these titles can also be enforced to prevent employees from changing them.

1. Hover over Settings and select **Workspaces**.
2. Select the desired workspace.
3. Click the **Reports** tab on the left.
4. Scroll down to the Default Report Title section.
5. Configure the formula. You can use the example provided on the page as a guide or choose from more [report formula options](https://help.expensify.com/articles/expensify-classic/spending-insights/Custom-Templates).
- Some formulas will automatically update the report title as changes are made to the report. For example, any formula related to dates, total amounts, workspace name, would adjust the title before the report is submitted for approval. Changes will not retroactively update report titles for reports which have been Approved or Reimbursed.
6. If desired, enable the Enforce Default Report Title toggle. This will prevent employees from editing the default title.

</div>
6 changes: 0 additions & 6 deletions docs/articles/new-expensify/travel/Coming-Soon.md

This file was deleted.

4 changes: 2 additions & 2 deletions ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.4.79</string>
<string>1.4.80</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -40,7 +40,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.4.79.10</string>
<string>1.4.80.17</string>
<key>FullStory</key>
<dict>
<key>OrgId</key>
Expand Down
4 changes: 2 additions & 2 deletions ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.4.79</string>
<string>1.4.80</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.4.79.10</string>
<string>1.4.80.17</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions ios/NotificationServiceExtension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundleShortVersionString</key>
<string>1.4.79</string>
<string>1.4.80</string>
<key>CFBundleVersion</key>
<string>1.4.79.10</string>
<string>1.4.80.17</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
Expand Down
Loading

0 comments on commit 02a44ff

Please sign in to comment.