fix(cc-ui-logging): @webex/ui-logging package#491
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
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. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
|
Update the package to @webex/ui-logging |
| }); | ||
| }; | ||
| }, []); | ||
|
|
There was a problem hiding this comment.
Add the ticket for propUpdate log
| }; | ||
|
|
||
| export default CallControlCADComponent; | ||
| const CallControlCADComponentWithMetrics = withMetrics(CallControlCADComponent, 'CallControlCAD'); |
There was a problem hiding this comment.
CallControlComponent is already wrapper in withMetrics, and we are again wrapping the component here with withMetrics. See if the logging is happening twice? If it is then it is wrong. we only need it once
| expect(renderSpy).toHaveBeenCalledTimes(2); | ||
| }); | ||
|
|
||
| it('should handle complex prop changes', () => { |
There was a problem hiding this comment.
This is not required, as we are only doing shallow comparision
| stats: { | ||
| warningsFilter: [/sass-loader/], | ||
| }, |
There was a problem hiding this comment.
Add a comment about this suppression
Kesari3008
left a comment
There was a problem hiding this comment.
Approving with few minor comments
| "@momentum-ui/illustrations": "^1.24.0", | ||
| "@r2wc/react-to-web-component": "2.0.3", | ||
| "@webex/cc-store": "workspace:*" | ||
| "@webex/cc-store": "workspace:*", |
There was a problem hiding this comment.
Why are we removing this ?
There was a problem hiding this comment.
Its not removed, just added another dependency and this line it added a comma that why it is showing like this
| "react-dom": ">=18.3.1" | ||
| } | ||
| } No newline at end of file | ||
| } |
There was a problem hiding this comment.
Why were these changes introduced? Can we revert them ?
There was a problem hiding this comment.
These are linting changes, this needs to be fixed in the tooling. We already have a task for this
| const taskListPresentational = screen.getByTestId('task-list'); | ||
| expect(taskListPresentational).toBeInTheDocument(); | ||
|
|
||
| // Verify that `TaskListPresentational` is called with the correct props. |
| export type WidgetMetrics = { | ||
| widgetName: string; | ||
| event: 'WIDGET_MOUNTED' | 'ERROR' | 'WIDGET_UNMOUNTED' | 'PROPS_UPDATED'; | ||
| props?: Record<string, any>; |
There was a problem hiding this comment.
Is there no way to avoid using any for props and additionalContext ?
There was a problem hiding this comment.
No, we dont for now. props can be from any widget. If I use the actual types from the widgets it would end up creating a circular dependency. 1 thing we can do is move all the types to store but that would go against out design
| */ | ||
| export const logMetrics = (metric: WidgetMetrics) => { | ||
| if (!store.logger) { | ||
| console.warn('CC-Widgets: UI Metrics: No logger found'); |
There was a problem hiding this comment.
Can we avoid console.warn ? We can use logger.warn
There was a problem hiding this comment.
this scenario is for when logger is not present. so we are just logging a warning
| * Once we start sanitizing we can do a deep comparison. This is used to only re-render | ||
| * the HOC if the props have changed. | ||
| */ | ||
| export function havePropsChanged(prev: any, next: any): boolean { |
There was a problem hiding this comment.
Same comment here about any
There was a problem hiding this comment.
Same as above
| } | ||
|
|
||
| // All shallow comparisons passed, consider props unchanged | ||
| return false; |
There was a problem hiding this comment.
Where do we log metrics for prop updated case or is that what that JIra is added in comment ?
There was a problem hiding this comment.
The JIRA has been added @ packages/contact-center/ui-logging/src/withMetrics.tsx
# [1.28.0-ccwidgets.107](v1.28.0-ccwidgets.106...v1.28.0-ccwidgets.107) (2025-08-22) ### Bug Fixes * **cc-ui-logging:** @webex/ui-logging package ([#491](#491)) ([b647448](b647448)) * **cc-widgets:** added new chat client for cc widgets e2e testing ([#516](#516)) ([1b34046](1b34046)) * **cc-widgets:** Updated chat client with new asset ([#515](#515)) ([ea99d28](ea99d28)) * **publish:** force-publish-version-108 ([#522](#522)) ([125fd27](125fd27)) * **tooling:** force publish version 108 - 2 ([#523](#523)) ([ae9b70e](ae9b70e)) * **tooling:** force publish version 108 - 4 ([#525](#525)) ([010e10e](010e10e)) * **ui-logging:** add public access config in cc-ui-logging ([#521](#521)) ([3ab033b](3ab033b)) ### Features * **widgets:** addd e2e tests for task list ([#508](#508)) ([549dafd](549dafd))
|
🎉 This PR is included in version 1.28.0-ccwidgets.107 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
COMPLETES # https://jira-eng-sjc12.cisco.com/jira/browse/CAI-6285
This pull request addresses
by making the following changes
Change Type
The following scenarios were tested
The GAI Coding Policy And Copyright Annotation Best Practices
Checklist before merging