Skip to content

Commit e49580d

Browse files
authored
sync features and bugfixs from 206c0e0 (#1688)
* sync features and bugfix from 206c0e0 * chore: coverage all in actions * upgrade ejs
1 parent 9011fa4 commit e49580d

File tree

140 files changed

+1152
-967
lines changed

Some content is hidden

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

140 files changed

+1152
-967
lines changed

.github/workflows/ci.yml

Lines changed: 61 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,67 @@ jobs:
1818
with:
1919
node-version: ${{ matrix.node-version }}
2020
- run: yarn
21-
- run: yarn workspace @ringcentral-integration/phone-number test
22-
- run: yarn workspace @ringcentral-integration/i18n test
23-
- run: yarn workspace @ringcentral-integration/locale-loader test
24-
- run: yarn workspace @ringcentral-integration/core test
25-
- run: yarn workspace @ringcentral-integration/commons test
26-
- run: yarn workspace @ringcentral-integration/widgets test
27-
- run: yarn workspace ringcentral-widgets-test test:jest
28-
21+
- run: yarn workspace @ringcentral-integration/phone-number test --coverage
22+
- name: Phone Number Coveralls
23+
uses: coverallsapp/[email protected]
24+
with:
25+
github-token: ${{ secrets.GITHUB_TOKEN }}
26+
path-to-lcov: ./packages/phone-number/coverage/lcov.info
27+
flag-name: phone-number
28+
parallel: true
29+
- run: yarn workspace @ringcentral-integration/i18n test --coverage
30+
- name: I18n Coveralls
31+
uses: coverallsapp/[email protected]
32+
with:
33+
github-token: ${{ secrets.GITHUB_TOKEN }}
34+
path-to-lcov: ./packages/i18n/coverage/lcov.info
35+
flag-name: i18n
36+
parallel: true
37+
- run: yarn workspace @ringcentral-integration/locale-loader test --coverage
38+
- name: locale-loader Coveralls
39+
uses: coverallsapp/[email protected]
40+
with:
41+
github-token: ${{ secrets.GITHUB_TOKEN }}
42+
path-to-lcov: ./packages/locale-loader/coverage/lcov.info
43+
flag-name: locale-loader
44+
parallel: true
45+
- run: yarn workspace @ringcentral-integration/core test --coverage
46+
- name: Core Coveralls
47+
uses: coverallsapp/[email protected]
48+
with:
49+
github-token: ${{ secrets.GITHUB_TOKEN }}
50+
path-to-lcov: ./packages/core/coverage/lcov.info
51+
flag-name: core
52+
parallel: true
53+
- run: yarn workspace @ringcentral-integration/commons test --coverage
54+
- name: Commons Coveralls
55+
uses: coverallsapp/[email protected]
56+
with:
57+
github-token: ${{ secrets.GITHUB_TOKEN }}
58+
path-to-lcov: ./packages/ringcentral-integration/coverage/lcov.info
59+
flag-name: commons
60+
parallel: true
61+
- run: yarn workspace @ringcentral-integration/widgets test --coverage
62+
- name: Widgets Coveralls
63+
uses: coverallsapp/[email protected]
64+
with:
65+
github-token: ${{ secrets.GITHUB_TOKEN }}
66+
path-to-lcov: ./packages/ringcentral-widgets/coverage/lcov.info
67+
flag-name: widgets
68+
parallel: true
69+
- run: yarn workspace ringcentral-widgets-test test --coverage
70+
- name: Widgets Integration Coveralls
71+
uses: coverallsapp/[email protected]
72+
with:
73+
github-token: ${{ secrets.GITHUB_TOKEN }}
74+
path-to-lcov: ./packages/ringcentral-widgets-test/coverage/lcov.info
75+
flag-name: widgets-integration
76+
parallel: true
77+
- name: Coveralls
78+
uses: coverallsapp/[email protected]
79+
with:
80+
github-token: ${{ secrets.GITHUB_TOKEN }}
81+
parallel-finished: true
2982
branch-release:
3083
needs: tests
3184
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,7 @@ alias.json
6262
*/**/gh-pages
6363
*/**/junit.xml
6464

65+
html-report
6566
*/**/html-report
67+
*/**/jest_html_reporters.html
68+
*/**/junit-report

.sync

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3bc468af3daaeb57779ea6e6fe239e75a4d45cfa
1+
206c0e043399ff4f2bde5fcbf222d6a036e14a92

packages/babel-settings/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@
3434
"babel-jest": "^27.0.1"
3535
},
3636
"ci": {
37-
"ringcentral-js-widgets": "**"
37+
"ringcentral-widgets-test": "**"
3838
}
3939
}

packages/core/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"lib": "lib"
88
},
99
"scripts": {
10-
"test": "cross-env NODE_ENV=ci yarn jest",
10+
"test": "NODE_ENV=ci yarn run-test",
1111
"build": "yarn gulp build",
1212
"gulp": "gulp --require @ringcentral-integration/babel-settings/lib/register.js",
1313
"release": "yarn gulp release"
@@ -35,5 +35,8 @@
3535
"immer": "^9.0.2",
3636
"ramda": "^0.27.0",
3737
"redux": "^4.0.5"
38+
},
39+
"ci": {
40+
"core": "**"
3841
}
3942
}

packages/engage-voice-widget/containers/AppView/styles.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ input {
2020

2121
.root {
2222
@include full-size;
23-
background-color: $app-background-color;
23+
background-color: $lightgray;
2424
}

packages/glip-widgets/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@
5858
"react-virtualized": "^9.19.1"
5959
},
6060
"ci": {
61-
"ringcentral-js-widgets": "**"
61+
"ringcentral-widgets-test": "**"
6262
}
6363
}

packages/i18n/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@
5050
]
5151
},
5252
"ci": {
53-
"ringcentral-js-widgets": "**"
53+
"i18n": "**"
5454
}
5555
}

packages/locale-loader/lib/generateLoaderContent/index.test.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { transform } from 'babel-core';
1+
import { transform } from '@babel/core';
22
import formatLocale from '@ringcentral-integration/i18n/lib/formatLocale';
33
import fs from 'fs-extra';
4+
import path from 'path';
45
import generateLoaderContent from '.';
56

67
const files = ['en_us.js', 'FR-FR.JS', 'aa-AAAA-ZZ.JS'];
@@ -12,7 +13,9 @@ describe('generateLoaderContent', () => {
1213
});
1314
describe('generated content', () => {
1415
afterAll(async () => {
15-
await fs.remove('./testData/generateLoaderContent/loader.js');
16+
await fs.remove(
17+
path.resolve(__dirname, './testData/generateLoaderContent/loader.js'),
18+
);
1619
});
1720
const content = generateLoaderContent({ files });
1821
files.forEach((file) => {
@@ -29,12 +32,16 @@ describe('generateLoaderContent', () => {
2932
expect(content.indexOf(`case '${lang}':`) > -1).toBe(true);
3033
});
3134
});
32-
test('should be valid js file content', async () => {
35+
test('should be valid js file content', () => {
3336
expect(() => {
3437
transform(content, { filename: 'en-GB.js' });
3538
}).not.toThrow();
36-
await fs.mkdirp('./testData/generateLoaderContent');
37-
await fs.writeFile('./testData/generateLoaderContent/loader.js', content);
39+
const folder = path.resolve(
40+
__dirname,
41+
'../../testData/generateLoaderContent',
42+
);
43+
fs.mkdirpSync(folder);
44+
fs.writeFileSync(path.resolve(folder, 'loader.js'), content);
3845
/* eslint-disable-next-line */
3946
const loader = require('../../testData/generateLoaderContent/loader');
4047
expect(typeof loader.default).toBe('function');

packages/locale-loader/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@
6767
]
6868
},
6969
"ci": {
70-
"ringcentral-js-widgets": "**"
70+
"locale-loader": "**"
7171
}
7272
}

packages/locale-settings/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
"license": "MIT",
77
"private": true,
88
"ci": {
9-
"ringcentral-js-widgets": "**"
9+
"ringcentral-widgets-test": "**"
1010
}
1111
}

packages/phone-number/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
]
5454
},
5555
"ci": {
56-
"ringcentral-js-widgets": "**"
56+
"phone-number": "**"
5757
}
5858
}

packages/ringcentral-integration/integration-test/commons/Phone/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import RecentCalls from '../../../modules/RecentCalls';
5050
import RecentMessages from '../../../modules/RecentMessages';
5151
import RegionSettings from '../../../modules/RegionSettings';
5252
import Ringout from '../../../modules/Ringout';
53-
import Softphone from '../../../modules/Softphone';
53+
import { Softphone } from '../../../modules/Softphone';
5454
import Storage from '../../../modules/Storage';
5555
import Subscription from '../../../modules/Subscription';
5656
import { TabManager } from '../../../modules/TabManager';

packages/ringcentral-integration/jest_html_reporters.html

Lines changed: 0 additions & 71 deletions
This file was deleted.

packages/ringcentral-integration/modules/Brand/Brand.interface.ts

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { RcThemeSwitcherProviderProps } from '@ringcentral/juno';
2+
13
export interface CallWithJupiterConfig {
24
/**
35
* Branded Jupiter call link
@@ -13,6 +15,55 @@ export interface CallWithJupiterConfig {
1315
name: string;
1416
}
1517

18+
/**
19+
* css module variables
20+
*
21+
* ! should not add new variables more, use Juno token please
22+
*/
23+
export type CssModuleVariable = {
24+
rcBlue?: string;
25+
bigRed?: string;
26+
darkRed?: string;
27+
tomato?: string;
28+
orange?: string;
29+
leaf?: string;
30+
dark?: string;
31+
night?: string;
32+
ash?: string;
33+
coin?: string;
34+
smoke?: string;
35+
silver?: string;
36+
egg?: string;
37+
snow?: string;
38+
rcOrange?: string;
39+
darkergray?: string;
40+
darkgray?: string;
41+
gray?: string;
42+
bggray?: string;
43+
lightergray?: string;
44+
lightgray?: string;
45+
greyLight?: string;
46+
missed?: string;
47+
active?: string;
48+
primaryColor?: string;
49+
primaryColorHighlight?: string;
50+
primaryColorHighlightSolid?: string;
51+
linePanelBackgroundColor?: string;
52+
callBtnColor?: string;
53+
extensionBackgroundColor?: string;
54+
smsBubbleBackgroundColor?: string;
55+
brandFontColor?: string;
56+
brandFontColorHighlight?: string;
57+
jupiterBackgroundColor?: string;
58+
59+
// project related
60+
c2dArrowColor?: string;
61+
addMeetingBtnColor?: string;
62+
addMeetingBtnTextColor?: string;
63+
headerLogoWidth?: string;
64+
headerLogoHeight?: string;
65+
};
66+
1667
export interface BrandConfig {
1768
/**
1869
* Brand ID registered in RingCentral
@@ -101,13 +152,24 @@ export interface BrandConfig {
101152
*/
102153
allowRegionSetting?: boolean;
103154
/**
104-
* spartanProtocol
155+
* spartan Protocol
105156
*/
106-
spartanProtocol: string;
157+
spartanProtocol?: string;
107158
/**
108159
* Allow JupiterUniversalLink
109160
*/
110-
allowJupiterUniversalLink: boolean;
161+
allowJupiterUniversalLink?: boolean;
162+
/**
163+
* theme for `RcThemeProvider`
164+
*/
165+
theme?: RcThemeSwitcherProviderProps & {
166+
/**
167+
* variable for css module
168+
*
169+
* * make sure you need update that, all token should always get from Juno theme, prevent to use that
170+
*/
171+
variable?: CssModuleVariable;
172+
};
111173
}
112174

113175
export interface Deps<T extends BrandConfig = BrandConfig> {

packages/ringcentral-integration/modules/CallV2/Call.interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { ExtensionFeatures } from '../ExtensionFeatures';
77
import { NumberValidate } from '../NumberValidateV2';
88
import { RegionSettings } from '../RegionSettingsV2';
99
import { Ringout } from '../RingoutV2';
10-
import { Softphone } from '../SoftphoneV2';
10+
import { Softphone } from '../Softphone';
1111
import { Storage } from '../StorageV2';
1212
import { Webphone } from '../WebphoneV2';
1313

packages/ringcentral-integration/modules/CallingSettingsV2/CallingSettings.interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { ForwardingNumber } from '../ForwardingNumberV2';
99
import { Storage } from '../StorageV2';
1010
import { TabManager } from '../TabManager';
1111
import { Webphone } from '../WebphoneV2';
12-
import { Softphone } from '../SoftphoneV2';
12+
import { Softphone } from '../Softphone';
1313
import { ExtensionFeatures } from '../ExtensionFeatures';
1414

1515
export interface Deps {

packages/ringcentral-integration/modules/RcVideo/RcVideo.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -814,8 +814,8 @@ export class RcVideo extends RcModule<Record<string, any>, RcVideoActionTypes> {
814814
meeting: {
815815
...processedMeeting,
816816
isMeetingPasswordValid: this.validatePasswordSettings(
817-
processedMeeting.meetingPassword ?? this.meeting.meetingPassword,
818-
processedMeeting.isMeetingSecret ?? this.meeting.isMeetingSecret,
817+
processedMeeting.meetingPassword ?? this.meeting?.meetingPassword,
818+
processedMeeting.isMeetingSecret ?? this.meeting?.isMeetingSecret,
819819
),
820820
},
821821
patch,

packages/ringcentral-integration/modules/RcVideoV2/RcVideo.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -793,8 +793,8 @@ export class RcVideo extends RcModuleV2<Deps> implements IMeeting {
793793
{
794794
...processedMeeting,
795795
isMeetingPasswordValid: this.validatePasswordSettings(
796-
processedMeeting.meetingPassword ?? this.meeting.meetingPassword,
797-
processedMeeting.isMeetingSecret ?? this.meeting.isMeetingSecret,
796+
processedMeeting.meetingPassword ?? this.meeting?.meetingPassword,
797+
processedMeeting.isMeetingSecret ?? this.meeting?.isMeetingSecret,
798798
),
799799
},
800800
patch,

packages/ringcentral-integration/modules/SoftphoneV2/Softphone.ts renamed to packages/ringcentral-integration/modules/Softphone/Softphone.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,7 @@ export class Softphone<T extends Deps = Deps> extends RcModuleV2<T> {
9999

100100
@computed(({ callWithJupiterConfig }: Softphone) => [callWithJupiterConfig])
101101
get jupiterAppName() {
102-
return this.callWithJupiterConfig?.name
103-
? `${this.callWithJupiterConfig?.name} App`
104-
: null;
102+
return this.callWithJupiterConfig?.name ?? null;
105103
}
106104

107105
// currently we don't have Bt brand uri scheme

packages/ringcentral-integration/modules/Softphone/actionTypes.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

packages/ringcentral-integration/modules/Softphone/getSoftphoneReducer.js

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)