Merge branch 'testeA'

pull/1/head
adriano 2022-02-22 21:53:28 -03:00
commit ccfa108e6e
3 changed files with 42 additions and 8 deletions

View File

@ -207,8 +207,14 @@ const Connections = () => {
};
const renderActionButtons = whatsApp => {
return (
<>
return (
<Can
role={user.profile}
perform="connection-button:show"
yes={() => (
<>
{whatsApp.status === "qrcode" && (
<Button
size="small"
@ -219,8 +225,9 @@ const Connections = () => {
{i18n.t("connections.buttons.qrcode")}
</Button>
)}
{whatsApp.status === "DISCONNECTED" && (
<>
{whatsApp.status === "DISCONNECTED" && (
<>
<Button
size="small"
variant="outlined"
@ -259,6 +266,10 @@ const Connections = () => {
</Button>
)}
</>
)}
/>
);
};
@ -358,9 +369,20 @@ const Connections = () => {
<TableCell align="center">
{i18n.t("connections.table.status")}
</TableCell>
<TableCell align="center">
<Can
role={user.profile}
perform="connection-button:show"
yes={() => (
<TableCell align="center">
{i18n.t("connections.table.session")}
</TableCell>
</TableCell>
)}
/>
<TableCell align="center">
{i18n.t("connections.table.lastUpdate")}
</TableCell>
@ -384,9 +406,19 @@ const Connections = () => {
<TableCell align="center">
{renderStatusToolTips(whatsApp)}
</TableCell>
<TableCell align="center">
<Can
role={user.profile}
perform="connection-button:show"
yes={() => (
<TableCell align="center">
{renderActionButtons(whatsApp)}
</TableCell>
)}
/>
<TableCell align="center">
{format(parseISO(whatsApp.updatedAt), "dd/MM/yy HH:mm")}
</TableCell>

View File

@ -38,6 +38,7 @@ const rules = {
"btn-add-whatsapp",
"btn-remove-whatsapp",
"ticket-report:show",
"connection-button:show"
],
},
};

View File

@ -80,7 +80,8 @@ const messages = {
qrcode: {
title: "Esperando leitura do QR Code",
content:
"Clique no botão 'QR CODE' e leia o QR Code com o seu celular para iniciar a sessão",
// "Clique no botão 'QR CODE' e leia o QR Code com o seu celular para iniciar a sessão",
"Entre em contato com o suporte para realizar a leitura do QR code",
},
connected: {
title: "Conexão estabelecida!",