Skip to content
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

feat: configure EC remotely #599

Merged

Conversation

Spiral-Memory
Copy link
Collaborator

@Spiral-Memory Spiral-Memory commented Jun 27, 2024

Brief Title

This PR adds a feature to remotely configure EmbeddedChat using the EmbeddedChat RC app.

Acceptance Criteria Fulfillment

  • Added all the required string/boolean/select settings in the EmbeddedChat RC app
  • Refactored the EmbeddedChat RC app's read setting logic
  • Introduced a fetch function to read RC app settings
  • Added a useRemoteProps hook that overrides the existing props if any of the props match those in the remote configuration

The implementation is simple: before displaying the EmbeddedChat, we fetch the remote props from EC settings. If a new prop is present or an existing one needs to be overridden, it overrides the prop and then shows the EmbeddedChat component. These overrides happen only when remoteOpt is passed as true.

We can't directly mutate the props, so I have added a state config that now handles the props accordingly.

Fixes #597

Video/Screenshots

2024-06-28.23-28-26.mp4

@Spiral-Memory Spiral-Memory marked this pull request as draft June 27, 2024 18:39
@Spiral-Memory Spiral-Memory force-pushed the feat/configure-ec-remotely branch 5 times, most recently from 734fe9f to 9683dd0 Compare June 28, 2024 17:54
@Spiral-Memory Spiral-Memory marked this pull request as ready for review June 28, 2024 17:54
@Spiral-Memory Spiral-Memory force-pushed the feat/configure-ec-remotely branch 2 times, most recently from 4b94262 to 5fc56ef Compare June 29, 2024 11:09
@sidmohanty11 sidmohanty11 self-requested a review June 29, 2024 12:12
@Spiral-Memory
Copy link
Collaborator Author

Hey @sidmohanty11 ,

This PR is ready for review. It fixes some minor issues and mainly adds a feature to remotely configure the props. I've explained its workings in the PR description. Please take a look.

Thanks!

Copy link
Collaborator

@sidmohanty11 sidmohanty11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Awesome work!

@sidmohanty11 sidmohanty11 merged commit 02b5ec8 into RocketChat:develop Jun 29, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT]: Remotely configure EmbeddedChat props through RC app
2 participants