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

Add get assistance page #6903

Merged
merged 46 commits into from
Jan 11, 2022
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
d3d348d
Rename unused shouldShowInboxCallButton prop to shouldShowGetAssistan…
puneetlath Dec 25, 2021
b61f5d1
Set prop to show get assistance button on all workspace pages
puneetlath Dec 25, 2021
ce41d89
Add copy for get assistance page
puneetlath Dec 25, 2021
0fd511c
Replace InboxCallButton with GetAssistanceButton in Header
puneetlath Dec 25, 2021
80ff0c8
Add shell get assistance page
puneetlath Dec 25, 2021
fcd0be1
Add routing to get assistance page
puneetlath Dec 26, 2021
7f5c4a9
Add back button to get assistance page
puneetlath Dec 26, 2021
ef16935
Add withLocalize to GetAssistancePage
puneetlath Dec 26, 2021
60ea2e0
Add menu items for chat and phone to GetAssistancePage
puneetlath Dec 26, 2021
5cf67ae
Add navigate to concierge chat funcionality to GetAssistancePage
puneetlath Dec 26, 2021
f9673f5
Fix issue where navigating to concierge only works every other time
puneetlath Dec 26, 2021
7605bca
Add navigate to RequestCallPage funcionality to GetAssistancePage
puneetlath Dec 26, 2021
db07088
Have back button on RequestCallPage go back to previous screen
puneetlath Dec 26, 2021
b830a11
Remove deprecated InboxCallButton component
puneetlath Dec 26, 2021
df687e1
Move GetAssistancePage into workspace folder
puneetlath Dec 27, 2021
eca8105
Update with proper spanish translations
puneetlath Dec 27, 2021
ba68fca
Update get assistance routing to be within workspace section
puneetlath Dec 27, 2021
84956dd
Update HeaderWithCloseButton to take policyID as optional prop
puneetlath Dec 27, 2021
7a2179c
Update GetAssistance description spanish translation
puneetlath Dec 29, 2021
03d2d07
Add question mark icon for get assistance
puneetlath Dec 30, 2021
3daf59d
Decouple get assistance route from workspace route
puneetlath Dec 31, 2021
b220f44
Remove policyID prop from HeaderWithCloseButton
puneetlath Jan 1, 2022
f25a6c3
Store last accessed workspace in Onyx whenever workspace is loaded
puneetlath Jan 1, 2022
bf18efd
Add guides call task ID to get assistance route params
puneetlath Jan 1, 2022
d092282
Add guides call task IDs as constants
puneetlath Jan 1, 2022
79a2d29
Pass the guides call task ID to header as a prop from all workspace p…
puneetlath Jan 1, 2022
b1a165b
Pass the guides call task ID from get assistance page to request call…
puneetlath Jan 1, 2022
9e85a73
Navigate back instead of to concierge dm after requesting call
puneetlath Jan 2, 2022
270d1a4
Refactor GetAssistancePage into stateless functional component
puneetlath Jan 2, 2022
69c3b09
Update VideoChatButtonAndMenu to use guides call constant instead of …
puneetlath Jan 2, 2022
aec2cc7
If there is a lastAccessedWorkspace in Onyx, use that for the guides …
puneetlath Jan 3, 2022
48c958e
Revert fix to issue where navigating to concierge only works every ot…
puneetlath Jan 6, 2022
a422846
Update Onyx key from lastAccessedWorkspace to lastAccessedWorkspacePo…
puneetlath Jan 6, 2022
aacd612
Add concierge exclamation illustration
puneetlath Jan 6, 2022
a80903b
Refactor WorkspaceSection component to be more generic PageSectionWit…
puneetlath Jan 6, 2022
eb9f657
Move GetAssistancePage out of workspace folder to main pages folder
puneetlath Jan 8, 2022
1328374
Refactor GetAssistancePage to use PageSectionWithIcon
puneetlath Jan 8, 2022
c8801d0
Rename PageSectionWithIcon to Section
puneetlath Jan 10, 2022
af45f1c
Refactor RequestCallPage to use Section
puneetlath Jan 10, 2022
a4ff986
Improve the code for getting the policy ID for Guides call
puneetlath Jan 10, 2022
7cd2d05
Remove no longer used growlMessageNoPersonalPolicy
puneetlath Jan 10, 2022
cf5171c
Merge branch 'main' into puneet-workspace-assistance
puneetlath Jan 10, 2022
6fe09f4
Merge branch 'main' into puneet-workspace-assistance
puneetlath Jan 10, 2022
d076173
Fix personal details error messages I messed up on merge
puneetlath Jan 10, 2022
a571966
Minor style fixes
puneetlath Jan 11, 2022
b5b1dcc
Make policy id in comment policyID to make it more searchable
puneetlath Jan 11, 2022
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
12 changes: 12 additions & 0 deletions assets/images/question-mark-circle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,18 @@ const CONST = {
PREFIX: '__predefined_',
SELF_SELECT: '__predefined_selfSelect',
},
GUIDES_CALL_TASK_IDS: {
CONCIERGE_DM: 'NewExpensifyConciergeDM',
WORKSPACE_INITIAL: 'WorkspaceHome',
WORKSPACE_SETTINGS: 'WorkspaceGeneralSettings',
WORKSPACE_CARD: 'WorkspaceCorporateCards',
WORKSPACE_REIMBURSE: 'WorkspaceReimburseReceipts',
WORKSPACE_BILLS: 'WorkspacePayBills',
WORKSPACE_INVOICES: 'WorkspaceSendInvoices',
WORKSPACE_TRAVEL: 'WorkspaceBookTravel',
WORKSPACE_MEMBERS: 'WorkspaceManageMembers',
WORKSPACE_BANK_ACCOUNT: 'WorkspaceBankAccount',
},
get EXPENSIFY_EMAILS() {
return [
this.EMAIL.CONCIERGE,
Expand Down
2 changes: 2 additions & 0 deletions src/ONYXKEYS.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,6 @@ export default {
// Stores information about active wallet transfer amount, selectedAccountID, status, etc
WALLET_TRANSFER: 'walletTransfer',

// The policy id of the last workspace whose settings were accessed by the user
puneetlath marked this conversation as resolved.
Show resolved Hide resolved
LAST_ACCESSED_WORKSPACE_POLICY_ID: 'lastAccessedWorkspacePolicyID',
};
2 changes: 2 additions & 0 deletions src/ROUTES.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ export default {
getReportDetailsRoute: reportID => `r/${reportID}/details`,
LOGIN_WITH_SHORT_LIVED_TOKEN: 'transition',
VALIDATE_LOGIN: 'v/:accountID/:validateCode',
GET_ASSISTANCE: 'get-assistance/:taskID',
getGetAssistanceRoute: taskID => `get-assistance/${taskID}`,

// This is a special validation URL that will take the user to /workspace/new after validation. This is used
// when linking users from e.com in order to share a session in this app.
Expand Down
29 changes: 21 additions & 8 deletions src/components/HeaderWithCloseButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import {
} from 'react-native';
import styles from '../styles/styles';
import Header from './Header';
import Navigation from '../libs/Navigation/Navigation';
import ROUTES from '../ROUTES';
import Icon from './Icon';
import * as Expensicons from './Icon/Expensicons';
import withLocalize, {withLocalizePropTypes} from './withLocalize';
import Tooltip from './Tooltip';
import InboxCallButton from './InboxCallButton';
import ThreeDotsMenu, {ThreeDotsMenuItemPropTypes} from './ThreeDotsMenu';

const propTypes = {
Expand Down Expand Up @@ -40,8 +41,8 @@ const propTypes = {
/** Whether we should show a download button */
shouldShowDownloadButton: PropTypes.bool,

/** Whether we should show a inbox call button */
shouldShowInboxCallButton: PropTypes.bool,
/** Whether we should show a get assistance (question mark) button */
shouldShowGetAssistanceButton: PropTypes.bool,

/** Whether we should show a more options (threedots) button */
shouldShowThreeDotsButton: PropTypes.bool,
Expand All @@ -63,8 +64,8 @@ const propTypes = {
/** Whether we should show the step counter */
shouldShowStepCounter: PropTypes.bool,

/** The task ID to associate with the call button, if we show it */
inboxCallTaskID: PropTypes.string,
/** The guides call task ID to associate with the get assistance button, if we show it */
puneetlath marked this conversation as resolved.
Show resolved Hide resolved
guidesCallTaskID: PropTypes.string,

/** Data to display a step counter in the header */
stepCounter: PropTypes.shape({
Expand All @@ -85,11 +86,11 @@ const defaultProps = {
shouldShowBackButton: false,
shouldShowBorderBottom: false,
shouldShowDownloadButton: false,
shouldShowInboxCallButton: false,
shouldShowGetAssistanceButton: false,
shouldShowThreeDotsButton: false,
shouldShowCloseButton: true,
shouldShowStepCounter: true,
inboxCallTaskID: '',
guidesCallTaskID: '',
stepCounter: null,
threeDotsMenuItems: [],
threeDotsAnchorPosition: {
Expand Down Expand Up @@ -138,7 +139,19 @@ const HeaderWithCloseButton = props => (
)
}

{props.shouldShowInboxCallButton && <InboxCallButton taskID={props.inboxCallTaskID} />}
{props.shouldShowGetAssistanceButton
&& (
<Tooltip text={props.translate('getAssistancePage.questionMarkButtonTooltip')}>
<TouchableOpacity
onPress={() => Navigation.navigate(ROUTES.getGetAssistanceRoute(props.guidesCallTaskID))}
style={[styles.touchableButtonImage, styles.mr0]}
accessibilityRole="button"
accessibilityLabel={props.translate('getAssistancePage.questionMarkButtonTooltip')}
>
<Icon src={Expensicons.QuestionMark} />
</TouchableOpacity>
</Tooltip>
)}

{props.shouldShowThreeDotsButton && (
<ThreeDotsMenu
Expand Down
2 changes: 2 additions & 0 deletions src/components/Icon/Expensicons.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import PinCircle from '../../../assets/images/pin-circle.svg';
import Plus from '../../../assets/images/plus.svg';
import Printer from '../../../assets/images/printer.svg';
import Profile from '../../../assets/images/profile.svg';
import QuestionMark from '../../../assets/images/question-mark-circle.svg';
import Receipt from '../../../assets/images/receipt.svg';
import ReceiptSearch from '../../../assets/images/receipt-search.svg';
import RotateLeft from '../../../assets/images/rotate-left.svg';
Expand Down Expand Up @@ -123,6 +124,7 @@ export {
Plus,
Printer,
Profile,
QuestionMark,
Receipt,
ReceiptSearch,
RotateLeft,
Expand Down
2 changes: 2 additions & 0 deletions src/components/Icon/Illustrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import BankArrowPink from '../../../assets/images/product-illustrations/bank-arr
import BankMouseGreen from '../../../assets/images/product-illustrations/bank-mouse--green.svg';
import BankUserGreen from '../../../assets/images/product-illustrations/bank-user--green.svg';
import ConciergeBlue from '../../../assets/images/product-illustrations/concierge--blue.svg';
import ConciergeExclamation from '../../../assets/images/product-illustrations/concierge--exclamation.svg';
import CreditCardsBlue from '../../../assets/images/product-illustrations/credit-cards--blue.svg';
import InvoiceOrange from '../../../assets/images/product-illustrations/invoice--orange.svg';
import JewelBoxBlue from '../../../assets/images/product-illustrations/jewel-box--blue.svg';
Expand All @@ -19,6 +20,7 @@ export {
BankMouseGreen,
BankUserGreen,
ConciergeBlue,
ConciergeExclamation,
CreditCardsBlue,
InvoiceOrange,
JewelBoxBlue,
Expand Down
41 changes: 0 additions & 41 deletions src/components/InboxCallButton.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';
import {View} from 'react-native';
import PropTypes from 'prop-types';
import Text from '../../components/Text';
import styles from '../../styles/styles';
import MenuItemList from '../../components/MenuItemList';
import Icon from '../../components/Icon';
import menuItemPropTypes from '../../components/menuItemPropTypes';
import Text from './Text';
import styles from '../styles/styles';
import MenuItemList from './MenuItemList';
import Icon from './Icon';
import menuItemPropTypes from './menuItemPropTypes';

const propTypes = {
/** An array of props that are pass to individual MenuItem components */
Expand All @@ -31,7 +31,7 @@ const defaultProps = {
IconComponent: null,
};

const WorkspaceSection = (props) => {
const Section = (props) => {
puneetlath marked this conversation as resolved.
Show resolved Hide resolved
const IconComponent = props.IconComponent;
return (
<>
Expand All @@ -56,8 +56,8 @@ const WorkspaceSection = (props) => {
);
};

WorkspaceSection.displayName = 'WorkspaceSection';
WorkspaceSection.propTypes = propTypes;
WorkspaceSection.defaultProps = defaultProps;
Section.displayName = 'Section';
Section.propTypes = propTypes;
Section.defaultProps = defaultProps;

export default WorkspaceSection;
export default Section;
2 changes: 1 addition & 1 deletion src/components/VideoChatButtonAndMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class VideoChatButtonAndMenu extends Component {
onPress={() => {
// If this is the Concierge chat, we'll open the modal for requesting a setup call instead
if (this.props.isConcierge) {
Navigation.navigate(ROUTES.getRequestCallRoute('NewExpensifyConciergeDM'));
Navigation.navigate(ROUTES.getRequestCallRoute(CONST.GUIDES_CALL_TASK_IDS.CONCIERGE_DM));
return;
}
this.toggleVideoChatMenu();
Expand Down
9 changes: 8 additions & 1 deletion src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -805,14 +805,21 @@ export default {
clearProgress: 'Starting over will clear the progress you have made so far.',
},
},
getAssistancePage: {
title: 'Get assistance',
subtitle: 'Have questions, or need help?',
description: 'We have answers! Choose from the support options below:',
chatWithConcierge: 'Chat with Concierge',
requestSetupCall: 'Request a setup call',
questionMarkButtonTooltip: 'Get assistance from our team',
},
requestCallPage: {
title: 'Request a call',
subtitle: 'Have questions, or need help?',
description: 'Our team of guides are on hand to help you each step of the way. Type in your name and phone number, and we’ll give you a call back.',
callMe: 'Call me',
growlMessageOnSave: 'Call requested.',
growlMessageEmptyName: 'Please provide both a first and last name so our guides know how to address you!',
growlMessageNoPersonalPolicy: 'I wasn\'t able to find a personal policy to associate this Guides call with, please check your connection and try again.',
callButton: 'Call',
callButtonTooltip: 'Get live help from our team',
},
Expand Down
9 changes: 8 additions & 1 deletion src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -807,14 +807,21 @@ export default {
clearProgress: 'Empezar de nuevo descartará lo completado hasta ahora.',
},
},
getAssistancePage: {
title: 'Obtener ayuda',
subtitle: '¿Tienes preguntas o necesitas ayuda?',
description: '¡Tenemos las respuestas! Elige una de las siguientes opciones:',
chatWithConcierge: 'Chatear con Concierge',
requestSetupCall: 'Llámame por teléfono',
questionMarkButtonTooltip: 'Obtén ayuda de nuestro equipo',
},
requestCallPage: {
title: 'Llámame por teléfono',
subtitle: '¿Tienes preguntas o necesitas ayuda?',
description: '¿Necesitas ayuda configurando tu cuenta? Nuestro equipo de guías puede ayudarte. Escribe tu nombre y número de teléfono y te llamaremos.',
callMe: 'Llámame',
growlMessageOnSave: 'Llamada solicitada.',
growlMessageEmptyName: 'Por favor ingresa tu nombre completo',
growlMessageNoPersonalPolicy: 'No he podido encontrar una póliza personal con la que asociar esta llamada a las Guías, compruebe su conexión e inténtelo de nuevo.',
callButton: 'Llamar',
callButtonTooltip: 'Recibe ayuda telefónica de nuestro equipo',
},
Expand Down
5 changes: 5 additions & 0 deletions src/libs/Navigation/AppNavigator/ModalStackNavigators.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import NewChatPage from '../../../pages/NewChatPage';
import NewGroupPage from '../../../pages/NewGroupPage';
import SearchPage from '../../../pages/SearchPage';
import DetailsPage from '../../../pages/DetailsPage';
import GetAssistancePage from '../../../pages/GetAssistancePage';
import IOURequestPage from '../../../pages/iou/IOURequestPage';
import IOUBillPage from '../../../pages/iou/IOUBillPage';
import IOUSendPage from '../../../pages/iou/IOUSendPage';
Expand Down Expand Up @@ -271,6 +272,10 @@ const SettingsModalStackNavigator = createModalStackNavigator([
name: 'ReimbursementAccount',
initialParams: {stepToOpen: CONST.BANK_ACCOUNT.STEP.BANK_ACCOUNT},
},
{
Component: GetAssistancePage,
name: 'GetAssistance',
},
]);

const EnablePaymentsStackNavigator = createModalStackNavigator([{
Expand Down
3 changes: 3 additions & 0 deletions src/libs/Navigation/linkingConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ export default {
path: ROUTES.BANK_ACCOUNT_WITH_STEP_TO_OPEN,
exact: true,
},
GetAssistance: {
path: ROUTES.GET_ASSISTANCE,
},
puneetlath marked this conversation as resolved.
Show resolved Hide resolved
},
},
Report_Details: {
Expand Down
8 changes: 3 additions & 5 deletions src/libs/actions/Inbox.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import Onyx from 'react-native-onyx';
import CONST from '../../CONST';
import ONYXKEYS from '../../ONYXKEYS';
import * as API from '../API';
import Growl from '../Growl';
import * as Localize from '../Localize';
import * as Report from './Report';
import Navigation from '../Navigation/Navigation';

/**
* @param {Object} params
Expand All @@ -13,10 +12,9 @@ import * as Report from './Report';
* @param {String} firstName
* @param {String} lastName
* @param {String} phoneNumber
* @param {String} email
*/
function requestInboxCall({
taskID, policyID, firstName, lastName, phoneNumber, email,
taskID, policyID, firstName, lastName, phoneNumber,
}) {
Onyx.merge(ONYXKEYS.REQUEST_CALL_FORM, {loading: true});
API.Inbox_CallUser({
Expand All @@ -29,7 +27,7 @@ function requestInboxCall({
.then((result) => {
if (result.jsonCode === 200) {
Growl.success(Localize.translateLocal('requestCallPage.growlMessageOnSave'));
Report.fetchOrCreateChatReport([email, CONST.EMAIL.CONCIERGE], true);
puneetlath marked this conversation as resolved.
Show resolved Hide resolved
Navigation.goBack();
return;
}

Expand Down
9 changes: 9 additions & 0 deletions src/libs/actions/Policy.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,14 @@ function hideWorkspaceAlertMessage(policyID) {
Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, {alertMessage: ''});
}

/**
* Stores in Onyx the policy ID of the last workspace that was accessed by the user
* @param {String} policyID
*/
function updateLastAccessedWorkspace(policyID) {
Onyx.set(ONYXKEYS.LAST_ACCESSED_WORKSPACE_POLICY_ID, policyID);
}

export {
getPolicyList,
loadFullPolicy,
Expand All @@ -417,4 +425,5 @@ export {
deletePolicy,
createAndNavigate,
createAndGetPolicyList,
updateLastAccessedWorkspace,
};
Loading