feat: the team no longer gets alert e-mails; the Kanban user form drops the option
All checks were successful
Build and deploy / Validate source (push) Successful in 47s
Build and deploy / Integration suite on a real stack (push) Successful in 3m38s
Build and deploy / Secret scan and release gate (push) Successful in 9s
Build and deploy / Publish images (push) Successful in 1m20s
All checks were successful
Build and deploy / Validate source (push) Successful in 47s
Build and deploy / Integration suite on a real stack (push) Successful in 3m38s
Build and deploy / Secret scan and release gate (push) Successful in 9s
Build and deploy / Publish images (push) Successful in 1m20s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1097,7 +1097,7 @@ function renderUsers(){
|
||||
const machineName=id=>machines.find(m=>m.id===id)?.name||'—';
|
||||
const rows=users.map(u=>{
|
||||
const tr=node('tr');if(!u.active)tr.classList.add('off');
|
||||
const who=node('td');who.append(node('b',u.name||u.email),node('span',u.email+(u.alerts?' · recebe alertas':''),'faint block'));
|
||||
const who=node('td');who.append(node('b',u.name||u.email),node('span',u.email,'faint block'));
|
||||
const machinesTd=node('td',u.machines.length?u.machines.map(machineName).join(', '):(u.role==='operador'?'Todas':'—'));
|
||||
const seen=node('td',u.last_login_at?when(u.last_login_at):'nunca entrou','faint');
|
||||
const actions=node('td',undefined,'actions');
|
||||
@@ -1143,16 +1143,14 @@ function userForm(u){
|
||||
pass.required=!editing;pass.placeholder=editing?'Deixe em branco para manter':'8 caracteres ou mais';
|
||||
const active=node('input');active.type='checkbox';active.checked=u?u.active:true;active.disabled=u?.email===ME.email;
|
||||
const activeLabel=node('label',undefined,'check');activeLabel.append(active,'Ativo (pode entrar no Kanban)');
|
||||
const alerts=node('input');alerts.type='checkbox';alerts.checked=!!u?.alerts;
|
||||
const alertsLabel=node('label',undefined,'check');alertsLabel.append(alerts,'Receber alertas por e-mail (pedido pago, cotação para revisar, pagamento com problema)');
|
||||
const boxes=usersData.machines.map(m=>{const c=node('input');c.type='checkbox';c.value=m.id;c.checked=!!u?.machines.includes(m.id);
|
||||
const l=node('label',undefined,'check');l.append(c,m.name);return l;});
|
||||
const machinesField=node('div',undefined,'mfield');
|
||||
machinesField.append('Máquinas (só para operadores; nenhuma = todas)',...(boxes.length?boxes:[node('span','Nenhuma máquina cadastrada.','faint')]));
|
||||
const syncMachines=()=>{machinesField.hidden=role.value!=='operador';};role.onchange=syncMachines;syncMachines();
|
||||
dialog(editing?'Editar usuário':'Novo usuário',[field('Nome',name),field('E-mail',email),field('Perfil',role),
|
||||
field(editing?'Nova senha':'Senha inicial',pass),machinesField,activeLabel,alertsLabel],async()=>{
|
||||
const body={name:name.value,email:email.value,role:role.value==='superadmin'?'admin':role.value,active:active.checked,alerts:alerts.checked,
|
||||
field(editing?'Nova senha':'Senha inicial',pass),machinesField,activeLabel],async()=>{
|
||||
const body={name:name.value,email:email.value,role:role.value==='superadmin'?'admin':role.value,active:active.checked,
|
||||
machines:role.value==='operador'?boxes.map(l=>l.querySelector('input')).filter(c=>c.checked).map(c=>c.value):[],
|
||||
password:pass.value||null};
|
||||
await api(editing?'/users/'+u.id:'/users',body);
|
||||
@@ -1689,22 +1687,20 @@ function renderIntegrations(){
|
||||
$('integrations').replaceChildren(...rows);
|
||||
eventFilters();
|
||||
}
|
||||
// E-mail: customers' password recovery and the team's alerts (app/mail.py).
|
||||
// E-mail: the customers' messages (app/mail.py).
|
||||
function mailRow(m){
|
||||
const name='E-mail';
|
||||
if(m.adapter!=='smtp'&&m.adapter!=='log')return integration({name,state:'Não configurado',tone:'off',
|
||||
summary:'Sem recuperação de senha por e-mail: o cliente é orientado a chamar no WhatsApp.'});
|
||||
const local=m.adapter==='log';
|
||||
const who=m.alerts?m.alerts+(m.alerts>1?' pessoas recebem':' pessoa recebe')+' os alertas':'ninguém recebe os alertas ainda';
|
||||
return integration({name,state:m.error?'Verificar':local?'Só registro':'Ativo',tone:m.error?'warn':local?'off':'ok',
|
||||
summary:m.error?'Falhou o envio para '+m.error.to+': '+m.error.error:'Recuperação de senha e alertas · '+who+'.',
|
||||
summary:m.error?'Falhou o envio para '+m.error.to+': '+m.error.error:'E-mails dos clientes: confirmação de pedido, recuperação de senha e códigos de confirmação.',
|
||||
actions:[button('Enviar teste',async()=>{const r=await api('/mail/test',{});
|
||||
say(local?'Teste registrado. Neste ambiente os e-mails ficam só no registro do servidor.':'Teste enviado para '+r.to+'. Confira a caixa de entrada (e o spam).');})],
|
||||
details:[...(local?[node('p','Ambiente local: os e-mails não saem do servidor, ficam no registro do worker.')]:[]),
|
||||
['Remetente',m.from||'—'],...(m.host?[['Servidor',m.host]]:[]),
|
||||
['Último envio',m.last_sent?when(m.last_sent):'Nenhum ainda'],['Na fila',String(m.pending||0)],
|
||||
...(m.error?[['Último erro',when(m.error.at)+' · '+m.error.error]]:[]),
|
||||
node('p','Quem recebe os alertas se escolhe em Usuários → Editar → “Receber alertas por e-mail”.')]});
|
||||
...(m.error?[['Último erro',when(m.error.at)+' · '+m.error.error]]:[])]});
|
||||
}
|
||||
function mercadoPagoCheck(r){
|
||||
const w=r.webhooks||{};
|
||||
|
||||
Reference in New Issue
Block a user