ux: mensagem especifica para play desativado em ticket encerrado
This commit is contained in:
parent
9d30d970a4
commit
a2a186dcf5
1 changed files with 10 additions and 1 deletions
|
|
@ -413,6 +413,15 @@ export function TicketSummaryHeader({ ticket }: TicketHeaderProps) {
|
||||||
const canPauseWork = !isResolved && (isAdmin || isCurrentResponsible)
|
const canPauseWork = !isResolved && (isAdmin || isCurrentResponsible)
|
||||||
const pauseDisabled = !canPauseWork
|
const pauseDisabled = !canPauseWork
|
||||||
const startDisabled = !canControlWork
|
const startDisabled = !canControlWork
|
||||||
|
const startDisabledReason = useMemo(() => {
|
||||||
|
if (isResolved) {
|
||||||
|
return "Este chamado está encerrado. Reabra o ticket para iniciar um novo atendimento."
|
||||||
|
}
|
||||||
|
if (!isAdmin && hasAssignee && !isCurrentResponsible) {
|
||||||
|
return "Apenas o responsável atual ou um administrador pode iniciar este atendimento."
|
||||||
|
}
|
||||||
|
return "Não é possível iniciar o atendimento neste momento."
|
||||||
|
}, [isResolved, isAdmin, hasAssignee, isCurrentResponsible])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!customersInitialized) {
|
if (!customersInitialized) {
|
||||||
|
|
@ -1261,7 +1270,7 @@ export function TicketSummaryHeader({ ticket }: TicketHeaderProps) {
|
||||||
</span>
|
</span>
|
||||||
</TooltipTrigger>
|
</TooltipTrigger>
|
||||||
<TooltipContent className="rounded-lg border border-slate-200 bg-white px-3 py-2 text-xs font-medium text-neutral-700 shadow-lg">
|
<TooltipContent className="rounded-lg border border-slate-200 bg-white px-3 py-2 text-xs font-medium text-neutral-700 shadow-lg">
|
||||||
Apenas o responsável atual ou um administrador pode iniciar este atendimento.
|
{startDisabledReason}
|
||||||
</TooltipContent>
|
</TooltipContent>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
) : (
|
) : (
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue