Skip to content

Commit

Permalink
sync features and bugfixs from 206c0e0 (#1688)
Browse files Browse the repository at this point in the history
* sync features and bugfix from 206c0e0

* chore: coverage all in actions

* upgrade ejs
  • Loading branch information
embbnux authored Sep 15, 2021
1 parent 9011fa4 commit e49580d
Show file tree
Hide file tree
Showing 140 changed files with 1,152 additions and 967 deletions.
69 changes: 61 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,67 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: yarn
- run: yarn workspace @ringcentral-integration/phone-number test
- run: yarn workspace @ringcentral-integration/i18n test
- run: yarn workspace @ringcentral-integration/locale-loader test
- run: yarn workspace @ringcentral-integration/core test
- run: yarn workspace @ringcentral-integration/commons test
- run: yarn workspace @ringcentral-integration/widgets test
- run: yarn workspace ringcentral-widgets-test test:jest

- run: yarn workspace @ringcentral-integration/phone-number test --coverage
- name: Phone Number Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./packages/phone-number/coverage/lcov.info
flag-name: phone-number
parallel: true
- run: yarn workspace @ringcentral-integration/i18n test --coverage
- name: I18n Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./packages/i18n/coverage/lcov.info
flag-name: i18n
parallel: true
- run: yarn workspace @ringcentral-integration/locale-loader test --coverage
- name: locale-loader Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./packages/locale-loader/coverage/lcov.info
flag-name: locale-loader
parallel: true
- run: yarn workspace @ringcentral-integration/core test --coverage
- name: Core Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./packages/core/coverage/lcov.info
flag-name: core
parallel: true
- run: yarn workspace @ringcentral-integration/commons test --coverage
- name: Commons Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./packages/ringcentral-integration/coverage/lcov.info
flag-name: commons
parallel: true
- run: yarn workspace @ringcentral-integration/widgets test --coverage
- name: Widgets Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./packages/ringcentral-widgets/coverage/lcov.info
flag-name: widgets
parallel: true
- run: yarn workspace ringcentral-widgets-test test --coverage
- name: Widgets Integration Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./packages/ringcentral-widgets-test/coverage/lcov.info
flag-name: widgets-integration
parallel: true
- name: Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
branch-release:
needs: tests
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' }}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,7 @@ alias.json
*/**/gh-pages
*/**/junit.xml

html-report
*/**/html-report
*/**/jest_html_reporters.html
*/**/junit-report
2 changes: 1 addition & 1 deletion .sync
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3bc468af3daaeb57779ea6e6fe239e75a4d45cfa
206c0e043399ff4f2bde5fcbf222d6a036e14a92
2 changes: 1 addition & 1 deletion packages/babel-settings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
"babel-jest": "^27.0.1"
},
"ci": {
"ringcentral-js-widgets": "**"
"ringcentral-widgets-test": "**"
}
}
5 changes: 4 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"lib": "lib"
},
"scripts": {
"test": "cross-env NODE_ENV=ci yarn jest",
"test": "NODE_ENV=ci yarn run-test",
"build": "yarn gulp build",
"gulp": "gulp --require @ringcentral-integration/babel-settings/lib/register.js",
"release": "yarn gulp release"
Expand Down Expand Up @@ -35,5 +35,8 @@
"immer": "^9.0.2",
"ramda": "^0.27.0",
"redux": "^4.0.5"
},
"ci": {
"core": "**"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ input {

.root {
@include full-size;
background-color: $app-background-color;
background-color: $lightgray;
}
2 changes: 1 addition & 1 deletion packages/glip-widgets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@
"react-virtualized": "^9.19.1"
},
"ci": {
"ringcentral-js-widgets": "**"
"ringcentral-widgets-test": "**"
}
}
2 changes: 1 addition & 1 deletion packages/i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@
]
},
"ci": {
"ringcentral-js-widgets": "**"
"i18n": "**"
}
}
17 changes: 12 additions & 5 deletions packages/locale-loader/lib/generateLoaderContent/index.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { transform } from 'babel-core';
import { transform } from '@babel/core';
import formatLocale from '@ringcentral-integration/i18n/lib/formatLocale';
import fs from 'fs-extra';
import path from 'path';
import generateLoaderContent from '.';

const files = ['en_us.js', 'FR-FR.JS', 'aa-AAAA-ZZ.JS'];
Expand All @@ -12,7 +13,9 @@ describe('generateLoaderContent', () => {
});
describe('generated content', () => {
afterAll(async () => {
await fs.remove('./testData/generateLoaderContent/loader.js');
await fs.remove(
path.resolve(__dirname, './testData/generateLoaderContent/loader.js'),
);
});
const content = generateLoaderContent({ files });
files.forEach((file) => {
Expand All @@ -29,12 +32,16 @@ describe('generateLoaderContent', () => {
expect(content.indexOf(`case '${lang}':`) > -1).toBe(true);
});
});
test('should be valid js file content', async () => {
test('should be valid js file content', () => {
expect(() => {
transform(content, { filename: 'en-GB.js' });
}).not.toThrow();
await fs.mkdirp('./testData/generateLoaderContent');
await fs.writeFile('./testData/generateLoaderContent/loader.js', content);
const folder = path.resolve(
__dirname,
'../../testData/generateLoaderContent',
);
fs.mkdirpSync(folder);
fs.writeFileSync(path.resolve(folder, 'loader.js'), content);
/* eslint-disable-next-line */
const loader = require('../../testData/generateLoaderContent/loader');
expect(typeof loader.default).toBe('function');
Expand Down
2 changes: 1 addition & 1 deletion packages/locale-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@
]
},
"ci": {
"ringcentral-js-widgets": "**"
"locale-loader": "**"
}
}
2 changes: 1 addition & 1 deletion packages/locale-settings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"license": "MIT",
"private": true,
"ci": {
"ringcentral-js-widgets": "**"
"ringcentral-widgets-test": "**"
}
}
2 changes: 1 addition & 1 deletion packages/phone-number/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@
]
},
"ci": {
"ringcentral-js-widgets": "**"
"phone-number": "**"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import RecentCalls from '../../../modules/RecentCalls';
import RecentMessages from '../../../modules/RecentMessages';
import RegionSettings from '../../../modules/RegionSettings';
import Ringout from '../../../modules/Ringout';
import Softphone from '../../../modules/Softphone';
import { Softphone } from '../../../modules/Softphone';
import Storage from '../../../modules/Storage';
import Subscription from '../../../modules/Subscription';
import { TabManager } from '../../../modules/TabManager';
Expand Down
71 changes: 0 additions & 71 deletions packages/ringcentral-integration/jest_html_reporters.html

This file was deleted.

68 changes: 65 additions & 3 deletions packages/ringcentral-integration/modules/Brand/Brand.interface.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { RcThemeSwitcherProviderProps } from '@ringcentral/juno';

export interface CallWithJupiterConfig {
/**
* Branded Jupiter call link
Expand All @@ -13,6 +15,55 @@ export interface CallWithJupiterConfig {
name: string;
}

/**
* css module variables
*
* ! should not add new variables more, use Juno token please
*/
export type CssModuleVariable = {
rcBlue?: string;
bigRed?: string;
darkRed?: string;
tomato?: string;
orange?: string;
leaf?: string;
dark?: string;
night?: string;
ash?: string;
coin?: string;
smoke?: string;
silver?: string;
egg?: string;
snow?: string;
rcOrange?: string;
darkergray?: string;
darkgray?: string;
gray?: string;
bggray?: string;
lightergray?: string;
lightgray?: string;
greyLight?: string;
missed?: string;
active?: string;
primaryColor?: string;
primaryColorHighlight?: string;
primaryColorHighlightSolid?: string;
linePanelBackgroundColor?: string;
callBtnColor?: string;
extensionBackgroundColor?: string;
smsBubbleBackgroundColor?: string;
brandFontColor?: string;
brandFontColorHighlight?: string;
jupiterBackgroundColor?: string;

// project related
c2dArrowColor?: string;
addMeetingBtnColor?: string;
addMeetingBtnTextColor?: string;
headerLogoWidth?: string;
headerLogoHeight?: string;
};

export interface BrandConfig {
/**
* Brand ID registered in RingCentral
Expand Down Expand Up @@ -101,13 +152,24 @@ export interface BrandConfig {
*/
allowRegionSetting?: boolean;
/**
* spartanProtocol
* spartan Protocol
*/
spartanProtocol: string;
spartanProtocol?: string;
/**
* Allow JupiterUniversalLink
*/
allowJupiterUniversalLink: boolean;
allowJupiterUniversalLink?: boolean;
/**
* theme for `RcThemeProvider`
*/
theme?: RcThemeSwitcherProviderProps & {
/**
* variable for css module
*
* * make sure you need update that, all token should always get from Juno theme, prevent to use that
*/
variable?: CssModuleVariable;
};
}

export interface Deps<T extends BrandConfig = BrandConfig> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ExtensionFeatures } from '../ExtensionFeatures';
import { NumberValidate } from '../NumberValidateV2';
import { RegionSettings } from '../RegionSettingsV2';
import { Ringout } from '../RingoutV2';
import { Softphone } from '../SoftphoneV2';
import { Softphone } from '../Softphone';
import { Storage } from '../StorageV2';
import { Webphone } from '../WebphoneV2';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ForwardingNumber } from '../ForwardingNumberV2';
import { Storage } from '../StorageV2';
import { TabManager } from '../TabManager';
import { Webphone } from '../WebphoneV2';
import { Softphone } from '../SoftphoneV2';
import { Softphone } from '../Softphone';
import { ExtensionFeatures } from '../ExtensionFeatures';

export interface Deps {
Expand Down
4 changes: 2 additions & 2 deletions packages/ringcentral-integration/modules/RcVideo/RcVideo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -814,8 +814,8 @@ export class RcVideo extends RcModule<Record<string, any>, RcVideoActionTypes> {
meeting: {
...processedMeeting,
isMeetingPasswordValid: this.validatePasswordSettings(
processedMeeting.meetingPassword ?? this.meeting.meetingPassword,
processedMeeting.isMeetingSecret ?? this.meeting.isMeetingSecret,
processedMeeting.meetingPassword ?? this.meeting?.meetingPassword,
processedMeeting.isMeetingSecret ?? this.meeting?.isMeetingSecret,
),
},
patch,
Expand Down
4 changes: 2 additions & 2 deletions packages/ringcentral-integration/modules/RcVideoV2/RcVideo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -793,8 +793,8 @@ export class RcVideo extends RcModuleV2<Deps> implements IMeeting {
{
...processedMeeting,
isMeetingPasswordValid: this.validatePasswordSettings(
processedMeeting.meetingPassword ?? this.meeting.meetingPassword,
processedMeeting.isMeetingSecret ?? this.meeting.isMeetingSecret,
processedMeeting.meetingPassword ?? this.meeting?.meetingPassword,
processedMeeting.isMeetingSecret ?? this.meeting?.isMeetingSecret,
),
},
patch,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ export class Softphone<T extends Deps = Deps> extends RcModuleV2<T> {

@computed(({ callWithJupiterConfig }: Softphone) => [callWithJupiterConfig])
get jupiterAppName() {
return this.callWithJupiterConfig?.name
? `${this.callWithJupiterConfig?.name} App`
: null;
return this.callWithJupiterConfig?.name ?? null;
}

// currently we don't have Bt brand uri scheme
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit e49580d

Please sign in to comment.