Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
27 changes: 2 additions & 25 deletions src/components/ImportedFromAccountingSoftware.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import CONST from '@src/CONST';
import ROUTES from '@src/ROUTES';
import type {ConnectionName} from '@src/types/onyx/Policy';
import Icon from './Icon';
import RenderHTML from './RenderHTML';
import Text from './Text';
import TextBlock from './TextBlock';
import TextLinkBlock from './TextLinkBlock';
Expand All @@ -27,32 +26,15 @@ type ImportedFromAccountingSoftwareProps = {

/** The translated text for the "imported from" message */
translatedText: string;

/** The custom tag name */
customTagName?: string;

/** Whether we are displaying the tags */
isDisplayingTags?: boolean;
};

function ImportedFromAccountingSoftware({
policyID,
currentConnectionName,
translatedText,
connectedIntegration,
customTagName,
isDisplayingTags = false,
}: ImportedFromAccountingSoftwareProps) {
function ImportedFromAccountingSoftware({policyID, currentConnectionName, translatedText, connectedIntegration}: ImportedFromAccountingSoftwareProps) {
const styles = useThemeStyles();
const StyleUtils = useStyleUtils();
const {translate} = useLocalize();
const {environmentURL} = useEnvironment();
const icon = getIntegrationIcon(connectedIntegration);

if (!customTagName && isDisplayingTags) {
return null;
}

return (
<View style={[styles.alignItemsCenter, styles.flexRow, styles.flexWrap]}>
<TextBlock
Expand All @@ -74,12 +56,7 @@ function ImportedFromAccountingSoftware({
) : undefined
}
/>
<Text style={[styles.textNormal, styles.colorMuted]}>. </Text>
{isDisplayingTags && !!customTagName && (
<View style={[styles.renderHTML]}>
<RenderHTML html={translate('workspace.tags.employeesSeeTagsAs', {customTagName})} />
</View>
)}
<Text style={[styles.textNormal, styles.colorMuted]}>.</Text>
Comment thread
amyevans marked this conversation as resolved.
</View>
);
}
Expand Down
4 changes: 1 addition & 3 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ import type {
EditDestinationSubtitleParams,
ElectronicFundsParams,
EmployeeInviteMessageParams,
EmployeesSeeTagsAsParams,
EmptyCategoriesSubtitleWithAccountingParams,
EmptyTagsSubtitleWithAccountingParams,
EnableContinuousReconciliationParams,
Expand Down Expand Up @@ -4882,8 +4881,7 @@ const translations = {
existingTagError: 'Ein Tag mit diesem Namen existiert bereits',
invalidTagNameError: 'Der Tag-Name darf nicht 0 sein. Bitte wählen Sie einen anderen Wert.',
genericFailureMessage: 'Beim Aktualisieren des Tags ist ein Fehler aufgetreten, bitte versuchen Sie es erneut.',
importedFromAccountingSoftware: 'Tags werden in deiner',
employeesSeeTagsAs: ({customTagName}: EmployeesSeeTagsAsParams) => ` <muted-text>Mitarbeiter sehen Tags als <strong>${customTagName}</strong>.</muted-text>`,
importedFromAccountingSoftware: 'Die unten stehenden Tags werden aus Ihrem',
glCode: 'GL-Code',
updateGLCodeFailureMessage: 'Beim Aktualisieren des GL-Codes ist ein Fehler aufgetreten, bitte versuchen Sie es erneut.',
tagRules: 'Tag-Regeln',
Expand Down
4 changes: 1 addition & 3 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ import type {
EditDestinationSubtitleParams,
ElectronicFundsParams,
EmployeeInviteMessageParams,
EmployeesSeeTagsAsParams,
EmptyCategoriesSubtitleWithAccountingParams,
EmptyTagsSubtitleWithAccountingParams,
EnableContinuousReconciliationParams,
Expand Down Expand Up @@ -4855,8 +4854,7 @@ const translations = {
existingTagError: 'A tag with this name already exists',
invalidTagNameError: 'Tag name cannot be 0. Please choose a different value.',
genericFailureMessage: 'An error occurred while updating the tag, please try again',
importedFromAccountingSoftware: 'Tags are managed in your',
employeesSeeTagsAs: ({customTagName}: EmployeesSeeTagsAsParams) => `<muted-text>Employees see tags as <strong>${customTagName}</strong>.</muted-text>`,
importedFromAccountingSoftware: 'The tags below are imported from your',
glCode: 'GL code',
updateGLCodeFailureMessage: 'An error occurred while updating the GL code, please try again',
tagRules: 'Tag rules',
Expand Down
4 changes: 1 addition & 3 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ import type {
EditDestinationSubtitleParams,
ElectronicFundsParams,
EmployeeInviteMessageParams,
EmployeesSeeTagsAsParams,
EmptyCategoriesSubtitleWithAccountingParams,
EmptyTagsSubtitleWithAccountingParams,
EnableContinuousReconciliationParams,
Expand Down Expand Up @@ -4863,8 +4862,7 @@ const translations = {
existingTagError: 'Ya existe una etiqueta con este nombre',
invalidTagNameError: 'El nombre de la etiqueta no puede ser 0. Por favor, elige un valor diferente.',
genericFailureMessage: 'Se ha producido un error al actualizar la etiqueta. Por favor, inténtelo nuevamente.',
importedFromAccountingSoftware: 'Las etiquetas se gestionan en tu',
employeesSeeTagsAs: ({customTagName}: EmployeesSeeTagsAsParams) => ` <muted-text>Los empleados ven las etiquetas como <strong>${customTagName}</strong>.</muted-text>`,
importedFromAccountingSoftware: 'Etiquetas importadas desde',
glCode: 'Código de Libro Mayor',
updateGLCodeFailureMessage: 'Se produjo un error al actualizar el código de Libro Mayor. Por favor, inténtelo nuevamente.',
tagRules: 'Reglas de etiquetas',
Expand Down
4 changes: 1 addition & 3 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ import type {
EditDestinationSubtitleParams,
ElectronicFundsParams,
EmployeeInviteMessageParams,
EmployeesSeeTagsAsParams,
EmptyCategoriesSubtitleWithAccountingParams,
EmptyTagsSubtitleWithAccountingParams,
EnableContinuousReconciliationParams,
Expand Down Expand Up @@ -4894,8 +4893,7 @@ const translations = {
existingTagError: 'Un tag avec ce nom existe déjà',
invalidTagNameError: 'Le nom de la balise ne peut pas être 0. Veuillez choisir une autre valeur.',
genericFailureMessage: "Une erreur s'est produite lors de la mise à jour du tag, veuillez réessayer.",
importedFromAccountingSoftware: 'Les étiquettes sont gérées dans votre',
employeesSeeTagsAs: ({customTagName}: EmployeesSeeTagsAsParams) => ` <muted-text>Les employés voient les étiquettes comme <strong>${customTagName}</strong>.</muted-text>`,
importedFromAccountingSoftware: 'Les balises ci-dessous sont importées de votre',
glCode: 'Code GL',
updateGLCodeFailureMessage: "Une erreur s'est produite lors de la mise à jour du code GL, veuillez réessayer.",
tagRules: 'Règles de balise',
Expand Down
4 changes: 1 addition & 3 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ import type {
EditDestinationSubtitleParams,
ElectronicFundsParams,
EmployeeInviteMessageParams,
EmployeesSeeTagsAsParams,
EmptyCategoriesSubtitleWithAccountingParams,
EmptyTagsSubtitleWithAccountingParams,
EnableContinuousReconciliationParams,
Expand Down Expand Up @@ -4896,8 +4895,7 @@ const translations = {
existingTagError: 'Un tag con questo nome esiste già',
invalidTagNameError: 'Il nome del tag non può essere 0. Si prega di scegliere un valore diverso.',
genericFailureMessage: "Si è verificato un errore durante l'aggiornamento del tag, riprova.",
importedFromAccountingSoftware: 'I tag sono gestiti nel tuo',
employeesSeeTagsAs: ({customTagName}: EmployeesSeeTagsAsParams) => ` <muted-text>I dipendenti vedono i tag come <strong>${customTagName}</strong>.</muted-text>`,
importedFromAccountingSoftware: 'I tag qui sotto sono importati dal tuo',
glCode: 'Codice GL',
updateGLCodeFailureMessage: "Si è verificato un errore durante l'aggiornamento del codice GL, riprova.",
tagRules: 'Regole dei tag',
Expand Down
4 changes: 1 addition & 3 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ import type {
EditDestinationSubtitleParams,
ElectronicFundsParams,
EmployeeInviteMessageParams,
EmployeesSeeTagsAsParams,
EmptyCategoriesSubtitleWithAccountingParams,
EmptyTagsSubtitleWithAccountingParams,
EnableContinuousReconciliationParams,
Expand Down Expand Up @@ -4856,8 +4855,7 @@ const translations = {
existingTagError: 'この名前のタグはすでに存在します',
invalidTagNameError: 'タグ名は0にできません。別の値を選んでください。',
genericFailureMessage: 'タグの更新中にエラーが発生しました。もう一度お試しください。',
importedFromAccountingSoftware: 'タグは次で管理されています:',
employeesSeeTagsAs: ({customTagName}: EmployeesSeeTagsAsParams) => ` <muted-text>従業員にはタグが次のように表示されます: <strong>${customTagName}</strong>.</muted-text>`,
importedFromAccountingSoftware: '以下のタグはあなたのからインポートされます',
glCode: 'GLコード',
updateGLCodeFailureMessage: 'GLコードの更新中にエラーが発生しました。もう一度お試しください。',
tagRules: 'タグルール',
Expand Down
4 changes: 1 addition & 3 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ import type {
EditDestinationSubtitleParams,
ElectronicFundsParams,
EmployeeInviteMessageParams,
EmployeesSeeTagsAsParams,
EmptyCategoriesSubtitleWithAccountingParams,
EmptyTagsSubtitleWithAccountingParams,
EnableContinuousReconciliationParams,
Expand Down Expand Up @@ -4889,8 +4888,7 @@ const translations = {
existingTagError: 'Er bestaat al een tag met deze naam.',
invalidTagNameError: 'Tagnaam kan niet 0 zijn. Kies een andere waarde.',
genericFailureMessage: 'Er is een fout opgetreden bij het bijwerken van de tag, probeer het alstublieft opnieuw.',
importedFromAccountingSoftware: 'Tags worden beheerd in je',
employeesSeeTagsAs: ({customTagName}: EmployeesSeeTagsAsParams) => `<muted-text>Werknemers zien tags als <strong>${customTagName}</strong>.</muted-text>`,
importedFromAccountingSoftware: 'De onderstaande labels zijn geïmporteerd uit uw',
glCode: 'GL-code',
updateGLCodeFailureMessage: 'Er is een fout opgetreden bij het bijwerken van de GL-code, probeer het alstublieft opnieuw.',
tagRules: 'Tagregels',
Expand Down
5 changes: 0 additions & 5 deletions src/languages/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ type AddressLineParams = {
lineNumber: number;
};

type EmployeesSeeTagsAsParams = {
customTagName: string;
};

type CharacterLimitParams = {
limit: number | string;
};
Expand Down Expand Up @@ -1245,7 +1241,6 @@ export type {
BusinessRegistrationNumberParams,
DependentMultiLevelTagsSubtitleParams,
PayAndDowngradeDescriptionParams,
EmployeesSeeTagsAsParams,
DisconnectYourBankAccountParams,
MergeAccountIntoParams,
};
4 changes: 1 addition & 3 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ import type {
EditDestinationSubtitleParams,
ElectronicFundsParams,
EmployeeInviteMessageParams,
EmployeesSeeTagsAsParams,
EmptyCategoriesSubtitleWithAccountingParams,
EmptyTagsSubtitleWithAccountingParams,
EnableContinuousReconciliationParams,
Expand Down Expand Up @@ -4879,8 +4878,7 @@ const translations = {
existingTagError: 'Tag o tej nazwie już istnieje',
invalidTagNameError: 'Nazwa tagu nie może być 0. Proszę wybrać inną wartość.',
genericFailureMessage: 'Wystąpił błąd podczas aktualizacji tagu, spróbuj ponownie.',
importedFromAccountingSoftware: 'Tagi są zarządzane w Twoim',
employeesSeeTagsAs: ({customTagName}: EmployeesSeeTagsAsParams) => `<muted-text>Pracownicy widzą tagi jako <strong>${customTagName}</strong>.</muted-text>`,
importedFromAccountingSoftware: 'Tagi poniżej są importowane z twojego',
glCode: 'Kod GL',
updateGLCodeFailureMessage: 'Wystąpił błąd podczas aktualizacji kodu GL, spróbuj ponownie.',
tagRules: 'Zasady tagów',
Expand Down
4 changes: 1 addition & 3 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ import type {
EditDestinationSubtitleParams,
ElectronicFundsParams,
EmployeeInviteMessageParams,
EmployeesSeeTagsAsParams,
EmptyCategoriesSubtitleWithAccountingParams,
EmptyTagsSubtitleWithAccountingParams,
EnableContinuousReconciliationParams,
Expand Down Expand Up @@ -4884,8 +4883,7 @@ const translations = {
existingTagError: 'Uma tag com este nome já existe',
invalidTagNameError: 'O nome da tag não pode ser 0. Por favor, escolha um valor diferente.',
genericFailureMessage: 'Ocorreu um erro ao atualizar a tag, por favor, tente novamente.',
importedFromAccountingSoftware: 'As tags são gerenciadas no seu',
employeesSeeTagsAs: ({customTagName}: EmployeesSeeTagsAsParams) => `<muted-text>Os funcionários veem as tags como <strong>${customTagName}</strong>.</muted-text>`,
importedFromAccountingSoftware: 'As tags abaixo são importadas do seu',
glCode: 'Código GL',
updateGLCodeFailureMessage: 'Ocorreu um erro ao atualizar o código GL, por favor, tente novamente.',
tagRules: 'Regras de tag',
Expand Down
4 changes: 1 addition & 3 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ import type {
EditDestinationSubtitleParams,
ElectronicFundsParams,
EmployeeInviteMessageParams,
EmployeesSeeTagsAsParams,
EmptyCategoriesSubtitleWithAccountingParams,
EmptyTagsSubtitleWithAccountingParams,
EnableContinuousReconciliationParams,
Expand Down Expand Up @@ -4794,8 +4793,7 @@ const translations = {
existingTagError: '具有此名称的标签已存在',
invalidTagNameError: '标签名称不能为0。请选择其他值。',
genericFailureMessage: '更新标签时发生错误,请重试。',
importedFromAccountingSoftware: '标签在您的系统中管理',
employeesSeeTagsAs: ({customTagName}: EmployeesSeeTagsAsParams) => `<muted-text>员工看到的标签为 <strong>${customTagName}</strong>。</muted-text>`,
importedFromAccountingSoftware: '以下标签是从您的...导入的',
glCode: 'GL代码',
updateGLCodeFailureMessage: '更新总账代码时发生错误,请重试。',
tagRules: '标签规则',
Expand Down
8 changes: 1 addition & 7 deletions src/pages/workspace/tags/WorkspaceTagsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -610,16 +610,10 @@ function WorkspaceTagsPage({route}: WorkspaceTagsPageProps) {
currentConnectionName={currentConnectionName}
connectedIntegration={connectedIntegration}
translatedText={translate('workspace.tags.importedFromAccountingSoftware')}
customTagName={policyTagLists.at(0)?.name ?? ''}
isDisplayingTags
/>
) : (
<Text style={[styles.textNormal, styles.colorMuted]}>
{!hasDependentTags && !!policyTagLists.at(0)?.name && (
<View style={[styles.renderHTML]}>
<RenderHTML html={translate('workspace.tags.employeesSeeTagsAs', {customTagName: policyTagLists.at(0)?.name ?? ''})} />
</View>
)}
{translate('workspace.tags.subtitle')}
Comment thread
amyevans marked this conversation as resolved.
{hasDependentTags && (
<View style={[styles.renderHTML]}>
<RenderHTML
Expand Down
17 changes: 7 additions & 10 deletions tests/ui/WorkspaceTagsTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {act, fireEvent, render, screen, waitFor} from '@testing-library/react-na
import React from 'react';
import Onyx from 'react-native-onyx';
import ComposeProviders from '@components/ComposeProviders';
import HTMLEngineProvider from '@components/HTMLEngineProvider';
import {LocaleContextProvider} from '@components/LocaleContextProvider';
import OnyxListItemProvider from '@components/OnyxListItemProvider';
import {CurrentReportIDContextProvider} from '@hooks/useCurrentReportID';
Expand Down Expand Up @@ -32,15 +31,13 @@ const renderPage = (initialRouteName: typeof SCREENS.WORKSPACE.TAGS, initialPara
<ComposeProviders components={[OnyxListItemProvider, LocaleContextProvider, CurrentReportIDContextProvider]}>
<PortalProvider>
<NavigationContainer>
<HTMLEngineProvider>
<Stack.Navigator initialRouteName={initialRouteName}>
<Stack.Screen
name={SCREENS.WORKSPACE.TAGS}
component={WorkspaceTagsPage}
initialParams={initialParams}
/>
</Stack.Navigator>
</HTMLEngineProvider>
<Stack.Navigator initialRouteName={initialRouteName}>
Comment thread
amyevans marked this conversation as resolved.
<Stack.Screen
name={SCREENS.WORKSPACE.TAGS}
component={WorkspaceTagsPage}
initialParams={initialParams}
/>
</Stack.Navigator>
</NavigationContainer>
</PortalProvider>
</ComposeProviders>,
Expand Down
Loading