From 1d55ee6849d59c5202a0c21d59ba5a90ece00b2e Mon Sep 17 00:00:00 2001 From: Ishpaul Singh Date: Wed, 13 Mar 2024 21:15:46 +0530 Subject: [PATCH 01/11] fixes the scroll issue --- .../workflows/WorkspaceWorkflowsPage.tsx | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx b/src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx index c6ace2b0856e..efb559a60844 100644 --- a/src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx +++ b/src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx @@ -1,6 +1,6 @@ import type {StackScreenProps} from '@react-navigation/stack'; import React, {useCallback, useEffect, useMemo} from 'react'; -import {FlatList, View} from 'react-native'; +import {View} from 'react-native'; import type {OnyxEntry} from 'react-native-onyx'; import {withOnyx} from 'react-native-onyx'; import * as Illustrations from '@components/Icon/Illustrations'; @@ -80,7 +80,7 @@ function WorkspaceWorkflowsPage({policy, betas, route, reimbursementAccount, ses const hasReimburserEmailError = !!policy?.errorFields?.reimburserEmail; return [ - ...(canUseDelayedSubmission + ...(!canUseDelayedSubmission ? [ { icon: Illustrations.ReceiptEnvelope, @@ -206,8 +206,8 @@ function WorkspaceWorkflowsPage({policy, betas, route, reimbursementAccount, ses session?.accountID, ]); - const renderOptionItem = ({item}: {item: ToggleSettingOptionRowProps}) => ( - + const renderOptionItem = (item: ToggleSettingOptionRowProps, index: number) => ( +
{translate('workflowsPage.workflowDescription')} - item.title} - /> + {optionItems.map(renderOptionItem)}
From cb5f762aeda5aa8f85f5c772e18a7abfda8c122b Mon Sep 17 00:00:00 2001 From: Ishpaul Singh Date: Wed, 13 Mar 2024 23:55:07 +0530 Subject: [PATCH 02/11] lint fix --- src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx b/src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx index efb559a60844..8f79787eb705 100644 --- a/src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx +++ b/src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx @@ -207,7 +207,10 @@ function WorkspaceWorkflowsPage({policy, betas, route, reimbursementAccount, ses ]); const renderOptionItem = (item: ToggleSettingOptionRowProps, index: number) => ( - + Date: Thu, 14 Mar 2024 18:14:34 +0530 Subject: [PATCH 03/11] Update src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx --- src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx b/src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx index 8f79787eb705..dbaa211625c7 100644 --- a/src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx +++ b/src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx @@ -80,7 +80,7 @@ function WorkspaceWorkflowsPage({policy, betas, route, reimbursementAccount, ses const hasReimburserEmailError = !!policy?.errorFields?.reimburserEmail; return [ - ...(!canUseDelayedSubmission + ...(canUseDelayedSubmission ? [ { icon: Illustrations.ReceiptEnvelope, From a2ab478d08c42446d97d68500dcfa1c965513358 Mon Sep 17 00:00:00 2001 From: Ishpaul Singh Date: Thu, 14 Mar 2024 19:29:22 +0530 Subject: [PATCH 04/11] remove redundant scrollview --- src/pages/workspace/WorkspaceProfilePage.tsx | 211 +++++++++---------- 1 file changed, 104 insertions(+), 107 deletions(-) diff --git a/src/pages/workspace/WorkspaceProfilePage.tsx b/src/pages/workspace/WorkspaceProfilePage.tsx index ddebc9d4b368..459eaf6b127f 100644 --- a/src/pages/workspace/WorkspaceProfilePage.tsx +++ b/src/pages/workspace/WorkspaceProfilePage.tsx @@ -11,7 +11,6 @@ import * as Expensicons from '@components/Icon/Expensicons'; import * as Illustrations from '@components/Icon/Illustrations'; import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; import OfflineWithFeedback from '@components/OfflineWithFeedback'; -import ScrollView from '@components/ScrollView'; import Section from '@components/Section'; import Text from '@components/Text'; import useLocalize from '@hooks/useLocalize'; @@ -101,121 +100,119 @@ function WorkspaceProfilePage({policy, currencyList = {}, route}: WorkSpaceProfi icon={Illustrations.House} > {(hasVBA?: boolean) => ( - - -
- - Navigation.navigate(ROUTES.WORKSPACE_AVATAR.getRoute(policy?.id ?? ''))} - source={policy?.avatar ?? ''} - size={CONST.AVATAR_SIZE.XLARGE} - avatarStyle={styles.avatarXLarge} - enablePreview - DefaultAvatar={DefaultAvatar} - type={CONST.ICON_TYPE_WORKSPACE} - fallbackIcon={Expensicons.FallbackWorkspaceAvatar} - style={[ - isSmallScreenWidth ? styles.mb1 : styles.mb3, - isSmallScreenWidth ? styles.mtn17 : styles.mtn20, - styles.alignItemsStart, - styles.sectionMenuItemTopDescription, - ]} - isUsingDefaultAvatar={!policy?.avatar ?? null} - onImageSelected={(file) => Policy.updateWorkspaceAvatar(policy?.id ?? '', file as File)} - onImageRemoved={() => Policy.deleteWorkspaceAvatar(policy?.id ?? '')} - editorMaskImage={Expensicons.ImageCropSquareMask} - pendingAction={policy?.pendingFields?.avatar} - errors={policy?.errorFields?.avatar} - onErrorClose={() => Policy.clearAvatarErrors(policy?.id ?? '')} - previewSource={UserUtils.getFullSizeAvatar(policy?.avatar ?? '')} - headerTitle={translate('workspace.common.workspaceAvatar')} - originalFileName={policy?.originalFileName} + +
+ + Navigation.navigate(ROUTES.WORKSPACE_AVATAR.getRoute(policy?.id ?? ''))} + source={policy?.avatar ?? ''} + size={CONST.AVATAR_SIZE.XLARGE} + avatarStyle={styles.avatarXLarge} + enablePreview + DefaultAvatar={DefaultAvatar} + type={CONST.ICON_TYPE_WORKSPACE} + fallbackIcon={Expensicons.FallbackWorkspaceAvatar} + style={[ + isSmallScreenWidth ? styles.mb1 : styles.mb3, + isSmallScreenWidth ? styles.mtn17 : styles.mtn20, + styles.alignItemsStart, + styles.sectionMenuItemTopDescription, + ]} + isUsingDefaultAvatar={!policy?.avatar ?? null} + onImageSelected={(file) => Policy.updateWorkspaceAvatar(policy?.id ?? '', file as File)} + onImageRemoved={() => Policy.deleteWorkspaceAvatar(policy?.id ?? '')} + editorMaskImage={Expensicons.ImageCropSquareMask} + pendingAction={policy?.pendingFields?.avatar} + errors={policy?.errorFields?.avatar} + onErrorClose={() => Policy.clearAvatarErrors(policy?.id ?? '')} + previewSource={UserUtils.getFullSizeAvatar(policy?.avatar ?? '')} + headerTitle={translate('workspace.common.workspaceAvatar')} + originalFileName={policy?.originalFileName} + disabled={readOnly} + disabledStyle={styles.cursorDefault} + errorRowStyles={undefined} + /> + + - + + {(!StringUtils.isEmptyString(policy?.description ?? '') || !readOnly) && ( + - {(!StringUtils.isEmptyString(policy?.description ?? '') || !readOnly) && ( - - - - )} - - - - - {hasVBA ? translate('workspace.editor.currencyInputDisabledText') : translate('workspace.editor.currencyInputHelpText')} - - - - {!readOnly && ( - -
- setIsDeleteModalOpen(false)} - prompt={translate('workspace.common.deleteConfirmation')} - confirmText={translate('common.delete')} - cancelText={translate('common.cancel')} - danger - /> -
- + )} + + + + + {hasVBA ? translate('workspace.editor.currencyInputDisabledText') : translate('workspace.editor.currencyInputHelpText')} + + + + {!readOnly && ( + +
+ setIsDeleteModalOpen(false)} + prompt={translate('workspace.common.deleteConfirmation')} + confirmText={translate('common.delete')} + cancelText={translate('common.cancel')} + danger + /> +
)} ); From d0408b8cf7d9b0e18fc287b3c844654599ae9361 Mon Sep 17 00:00:00 2001 From: Ishpaul Singh Date: Thu, 14 Mar 2024 19:40:15 +0530 Subject: [PATCH 05/11] prettier diffs --- src/pages/workspace/WorkspaceProfilePage.tsx | 214 +++++++++---------- 1 file changed, 107 insertions(+), 107 deletions(-) diff --git a/src/pages/workspace/WorkspaceProfilePage.tsx b/src/pages/workspace/WorkspaceProfilePage.tsx index f1a1026fd670..dc3e6e268f15 100644 --- a/src/pages/workspace/WorkspaceProfilePage.tsx +++ b/src/pages/workspace/WorkspaceProfilePage.tsx @@ -100,122 +100,122 @@ function WorkspaceProfilePage({policy, currencyList = {}, route}: WorkSpaceProfi icon={Illustrations.House} > {(hasVBA?: boolean) => ( - -
- - Navigation.navigate(ROUTES.WORKSPACE_AVATAR.getRoute(policy?.id ?? ''))} - source={policy?.avatar ?? ''} - size={CONST.AVATAR_SIZE.XLARGE} - avatarStyle={styles.avatarXLarge} - enablePreview - DefaultAvatar={DefaultAvatar} - type={CONST.ICON_TYPE_WORKSPACE} - fallbackIcon={Expensicons.FallbackWorkspaceAvatar} - style={[ - isSmallScreenWidth ? styles.mb1 : styles.mb3, - isSmallScreenWidth ? styles.mtn17 : styles.mtn20, - styles.alignItemsStart, - styles.sectionMenuItemTopDescription, - ]} - editIconStyle={styles.smallEditIconWorkspace} - isUsingDefaultAvatar={!policy?.avatar ?? null} - onImageSelected={(file) => Policy.updateWorkspaceAvatar(policy?.id ?? '', file as File)} - onImageRemoved={() => Policy.deleteWorkspaceAvatar(policy?.id ?? '')} - editorMaskImage={Expensicons.ImageCropSquareMask} - pendingAction={policy?.pendingFields?.avatar} - errors={policy?.errorFields?.avatar} - onErrorClose={() => Policy.clearAvatarErrors(policy?.id ?? '')} - previewSource={UserUtils.getFullSizeAvatar(policy?.avatar ?? '')} - headerTitle={translate('workspace.common.workspaceAvatar')} - originalFileName={policy?.originalFileName} + +
+ + Navigation.navigate(ROUTES.WORKSPACE_AVATAR.getRoute(policy?.id ?? ''))} + source={policy?.avatar ?? ''} + size={CONST.AVATAR_SIZE.XLARGE} + avatarStyle={styles.avatarXLarge} + enablePreview + DefaultAvatar={DefaultAvatar} + type={CONST.ICON_TYPE_WORKSPACE} + fallbackIcon={Expensicons.FallbackWorkspaceAvatar} + style={[ + isSmallScreenWidth ? styles.mb1 : styles.mb3, + isSmallScreenWidth ? styles.mtn17 : styles.mtn20, + styles.alignItemsStart, + styles.sectionMenuItemTopDescription, + ]} + editIconStyle={styles.smallEditIconWorkspace} + isUsingDefaultAvatar={!policy?.avatar ?? null} + onImageSelected={(file) => Policy.updateWorkspaceAvatar(policy?.id ?? '', file as File)} + onImageRemoved={() => Policy.deleteWorkspaceAvatar(policy?.id ?? '')} + editorMaskImage={Expensicons.ImageCropSquareMask} + pendingAction={policy?.pendingFields?.avatar} + errors={policy?.errorFields?.avatar} + onErrorClose={() => Policy.clearAvatarErrors(policy?.id ?? '')} + previewSource={UserUtils.getFullSizeAvatar(policy?.avatar ?? '')} + headerTitle={translate('workspace.common.workspaceAvatar')} + originalFileName={policy?.originalFileName} + disabled={readOnly} + disabledStyle={styles.cursorDefault} + errorRowStyles={undefined} + /> + + - + + {(!StringUtils.isEmptyString(policy?.description ?? '') || !readOnly) && ( + - {(!StringUtils.isEmptyString(policy?.description ?? '') || !readOnly) && ( - - - - )} - - - - - {hasVBA ? translate('workspace.editor.currencyInputDisabledText') : translate('workspace.editor.currencyInputHelpText')} - - - - {!readOnly && ( - -
- setIsDeleteModalOpen(false)} - prompt={translate('workspace.common.deleteConfirmation')} - confirmText={translate('common.delete')} - cancelText={translate('common.cancel')} - danger - /> -
+ )} + + + + + {hasVBA ? translate('workspace.editor.currencyInputDisabledText') : translate('workspace.editor.currencyInputHelpText')} + + + + {!readOnly && ( + +
+ setIsDeleteModalOpen(false)} + prompt={translate('workspace.common.deleteConfirmation')} + confirmText={translate('common.delete')} + cancelText={translate('common.cancel')} + danger + /> +
)} ); From 251c60b06435be533485b8ae0b97a11cf628b29c Mon Sep 17 00:00:00 2001 From: Ishpaul Singh Date: Thu, 14 Mar 2024 19:43:59 +0530 Subject: [PATCH 06/11] fixes merge conflicts --- src/pages/workspace/WorkspaceProfilePage.tsx | 214 +++++++++---------- 1 file changed, 107 insertions(+), 107 deletions(-) diff --git a/src/pages/workspace/WorkspaceProfilePage.tsx b/src/pages/workspace/WorkspaceProfilePage.tsx index dc3e6e268f15..f1a1026fd670 100644 --- a/src/pages/workspace/WorkspaceProfilePage.tsx +++ b/src/pages/workspace/WorkspaceProfilePage.tsx @@ -100,122 +100,122 @@ function WorkspaceProfilePage({policy, currencyList = {}, route}: WorkSpaceProfi icon={Illustrations.House} > {(hasVBA?: boolean) => ( - -
- - Navigation.navigate(ROUTES.WORKSPACE_AVATAR.getRoute(policy?.id ?? ''))} - source={policy?.avatar ?? ''} - size={CONST.AVATAR_SIZE.XLARGE} - avatarStyle={styles.avatarXLarge} - enablePreview - DefaultAvatar={DefaultAvatar} - type={CONST.ICON_TYPE_WORKSPACE} - fallbackIcon={Expensicons.FallbackWorkspaceAvatar} - style={[ - isSmallScreenWidth ? styles.mb1 : styles.mb3, - isSmallScreenWidth ? styles.mtn17 : styles.mtn20, - styles.alignItemsStart, - styles.sectionMenuItemTopDescription, - ]} - editIconStyle={styles.smallEditIconWorkspace} - isUsingDefaultAvatar={!policy?.avatar ?? null} - onImageSelected={(file) => Policy.updateWorkspaceAvatar(policy?.id ?? '', file as File)} - onImageRemoved={() => Policy.deleteWorkspaceAvatar(policy?.id ?? '')} - editorMaskImage={Expensicons.ImageCropSquareMask} - pendingAction={policy?.pendingFields?.avatar} - errors={policy?.errorFields?.avatar} - onErrorClose={() => Policy.clearAvatarErrors(policy?.id ?? '')} - previewSource={UserUtils.getFullSizeAvatar(policy?.avatar ?? '')} - headerTitle={translate('workspace.common.workspaceAvatar')} - originalFileName={policy?.originalFileName} - disabled={readOnly} - disabledStyle={styles.cursorDefault} - errorRowStyles={undefined} - /> - - +
+ + Navigation.navigate(ROUTES.WORKSPACE_AVATAR.getRoute(policy?.id ?? ''))} + source={policy?.avatar ?? ''} + size={CONST.AVATAR_SIZE.XLARGE} + avatarStyle={styles.avatarXLarge} + enablePreview + DefaultAvatar={DefaultAvatar} + type={CONST.ICON_TYPE_WORKSPACE} + fallbackIcon={Expensicons.FallbackWorkspaceAvatar} + style={[ + isSmallScreenWidth ? styles.mb1 : styles.mb3, + isSmallScreenWidth ? styles.mtn17 : styles.mtn20, + styles.alignItemsStart, + styles.sectionMenuItemTopDescription, + ]} + editIconStyle={styles.smallEditIconWorkspace} + isUsingDefaultAvatar={!policy?.avatar ?? null} + onImageSelected={(file) => Policy.updateWorkspaceAvatar(policy?.id ?? '', file as File)} + onImageRemoved={() => Policy.deleteWorkspaceAvatar(policy?.id ?? '')} + editorMaskImage={Expensicons.ImageCropSquareMask} + pendingAction={policy?.pendingFields?.avatar} + errors={policy?.errorFields?.avatar} + onErrorClose={() => Policy.clearAvatarErrors(policy?.id ?? '')} + previewSource={UserUtils.getFullSizeAvatar(policy?.avatar ?? '')} + headerTitle={translate('workspace.common.workspaceAvatar')} + originalFileName={policy?.originalFileName} disabled={readOnly} - wrapperStyle={[styles.sectionMenuItemTopDescription, isSmallScreenWidth ? styles.mt3 : {}]} - onPress={onPressName} - shouldGreyOutWhenDisabled={false} - shouldUseDefaultCursorWhenDisabled + disabledStyle={styles.cursorDefault} + errorRowStyles={undefined} /> - - {(!StringUtils.isEmptyString(policy?.description ?? '') || !readOnly) && ( - + - )} - - - - - {hasVBA ? translate('workspace.editor.currencyInputDisabledText') : translate('workspace.editor.currencyInputHelpText')} - - - - {!readOnly && ( - -
- setIsDeleteModalOpen(false)} - prompt={translate('workspace.common.deleteConfirmation')} - confirmText={translate('common.delete')} - cancelText={translate('common.cancel')} - danger - /> - + {(!StringUtils.isEmptyString(policy?.description ?? '') || !readOnly) && ( + + + + )} + + + + + {hasVBA ? translate('workspace.editor.currencyInputDisabledText') : translate('workspace.editor.currencyInputHelpText')} + + + + {!readOnly && ( + +
+ setIsDeleteModalOpen(false)} + prompt={translate('workspace.common.deleteConfirmation')} + confirmText={translate('common.delete')} + cancelText={translate('common.cancel')} + danger + /> +
)} ); From 5fee8ce1b11f9071bb4c4ab427086ef1cd769654 Mon Sep 17 00:00:00 2001 From: Ishpaul Singh Date: Thu, 14 Mar 2024 19:44:58 +0530 Subject: [PATCH 07/11] prettier diffs --- src/pages/workspace/WorkspaceProfilePage.tsx | 214 +++++++++---------- 1 file changed, 107 insertions(+), 107 deletions(-) diff --git a/src/pages/workspace/WorkspaceProfilePage.tsx b/src/pages/workspace/WorkspaceProfilePage.tsx index f1a1026fd670..dc3e6e268f15 100644 --- a/src/pages/workspace/WorkspaceProfilePage.tsx +++ b/src/pages/workspace/WorkspaceProfilePage.tsx @@ -100,122 +100,122 @@ function WorkspaceProfilePage({policy, currencyList = {}, route}: WorkSpaceProfi icon={Illustrations.House} > {(hasVBA?: boolean) => ( - -
- - Navigation.navigate(ROUTES.WORKSPACE_AVATAR.getRoute(policy?.id ?? ''))} - source={policy?.avatar ?? ''} - size={CONST.AVATAR_SIZE.XLARGE} - avatarStyle={styles.avatarXLarge} - enablePreview - DefaultAvatar={DefaultAvatar} - type={CONST.ICON_TYPE_WORKSPACE} - fallbackIcon={Expensicons.FallbackWorkspaceAvatar} - style={[ - isSmallScreenWidth ? styles.mb1 : styles.mb3, - isSmallScreenWidth ? styles.mtn17 : styles.mtn20, - styles.alignItemsStart, - styles.sectionMenuItemTopDescription, - ]} - editIconStyle={styles.smallEditIconWorkspace} - isUsingDefaultAvatar={!policy?.avatar ?? null} - onImageSelected={(file) => Policy.updateWorkspaceAvatar(policy?.id ?? '', file as File)} - onImageRemoved={() => Policy.deleteWorkspaceAvatar(policy?.id ?? '')} - editorMaskImage={Expensicons.ImageCropSquareMask} - pendingAction={policy?.pendingFields?.avatar} - errors={policy?.errorFields?.avatar} - onErrorClose={() => Policy.clearAvatarErrors(policy?.id ?? '')} - previewSource={UserUtils.getFullSizeAvatar(policy?.avatar ?? '')} - headerTitle={translate('workspace.common.workspaceAvatar')} - originalFileName={policy?.originalFileName} + +
+ + Navigation.navigate(ROUTES.WORKSPACE_AVATAR.getRoute(policy?.id ?? ''))} + source={policy?.avatar ?? ''} + size={CONST.AVATAR_SIZE.XLARGE} + avatarStyle={styles.avatarXLarge} + enablePreview + DefaultAvatar={DefaultAvatar} + type={CONST.ICON_TYPE_WORKSPACE} + fallbackIcon={Expensicons.FallbackWorkspaceAvatar} + style={[ + isSmallScreenWidth ? styles.mb1 : styles.mb3, + isSmallScreenWidth ? styles.mtn17 : styles.mtn20, + styles.alignItemsStart, + styles.sectionMenuItemTopDescription, + ]} + editIconStyle={styles.smallEditIconWorkspace} + isUsingDefaultAvatar={!policy?.avatar ?? null} + onImageSelected={(file) => Policy.updateWorkspaceAvatar(policy?.id ?? '', file as File)} + onImageRemoved={() => Policy.deleteWorkspaceAvatar(policy?.id ?? '')} + editorMaskImage={Expensicons.ImageCropSquareMask} + pendingAction={policy?.pendingFields?.avatar} + errors={policy?.errorFields?.avatar} + onErrorClose={() => Policy.clearAvatarErrors(policy?.id ?? '')} + previewSource={UserUtils.getFullSizeAvatar(policy?.avatar ?? '')} + headerTitle={translate('workspace.common.workspaceAvatar')} + originalFileName={policy?.originalFileName} + disabled={readOnly} + disabledStyle={styles.cursorDefault} + errorRowStyles={undefined} + /> + + - + + {(!StringUtils.isEmptyString(policy?.description ?? '') || !readOnly) && ( + - {(!StringUtils.isEmptyString(policy?.description ?? '') || !readOnly) && ( - - - - )} - - - - - {hasVBA ? translate('workspace.editor.currencyInputDisabledText') : translate('workspace.editor.currencyInputHelpText')} - - - - {!readOnly && ( - -
- setIsDeleteModalOpen(false)} - prompt={translate('workspace.common.deleteConfirmation')} - confirmText={translate('common.delete')} - cancelText={translate('common.cancel')} - danger - /> -
+ )} + + + + + {hasVBA ? translate('workspace.editor.currencyInputDisabledText') : translate('workspace.editor.currencyInputHelpText')} + + + + {!readOnly && ( + +
+ setIsDeleteModalOpen(false)} + prompt={translate('workspace.common.deleteConfirmation')} + confirmText={translate('common.delete')} + cancelText={translate('common.cancel')} + danger + /> +
)} ); From a9954f9c14de816d70784b9b106a49c5130a61a3 Mon Sep 17 00:00:00 2001 From: Ishpaul Singh Date: Thu, 14 Mar 2024 19:49:22 +0530 Subject: [PATCH 08/11] revert unncessary changes --- src/pages/workspace/WorkspaceProfilePage.tsx | 217 ++++++++++--------- 1 file changed, 110 insertions(+), 107 deletions(-) diff --git a/src/pages/workspace/WorkspaceProfilePage.tsx b/src/pages/workspace/WorkspaceProfilePage.tsx index dc3e6e268f15..2df6dd0489f9 100644 --- a/src/pages/workspace/WorkspaceProfilePage.tsx +++ b/src/pages/workspace/WorkspaceProfilePage.tsx @@ -11,6 +11,7 @@ import * as Expensicons from '@components/Icon/Expensicons'; import * as Illustrations from '@components/Icon/Illustrations'; import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; import OfflineWithFeedback from '@components/OfflineWithFeedback'; +import ScrollView from '@components/ScrollView'; import Section from '@components/Section'; import Text from '@components/Text'; import useLocalize from '@hooks/useLocalize'; @@ -100,122 +101,124 @@ function WorkspaceProfilePage({policy, currencyList = {}, route}: WorkSpaceProfi icon={Illustrations.House} > {(hasVBA?: boolean) => ( - -
- - Navigation.navigate(ROUTES.WORKSPACE_AVATAR.getRoute(policy?.id ?? ''))} - source={policy?.avatar ?? ''} - size={CONST.AVATAR_SIZE.XLARGE} - avatarStyle={styles.avatarXLarge} - enablePreview - DefaultAvatar={DefaultAvatar} - type={CONST.ICON_TYPE_WORKSPACE} - fallbackIcon={Expensicons.FallbackWorkspaceAvatar} - style={[ - isSmallScreenWidth ? styles.mb1 : styles.mb3, - isSmallScreenWidth ? styles.mtn17 : styles.mtn20, - styles.alignItemsStart, - styles.sectionMenuItemTopDescription, - ]} - editIconStyle={styles.smallEditIconWorkspace} - isUsingDefaultAvatar={!policy?.avatar ?? null} - onImageSelected={(file) => Policy.updateWorkspaceAvatar(policy?.id ?? '', file as File)} - onImageRemoved={() => Policy.deleteWorkspaceAvatar(policy?.id ?? '')} - editorMaskImage={Expensicons.ImageCropSquareMask} - pendingAction={policy?.pendingFields?.avatar} - errors={policy?.errorFields?.avatar} - onErrorClose={() => Policy.clearAvatarErrors(policy?.id ?? '')} - previewSource={UserUtils.getFullSizeAvatar(policy?.avatar ?? '')} - headerTitle={translate('workspace.common.workspaceAvatar')} - originalFileName={policy?.originalFileName} - disabled={readOnly} - disabledStyle={styles.cursorDefault} - errorRowStyles={undefined} - /> - - + +
+ + Navigation.navigate(ROUTES.WORKSPACE_AVATAR.getRoute(policy?.id ?? ''))} + source={policy?.avatar ?? ''} + size={CONST.AVATAR_SIZE.XLARGE} + avatarStyle={styles.avatarXLarge} + enablePreview + DefaultAvatar={DefaultAvatar} + type={CONST.ICON_TYPE_WORKSPACE} + fallbackIcon={Expensicons.FallbackWorkspaceAvatar} + style={[ + isSmallScreenWidth ? styles.mb1 : styles.mb3, + isSmallScreenWidth ? styles.mtn17 : styles.mtn20, + styles.alignItemsStart, + styles.sectionMenuItemTopDescription, + ]} + editIconStyle={styles.smallEditIconWorkspace} + isUsingDefaultAvatar={!policy?.avatar ?? null} + onImageSelected={(file) => Policy.updateWorkspaceAvatar(policy?.id ?? '', file as File)} + onImageRemoved={() => Policy.deleteWorkspaceAvatar(policy?.id ?? '')} + editorMaskImage={Expensicons.ImageCropSquareMask} + pendingAction={policy?.pendingFields?.avatar} + errors={policy?.errorFields?.avatar} + onErrorClose={() => Policy.clearAvatarErrors(policy?.id ?? '')} + previewSource={UserUtils.getFullSizeAvatar(policy?.avatar ?? '')} + headerTitle={translate('workspace.common.workspaceAvatar')} + originalFileName={policy?.originalFileName} disabled={readOnly} - wrapperStyle={[styles.sectionMenuItemTopDescription, isSmallScreenWidth ? styles.mt3 : {}]} - onPress={onPressName} - shouldGreyOutWhenDisabled={false} - shouldUseDefaultCursorWhenDisabled + disabledStyle={styles.cursorDefault} + errorRowStyles={undefined} /> - - {(!StringUtils.isEmptyString(policy?.description ?? '') || !readOnly) && ( - + - )} - - - - - {hasVBA ? translate('workspace.editor.currencyInputDisabledText') : translate('workspace.editor.currencyInputHelpText')} - - - - {!readOnly && ( - -
- setIsDeleteModalOpen(false)} - prompt={translate('workspace.common.deleteConfirmation')} - confirmText={translate('common.delete')} - cancelText={translate('common.cancel')} - danger - /> -
+ {(!StringUtils.isEmptyString(policy?.description ?? '') || !readOnly) && ( + + + + )} + + + + + {hasVBA ? translate('workspace.editor.currencyInputDisabledText') : translate('workspace.editor.currencyInputHelpText')} + + + + {!readOnly && ( + +
+ setIsDeleteModalOpen(false)} + prompt={translate('workspace.common.deleteConfirmation')} + confirmText={translate('common.delete')} + cancelText={translate('common.cancel')} + danger + /> +
+
)} ); From 9f4cae72617ada6b61d7c518ec2ea6feca4fc8d6 Mon Sep 17 00:00:00 2001 From: Ishpaul Singh Date: Thu, 14 Mar 2024 19:57:49 +0530 Subject: [PATCH 09/11] removes redundant scrollview --- src/pages/workspace/WorkspaceProfilePage.tsx | 217 +++++++++---------- 1 file changed, 107 insertions(+), 110 deletions(-) diff --git a/src/pages/workspace/WorkspaceProfilePage.tsx b/src/pages/workspace/WorkspaceProfilePage.tsx index 2df6dd0489f9..dc3e6e268f15 100644 --- a/src/pages/workspace/WorkspaceProfilePage.tsx +++ b/src/pages/workspace/WorkspaceProfilePage.tsx @@ -11,7 +11,6 @@ import * as Expensicons from '@components/Icon/Expensicons'; import * as Illustrations from '@components/Icon/Illustrations'; import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; import OfflineWithFeedback from '@components/OfflineWithFeedback'; -import ScrollView from '@components/ScrollView'; import Section from '@components/Section'; import Text from '@components/Text'; import useLocalize from '@hooks/useLocalize'; @@ -101,124 +100,122 @@ function WorkspaceProfilePage({policy, currencyList = {}, route}: WorkSpaceProfi icon={Illustrations.House} > {(hasVBA?: boolean) => ( - - -
- - Navigation.navigate(ROUTES.WORKSPACE_AVATAR.getRoute(policy?.id ?? ''))} - source={policy?.avatar ?? ''} - size={CONST.AVATAR_SIZE.XLARGE} - avatarStyle={styles.avatarXLarge} - enablePreview - DefaultAvatar={DefaultAvatar} - type={CONST.ICON_TYPE_WORKSPACE} - fallbackIcon={Expensicons.FallbackWorkspaceAvatar} - style={[ - isSmallScreenWidth ? styles.mb1 : styles.mb3, - isSmallScreenWidth ? styles.mtn17 : styles.mtn20, - styles.alignItemsStart, - styles.sectionMenuItemTopDescription, - ]} - editIconStyle={styles.smallEditIconWorkspace} - isUsingDefaultAvatar={!policy?.avatar ?? null} - onImageSelected={(file) => Policy.updateWorkspaceAvatar(policy?.id ?? '', file as File)} - onImageRemoved={() => Policy.deleteWorkspaceAvatar(policy?.id ?? '')} - editorMaskImage={Expensicons.ImageCropSquareMask} - pendingAction={policy?.pendingFields?.avatar} - errors={policy?.errorFields?.avatar} - onErrorClose={() => Policy.clearAvatarErrors(policy?.id ?? '')} - previewSource={UserUtils.getFullSizeAvatar(policy?.avatar ?? '')} - headerTitle={translate('workspace.common.workspaceAvatar')} - originalFileName={policy?.originalFileName} + +
+ + Navigation.navigate(ROUTES.WORKSPACE_AVATAR.getRoute(policy?.id ?? ''))} + source={policy?.avatar ?? ''} + size={CONST.AVATAR_SIZE.XLARGE} + avatarStyle={styles.avatarXLarge} + enablePreview + DefaultAvatar={DefaultAvatar} + type={CONST.ICON_TYPE_WORKSPACE} + fallbackIcon={Expensicons.FallbackWorkspaceAvatar} + style={[ + isSmallScreenWidth ? styles.mb1 : styles.mb3, + isSmallScreenWidth ? styles.mtn17 : styles.mtn20, + styles.alignItemsStart, + styles.sectionMenuItemTopDescription, + ]} + editIconStyle={styles.smallEditIconWorkspace} + isUsingDefaultAvatar={!policy?.avatar ?? null} + onImageSelected={(file) => Policy.updateWorkspaceAvatar(policy?.id ?? '', file as File)} + onImageRemoved={() => Policy.deleteWorkspaceAvatar(policy?.id ?? '')} + editorMaskImage={Expensicons.ImageCropSquareMask} + pendingAction={policy?.pendingFields?.avatar} + errors={policy?.errorFields?.avatar} + onErrorClose={() => Policy.clearAvatarErrors(policy?.id ?? '')} + previewSource={UserUtils.getFullSizeAvatar(policy?.avatar ?? '')} + headerTitle={translate('workspace.common.workspaceAvatar')} + originalFileName={policy?.originalFileName} + disabled={readOnly} + disabledStyle={styles.cursorDefault} + errorRowStyles={undefined} + /> + + - + + {(!StringUtils.isEmptyString(policy?.description ?? '') || !readOnly) && ( + - {(!StringUtils.isEmptyString(policy?.description ?? '') || !readOnly) && ( - - - - )} - - - - - {hasVBA ? translate('workspace.editor.currencyInputDisabledText') : translate('workspace.editor.currencyInputHelpText')} - - - - {!readOnly && ( - -
- setIsDeleteModalOpen(false)} - prompt={translate('workspace.common.deleteConfirmation')} - confirmText={translate('common.delete')} - cancelText={translate('common.cancel')} - danger - /> -
- + )} + + + + + {hasVBA ? translate('workspace.editor.currencyInputDisabledText') : translate('workspace.editor.currencyInputHelpText')} + + + + {!readOnly && ( + +
+ setIsDeleteModalOpen(false)} + prompt={translate('workspace.common.deleteConfirmation')} + confirmText={translate('common.delete')} + cancelText={translate('common.cancel')} + danger + /> +
)} ); From 508ed4393c079bc014980bd3b4f42389c0c21b8d Mon Sep 17 00:00:00 2001 From: Ishpaul Singh Date: Thu, 14 Mar 2024 20:14:58 +0530 Subject: [PATCH 10/11] checking merge comptibitlity --- src/pages/workspace/WorkspaceProfilePage.tsx | 217 ++++++++++--------- 1 file changed, 110 insertions(+), 107 deletions(-) diff --git a/src/pages/workspace/WorkspaceProfilePage.tsx b/src/pages/workspace/WorkspaceProfilePage.tsx index dc3e6e268f15..2df6dd0489f9 100644 --- a/src/pages/workspace/WorkspaceProfilePage.tsx +++ b/src/pages/workspace/WorkspaceProfilePage.tsx @@ -11,6 +11,7 @@ import * as Expensicons from '@components/Icon/Expensicons'; import * as Illustrations from '@components/Icon/Illustrations'; import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; import OfflineWithFeedback from '@components/OfflineWithFeedback'; +import ScrollView from '@components/ScrollView'; import Section from '@components/Section'; import Text from '@components/Text'; import useLocalize from '@hooks/useLocalize'; @@ -100,122 +101,124 @@ function WorkspaceProfilePage({policy, currencyList = {}, route}: WorkSpaceProfi icon={Illustrations.House} > {(hasVBA?: boolean) => ( - -
- - Navigation.navigate(ROUTES.WORKSPACE_AVATAR.getRoute(policy?.id ?? ''))} - source={policy?.avatar ?? ''} - size={CONST.AVATAR_SIZE.XLARGE} - avatarStyle={styles.avatarXLarge} - enablePreview - DefaultAvatar={DefaultAvatar} - type={CONST.ICON_TYPE_WORKSPACE} - fallbackIcon={Expensicons.FallbackWorkspaceAvatar} - style={[ - isSmallScreenWidth ? styles.mb1 : styles.mb3, - isSmallScreenWidth ? styles.mtn17 : styles.mtn20, - styles.alignItemsStart, - styles.sectionMenuItemTopDescription, - ]} - editIconStyle={styles.smallEditIconWorkspace} - isUsingDefaultAvatar={!policy?.avatar ?? null} - onImageSelected={(file) => Policy.updateWorkspaceAvatar(policy?.id ?? '', file as File)} - onImageRemoved={() => Policy.deleteWorkspaceAvatar(policy?.id ?? '')} - editorMaskImage={Expensicons.ImageCropSquareMask} - pendingAction={policy?.pendingFields?.avatar} - errors={policy?.errorFields?.avatar} - onErrorClose={() => Policy.clearAvatarErrors(policy?.id ?? '')} - previewSource={UserUtils.getFullSizeAvatar(policy?.avatar ?? '')} - headerTitle={translate('workspace.common.workspaceAvatar')} - originalFileName={policy?.originalFileName} - disabled={readOnly} - disabledStyle={styles.cursorDefault} - errorRowStyles={undefined} - /> - - + +
+ + Navigation.navigate(ROUTES.WORKSPACE_AVATAR.getRoute(policy?.id ?? ''))} + source={policy?.avatar ?? ''} + size={CONST.AVATAR_SIZE.XLARGE} + avatarStyle={styles.avatarXLarge} + enablePreview + DefaultAvatar={DefaultAvatar} + type={CONST.ICON_TYPE_WORKSPACE} + fallbackIcon={Expensicons.FallbackWorkspaceAvatar} + style={[ + isSmallScreenWidth ? styles.mb1 : styles.mb3, + isSmallScreenWidth ? styles.mtn17 : styles.mtn20, + styles.alignItemsStart, + styles.sectionMenuItemTopDescription, + ]} + editIconStyle={styles.smallEditIconWorkspace} + isUsingDefaultAvatar={!policy?.avatar ?? null} + onImageSelected={(file) => Policy.updateWorkspaceAvatar(policy?.id ?? '', file as File)} + onImageRemoved={() => Policy.deleteWorkspaceAvatar(policy?.id ?? '')} + editorMaskImage={Expensicons.ImageCropSquareMask} + pendingAction={policy?.pendingFields?.avatar} + errors={policy?.errorFields?.avatar} + onErrorClose={() => Policy.clearAvatarErrors(policy?.id ?? '')} + previewSource={UserUtils.getFullSizeAvatar(policy?.avatar ?? '')} + headerTitle={translate('workspace.common.workspaceAvatar')} + originalFileName={policy?.originalFileName} disabled={readOnly} - wrapperStyle={[styles.sectionMenuItemTopDescription, isSmallScreenWidth ? styles.mt3 : {}]} - onPress={onPressName} - shouldGreyOutWhenDisabled={false} - shouldUseDefaultCursorWhenDisabled + disabledStyle={styles.cursorDefault} + errorRowStyles={undefined} /> - - {(!StringUtils.isEmptyString(policy?.description ?? '') || !readOnly) && ( - + - )} - - - - - {hasVBA ? translate('workspace.editor.currencyInputDisabledText') : translate('workspace.editor.currencyInputHelpText')} - - - - {!readOnly && ( - -
- setIsDeleteModalOpen(false)} - prompt={translate('workspace.common.deleteConfirmation')} - confirmText={translate('common.delete')} - cancelText={translate('common.cancel')} - danger - /> -
+ {(!StringUtils.isEmptyString(policy?.description ?? '') || !readOnly) && ( + + + + )} + + + + + {hasVBA ? translate('workspace.editor.currencyInputDisabledText') : translate('workspace.editor.currencyInputHelpText')} + + + + {!readOnly && ( + +
+ setIsDeleteModalOpen(false)} + prompt={translate('workspace.common.deleteConfirmation')} + confirmText={translate('common.delete')} + cancelText={translate('common.cancel')} + danger + /> +
+
)} ); From 7089a6c2c06275112abeed9f5c7544854ec06ecf Mon Sep 17 00:00:00 2001 From: Ishpaul Singh Date: Fri, 22 Mar 2024 21:27:02 +0530 Subject: [PATCH 11/11] resolves more conflict after merge --- src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx b/src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx index 534c5bd67f59..db59980a2cf4 100644 --- a/src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx +++ b/src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx @@ -280,6 +280,7 @@ function WorkspaceWorkflowsPage({policy, betas, route, reimbursementAccount, ses shouldShowNotFoundPage={!isPaidGroupPolicy || !isPolicyAdmin} shouldSkipVBBACall isLoading={isLoading} + shouldUseScrollView >