Skip to content

Commit

Permalink
misc: support to show third party displayName (#862)
Browse files Browse the repository at this point in the history
* misc: support to third party displayName

* misc: version 2.0.1
  • Loading branch information
embbnux authored Aug 26, 2024
1 parent f7ad724 commit 257799e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
4 changes: 3 additions & 1 deletion docs/integration/third-party-auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ document.querySelector("#rc-widget-adapter-frame").contentWindow.postMessage({
type: 'rc-adapter-register-third-party-service',
service: {
name: 'TestService',
displayName: 'TestServiceDisplayName', // Optional, supported from 2.0.1
info: 'Some description about this service', // Optional, supported from 2.0.0
authorizationPath: '/authorize',
authorizedTitle: 'Unauthorize',
unauthorizedTitle: 'Authorize',
authorized: false,
authorizedAccount: '[email protected]', // optional, authorized account email or id
authorizationLogo: 'https://your_brand_picture/logo.png', // optional, show your brand logo in authorization section, recommended: height 20px, width < 85px.
authorizationLogo: 'https://your_brand_picture/logo.png', // optional, show your brand logo in authorization section, recommended: height 30px, width < 85px.
// showAuthRedDot: true, // optional, this will show red dot at settings page when need to auth
}
}, '*');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ringcentral-embeddable",
"version": "2.0.0",
"version": "2.0.1",
"description": "A RingCentral Embeddable Widget Application",
"main": "index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion src/modules/SettingsUI/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class SettingsUI extends BaseSettingsUI {
showFeedback: thirdPartyService.showFeedback,
thirdPartySettings: thirdPartyService.settings,
thirdPartyAuth: thirdPartyService.authorizationRegistered ? {
serviceName: thirdPartyService.serviceName,
serviceName: thirdPartyService.displayName || thirdPartyService.serviceName,
serviceInfo: thirdPartyService.serviceInfo,
authorized: thirdPartyService.authorized,
contactSyncing: thirdPartyService.contactSyncing,
Expand Down
8 changes: 8 additions & 0 deletions src/modules/ThirdPartyService/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export default class ThirdPartyService extends RcModuleV2 {
}
this._registerService({
serviceName: service.name,
serviceDisplayName: service.displayName,
serviceInfo: service.info || '',
});
if (service.authorizationPath) {
Expand Down Expand Up @@ -982,6 +983,9 @@ export default class ThirdPartyService extends RcModuleV2 {
@state
serviceName = null;

@state
displayName = null;

@state
serviceInfo = null;

Expand All @@ -991,9 +995,13 @@ export default class ThirdPartyService extends RcModuleV2 {
@action
_registerService({
serviceName,
serviceDisplayName,
serviceInfo,
}) {
this.serviceName = serviceName;
if (serviceDisplayName) {
this.displayName = serviceDisplayName;
}
this._sourceReady = true;
this.serviceInfo = serviceInfo;
}
Expand Down

0 comments on commit 257799e

Please sign in to comment.