• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ringcentral / ringcentral-js-widgets / 9984535799

18 Jul 2024 02:28AM UTC coverage: 63.055% (+1.7%) from 61.322%
9984535799

push

github

web-flow
misc: sync features and bugfixes from f39b7a45 (#1747)

* misc: sync features and bugfixes from ba8d789

* misc: add i18n-dayjs and react-hooks packages

* version to 0.15.0

* chore: update crius

* misc: sync from f39b7a45

* chore: fix tests

* chore: fix tests

* chore: run test with --updateSnapshot

9782 of 17002 branches covered (57.53%)

Branch coverage included in aggregate %.

2206 of 3368 new or added lines in 501 files covered. (65.5%)

219 existing lines in 52 files now uncovered.

16601 of 24839 relevant lines covered (66.83%)

178566.16 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/packages/ringcentral-widgets/modules/CallControlUI/CallControlUI.interface.ts
1
import callDirections from '@ringcentral-integration/commons/enums/callDirections';
2
import calleeTypes from '@ringcentral-integration/commons/enums/calleeTypes';
3
import type { NormalizedSession } from '@ringcentral-integration/commons/interfaces/Webphone.interface';
4
import type { AccountInfo } from '@ringcentral-integration/commons/modules/AccountInfo';
5
import type { AppFeatures } from '@ringcentral-integration/commons/modules/AppFeatures/AppFeatures';
6
import type { Brand } from '@ringcentral-integration/commons/modules/Brand';
7
import type { CallMonitor } from '@ringcentral-integration/commons/modules/CallMonitor';
8
import type { CallingSettings } from '@ringcentral-integration/commons/modules/CallingSettings';
9
import type { ConferenceCall } from '@ringcentral-integration/commons/modules/ConferenceCall';
10
import type { ContactMatcher } from '@ringcentral-integration/commons/modules/ContactMatcher';
11
import type { ContactSearch } from '@ringcentral-integration/commons/modules/ContactSearch';
12
import type { ExtensionInfo } from '@ringcentral-integration/commons/modules/ExtensionInfo';
13
import type { ForwardingNumber } from '@ringcentral-integration/commons/modules/ForwardingNumber';
14
import type { Locale } from '@ringcentral-integration/commons/modules/Locale';
15
import type { RegionSettings } from '@ringcentral-integration/commons/modules/RegionSettings';
16
import type { Webphone } from '@ringcentral-integration/commons/modules/Webphone';
17
import type { ReactNode } from 'react';
18

19
import type { ConnectivityManager } from '../ConnectivityManager';
20
import type { RouterInteraction } from '../RouterInteraction';
21

22
export interface CallControlUIOptions {}
23

24
export interface CallControlComponentProps {
25
  params?: {
26
    sessionId?: string;
27
  };
28
  showCallQueueName?: boolean;
29
  showCallerIdName?: boolean;
30
  showPark?: boolean;
31
  getAvatarUrl?: () => string;
32
  onBackButtonClick?: () => any;
33
  phoneTypeRenderer?: () => ReactNode;
34
  phoneSourceNameRenderer?: () => ReactNode;
35
  children?: ReactNode;
36
}
37

38
export interface Deps {
39
  appFeatures: AppFeatures;
40
  webphone: Webphone;
41
  locale: Locale;
42
  contactMatcher: ContactMatcher;
43
  regionSettings: RegionSettings;
44
  brand: Brand;
45
  contactSearch: ContactSearch;
46
  callingSettings: CallingSettings;
47
  connectivityManager: ConnectivityManager;
48
  forwardingNumber: ForwardingNumber;
49
  callMonitor: CallMonitor;
50
  extensionInfo: ExtensionInfo;
51
  conferenceCall?: ConferenceCall;
52
  routerInteraction?: RouterInteraction;
53
  callControlUIOptions: CallControlUIOptions;
54
  accountInfo: AccountInfo;
55
}
56
export function getLastCallInfoFromWebphoneSession(
57
  webphoneSession: NormalizedSession,
58
  contactMapping?: any,
59
) {
60
  const sessionNumber =
61
    webphoneSession.direction === callDirections.outbound
×
62
      ? webphoneSession.to
63
      : webphoneSession.from;
64
  const sessionStatus = webphoneSession.callStatus;
×
NEW
65
  let matchedContact = webphoneSession.contactMatch;
×
NEW
66
  if (!matchedContact && contactMapping) {
×
NEW
67
    const matches = contactMapping[sessionNumber];
×
NEW
68
    if (matches?.length) {
×
NEW
69
      matchedContact = matches[0];
×
70
    }
71
  }
UNCOV
72
  const calleeType = matchedContact
×
73
    ? calleeTypes.contacts
74
    : calleeTypes.unknown;
75
  return {
×
76
    calleeType,
77
    avatarUrl: matchedContact && matchedContact.profileImageUrl,
×
78
    lastCallContact: matchedContact,
79
    name: matchedContact && matchedContact.name,
×
80
    status: sessionStatus,
81
    phoneNumber: sessionNumber,
82
  };
83
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc