-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[IMPROVE] Support for tag request close when is obligatory to close Omnichannel's Channel #4353
Conversation
app/containers/ActionSheet/ActionSheetContentWithInputAndSubmit/index.tsx
Outdated
Show resolved
Hide resolved
app/containers/ActionSheet/ActionSheetContentWithInputAndSubmit/index.tsx
Outdated
Show resolved
Hide resolved
onPress: () => { | ||
if (isMasterDetail) { | ||
navigation.navigate('ModalStackNavigator', { | ||
screen: 'ForwardLivechatView', | ||
params: { rid } | ||
}); | ||
} else { | ||
navigation.navigate('ForwardLivechatView', { rid }); | ||
} | ||
} |
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.
Fix the navigation to ForwardLivechatView using the tablets. That was missing.
app/containers/ActionSheet/ActionSheetContentWithInputAndSubmit/index.tsx
Outdated
Show resolved
Hide resolved
app/lib/services/restApi.ts
Outdated
// RC 0.29.0 | ||
sdk.methodCallWrapper('livechat:closeRoom', rid, comment, { clientAction: true }); | ||
sdk.methodCallWrapper('livechat:closeRoom', rid, comment, { clientAction: true, tags }); |
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 you sure old versions of the server are accepting this extra argument?
I'm not talking about disabling the feature, but backwards compatibility.
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.
I don't have this answer right now, but I will search for it. At least, in which version of the server the tags were introduced
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.
The tags were introduced here: RocketChat/Rocket.Chat#17254
2 years ago!
Instead of creating a condition for which version of the server, I decided to send the extra argument only when there are tags selected.
app/views/CloseLivechatView.tsx
Outdated
} else { | ||
setCanSubmit(false); | ||
} | ||
}, [inputValue, livechatRequestComment, requestTags, tagParamSelected]); |
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.
Everything on this dependency array is a state.
Every time they update, a re-render is triggered.
What you're doing is triggering a new re-render whenever they update to update canSubmit
and then update the button.
That's unnecessary.
Since you already know the render is going to get triggered, you can use a normal constant instead of a state.
This is much better.
let canSubmit = false;
if (!requestTags && !livechatRequestComment) {
canSubmit = true;
}
// ...
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.
Nice point!
…mnichannel's Channel (RocketChat#4353) * [IMPROVE] Support for tag request close * clean up * refactor isObrigatory and value * fix obligatory * removed onSubmitEditing * create closelivechatview * Refactor Close Omnichannel from ActionSheet to a new Screen * Fix navigation * fix screen title * back to before actionsheetwithinput * added string in pt-br * refactor canSubmit * fix the method closeRoom * comment of server's version * some tweaks * Update app/lib/services/restApi.ts Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com>
Proposed changes
Currently, mobile does not give support for the Request tag(s) before closing conversation option for Omnichannel Departments. Because of that, when an agent tries to close a chat and their department has that option active, the agent does not receive the request for a tag.
The chat ends up not being closed, and they receive no feedback on what's happening.
Issue(s)
How to test or reproduce
As an agent, your department must enable
Request tag(s) before closing conversation
Take a new Omnichannel Chat
Try closing it
Trying to close an old chat without tags.
Screenshots
Screen.Recording.2022-07-14.at.21.59.32.mov
Types of changes
Checklist
Further comments