Skip to content

Commit

Permalink
added new setting and logic as per CC-13, allowing the default behavi…
Browse files Browse the repository at this point in the history
…or or the new one, enabling Agents to place chats onHold at anytime
  • Loading branch information
cabaceira committed Oct 2, 2023
1 parent 06b610c commit aff1d43
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,9 @@ export const useQuickActions = (): {
const canSendTranscriptPDF = usePermission('request-pdf-transcript');
const canCloseRoom = usePermission('close-livechat-room');
const canCloseOthersRoom = usePermission('close-others-livechat-room');
const canPlaceChatOnHold = Boolean(!room.onHold && room.u && manualOnHoldAllowed);

const allowManualOnHoldUponAgentEngagement = useSetting('Livechat_allow_manual_on_hold_upon_agent_engagement_only');
const canPlaceChatOnHold = !room.onHold && room.u && manualOnHoldAllowed &&

Check failure on line 313 in apps/meteor/client/views/room/Header/Omnichannel/QuickActions/hooks/useQuickActions.tsx

View workflow job for this annotation

GitHub Actions / 🔎 Code Check / Code Lint

Replace `·!room.onHold·&&·room.u·&&·manualOnHoldAllowed·&&⏎↹↹↹↹↹↹↹··` with `⏎↹↹!room.onHold·&&·room.u·&&·manualOnHoldAllowed·&&`
(allowManualOnHoldUponAgentEngagement ? !(room as any).lastMessage?.token : true);
const hasPermissionButtons = (id: string): boolean => {
switch (id) {
case QuickActionsEnum.MoveQueue:
Expand Down
12 changes: 12 additions & 0 deletions apps/meteor/ee/app/livechat-enterprise/server/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,18 @@ export const createSettings = async (): Promise<void> => {
enableQuery: omnichannelEnabledQuery,
});

await settingsRegistry.add('Livechat_allow_manual_on_hold_upon_agent_engagement_only', true, {
type: 'boolean',

Check failure on line 202 in apps/meteor/ee/app/livechat-enterprise/server/settings.ts

View workflow job for this annotation

GitHub Actions / 🔎 Code Check / Code Lint

Replace `········` with `↹↹`
group: 'Omnichannel',

Check failure on line 203 in apps/meteor/ee/app/livechat-enterprise/server/settings.ts

View workflow job for this annotation

GitHub Actions / 🔎 Code Check / Code Lint

Replace `········` with `↹↹`
section: 'Sessions',

Check failure on line 204 in apps/meteor/ee/app/livechat-enterprise/server/settings.ts

View workflow job for this annotation

GitHub Actions / 🔎 Code Check / Code Lint

Replace `········` with `↹↹`
enterprise: true,

Check failure on line 205 in apps/meteor/ee/app/livechat-enterprise/server/settings.ts

View workflow job for this annotation

GitHub Actions / 🔎 Code Check / Code Lint

Replace `········` with `↹↹`
invalidValue: false,

Check failure on line 206 in apps/meteor/ee/app/livechat-enterprise/server/settings.ts

View workflow job for this annotation

GitHub Actions / 🔎 Code Check / Code Lint

Replace `········` with `↹↹`
public: true,

Check failure on line 207 in apps/meteor/ee/app/livechat-enterprise/server/settings.ts

View workflow job for this annotation

GitHub Actions / 🔎 Code Check / Code Lint

Replace `········` with `↹↹`
modules: ['livechat-enterprise'],

Check failure on line 208 in apps/meteor/ee/app/livechat-enterprise/server/settings.ts

View workflow job for this annotation

GitHub Actions / 🔎 Code Check / Code Lint

Replace `········` with `↹↹`
enableQuery: { _id: 'Livechat_allow_manual_on_hold', value: true },

Check failure on line 209 in apps/meteor/ee/app/livechat-enterprise/server/settings.ts

View workflow job for this annotation

GitHub Actions / 🔎 Code Check / Code Lint

Replace `········` with `↹↹`
});


await settingsRegistry.add('Livechat_auto_transfer_chat_timeout', 0, {
type: 'int',
group: 'Omnichannel',
Expand Down
3 changes: 2 additions & 1 deletion apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -3051,7 +3051,8 @@
"Livechat_agents": "Omnichannel agents",
"Livechat_Agents": "Agents",
"Livechat_allow_manual_on_hold": "Allow agents to manually place chat On Hold",
"Livechat_allow_manual_on_hold_Description": "If enabled, the agent will get a new option to place a chat On Hold, provided the agent has sent the last message",
"Livechat_allow_manual_on_hold_upon_agent_engagement_only": "Allow agents to manually place chat On Hold, provided the agent has sent the last message",
"Livechat_allow_manual_on_hold__upon_agent_engagement_only_Description": "If enabled, the agent will get a new option to place a chat On Hold, provided the agent has sent the last message, otherwise Agents are able to place chats onHold irrespective",
"Livechat_AllowedDomainsList": "Livechat Allowed Domains",
"Livechat_Appearance": "Livechat Appearance",
"Livechat_auto_close_on_hold_chats_custom_message": "Custom message for closed chats in On Hold queue",
Expand Down
5 changes: 3 additions & 2 deletions apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -2628,7 +2628,8 @@
"Livechat_agents": "Agentes do omnichannel",
"Livechat_Agents": "Agentes",
"Livechat_allow_manual_on_hold": "Permitir que agentes coloquem a conversa em espera manualmente",
"Livechat_allow_manual_on_hold_Description": "Se habilitado, o agente terá uma nova opção para colocar a conversa em espera, desde que o agente tenha enviado a última mensagem",
"Livechat_allow_manual_on_hold_upon_agent_engagement_only": "Permitir que agentes coloquem a conversa em espera manualmente, sempre que o agente tenha enviado a última mensagem",
"Livechat_allow_manual_on_hold__upon_agent_engagement_only_Description": "Se habilitado, o agente terá uma nova opção para colocar a conversa em espera, desde que o agente tenha enviado a última mensagem. Caso contrário poderá sempre colocar a conversa em espera.",
"Livechat_AllowedDomainsList": "Domínios permitidos em Livechat",
"Livechat_Appearance": "Aparência do livechat",
"Livechat_auto_close_on_hold_chats_custom_message": "Mensagem personalizada para conversas encerradas na fila em espera",
Expand Down Expand Up @@ -4971,4 +4972,4 @@
"RegisterWorkspace_Features_Omnichannel_Title": "Omnichannel",
"RegisterWorkspace_Setup_Label": "E-mail da conta da nuvem",
"cloud.RegisterWorkspace_Setup_Terms_Privacy": "Eu concordo com os <1>Termos e condições</1> e a <3>Política de privacidade</3>"
}
}

0 comments on commit aff1d43

Please sign in to comment.