Skip to content

Commit

Permalink
Merge branch 'main' into ts-migration/activeClientManager-lib
Browse files Browse the repository at this point in the history
  • Loading branch information
VickyStash committed Oct 5, 2023
2 parents ab134ae + 7f7b424 commit 418ebf3
Show file tree
Hide file tree
Showing 908 changed files with 33,097 additions and 11,353 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ USE_WEB_PROXY=false
USE_WDYR=false
CAPTURE_METRICS=false
ONYX_METRICS=false
GOOGLE_GEOLOCATION_API_KEY=AIzaSyBqg6bMvQU7cPWDKhhzpYqJrTEnSorpiLI

EXPENSIFY_ACCOUNT_ID_ACCOUNTING=-1
EXPENSIFY_ACCOUNT_ID_ADMIN=-1
Expand Down
1 change: 1 addition & 0 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ PUSHER_APP_KEY=268df511a204fbb60884
USE_WEB_PROXY=false
ENVIRONMENT=production
SEND_CRASH_REPORTS=true
GOOGLE_GEOLOCATION_API_KEY=AIzaSyBFKujMpzExz0_z2pAGfPUwkmlaUc-uw1Q
1 change: 1 addition & 0 deletions .env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ PUSHER_APP_KEY=268df511a204fbb60884
USE_WEB_PROXY=false
ENVIRONMENT=staging
SEND_CRASH_REPORTS=true
GOOGLE_GEOLOCATION_API_KEY=AIzaSyD2T1mlByThbUN88O8OPOD8vKuMMwLD4-M
6 changes: 5 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const restrictedImportPatterns = [
];

module.exports = {
extends: ['expensify', 'plugin:storybook/recommended', 'plugin:react-hooks/recommended', 'prettier', 'plugin:react-native-a11y/basic'],
extends: ['expensify', 'plugin:storybook/recommended', 'plugin:react-hooks/recommended', 'plugin:react-native-a11y/basic', 'prettier'],
plugins: ['react-hooks', 'react-native-a11y'],
parser: 'babel-eslint',
ignorePatterns: ['!.*', 'src/vendor', '.github/actions/**/index.js', 'desktop/dist/*.js', 'dist/*.js', 'node_modules/.bin/**', 'node_modules/.cache/**', '.git/**'],
Expand All @@ -38,6 +38,7 @@ module.exports = {
{
files: ['*.js', '*.jsx', '*.ts', '*.tsx'],
rules: {
'rulesdir/no-multiple-onyx-in-file': 'off',
'rulesdir/onyx-props-must-have-default': 'off',
'react-native-a11y/has-accessibility-hint': ['off'],
'react-native-a11y/has-valid-accessibility-descriptors': [
Expand Down Expand Up @@ -75,6 +76,7 @@ module.exports = {
patterns: restrictedImportPatterns,
},
],
curly: 'error',
},
},
{
Expand Down Expand Up @@ -161,6 +163,8 @@ module.exports = {
patterns: restrictedImportPatterns,
},
],
curly: 'error',
'you-dont-need-lodash-underscore/throttle': 'off',
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/Accessibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ What can we do to fix the issue?
<!---
Check off any platforms that are affected by this issue
--->
Which of our officially supported platforms is this issue occurring on?
Which of our officially supported platforms is this issue occurring on? Please only tick the box if you have provided a screen-recording in the thread for each platform:
- [ ] Android / native
- [ ] Android / Chrome
- [ ] iOS / native
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/composite/buildAndroidAPK/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ runs:

- uses: ruby/setup-ruby@eae47962baca661befdfd24e4d6c34ade04858f7
with:
ruby-version: '2.7'
ruby-version: "2.7"
bundler-cache: true

- uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef
Expand All @@ -26,4 +26,4 @@ runs:
uses: actions/upload-artifact@65d862660abb392b8c4a3d1195a2108db131dd05
with:
name: ${{ inputs.ARTIFACT_NAME }}
path: android/app/build/outputs/apk/e2eRelease/app-e2eRelease.apk
path: android/app/build/outputs/apk/e2e/release/app-e2e-release.apk
6 changes: 6 additions & 0 deletions .github/actions/javascript/getPullRequestDetails/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@ inputs:
outputs:
MERGE_COMMIT_SHA:
description: 'The merge_commit_sha of the given pull request'
HEAD_COMMIT_SHA:
description: 'The head_commit_sha of the given pull request'
MERGE_ACTOR:
description: 'The actor who merged the pull request'
IS_MERGED:
description: 'True if the pull request is merged'
FORKED_REPO_URL:
description: 'Output forked repo URL if PR includes changes from a fork'
runs:
using: 'node16'
main: './index.js'
53 changes: 39 additions & 14 deletions .github/scripts/createDocsRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@ const yaml = require('js-yaml');
const fs = require('fs');
const _ = require('underscore');

const warn = 'Number of hubs in _routes.yml does not match number of hubs in docs/articles. Please update _routes.yml with hub info.';
const warnMessage = (platform) => `Number of hubs in _routes.yml does not match number of hubs in docs/${platform}/articles. Please update _routes.yml with hub info.`;
const disclaimer = '# This file is auto-generated. Do not edit it directly. Use npm run createDocsRoutes instead.\n';
const docsDir = `${process.cwd()}/docs`;
const routes = yaml.load(fs.readFileSync(`${docsDir}/_data/_routes.yml`, 'utf8'));
const platformNames = {
expensifyClassic: 'expensify-classic',
newExpensify: 'new-expensify',
};

/**
* @param {String} str - The string to convert to title case
* @returns {String}
*/
function toTitleCase(str) {
return str.replace(/\w\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase());
return str.replace(/\w\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substr(1));
}

/**
Expand All @@ -28,7 +32,7 @@ function getArticleObj(filename) {
}

/**
* If the articlea / sections exist in the hub, then push the entry to the array.
* If the article / sections exist in the hub, then push the entry to the array.
* Otherwise, create the array and push the entry to it.
* @param {*} hubs - The hubs array
* @param {*} hub - The hub we are iterating
Expand All @@ -44,20 +48,20 @@ function pushOrCreateEntry(hubs, hub, key, entry) {
}
}

function run() {
const hubs = fs.readdirSync(`${docsDir}/articles`);
if (hubs.length !== routes.hubs.length) {
// If new hubs have been added without metadata addition to _routes.yml
console.error(warn);
process.exit(1);
}
/**
* Add articles and sections to hubs
* @param {Array} hubs - The hubs inside docs/articles/ for a platform
* @param {String} platformName - Expensify Classic or New Expensify
* @param {Array} routeHubs - The hubs insude docs/data/_routes.yml for a platform
*/
function createHubsWithArticles(hubs, platformName, routeHubs) {
_.each(hubs, (hub) => {
// Iterate through each directory in articles
fs.readdirSync(`${docsDir}/articles/${hub}`).forEach((fileOrFolder) => {
fs.readdirSync(`${docsDir}/articles/${platformName}/${hub}`).forEach((fileOrFolder) => {
// If the directory content is a markdown file, then it is an article
if (fileOrFolder.endsWith('.md')) {
const articleObj = getArticleObj(fileOrFolder);
pushOrCreateEntry(routes.hubs, hub, 'articles', articleObj);
pushOrCreateEntry(routeHubs, hub, 'articles', articleObj);
return;
}

Expand All @@ -66,17 +70,38 @@ function run() {
const articles = [];

// Each subfolder will be a section containing articles
fs.readdirSync(`${docsDir}/articles/${hub}/${section}`).forEach((subArticle) => {
fs.readdirSync(`${docsDir}/articles/${platformName}/${hub}/${section}`).forEach((subArticle) => {
articles.push(getArticleObj(subArticle));
});

pushOrCreateEntry(routes.hubs, hub, 'sections', {
pushOrCreateEntry(routeHubs, hub, 'sections', {
href: section,
title: toTitleCase(section.replaceAll('-', ' ')),
articles,
});
});
});
}

function run() {
const expensifyClassicArticleHubs = fs.readdirSync(`${docsDir}/articles/${platformNames.expensifyClassic}`);
const newExpensifyArticleHubs = fs.readdirSync(`${docsDir}/articles/${platformNames.newExpensify}`);

const expensifyClassicRoute = _.find(routes.platforms, (platform) => platform.href === platformNames.expensifyClassic);
const newExpensifyRoute = _.find(routes.platforms, (platform) => platform.href === platformNames.newExpensify);

if (expensifyClassicArticleHubs.length !== expensifyClassicRoute.hubs.length) {
console.error(warnMessage(platformNames.expensifyClassic));
process.exit(1);
}

if (newExpensifyArticleHubs.length !== newExpensifyRoute.hubs.length) {
console.error(warnMessage(platformNames.newExpensify));
process.exit(1);
}

createHubsWithArticles(expensifyClassicArticleHubs, platformNames.expensifyClassic, expensifyClassicRoute.hubs);
createHubsWithArticles(newExpensifyArticleHubs, platformNames.newExpensify, newExpensifyRoute.hubs);

// Convert the object to YAML and write it to the file
let yamlString = yaml.dump(routes);
Expand Down
Loading

0 comments on commit 418ebf3

Please sign in to comment.