Skip to content

Comments

[FIX] Flextab information is not working when clicking on visitor or agent username in Omnichannel messages#16797

Merged
renatobecker merged 6 commits intoRocketChat:developfrom
ashwaniYDV:livechatUser
Mar 9, 2020
Merged

[FIX] Flextab information is not working when clicking on visitor or agent username in Omnichannel messages#16797
renatobecker merged 6 commits intoRocketChat:developfrom
ashwaniYDV:livechatUser

Conversation

@ashwaniYDV
Copy link
Contributor

@ashwaniYDV ashwaniYDV commented Mar 6, 2020

Closes #16795

After changes:

12

@ashwaniYDV ashwaniYDV changed the title [FIX] Visitor info flexTab data is not defined if accessed by clicking guest name/avatar [FIX] Visitor and livechat agent info flexTab data is not defined if accessed by clicking guest/agent name/avatar Mar 6, 2020
@ashwaniYDV
Copy link
Contributor Author

@renatobecker Please review :)


const roomData = Session.get(`roomData${ RoomManager.openedRoom }`);
if (roomTypes.roomTypes[roomData.t].enableMembersListProfile()) {
if (roomTypes.roomTypes[roomData.t].enableMembersListProfile() || roomData.t === 'l') {
Copy link
Contributor

Choose a reason for hiding this comment

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

My suggestion is to return true on the enableMembersListProfile method of the LivechatRoomType.

}

const { username } = msg.u;
const roomData = Session.get(`roomData${ RoomManager.openedRoom }`);
Copy link
Contributor

@renatobecker renatobecker Mar 9, 2020

Choose a reason for hiding this comment

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

I don't think this is a better implementation of this issue.
My suggestion is to create a custom method on the roomTypes class, called by something like openCustomProfileTab. you could call this new method before this line. In the default method, you would return false and in the LivechatRoomType you would implement the method, passing the instance, roomData and username as parameters. Then, you just need to check if the username is the same as the guest username, if so you could do something we do here;

@ashwaniYDV
Copy link
Contributor Author

hi @renatobecker. I have done the requested changes

Copy link
Contributor

@renatobecker renatobecker left a comment

Choose a reason for hiding this comment

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

Your implementation is good, I just left some suggestions to improve the code/logic.
Thanks.

}

openCustomProfileTab(instance, room, username) {
if (room.v.username !== username) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (room.v.username !== username) {
if (!room || !room.v || room.v.username !== username) {

instance.groupDetail.set(null);
instance.tabBar.setTemplate('membersList');
instance.tabBar.open();
if (!roomTypes.roomTypes[roomData.t].openCustomProfileTab(instance, roomData, username)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (!roomTypes.roomTypes[roomData.t].openCustomProfileTab(instance, roomData, username)) {
if (roomTypes.roomTypes[roomData.t].openCustomProfileTab(instance, roomData, username)) {
return;
}

@renatobecker renatobecker changed the title [FIX] Visitor and livechat agent info flexTab data is not defined if accessed by clicking guest/agent name/avatar [FIX] Flextab information is not working when clicking on visitor or agent username in Omnichannel messages Mar 9, 2020
@renatobecker renatobecker added this to the 3.1.0 milestone Mar 9, 2020
@renatobecker renatobecker merged commit 04857cb into RocketChat:develop Mar 9, 2020
gabriellsh added a commit to ritwizsinha/Rocket.Chat that referenced this pull request Mar 11, 2020
…6537-ritwizsinha-Issue#16499

* 'develop' of github.com:RocketChat/Rocket.Chat: (173 commits)
  [FIX] No settings to be displayed if search not found (RocketChat#16255)
  [FIX] Removed some hardcoded texts (RocketChat#16304)
  [FIX] Cannot unfollow message from thread's panel (RocketChat#16560)
  Add Enterprise Edition license (RocketChat#16801)
  [FIX] Fallback content-type as application/octet-stream for FileSystem uploads (RocketChat#16776)
  [IMPROVE] Apps-engine E2E tests (RocketChat#16781)
  [FIX] Remove spaces from i18n placeholders to show Personal access token (RocketChat#16724)
  [NEW] SAML config to allow clock drift (RocketChat#16751)
  [FIX] Slash command preview: Wrong item being selected, Horizontal scroll (RocketChat#16750)
  [FIX] Cannot pin on direct messages (RocketChat#16759)
  [FIX] Get all channels from Slack via REST API (RocketChat#16767)
  LingoHub Update 🚀 (RocketChat#16837)
  [FIX]  Flextab information is not working when clicking on visitor or agent username in Omnichannel messages (RocketChat#16797)
  Update Node to 12.16.1
  [NEW] Update Meteor to 1.9.2 (RocketChat#16718)
  [FIX] Slackbridge-import command doesn't work (RocketChat#16645)
  Fix omnichannel icon missing on sidebar (RocketChat#16775)
  [IMPROVE] Rename client-side term "Livechat" to "Omnichannel" (RocketChat#16752)
  [FIX] Language country has been ignored on translation load (RocketChat#16757)
  [FIX] Cannot edit Profile when Full Name is empty and not required (RocketChat#16744)
  ...
gabriellsh added a commit that referenced this pull request Mar 13, 2020
…exact_search

* 'develop' of github.com:RocketChat/Rocket.Chat: (178 commits)
  [IMPROVE] Add option to require authentication on user's shield endpoint (#16845)
  [FIX] Custom OAuth Bug (#16811)
  [FIX] Integrations page pagination (#16838)
  fix: livechat/facebook missing visitor data after registerGuest (#16810)
  [FIX] Invite links counting users already joined (#16591)
  [FIX] No settings to be displayed if search not found (#16255)
  [FIX] Removed some hardcoded texts (#16304)
  [FIX] Cannot unfollow message from thread's panel (#16560)
  Add Enterprise Edition license (#16801)
  [FIX] Fallback content-type as application/octet-stream for FileSystem uploads (#16776)
  [IMPROVE] Apps-engine E2E tests (#16781)
  [FIX] Remove spaces from i18n placeholders to show Personal access token (#16724)
  [NEW] SAML config to allow clock drift (#16751)
  [FIX] Slash command preview: Wrong item being selected, Horizontal scroll (#16750)
  [FIX] Cannot pin on direct messages (#16759)
  [FIX] Get all channels from Slack via REST API (#16767)
  LingoHub Update 🚀 (#16837)
  [FIX]  Flextab information is not working when clicking on visitor or agent username in Omnichannel messages (#16797)
  Update Node to 12.16.1
  [NEW] Update Meteor to 1.9.2 (#16718)
  ...
@sampaiodiego sampaiodiego mentioned this pull request Apr 9, 2020
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.

Visitor and livechat agent info flexTab data is not defined if accessed by clicking guest/agent name/avatar

2 participants