-
Notifications
You must be signed in to change notification settings - Fork 65
feat(cc): add campaign preview #684
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
Open
cmullenx
wants to merge
13
commits into
webex:next
Choose a base branch
from
cmullenx:chrmulle/campaignPrev
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b083765
feat(cc): add campaign preview
8fce80b
remove dead code
78d5e70
update based on codex pr comment
e9850ce
update based on codex pr comment
b778abb
fix popover styling issue and put campaign in connecting state until …
e8a783a
update based on pr comments
1406aa2
update pr comments
c0f241f
more pr comments
97626eb
more pr review changes
ca1781f
pr changes
ac283ae
more pr fixes
a2cc5df
address codex comment
c620507
pr fix
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
149 changes: 149 additions & 0 deletions
149
...ponents/src/components/task/CampaignTask/CampaignTaskListItem/campaign-task-list-item.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,149 @@ | ||
| import React from 'react'; | ||
| import {Avatar, Button, ListItem, Text, Tooltip} from '@momentum-design/components/dist/react'; | ||
| import CampaignCountdown from '../../CampaignCountdown/campaign-countdown'; | ||
| import TaskTimer from '../../TaskTimer/index'; | ||
| import {CampaignTaskListItemProps} from '../../task.types'; | ||
| import { | ||
| CAMPAIGN_ACCEPT, | ||
| CAMPAIGN_CONNECTING, | ||
| CAMPAIGN_SKIP, | ||
| CAMPAIGN_SKIP_TOOLTIP, | ||
| CAMPAIGN_SKIP_DISABLED_TOOLTIP, | ||
| CAMPAIGN_REMOVE, | ||
| CAMPAIGN_REMOVE_TOOLTIP, | ||
| CAMPAIGN_REMOVE_DISABLED_TOOLTIP, | ||
| CAMPAIGN_ACTIONS_LABEL, | ||
| HANDLE_TIME, | ||
| } from '../../constants'; | ||
|
|
||
| /** | ||
| * CampaignTaskListItem renders the ListItem row shared between the | ||
| * CampaignTask inline card and the CampaignTaskPopover. | ||
| * | ||
| * Layout: Avatar | Title / Phone / Countdown | Accept + Skip/Remove buttons | ||
| */ | ||
| const CampaignTaskListItem: React.FC<CampaignTaskListItemProps> = ({ | ||
| title, | ||
| phoneNumber, | ||
| customerName, | ||
| timeoutTimestamp, | ||
| isAcceptClicked, | ||
| isAccepted, | ||
| isAcceptDisabled, | ||
| isSkipDisabled, | ||
| isRemoveDisabled, | ||
| onAccept, | ||
| onSkip, | ||
| onRemove, | ||
| onTimeout, | ||
| handleTimestamp, | ||
| logger, | ||
| className, | ||
| testIdPrefix = 'campaign-task', | ||
| }) => { | ||
| const skipTooltipText = isSkipDisabled ? CAMPAIGN_SKIP_DISABLED_TOOLTIP : CAMPAIGN_SKIP_TOOLTIP; | ||
| const removeTooltipText = isRemoveDisabled ? CAMPAIGN_REMOVE_DISABLED_TOOLTIP : CAMPAIGN_REMOVE_TOOLTIP; | ||
| const skipButtonId = `${testIdPrefix}-skip-btn`; | ||
| const removeButtonId = `${testIdPrefix}-remove-btn`; | ||
|
|
||
| return ( | ||
| <ListItem className={className} data-testid={`${testIdPrefix}-list-item`}> | ||
| <Avatar slot="leading-controls" icon-name="campaign-management-bold" className="campaign-avatar" /> | ||
|
|
||
| <Text slot="leading-text-primary-label" type="body-large-medium" data-testid={`${testIdPrefix}-title`}> | ||
| {title} | ||
| </Text> | ||
| {customerName && phoneNumber && phoneNumber !== customerName && ( | ||
| <Text slot="leading-text-secondary-label" type="body-midsize-regular" data-testid={`${testIdPrefix}-phone`}> | ||
| {phoneNumber} | ||
| </Text> | ||
| )} | ||
| {!isAccepted && timeoutTimestamp && ( | ||
| <div slot="leading-text-tertiary-label"> | ||
| <CampaignCountdown timeoutTimestamp={timeoutTimestamp} onTimeout={onTimeout} logger={logger} /> | ||
| </div> | ||
| )} | ||
| {isAccepted && handleTimestamp && ( | ||
| <Text | ||
| slot="leading-text-tertiary-label" | ||
| tagname="span" | ||
| type="body-midsize-regular" | ||
| className="campaign-task-handle-time" | ||
| data-testid={`${testIdPrefix}-handle-time`} | ||
| > | ||
| {HANDLE_TIME} <TaskTimer startTimeStamp={handleTimestamp} /> | ||
| </Text> | ||
| )} | ||
|
|
||
| {!isAccepted && ( | ||
| <div | ||
| slot="trailing-controls" | ||
| className="campaign-task-actions" | ||
| aria-label={CAMPAIGN_ACTIONS_LABEL} | ||
| data-testid={`${testIdPrefix}-actions`} | ||
| > | ||
| {!isAcceptClicked ? ( | ||
| <Button | ||
| variant="primary" | ||
| color="positive" | ||
| size={28} | ||
| onClick={onAccept} | ||
| disabled={isAcceptDisabled} | ||
| aria-label={CAMPAIGN_ACCEPT} | ||
| data-testid={`${testIdPrefix}-accept-button`} | ||
| > | ||
| {CAMPAIGN_ACCEPT} | ||
| </Button> | ||
| ) : ( | ||
| <Button | ||
| variant="secondary" | ||
| size={28} | ||
| disabled | ||
| aria-label={CAMPAIGN_CONNECTING} | ||
| data-testid={`${testIdPrefix}-connecting-button`} | ||
| > | ||
| {CAMPAIGN_CONNECTING} | ||
| </Button> | ||
| )} | ||
|
|
||
| <div | ||
| className="campaign-task-skip-remove" | ||
| role="group" | ||
| aria-label={`${CAMPAIGN_SKIP} and ${CAMPAIGN_REMOVE}`} | ||
| data-testid={`${testIdPrefix}-skip-remove`} | ||
| > | ||
| <Button | ||
| id={skipButtonId} | ||
| variant="secondary" | ||
| size={28} | ||
| prefixIcon="skip-bold" | ||
| onClick={onSkip} | ||
| disabled={isSkipDisabled} | ||
| aria-label={CAMPAIGN_SKIP} | ||
| data-testid={`${testIdPrefix}-skip-button`} | ||
| /> | ||
| <Tooltip triggerID={skipButtonId} placement="bottom" tooltipType="label"> | ||
| {skipTooltipText} | ||
| </Tooltip> | ||
|
|
||
| <Button | ||
| id={removeButtonId} | ||
| variant="secondary" | ||
| size={28} | ||
| prefixIcon="remove-bold" | ||
| onClick={onRemove} | ||
| disabled={isRemoveDisabled} | ||
| aria-label={CAMPAIGN_REMOVE} | ||
| data-testid={`${testIdPrefix}-remove-button`} | ||
| /> | ||
| <Tooltip triggerID={removeButtonId} placement="bottom" tooltipType="label"> | ||
| {removeTooltipText} | ||
| </Tooltip> | ||
| </div> | ||
| </div> | ||
| )} | ||
| </ListItem> | ||
| ); | ||
| }; | ||
|
|
||
| export default CampaignTaskListItem; |
56 changes: 56 additions & 0 deletions
56
...nts/src/components/task/CampaignTask/CampaignTaskPopover/campaign-task-popover.style.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| .campaign-task-popover { | ||
| &__content { | ||
| display: flex; | ||
| flex-direction: column; | ||
| padding: 0.5rem; | ||
| gap: 0.5rem; | ||
| min-height: 0; | ||
| overflow: hidden; | ||
|
|
||
| // Cap the variables panel height inside the popover so it scrolls | ||
| // instead of overflowing past the popover boundary. | ||
| // Agent Desktop uses max-height: 120px (~7.5rem) on the details container. | ||
| .global-variables-panel--two-column { | ||
| max-height: 7.5rem; | ||
| overflow-y: auto; | ||
| } | ||
| } | ||
|
|
||
| &__list-item { | ||
| --mdc-listitem-padding-left-right: 0.75rem; | ||
| --mdc-listitem-padding-top-bottom: 0.5rem; | ||
| --mdc-listitem-background-color-hover: transparent; | ||
| --mdc-listitem-background-color-active: transparent; | ||
| --mdc-listitem-cursor: default; | ||
| width: 100%; | ||
|
|
||
| .campaign-avatar { | ||
| --mdc-avatar-default-background-color: var(--mds-color-theme-avatar-campaign); | ||
| --mdc-avatar-default-foreground-color: var(--mds-color-theme-indicator-stable); | ||
| } | ||
| } | ||
|
|
||
| // Action buttons — vertical column on the right (Accept on top, Skip + Remove below) | ||
| .campaign-task-actions { | ||
| display: flex; | ||
| flex-direction: column; | ||
| justify-content: space-evenly; | ||
| align-items: flex-end; | ||
| gap: 0.25rem; | ||
| height: 100%; | ||
| } | ||
|
|
||
| .campaign-task-skip-remove { | ||
| display: flex; | ||
| align-items: center; | ||
| gap: 0.25rem; | ||
| margin-left: auto; | ||
| } | ||
|
|
||
| // Icon buttons (skip / remove) — match call-control circular icon button style | ||
| .campaign-task-icon-button { | ||
| width: 1.75rem !important; | ||
| height: 1.75rem !important; | ||
| } | ||
|
|
||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.