From 3e1157793675887f1c28b48c682253f7786fcd13 Mon Sep 17 00:00:00 2001 From: OSBotify <76178356+OSBotify@users.noreply.github.com> Date: Wed, 12 Oct 2022 17:51:53 -0400 Subject: [PATCH 1/2] Merge pull request #11779 from Expensify/version-BUILD-AC364366-0D69-4922-9F1A-F644BDAA4429 Update version to 1.2.13-4 on main (cherry picked from commit d0f0dd5ee7b88bf31d544f758ab7cfba88c6f0c0) --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NewExpensifyTests/Info.plist | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 278421a2be97..a88692d6c6ca 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -156,8 +156,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001021303 - versionName "1.2.13-3" + versionCode 1001021304 + versionName "1.2.13-4" buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() if (isNewArchitectureEnabled()) { diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 285967c2f72b..db4b5e437f76 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -30,7 +30,7 @@ CFBundleVersion - 1.2.13.3 + 1.2.13.4 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index b29fae685837..b6f67260986b 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.2.13.3 + 1.2.13.4 diff --git a/package-lock.json b/package-lock.json index 7d6fb1e90e88..2e0bf0bd9873 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "1.2.13-3", + "version": "1.2.13-4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "1.2.13-3", + "version": "1.2.13-4", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 60c7d098af77..f803c74d578f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.2.13-3", + "version": "1.2.13-4", "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.", From 2ab566f80d2192ab65dbb3992d85b99ebe4a1fd7 Mon Sep 17 00:00:00 2001 From: Alexander Mechler Date: Wed, 12 Oct 2022 14:44:12 -0700 Subject: [PATCH 2/2] Merge pull request #11774 from Expensify/amechler-make-me-admin-transition (cherry picked from commit 3a6fe306624b0acb75acc3d16bfb69a1b9382eba) --- src/libs/actions/App.js | 7 ++++++- src/libs/actions/Policy.js | 7 ++++++- src/pages/workspace/WorkspaceMembersPage.js | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/libs/actions/App.js b/src/libs/actions/App.js index 265de152b3d5..faa7fe87f5d3 100644 --- a/src/libs/actions/App.js +++ b/src/libs/actions/App.js @@ -188,11 +188,16 @@ function setUpPoliciesAndNavigate(session) { const url = new URL(currentUrl); const exitTo = url.searchParams.get('exitTo'); + // Approved Accountants and Guides can enter a flow where they make a workspace for other users, + // and those are passed as a search parameter when using transition links + const ownerEmail = url.searchParams.get('ownerEmail'); + const makeMeAdmin = url.searchParams.get('makeMeAdmin'); + const shouldCreateFreePolicy = !isLoggingInAsNewUser && Str.startsWith(url.pathname, Str.normalizeUrl(ROUTES.TRANSITION_FROM_OLD_DOT)) && exitTo === ROUTES.WORKSPACE_NEW; if (shouldCreateFreePolicy) { - Policy.createWorkspace(); + Policy.createWorkspace(ownerEmail, makeMeAdmin); return; } if (!isLoggingInAsNewUser && exitTo) { diff --git a/src/libs/actions/Policy.js b/src/libs/actions/Policy.js index fc3cd7dda1bd..d5901d68918d 100644 --- a/src/libs/actions/Policy.js +++ b/src/libs/actions/Policy.js @@ -764,8 +764,11 @@ function generatePolicyID() { /** * Optimistically creates a new workspace and default workspace chats + * + * @param {String} [ownerEmail] Optional, the email of the account to make the owner of the policy + * @param {Boolean} [makeMeAdmin] Optional, leave the calling account as an admin on the policy */ -function createWorkspace() { +function createWorkspace(ownerEmail = '', makeMeAdmin = false) { const policyID = generatePolicyID(); const workspaceName = generateDefaultWorkspaceName(); @@ -786,6 +789,8 @@ function createWorkspace() { announceChatReportID, adminsChatReportID, expenseChatReportID, + ownerEmail, + makeMeAdmin, policyName: workspaceName, type: CONST.POLICY.TYPE.FREE, }, diff --git a/src/pages/workspace/WorkspaceMembersPage.js b/src/pages/workspace/WorkspaceMembersPage.js index 0b3f12570340..5e00fdce8cea 100644 --- a/src/pages/workspace/WorkspaceMembersPage.js +++ b/src/pages/workspace/WorkspaceMembersPage.js @@ -267,7 +267,7 @@ class WorkspaceMembersPage extends React.Component { }} /> - {this.props.session.email === item.login && ( + {(this.props.session.email === item.login || item.role === 'admin') && (