@orbe-agro/client-core 5.6.258 → 5.6.260

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/@ecme/components/layouts/PostLoginLayout/PostLoginLayout.js +2 -1
  2. package/dist/@ecme/components/layouts/PostLoginLayout/PostLoginLayout.js.map +1 -1
  3. package/dist/@ecme/components/template/Footer.js +1 -1
  4. package/dist/@types/@ecme/components/layouts/PostLoginLayout/PostLoginLayout.d.ts.map +1 -1
  5. package/dist/@types/base/components/shared/AceitarProcessoDialog.d.ts +2 -1
  6. package/dist/@types/base/components/shared/AceitarProcessoDialog.d.ts.map +1 -1
  7. package/dist/@types/base/components/shared/AdicionarHistoricoDialog.d.ts.map +1 -1
  8. package/dist/@types/base/components/shared/CancelarProcessoDialog.d.ts.map +1 -1
  9. package/dist/@types/base/components/shared/ConcluirProcessoDialog.d.ts.map +1 -1
  10. package/dist/@types/base/components/shared/EncerrarProcessoDialog.d.ts.map +1 -1
  11. package/dist/@types/base/components/shared/ReabrirProcessoDialog.d.ts.map +1 -1
  12. package/dist/@types/base/components/shared/RetornarFluxAtendimentoDialog.d.ts.map +1 -1
  13. package/dist/@types/base/components/shared/TransferirParaAtendenteDialog.d.ts.map +1 -1
  14. package/dist/@types/base/components/shared/TransferirParaSolicitanteDialog.d.ts.map +1 -1
  15. package/dist/@types/base/components/shared/TransferirProcessoDialog.d.ts.map +1 -1
  16. package/dist/base/components/shared/AceitarProcessoDialog.js +16 -2
  17. package/dist/base/components/shared/AceitarProcessoDialog.js.map +1 -1
  18. package/dist/base/components/shared/AdicionarHistoricoDialog.js +28 -24
  19. package/dist/base/components/shared/AdicionarHistoricoDialog.js.map +1 -1
  20. package/dist/base/components/shared/CancelarProcessoDialog.js +28 -24
  21. package/dist/base/components/shared/CancelarProcessoDialog.js.map +1 -1
  22. package/dist/base/components/shared/ConcluirProcessoDialog.js +27 -23
  23. package/dist/base/components/shared/ConcluirProcessoDialog.js.map +1 -1
  24. package/dist/base/components/shared/EncerrarProcessoDialog.js +28 -24
  25. package/dist/base/components/shared/EncerrarProcessoDialog.js.map +1 -1
  26. package/dist/base/components/shared/ReabrirProcessoDialog.js +27 -23
  27. package/dist/base/components/shared/ReabrirProcessoDialog.js.map +1 -1
  28. package/dist/base/components/shared/RetornarFluxAtendimentoDialog.js +27 -23
  29. package/dist/base/components/shared/RetornarFluxAtendimentoDialog.js.map +1 -1
  30. package/dist/base/components/shared/TransferirParaAtendenteDialog.js +28 -24
  31. package/dist/base/components/shared/TransferirParaAtendenteDialog.js.map +1 -1
  32. package/dist/base/components/shared/TransferirParaSolicitanteDialog.js +28 -24
  33. package/dist/base/components/shared/TransferirParaSolicitanteDialog.js.map +1 -1
  34. package/dist/base/components/shared/TransferirProcessoDialog.js +43 -33
  35. package/dist/base/components/shared/TransferirProcessoDialog.js.map +1 -1
  36. package/dist/base/services/modules/insumos/vendas/VendasService.js.map +1 -1
  37. package/lib/@ecme/components/layouts/PostLoginLayout/PostLoginLayout.tsx +4 -1
  38. package/lib/base/components/shared/AceitarProcessoDialog.tsx +13 -2
  39. package/lib/base/components/shared/AdicionarHistoricoDialog.tsx +16 -13
  40. package/lib/base/components/shared/CancelarProcessoDialog.tsx +16 -13
  41. package/lib/base/components/shared/ConcluirProcessoDialog.tsx +16 -13
  42. package/lib/base/components/shared/EncerrarProcessoDialog.tsx +16 -13
  43. package/lib/base/components/shared/ReabrirProcessoDialog.tsx +16 -13
  44. package/lib/base/components/shared/RetornarFluxAtendimentoDialog.tsx +14 -12
  45. package/lib/base/components/shared/TransferirParaAtendenteDialog.tsx +14 -12
  46. package/lib/base/components/shared/TransferirParaSolicitanteDialog.tsx +14 -12
  47. package/lib/base/components/shared/TransferirProcessoDialog.tsx +20 -12
  48. package/lib/base/services/modules/insumos/vendas/VendasService.ts +1 -1
  49. package/package.json +1 -1
@@ -17,6 +17,7 @@ import { Routes } from "@/@types";
17
17
  import { protectedRoutes, publicRoutes } from "@/configs";
18
18
  import GlobalLoading from "@/components/shared/loaders/GlobalLoading";
19
19
  import OrbeAiWidget from "@/components/template/OrbeAiWidget";
20
+ import Can from "@/components/shared/Can";
20
21
 
21
22
  type Layouts = Record<
22
23
  string,
@@ -66,7 +67,9 @@ const PostLoginLayout = ({
66
67
  return (
67
68
  <>
68
69
  <GlobalLoading />
69
- <OrbeAiWidget />
70
+ <Can I="VISUALIZAR_CHAT_ORBE_AI">
71
+ <OrbeAiWidget />
72
+ </Can>
70
73
  <Suspense
71
74
  fallback={
72
75
  <div className="flex flex-auto flex-col h-[100vh]">
@@ -4,15 +4,20 @@ import useAceitarProcesso from '@base/hooks/flux/useAceitarProcesso'
4
4
  interface AceitarProcessoDialogProps {
5
5
  isOpen: boolean
6
6
  onClose: () => void
7
+ onSuccess?: () => void
7
8
  idProcesso: number
8
9
  }
9
10
 
10
11
  const AceitarProcessoDialog = ({
11
12
  isOpen,
12
13
  onClose,
14
+ onSuccess,
13
15
  idProcesso,
14
16
  }: AceitarProcessoDialogProps) => {
15
- const { mutate: aceitarProcesso } = useAceitarProcesso(onClose)
17
+ const { mutate: aceitarProcesso, isPending } = useAceitarProcesso(
18
+ onClose,
19
+ onSuccess,
20
+ )
16
21
 
17
22
  const handleAceitarProcesso = (id: number) => {
18
23
  aceitarProcesso(id)
@@ -23,13 +28,19 @@ const AceitarProcessoDialog = ({
23
28
  <Dialog isOpen={isOpen} onClose={onClose} onRequestClose={onClose}>
24
29
  <h5 className="mb-4">Aceitar Processo</h5>
25
30
  <div className="flex w-full items-start">
26
- <Button block className="mx-2" onClick={() => onClose()}>
31
+ <Button
32
+ block
33
+ className="mx-2"
34
+ disabled={isPending}
35
+ onClick={() => onClose()}
36
+ >
27
37
  Cancelar
28
38
  </Button>
29
39
  <Button
30
40
  block
31
41
  className="mx-2"
32
42
  variant="solid"
43
+ loading={isPending}
33
44
  onClick={() => handleAceitarProcesso(idProcesso)}
34
45
  >
35
46
  Confirmar
@@ -1,4 +1,4 @@
1
- import { Button, Drawer, Input, Tooltip } from "@/components";
1
+ import { Button, Dialog, Input, Tooltip } from "@/components";
2
2
  import { useState } from "react";
3
3
  import useAdicionarHistorico from "@base/hooks/flux/useAdicionarHistorico";
4
4
  import { TActionProcesso } from "@base/@types/models/flux/processo";
@@ -14,8 +14,9 @@ const AdicionarHistoricoDialog = ({
14
14
  onClose,
15
15
  idProcesso,
16
16
  }: AdicionarHistoricoDialogProps) => {
17
- const { mutate: transferirProcesso } = useAdicionarHistorico(onClose, () =>
18
- setMotivo("")
17
+ const { mutate: transferirProcesso, isPending } = useAdicionarHistorico(
18
+ onClose,
19
+ () => setMotivo("")
19
20
  );
20
21
  const [motivo, setMotivo] = useState<string>("");
21
22
 
@@ -24,7 +25,12 @@ const AdicionarHistoricoDialog = ({
24
25
  };
25
26
  const Footer = (
26
27
  <div className="flex w-full items-start">
27
- <Button block className="mx-2" onClick={() => onClose()}>
28
+ <Button
29
+ block
30
+ className="mx-2"
31
+ disabled={isPending}
32
+ onClick={() => onClose()}
33
+ >
28
34
  Cancelar
29
35
  </Button>
30
36
  <Tooltip title={!motivo ? "Motivo obrigatório" : <></>} placement="top">
@@ -34,6 +40,7 @@ const AdicionarHistoricoDialog = ({
34
40
  className="mx-2"
35
41
  variant="solid"
36
42
  disabled={!motivo}
43
+ loading={isPending}
37
44
  onClick={() =>
38
45
  handleTransferirProcesso({
39
46
  idProcesso,
@@ -50,14 +57,9 @@ const AdicionarHistoricoDialog = ({
50
57
 
51
58
  return (
52
59
  <>
53
- <Drawer
54
- title="Adicionar Histórico"
55
- isOpen={isOpen}
56
- onClose={onClose}
57
- onRequestClose={onClose}
58
- footer={Footer}
59
- >
60
- <div className="flex flex-col gap-4 p-4">
60
+ <Dialog isOpen={isOpen} onClose={onClose} onRequestClose={onClose}>
61
+ <h5 className="mb-4">Adicionar Histórico</h5>
62
+ <div className="flex flex-col gap-4">
61
63
  <Input
62
64
  textArea
63
65
  required
@@ -67,7 +69,8 @@ const AdicionarHistoricoDialog = ({
67
69
  onChange={(e: any) => setMotivo(e.target.value)}
68
70
  />
69
71
  </div>
70
- </Drawer>
72
+ <div className="mt-6">{Footer}</div>
73
+ </Dialog>
71
74
  </>
72
75
  );
73
76
  };
@@ -1,4 +1,4 @@
1
- import { Drawer, Input, Tooltip } from "@/components/ui";
1
+ import { Input, Tooltip } from "@/components/ui";
2
2
  import { TActionProcesso } from "@base/@types/models/flux/processo";
3
3
  import { Button, Dialog } from "@/components";
4
4
  import { useState } from "react";
@@ -15,8 +15,9 @@ const CancelarProcessoDialog = ({
15
15
  onClose,
16
16
  idProcesso,
17
17
  }: CancelarProcessoDialogProps) => {
18
- const { mutate: cancelarProcesso } = useCancelarProcesso(onClose, () =>
19
- setMotivo("")
18
+ const { mutate: cancelarProcesso, isPending } = useCancelarProcesso(
19
+ onClose,
20
+ () => setMotivo("")
20
21
  );
21
22
  const [motivo, setMotivo] = useState<string>("");
22
23
 
@@ -26,7 +27,12 @@ const CancelarProcessoDialog = ({
26
27
 
27
28
  const Footer = (
28
29
  <div className="flex w-full items-start">
29
- <Button block className="mx-2" onClick={() => onClose()}>
30
+ <Button
31
+ block
32
+ className="mx-2"
33
+ disabled={isPending}
34
+ onClick={() => onClose()}
35
+ >
30
36
  Cancelar
31
37
  </Button>
32
38
  <Tooltip title={!motivo ? "Motivo obrigatório" : <></>} placement="top">
@@ -36,6 +42,7 @@ const CancelarProcessoDialog = ({
36
42
  className="mx-2"
37
43
  variant="solid"
38
44
  disabled={!motivo}
45
+ loading={isPending}
39
46
  onClick={() =>
40
47
  handleCancelarProcesso({
41
48
  idProcesso,
@@ -52,14 +59,9 @@ const CancelarProcessoDialog = ({
52
59
 
53
60
  return (
54
61
  <>
55
- <Drawer
56
- title="Cancelar Processo"
57
- isOpen={isOpen}
58
- onClose={onClose}
59
- onRequestClose={onClose}
60
- footer={Footer}
61
- >
62
- <div className="flex flex-col gap-4 p-4">
62
+ <Dialog isOpen={isOpen} onClose={onClose} onRequestClose={onClose}>
63
+ <h5 className="mb-4">Cancelar Processo</h5>
64
+ <div className="flex flex-col gap-4">
63
65
  <Input
64
66
  textArea
65
67
  required
@@ -69,7 +71,8 @@ const CancelarProcessoDialog = ({
69
71
  onChange={(e) => setMotivo(e.target.value)}
70
72
  />
71
73
  </div>
72
- </Drawer>
74
+ <div className="mt-6">{Footer}</div>
75
+ </Dialog>
73
76
  </>
74
77
  );
75
78
  };
@@ -1,4 +1,4 @@
1
- import { Drawer, Input, Tooltip } from "@/components/ui";
1
+ import { Dialog, Input, Tooltip } from "@/components/ui";
2
2
  import { TActionProcesso } from "@base/@types/models/flux/processo";
3
3
  import { Button } from "@/components";
4
4
  import { useState } from "react";
@@ -15,8 +15,9 @@ const ConcluirProcessoDialog = ({
15
15
  onClose,
16
16
  idProcesso,
17
17
  }: ConcluirProcessoDialogProps) => {
18
- const { mutate: concluirProcesso } = useConcluirProcesso(onClose, () =>
19
- setMotivo("")
18
+ const { mutate: concluirProcesso, isPending } = useConcluirProcesso(
19
+ onClose,
20
+ () => setMotivo("")
20
21
  );
21
22
  const [motivo, setMotivo] = useState<string>("");
22
23
 
@@ -26,7 +27,12 @@ const ConcluirProcessoDialog = ({
26
27
 
27
28
  const Footer = (
28
29
  <div className="flex w-full items-start">
29
- <Button block className="mx-2" onClick={() => onClose()}>
30
+ <Button
31
+ block
32
+ className="mx-2"
33
+ disabled={isPending}
34
+ onClick={() => onClose()}
35
+ >
30
36
  Cancelar
31
37
  </Button>
32
38
  <Tooltip title={!motivo ? "Motivo obrigatório" : <></>} placement="top">
@@ -36,6 +42,7 @@ const ConcluirProcessoDialog = ({
36
42
  className="mx-2"
37
43
  variant="solid"
38
44
  disabled={!motivo}
45
+ loading={isPending}
39
46
  onClick={() => {
40
47
  handleConcluirProcesso({
41
48
  idProcesso,
@@ -52,14 +59,9 @@ const ConcluirProcessoDialog = ({
52
59
 
53
60
  return (
54
61
  <>
55
- <Drawer
56
- title="Concluir Processo"
57
- isOpen={isOpen}
58
- onClose={onClose}
59
- onRequestClose={onClose}
60
- footer={Footer}
61
- >
62
- <div className="flex flex-col gap-4 p-4">
62
+ <Dialog isOpen={isOpen} onClose={onClose} onRequestClose={onClose}>
63
+ <h5 className="mb-4">Concluir Processo</h5>
64
+ <div className="flex flex-col gap-4">
63
65
  <Input
64
66
  textArea
65
67
  rows={4}
@@ -68,7 +70,8 @@ const ConcluirProcessoDialog = ({
68
70
  onChange={(e) => setMotivo(e.target.value)}
69
71
  />
70
72
  </div>
71
- </Drawer>
73
+ <div className="mt-6">{Footer}</div>
74
+ </Dialog>
72
75
  </>
73
76
  );
74
77
  };
@@ -1,4 +1,4 @@
1
- import { Drawer, Input, Tooltip } from "@/components/ui";
1
+ import { Input, Tooltip } from "@/components/ui";
2
2
  import { TActionProcesso } from "@base/@types/models/flux/processo";
3
3
  import { Button, Dialog } from "@/components";
4
4
  import { useState } from "react";
@@ -15,8 +15,9 @@ const EncerrarProcessoDialog = ({
15
15
  onClose,
16
16
  idProcesso,
17
17
  }: EncerrarProcessoDialogProps) => {
18
- const { mutate: encerrarProcesso } = useEncerrarProcesso(onClose, () =>
19
- setMotivo("")
18
+ const { mutate: encerrarProcesso, isPending } = useEncerrarProcesso(
19
+ onClose,
20
+ () => setMotivo("")
20
21
  );
21
22
  const [motivo, setMotivo] = useState<string>("");
22
23
 
@@ -26,7 +27,12 @@ const EncerrarProcessoDialog = ({
26
27
 
27
28
  const Footer = (
28
29
  <div className="flex w-full items-start">
29
- <Button block className="mx-2" onClick={() => onClose()}>
30
+ <Button
31
+ block
32
+ className="mx-2"
33
+ disabled={isPending}
34
+ onClick={() => onClose()}
35
+ >
30
36
  Cancelar
31
37
  </Button>
32
38
  <Tooltip title={!motivo ? "Motivo obrigatório" : <></>} placement="top">
@@ -36,6 +42,7 @@ const EncerrarProcessoDialog = ({
36
42
  className="mx-2"
37
43
  variant="solid"
38
44
  disabled={!motivo}
45
+ loading={isPending}
39
46
  onClick={() =>
40
47
  handleEncerrarProcesso({
41
48
  idProcesso,
@@ -52,14 +59,9 @@ const EncerrarProcessoDialog = ({
52
59
 
53
60
  return (
54
61
  <>
55
- <Drawer
56
- title="Encerrar Processo"
57
- isOpen={isOpen}
58
- onClose={onClose}
59
- onRequestClose={onClose}
60
- footer={Footer}
61
- >
62
- <div className="flex flex-col gap-4 p-4">
62
+ <Dialog isOpen={isOpen} onClose={onClose} onRequestClose={onClose}>
63
+ <h5 className="mb-4">Encerrar Processo</h5>
64
+ <div className="flex flex-col gap-4">
63
65
  <Input
64
66
  textArea
65
67
  required
@@ -69,7 +71,8 @@ const EncerrarProcessoDialog = ({
69
71
  onChange={(e) => setMotivo(e.target.value)}
70
72
  />
71
73
  </div>
72
- </Drawer>
74
+ <div className="mt-6">{Footer}</div>
75
+ </Dialog>
73
76
  </>
74
77
  );
75
78
  };
@@ -1,4 +1,4 @@
1
- import { Drawer, Input, Tooltip } from "@/components/ui";
1
+ import { Dialog, Input, Tooltip } from "@/components/ui";
2
2
  import { TActionProcesso } from "@base/@types/models/flux/processo";
3
3
  import { Button } from "@/components";
4
4
  import { useState } from "react";
@@ -15,8 +15,9 @@ const ReabrirProcessoDialog = ({
15
15
  onClose,
16
16
  idProcesso,
17
17
  }: ReabrirProcessoDialogProps) => {
18
- const { mutate: reabrirProcesso } = useReabrirProcesso(onClose, () =>
19
- setMotivo("")
18
+ const { mutate: reabrirProcesso, isPending } = useReabrirProcesso(
19
+ onClose,
20
+ () => setMotivo("")
20
21
  );
21
22
  const [motivo, setMotivo] = useState<string>("");
22
23
 
@@ -26,7 +27,12 @@ const ReabrirProcessoDialog = ({
26
27
 
27
28
  const Footer = (
28
29
  <div className="flex w-full items-start">
29
- <Button block className="mx-2" onClick={() => onClose()}>
30
+ <Button
31
+ block
32
+ className="mx-2"
33
+ disabled={isPending}
34
+ onClick={() => onClose()}
35
+ >
30
36
  Cancelar
31
37
  </Button>
32
38
  <Tooltip title={!motivo ? "Motivo obrigatório" : <></>} placement="top">
@@ -36,6 +42,7 @@ const ReabrirProcessoDialog = ({
36
42
  className="mx-2"
37
43
  variant="solid"
38
44
  disabled={!motivo}
45
+ loading={isPending}
39
46
  onClick={() =>
40
47
  handleReabrirProcesso({
41
48
  idProcesso,
@@ -52,14 +59,9 @@ const ReabrirProcessoDialog = ({
52
59
 
53
60
  return (
54
61
  <>
55
- <Drawer
56
- title="Reabrir Processo"
57
- isOpen={isOpen}
58
- onClose={onClose}
59
- onRequestClose={onClose}
60
- footer={Footer}
61
- >
62
- <div className="flex flex-col gap-4 p-4">
62
+ <Dialog isOpen={isOpen} onClose={onClose} onRequestClose={onClose}>
63
+ <h5 className="mb-4">Reabrir Processo</h5>
64
+ <div className="flex flex-col gap-4">
63
65
  <Input
64
66
  textArea
65
67
  rows={4}
@@ -68,7 +70,8 @@ const ReabrirProcessoDialog = ({
68
70
  onChange={(e) => setMotivo(e.target.value)}
69
71
  />
70
72
  </div>
71
- </Drawer>
73
+ <div className="mt-6">{Footer}</div>
74
+ </Dialog>
72
75
  </>
73
76
  );
74
77
  };
@@ -1,4 +1,4 @@
1
- import { Drawer, Input, Tooltip } from "@/components/ui";
1
+ import { Dialog, Input, Tooltip } from "@/components/ui";
2
2
  import { TActionProcesso } from "@base/@types/models/flux/processo";
3
3
  import { Button } from "@/components";
4
4
  import { useState } from "react";
@@ -15,7 +15,7 @@ const RetornarFluxAtendimentoDialog = ({
15
15
  onClose,
16
16
  idProcesso,
17
17
  }: RetornarFluxAtendimentoDialogProps) => {
18
- const { mutate: retornarProcesso } = useRetornarFluxoAtendimento(
18
+ const { mutate: retornarProcesso, isPending } = useRetornarFluxoAtendimento(
19
19
  onClose,
20
20
  () => setMotivo("")
21
21
  );
@@ -27,7 +27,12 @@ const RetornarFluxAtendimentoDialog = ({
27
27
 
28
28
  const Footer = (
29
29
  <div className="flex w-full items-start">
30
- <Button block className="mx-2" onClick={() => onClose()}>
30
+ <Button
31
+ block
32
+ className="mx-2"
33
+ disabled={isPending}
34
+ onClick={() => onClose()}
35
+ >
31
36
  Cancelar
32
37
  </Button>
33
38
  <Tooltip title={!motivo ? "Motivo obrigatório" : <></>} placement="top">
@@ -37,6 +42,7 @@ const RetornarFluxAtendimentoDialog = ({
37
42
  className="mx-2"
38
43
  variant="solid"
39
44
  disabled={!motivo}
45
+ loading={isPending}
40
46
  onClick={() =>
41
47
  handleRetornarProcesso({
42
48
  idProcesso,
@@ -53,14 +59,9 @@ const RetornarFluxAtendimentoDialog = ({
53
59
 
54
60
  return (
55
61
  <>
56
- <Drawer
57
- title="Retornar Fluxo de Atendimento"
58
- isOpen={isOpen}
59
- onClose={onClose}
60
- onRequestClose={onClose}
61
- footer={Footer}
62
- >
63
- <div className="flex flex-col gap-4 p-4">
62
+ <Dialog isOpen={isOpen} onClose={onClose} onRequestClose={onClose}>
63
+ <h5 className="mb-4">Retornar Fluxo de Atendimento</h5>
64
+ <div className="flex flex-col gap-4">
64
65
  <Input
65
66
  textArea
66
67
  rows={4}
@@ -69,7 +70,8 @@ const RetornarFluxAtendimentoDialog = ({
69
70
  onChange={(e) => setMotivo(e.target.value)}
70
71
  />
71
72
  </div>
72
- </Drawer>
73
+ <div className="mt-6">{Footer}</div>
74
+ </Dialog>
73
75
  </>
74
76
  );
75
77
  };
@@ -1,4 +1,4 @@
1
- import { Button, Drawer, Input, Tooltip } from "@/components";
1
+ import { Button, Dialog, Input, Tooltip } from "@/components";
2
2
  import { TActionProcesso } from "@base/@types/models/flux/processo";
3
3
  import { useState } from "react";
4
4
  import useTransferirParaAtendente from "@base/hooks/flux/useTransferirParaAtendente";
@@ -14,7 +14,7 @@ const TransferirParaAtendenteDialog = ({
14
14
  onClose,
15
15
  idProcesso,
16
16
  }: TransferirParaAtendenteDialogProps) => {
17
- const { mutate: transferirProcesso } = useTransferirParaAtendente(
17
+ const { mutate: transferirProcesso, isPending } = useTransferirParaAtendente(
18
18
  onClose,
19
19
  () => setMotivo("")
20
20
  );
@@ -25,7 +25,12 @@ const TransferirParaAtendenteDialog = ({
25
25
  };
26
26
  const Footer = (
27
27
  <div className="flex w-full items-start">
28
- <Button block className="mx-2" onClick={() => onClose()}>
28
+ <Button
29
+ block
30
+ className="mx-2"
31
+ disabled={isPending}
32
+ onClick={() => onClose()}
33
+ >
29
34
  Cancelar
30
35
  </Button>
31
36
  <Tooltip title={!motivo ? "Motivo obrigatório" : <></>} placement="top">
@@ -35,6 +40,7 @@ const TransferirParaAtendenteDialog = ({
35
40
  className="mx-2"
36
41
  variant="solid"
37
42
  disabled={!motivo}
43
+ loading={isPending}
38
44
  onClick={() =>
39
45
  handleTransferirProcesso({
40
46
  idProcesso,
@@ -51,14 +57,9 @@ const TransferirParaAtendenteDialog = ({
51
57
 
52
58
  return (
53
59
  <>
54
- <Drawer
55
- title="Transferir Processo para Atendente"
56
- isOpen={isOpen}
57
- onClose={onClose}
58
- onRequestClose={onClose}
59
- footer={Footer}
60
- >
61
- <div className="flex flex-col gap-4 p-4">
60
+ <Dialog isOpen={isOpen} onClose={onClose} onRequestClose={onClose}>
61
+ <h5 className="mb-4">Transferir Processo para Atendente</h5>
62
+ <div className="flex flex-col gap-4">
62
63
  <Input
63
64
  textArea
64
65
  required
@@ -68,7 +69,8 @@ const TransferirParaAtendenteDialog = ({
68
69
  onChange={(e: any) => setMotivo(e.target.value)}
69
70
  />
70
71
  </div>
71
- </Drawer>
72
+ <div className="mt-6">{Footer}</div>
73
+ </Dialog>
72
74
  </>
73
75
  );
74
76
  };
@@ -1,4 +1,4 @@
1
- import { Button, Drawer, Input, Tooltip } from "@/components";
1
+ import { Button, Dialog, Input, Tooltip } from "@/components";
2
2
  import { TActionProcesso } from "@base/@types/models/flux/processo";
3
3
  import { useState } from "react";
4
4
  import useTransferirParaSolicitante from "@base/hooks/flux/useTransferirParaSolicitante";
@@ -14,7 +14,7 @@ const TransferirParaSolicitanteDialog = ({
14
14
  onClose,
15
15
  idProcesso,
16
16
  }: TransferirParaSolicitanteDialogProps) => {
17
- const { mutate: transferirProcesso } = useTransferirParaSolicitante(
17
+ const { mutate: transferirProcesso, isPending } = useTransferirParaSolicitante(
18
18
  onClose,
19
19
  () => setMotivo("")
20
20
  );
@@ -25,7 +25,12 @@ const TransferirParaSolicitanteDialog = ({
25
25
  };
26
26
  const Footer = (
27
27
  <div className="flex w-full items-start">
28
- <Button block className="mx-2" onClick={() => onClose()}>
28
+ <Button
29
+ block
30
+ className="mx-2"
31
+ disabled={isPending}
32
+ onClick={() => onClose()}
33
+ >
29
34
  Cancelar
30
35
  </Button>
31
36
  <Tooltip title={!motivo ? "Motivo obrigatório" : <></>} placement="top">
@@ -35,6 +40,7 @@ const TransferirParaSolicitanteDialog = ({
35
40
  className="mx-2"
36
41
  variant="solid"
37
42
  disabled={!motivo}
43
+ loading={isPending}
38
44
  onClick={() =>
39
45
  handleTransferirProcesso({
40
46
  idProcesso,
@@ -51,14 +57,9 @@ const TransferirParaSolicitanteDialog = ({
51
57
 
52
58
  return (
53
59
  <>
54
- <Drawer
55
- title="Transferir Processo para Solicitante"
56
- isOpen={isOpen}
57
- onClose={onClose}
58
- onRequestClose={onClose}
59
- footer={Footer}
60
- >
61
- <div className="flex flex-col gap-4 p-4">
60
+ <Dialog isOpen={isOpen} onClose={onClose} onRequestClose={onClose}>
61
+ <h5 className="mb-4">Transferir Processo para Solicitante</h5>
62
+ <div className="flex flex-col gap-4">
62
63
  <Input
63
64
  textArea
64
65
  rows={4}
@@ -68,7 +69,8 @@ const TransferirParaSolicitanteDialog = ({
68
69
  onChange={(e) => setMotivo(e.target.value)}
69
70
  />
70
71
  </div>
71
- </Drawer>
72
+ <div className="mt-6">{Footer}</div>
73
+ </Dialog>
72
74
  </>
73
75
  );
74
76
  };
@@ -1,4 +1,4 @@
1
- import { Button, Drawer, Input, Select, Tooltip } from "@/components";
1
+ import { Button, Dialog, Input, Select, Tooltip } from "@/components";
2
2
  import { TActionProcesso } from "@base/@types/models/flux/processo";
3
3
  import { useEffect, useState } from "react";
4
4
  import useTransferirProcesso from "@base/hooks/flux/useTransferirProcesso";
@@ -15,7 +15,13 @@ const TransferirProcessoDialog = ({
15
15
  onClose,
16
16
  idProcesso,
17
17
  }: TransferirProcessoDialogProps) => {
18
- const { mutate: transferirProcesso } = useTransferirProcesso();
18
+ const { mutate: transferirProcesso, isPending } = useTransferirProcesso(
19
+ onClose,
20
+ () => {
21
+ setMotivo("");
22
+ setIdUsuario(null);
23
+ }
24
+ );
19
25
  const [idUsuario, setIdUsuario] = useState<any>(null);
20
26
  const [motivo, setMotivo] = useState<string>("");
21
27
  const [usersOptions, setUsersOptions] = useState<
@@ -46,7 +52,12 @@ const TransferirProcessoDialog = ({
46
52
  };
47
53
  const Footer = (
48
54
  <div className="flex w-full items-start">
49
- <Button block className="mx-2" onClick={() => onClose()}>
55
+ <Button
56
+ block
57
+ className="mx-2"
58
+ disabled={isPending}
59
+ onClick={() => onClose()}
60
+ >
50
61
  Cancelar
51
62
  </Button>
52
63
  <Tooltip title={!motivo ? "Motivo obrigatório" : <></>} placement="top">
@@ -56,6 +67,7 @@ const TransferirProcessoDialog = ({
56
67
  className="mx-2"
57
68
  variant="solid"
58
69
  disabled={!motivo}
70
+ loading={isPending}
59
71
  onClick={() =>
60
72
  handleTransferirProcesso({
61
73
  idProcesso,
@@ -73,14 +85,9 @@ const TransferirProcessoDialog = ({
73
85
 
74
86
  return (
75
87
  <>
76
- <Drawer
77
- title="Transferir Processo"
78
- isOpen={isOpen}
79
- onClose={onClose}
80
- onRequestClose={onClose}
81
- footer={Footer}
82
- >
83
- <div className="flex flex-col gap-4 p-4">
88
+ <Dialog isOpen={isOpen} onClose={onClose} onRequestClose={onClose}>
89
+ <h5 className="mb-4">Transferir Processo</h5>
90
+ <div className="flex flex-col gap-4">
84
91
  <Select
85
92
  placeholder="Selecione um usuário"
86
93
  options={usersOptions}
@@ -94,7 +101,8 @@ const TransferirProcessoDialog = ({
94
101
  onChange={(e: any) => setMotivo(e.target.value)}
95
102
  />
96
103
  </div>
97
- </Drawer>
104
+ <div className="mt-6">{Footer}</div>
105
+ </Dialog>
98
106
  </>
99
107
  );
100
108
  };
@@ -64,4 +64,4 @@ export async function apiSetVendaLock(idVenda: number, lock: boolean) {
64
64
  lock,
65
65
  },
66
66
  })
67
- }
67
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbe-agro/client-core",
3
- "version": "5.6.258",
3
+ "version": "5.6.260",
4
4
  "description": "Biblioteca principal de componentes e utilidades para os microfrontends do Orbe Agro.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",