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
3 changes: 3 additions & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2186,6 +2186,8 @@ const translations: TranslationDeepObject<typeof en> = {
profileAvatar: 'Profil-Avatar',
customInstructions: 'Benutzerdefinierte Anweisungen',
copilotIntoAccount: 'Copilot in Konto',
viewUserHistory: 'Nutzerverlauf anzeigen',
viewAgentHistory: 'Agentenverlauf anzeigen',
publicSection: {
title: 'Öffentlich',
subtitle: 'Diese Angaben werden in deinem öffentlichen Profil angezeigt. Jede:r kann sie sehen.',
Expand Down Expand Up @@ -3143,6 +3145,7 @@ ${amount} für ${merchant} – ${date}`,
agentName: 'Name der Agentin/des Agenten',
instructions: 'Eigene Anweisungen schreiben',
chatWithAgent: 'Mit Agent chatten',
viewAgentHistory: 'Agentenverlauf anzeigen',
copilotIntoAccount: 'Copilot ins Konto',
deleteAgent: 'Agent löschen',
deleteAgentTitle: 'Agent löschen?',
Expand Down
3 changes: 3 additions & 0 deletions src/languages/el.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2235,6 +2235,8 @@ const translations: TranslationDeepObject<typeof en> = {
profileAvatar: 'Εικόνα προφίλ',
customInstructions: 'Προσαρμοσμένες οδηγίες',
copilotIntoAccount: 'Οδηγός εντός λογαριασμού',
viewUserHistory: 'Προβολή ιστορικού χρήστη',
viewAgentHistory: 'Προβολή ιστορικού αντιπροσώπου',
publicSection: {
title: 'Δημόσιο',
subtitle: 'Αυτές οι πληροφορίες εμφανίζονται στο δημόσιο προφίλ σας. Μπορεί να τις δει οποιοσδήποτε.',
Expand Down Expand Up @@ -3183,6 +3185,7 @@ ${amount} για ${merchant} - ${date}`,
agentName: 'Όνομα αντιπροσώπου',
instructions: 'Γράψτε προσαρμοσμένες οδηγίες',
chatWithAgent: 'Συνομιλήστε με εκπρόσωπο',
viewAgentHistory: 'Προβολή ιστορικού αντιπροσώπου',
copilotIntoAccount: 'Οδηγός εντός λογαριασμού',
deleteAgent: 'Διαγραφή υπαλλήλου',
deleteAgentTitle: 'Διαγραφή υπαλλήλου;',
Expand Down
3 changes: 3 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2289,6 +2289,8 @@ const translations = {
profileAvatar: 'Profile avatar',
customInstructions: 'Custom instructions',
copilotIntoAccount: 'Copilot into account',
viewUserHistory: 'View user history',
viewAgentHistory: 'View agent history',
publicSection: {
title: 'Public',
subtitle: 'These details are displayed on your public profile. Anyone can see them.',
Expand Down Expand Up @@ -3232,6 +3234,7 @@ const translations = {
agentName: 'Agent name',
instructions: 'Write custom instructions',
chatWithAgent: 'Chat with agent',
viewAgentHistory: 'View agent history',
copilotIntoAccount: 'Copilot into account',
deleteAgent: 'Delete agent',
deleteAgentTitle: 'Delete agent?',
Expand Down
3 changes: 3 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2107,6 +2107,8 @@ const translations: TranslationDeepObject<typeof en> = {
profileAvatar: 'Perfil avatar',
customInstructions: 'Instrucciones personalizadas',
copilotIntoAccount: 'Copilot a la cuenta',
viewUserHistory: 'Ver historial del usuario',
viewAgentHistory: 'Ver historial del agente',
publicSection: {
title: 'Público',
subtitle: 'Estos detalles se muestran en tu perfil público, a disposición de los demás.',
Expand Down Expand Up @@ -3048,6 +3050,7 @@ ${amount} para ${merchant} - ${date}`,
agentName: 'Nombre del agente',
instructions: 'Escribir instrucciones personalizadas',
chatWithAgent: 'Chatear con el agente',
viewAgentHistory: 'Ver historial del agente',
copilotIntoAccount: 'Copilot en la cuenta',
deleteAgent: 'Eliminar agente',
deleteAgentTitle: '¿Eliminar agente?',
Expand Down
3 changes: 3 additions & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2190,6 +2190,8 @@ const translations: TranslationDeepObject<typeof en> = {
profileAvatar: 'Avatar de profil',
customInstructions: 'Instructions personnalisées',
copilotIntoAccount: 'Copilot dans le compte',
viewUserHistory: 'Voir l’historique de l’utilisateur',
viewAgentHistory: 'Voir l’historique de l’agent',
publicSection: {
title: 'Public',
subtitle: 'Ces informations sont affichées sur votre profil public. Tout le monde peut les voir.',
Expand Down Expand Up @@ -3148,6 +3150,7 @@ ${amount} pour ${merchant} - ${date}`,
agentName: 'Nom de l’agent',
instructions: 'Écrire des instructions personnalisées',
chatWithAgent: 'Discuter avec l’agent',
viewAgentHistory: 'Voir l’historique de l’agent',
copilotIntoAccount: 'Copilote dans le compte',
deleteAgent: 'Supprimer l’agent',
deleteAgentTitle: 'Supprimer l’agent ?',
Expand Down
3 changes: 3 additions & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2180,6 +2180,8 @@ const translations: TranslationDeepObject<typeof en> = {
profileAvatar: 'Avatar profilo',
customInstructions: 'Istruzioni personalizzate',
copilotIntoAccount: "Copilot nell'account",
viewUserHistory: 'Visualizza cronologia utente',
viewAgentHistory: 'Visualizza cronologia agente',
publicSection: {
title: 'Pubblico',
subtitle: 'Questi dettagli vengono visualizzati nel tuo profilo pubblico. Chiunque può vederli.',
Expand Down Expand Up @@ -3131,6 +3133,7 @@ ${amount} per ${merchant} - ${date}`,
agentName: 'Nome agente',
instructions: 'Scrivi istruzioni personalizzate',
chatWithAgent: 'Chatta con l’agente',
viewAgentHistory: 'Visualizza cronologia agente',
copilotIntoAccount: 'Copilot nell’account',
deleteAgent: 'Elimina agente',
deleteAgentTitle: 'Eliminare agente?',
Expand Down
3 changes: 3 additions & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2161,6 +2161,8 @@ const translations: TranslationDeepObject<typeof en> = {
profileAvatar: 'プロフィールアバター',
customInstructions: 'カスタム指示',
copilotIntoAccount: 'アカウントにCopilot',
viewUserHistory: 'ユーザー履歴を表示',
viewAgentHistory: 'エージェント履歴を表示',
publicSection: {
title: '公開',
subtitle: 'これらの詳細はあなたの公開プロフィールに表示され、誰でも閲覧できます。',
Expand Down Expand Up @@ -3102,6 +3104,7 @@ ${date} の ${merchant} への ${amount}`,
agentName: '担当者名',
instructions: 'カスタム手順を作成',
chatWithAgent: 'エージェントとチャット',
viewAgentHistory: 'エージェント履歴を表示',
copilotIntoAccount: 'アカウントにコパイロット',
deleteAgent: 'エージェントを削除',
deleteAgentTitle: 'エージェントを削除しますか?',
Expand Down
3 changes: 3 additions & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2177,6 +2177,8 @@ const translations: TranslationDeepObject<typeof en> = {
profileAvatar: 'Profielavatar',
customInstructions: 'Aangepaste instructies',
copilotIntoAccount: 'Copilot naar account',
viewUserHistory: 'Gebruikersgeschiedenis bekijken',
viewAgentHistory: 'Agentgeschiedenis bekijken',
publicSection: {
title: 'Openbaar',
subtitle: 'Deze gegevens worden weergegeven op je openbare profiel. Iedereen kan ze zien.',
Expand Down Expand Up @@ -3134,6 +3136,7 @@ ${amount} voor ${merchant} - ${date}`,
agentName: 'Naam medewerker',
instructions: 'Aangepaste instructies schrijven',
chatWithAgent: 'Chat met agent',
viewAgentHistory: 'Agentgeschiedenis bekijken',
copilotIntoAccount: 'Copilot in account',
deleteAgent: 'Agent verwijderen',
deleteAgentTitle: 'Agent verwijderen?',
Expand Down
3 changes: 3 additions & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2211,6 +2211,8 @@ const translations: TranslationDeepObject<typeof en> = {
profileAvatar: 'Awatar profilu',
customInstructions: 'Niestandardowe instrukcje',
copilotIntoAccount: 'Copilot do konta',
viewUserHistory: 'Zobacz historię użytkownika',
viewAgentHistory: 'Zobacz historię agenta',
publicSection: {
title: 'Public',
subtitle: 'Te dane są wyświetlane w Twoim publicznym profilu. Każdy może je zobaczyć.',
Expand Down Expand Up @@ -3160,6 +3162,7 @@ ${amount} dla ${merchant} - ${date}`,
agentName: 'Nazwa agenta',
instructions: 'Napisz własne instrukcje',
chatWithAgent: 'Czat z agentem',
viewAgentHistory: 'Zobacz historię agenta',
copilotIntoAccount: 'Copilot na konto',
deleteAgent: 'Usuń agenta',
deleteAgentTitle: 'Usunąć agenta?',
Expand Down
3 changes: 3 additions & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2171,6 +2171,8 @@ const translations: TranslationDeepObject<typeof en> = {
profileAvatar: 'Avatar do perfil',
customInstructions: 'Instruções personalizadas',
copilotIntoAccount: 'Copilot na conta',
viewUserHistory: 'Ver histórico do usuário',
viewAgentHistory: 'Ver histórico do agente',
publicSection: {
title: 'Público',
subtitle: 'Esses detalhes são exibidos no seu perfil público. Qualquer pessoa pode vê-los.',
Expand Down Expand Up @@ -3123,6 +3125,7 @@ ${amount} para ${merchant} - ${date}`,
agentName: 'Nome do agente',
instructions: 'Escrever instruções personalizadas',
chatWithAgent: 'Conversar com o agente',
viewAgentHistory: 'Ver histórico do agente',
copilotIntoAccount: 'Copilot na conta',
deleteAgent: 'Excluir agente',
deleteAgentTitle: 'Excluir agente?',
Expand Down
3 changes: 3 additions & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2102,6 +2102,8 @@ const translations: TranslationDeepObject<typeof en> = {
profileAvatar: '个人头像',
customInstructions: '自定义指令',
copilotIntoAccount: 'Copilot 到账户',
viewUserHistory: '查看用户历史记录',
viewAgentHistory: '查看代理历史记录',
publicSection: {
title: '公开',
subtitle: '这些详细信息会显示在你的公开资料中,任何人都可以看到。',
Expand Down Expand Up @@ -3024,6 +3026,7 @@ ${amount},商户:${merchant} - 日期:${date}`,
agentName: '代理人姓名',
instructions: '编写自定义说明',
chatWithAgent: '与代理聊天',
viewAgentHistory: '查看代理历史记录',
copilotIntoAccount: 'Copilot 进入账户',
deleteAgent: '删除代理',
deleteAgentTitle: '删除代理?',
Expand Down
18 changes: 17 additions & 1 deletion src/pages/ProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ import {
isHiddenForCurrentUser as isReportHiddenForCurrentUser,
navigateToPrivateNotes,
} from '@libs/ReportUtils';
import {buildQueryStringFromFilterFormValues} from '@libs/SearchQueryUtils';
import {isAgentEmail} from '@libs/SessionUtils';
import {generateAccountID} from '@libs/UserUtils';
import {isValidAccountRoute} from '@libs/ValidationUtils';

Expand Down Expand Up @@ -96,7 +98,7 @@ function ProfilePage({route}: ProfilePageProps) {
const [guidedSetupAndTourStatus] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {selector: guidedSetupAndTourStatusSelector});
const switchToDelegator = useSwitchToDelegator();
const guideCalendarLink = account?.guideDetails?.calendarLink ?? '';
const expensifyIcons = useMemoizedLazyExpensifyIcons(['Bug', 'Pencil', 'Phone', 'UserPlus']);
const expensifyIcons = useMemoizedLazyExpensifyIcons(['Bug', 'MagnifyingGlass', 'Pencil', 'Phone', 'UserPlus']);
const accountID = Number(route.params?.accountID ?? CONST.DEFAULT_NUMBER_ID);
const [agentPrompt] = useOnyx(`${ONYXKEYS.COLLECTION.SHARED_NVP_AGENT_PROMPT}${accountID}`);
const isCurrentUser = currentUserAccountID === accountID;
Expand Down Expand Up @@ -327,6 +329,20 @@ function ProfilePage({route}: ProfilePageProps) {
onPress={() => switchToDelegator(login)}
/>
)}
{!!accountID && !isAnonymousUserSession() && !!login && (
Comment thread
hungvu193 marked this conversation as resolved.
Resolved
<MenuItem
shouldShowRightIcon
title={translate(isAgentEmail(login) ? 'profilePage.viewAgentHistory' : 'profilePage.viewUserHistory')}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We replaced the MagnifyingGlass icon to History icon and also changed the title text to more relevant See chat history in #102270

icon={expensifyIcons.MagnifyingGlass}
onPress={() => {
const query = buildQueryStringFromFilterFormValues({
type: CONST.SEARCH.DATA_TYPES.CHAT,
from: [String(accountID)],
});
Navigation.revealRouteBeforeDismissingModal(ROUTES.SEARCH_ROOT.getRoute({query, rawQuery: query}));
}}
/>
)}
{shouldShowNotificationPreference && (
<MenuItemField
name={translate('notificationPreferencesPage.label')}
Expand Down
16 changes: 15 additions & 1 deletion src/pages/settings/Agents/EditAgentPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {getRuleBotEnforcedPolicy} from '@libs/AgentRulesUtils';
import Navigation from '@libs/Navigation/Navigation';
import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavigation/types';
import type {SettingsNavigatorParamList} from '@libs/Navigation/types';
import {buildQueryStringFromFilterFormValues} from '@libs/SearchQueryUtils';

import NotFoundPage from '@pages/ErrorPage/NotFoundPage';

Expand All @@ -40,7 +41,7 @@ type EditAgentPageProps = PlatformStackScreenProps<SettingsNavigatorParamList, t
function EditAgentPage({route}: EditAgentPageProps) {
const {translate} = useLocalize();
const styles = useThemeStyles();
const icons = useMemoizedLazyExpensifyIcons(['Trashcan', 'ChatBubble', 'Users']);
const icons = useMemoizedLazyExpensifyIcons(['Trashcan', 'ChatBubble', 'MagnifyingGlass', 'Users']);
const accountID = route.params.accountID;
const [agent, agentMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.SHARED_NVP_AGENT_PROMPT}${accountID}`);
const [personalDetails, personalDetailsMetadata] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: (list) => list?.[accountID]});
Expand Down Expand Up @@ -84,6 +85,13 @@ function EditAgentPage({route}: EditAgentPageProps) {
const handleCopilotPress = () => {
switchToDelegator(agentLogin);
};
const handleViewHistoryPress = () => {
const query = buildQueryStringFromFilterFormValues({
type: CONST.SEARCH.DATA_TYPES.CHAT,
from: [String(accountID)],
});
Navigation.navigate(ROUTES.SEARCH_ROOT.getRoute({query, rawQuery: query}));
};

if (shouldShowNotFoundPage) {
return <NotFoundPage onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_AGENTS)} />;
Expand Down Expand Up @@ -151,6 +159,12 @@ function EditAgentPage({route}: EditAgentPageProps) {
onPress={handleEditPromptPress}
/>
</OfflineWithFeedback>
<MenuItemAction
title={translate('editAgentPage.viewAgentHistory')}
icon={icons.MagnifyingGlass}
onPress={handleViewHistoryPress}
isDisabled={areActionsDisabled}
/>
<MenuItemAction
title={translate('editAgentPage.chatWithAgent')}
icon={icons.ChatBubble}
Expand Down
Loading
Loading