Skip to content

Commit 5b58389

Browse files
authored
package rename and sync feature and bugfix from 3acdd2b (#1672)
* sync feature and bugfix from 3acdd2b * chore: update ci tool * chore: fix star script
1 parent 1ba8e0e commit 5b58389

File tree

1,233 files changed

+4378
-3749
lines changed

Some content is hidden

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

1,233 files changed

+4378
-3749
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
with:
8383
node-version: ${{ matrix.node-version }}
8484
- run: yarn
85-
- run: yarn workspace ringcentral-integration test
85+
- run: yarn workspace @ringcentral-integration/commons test
8686
commons-branch-release:
8787
needs: integration-test
8888
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' }}
@@ -100,7 +100,7 @@ jobs:
100100
with:
101101
node-version: ${{ matrix.node-version }}
102102
- run: yarn
103-
- run: yarn workspace ringcentral-integration release
103+
- run: yarn workspace @ringcentral-integration/commons release
104104
- name: Commons Branch Release
105105
uses: JamesIves/[email protected]
106106
with:
@@ -125,7 +125,7 @@ jobs:
125125
with:
126126
node-version: ${{ matrix.node-version }}
127127
- run: yarn
128-
- run: yarn workspace ringcentral-widgets release
128+
- run: yarn workspace @ringcentral-integration/widgets release
129129
- name: Widgets Branch Release
130130
uses: JamesIves/[email protected]
131131
with:

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
id: get_version
4646
run: echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
4747
- run: yarn
48-
- run: yarn workspace ringcentral-integration release
48+
- run: yarn workspace @ringcentral-integration/commons release
4949
env:
5050
TRAVIS_TAG: ${{ steps.get_version.outputs.SOURCE_TAG }}
5151
- run: npm publish
@@ -68,7 +68,7 @@ jobs:
6868
id: get_version
6969
run: echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
7070
- run: yarn
71-
- run: yarn workspace ringcentral-widgets release
71+
- run: yarn workspace @ringcentral-integration/widgets release
7272
env:
7373
TRAVIS_TAG: ${{ steps.get_version.outputs.SOURCE_TAG }}
7474
- run: npm publish

.sync

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
25a535d1b5764390c1d0407963d4bc6bf4a9f3e4
1+
3acdd2ba8063150decb73c3ba2accf04da2c8f5e

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
"scripts": {
1111
"setup": "echo \"Error: no setup specified\" && exit 0",
1212
"test": "./scripts/runAllTests.sh",
13-
"start": "yarn workspace ringcentral-widgets-demo start",
14-
"release": "yarn workspace ringcentral-widgets release && yarn workspace ringcentral-integration release",
15-
"commons:test": "yarn workspace ringcentral-integration test",
13+
"start": "yarn workspace @ringcentral-integration/widgets-demo start",
14+
"release": "yarn workspace @ringcentral-integration/widgets release && yarn workspace @ringcentral-integration/commons release",
15+
"commons:test": "yarn workspace @ringcentral-integration/commons test",
1616
"widgets:test": "yarn workspace ringcentral-widgets-test test",
17-
"commons:integration-test": "yarn workspace ringcentral-integration karma",
17+
"commons:integration-test": "yarn workspace @ringcentral-integration/commons karma",
1818
"docs": "yarn workspace ringcentral-widgets-docs start",
1919
"docs:build": "yarn workspace ringcentral-widgets-docs build",
20-
"commons:prepare-release": "babel-node scripts/prepareRelease.js ringcentral-integration commons-release",
21-
"commons:start-release": "babel-node scripts/startRelease.js ringcentral-integration commons-release",
22-
"widgets:prepare-release": "babel-node scripts/prepareRelease.js ringcentral-widgets widgets-release",
23-
"widgets:start-release": "babel-node scripts/startRelease.js ringcentral-widgets widgets-release",
20+
"commons:prepare-release": "babel-node scripts/prepareRelease.js @ringcentral-integration/commons commons-release",
21+
"commons:start-release": "babel-node scripts/startRelease.js @ringcentral-integration/commons commons-release",
22+
"widgets:prepare-release": "babel-node scripts/prepareRelease.js @ringcentral-integration/widgets widgets-release",
23+
"widgets:start-release": "babel-node scripts/startRelease.js @ringcentral-integration/widgets widgets-release",
2424
"i18n:prepare-release": "babel-node scripts/prepareRelease.js @ringcentral-integration/i18n i18n-release",
2525
"i18n:start-release": "babel-node scripts/startRelease.js @ringcentral-integration/i18n i18n-release",
2626
"locale-loader:prepare-release": "babel-node scripts/prepareRelease.js @ringcentral-integration/locale-loader locale-loader-release",

packages/core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ const main = createApp({
531531
Example of `createApp()` with DI:
532532
533533
```ts
534-
import { createApp } from 'ringcentral-integration/lib/createApp';
534+
import { createApp } from '@ringcentral-integration/commons/lib/createApp';
535535

536536
@Module({
537537
name: 'Todo',

packages/core/lib/usm-redux/decorators/action.ts

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ export const action = (
4141
state = produce(lastState, recipe);
4242
}
4343
setStagedState(undefined);
44+
const changed = lastState !== state;
4445
if (process.env.NODE_ENV === 'development') {
45-
if (lastState === state) {
46+
if (!changed) {
4647
console.warn(
4748
`There are no state updates to method '${
4849
this[identifierKey]
@@ -60,19 +61,22 @@ export const action = (
6061
);
6162
// performance detail: https://immerjs.github.io/immer/docs/performance
6263
}
63-
this[storeKey].dispatch({
64-
type: this[identifierKey],
65-
method: key,
66-
params: args,
67-
_state: state,
68-
_usm: usm,
69-
...(enablePatches
70-
? {
71-
_patches: patches,
72-
_inversePatches: inversePatches,
73-
}
74-
: {}),
75-
} as Action);
64+
65+
if (changed) {
66+
this[storeKey].dispatch({
67+
type: this[identifierKey],
68+
method: key,
69+
params: args,
70+
_state: state,
71+
_usm: usm,
72+
...(enablePatches
73+
? {
74+
_patches: patches,
75+
_inversePatches: inversePatches,
76+
}
77+
: {}),
78+
} as Action);
79+
}
7680
} finally {
7781
setStagedState(undefined);
7882
}

packages/engage-voice-widget/agentScript/agentScript.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { EventEmitter } from 'events';
2-
import { SingleTabBroadcastChannel } from 'ringcentral-integration/lib/SingleTabBroadcastChannel';
2+
import { SingleTabBroadcastChannel } from '@ringcentral-integration/commons/lib/SingleTabBroadcastChannel';
33

44
import {
55
agentScriptEvents,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '~ringcentral-widgets/lib/commonStyles/text-ellipsis.scss';
1+
@import '~@ringcentral-integration/widgets/lib/commonStyles/text-ellipsis.scss';
22
@import '../../scss/variables.scss';
33

44
.children {

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

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { RcButton, RcIconButton, RcMenu, RcMenuItem } from '@ringcentral/juno';
22
import { Transcription } from '@ringcentral/juno/icon';
33
import classNames from 'classnames';
44
import React, { FunctionComponent, useCallback, useRef, useState } from 'react';
5-
import { BasicCallInfo } from 'ringcentral-widgets/components/BasicCallInfo';
5+
import { BasicCallInfo } from '@ringcentral-integration/widgets/components/BasicCallInfo';
66
import CallLogPanel, {
77
CallLogPanelProps,
8-
} from 'ringcentral-widgets/components/CallLogPanel';
8+
} from '@ringcentral-integration/widgets/components/CallLogPanel';
99

1010
import { transferTypes } from '../../enums';
1111
import {
@@ -15,6 +15,7 @@ import {
1515
import { EvSmallCallControl } from '../EvSmallCallControl';
1616
import i18n from './i18n';
1717
import { IvrInfo } from './IvrInfo';
18+
import { KeypadCollapse } from './KeypadCollapse';
1819
import styles from './styles.scss';
1920
import { EditLogSection, getButtonText } from './utils';
2021

@@ -70,11 +71,14 @@ export const ActivityCallLogPanel: FunctionComponent<ActivityCallLogPanelProps>
7071
onRestartTimer,
7172
onStopRecord,
7273
disablePauseRecord,
74+
isKeypadOpen,
75+
keypadValue,
76+
setKeypadIsOpen,
77+
setKeypadValue,
7378
...rest
7479
}) => {
7580
const transferRef = useRef(null);
7681
const rootRef = useRef<CallLogPanel>(null);
77-
7882
const [transferEl, setTransferRef] = useState(null);
7983
const isActivity = status === 'active';
8084
const isCallEnd = status === 'callEnd';
@@ -165,6 +169,21 @@ export const ActivityCallLogPanel: FunctionComponent<ActivityCallLogPanelProps>
165169
</>
166170
);
167171
}}
172+
renderKeypadPanel={() => {
173+
return (
174+
!isCallEnd && (
175+
<>
176+
<KeypadCollapse
177+
isKeypadOpen={isKeypadOpen}
178+
currentLocale={currentLocale}
179+
setKeypadIsOpen={setKeypadIsOpen}
180+
keypadValue={keypadValue}
181+
setKeypadValue={setKeypadValue}
182+
/>
183+
</>
184+
)
185+
);
186+
}}
168187
renderCallLogCallControl={() => {
169188
const isOnTransfer = Boolean(transferEl);
170189
return (
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
import React, { FunctionComponent, useState } from 'react';
2+
3+
import {
4+
RcDialer,
5+
RcDialerPadSounds,
6+
RcDialPad,
7+
RcDialTextField,
8+
RcFade,
9+
RcIconButton,
10+
RcPaper,
11+
RcTooltip,
12+
} from '@ringcentral/juno';
13+
import { Close, Keypad } from '@ringcentral/juno/icon';
14+
import {
15+
Wrapper,
16+
Backdrop,
17+
StyledCollapse,
18+
Footer,
19+
KeyPadCloseButton,
20+
} from './styles/KeyPadWrapper';
21+
import i18n from './i18n';
22+
23+
type keypadProps = {
24+
currentLocale: string;
25+
isKeypadOpen?: boolean;
26+
keypadValue?: string;
27+
setKeypadValue?: (value: string) => void;
28+
setKeypadIsOpen?: (status: boolean) => void;
29+
};
30+
31+
export const KeypadCollapse: FunctionComponent<keypadProps> = ({
32+
currentLocale,
33+
isKeypadOpen,
34+
keypadValue,
35+
setKeypadValue,
36+
setKeypadIsOpen,
37+
}) => {
38+
const [keypadOpenHover, setkeypadOpenHover] = useState(false);
39+
const [forceToolTipHide, setForceToolTipHide] = useState(false);
40+
return (
41+
<Wrapper open={isKeypadOpen}>
42+
<Backdrop open={isKeypadOpen} data-sign="keypadGreyBackground" />
43+
<StyledCollapse
44+
in={isKeypadOpen}
45+
collapsedHeight="32px"
46+
open={isKeypadOpen}
47+
onEnter={() => {
48+
setForceToolTipHide(true);
49+
}}
50+
onExited={() => {
51+
setForceToolTipHide(false);
52+
}}
53+
>
54+
<RcPaper elevation={0}>
55+
{isKeypadOpen ? (
56+
<KeyPadCloseButton>
57+
<RcIconButton
58+
data-sign="keypadCloseButton"
59+
variant="plain"
60+
size="medium"
61+
symbol={Close}
62+
title={i18n.getString('close', currentLocale)}
63+
onClick={() => {
64+
setKeypadIsOpen(false);
65+
setkeypadOpenHover(false);
66+
}}
67+
/>
68+
</KeyPadCloseButton>
69+
) : (
70+
<RcTooltip
71+
placement="top"
72+
title={i18n.getString('keypad', currentLocale)}
73+
open={keypadOpenHover}
74+
tooltipForceHide={forceToolTipHide}
75+
>
76+
<Footer
77+
onClick={() => {
78+
if (!isKeypadOpen) {
79+
setKeypadIsOpen(true);
80+
}
81+
}}
82+
onMouseOver={() => {
83+
if (!isKeypadOpen) {
84+
setkeypadOpenHover(true);
85+
}
86+
}}
87+
onMouseLeave={() => {
88+
setkeypadOpenHover(false);
89+
}}
90+
keypadOpenHover={keypadOpenHover}
91+
open={isKeypadOpen}
92+
data-sign="keypadOpenButton"
93+
>
94+
<RcIconButton variant="plain" size="small" symbol={Keypad} />
95+
</Footer>
96+
</RcTooltip>
97+
)}
98+
<RcDialer>
99+
{isKeypadOpen && (
100+
<RcDialTextField
101+
data-sign="keypadTextField"
102+
value={keypadValue}
103+
align="center"
104+
textVariant="subheading1"
105+
fullWidth
106+
onlyAllowKeypadValue
107+
onChange={setKeypadValue}
108+
autoFocus={isKeypadOpen}
109+
keypadMode
110+
onKeyDown={(e) => {
111+
if (
112+
e.key === 'Backspace' ||
113+
e.key === '-' ||
114+
e.key === '\\'
115+
) {
116+
e.preventDefault();
117+
}
118+
}}
119+
/>
120+
)}
121+
<RcDialPad sounds={RcDialerPadSounds} data-sign="keypadCollapse" />
122+
</RcDialer>
123+
</RcPaper>
124+
</StyledCollapse>
125+
</Wrapper>
126+
);
127+
};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export default {
2+
close: 'Close',
3+
keypad: 'Keypad',
4+
};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import I18n from '@ringcentral-integration/i18n';
2+
import loadLocale from './loadLocale';
3+
4+
export default new I18n(loadLocale);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* loadLocale */
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './KeypadCollapse';

0 commit comments

Comments
 (0)