Skip to content

Commit

Permalink
package rename and sync feature and bugfix from 3acdd2b (#1672)
Browse files Browse the repository at this point in the history
* sync feature and bugfix from 3acdd2b

* chore: update ci tool

* chore: fix star script
  • Loading branch information
embbnux authored Jun 30, 2021
1 parent 1ba8e0e commit 5b58389
Show file tree
Hide file tree
Showing 1,233 changed files with 4,378 additions and 3,749 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: yarn
- run: yarn workspace ringcentral-integration test
- run: yarn workspace @ringcentral-integration/commons test
commons-branch-release:
needs: integration-test
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' }}
Expand All @@ -100,7 +100,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: yarn
- run: yarn workspace ringcentral-integration release
- run: yarn workspace @ringcentral-integration/commons release
- name: Commons Branch Release
uses: JamesIves/[email protected]
with:
Expand All @@ -125,7 +125,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: yarn
- run: yarn workspace ringcentral-widgets release
- run: yarn workspace @ringcentral-integration/widgets release
- name: Widgets Branch Release
uses: JamesIves/[email protected]
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
id: get_version
run: echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
- run: yarn
- run: yarn workspace ringcentral-integration release
- run: yarn workspace @ringcentral-integration/commons release
env:
TRAVIS_TAG: ${{ steps.get_version.outputs.SOURCE_TAG }}
- run: npm publish
Expand All @@ -68,7 +68,7 @@ jobs:
id: get_version
run: echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
- run: yarn
- run: yarn workspace ringcentral-widgets release
- run: yarn workspace @ringcentral-integration/widgets release
env:
TRAVIS_TAG: ${{ steps.get_version.outputs.SOURCE_TAG }}
- run: npm publish
Expand Down
2 changes: 1 addition & 1 deletion .sync
Original file line number Diff line number Diff line change
@@ -1 +1 @@
25a535d1b5764390c1d0407963d4bc6bf4a9f3e4
3acdd2ba8063150decb73c3ba2accf04da2c8f5e
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
"scripts": {
"setup": "echo \"Error: no setup specified\" && exit 0",
"test": "./scripts/runAllTests.sh",
"start": "yarn workspace ringcentral-widgets-demo start",
"release": "yarn workspace ringcentral-widgets release && yarn workspace ringcentral-integration release",
"commons:test": "yarn workspace ringcentral-integration test",
"start": "yarn workspace @ringcentral-integration/widgets-demo start",
"release": "yarn workspace @ringcentral-integration/widgets release && yarn workspace @ringcentral-integration/commons release",
"commons:test": "yarn workspace @ringcentral-integration/commons test",
"widgets:test": "yarn workspace ringcentral-widgets-test test",
"commons:integration-test": "yarn workspace ringcentral-integration karma",
"commons:integration-test": "yarn workspace @ringcentral-integration/commons karma",
"docs": "yarn workspace ringcentral-widgets-docs start",
"docs:build": "yarn workspace ringcentral-widgets-docs build",
"commons:prepare-release": "babel-node scripts/prepareRelease.js ringcentral-integration commons-release",
"commons:start-release": "babel-node scripts/startRelease.js ringcentral-integration commons-release",
"widgets:prepare-release": "babel-node scripts/prepareRelease.js ringcentral-widgets widgets-release",
"widgets:start-release": "babel-node scripts/startRelease.js ringcentral-widgets widgets-release",
"commons:prepare-release": "babel-node scripts/prepareRelease.js @ringcentral-integration/commons commons-release",
"commons:start-release": "babel-node scripts/startRelease.js @ringcentral-integration/commons commons-release",
"widgets:prepare-release": "babel-node scripts/prepareRelease.js @ringcentral-integration/widgets widgets-release",
"widgets:start-release": "babel-node scripts/startRelease.js @ringcentral-integration/widgets widgets-release",
"i18n:prepare-release": "babel-node scripts/prepareRelease.js @ringcentral-integration/i18n i18n-release",
"i18n:start-release": "babel-node scripts/startRelease.js @ringcentral-integration/i18n i18n-release",
"locale-loader:prepare-release": "babel-node scripts/prepareRelease.js @ringcentral-integration/locale-loader locale-loader-release",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ const main = createApp({
Example of `createApp()` with DI:
```ts
import { createApp } from 'ringcentral-integration/lib/createApp';
import { createApp } from '@ringcentral-integration/commons/lib/createApp';

@Module({
name: 'Todo',
Expand Down
32 changes: 18 additions & 14 deletions packages/core/lib/usm-redux/decorators/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ export const action = (
state = produce(lastState, recipe);
}
setStagedState(undefined);
const changed = lastState !== state;
if (process.env.NODE_ENV === 'development') {
if (lastState === state) {
if (!changed) {
console.warn(
`There are no state updates to method '${
this[identifierKey]
Expand All @@ -60,19 +61,22 @@ export const action = (
);
// performance detail: https://immerjs.github.io/immer/docs/performance
}
this[storeKey].dispatch({
type: this[identifierKey],
method: key,
params: args,
_state: state,
_usm: usm,
...(enablePatches
? {
_patches: patches,
_inversePatches: inversePatches,
}
: {}),
} as Action);

if (changed) {
this[storeKey].dispatch({
type: this[identifierKey],
method: key,
params: args,
_state: state,
_usm: usm,
...(enablePatches
? {
_patches: patches,
_inversePatches: inversePatches,
}
: {}),
} as Action);
}
} finally {
setStagedState(undefined);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/engage-voice-widget/agentScript/agentScript.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EventEmitter } from 'events';
import { SingleTabBroadcastChannel } from 'ringcentral-integration/lib/SingleTabBroadcastChannel';
import { SingleTabBroadcastChannel } from '@ringcentral-integration/commons/lib/SingleTabBroadcastChannel';

import {
agentScriptEvents,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '~ringcentral-widgets/lib/commonStyles/text-ellipsis.scss';
@import '~@ringcentral-integration/widgets/lib/commonStyles/text-ellipsis.scss';
@import '../../scss/variables.scss';

.children {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { RcButton, RcIconButton, RcMenu, RcMenuItem } from '@ringcentral/juno';
import { Transcription } from '@ringcentral/juno/icon';
import classNames from 'classnames';
import React, { FunctionComponent, useCallback, useRef, useState } from 'react';
import { BasicCallInfo } from 'ringcentral-widgets/components/BasicCallInfo';
import { BasicCallInfo } from '@ringcentral-integration/widgets/components/BasicCallInfo';
import CallLogPanel, {
CallLogPanelProps,
} from 'ringcentral-widgets/components/CallLogPanel';
} from '@ringcentral-integration/widgets/components/CallLogPanel';

import { transferTypes } from '../../enums';
import {
Expand All @@ -15,6 +15,7 @@ import {
import { EvSmallCallControl } from '../EvSmallCallControl';
import i18n from './i18n';
import { IvrInfo } from './IvrInfo';
import { KeypadCollapse } from './KeypadCollapse';
import styles from './styles.scss';
import { EditLogSection, getButtonText } from './utils';

Expand Down Expand Up @@ -70,11 +71,14 @@ export const ActivityCallLogPanel: FunctionComponent<ActivityCallLogPanelProps>
onRestartTimer,
onStopRecord,
disablePauseRecord,
isKeypadOpen,
keypadValue,
setKeypadIsOpen,
setKeypadValue,
...rest
}) => {
const transferRef = useRef(null);
const rootRef = useRef<CallLogPanel>(null);

const [transferEl, setTransferRef] = useState(null);
const isActivity = status === 'active';
const isCallEnd = status === 'callEnd';
Expand Down Expand Up @@ -165,6 +169,21 @@ export const ActivityCallLogPanel: FunctionComponent<ActivityCallLogPanelProps>
</>
);
}}
renderKeypadPanel={() => {
return (
!isCallEnd && (
<>
<KeypadCollapse
isKeypadOpen={isKeypadOpen}
currentLocale={currentLocale}
setKeypadIsOpen={setKeypadIsOpen}
keypadValue={keypadValue}
setKeypadValue={setKeypadValue}
/>
</>
)
);
}}
renderCallLogCallControl={() => {
const isOnTransfer = Boolean(transferEl);
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
import React, { FunctionComponent, useState } from 'react';

import {
RcDialer,
RcDialerPadSounds,
RcDialPad,
RcDialTextField,
RcFade,
RcIconButton,
RcPaper,
RcTooltip,
} from '@ringcentral/juno';
import { Close, Keypad } from '@ringcentral/juno/icon';
import {
Wrapper,
Backdrop,
StyledCollapse,
Footer,
KeyPadCloseButton,
} from './styles/KeyPadWrapper';
import i18n from './i18n';

type keypadProps = {
currentLocale: string;
isKeypadOpen?: boolean;
keypadValue?: string;
setKeypadValue?: (value: string) => void;
setKeypadIsOpen?: (status: boolean) => void;
};

export const KeypadCollapse: FunctionComponent<keypadProps> = ({
currentLocale,
isKeypadOpen,
keypadValue,
setKeypadValue,
setKeypadIsOpen,
}) => {
const [keypadOpenHover, setkeypadOpenHover] = useState(false);
const [forceToolTipHide, setForceToolTipHide] = useState(false);
return (
<Wrapper open={isKeypadOpen}>
<Backdrop open={isKeypadOpen} data-sign="keypadGreyBackground" />
<StyledCollapse
in={isKeypadOpen}
collapsedHeight="32px"
open={isKeypadOpen}
onEnter={() => {
setForceToolTipHide(true);
}}
onExited={() => {
setForceToolTipHide(false);
}}
>
<RcPaper elevation={0}>
{isKeypadOpen ? (
<KeyPadCloseButton>
<RcIconButton
data-sign="keypadCloseButton"
variant="plain"
size="medium"
symbol={Close}
title={i18n.getString('close', currentLocale)}
onClick={() => {
setKeypadIsOpen(false);
setkeypadOpenHover(false);
}}
/>
</KeyPadCloseButton>
) : (
<RcTooltip
placement="top"
title={i18n.getString('keypad', currentLocale)}
open={keypadOpenHover}
tooltipForceHide={forceToolTipHide}
>
<Footer
onClick={() => {
if (!isKeypadOpen) {
setKeypadIsOpen(true);
}
}}
onMouseOver={() => {
if (!isKeypadOpen) {
setkeypadOpenHover(true);
}
}}
onMouseLeave={() => {
setkeypadOpenHover(false);
}}
keypadOpenHover={keypadOpenHover}
open={isKeypadOpen}
data-sign="keypadOpenButton"
>
<RcIconButton variant="plain" size="small" symbol={Keypad} />
</Footer>
</RcTooltip>
)}
<RcDialer>
{isKeypadOpen && (
<RcDialTextField
data-sign="keypadTextField"
value={keypadValue}
align="center"
textVariant="subheading1"
fullWidth
onlyAllowKeypadValue
onChange={setKeypadValue}
autoFocus={isKeypadOpen}
keypadMode
onKeyDown={(e) => {
if (
e.key === 'Backspace' ||
e.key === '-' ||
e.key === '\\'
) {
e.preventDefault();
}
}}
/>
)}
<RcDialPad sounds={RcDialerPadSounds} data-sign="keypadCollapse" />
</RcDialer>
</RcPaper>
</StyledCollapse>
</Wrapper>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
close: 'Close',
keypad: 'Keypad',
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import I18n from '@ringcentral-integration/i18n';
import loadLocale from './loadLocale';

export default new I18n(loadLocale);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* loadLocale */
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './KeypadCollapse';
Loading

0 comments on commit 5b58389

Please sign in to comment.