Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

[NEW] Show/Hide Agent information #279

Merged
merged 11 commits into from
Nov 18, 2019

Conversation

renatobecker-zz
Copy link
Contributor

@renatobecker-zz renatobecker-zz commented Aug 22, 2019

This PR adds a new feature into the Livechat Widget:

Related to RocketChat/Rocket.Chat#15216

  • A new setting to show/hide the Agent information. It's a recurrent feature request related to GDPR stuff. When the setting is disabled, the widget will look like the image below:

Screen Shot 2019-08-22 at 12 28 17

- New API's to minimize/maximize the Widget;
- Deal with a new setting to hide Agent information;
@renatobecker-zz renatobecker-zz added the enhancement New feature or request label Aug 22, 2019
Copy link
Member

@ggazzo ggazzo left a comment

Choose a reason for hiding this comment

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

I think we have 2 different features here, and maybe would be better if we splitted into 2 different prs

its better to revert if we had some problem, and helps our release process...

what do you think @tassoevan ?

@renatobecker-zz
Copy link
Contributor Author

renatobecker-zz commented Aug 23, 2019

I think we have 2 different features here, and maybe would be better if we splitted into 2 different prs

its better to revert if we had some problem, and helps our release process...

what do you think @tassoevan ?

There is no problem creating two pull request, I'll do it.
Done.

@wreiske
Copy link

wreiske commented Aug 24, 2019

Does this maximize and minimize open and close the widget? Or, just make it full screen width and height? I'm looking for a way to open the live chat programmatically with something like RocketChat.livechat.open(), .close().

@renatobecker-zz
Copy link
Contributor Author

renatobecker-zz commented Aug 26, 2019

Does this maximize and minimize open and close the widget? Or, just make it full screen width and height? I'm looking for a way to open the live chat programmatically with something like RocketChat.livechat.open(), .close().

Yeah, it will do exactly what you're looking for, but I'm moving that implementation to another pull request.
Thanks.

@engelgabriel
Copy link
Member

Copy link
Contributor

@tassoevan tassoevan left a comment

Choose a reason for hiding this comment

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

I don't like the idea of piercing the showAgentInfo prop through the components... That's why Context API exists. Also, in some presentational components, just omitting the agent prop does the trick. What about implement an AgentInformationContext and wrap the ChatContainer with the AgentInformationContext.Provider?

@renatobecker-zz
Copy link
Contributor Author

I don't like the idea of piercing the showAgentInfo prop through the components... That's why Context API exists. Also, in some presentational components, just omitting the agent prop does the trick. What about implement an AgentInformationContext and wrap the ChatContainer with the AgentInformationContext.Provider?

There are other events where we need to deal with the permission, like the onTyping, so we can't just omit the agent prop.

@renatobecker-zz
Copy link
Contributor Author

I don't like the idea of piercing the showAgentInfo prop through the components... That's why Context API exists. Also, in some presentational components, just omitting the agent prop does the trick. What about implement an AgentInformationContext and wrap the ChatContainer with the AgentInformationContext.Provider?

There are other events where we need to deal with the permission, like the onTyping, so we can't just omit the agent prop.

In addition: What I can do is not send the agent info on backend side and then reduce the propagation of the showAgentInfo. but I'll need to use it in specific methods, like the onTyping.

@tassoevan
Copy link
Contributor

Well, at least we must give a try to the AgentInformationContext idea. The Chat, for instance, just carries the prop to give it to the Screen component... This is error-prone and a waste of time.

@renatobecker-zz
Copy link
Contributor Author

@ggazzo, this PR is ready to review/merge, as well as the related PR on the backend side.

@tassoevan tassoevan changed the base branch from dev to develop October 11, 2019 15:54
@@ -23,7 +23,7 @@ export const loadConfig = async () => {

await store.setState({
config,
agent,
agent: agent && agent.hiddenInfo ? { hiddenInfo: true } : agent, // TODO: revert it when the API is updated
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we keep this TODO?

@renatobecker-zz renatobecker-zz merged commit 34313fc into develop Nov 18, 2019
@renatobecker-zz renatobecker-zz deleted the new-setting-show-hide-livechat-agent branch November 18, 2019 12:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants