-
Notifications
You must be signed in to change notification settings - Fork 65
feat(ccwidgets): merge rtt with next #666
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
Changes from all commits
1e79df7
90879db
b067344
f75a3c0
83e5bf8
e9acd6c
5c933ce
6225094
a8fb0ad
3898f6d
cc968f3
949982b
642de49
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,4 +72,4 @@ | |
| "prepare": "husky", | ||
| "package-tools": "webex-package-tools" | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| .real-time-transcript { | ||
| background: var(--mds-color-theme-background-primary-normal); | ||
| border-radius: 0.5rem; | ||
| display: flex; | ||
| flex-direction: column; | ||
| min-height: 12rem; | ||
| padding: 1rem 1.125rem; | ||
| } | ||
|
|
||
| .real-time-transcript__content { | ||
| display: flex; | ||
| flex: 1; | ||
| flex-direction: column; | ||
| overflow-y: auto; | ||
| row-gap: 1.25rem; | ||
| } | ||
|
|
||
| .real-time-transcript__event { | ||
| color: var(--mds-color-theme-text-secondary-normal); | ||
| font-size: 0.75rem; | ||
| line-height: 1rem; | ||
| margin: 0.25rem 0 0.125rem; | ||
| text-align: center; | ||
| } | ||
|
|
||
| .real-time-transcript__event-time { | ||
| color: inherit; | ||
| } | ||
|
|
||
| .real-time-transcript__item { | ||
| align-items: flex-start; | ||
| column-gap: 0.875rem; | ||
| display: flex; | ||
| } | ||
|
|
||
| .real-time-transcript__avatar-wrap { | ||
| flex-shrink: 0; | ||
| height: 2.25rem; | ||
| width: 2.25rem; | ||
| } | ||
|
|
||
| .real-time-transcript__avatar-fallback { | ||
| --mdc-avatar-size: 2.25rem; | ||
| } | ||
|
|
||
| .real-time-transcript__text-block { | ||
| min-width: 0; | ||
| } | ||
|
|
||
| .real-time-transcript__meta { | ||
| color: var(--mds-color-theme-text-secondary-normal); | ||
| display: flex; | ||
| font-size: 0.75rem; | ||
| line-height: 1rem; | ||
| } | ||
|
|
||
| .real-time-transcript__time { | ||
| color: #2e6de5; | ||
| margin-left: 0.625rem; | ||
| text-decoration: underline; | ||
| } | ||
|
|
||
| .real-time-transcript__message { | ||
| color: var(--mds-color-theme-text-primary-normal); | ||
| font-size: 1.0625rem; | ||
| line-height: 1.5rem; | ||
| margin: 0.25rem 0 0; | ||
| } | ||
|
|
||
| .real-time-transcript__empty { | ||
| color: var(--mds-color-theme-text-secondary-normal); | ||
| font-size: 0.875rem; | ||
| line-height: 1.25rem; | ||
| padding: 1rem 0.125rem; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| import React, {useMemo} from 'react'; | ||
| import {Avatar, Text} from '@momentum-design/components/dist/react'; | ||
| import {withMetrics} from '@webex/cc-ui-logging'; | ||
| import {RealTimeTranscriptComponentProps} from '../task.types'; | ||
| import './real-time-transcript.style.scss'; | ||
|
|
||
| const formatSpeaker = (speaker?: string) => speaker || 'Unknown'; | ||
| const EMPTY_TRANSCRIPT_MESSAGE = 'No live transcript available.'; | ||
|
|
||
| const RealTimeTranscriptComponent: React.FC<RealTimeTranscriptComponentProps> = ({ | ||
| liveTranscriptEntries = [], | ||
| className, | ||
| }) => { | ||
| const sortedEntries = useMemo( | ||
| () => | ||
| [...liveTranscriptEntries].sort((a, b) => { | ||
| if (a.timestamp === b.timestamp) return 0; | ||
| return a.timestamp > b.timestamp ? 1 : -1; | ||
| }), | ||
| [liveTranscriptEntries] | ||
| ); | ||
|
|
||
| return ( | ||
| <section className={`real-time-transcript ${className || ''}`.trim()} data-testid="real-time-transcript:root"> | ||
| <div className="real-time-transcript__content" data-testid="real-time-transcript:live-content"> | ||
| {sortedEntries.length === 0 ? ( | ||
| <Text className="real-time-transcript__empty" tagname="div" type="body-midsize-regular"> | ||
| {EMPTY_TRANSCRIPT_MESSAGE} | ||
| </Text> | ||
| ) : ( | ||
| <> | ||
| {sortedEntries.map((entry) => ( | ||
| <React.Fragment key={entry.id}> | ||
| {entry.event ? ( | ||
| <Text | ||
| className="real-time-transcript__event" | ||
| data-testid="real-time-transcript:event" | ||
| tagname="div" | ||
| type="body-midsize-regular" | ||
| > | ||
| {entry.event} | ||
| {entry.displayTime ? ( | ||
| <Text className="real-time-transcript__event-time" tagname="span" type="body-midsize-regular"> | ||
| . {entry.displayTime} | ||
| </Text> | ||
| ) : null} | ||
| </Text> | ||
| ) : null} | ||
| <div className="real-time-transcript__item" data-testid="real-time-transcript:item"> | ||
| <div className="real-time-transcript__avatar-wrap"> | ||
| <Avatar | ||
| className="real-time-transcript__avatar-fallback" | ||
| icon-name={entry.avatarUrl || entry.isCustomer ? undefined : 'placeholder-bold'} | ||
| src={entry.avatarUrl} | ||
| title={formatSpeaker(entry.speaker)} | ||
| > | ||
| {entry.initials || (entry.isCustomer ? 'CU' : 'YO')} | ||
| </Avatar> | ||
| </div> | ||
| <div className="real-time-transcript__text-block"> | ||
| <div className="real-time-transcript__meta"> | ||
| <Text tagname="span" type="body-large-bold"> | ||
| {formatSpeaker(entry.speaker)} | ||
| </Text> | ||
| {entry.displayTime ? ( | ||
| <Text className="real-time-transcript__time" tagname="span" type="body-midsize-regular"> | ||
| {entry.displayTime} | ||
| </Text> | ||
| ) : null} | ||
| </div> | ||
| <Text className="real-time-transcript__message" tagname="p" type="body-large-regular"> | ||
| {entry.message} | ||
| </Text> | ||
| </div> | ||
| </div> | ||
| </React.Fragment> | ||
| ))} | ||
| </> | ||
| )} | ||
| </div> | ||
| </section> | ||
| ); | ||
| }; | ||
|
|
||
| const RealTimeTranscriptComponentWithMetrics = withMetrics(RealTimeTranscriptComponent, 'RealTimeTranscript'); | ||
|
|
||
| export default RealTimeTranscriptComponentWithMetrics; |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we extending outdial call tests as part of this PR?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These tests were failing in the pipeline and in my local as well, not sure why that was happening because there is no change in outdial code
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's strange. What if we take a fresh clone of next branch? Do we see the same error there?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes I did pull fresh next branch before adding this and it was still failing for me yesterday. I found it strange too. I can try it again today and if it is not needed, I will remove it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it still be "transcripts" because it is not one transcript you get?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feature says real time transcript and everywhere we are keeping without s so to make it consistent I changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you say, "feature says", where is this?
I was trying to find the help doc and the help doc says real time transcripts in plural?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked in AgentDesktop Code and contact center announcements for this feature. Let me know if you still want it to be changed.