Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Wave Collect] [Xero/QBO] Update educational messages #42487

Merged
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2241,6 +2241,7 @@ export default {
enable: 'Enable rate',
enableMultiple: 'Enable rates',
},
importedFromAccountingSoftware: 'The taxes below are imported from your',
},
emptyWorkspace: {
title: 'Create a workspace',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2277,6 +2277,7 @@ export default {
enable: 'Activar tasa',
enableMultiple: 'Activar tasas',
},
importedFromAccountingSoftware: 'Impuestos importadas desde',
},
emptyWorkspace: {
title: 'Crea un espacio de trabajo',
Expand Down
20 changes: 3 additions & 17 deletions src/pages/workspace/categories/WorkspaceCategoriesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,16 @@ function WorkspaceCategoriesPage({route}: WorkspaceCategoriesPageProps) {

const getHeaderText = () => (
<View style={[styles.ph5, styles.pb5, styles.pt3]}>
{Object.keys(policy?.connections ?? {}).length > 0 ? (
{isConnectedToAccounting ? (
<Text>
<Text style={[styles.textNormal, styles.colorMuted]}>{`${translate('workspace.categories.importedFromAccountingSoftware')} `}</Text>
<TextLink
style={[styles.textNormal, styles.link]}
href={`${environmentURL}/${ROUTES.POLICY_ACCOUNTING.getRoute(policyId)}`}
>
{`${translate('workspace.accounting.qbo')} ${translate('workspace.accounting.settings')}`}
{`${translate(isConnectedToQbo ? 'workspace.accounting.qbo' : 'workspace.accounting.xero')} ${translate('workspace.accounting.settings')}`}
</TextLink>
<Text style={[styles.textNormal, styles.colorMuted]}>.</Text>
</Text>
) : (
<Text style={[styles.textNormal, styles.colorMuted]}>{translate('workspace.categories.subtitle')}</Text>
Expand Down Expand Up @@ -295,21 +296,6 @@ function WorkspaceCategoriesPage({route}: WorkspaceCategoriesPageProps) {
/>
{isSmallScreenWidth && <View style={[styles.pl5, styles.pr5]}>{getHeaderButtons()}</View>}
{!isSmallScreenWidth && getHeaderText()}
<View style={[styles.ph5, styles.pb5, styles.pt3]}>
{isConnectedToAccounting ? (
<Text>
<Text style={[styles.textNormal, styles.colorMuted]}>{`${translate('workspace.categories.importedFromAccountingSoftware')} `}</Text>
<TextLink
style={[styles.textNormal, styles.link]}
href={`${environmentURL}/${ROUTES.POLICY_ACCOUNTING.getRoute(policyId)}`}
>
{`${translate(isConnectedToQbo ? 'workspace.accounting.qbo' : 'workspace.accounting.xero')} ${translate('workspace.accounting.settings')}`}
</TextLink>
</Text>
) : (
<Text style={[styles.textNormal, styles.colorMuted]}>{translate('workspace.categories.subtitle')}</Text>
)}
</View>
{isLoading && (
<ActivityIndicator
size={CONST.ACTIVITY_INDICATOR_SIZE.LARGE}
Expand Down
6 changes: 4 additions & 2 deletions src/pages/workspace/tags/WorkspaceTagsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ function WorkspaceTagsPage({route}: WorkspaceTagsPageProps) {
const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`);
const {environmentURL} = useEnvironment();
const isConnectedToAccounting = Object.keys(policy?.connections ?? {}).length > 0;
const isConnectedToQbo = policy?.connections?.quickbooksOnline;
const [policyTagLists, isMultiLevelTags] = useMemo(() => [PolicyUtils.getTagLists(policyTags), PolicyUtils.isMultiLevelTags(policyTags)], [policyTags]);
const canSelectMultiple = !isMultiLevelTags;

Expand Down Expand Up @@ -278,8 +279,9 @@ function WorkspaceTagsPage({route}: WorkspaceTagsPageProps) {
style={[styles.textNormal, styles.link]}
href={`${environmentURL}/${ROUTES.POLICY_ACCOUNTING.getRoute(policyID)}`}
>
{`${translate('workspace.accounting.qbo')} ${translate('workspace.accounting.settings')}`}
{`${translate(isConnectedToQbo ? 'workspace.accounting.qbo' : 'workspace.accounting.xero')} ${translate('workspace.accounting.settings')}`}
</TextLink>
<Text style={[styles.textNormal, styles.colorMuted]}>.</Text>
</Text>
) : (
<Text style={[styles.textNormal, styles.colorMuted]}>{translate('workspace.tags.subtitle')}</Text>
Expand Down Expand Up @@ -318,7 +320,7 @@ function WorkspaceTagsPage({route}: WorkspaceTagsPageProps) {
cancelText={translate('common.cancel')}
danger
/>
{!isSmallScreenWidth && getHeaderText()}
{!isSmallScreenWidth || (tagList.length === 0 && !isLoading) && getHeaderText()}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you do same for the categories too?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or can we remove the condition isSmallScreenWidth?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The isSmallScreenWidth check is added later in the SelectionScreen listHeaderComponent. It seems it was added intentionally. So not sure about that.

{isLoading && (
<ActivityIndicator
size={CONST.ACTIVITY_INDICATOR_SIZE.LARGE}
Expand Down
22 changes: 21 additions & 1 deletion src/pages/workspace/taxes/WorkspaceTaxesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import ListItemRightCaretWithLabel from '@components/SelectionList/ListItemRight
import TableListItem from '@components/SelectionList/TableListItem';
import type {ListItem} from '@components/SelectionList/types';
import Text from '@components/Text';
import TextLink from '@components/TextLink';
import useEnvironment from '@hooks/useEnvironment';
import useLocalize from '@hooks/useLocalize';
import useNetwork from '@hooks/useNetwork';
import useTheme from '@hooks/useTheme';
Expand Down Expand Up @@ -47,12 +49,16 @@ function WorkspaceTaxesPage({
const styles = useThemeStyles();
const theme = useTheme();
const {translate} = useLocalize();
const {environmentURL} = useEnvironment();
const [selectedTaxesIDs, setSelectedTaxesIDs] = useState<string[]>([]);
const [isDeleteModalVisible, setIsDeleteModalVisible] = useState(false);
const defaultExternalID = policy?.taxRates?.defaultExternalID;
const foreignTaxDefault = policy?.taxRates?.foreignTaxDefault;
const isFocused = useIsFocused();

const isConnectedToAccounting = Object.keys(policy?.connections ?? {}).length > 0;
const isConnectedToQbo = policy?.connections?.quickbooksOnline;

const fetchTaxes = useCallback(() => {
openPolicyTaxesPage(policyID);
}, [policyID]);
Expand Down Expand Up @@ -239,7 +245,20 @@ function WorkspaceTaxesPage({

const getHeaderText = () => (
<View style={[styles.ph5, styles.pb5, styles.pt3]}>
<Text style={[styles.textNormal, styles.colorMuted]}>{translate('workspace.taxes.subtitle')}</Text>
{isConnectedToAccounting ? (
<Text>
<Text style={[styles.textNormal, styles.colorMuted]}>{`${translate('workspace.taxes.importedFromAccountingSoftware')} `}</Text>
<TextLink
style={[styles.textNormal, styles.link]}
href={`${environmentURL}/${ROUTES.POLICY_ACCOUNTING.getRoute(policyID)}`}
>
{`${translate(isConnectedToQbo ? 'workspace.accounting.qbo' : 'workspace.accounting.xero')} ${translate('workspace.accounting.settings')}`}
</TextLink>
<Text style={[styles.textNormal, styles.colorMuted]}>.</Text>
</Text>
) : (
<Text style={[styles.textNormal, styles.colorMuted]}>{translate('workspace.taxes.subtitle')}</Text>
)}
</View>
);

Expand All @@ -263,6 +282,7 @@ function WorkspaceTaxesPage({
{!isSmallScreenWidth && headerButtons}
</HeaderWithBackButton>
{isSmallScreenWidth && <View style={[styles.pl5, styles.pr5]}>{headerButtons}</View>}

{!isSmallScreenWidth && getHeaderText()}
{isLoading && (
<ActivityIndicator
Expand Down
Loading