- {allowToSent && !isSent && (
- <>
-
-
- >
- )}
+
+
+
+
+
+
+
+
+ Editar
+
+
- {!isSent && (
- <>
-
+
+
+
+
+
+ Duplicar
+
+
-
- >
- )}
+
+
+
+
+
+ Descargar
+
+
-
-
-
-
- {t("quotes.list.resume.download_quote")}
-
+
+
+
+
+
+ Archivar
+
+
+
- {/*
-
-
-
-
-
- {t("common.more")}
-
-
-
-
-
- {t("quotes.list.preview.download_quote")}
-
-
- */}
+
+
+
diff --git a/client/src/app/quotes/components/QuotesDataTable.tsx b/client/src/app/quotes/components/QuotesDataTable.tsx
index ea48f7f..07567cd 100644
--- a/client/src/app/quotes/components/QuotesDataTable.tsx
+++ b/client/src/app/quotes/components/QuotesDataTable.tsx
@@ -19,7 +19,7 @@ import { useNavigate } from "react-router-dom";
import { useQuotes } from "../hooks";
import { DownloadQuoteDialog } from "./DownloadQuoteDialog";
import { QuoteResume } from "./QuoteResume";
-import { QuoteStatusEditor } from "./editors";
+import { QuoteSentToEditor, QuoteStatusEditor } from "./editors";
export const QuotesDataTable = ({
status = "all",
@@ -89,6 +89,23 @@ export const QuotesDataTable = ({
);
};
+ const handleArchiveQuote = (id: string) => {
+ setStatusMutation(
+ { id, newStatus: "archived" },
+
+ {
+ onSuccess: () => {
+ toast({
+ description: t("quotes.quote_status_editor.toast_status_changed", {
+ newStatus: t("quotes.status.archived"),
+ }),
+ variant: "success",
+ });
+ },
+ }
+ );
+ };
+
const handleOnChangeStatus = (id: string, newStatus: string) => {
setStatusMutation(
{ id, newStatus },
@@ -148,9 +165,7 @@ export const QuotesDataTable = ({
- handleOnChangeStatus(original.id, newStatus)
- }
+ onChangeStatus={(newStatus: string) => handleOnChangeStatus(original.id, newStatus)}
/>
),
},
@@ -162,12 +177,17 @@ export const QuotesDataTable = ({
),
cell: ({ row: { original } }: { row: { original: IListQuotes_Response_DTO } }) => {
const quoteDate = UTCDateValue.create(original.date_sent);
+ const isSuccess = quoteDate.isSuccess && !quoteDate.object.isEmpty();
+
return (
- {quoteDate.isSuccess ? (
-
+ {isSuccess ? (
+
) : (
- <>->
+ <>>
)}
);
@@ -217,7 +237,7 @@ export const QuotesDataTable = ({
})}
),
- size: 600,
+ size: 500,
},
/*{
@@ -240,86 +260,96 @@ export const QuotesDataTable = ({
cell: ({ row: { original } }: { row: { original: IListQuotes_Response_DTO } }) => {
const allowToSent = original?.status === "accepted" && !original?.date_sent;
const isSent = original?.status === "accepted" && !!original?.date_sent;
+ const isArchived = original?.status === "archived";
return (
-