Skip to content

Commit 620cfab

Browse files
authored
sync features and bugfixs from 94b20ac (#1656)
1 parent 0b143b8 commit 620cfab

File tree

650 files changed

+13845
-4580
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

650 files changed

+13845
-4580
lines changed

.sync

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1fc429fc05d35d58ca7af09292ec641530ff066f
1+
94b20ac373f4b4b2b76a4023a3f2e369eb193d91

packages/engage-voice-widget/components/ActivityCallLogPanel/ActivityCallLogPanel.spec.tsx

Lines changed: 14 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ function setup(
6969
onActive = () => {},
7070
showMuteButton = false,
7171
ivrAlertData = defaultIVRAlertData,
72+
showSmallCallControl = true,
7273
}: Partial<ActivityCallLogPanelProps> = {} as any,
7374
) {
7475
return mount(
@@ -107,6 +108,7 @@ function setup(
107108
showMuteButton={showMuteButton}
108109
ivrAlertData={ivrAlertData}
109110
onCopySuccess={() => {}}
111+
showSmallCallControl={showSmallCallControl}
110112
/>
111113
</RcThemeProvider>,
112114
);
@@ -135,12 +137,7 @@ const getControlButton = (type) => {
135137
click: () => isExist && button.find('button').simulate('click'),
136138
title: isExist && button.find('CircleIconButton').prop('title'),
137139
isActive: isExist && button.find('button').hasClass('buttonActive'),
138-
isDisabled:
139-
isExist &&
140-
!!button
141-
.find('button')
142-
.render()
143-
.attr('disabled'),
140+
isDisabled: isExist && !!button.find('button').render().attr('disabled'),
144141
};
145142
};
146143

@@ -371,16 +368,10 @@ describe('<ActivityCallLogPanel />', async () => {
371368
expect(wrapper.find('ActiveCallButton')).toHaveLength(1);
372369
expect(getControlButton('HandUpButton').isExist).toBe(false);
373370
expect(
374-
wrapper
375-
.find('ActiveCallButton')
376-
.find('button')
377-
.hasClass('buttonActive'),
371+
wrapper.find('ActiveCallButton').find('button').hasClass('buttonActive'),
378372
).toBe(true);
379373

380-
wrapper
381-
.find('ActiveCallButton')
382-
.find('button')
383-
.simulate('click');
374+
wrapper.find('ActiveCallButton').find('button').simulate('click');
384375
expect(onActive).toBeCalled();
385376
});
386377

@@ -438,12 +429,7 @@ describe('<ActivityCallLogPanel />', async () => {
438429
isOnActive: disableControl === 'disableActive',
439430
showMuteButton: true,
440431
});
441-
expect(
442-
wrapper
443-
.find(domTag)
444-
.find('button')
445-
.prop('disabled'),
446-
).toBe(true);
432+
expect(wrapper.find(domTag).find('button').prop('disabled')).toBe(true);
447433
}),
448434
);
449435

@@ -477,25 +463,12 @@ describe('<ActivityCallLogPanel />', async () => {
477463
const item = wrapper.find('.item');
478464
for (let i = 0; i < ivrAlertData.length; i++) {
479465
if (i !== 0) {
480-
expect(
481-
item
482-
.at(i)
483-
.find('.subject')
484-
.text(),
485-
).toBe(ivrAlertData[i].subject);
486-
expect(
487-
item
488-
.at(i)
489-
.find('.body')
490-
.text(),
491-
).toBe(ivrAlertData[i].body);
466+
expect(item.at(i).find('.subject').text()).toBe(
467+
ivrAlertData[i].subject,
468+
);
469+
expect(item.at(i).find('.body').text()).toBe(ivrAlertData[i].body);
492470
} else {
493-
expect(
494-
item
495-
.at(0)
496-
.find('.body')
497-
.text(),
498-
).toBe(ivrAlertData[0].body);
471+
expect(item.at(0).find('.body').text()).toBe(ivrAlertData[0].body);
499472
}
500473
}
501474
expect(wrapper.find(RcExpansionPanelSummary).text()).toBe(subject);
@@ -506,26 +479,17 @@ describe('<ActivityCallLogPanel />', async () => {
506479
wrapper = setup({
507480
status: 'active',
508481
});
509-
wrapper
510-
.find(RcExpansionPanelSummary)
511-
.find('RcIcon')
512-
.simulate('click');
482+
wrapper.find(RcExpansionPanelSummary).find('RcIcon').simulate('click');
513483
wrapper.update();
514484
expect(
515-
wrapper
516-
.find(RcExpansionPanel)
517-
.find('.expanded')
518-
.exists(),
485+
wrapper.find(RcExpansionPanel).find('.expanded').exists(),
519486
).toBeTruthy();
520487
wrapper = setup({
521488
status: 'callEnd',
522489
});
523490
wrapper.update();
524491
expect(
525-
wrapper
526-
.find(RcExpansionPanel)
527-
.find('.expanded')
528-
.exists(),
492+
wrapper.find(RcExpansionPanel).find('.expanded').exists(),
529493
).toBeFalsy();
530494
});
531495
return null;

packages/engage-voice-widget/components/ActivityCallLogPanel/ActivityCallLogPanel.tsx

Lines changed: 79 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export const ActivityCallLogPanel: FunctionComponent<ActivityCallLogPanelProps>
5656
ivrAlertData,
5757
onCopySuccess,
5858
scrollTo,
59+
referenceFieldOptions,
5960
...rest
6061
}) => {
6162
const transferRef = useRef(null);
@@ -79,12 +80,14 @@ export const ActivityCallLogPanel: FunctionComponent<ActivityCallLogPanelProps>
7980
const editLogSection = useCallback(
8081
(props) => (
8182
<EditLogSection
83+
isWide={isWide}
8284
{...props}
8385
scrollTo={scrollTo}
8486
rootRef={rootRef.current?.editSectionRef}
87+
referenceFieldOptions={referenceFieldOptions}
8588
/>
8689
),
87-
[scrollTo],
90+
[isWide, scrollTo, referenceFieldOptions],
8891
);
8992

9093
return (
@@ -136,7 +139,78 @@ export const ActivityCallLogPanel: FunctionComponent<ActivityCallLogPanelProps>
136139
}}
137140
renderCallLogCallControl={() => {
138141
const isOnTransfer = Boolean(transferEl);
139-
return isCallEnd ? (
142+
return (
143+
!isCallEnd && (
144+
<>
145+
<RcMenu
146+
classes={{ paper: styles.paper }}
147+
anchorEl={transferEl}
148+
open={isOnTransfer}
149+
onClose={handleTransferClose}
150+
data-sign="transferMenu"
151+
>
152+
<RcMenuItem
153+
onClick={() => goToTransferCallPage(transferTypes.internal)}
154+
disabled={!allowTransferCall || disableInternalTransfer}
155+
data-sign="transferItem-internalTransfer"
156+
>
157+
{i18n.getString('internalTransfer', currentLocale)}
158+
</RcMenuItem>
159+
<RcMenuItem
160+
onClick={() => goToTransferCallPage(transferTypes.phoneBook)}
161+
disabled={!allowTransferCall}
162+
data-sign="transferItem-phoneBookTransfer"
163+
>
164+
{i18n.getString('phoneBookTransfer', currentLocale)}
165+
</RcMenuItem>
166+
<RcMenuItem
167+
onClick={() => goToRequeueCallPage()}
168+
disabled={!allowRequeueCall}
169+
data-sign="transferItem-queueTransfer"
170+
>
171+
{i18n.getString('queueTransfer', currentLocale)}
172+
</RcMenuItem>
173+
<RcMenuItem
174+
onClick={() =>
175+
goToTransferCallPage(transferTypes.manualEntry)
176+
}
177+
disabled={!allowTransferCall}
178+
data-sign="transferItem-enterANumber"
179+
>
180+
{i18n.getString('enterANumber', currentLocale)}
181+
</RcMenuItem>
182+
</RcMenu>
183+
<EvSmallCallControl
184+
onMute={onMute}
185+
onUnmute={onUnmute}
186+
onHangup={onHangup}
187+
onReject={onReject}
188+
onHold={onHold}
189+
onTransfer={onTransfer}
190+
onUnHold={onUnHold}
191+
onActive={onActive}
192+
isOnMute={isOnMute}
193+
currentLocale={currentLocale}
194+
isOnTransfer={isOnActive || isOnTransfer}
195+
isOnHold={isOnHold}
196+
transferRef={transferRef}
197+
size={smallCallControlSize}
198+
isInComingCall={isInComingCall}
199+
disableTransfer={disableTransfer}
200+
disableHold={disableHold}
201+
disableHangup={disableHangup}
202+
disableMute={disableMute}
203+
disableActive={disableActive}
204+
isOnActive={isOnActive}
205+
showMuteButton={showMuteButton}
206+
/>
207+
</>
208+
)
209+
);
210+
}}
211+
>
212+
{isCallEnd && (
213+
<div className={classNames(styles.submitButton)}>
140214
<RcButton
141215
data-sign="submit"
142216
size="large"
@@ -147,72 +221,9 @@ export const ActivityCallLogPanel: FunctionComponent<ActivityCallLogPanelProps>
147221
>
148222
{getButtonText(saveStatus, currentLocale)}
149223
</RcButton>
150-
) : (
151-
<>
152-
<RcMenu
153-
classes={{ paper: styles.paper }}
154-
anchorEl={transferEl}
155-
open={isOnTransfer}
156-
onClose={handleTransferClose}
157-
data-sign="transferMenu"
158-
>
159-
<RcMenuItem
160-
onClick={() => goToTransferCallPage(transferTypes.internal)}
161-
disabled={!allowTransferCall || disableInternalTransfer}
162-
data-sign="transferItem-internalTransfer"
163-
>
164-
{i18n.getString('internalTransfer', currentLocale)}
165-
</RcMenuItem>
166-
<RcMenuItem
167-
onClick={() => goToTransferCallPage(transferTypes.phoneBook)}
168-
disabled={!allowTransferCall}
169-
data-sign="transferItem-phoneBookTransfer"
170-
>
171-
{i18n.getString('phoneBookTransfer', currentLocale)}
172-
</RcMenuItem>
173-
<RcMenuItem
174-
onClick={() => goToRequeueCallPage()}
175-
disabled={!allowRequeueCall}
176-
data-sign="transferItem-queueTransfer"
177-
>
178-
{i18n.getString('queueTransfer', currentLocale)}
179-
</RcMenuItem>
180-
<RcMenuItem
181-
onClick={() => goToTransferCallPage(transferTypes.manualEntry)}
182-
disabled={!allowTransferCall}
183-
data-sign="transferItem-enterANumber"
184-
>
185-
{i18n.getString('enterANumber', currentLocale)}
186-
</RcMenuItem>
187-
</RcMenu>
188-
<EvSmallCallControl
189-
onMute={onMute}
190-
onUnmute={onUnmute}
191-
onHangup={onHangup}
192-
onReject={onReject}
193-
onHold={onHold}
194-
onTransfer={onTransfer}
195-
onUnHold={onUnHold}
196-
onActive={onActive}
197-
isOnMute={isOnMute}
198-
currentLocale={currentLocale}
199-
isOnTransfer={isOnActive || isOnTransfer}
200-
isOnHold={isOnHold}
201-
transferRef={transferRef}
202-
size={smallCallControlSize}
203-
isInComingCall={isInComingCall}
204-
disableTransfer={disableTransfer}
205-
disableHold={disableHold}
206-
disableHangup={disableHangup}
207-
disableMute={disableMute}
208-
disableActive={disableActive}
209-
isOnActive={isOnActive}
210-
showMuteButton={showMuteButton}
211-
/>
212-
</>
213-
);
214-
}}
215-
/>
224+
</div>
225+
)}
226+
</CallLogPanel>
216227
);
217228
};
218229

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { StepFunction } from 'crius-test';
2+
3+
import { getCurrentRouteId } from '../../../salesforce-engage-voice/test/utils/getCurrentRouteId';
4+
import { ActivityCallLogPage } from '../../containers/ActivityCallLogPage';
5+
import { moduleUIPageMount } from '../../test/utils';
6+
7+
export const UTActivityCallLogPanel: StepFunction<any, any> = async (
8+
props,
9+
context,
10+
) => {
11+
const id = getCurrentRouteId(context.phone.routerInteraction.currentPath);
12+
13+
const wrapper = moduleUIPageMount(ActivityCallLogPage, { id });
14+
15+
let index = 0;
16+
17+
if (props.menuType === 'whatid') {
18+
index = 1;
19+
}
20+
21+
const getSelectList = () => {
22+
return wrapper
23+
.find('EditLogSection')
24+
.find('CallLogFields')
25+
.find('FieldItem')
26+
.find('SelectList')
27+
.at(index);
28+
};
29+
30+
const openField = getSelectList()
31+
.find('[data-sign="select-list-open"]')
32+
.at(0);
33+
34+
openField.simulate('click');
35+
36+
const addMenuIcon = getSelectList().find(
37+
'RcIconButton[data-sign="addEntityMenu"]',
38+
);
39+
40+
addMenuIcon.simulate('click');
41+
42+
const menuItems = getSelectList().find('RcMenuItem');
43+
44+
const entityName = props.entityName.toLowerCase();
45+
menuItems.find(`[title="Create ${entityName}"]`).simulate('click');
46+
wrapper.unmount();
47+
};

packages/engage-voice-widget/components/ActivityCallLogPanel/IvrInfo/IvrInfo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
RcIcon,
66
RcLink,
77
} from '@ringcentral/juno';
8-
import arrowDownSvg from '@ringcentral/juno/icons/icon-arrow_down.svg';
8+
import arrowDownSvg from '@ringcentral/juno/icon/ArrowDown2';
99
import classNames from 'classnames';
1010
import React, { FunctionComponent, useEffect, useState } from 'react';
1111

packages/engage-voice-widget/components/ActivityCallLogPanel/i18n/en-US.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
export default {
2-
none: 'None',
32
submit: 'Submit',
4-
name: 'Name',
5-
relatedTo: 'Related to',
63
disposition: 'Disposition',
7-
multipleNameMatch: 'Multiple name matches',
8-
multipleRelatedToMatch: 'Multiple related matches',
9-
namePlaceholder: 'Search contact/lead',
10-
relatedToPlaceholder: 'Search account/opportunity...',
114
internalTransfer: 'Internal transfer',
125
phoneBookTransfer: 'Phone book transfer',
136
queueTransfer: 'Queue transfer',

packages/engage-voice-widget/components/ActivityCallLogPanel/styles.scss

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,10 @@ $classic-content-width: 144px;
3838
left: 48px !important;
3939
}
4040
}
41-
41+
.submitButton {
42+
height: 60px;
43+
display: flex;
44+
align-items: center;
45+
padding: 0 $lightning-page-space;
46+
box-shadow: 0 -2px 5px 0 rgba(0, 0, 0, 0.15);
47+
}

0 commit comments

Comments
 (0)