-
Notifications
You must be signed in to change notification settings - Fork 378
fix(plugin-cc): adding int setup support #4377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughA toggle mechanism has been introduced to switch between production and integration environments in the contact center sample application. This involves adding a button to the UI labeled "In Production" and a supporting JavaScript function, Estimated code review effort1 (<30 minutes) Possibly related PRs
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
yarn install v1.22.22 ... [truncated 7275 characters] ... [email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead. 📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
docs/samples/contact-center/app.js
(3 hunks)docs/samples/contact-center/index.html
(1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: robstax
PR: webex/webex-js-sdk#3948
File: packages/@webex/webex-core/test/unit/spec/webex-core.js:178-254
Timestamp: 2024-11-01T00:30:53.442Z
Learning: In the webex-js-sdk project, when reviewing changes in `packages/@webex/webex-core/test/unit/spec/webex-core.js`, if the user declines to add negative test cases for invalid interceptor configurations, accept their decision and do not insist.
Learnt from: pagour98
PR: webex/webex-js-sdk#4086
File: packages/@webex/plugin-cc/test/unit/spec/services/task/dialer.ts:52-57
Timestamp: 2025-02-12T10:13:06.265Z
Learning: In packages/@webex/plugin-cc tests, catch blocks in test cases follow CC Desktop pattern using `expect(true).toBe(true)` for consistency.
Learnt from: pagour98
PR: webex/webex-js-sdk#4086
File: docs/samples/contact-center/index.html:226-237
Timestamp: 2025-02-12T10:21:39.427Z
Learning: Accessibility improvements are not required for sample applications in the webex-js-sdk repository, as these apps primarily focus on demonstrating core functionality.
Learnt from: bhabalan
PR: webex/webex-js-sdk#4022
File: docs/samples/contact-center/app.js:116-118
Timestamp: 2024-12-06T12:48:03.643Z
Learning: In `docs/samples/contact-center/app.js`, hardcoding the OAuth client ID and secret is acceptable for testing purposes in an isolated sandbox environment.
Learnt from: sreenara
PR: webex/webex-js-sdk#4175
File: packages/calling/src/Voicemail/WxCallBackendConnector.ts:360-370
Timestamp: 2025-04-01T11:07:10.907Z
Learning: In the Webex JavaScript SDK, some HTTP requests need to use GET even for operations that change state (like marking voicemails as read/unread or deleting them) because the team doesn't control the service implementation. This is part of adapting to external service requirements, particularly for FedRAMP compliance.
docs/samples/contact-center/index.html (1)
Learnt from: bhabalan
PR: webex/webex-js-sdk#4022
File: docs/samples/contact-center/app.js:116-118
Timestamp: 2024-12-06T12:48:03.643Z
Learning: In `docs/samples/contact-center/app.js`, hardcoding the OAuth client ID and secret is acceptable for testing purposes in an isolated sandbox environment.
docs/samples/contact-center/app.js (5)
Learnt from: bhabalan
PR: webex/webex-js-sdk#4022
File: docs/samples/contact-center/app.js:116-118
Timestamp: 2024-12-06T12:48:03.643Z
Learning: In `docs/samples/contact-center/app.js`, hardcoding the OAuth client ID and secret is acceptable for testing purposes in an isolated sandbox environment.
Learnt from: Kesari3008
PR: webex/webex-js-sdk#4258
File: packages/@webex/plugin-cc/src/webex.js:0-0
Timestamp: 2025-05-13T17:01:05.340Z
Learning: In the webex-js-sdk project, `PACKAGE_VERSION` is a constant that's injected by the build system and doesn't need to be explicitly imported in the source files.
Learnt from: robstax
PR: webex/webex-js-sdk#3948
File: packages/@webex/webex-core/test/unit/spec/webex-core.js:178-254
Timestamp: 2024-11-01T00:30:53.442Z
Learning: In the webex-js-sdk project, when reviewing changes in `packages/@webex/webex-core/test/unit/spec/webex-core.js`, if the user declines to add negative test cases for invalid interceptor configurations, accept their decision and do not insist.
Learnt from: pagour98
PR: webex/webex-js-sdk#4086
File: docs/samples/contact-center/index.html:226-237
Timestamp: 2025-02-12T10:21:39.427Z
Learning: Accessibility improvements are not required for sample applications in the webex-js-sdk repository, as these apps primarily focus on demonstrating core functionality.
Learnt from: rsarika
PR: webex/webex-js-sdk#4098
File: packages/calling/src/Logger/index.ts:0-0
Timestamp: 2025-02-14T09:43:31.759Z
Learning: In the Webex JS SDK's Logger module, the console is used as the default logger fallback when no custom logger is provided, making extensive logger validation unnecessary. A simple existence check `if (logger)` is sufficient when setting a custom logger.
🪛 Biome (1.9.4)
docs/samples/contact-center/app.js
[error] 83-83: Shouldn't redeclare 'changeEnv'. Consider to delete it or rename it.
'changeEnv' is defined here:
(lint/suspicious/noRedeclare)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: AWS Amplify Console Web Preview
🔇 Additional comments (5)
docs/samples/contact-center/index.html (1)
47-47
: LGTM! Clean UI addition for environment toggle.The button placement in the Auth & Registration section is logical, and the implementation correctly integrates with the JavaScript functionality defined in app.js.
docs/samples/contact-center/app.js (4)
81-81
: LGTM! Good default value for production environment.Starting with
enableProd = true
ensures the application defaults to production mode, which is the safer default.
83-86
: LGTM! Clean toggle implementation.The function correctly toggles the environment state and updates the button label accordingly. The ternary operator clearly shows the two states.
182-197
: LGTM! Proper environment-based OAuth configuration.The implementation correctly:
- Uses different client IDs for production vs integration environments
- Conditionally sets the discovery service URL for integration environment
- Maintains the existing OAuth flow structure
The hardcoded client IDs are acceptable for testing purposes in this sample application context.
814-821
: LGTM! Consistent environment configuration in Webex initialization.The integration environment discovery service URL configuration matches the OAuth initialization approach, ensuring consistent environment selection across both authentication methods.
This pull request is automatically being deployed by Amplify Hosting (learn more). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see the comment
const webexConfig = generateWebexConfig({ | ||
credentials: { | ||
...(!enableProd && {authorizeUrl: 'https://idbrokerbts.webex.com/idb/oauth2/v1/authorize'}), | ||
client_id: enableProd ? 'C70599433db154842e919ad9e18273d835945ff198251c82204b236b157b3a213' : 'Cd0dd53db1f470a5a9941e5eee31575bd0889d7006e3a80a1443ad12a42049da1', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the clientId different from the older value for Prod? C04ef08ffce356c3161bb66b15dbdd98d26b6c683c5ce1a1a89efad545fdadd74
. We won't use the integration then...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking comment. Please reply on the change of the clientId
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR looks good, only have one comment regarding the different client id.
Let us also update with latest next before merging.
webex = window.webex = Webex.init({ | ||
config: generateWebexConfig({ | ||
credentials: { | ||
client_id: 'C04ef08ffce356c3161bb66b15dbdd98d26b6c683c5ce1a1a89efad545fdadd74', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we not using this service app for OAuth anymore? Is there a reason for it?
COMPLETES #AD-HOC
This pull request addresses
Enable the int environment to support testing in integration setup.
by making the following changes
Added flag on the sample app to support integration setup testing.
Change Type
The following scenarios were tested
The GAI Coding Policy And Copyright Annotation Best Practices
I certified that
Make sure to have followed the contributing guidelines before submitting.