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
15 changes: 7 additions & 8 deletions src/components/DelegateNoAccessModalProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React, {createContext, useMemo, useState} from 'react';
import type {PropsWithChildren} from 'react';
import {View} from 'react-native';
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import useThemeStyles from '@hooks/useThemeStyles';
import AccountUtils from '@libs/AccountUtils';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ConfirmModal from './ConfirmModal';
import Text from './Text';
import TextLink from './TextLink';
import RenderHTML from './RenderHTML';

type DelegateNoAccessContextType = {
/** Whether the current user is acting as delegate */
Expand All @@ -29,6 +29,7 @@ const DelegateNoAccessContext = createContext<DelegateNoAccessContextType>({

function DelegateNoAccessModalProvider({children}: PropsWithChildren) {
const {translate} = useLocalize();
const styles = useThemeStyles();
const [isModalOpen, setIsModalOpen] = useState(false);
const currentUserDetails = useCurrentUserPersonalDetails();
const delegatorEmail = currentUserDetails?.login ?? '';
Expand All @@ -37,11 +38,9 @@ function DelegateNoAccessModalProvider({children}: PropsWithChildren) {
const isDelegateAccessRestricted = isActingAsDelegate && AccountUtils.isDelegateOnlySubmitter(account);

const delegateNoAccessPrompt = (
<Text>
{translate('delegate.notAllowedMessageStart')}
<TextLink href={CONST.DELEGATE_ROLE_HELP_DOT_ARTICLE_LINK}>{translate('delegate.notAllowedMessageHyperLinked')}</TextLink>
{translate('delegate.notAllowedMessageEnd', {accountOwnerEmail: delegatorEmail})}
</Text>
<View style={[styles.renderHTML, styles.flexRow]}>
<RenderHTML html={translate('delegate.notAllowedMessage', {accountOwnerEmail: delegatorEmail})} />
</View>
);
const contextValue = useMemo(
() => ({
Expand Down
5 changes: 2 additions & 3 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6908,9 +6908,8 @@ const translations = {
enterMagicCodeUpdate: ({contactMethod}: EnterMagicCodeParams) => `Bitte geben Sie den magischen Code ein, der an ${contactMethod} gesendet wurde, um Ihren Copilot zu aktualisieren.`,
notAllowed: 'Nicht so schnell...',
noAccessMessage: 'Als Copilot hast du keinen Zugriff auf diese Seite. Entschuldigung!',
notAllowedMessageStart: `Als ein`,
notAllowedMessageHyperLinked: 'Copilot',
notAllowedMessageEnd: ({accountOwnerEmail}: AccountOwnerParams) => `Für ${accountOwnerEmail} haben Sie keine Berechtigung, diese Aktion auszuführen. Entschuldigung!`,
notAllowedMessage: ({accountOwnerEmail}: AccountOwnerParams) =>
`Als <a href="${CONST.DELEGATE_ROLE_HELP_DOT_ARTICLE_LINK}">Copilot</a> für ${accountOwnerEmail} haben Sie nicht die Erlaubnis, diese Aktion durchzuführen. Entschuldigung!`,
copilotAccess: 'Copilot-Zugriff',
},
debug: {
Expand Down
5 changes: 2 additions & 3 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6866,9 +6866,8 @@ const translations = {
enterMagicCodeUpdate: ({contactMethod}: EnterMagicCodeParams) => `Please enter the magic code sent to ${contactMethod} to update your copilot.`,
notAllowed: 'Not so fast...',
noAccessMessage: "As a copilot, you don't have access to \nthis page. Sorry!",
notAllowedMessageStart: `As a`,
notAllowedMessageHyperLinked: ' copilot',
notAllowedMessageEnd: ({accountOwnerEmail}: AccountOwnerParams) => ` for ${accountOwnerEmail}, you don't have permission to take this action. Sorry!`,
notAllowedMessage: ({accountOwnerEmail}: AccountOwnerParams) =>
`As a <a href="${CONST.DELEGATE_ROLE_HELP_DOT_ARTICLE_LINK}">copilot</a> for ${accountOwnerEmail}, you don't have permission to take this action. Sorry!`,
copilotAccess: 'Copilot access',
},
debug: {
Expand Down
5 changes: 2 additions & 3 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7360,9 +7360,8 @@ const translations = {
`Por favor, introduce el código mágico enviado a ${contactMethod} para actualizar el nivel de acceso de tu copiloto.`,
notAllowed: 'No tan rápido...',
noAccessMessage: 'Como copiloto, no tienes acceso a esta página. ¡Lo sentimos!',
notAllowedMessageStart: `Como`,
notAllowedMessageHyperLinked: ' copiloto',
notAllowedMessageEnd: ({accountOwnerEmail}: AccountOwnerParams) => ` de ${accountOwnerEmail}, no tienes permiso para realizar esta acción. ¡Lo siento!`,
notAllowedMessage: ({accountOwnerEmail}: AccountOwnerParams) =>
`Como <a href="${CONST.DELEGATE_ROLE_HELP_DOT_ARTICLE_LINK}">copiloto</a> de ${accountOwnerEmail}, no tienes permiso para realizar esta acción. ¡Lo siento!`,
copilotAccess: 'Acceso a Copilot',
},
debug: {
Expand Down
5 changes: 2 additions & 3 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6919,9 +6919,8 @@ const translations = {
enterMagicCodeUpdate: ({contactMethod}: EnterMagicCodeParams) => `Veuillez entrer le code magique envoyé à ${contactMethod} pour mettre à jour votre copilote.`,
notAllowed: 'Pas si vite...',
noAccessMessage: "En tant que copilote, vous n'avez pas accès à cette page. Désolé !",
notAllowedMessageStart: `En tant que`,
notAllowedMessageHyperLinked: 'copilot',
notAllowedMessageEnd: ({accountOwnerEmail}: AccountOwnerParams) => `pour ${accountOwnerEmail}, vous n'avez pas la permission d'effectuer cette action. Désolé !`,
notAllowedMessage: ({accountOwnerEmail}: AccountOwnerParams) =>
`En tant que <a href="${CONST.DELEGATE_ROLE_HELP_DOT_ARTICLE_LINK}">copilote</a> de ${accountOwnerEmail}, vous n'avez pas la permission d'entreprendre cette action. Désolé de ne pas pouvoir effectuer cette action.`,
copilotAccess: 'Accès Copilot',
},
debug: {
Expand Down
5 changes: 2 additions & 3 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6920,9 +6920,8 @@ const translations = {
enterMagicCodeUpdate: ({contactMethod}: EnterMagicCodeParams) => `Inserisci il codice magico inviato a ${contactMethod} per aggiornare il tuo copilota.`,
notAllowed: 'Non così in fretta...',
noAccessMessage: 'Come copilota, non hai accesso a questa pagina. Mi dispiace!',
notAllowedMessageStart: `Come un/una`,
notAllowedMessageHyperLinked: 'copilota',
notAllowedMessageEnd: ({accountOwnerEmail}: AccountOwnerParams) => `per ${accountOwnerEmail}, non hai il permesso di eseguire questa azione. Mi dispiace!`,
notAllowedMessage: ({accountOwnerEmail}: AccountOwnerParams) =>
`Come <a href="${CONST.DELEGATE_ROLE_HELP_DOT_ARTICLE_LINK}">copilota</a> di ${accountOwnerEmail}, non hai il permesso di eseguire questa azione. Mi dispiace!`,
copilotAccess: 'Accesso Copilot',
},
debug: {
Expand Down
5 changes: 2 additions & 3 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6871,9 +6871,8 @@ const translations = {
enterMagicCodeUpdate: ({contactMethod}: EnterMagicCodeParams) => `コパイロットを更新するために、${contactMethod}に送信されたマジックコードを入力してください。`,
notAllowed: 'ちょっと待ってください…',
noAccessMessage: 'コパイロットとして、このページにアクセスする権限がありません。申し訳ありません!',
notAllowedMessageStart: `As a`,
notAllowedMessageHyperLinked: 'コパイロット',
notAllowedMessageEnd: ({accountOwnerEmail}: AccountOwnerParams) => `${accountOwnerEmail}、この操作を行う権限がありません。申し訳ありません!`,
notAllowedMessage: ({accountOwnerEmail}: AccountOwnerParams) =>
`${accountOwnerEmail} の<a href="${CONST.DELEGATE_ROLE_HELP_DOT_ARTICLE_LINK}">副操縦士</a>として、あなたはこの行動を取る許可を持っていません。申し訳ありません!`,
copilotAccess: 'Copilotアクセス',
},
debug: {
Expand Down
5 changes: 2 additions & 3 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6910,9 +6910,8 @@ const translations = {
enterMagicCodeUpdate: ({contactMethod}: EnterMagicCodeParams) => `Voer de magische code in die naar ${contactMethod} is verzonden om uw copilot bij te werken.`,
notAllowed: 'Niet zo snel...',
noAccessMessage: 'Als copiloot heb je geen toegang tot deze pagina. Sorry!',
notAllowedMessageStart: `Als een`,
notAllowedMessageHyperLinked: 'copilot',
notAllowedMessageEnd: ({accountOwnerEmail}: AccountOwnerParams) => `voor ${accountOwnerEmail}, je hebt geen toestemming om deze actie uit te voeren. Sorry!`,
notAllowedMessage: ({accountOwnerEmail}: AccountOwnerParams) =>
`Als <a href="${CONST.DELEGATE_ROLE_HELP_DOT_ARTICLE_LINK}">copiloot</a> voor ${accountOwnerEmail} heb je geen toestemming om deze actie uit te voeren. Sorry!`,
copilotAccess: 'Copilot-toegang',
},
debug: {
Expand Down
5 changes: 2 additions & 3 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6895,9 +6895,8 @@ const translations = {
enterMagicCodeUpdate: ({contactMethod}: EnterMagicCodeParams) => `Proszę wprowadzić magiczny kod wysłany na ${contactMethod}, aby zaktualizować swojego pilota.`,
notAllowed: 'Nie tak szybko...',
noAccessMessage: 'Jako współpilot nie masz dostępu do tej strony. Przepraszamy!',
notAllowedMessageStart: `Jako`,
notAllowedMessageHyperLinked: 'copilot',
notAllowedMessageEnd: ({accountOwnerEmail}: AccountOwnerParams) => `dla ${accountOwnerEmail}, nie masz uprawnień do wykonania tej akcji. Przepraszamy!`,
notAllowedMessage: ({accountOwnerEmail}: AccountOwnerParams) =>
`Jako <a href="${CONST.DELEGATE_ROLE_HELP_DOT_ARTICLE_LINK}">copilot</a> ${accountOwnerEmail} nie masz uprawnień do wykonania tej akcji. Przepraszamy!`,
copilotAccess: 'Dostęp do Copilot',
},
debug: {
Expand Down
5 changes: 2 additions & 3 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6906,9 +6906,8 @@ const translations = {
enterMagicCodeUpdate: ({contactMethod}: EnterMagicCodeParams) => `Por favor, insira o código mágico enviado para ${contactMethod} para atualizar seu copiloto.`,
notAllowed: 'Não tão rápido...',
noAccessMessage: 'Como copiloto, você não tem acesso a esta página. Desculpe!',
notAllowedMessageStart: `Como um(a)`,
notAllowedMessageHyperLinked: 'copilot',
notAllowedMessageEnd: ({accountOwnerEmail}: AccountOwnerParams) => `para ${accountOwnerEmail}, você não tem permissão para realizar esta ação. Desculpe!`,
notAllowedMessage: ({accountOwnerEmail}: AccountOwnerParams) =>
`Como <a href="${CONST.DELEGATE_ROLE_HELP_DOT_ARTICLE_LINK}">copiloto</a> do ${accountOwnerEmail}, você não tem permissão para realizar essa ação. Desculpe-me!`,
copilotAccess: 'Acesso ao Copilot',
},
debug: {
Expand Down
5 changes: 2 additions & 3 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6777,9 +6777,8 @@ const translations = {
enterMagicCodeUpdate: ({contactMethod}: EnterMagicCodeParams) => `请输入发送到${contactMethod}的验证码以更新您的副驾驶。`,
notAllowed: '慢着...',
noAccessMessage: '作为副驾驶员,您无权访问此页面。抱歉!',
notAllowedMessageStart: `作为一名`,
notAllowedMessageHyperLinked: 'copilot',
notAllowedMessageEnd: ({accountOwnerEmail}: AccountOwnerParams) => `对于${accountOwnerEmail},您没有权限执行此操作。抱歉!`,
notAllowedMessage: ({accountOwnerEmail}: AccountOwnerParams) =>
`作为 ${accountOwnerEmail} 的<a href="${CONST.DELEGATE_ROLE_HELP_DOT_ARTICLE_LINK}">副驾驶员</a>,您无权执行此操作。对不起!`,
copilotAccess: 'Copilot访问权限',
},
debug: {
Expand Down