Skip to content

Commit 2341423

Browse files
brain-frogmolker
andauthored
fix(task): match OutdialCall UI with Figma (#589)
Co-authored-by: molker <molker@cisco.com>
1 parent b1faaed commit 2341423

6 files changed

Lines changed: 2808 additions & 2842 deletions

File tree

packages/contact-center/cc-components/src/components/task/OutdialCall/constants.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ export const OutdialStrings = {
77
INCORRECT_DN_FORMAT: 'Incorrect format.',
88
OUTDIAL_CALL: 'Outdial Call',
99
ADDRESS_BOOK_SEARCH_PLACEHOLDER: 'Search by Name/Number',
10+
ADDRESS_BOOK_NO_RESULTS: 'No address book entries found.',
11+
TAB_ADDRESS_BOOK: 'Address Book',
12+
TAB_DIALPAD: 'Dialpad',
1013
};
1114

1215
// Utility Constants
1316
export const KEY_LIST = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '*', '0', '#'];
17+
export const TABS = {
18+
DIAL_PAD: 'dial_pad',
19+
ADDRESS_BOOK: 'address_book',
20+
};

packages/contact-center/cc-components/src/components/task/OutdialCall/outdial-call.style.scss

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,7 @@
33
flex-direction: column;
44
align-items: center;
55
border-radius: 0.625rem;
6-
width: 15.625rem;
7-
height: 26.5rem;
8-
9-
.keypad {
10-
width: 100%;
11-
}
6+
width: 16.5rem;
127

138
mdc-input {
149
padding-bottom: 0; // default is 1 rem, 1.5 rem needed but provided by .keys
@@ -21,23 +16,27 @@
2116
.outdial-ani-select-container {
2217
position: relative;
2318
width: 100%;
24-
}
25-
26-
.outDialCallButton {
27-
margin-top: 1.5rem;
19+
padding-bottom: 1rem;
2820
}
2921

3022
.outdial-select-arrow-icon {
3123
position: absolute;
32-
right: 0;
33-
top: 83%;
24+
right: 0.375rem;
25+
top: 71%;
3426
transform: translateY(-50%);
3527
display: flex;
3628
align-items: center;
3729
pointer-events: none;
3830
z-index: 1;
3931
}
4032

33+
#outdial-ani-option-select {
34+
width: 100%;
35+
label {
36+
margin: 0;
37+
}
38+
}
39+
4140
.outdial-ani-option-name {
4241
display: flex;
4342
align-items: center;
@@ -51,7 +50,7 @@
5150
column-gap: 1.5rem;
5251
padding: 1.5rem 0;
5352
list-style-type: none;
54-
margin: 0 20%;
53+
margin: 0;
5554
}
5655

5756
.key {
@@ -70,6 +69,13 @@
7069
}
7170
}
7271

72+
.dialpad-tab-container {
73+
display: flex;
74+
flex-direction: column;
75+
align-items: center;
76+
width: 16.5rem;
77+
}
78+
7379
.address-book-container {
7480
width: 100%;
7581
}
@@ -116,25 +122,26 @@
116122
}
117123

118124
.tab-list {
125+
padding-bottom: 1rem;
126+
127+
.container {
128+
display: flex;
129+
justify-content: center;
130+
align-items: center;
131+
width: 100%;
132+
flex: 2;
133+
}
134+
119135
mdc-button {
120136
display: none;
121137
}
122138

123139
mdc-tab {
124-
width: 7.395rem;
125-
padding: 0;
140+
--mdc-tab-glass-active-color: #000000F2;
141+
--mdc-tab-glass-active-background-color-hover: #b2b2b2;
142+
--mdc-tab-glass-active-background-color-normal: #DEDEDE;
126143
}
127-
}
128-
129-
.ani-select-input {
130-
margin-top: 1rem;
144+
131145
}
132146
}
133147

134-
.height-auto {
135-
height: auto;
136-
}
137-
138-
.height-28-5rem {
139-
height: 28.5rem;
140-
}

packages/contact-center/cc-components/src/components/task/OutdialCall/outdial-call.tsx

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {SelectNext} from '@momentum-ui/react-collaboration';
99
import {Item} from '@react-stately/collections';
1010

1111
import {OutdialAniEntry, OutdialCallComponentProps} from '../task.types';
12-
import {OutdialStrings, KEY_LIST} from './constants';
12+
import {OutdialStrings, KEY_LIST, TABS} from './constants';
1313
import {DEFAULT_PAGE_SIZE} from '../constants';
1414
import {createInitials, debounce} from '../CallControl/CallControlCustom/call-control-custom.utils';
1515
import {useIntersectionObserver} from '../../../hooks';
@@ -37,11 +37,6 @@ const OutdialCallComponent: React.FunctionComponent<OutdialCallComponentProps> =
3737
isAddressBookEnabled = true,
3838
} = props;
3939

40-
const TABS = {
41-
DIAL_PAD: 'dial_pad',
42-
ADDRESS_BOOK: 'address_book',
43-
};
44-
4540
// State Hooks
4641
const [selectedTab, setSelectedTab] = useState(TABS.DIAL_PAD);
4742
const [destination, setDestination] = useState('');
@@ -140,7 +135,7 @@ const OutdialCallComponent: React.FunctionComponent<OutdialCallComponentProps> =
140135
}
141136
};
142137

143-
const handleDiapadTabClick = () => {
138+
const handleDialpadTabClick = () => {
144139
setSelectedAddressBookEntry(null);
145140
// Don't clear destination - preserve selected address book entry number
146141
setSelectedTab(TABS.DIAL_PAD);
@@ -252,16 +247,16 @@ const OutdialCallComponent: React.FunctionComponent<OutdialCallComponentProps> =
252247
<Spinner variant="button" />
253248
</div>
254249
) : (
255-
<p>No address book entries found.</p>
250+
<p>{OutdialStrings.ADDRESS_BOOK_NO_RESULTS}</p>
256251
)}
257252
</ul>
258253
</section>
259254
);
260255
};
261256

262-
const renderDiapad = () => {
257+
const renderDialpad = () => {
263258
return (
264-
<section className="keypad" data-testid="outdial-call-container">
259+
<>
265260
<Input
266261
className="outdial-input"
267262
id="outdial-number-input"
@@ -280,18 +275,18 @@ const OutdialCallComponent: React.FunctionComponent<OutdialCallComponentProps> =
280275
<ul className="keys" data-testid="outdial-keypad-keys">
281276
{KEY_LIST.map((key) => (
282277
<li key={key}>
283-
<Button className="key button" onClick={() => handleOnClick(key)}>
278+
<Button className="key" onClick={() => handleOnClick(key)}>
284279
{key}
285280
</Button>
286281
</li>
287282
))}
288283
</ul>
289-
</section>
284+
</>
290285
);
291286
};
292287

293288
return (
294-
<article className={`outdial-container ${isAddressBookEnabled ? 'height-28-5rem' : ''}`}>
289+
<article className="outdial-container" data-testid="outdial-call-container">
295290
{isAddressBookEnabled && (
296291
<>
297292
<TabList activeTabId={selectedTab} dataAriaLabel="Outdial call tabs" className="tab-list">
@@ -301,36 +296,43 @@ const OutdialCallComponent: React.FunctionComponent<OutdialCallComponentProps> =
301296
aria-controls={TABS.ADDRESS_BOOK}
302297
variant="glass"
303298
onClick={handleAddressBookTabClick}
299+
text={OutdialStrings.TAB_ADDRESS_BOOK}
304300
></Tab>
305301

306302
<Tab
307303
iconName="dialpad-bold"
308304
tabId={TABS.DIAL_PAD}
309305
aria-controls={TABS.DIAL_PAD}
310306
variant="glass"
311-
onClick={handleDiapadTabClick}
307+
onClick={handleDialpadTabClick}
308+
text={OutdialStrings.TAB_DIALPAD}
312309
></Tab>
313310
</TabList>
314311

315312
{selectedTab === TABS.ADDRESS_BOOK && (
316-
<div
313+
<section
317314
id={TABS.ADDRESS_BOOK}
318315
role="tabpanel"
319316
aria-labelledby={TABS.ADDRESS_BOOK}
320317
className="address-book-container"
321318
>
322319
{renderAddressBook()}
323-
</div>
320+
</section>
324321
)}
325322
{selectedTab === TABS.DIAL_PAD && (
326-
<div id={TABS.DIAL_PAD} role="tabpanel" aria-labelledby={TABS.DIAL_PAD} className="keypad">
327-
{renderDiapad()}
328-
</div>
323+
<section
324+
id={TABS.DIAL_PAD}
325+
role="tabpanel"
326+
aria-labelledby={TABS.DIAL_PAD}
327+
className="dialpad-tab-container"
328+
>
329+
{renderDialpad()}
330+
</section>
329331
)}
330332
</>
331333
)}
332334

333-
{!isAddressBookEnabled && renderDiapad()}
335+
{!isAddressBookEnabled && renderDialpad()}
334336

335337
<div className="outdial-ani-select-container">
336338
<Icon
@@ -371,7 +373,6 @@ const OutdialCallComponent: React.FunctionComponent<OutdialCallComponentProps> =
371373
<Button
372374
data-testid="outdial-call-button"
373375
prefixIcon={'handset-regular'}
374-
className="outDialCallButton"
375376
onClick={() => {
376377
startOutdial(destination, selectedANI);
377378
// Clear input field after initiating the call

0 commit comments

Comments
 (0)