ptechcore_ui 1.0.77 → 1.0.79
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.
- package/dist/index.cjs +275 -137
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +309 -170
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -405,7 +405,8 @@ import {
|
|
|
405
405
|
Save,
|
|
406
406
|
Loader2,
|
|
407
407
|
Check as Check2,
|
|
408
|
-
Trash2
|
|
408
|
+
Trash2,
|
|
409
|
+
MailOpen
|
|
409
410
|
} from "lucide-react";
|
|
410
411
|
|
|
411
412
|
// src/assets/modules-icons/crm-blue.svg
|
|
@@ -507,6 +508,25 @@ function formatCurrency(amount, currency = "XAF") {
|
|
|
507
508
|
}
|
|
508
509
|
return new Intl.NumberFormat("fr-FR").format(amount) + " " + currency;
|
|
509
510
|
}
|
|
511
|
+
function formatDateTime(date) {
|
|
512
|
+
if (!date) return "Non d\xE9fini";
|
|
513
|
+
try {
|
|
514
|
+
const dateObj = typeof date === "string" ? new Date(date) : date;
|
|
515
|
+
if (isNaN(dateObj.getTime())) {
|
|
516
|
+
return "Date invalide";
|
|
517
|
+
}
|
|
518
|
+
return dateObj.toLocaleDateString("fr-FR", {
|
|
519
|
+
year: "numeric",
|
|
520
|
+
month: "long",
|
|
521
|
+
day: "numeric",
|
|
522
|
+
hour: "2-digit",
|
|
523
|
+
minute: "2-digit",
|
|
524
|
+
second: "2-digit"
|
|
525
|
+
});
|
|
526
|
+
} catch (error) {
|
|
527
|
+
return "Erreur de format";
|
|
528
|
+
}
|
|
529
|
+
}
|
|
510
530
|
|
|
511
531
|
// src/contexts/ThemeContext.tsx
|
|
512
532
|
import { createContext, useContext, useState as useState2, useEffect as useEffect2 } from "react";
|
|
@@ -982,6 +1002,96 @@ var FetchApi = class {
|
|
|
982
1002
|
if (!res.ok) throw new Error(await res.text());
|
|
983
1003
|
return res.json();
|
|
984
1004
|
}
|
|
1005
|
+
static async postFile(url, payload, token) {
|
|
1006
|
+
const headers = {};
|
|
1007
|
+
const local_token = localStorage.getItem("token");
|
|
1008
|
+
if (local_token) {
|
|
1009
|
+
headers["Authorization"] = `Token ${local_token}`;
|
|
1010
|
+
}
|
|
1011
|
+
let body;
|
|
1012
|
+
const business_entity_id = localStorage.getItem("active_center_id");
|
|
1013
|
+
if (payload instanceof FormData) {
|
|
1014
|
+
if (business_entity_id) {
|
|
1015
|
+
payload.append("business_entity_id", business_entity_id);
|
|
1016
|
+
payload.append("business_entity", business_entity_id);
|
|
1017
|
+
}
|
|
1018
|
+
body = payload;
|
|
1019
|
+
} else if (payload) {
|
|
1020
|
+
const hasFile = Object.values(payload).some((v) => v instanceof File || v instanceof Blob);
|
|
1021
|
+
if (hasFile) {
|
|
1022
|
+
const formData = new FormData();
|
|
1023
|
+
Object.entries(payload).forEach(([key, value]) => {
|
|
1024
|
+
if (value instanceof File || value instanceof Blob) {
|
|
1025
|
+
formData.append(key, value);
|
|
1026
|
+
} else if (Array.isArray(value)) {
|
|
1027
|
+
formData.append(key, JSON.stringify(value));
|
|
1028
|
+
} else if (value !== null && value !== void 0) {
|
|
1029
|
+
formData.append(key, String(value));
|
|
1030
|
+
}
|
|
1031
|
+
});
|
|
1032
|
+
if (business_entity_id) {
|
|
1033
|
+
formData.append("business_entity_id", business_entity_id);
|
|
1034
|
+
formData.append("business_entity", business_entity_id);
|
|
1035
|
+
}
|
|
1036
|
+
body = formData;
|
|
1037
|
+
} else {
|
|
1038
|
+
headers["Content-Type"] = "application/json";
|
|
1039
|
+
body = JSON.stringify({ ...payload, business_entity_id, business_entity: business_entity_id });
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
const res = await fetch(url, {
|
|
1043
|
+
method: "POST",
|
|
1044
|
+
headers,
|
|
1045
|
+
body
|
|
1046
|
+
});
|
|
1047
|
+
if (!res.ok) throw new Error(await res.text());
|
|
1048
|
+
return res.json();
|
|
1049
|
+
}
|
|
1050
|
+
static async putFile(url, payload, token) {
|
|
1051
|
+
const headers = {};
|
|
1052
|
+
const local_token = localStorage.getItem("token");
|
|
1053
|
+
if (local_token) {
|
|
1054
|
+
headers["Authorization"] = `Token ${local_token}`;
|
|
1055
|
+
}
|
|
1056
|
+
let body;
|
|
1057
|
+
const business_entity_id = localStorage.getItem("active_center_id");
|
|
1058
|
+
if (payload instanceof FormData) {
|
|
1059
|
+
if (business_entity_id) {
|
|
1060
|
+
payload.append("business_entity_id", business_entity_id);
|
|
1061
|
+
payload.append("business_entity", business_entity_id);
|
|
1062
|
+
}
|
|
1063
|
+
body = payload;
|
|
1064
|
+
} else if (payload) {
|
|
1065
|
+
const hasFile = Object.values(payload).some((v) => v instanceof File || v instanceof Blob);
|
|
1066
|
+
if (hasFile) {
|
|
1067
|
+
const formData = new FormData();
|
|
1068
|
+
Object.entries(payload).forEach(([key, value]) => {
|
|
1069
|
+
if (value instanceof File || value instanceof Blob) {
|
|
1070
|
+
formData.append(key, value);
|
|
1071
|
+
} else if (Array.isArray(value)) {
|
|
1072
|
+
formData.append(key, JSON.stringify(value));
|
|
1073
|
+
} else if (value !== null && value !== void 0) {
|
|
1074
|
+
formData.append(key, String(value));
|
|
1075
|
+
}
|
|
1076
|
+
});
|
|
1077
|
+
if (business_entity_id) {
|
|
1078
|
+
formData.append("business_entity_id", business_entity_id);
|
|
1079
|
+
formData.append("business_entity", business_entity_id);
|
|
1080
|
+
}
|
|
1081
|
+
body = formData;
|
|
1082
|
+
} else {
|
|
1083
|
+
headers["Content-Type"] = "application/json";
|
|
1084
|
+
body = JSON.stringify({ ...payload, business_entity_id, business_entity: business_entity_id });
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
const res = await fetch(url, {
|
|
1088
|
+
method: "PUT",
|
|
1089
|
+
headers,
|
|
1090
|
+
body
|
|
1091
|
+
});
|
|
1092
|
+
if (!res.ok) throw new Error(await res.text());
|
|
1093
|
+
return res.json();
|
|
1094
|
+
}
|
|
985
1095
|
static async patch(url, payload, token) {
|
|
986
1096
|
const headers = {
|
|
987
1097
|
"Content-Type": "application/json"
|
|
@@ -1003,14 +1113,18 @@ var FetchApi = class {
|
|
|
1003
1113
|
var apiClient = {
|
|
1004
1114
|
get: (path) => FetchApi.get(`${API_URL}${path}`),
|
|
1005
1115
|
post: (path, data) => FetchApi.post(`${API_URL}${path}`, data),
|
|
1116
|
+
postFile: (path, data) => FetchApi.postFile(`${API_URL}${path}`, data),
|
|
1006
1117
|
put: (path, data) => FetchApi.put(`${API_URL}${path}`, data),
|
|
1118
|
+
putFile: (path, data) => FetchApi.putFile(`${API_URL}${path}`, data),
|
|
1007
1119
|
patch: (path, data) => FetchApi.patch(`${API_URL}${path}`, data),
|
|
1008
1120
|
delete: (path) => FetchApi.delete(`${API_URL}${path}`)
|
|
1009
1121
|
};
|
|
1010
1122
|
var coreApiClient = {
|
|
1011
1123
|
get: (path) => FetchApi.get(`${API_URL}/core${path}`),
|
|
1012
1124
|
post: (path, data) => FetchApi.post(`${API_URL}/core${path}`, data),
|
|
1125
|
+
postFile: (path, data) => FetchApi.postFile(`${API_URL}/core${path}`, data),
|
|
1013
1126
|
put: (path, data) => FetchApi.put(`${API_URL}/core${path}`, data),
|
|
1127
|
+
putFile: (path, data) => FetchApi.putFile(`${API_URL}/core${path}`, data),
|
|
1014
1128
|
patch: (path, data) => FetchApi.patch(`${API_URL}/core${path}`, data),
|
|
1015
1129
|
delete: (path) => FetchApi.delete(`${API_URL}/core${path}`)
|
|
1016
1130
|
};
|
|
@@ -1237,7 +1351,7 @@ var UserServices = {
|
|
|
1237
1351
|
// Obtenir toutes les notifications de l'utilisateur
|
|
1238
1352
|
getUsersNotifications: () => FetchApi.get(`${USERS_API_URL}notifications/`),
|
|
1239
1353
|
// Marquer une notification comme lue
|
|
1240
|
-
markNotificationAsRead: (notificationId) => FetchApi.post(`${
|
|
1354
|
+
markNotificationAsRead: (notificationId) => FetchApi.post(`${API_URL}/core/notifications/${notificationId}/mark-read/`, {}),
|
|
1241
1355
|
// Obtenir un utilisateur par ID
|
|
1242
1356
|
getUser: (id, token) => FetchApi.get(`${USERS_API_URL}${id}/`, token),
|
|
1243
1357
|
// Mettre à jour un utilisateur
|
|
@@ -2791,11 +2905,11 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "",
|
|
|
2791
2905
|
{
|
|
2792
2906
|
className: "relative p-2 hover:bg-[var(--color-surface-hover)] rounded-lg transition-colors",
|
|
2793
2907
|
onClick: () => setShowNotifications(!showNotifications),
|
|
2794
|
-
|
|
2908
|
+
title: `Notifications ${notifications.filter((n) => !n.is_read && !["approved"].includes(n?.object_detail?.answer)).length > 0 ? `(${notifications.filter((n) => !n.is_read && !["approved"].includes(n?.object_detail?.answer)).length} non lues)` : ""}`,
|
|
2795
2909
|
"aria-expanded": showNotifications,
|
|
2796
2910
|
children: [
|
|
2797
2911
|
/* @__PURE__ */ jsx9(Bell, { className: "w-5 h-5 text-[var(--color-text-secondary)]" }),
|
|
2798
|
-
notifications.filter((n) => !n.
|
|
2912
|
+
notifications.filter((n) => !n.is_read && !["approved"].includes(n?.object_detail?.answer)).length > 0 && /* @__PURE__ */ jsx9("span", { className: "absolute top-1 right-1 w-2 h-2 bg-[var(--color-error)] rounded-full" })
|
|
2799
2913
|
]
|
|
2800
2914
|
}
|
|
2801
2915
|
),
|
|
@@ -2807,31 +2921,29 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "",
|
|
|
2807
2921
|
"aria-label": "Centre de notifications",
|
|
2808
2922
|
children: [
|
|
2809
2923
|
/* @__PURE__ */ jsx9("div", { className: "p-4 border-b border-[var(--color-border)]", children: /* @__PURE__ */ jsx9("h3", { className: "font-semibold text-[var(--color-text-primary)]", children: "Notifications" }) }),
|
|
2810
|
-
/* @__PURE__ */ jsx9("div", { className: "divide-y divide-[var(--color-border)]", children: notifications.map(
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
"
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
"
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
notif.id
|
|
2834
|
-
)) })
|
|
2924
|
+
/* @__PURE__ */ jsx9("div", { className: "divide-y divide-[var(--color-border)]", children: notifications.map(
|
|
2925
|
+
(notif) => {
|
|
2926
|
+
const is_read = notif.is_read || ["approved"].includes(notif?.object_detail?.answer);
|
|
2927
|
+
return /* @__PURE__ */ jsx9(
|
|
2928
|
+
"div",
|
|
2929
|
+
{
|
|
2930
|
+
className: cn(
|
|
2931
|
+
"p-4 hover:bg-[var(--color-surface-hover)] cursor-pointer"
|
|
2932
|
+
),
|
|
2933
|
+
onClick: () => markNotificationAsRead(notif.id),
|
|
2934
|
+
children: /* @__PURE__ */ jsxs6("div", { className: "flex items-start gap-3", children: [
|
|
2935
|
+
/* @__PURE__ */ jsx9("div", { className: "mt-2", children: !is_read ? /* @__PURE__ */ jsx9(Mail, { size: 15, className: "text-[var(--color-primary)]" }) : /* @__PURE__ */ jsx9(MailOpen, { size: 15, className: "text-gray-500" }) }),
|
|
2936
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex-1", children: [
|
|
2937
|
+
/* @__PURE__ */ jsx9("p", { className: `text-sm ${!is_read ? "text-black font-bold" : " font-normal text-[var(--color-text-primary)]"}`, children: /* @__PURE__ */ jsx9("div", { className: "flex items-center gap-2", children: notif.title }) }),
|
|
2938
|
+
/* @__PURE__ */ jsx9("p", { className: "text-xs text-[var(--color-text-secondary)] mt-1", children: notif.message }),
|
|
2939
|
+
/* @__PURE__ */ jsx9("p", { className: "text-xs text-[var(--color-text-tertiary)] mt-2", children: formatDateTime(notif?.created_at) ?? "-" })
|
|
2940
|
+
] })
|
|
2941
|
+
] })
|
|
2942
|
+
},
|
|
2943
|
+
notif.id
|
|
2944
|
+
);
|
|
2945
|
+
}
|
|
2946
|
+
) })
|
|
2835
2947
|
]
|
|
2836
2948
|
}
|
|
2837
2949
|
)
|
|
@@ -6876,7 +6988,7 @@ import { useState as useState14, useRef as useRef4, useEffect as useEffect10 } f
|
|
|
6876
6988
|
import {
|
|
6877
6989
|
Folder as Folder2,
|
|
6878
6990
|
FolderOpen as FolderOpen2,
|
|
6879
|
-
File,
|
|
6991
|
+
File as File2,
|
|
6880
6992
|
FileText as FileText2,
|
|
6881
6993
|
FileImage,
|
|
6882
6994
|
FileSpreadsheet as FileSpreadsheet2,
|
|
@@ -6892,7 +7004,7 @@ var getFileIcon = (mimeType, isFolder, isOpen) => {
|
|
|
6892
7004
|
return isOpen ? FolderOpen2 : Folder2;
|
|
6893
7005
|
}
|
|
6894
7006
|
if (!mimeType) {
|
|
6895
|
-
return
|
|
7007
|
+
return File2;
|
|
6896
7008
|
}
|
|
6897
7009
|
const type = mimeType.toLowerCase();
|
|
6898
7010
|
if (type.startsWith("image/")) {
|
|
@@ -6925,7 +7037,7 @@ var getFileIcon = (mimeType, isFolder, isOpen) => {
|
|
|
6925
7037
|
if (type.startsWith("text/")) {
|
|
6926
7038
|
return FileText2;
|
|
6927
7039
|
}
|
|
6928
|
-
return
|
|
7040
|
+
return File2;
|
|
6929
7041
|
};
|
|
6930
7042
|
var getFileIconColor = (mimeType, isFolder) => {
|
|
6931
7043
|
if (isFolder) {
|
|
@@ -7029,7 +7141,7 @@ var formatFileSize = (bytes) => {
|
|
|
7029
7141
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
7030
7142
|
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(1))} ${units[i]}`;
|
|
7031
7143
|
};
|
|
7032
|
-
var
|
|
7144
|
+
var formatDate2 = (date) => {
|
|
7033
7145
|
if (!date) {
|
|
7034
7146
|
return "-";
|
|
7035
7147
|
}
|
|
@@ -7043,7 +7155,7 @@ var formatDate = (date) => {
|
|
|
7043
7155
|
year: "numeric"
|
|
7044
7156
|
});
|
|
7045
7157
|
};
|
|
7046
|
-
var
|
|
7158
|
+
var formatDateTime2 = (date) => {
|
|
7047
7159
|
if (!date) {
|
|
7048
7160
|
return "-";
|
|
7049
7161
|
}
|
|
@@ -7199,7 +7311,7 @@ var FileCard = ({ item, variant = "grid" }) => {
|
|
|
7199
7311
|
}
|
|
7200
7312
|
) : /* @__PURE__ */ jsx20("span", { className: "block truncate text-sm text-gray-900 dark:text-gray-100", children: item.name }) }),
|
|
7201
7313
|
/* @__PURE__ */ jsx20("span", { className: "text-xs text-gray-500 dark:text-gray-400 w-20 text-right", children: !isFolder && formatFileSize(item.size) }),
|
|
7202
|
-
/* @__PURE__ */ jsx20("span", { className: "text-xs text-gray-500 dark:text-gray-400 w-24 text-right", children:
|
|
7314
|
+
/* @__PURE__ */ jsx20("span", { className: "text-xs text-gray-500 dark:text-gray-400 w-24 text-right", children: formatDate2(item.updatedAt || item.createdAt) })
|
|
7203
7315
|
]
|
|
7204
7316
|
}
|
|
7205
7317
|
);
|
|
@@ -9382,7 +9494,7 @@ import {
|
|
|
9382
9494
|
MapPin,
|
|
9383
9495
|
FileText as FileText4,
|
|
9384
9496
|
CreditCard,
|
|
9385
|
-
File as
|
|
9497
|
+
File as File3
|
|
9386
9498
|
} from "lucide-react";
|
|
9387
9499
|
import { jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
9388
9500
|
var FormVendor = ({
|
|
@@ -9492,7 +9604,7 @@ var FormVendor = ({
|
|
|
9492
9604
|
{ id: "representative", label: "Repr\xE9sentant", icon: FileText4 },
|
|
9493
9605
|
{ id: "accounting", label: "Comptabilit\xE9", icon: FileText4 },
|
|
9494
9606
|
{ id: "banking", label: "Bancaire", icon: CreditCard },
|
|
9495
|
-
{ id: "attachment", label: "Fichiers", icon:
|
|
9607
|
+
{ id: "attachment", label: "Fichiers", icon: File3 }
|
|
9496
9608
|
];
|
|
9497
9609
|
const renderTabContent = () => {
|
|
9498
9610
|
switch (activeTab) {
|
|
@@ -9877,7 +9989,7 @@ var FormVendor = ({
|
|
|
9877
9989
|
case "attachment":
|
|
9878
9990
|
if (!object?.id) {
|
|
9879
9991
|
return /* @__PURE__ */ jsxs24("div", { className: "flex flex-col items-center justify-center py-12 text-gray-500", children: [
|
|
9880
|
-
/* @__PURE__ */ jsx30(
|
|
9992
|
+
/* @__PURE__ */ jsx30(File3, { className: "w-12 h-12 mb-4 text-gray-400" }),
|
|
9881
9993
|
/* @__PURE__ */ jsx30("p", { className: "text-lg font-medium", children: "Fichiers non disponibles" }),
|
|
9882
9994
|
/* @__PURE__ */ jsx30("p", { className: "text-sm mt-2", children: "Enregistrez d'abord le fournisseur pour pouvoir ajouter des fichiers." })
|
|
9883
9995
|
] });
|
|
@@ -10597,7 +10709,7 @@ var FormClient = ({
|
|
|
10597
10709
|
|
|
10598
10710
|
// src/components/common/ApprovalWorkflow.tsx
|
|
10599
10711
|
import { useState as useState22, useEffect as useEffect15 } from "react";
|
|
10600
|
-
import { X as X10, Plus as Plus3, Trash2 as Trash25, Users, Loader as Loader3, Eye as Eye4, FileText as FileText6, History } from "lucide-react";
|
|
10712
|
+
import { X as X10, Plus as Plus3, Trash2 as Trash25, Users, Loader as Loader3, Eye as Eye4, FileText as FileText6, History, Edit as Edit2, MessageSquare } from "lucide-react";
|
|
10601
10713
|
import { Fragment as Fragment9, jsx as jsx32, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
10602
10714
|
var ApprovalWorkflow = ({
|
|
10603
10715
|
process,
|
|
@@ -10690,7 +10802,7 @@ var ApprovalWorkflow = ({
|
|
|
10690
10802
|
email: v.user_detail?.email || "",
|
|
10691
10803
|
role: v.user_detail?.phonenumber || "-",
|
|
10692
10804
|
status: v.answer === "approved" /* APPROVED */ ? "approved" : v.answer === "refused" /* REFUSED */ ? "rejected" : "pending",
|
|
10693
|
-
answer: v.answer === "approved" /* APPROVED */ ? 2 : v.answer === "waiting" /* WAITING */ ? 1 : v.answer === "refused" /* REFUSED */ ? -1 : 0,
|
|
10805
|
+
answer: v.answer === "approved" /* APPROVED */ ? 2 : v.answer === "waiting" /* WAITING */ ? 1 : v.answer === "refused" /* REFUSED */ ? -1 : v.answer === "suggest-correction" /* SUGGEST_CORRECTION */ ? -2 : 0,
|
|
10694
10806
|
rank: v.rank,
|
|
10695
10807
|
note: v.note
|
|
10696
10808
|
})));
|
|
@@ -10705,7 +10817,7 @@ var ApprovalWorkflow = ({
|
|
|
10705
10817
|
email: v.user_detail?.email || "",
|
|
10706
10818
|
role: v.user_detail?.phonenumber || "-",
|
|
10707
10819
|
status: v.answer === "approved" /* APPROVED */ ? "approved" : v.answer === "refused" /* REFUSED */ ? "rejected" : "pending",
|
|
10708
|
-
answer: v.answer === "approved" /* APPROVED */ ? 2 : v.answer === "waiting" /* WAITING */ ? 1 : v.answer === "refused" /* REFUSED */ ? -1 : 0,
|
|
10820
|
+
answer: v.answer === "approved" /* APPROVED */ ? 2 : v.answer === "waiting" /* WAITING */ ? 1 : v.answer === "refused" /* REFUSED */ ? -1 : v.answer === "suggest-correction" /* SUGGEST_CORRECTION */ ? -2 : 0,
|
|
10709
10821
|
rank: v.rank,
|
|
10710
10822
|
note: v.note
|
|
10711
10823
|
})));
|
|
@@ -10780,14 +10892,24 @@ var ApprovalWorkflow = ({
|
|
|
10780
10892
|
}
|
|
10781
10893
|
setTransmitting(true);
|
|
10782
10894
|
try {
|
|
10783
|
-
|
|
10784
|
-
|
|
10785
|
-
const response = await ApprovalServices.start(caseData.id, token);
|
|
10895
|
+
if (formData.status === "suggest-correction" /* SUGGEST_CORRECTION */ && caseData?.id) {
|
|
10896
|
+
const response = await ApprovalServices.restart(caseData.id, token);
|
|
10786
10897
|
if (response.success) {
|
|
10787
|
-
showSuccess("
|
|
10898
|
+
showSuccess("Nouvelle version cr\xE9\xE9e et transmise avec succ\xE8s");
|
|
10788
10899
|
await loadCase();
|
|
10789
10900
|
} else {
|
|
10790
|
-
showError("Erreur lors de la transmission");
|
|
10901
|
+
showError("Erreur lors de la re-transmission");
|
|
10902
|
+
}
|
|
10903
|
+
} else {
|
|
10904
|
+
await handleSave();
|
|
10905
|
+
if (caseData?.id) {
|
|
10906
|
+
const response = await ApprovalServices.start(caseData.id, token);
|
|
10907
|
+
if (response.success) {
|
|
10908
|
+
showSuccess("Demande de validation transmise avec succ\xE8s");
|
|
10909
|
+
await loadCase();
|
|
10910
|
+
} else {
|
|
10911
|
+
showError("Erreur lors de la transmission");
|
|
10912
|
+
}
|
|
10791
10913
|
}
|
|
10792
10914
|
}
|
|
10793
10915
|
} catch (error) {
|
|
@@ -10946,12 +11068,19 @@ var ApprovalWorkflow = ({
|
|
|
10946
11068
|
switch (activeTab) {
|
|
10947
11069
|
case "workflow":
|
|
10948
11070
|
return /* @__PURE__ */ jsxs26("div", { className: "space-y-6", children: [
|
|
11071
|
+
formData.status === "suggest-correction" /* SUGGEST_CORRECTION */ && /* @__PURE__ */ jsxs26("div", { className: "p-4 rounded-lg border border-[var(--color-warning)] bg-[var(--color-warning-light)] flex items-start gap-3", children: [
|
|
11072
|
+
/* @__PURE__ */ jsx32(Edit2, { className: "w-5 h-5 flex-shrink-0 mt-0.5", style: { color: "var(--color-warning)" } }),
|
|
11073
|
+
/* @__PURE__ */ jsxs26("div", { children: [
|
|
11074
|
+
/* @__PURE__ */ jsx32("p", { className: "text-sm font-medium", style: { color: "var(--color-warning)" }, children: "Une modification a \xE9t\xE9 sugg\xE9r\xE9e sur cette demande" }),
|
|
11075
|
+
/* @__PURE__ */ jsx32("p", { className: "text-xs text-gray-500 mt-1", children: "Veuillez prendre en compte les commentaires et re-transmettre la demande." })
|
|
11076
|
+
] })
|
|
11077
|
+
] }),
|
|
10949
11078
|
renderStageSection("Verification", verification, setVerification, "verification"),
|
|
10950
11079
|
renderStageSection("Validation", validation, setValidation, "validation"),
|
|
10951
11080
|
!readOnly && /* @__PURE__ */ jsxs26("div", { className: "flex justify-between pt-4 border-t border-[#D9D9D9]", children: [
|
|
10952
11081
|
/* @__PURE__ */ jsx32("div", { className: "flex gap-3" }),
|
|
10953
11082
|
/* @__PURE__ */ jsxs26("div", { className: "flex gap-3", children: [
|
|
10954
|
-
formData.status
|
|
11083
|
+
(formData.status === "not-send" /* NOT_SEND */ || formData.status === "suggest-correction" /* SUGGEST_CORRECTION */) && /* @__PURE__ */ jsxs26(
|
|
10955
11084
|
Buttons_default,
|
|
10956
11085
|
{
|
|
10957
11086
|
onClick: handleSave,
|
|
@@ -10963,13 +11092,13 @@ var ApprovalWorkflow = ({
|
|
|
10963
11092
|
]
|
|
10964
11093
|
}
|
|
10965
11094
|
),
|
|
10966
|
-
formData.status === "not-send" /* NOT_SEND */ && /* @__PURE__ */ jsx32(
|
|
11095
|
+
(formData.status === "not-send" /* NOT_SEND */ || formData.status === "suggest-correction" /* SUGGEST_CORRECTION */) && /* @__PURE__ */ jsx32(
|
|
10967
11096
|
Buttons_default,
|
|
10968
11097
|
{
|
|
10969
11098
|
onClick: handleTransmit,
|
|
10970
11099
|
disabled: transmitting || saving,
|
|
10971
11100
|
type: "button",
|
|
10972
|
-
children: transmitting ? "Transmission..." : "Transmettre"
|
|
11101
|
+
children: transmitting ? "Transmission..." : formData.status === "suggest-correction" /* SUGGEST_CORRECTION */ ? "Re-transmettre" : "Transmettre"
|
|
10973
11102
|
}
|
|
10974
11103
|
)
|
|
10975
11104
|
] })
|
|
@@ -11174,71 +11303,81 @@ var StageRow = ({
|
|
|
11174
11303
|
return /* @__PURE__ */ jsx32("span", { className: "inline-flex items-center justify-center w-6 h-6 bg-gray-300 rounded-full", children: /* @__PURE__ */ jsx32("span", { className: "text-white text-xs", children: "\u23F1" }) });
|
|
11175
11304
|
} else if (answer === -1) {
|
|
11176
11305
|
return /* @__PURE__ */ jsx32("span", { className: "inline-flex items-center justify-center w-6 h-6 bg-[var(--color-error)] rounded-full", children: /* @__PURE__ */ jsx32("svg", { className: "w-4 h-4 text-white", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx32("path", { fillRule: "evenodd", d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z", clipRule: "evenodd" }) }) });
|
|
11306
|
+
} else if (answer === -2) {
|
|
11307
|
+
return /* @__PURE__ */ jsx32("span", { className: "inline-flex items-center justify-center w-6 h-6 bg-[var(--color-warning)] rounded-full", children: /* @__PURE__ */ jsx32(Edit2, { className: "w-4 h-4 text-white" }) });
|
|
11177
11308
|
}
|
|
11178
11309
|
return /* @__PURE__ */ jsx32("span", { className: "text-gray-400 text-xs", children: "-" });
|
|
11179
11310
|
};
|
|
11180
|
-
return /* @__PURE__ */ jsxs26(
|
|
11181
|
-
/* @__PURE__ */
|
|
11182
|
-
"
|
|
11183
|
-
|
|
11184
|
-
|
|
11185
|
-
|
|
11186
|
-
|
|
11187
|
-
|
|
11188
|
-
|
|
11189
|
-
|
|
11190
|
-
|
|
11191
|
-
|
|
11192
|
-
|
|
11193
|
-
|
|
11194
|
-
|
|
11195
|
-
|
|
11196
|
-
|
|
11197
|
-
|
|
11198
|
-
|
|
11199
|
-
|
|
11200
|
-
|
|
11201
|
-
|
|
11202
|
-
|
|
11203
|
-
|
|
11204
|
-
|
|
11205
|
-
|
|
11206
|
-
|
|
11207
|
-
|
|
11208
|
-
|
|
11209
|
-
|
|
11210
|
-
|
|
11211
|
-
|
|
11212
|
-
|
|
11213
|
-
|
|
11214
|
-
|
|
11215
|
-
|
|
11216
|
-
|
|
11217
|
-
|
|
11218
|
-
|
|
11219
|
-
|
|
11220
|
-
|
|
11221
|
-
|
|
11222
|
-
|
|
11223
|
-
|
|
11224
|
-
|
|
11225
|
-
|
|
11226
|
-
|
|
11227
|
-
|
|
11228
|
-
|
|
11229
|
-
|
|
11230
|
-
|
|
11231
|
-
|
|
11232
|
-
|
|
11233
|
-
"
|
|
11234
|
-
|
|
11235
|
-
|
|
11236
|
-
|
|
11237
|
-
|
|
11238
|
-
|
|
11239
|
-
|
|
11240
|
-
|
|
11241
|
-
|
|
11311
|
+
return /* @__PURE__ */ jsxs26(Fragment9, { children: [
|
|
11312
|
+
/* @__PURE__ */ jsxs26("tr", { className: "hover:bg-gray-50", children: [
|
|
11313
|
+
/* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-2 py-2 text-center", children: !readOnly && /* @__PURE__ */ jsx32(
|
|
11314
|
+
"button",
|
|
11315
|
+
{
|
|
11316
|
+
type: "button",
|
|
11317
|
+
onClick: onRemove,
|
|
11318
|
+
className: "text-[#B85450] hover:text-[var(--color-error)] transition-colors",
|
|
11319
|
+
title: "Supprimer",
|
|
11320
|
+
children: /* @__PURE__ */ jsx32(Trash25, { className: "w-4 h-4" })
|
|
11321
|
+
}
|
|
11322
|
+
) }),
|
|
11323
|
+
/* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-4 py-2 text-center", children: index + 1 }),
|
|
11324
|
+
/* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-2 py-2", children: /* @__PURE__ */ jsx32(
|
|
11325
|
+
SelectInput,
|
|
11326
|
+
{
|
|
11327
|
+
value: stage.space_answer,
|
|
11328
|
+
onChange: (e) => handleSpaceAnswerChange(e),
|
|
11329
|
+
disabled: readOnly,
|
|
11330
|
+
options: [
|
|
11331
|
+
{ value: "internal", label: "Interne" },
|
|
11332
|
+
{ value: "external", label: "Externe" }
|
|
11333
|
+
]
|
|
11334
|
+
}
|
|
11335
|
+
) }),
|
|
11336
|
+
/* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-2 py-2", children: stage.space_answer === "internal" ? /* @__PURE__ */ jsx32(
|
|
11337
|
+
SearchableSelect,
|
|
11338
|
+
{
|
|
11339
|
+
options: userOptions,
|
|
11340
|
+
value: stage.user,
|
|
11341
|
+
placeholder: "S\xE9lectionner...",
|
|
11342
|
+
searchPlaceholder: "Rechercher...",
|
|
11343
|
+
onSelect: handleUserSelect,
|
|
11344
|
+
disabled: readOnly || loadingUsers,
|
|
11345
|
+
filterFunction: userFilterFunction
|
|
11346
|
+
}
|
|
11347
|
+
) : /* @__PURE__ */ jsx32(
|
|
11348
|
+
TextInput,
|
|
11349
|
+
{
|
|
11350
|
+
value: stage.name,
|
|
11351
|
+
onChange: (e) => onUpdate({ name: e.target.value }),
|
|
11352
|
+
disabled: readOnly
|
|
11353
|
+
}
|
|
11354
|
+
) }),
|
|
11355
|
+
/* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-2 py-2", children: /* @__PURE__ */ jsx32(
|
|
11356
|
+
TextInput,
|
|
11357
|
+
{
|
|
11358
|
+
type: "email",
|
|
11359
|
+
value: stage.email,
|
|
11360
|
+
onChange: (e) => onUpdate({ email: e.target.value }),
|
|
11361
|
+
disabled: readOnly || stage.space_answer === "internal"
|
|
11362
|
+
}
|
|
11363
|
+
) }),
|
|
11364
|
+
/* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-2 py-2", children: /* @__PURE__ */ jsx32(
|
|
11365
|
+
"input",
|
|
11366
|
+
{
|
|
11367
|
+
type: "text",
|
|
11368
|
+
value: stage.role,
|
|
11369
|
+
disabled: true,
|
|
11370
|
+
className: "w-full px-2 py-1 border border-gray-300 rounded text-sm bg-gray-100"
|
|
11371
|
+
}
|
|
11372
|
+
) }),
|
|
11373
|
+
/* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-4 py-2 text-center", children: getStatusIcon(stage.answer) })
|
|
11374
|
+
] }),
|
|
11375
|
+
stage.note && /* @__PURE__ */ jsx32("tr", { children: /* @__PURE__ */ jsx32("td", { colSpan: 7, className: "border border-gray-300 px-4 py-2 bg-[var(--color-warning-light)]", children: /* @__PURE__ */ jsxs26("p", { className: "text-xs text-gray-600 italic flex items-center gap-1", children: [
|
|
11376
|
+
/* @__PURE__ */ jsx32(MessageSquare, { className: "w-3 h-3" }),
|
|
11377
|
+
' Note : "',
|
|
11378
|
+
stage.note,
|
|
11379
|
+
'"'
|
|
11380
|
+
] }) }) })
|
|
11242
11381
|
] });
|
|
11243
11382
|
};
|
|
11244
11383
|
var AddStageButton = ({
|
|
@@ -11789,7 +11928,7 @@ var getRole = (a, center_id) => {
|
|
|
11789
11928
|
console.log(a.user_detail, center_id);
|
|
11790
11929
|
return a.user_detail?.centers_access?.find((c) => c.id === center_id)?.fonction ?? "";
|
|
11791
11930
|
};
|
|
11792
|
-
var
|
|
11931
|
+
var formatDate3 = (date) => date ? formatDateFR(date) : "-";
|
|
11793
11932
|
var borderStyle = { borderColor: "var(--color-border)" };
|
|
11794
11933
|
var cellClass = "border px-2 py-1";
|
|
11795
11934
|
var headerStyle = { ...borderStyle, color: "var(--color-text-secondary)" };
|
|
@@ -11824,7 +11963,7 @@ var ApprovalRecap = ({ process, object_id }) => {
|
|
|
11824
11963
|
return /* @__PURE__ */ jsxs28("tr", { children: [
|
|
11825
11964
|
/* @__PURE__ */ jsx34("td", { className: `${cellClass} uppercase`, style: { ...borderStyle, color: "var(--color-text)" }, children: getName(item) }),
|
|
11826
11965
|
/* @__PURE__ */ jsx34("td", { className: `${cellClass} uppercase`, style: { ...borderStyle, color: "var(--color-text)" }, children: getRole(item, activeBusinessEntity?.id ?? null) }),
|
|
11827
|
-
/* @__PURE__ */ jsx34("td", { className: cellClass, style: borderStyle, children:
|
|
11966
|
+
/* @__PURE__ */ jsx34("td", { className: cellClass, style: borderStyle, children: formatDate3(item.answered_at) }),
|
|
11828
11967
|
/* @__PURE__ */ jsx34("td", { className: cellClass, style: borderStyle, children: /* @__PURE__ */ jsx34("span", { className: "inline-flex items-center gap-1", style: { color: s.color }, children: s.icon }) }),
|
|
11829
11968
|
/* @__PURE__ */ jsx34("td", { className: cellClass, style: borderStyle })
|
|
11830
11969
|
] }, i);
|
|
@@ -11845,7 +11984,7 @@ var ApprovalRecap = ({ process, object_id }) => {
|
|
|
11845
11984
|
/* @__PURE__ */ jsx34("td", { className: cellClass, style: borderStyle, children: "Demand\xE9 par" }),
|
|
11846
11985
|
/* @__PURE__ */ jsx34("td", { className: `${cellClass} uppercase`, style: { ...borderStyle, color: "var(--color-text)" }, children: `${requester.first_name} ${requester.last_name}`.trim() }),
|
|
11847
11986
|
/* @__PURE__ */ jsx34("td", { className: `${cellClass} uppercase`, style: { ...borderStyle, color: "var(--color-text)" }, children: requester?.centers_access?.find((c) => c.id === activeBusinessEntity?.id)?.fonction ?? "" }),
|
|
11848
|
-
/* @__PURE__ */ jsx34("td", { className: cellClass, style: borderStyle, children:
|
|
11987
|
+
/* @__PURE__ */ jsx34("td", { className: cellClass, style: borderStyle, children: formatDate3(caseData.created_at) }),
|
|
11849
11988
|
/* @__PURE__ */ jsx34("td", { className: cellClass, style: borderStyle, children: /* @__PURE__ */ jsx34("span", { className: "inline-flex items-center gap-1", style: { color: "var(--color-primary)" }, children: /* @__PURE__ */ jsx34(CheckCircle3, { className: "w-3.5 h-3.5" }) }) }),
|
|
11850
11989
|
/* @__PURE__ */ jsx34("td", { className: cellClass, style: borderStyle })
|
|
11851
11990
|
] }),
|
|
@@ -12589,7 +12728,7 @@ var DetailField = ({ label, value }) => value ? /* @__PURE__ */ jsxs32("div", {
|
|
|
12589
12728
|
/* @__PURE__ */ jsx39("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: label }),
|
|
12590
12729
|
/* @__PURE__ */ jsx39("p", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: typeof value === "string" || typeof value === "number" ? value : value })
|
|
12591
12730
|
] }) : null;
|
|
12592
|
-
var
|
|
12731
|
+
var formatDate4 = (d) => d ? new Date(d).toLocaleString("fr-FR", { day: "2-digit", month: "long", year: "numeric", hour: "2-digit", minute: "2-digit" }) : "-";
|
|
12593
12732
|
var ActivityDetailModal = ({ activity }) => {
|
|
12594
12733
|
const d = activity.detail;
|
|
12595
12734
|
if (!d) return /* @__PURE__ */ jsx39("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Aucun d\xE9tail disponible." });
|
|
@@ -12612,7 +12751,7 @@ var ActivityDetailModal = ({ activity }) => {
|
|
|
12612
12751
|
/* @__PURE__ */ jsx39(DetailField, { label: "Adresse de livraison", value: d.delivery_address }),
|
|
12613
12752
|
/* @__PURE__ */ jsx39(DetailField, { label: "Contact livraison", value: d.delivery_contact }),
|
|
12614
12753
|
/* @__PURE__ */ jsx39(DetailField, { label: "T\xE9l. livraison", value: d.delivery_phone }),
|
|
12615
|
-
/* @__PURE__ */ jsx39(DetailField, { label: "Cr\xE9\xE9 le", value:
|
|
12754
|
+
/* @__PURE__ */ jsx39(DetailField, { label: "Cr\xE9\xE9 le", value: formatDate4(d.created_at) }),
|
|
12616
12755
|
/* @__PURE__ */ jsx39(DetailField, { label: "Commentaires", value: d.comments })
|
|
12617
12756
|
] }),
|
|
12618
12757
|
d.items?.length > 0 && /* @__PURE__ */ jsxs32("div", { children: [
|
|
@@ -12667,7 +12806,7 @@ var ActivityDetailModal = ({ activity }) => {
|
|
|
12667
12806
|
/* @__PURE__ */ jsx39(DetailField, { label: "Prix final", value: d.final_price ? `${d.final_price.toLocaleString("fr-FR")} FCFA` : void 0 }),
|
|
12668
12807
|
/* @__PURE__ */ jsx39(DetailField, { label: "Remise", value: d.global_discount ? `${d.global_discount}${d.global_discount_type === "percentage" ? "%" : " FCFA"}` : void 0 }),
|
|
12669
12808
|
/* @__PURE__ */ jsx39(DetailField, { label: "Observations", value: d.observations }),
|
|
12670
|
-
/* @__PURE__ */ jsx39(DetailField, { label: "Cr\xE9\xE9 le", value:
|
|
12809
|
+
/* @__PURE__ */ jsx39(DetailField, { label: "Cr\xE9\xE9 le", value: formatDate4(d.created_at) })
|
|
12671
12810
|
] }),
|
|
12672
12811
|
d.items?.length > 0 && /* @__PURE__ */ jsxs32("div", { children: [
|
|
12673
12812
|
/* @__PURE__ */ jsxs32("h4", { className: "text-sm font-semibold text-[var(--color-text-primary)] mb-2", children: [
|
|
@@ -12714,9 +12853,9 @@ var ActivityDetailModal = ({ activity }) => {
|
|
|
12714
12853
|
/* @__PURE__ */ jsxs32("div", { className: "grid grid-cols-2 md:grid-cols-3 gap-4 bg-[var(--color-surface-hover)] rounded-lg p-4", children: [
|
|
12715
12854
|
/* @__PURE__ */ jsx39(DetailField, { label: "Type de r\xE9ception", value: d.type_of_receipt }),
|
|
12716
12855
|
/* @__PURE__ */ jsx39(DetailField, { label: "Adresse de r\xE9ception", value: d.receipt_address }),
|
|
12717
|
-
/* @__PURE__ */ jsx39(DetailField, { label: "Date de r\xE9ception", value:
|
|
12856
|
+
/* @__PURE__ */ jsx39(DetailField, { label: "Date de r\xE9ception", value: formatDate4(d.received_at) }),
|
|
12718
12857
|
/* @__PURE__ */ jsx39(DetailField, { label: "Commentaires", value: d.comments }),
|
|
12719
|
-
/* @__PURE__ */ jsx39(DetailField, { label: "Cr\xE9\xE9 le", value:
|
|
12858
|
+
/* @__PURE__ */ jsx39(DetailField, { label: "Cr\xE9\xE9 le", value: formatDate4(d.created_at) })
|
|
12720
12859
|
] }),
|
|
12721
12860
|
d.items?.length > 0 && /* @__PURE__ */ jsxs32("div", { children: [
|
|
12722
12861
|
/* @__PURE__ */ jsxs32("h4", { className: "text-sm font-semibold text-[var(--color-text-primary)] mb-2", children: [
|
|
@@ -17883,7 +18022,7 @@ import { useState as useState34, useEffect as useEffect26, useCallback as useCal
|
|
|
17883
18022
|
import {
|
|
17884
18023
|
Plus as Plus6,
|
|
17885
18024
|
MoreVertical as MoreVertical2,
|
|
17886
|
-
MessageSquare,
|
|
18025
|
+
MessageSquare as MessageSquare2,
|
|
17887
18026
|
Paperclip,
|
|
17888
18027
|
Search as Search4,
|
|
17889
18028
|
Filter as Filter2,
|
|
@@ -18185,7 +18324,7 @@ var TaskCard = ({ task, isDragging, onDragStart, onDragEnd, onEdit, onDelete })
|
|
|
18185
18324
|
/* @__PURE__ */ jsx56("span", { children: new Date(task.end_date).toLocaleDateString("fr-FR") })
|
|
18186
18325
|
] }),
|
|
18187
18326
|
/* @__PURE__ */ jsxs49("div", { className: "flex items-center gap-3", children: [
|
|
18188
|
-
task.comment && /* @__PURE__ */ jsx56("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ jsx56(
|
|
18327
|
+
task.comment && /* @__PURE__ */ jsx56("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ jsx56(MessageSquare2, { className: "w-3.5 h-3.5" }) }),
|
|
18189
18328
|
task.file && /* @__PURE__ */ jsx56("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ jsx56(Paperclip, { className: "w-3.5 h-3.5" }) })
|
|
18190
18329
|
] })
|
|
18191
18330
|
] })
|
|
@@ -20175,7 +20314,7 @@ import {
|
|
|
20175
20314
|
Plus as Plus11,
|
|
20176
20315
|
Search as Search7,
|
|
20177
20316
|
MoreVertical as MoreVertical4,
|
|
20178
|
-
Edit as
|
|
20317
|
+
Edit as Edit4,
|
|
20179
20318
|
Trash2 as Trash29,
|
|
20180
20319
|
Eye as Eye8,
|
|
20181
20320
|
Phone as Phone6,
|
|
@@ -20191,7 +20330,7 @@ import { useParams as useParams3, useNavigate as useNavigate11 } from "react-rou
|
|
|
20191
20330
|
import {
|
|
20192
20331
|
ArrowLeft as ArrowLeft2,
|
|
20193
20332
|
Building2 as Building28,
|
|
20194
|
-
Edit as
|
|
20333
|
+
Edit as Edit5,
|
|
20195
20334
|
Trash2 as Trash210,
|
|
20196
20335
|
Plus as Plus12,
|
|
20197
20336
|
MapPin as MapPin8,
|
|
@@ -20223,7 +20362,7 @@ import { Fragment as Fragment14, jsx as jsx72, jsxs as jsxs65 } from "react/jsx-
|
|
|
20223
20362
|
// src/pages/organizations/DetailEntity.tsx
|
|
20224
20363
|
import { useState as useState49, useEffect as useEffect37 } from "react";
|
|
20225
20364
|
import { useNavigate as useNavigate12, useParams as useParams4 } from "react-router-dom";
|
|
20226
|
-
import { Building2 as Building210, CreditCard as CreditCard6, FileText as FileText15, MapPin as MapPin9, User as UserIcon4, File as
|
|
20365
|
+
import { Building2 as Building210, CreditCard as CreditCard6, FileText as FileText15, MapPin as MapPin9, User as UserIcon4, File as File4 } from "lucide-react";
|
|
20227
20366
|
|
|
20228
20367
|
// src/forms/UserForm.tsx
|
|
20229
20368
|
import { useState as useState48, useEffect as useEffect36 } from "react";
|
|
@@ -20300,7 +20439,7 @@ import { useState as useState54, useEffect as useEffect40 } from "react";
|
|
|
20300
20439
|
import { useNavigate as useNavigate17 } from "react-router-dom";
|
|
20301
20440
|
import {
|
|
20302
20441
|
Plus as Plus14,
|
|
20303
|
-
Edit as
|
|
20442
|
+
Edit as Edit6,
|
|
20304
20443
|
Trash2 as Trash212
|
|
20305
20444
|
} from "lucide-react";
|
|
20306
20445
|
import { Fragment as Fragment17, jsx as jsx79, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
@@ -20344,7 +20483,7 @@ import {
|
|
|
20344
20483
|
Activity as Activity2,
|
|
20345
20484
|
Briefcase as Briefcase4,
|
|
20346
20485
|
Plus as Plus15,
|
|
20347
|
-
Edit as
|
|
20486
|
+
Edit as Edit7,
|
|
20348
20487
|
Loader2 as Loader210
|
|
20349
20488
|
} from "lucide-react";
|
|
20350
20489
|
import { Fragment as Fragment18, jsx as jsx81, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
@@ -20385,7 +20524,7 @@ import { jsx as jsx87, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
|
20385
20524
|
import { useState as useState60, useEffect as useEffect44 } from "react";
|
|
20386
20525
|
import {
|
|
20387
20526
|
Plus as Plus16,
|
|
20388
|
-
Edit as
|
|
20527
|
+
Edit as Edit8,
|
|
20389
20528
|
Trash2 as Trash214
|
|
20390
20529
|
} from "lucide-react";
|
|
20391
20530
|
import { Fragment as Fragment20, jsx as jsx88, jsxs as jsxs81 } from "react/jsx-runtime";
|
|
@@ -20395,7 +20534,7 @@ import React55, { useState as useState61, useEffect as useEffect45, useRef as us
|
|
|
20395
20534
|
import { useReactToPrint as useReactToPrint2 } from "react-to-print";
|
|
20396
20535
|
import {
|
|
20397
20536
|
Plus as Plus17,
|
|
20398
|
-
Edit as
|
|
20537
|
+
Edit as Edit9,
|
|
20399
20538
|
Trash2 as Trash215,
|
|
20400
20539
|
GripVertical as GripVertical2,
|
|
20401
20540
|
X as X19,
|
|
@@ -20643,7 +20782,7 @@ var PrintableFormPreview = React55.forwardRef(
|
|
|
20643
20782
|
import { useState as useState62, useEffect as useEffect46 } from "react";
|
|
20644
20783
|
import {
|
|
20645
20784
|
Plus as Plus18,
|
|
20646
|
-
Edit as
|
|
20785
|
+
Edit as Edit10,
|
|
20647
20786
|
Trash2 as Trash217,
|
|
20648
20787
|
Shield as Shield7,
|
|
20649
20788
|
CheckCircle as CheckCircle13,
|
|
@@ -26253,7 +26392,7 @@ import {
|
|
|
26253
26392
|
BarChart3 as BarChart37,
|
|
26254
26393
|
Users as Users17,
|
|
26255
26394
|
Target as Target6,
|
|
26256
|
-
Edit as
|
|
26395
|
+
Edit as Edit14,
|
|
26257
26396
|
Trash2 as Trash223,
|
|
26258
26397
|
TrendingUp as TrendingUp12,
|
|
26259
26398
|
TrendingDown as TrendingDown4,
|
|
@@ -26269,7 +26408,7 @@ import {
|
|
|
26269
26408
|
ChevronRight as ChevronRight7,
|
|
26270
26409
|
ClipboardList as ClipboardList5,
|
|
26271
26410
|
User as User5,
|
|
26272
|
-
MessageSquare as
|
|
26411
|
+
MessageSquare as MessageSquare3,
|
|
26273
26412
|
Zap as Zap5,
|
|
26274
26413
|
Activity as Activity3,
|
|
26275
26414
|
Filter as Filter5,
|
|
@@ -27476,7 +27615,7 @@ import {
|
|
|
27476
27615
|
Calendar as Calendar10,
|
|
27477
27616
|
Euro,
|
|
27478
27617
|
Download as Download7,
|
|
27479
|
-
Edit as
|
|
27618
|
+
Edit as Edit11,
|
|
27480
27619
|
Archive,
|
|
27481
27620
|
RefreshCw as RefreshCw10,
|
|
27482
27621
|
CheckCircle as CheckCircle14,
|
|
@@ -27771,7 +27910,7 @@ var ViewContractContent = ({
|
|
|
27771
27910
|
};
|
|
27772
27911
|
}, [contract]);
|
|
27773
27912
|
if (!contract) return null;
|
|
27774
|
-
const
|
|
27913
|
+
const formatDate5 = (dateString) => {
|
|
27775
27914
|
if (!dateString) return "Non d\xE9fini";
|
|
27776
27915
|
return new Date(dateString).toLocaleDateString("fr-FR");
|
|
27777
27916
|
};
|
|
@@ -28050,19 +28189,19 @@ var ViewContractContent = ({
|
|
|
28050
28189
|
/* @__PURE__ */ jsxs122("dl", { className: "space-y-3", children: [
|
|
28051
28190
|
/* @__PURE__ */ jsxs122("div", { className: "flex justify-between", children: [
|
|
28052
28191
|
/* @__PURE__ */ jsx133("dt", { className: "text-sm font-medium text-gray-500", children: "Date de cr\xE9ation" }),
|
|
28053
|
-
/* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900", children:
|
|
28192
|
+
/* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900", children: formatDate5(contract.created_at || contract.created_at) })
|
|
28054
28193
|
] }),
|
|
28055
28194
|
/* @__PURE__ */ jsxs122("div", { className: "flex justify-between", children: [
|
|
28056
28195
|
/* @__PURE__ */ jsx133("dt", { className: "text-sm font-medium text-gray-500", children: "Date de signature" }),
|
|
28057
|
-
/* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900", children:
|
|
28196
|
+
/* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900", children: formatDate5(contract.signature_date || "") })
|
|
28058
28197
|
] }),
|
|
28059
28198
|
/* @__PURE__ */ jsxs122("div", { className: "flex justify-between", children: [
|
|
28060
28199
|
/* @__PURE__ */ jsx133("dt", { className: "text-sm font-medium text-gray-500", children: "D\xE9but" }),
|
|
28061
|
-
/* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900", children:
|
|
28200
|
+
/* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900", children: formatDate5(contract.start_date) })
|
|
28062
28201
|
] }),
|
|
28063
28202
|
/* @__PURE__ */ jsxs122("div", { className: "flex justify-between", children: [
|
|
28064
28203
|
/* @__PURE__ */ jsx133("dt", { className: "text-sm font-medium text-gray-500", children: "Fin" }),
|
|
28065
|
-
/* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900 font-medium", children:
|
|
28204
|
+
/* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900 font-medium", children: formatDate5(contract.end_date) })
|
|
28066
28205
|
] }),
|
|
28067
28206
|
/* @__PURE__ */ jsxs122("div", { className: "flex justify-between", children: [
|
|
28068
28207
|
/* @__PURE__ */ jsx133("dt", { className: "text-sm font-medium text-gray-500", children: "Pr\xE9avis de r\xE9siliation" }),
|
|
@@ -28180,11 +28319,11 @@ var ViewContractContent = ({
|
|
|
28180
28319
|
/* @__PURE__ */ jsxs122("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-6", children: [
|
|
28181
28320
|
/* @__PURE__ */ jsxs122("div", { className: "p-4 bg-[var(--color-success-light)] rounded-lg", children: [
|
|
28182
28321
|
/* @__PURE__ */ jsx133("p", { className: "text-sm font-medium text-[var(--color-success)]", children: "Date de d\xE9but" }),
|
|
28183
|
-
/* @__PURE__ */ jsx133("p", { className: "text-xl font-bold text-gray-900 mt-1", children:
|
|
28322
|
+
/* @__PURE__ */ jsx133("p", { className: "text-xl font-bold text-gray-900 mt-1", children: formatDate5(contract.start_date) })
|
|
28184
28323
|
] }),
|
|
28185
28324
|
/* @__PURE__ */ jsxs122("div", { className: "p-4 bg-[var(--color-error-light)] rounded-lg", children: [
|
|
28186
28325
|
/* @__PURE__ */ jsx133("p", { className: "text-sm font-medium text-[var(--color-error)]", children: "Date de fin" }),
|
|
28187
|
-
/* @__PURE__ */ jsx133("p", { className: "text-xl font-bold text-gray-900 mt-1", children:
|
|
28326
|
+
/* @__PURE__ */ jsx133("p", { className: "text-xl font-bold text-gray-900 mt-1", children: formatDate5(contract.end_date) })
|
|
28188
28327
|
] }),
|
|
28189
28328
|
/* @__PURE__ */ jsxs122("div", { className: "p-4 bg-[var(--color-info-light)] rounded-lg", children: [
|
|
28190
28329
|
/* @__PURE__ */ jsx133("p", { className: "text-sm font-medium text-[var(--color-info)]", children: "Jours restants" }),
|
|
@@ -28217,7 +28356,7 @@ var ViewContractContent = ({
|
|
|
28217
28356
|
] }),
|
|
28218
28357
|
contract.renewal_date && /* @__PURE__ */ jsxs122("div", { className: "flex justify-between", children: [
|
|
28219
28358
|
/* @__PURE__ */ jsx133("dt", { className: "text-sm font-medium text-gray-500", children: "Date de renouvellement" }),
|
|
28220
|
-
/* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900", children:
|
|
28359
|
+
/* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900", children: formatDate5(contract.renewal_date) })
|
|
28221
28360
|
] }),
|
|
28222
28361
|
contract.duration && /* @__PURE__ */ jsxs122("div", { className: "flex justify-between", children: [
|
|
28223
28362
|
/* @__PURE__ */ jsx133("dt", { className: "text-sm font-medium text-gray-500", children: "Dur\xE9e" }),
|
|
@@ -28358,7 +28497,7 @@ var ViewContractContent = ({
|
|
|
28358
28497
|
milestone.percentage,
|
|
28359
28498
|
"%"
|
|
28360
28499
|
] }),
|
|
28361
|
-
/* @__PURE__ */ jsx133("td", { className: "py-3 text-center", children:
|
|
28500
|
+
/* @__PURE__ */ jsx133("td", { className: "py-3 text-center", children: formatDate5(milestone.dueDate) }),
|
|
28362
28501
|
/* @__PURE__ */ jsx133("td", { className: "py-3 text-center", children: /* @__PURE__ */ jsx133(Badge2, { variant: milestone.status === "paid" ? "success" : milestone.status === "overdue" ? "error" : milestone.status === "invoiced" ? "warning" : "default", children: milestone.status === "paid" ? "Pay\xE9" : milestone.status === "overdue" ? "En retard" : milestone.status === "invoiced" ? "Factur\xE9" : "En attente" }) })
|
|
28363
28502
|
] }, milestone.id)) })
|
|
28364
28503
|
] }) })
|
|
@@ -28627,11 +28766,11 @@ var ViewContractContent = ({
|
|
|
28627
28766
|
] }),
|
|
28628
28767
|
/* @__PURE__ */ jsxs122("div", { children: [
|
|
28629
28768
|
/* @__PURE__ */ jsx133("p", { className: "text-gray-500", children: "Date d'\xE9mission" }),
|
|
28630
|
-
/* @__PURE__ */ jsx133("p", { className: "font-medium", children:
|
|
28769
|
+
/* @__PURE__ */ jsx133("p", { className: "font-medium", children: formatDate5(guarantee.issueDate) })
|
|
28631
28770
|
] }),
|
|
28632
28771
|
/* @__PURE__ */ jsxs122("div", { children: [
|
|
28633
28772
|
/* @__PURE__ */ jsx133("p", { className: "text-gray-500", children: "Date d'expiration" }),
|
|
28634
|
-
/* @__PURE__ */ jsx133("p", { className: `font-medium ${new Date(guarantee.expiryDate) < /* @__PURE__ */ new Date() ? "text-[var(--color-error)]" : ""}`, children:
|
|
28773
|
+
/* @__PURE__ */ jsx133("p", { className: `font-medium ${new Date(guarantee.expiryDate) < /* @__PURE__ */ new Date() ? "text-[var(--color-error)]" : ""}`, children: formatDate5(guarantee.expiryDate) })
|
|
28635
28774
|
] })
|
|
28636
28775
|
] }),
|
|
28637
28776
|
guarantee.releaseConditions && /* @__PURE__ */ jsxs122("div", { className: "mt-3 p-3 bg-gray-50 rounded-lg", children: [
|
|
@@ -28671,7 +28810,7 @@ var ViewContractContent = ({
|
|
|
28671
28810
|
] }),
|
|
28672
28811
|
insurance.validUntil && /* @__PURE__ */ jsxs122("div", { children: [
|
|
28673
28812
|
/* @__PURE__ */ jsx133("p", { className: "text-gray-500", children: "Valide jusqu'au" }),
|
|
28674
|
-
/* @__PURE__ */ jsx133("p", { className: `font-medium ${new Date(insurance.validUntil) < /* @__PURE__ */ new Date() ? "text-[var(--color-error)]" : ""}`, children:
|
|
28813
|
+
/* @__PURE__ */ jsx133("p", { className: `font-medium ${new Date(insurance.validUntil) < /* @__PURE__ */ new Date() ? "text-[var(--color-error)]" : ""}`, children: formatDate5(insurance.validUntil) })
|
|
28675
28814
|
] })
|
|
28676
28815
|
] })
|
|
28677
28816
|
] }, insurance.id)) }) : /* @__PURE__ */ jsxs122("div", { className: "text-center py-8 text-gray-500", children: [
|
|
@@ -28742,7 +28881,7 @@ var ViewContractContent = ({
|
|
|
28742
28881
|
] }),
|
|
28743
28882
|
/* @__PURE__ */ jsxs122("div", { className: "text-right", children: [
|
|
28744
28883
|
/* @__PURE__ */ jsx133(Badge2, { variant: approver.status === "approved" ? "success" : approver.status === "rejected" ? "error" : "default", children: approver.status === "approved" ? "Approuv\xE9" : approver.status === "rejected" ? "Rejet\xE9" : "En attente" }),
|
|
28745
|
-
approver.approvalDate && /* @__PURE__ */ jsx133("p", { className: "text-xs text-gray-500 mt-1", children:
|
|
28884
|
+
approver.approvalDate && /* @__PURE__ */ jsx133("p", { className: "text-xs text-gray-500 mt-1", children: formatDate5(approver.approvalDate) })
|
|
28746
28885
|
] })
|
|
28747
28886
|
] }, index)) })
|
|
28748
28887
|
] }),
|
|
@@ -28796,11 +28935,11 @@ var ViewContractContent = ({
|
|
|
28796
28935
|
] }),
|
|
28797
28936
|
contract.governance.steeringCommittee.lastMeetingDate && /* @__PURE__ */ jsxs122("div", { className: "flex justify-between", children: [
|
|
28798
28937
|
/* @__PURE__ */ jsx133("dt", { className: "text-gray-500", children: "Derni\xE8re r\xE9union" }),
|
|
28799
|
-
/* @__PURE__ */ jsx133("dd", { className: "text-gray-900", children:
|
|
28938
|
+
/* @__PURE__ */ jsx133("dd", { className: "text-gray-900", children: formatDate5(contract.governance.steeringCommittee.lastMeetingDate) })
|
|
28800
28939
|
] }),
|
|
28801
28940
|
contract.governance.steeringCommittee.nextMeetingDate && /* @__PURE__ */ jsxs122("div", { className: "flex justify-between", children: [
|
|
28802
28941
|
/* @__PURE__ */ jsx133("dt", { className: "text-gray-500", children: "Prochaine r\xE9union" }),
|
|
28803
|
-
/* @__PURE__ */ jsx133("dd", { className: "text-gray-900 font-medium", children:
|
|
28942
|
+
/* @__PURE__ */ jsx133("dd", { className: "text-gray-900 font-medium", children: formatDate5(contract.governance.steeringCommittee.nextMeetingDate) })
|
|
28804
28943
|
] })
|
|
28805
28944
|
] })
|
|
28806
28945
|
] })
|
|
@@ -28873,7 +29012,7 @@ var ViewContractContent = ({
|
|
|
28873
29012
|
] }),
|
|
28874
29013
|
contract.regulatoryCompliance.sanctionsScreening?.lastScreeningDate && /* @__PURE__ */ jsxs122("p", { className: "text-sm text-gray-500", children: [
|
|
28875
29014
|
"Dernier contr\xF4le: ",
|
|
28876
|
-
|
|
29015
|
+
formatDate5(contract.regulatoryCompliance.sanctionsScreening.lastScreeningDate)
|
|
28877
29016
|
] })
|
|
28878
29017
|
] })
|
|
28879
29018
|
] })
|
|
@@ -28929,7 +29068,7 @@ var ViewContractContent = ({
|
|
|
28929
29068
|
] }),
|
|
28930
29069
|
/* @__PURE__ */ jsxs122("p", { className: "text-xs text-[var(--color-success)] mt-1", children: [
|
|
28931
29070
|
"\xC9valu\xE9 le ",
|
|
28932
|
-
|
|
29071
|
+
formatDate5(contract.esgCriteria.lastAssessmentDate)
|
|
28933
29072
|
] })
|
|
28934
29073
|
] }),
|
|
28935
29074
|
/* @__PURE__ */ jsx133(RewiseCard, { className: "p-4", children: /* @__PURE__ */ jsxs122("div", { className: "flex items-center space-x-3", children: [
|
|
@@ -29100,7 +29239,7 @@ var ViewContractContent = ({
|
|
|
29100
29239
|
/* @__PURE__ */ jsx133("span", { children: "\u2022" }),
|
|
29101
29240
|
/* @__PURE__ */ jsxs122("span", { children: [
|
|
29102
29241
|
"\xC9ch\xE9ance: ",
|
|
29103
|
-
|
|
29242
|
+
formatDate5(obligation.dueDate)
|
|
29104
29243
|
] })
|
|
29105
29244
|
] }),
|
|
29106
29245
|
/* @__PURE__ */ jsx133("span", { children: "\u2022" }),
|
|
@@ -29166,7 +29305,7 @@ var ViewContractContent = ({
|
|
|
29166
29305
|
] }),
|
|
29167
29306
|
sla.last_evaluation && /* @__PURE__ */ jsxs122("span", { children: [
|
|
29168
29307
|
"Derni\xE8re mesure: ",
|
|
29169
|
-
|
|
29308
|
+
formatDate5(sla.last_evaluation)
|
|
29170
29309
|
] })
|
|
29171
29310
|
] })
|
|
29172
29311
|
] }, sla.id)) }) : /* @__PURE__ */ jsxs122(RewiseCard, { className: "p-8 text-center", children: [
|
|
@@ -29377,7 +29516,7 @@ var ViewContractContent = ({
|
|
|
29377
29516
|
" MB \u2022 Version ",
|
|
29378
29517
|
doc.version,
|
|
29379
29518
|
" \u2022 Ajout\xE9 le ",
|
|
29380
|
-
|
|
29519
|
+
formatDate5(doc.uploadedAt)
|
|
29381
29520
|
] }),
|
|
29382
29521
|
doc.description && /* @__PURE__ */ jsx133("p", { className: "text-sm text-gray-600 mt-1", children: doc.description })
|
|
29383
29522
|
] })
|
|
@@ -29408,7 +29547,7 @@ var ViewContractContent = ({
|
|
|
29408
29547
|
] }),
|
|
29409
29548
|
/* @__PURE__ */ jsx133("p", { className: "text-sm text-gray-600 mb-2", children: amendment.description }),
|
|
29410
29549
|
/* @__PURE__ */ jsxs122("p", { className: "text-xs text-gray-500", children: [
|
|
29411
|
-
|
|
29550
|
+
formatDate5(amendment.date),
|
|
29412
29551
|
" \u2022 Raison: ",
|
|
29413
29552
|
amendment.reason
|
|
29414
29553
|
] })
|
|
@@ -29418,7 +29557,7 @@ var ViewContractContent = ({
|
|
|
29418
29557
|
const renderHistoryTab = () => /* @__PURE__ */ jsxs122("div", { className: "space-y-4", children: [
|
|
29419
29558
|
/* @__PURE__ */ jsx133("h3", { className: "text-lg font-semibold text-gray-900", children: "Historique des actions" }),
|
|
29420
29559
|
contract.auditTrail && contract.auditTrail.length > 0 ? /* @__PURE__ */ jsx133("div", { className: "space-y-4", children: contract.auditTrail.sort((a, b) => new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime()).map((entry, index) => /* @__PURE__ */ jsxs122("div", { className: "flex space-x-4", children: [
|
|
29421
|
-
/* @__PURE__ */ jsx133("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx133("div", { className: `w-10 h-10 rounded-full flex items-center justify-center ${entry.action === "created" ? "bg-[var(--color-success-light)]" : entry.action === "approved" ? "bg-[var(--color-info-light)]" : entry.action === "rejected" ? "bg-[var(--color-error-light)]" : entry.action === "signed" ? "bg-[var(--color-info-light)]" : entry.action === "amended" ? "bg-[var(--color-warning-light)]" : "bg-gray-100"}`, children: entry.action === "created" ? /* @__PURE__ */ jsx133(FileText20, { className: "w-5 h-5 text-[var(--color-success)]" }) : entry.action === "approved" ? /* @__PURE__ */ jsx133(CheckCircle14, { className: "w-5 h-5 text-[var(--color-info)]" }) : entry.action === "rejected" ? /* @__PURE__ */ jsx133(AlertTriangle9, { className: "w-5 h-5 text-[var(--color-error)]" }) : entry.action === "signed" ? /* @__PURE__ */ jsx133(FileCheck3, { className: "w-5 h-5 text-[var(--color-info)]" }) : entry.action === "amended" ? /* @__PURE__ */ jsx133(
|
|
29560
|
+
/* @__PURE__ */ jsx133("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx133("div", { className: `w-10 h-10 rounded-full flex items-center justify-center ${entry.action === "created" ? "bg-[var(--color-success-light)]" : entry.action === "approved" ? "bg-[var(--color-info-light)]" : entry.action === "rejected" ? "bg-[var(--color-error-light)]" : entry.action === "signed" ? "bg-[var(--color-info-light)]" : entry.action === "amended" ? "bg-[var(--color-warning-light)]" : "bg-gray-100"}`, children: entry.action === "created" ? /* @__PURE__ */ jsx133(FileText20, { className: "w-5 h-5 text-[var(--color-success)]" }) : entry.action === "approved" ? /* @__PURE__ */ jsx133(CheckCircle14, { className: "w-5 h-5 text-[var(--color-info)]" }) : entry.action === "rejected" ? /* @__PURE__ */ jsx133(AlertTriangle9, { className: "w-5 h-5 text-[var(--color-error)]" }) : entry.action === "signed" ? /* @__PURE__ */ jsx133(FileCheck3, { className: "w-5 h-5 text-[var(--color-info)]" }) : entry.action === "amended" ? /* @__PURE__ */ jsx133(Edit11, { className: "w-5 h-5 text-[var(--color-warning)]" }) : /* @__PURE__ */ jsx133(Clock11, { className: "w-5 h-5 text-gray-600" }) }) }),
|
|
29422
29561
|
/* @__PURE__ */ jsxs122("div", { className: "flex-1 min-w-0", children: [
|
|
29423
29562
|
/* @__PURE__ */ jsxs122("div", { className: "flex items-center justify-between", children: [
|
|
29424
29563
|
/* @__PURE__ */ jsx133("p", { className: "text-sm font-medium text-gray-900 capitalize", children: entry.action === "created" ? "Cr\xE9ation" : entry.action === "updated" ? "Mise \xE0 jour" : entry.action === "approved" ? "Approbation" : entry.action === "rejected" ? "Rejet" : entry.action === "signed" ? "Signature" : entry.action === "renewed" ? "Renouvellement" : entry.action === "terminated" ? "R\xE9siliation" : entry.action === "amended" ? "Avenant" : entry.action === "viewed" ? "Consultation" : entry.action === "exported" ? "Export" : entry.action }),
|
|
@@ -29466,7 +29605,7 @@ var ViewContractContent = ({
|
|
|
29466
29605
|
size: "sm",
|
|
29467
29606
|
onClick: () => handleAction("edit"),
|
|
29468
29607
|
children: [
|
|
29469
|
-
/* @__PURE__ */ jsx133(
|
|
29608
|
+
/* @__PURE__ */ jsx133(Edit11, { className: "w-4 h-4 mr-2" }),
|
|
29470
29609
|
"Modifier"
|
|
29471
29610
|
]
|
|
29472
29611
|
}
|
|
@@ -29506,7 +29645,7 @@ var ViewContractContent = ({
|
|
|
29506
29645
|
"Ce contrat expire dans ",
|
|
29507
29646
|
daysUntilExpiry,
|
|
29508
29647
|
" jours (",
|
|
29509
|
-
|
|
29648
|
+
formatDate5(contract.end_date),
|
|
29510
29649
|
")"
|
|
29511
29650
|
] })
|
|
29512
29651
|
] }),
|
|
@@ -29591,7 +29730,7 @@ import {
|
|
|
29591
29730
|
Table as Table3,
|
|
29592
29731
|
Plus as Plus22,
|
|
29593
29732
|
Trash2 as Trash221,
|
|
29594
|
-
Edit as
|
|
29733
|
+
Edit as Edit12,
|
|
29595
29734
|
CheckCircle as CheckCircle15,
|
|
29596
29735
|
XCircle as XCircle6,
|
|
29597
29736
|
AlertTriangle as AlertTriangle10,
|
|
@@ -30562,7 +30701,7 @@ var ContractForm = ({ contract, onSubmit, onCancel, onShowToast, isEdit = false
|
|
|
30562
30701
|
type: "button",
|
|
30563
30702
|
onClick: () => handleEditSLA(indicator),
|
|
30564
30703
|
className: "p-1 text-[#78a6d2] hover:bg-[#78a6d2]/10 rounded",
|
|
30565
|
-
children: /* @__PURE__ */ jsx134(
|
|
30704
|
+
children: /* @__PURE__ */ jsx134(Edit12, { className: "w-4 h-4" })
|
|
30566
30705
|
}
|
|
30567
30706
|
),
|
|
30568
30707
|
/* @__PURE__ */ jsx134(
|
|
@@ -32192,7 +32331,7 @@ import {
|
|
|
32192
32331
|
Smartphone as Smartphone3,
|
|
32193
32332
|
Filter as Filter4,
|
|
32194
32333
|
Search as Search11,
|
|
32195
|
-
Edit as
|
|
32334
|
+
Edit as Edit13,
|
|
32196
32335
|
Trash2 as Trash222,
|
|
32197
32336
|
Eye as Eye15,
|
|
32198
32337
|
EyeOff as EyeOff5
|
|
@@ -32528,7 +32667,7 @@ var AlertsManagementModal = ({
|
|
|
32528
32667
|
] })
|
|
32529
32668
|
] }),
|
|
32530
32669
|
/* @__PURE__ */ jsxs125("div", { className: "flex items-center space-x-2", children: [
|
|
32531
|
-
/* @__PURE__ */ jsx137(Button2, { variant: "text", size: "sm", children: /* @__PURE__ */ jsx137(
|
|
32670
|
+
/* @__PURE__ */ jsx137(Button2, { variant: "text", size: "sm", children: /* @__PURE__ */ jsx137(Edit13, { className: "w-4 h-4" }) }),
|
|
32532
32671
|
/* @__PURE__ */ jsx137(
|
|
32533
32672
|
Button2,
|
|
32534
32673
|
{
|
|
@@ -33850,7 +33989,7 @@ var SLAManagementModal = ({
|
|
|
33850
33989
|
onShowToast("Indicateur SLA supprim\xE9", "success");
|
|
33851
33990
|
}
|
|
33852
33991
|
};
|
|
33853
|
-
const
|
|
33992
|
+
const formatDate5 = (dateString) => {
|
|
33854
33993
|
if (!dateString) return "N/A";
|
|
33855
33994
|
return new Date(dateString).toLocaleDateString("fr-FR");
|
|
33856
33995
|
};
|
|
@@ -34005,7 +34144,7 @@ var SLAManagementModal = ({
|
|
|
34005
34144
|
/* @__PURE__ */ jsx139("p", { className: "text-sm", style: { color: colors.text.secondary }, children: indicator.description })
|
|
34006
34145
|
] }),
|
|
34007
34146
|
/* @__PURE__ */ jsxs127("div", { className: "flex space-x-2", children: [
|
|
34008
|
-
/* @__PURE__ */ jsx139(PrimaryButton, { variant: "outline", onClick: () => setEditingIndicator(indicator), children: /* @__PURE__ */ jsx139(
|
|
34147
|
+
/* @__PURE__ */ jsx139(PrimaryButton, { variant: "outline", onClick: () => setEditingIndicator(indicator), children: /* @__PURE__ */ jsx139(Edit14, { className: "w-4 h-4" }) }),
|
|
34009
34148
|
/* @__PURE__ */ jsx139(
|
|
34010
34149
|
"button",
|
|
34011
34150
|
{
|
|
@@ -34364,7 +34503,7 @@ var SLAManagementModal = ({
|
|
|
34364
34503
|
] }),
|
|
34365
34504
|
/* @__PURE__ */ jsxs127("p", { className: "text-xs mt-1", style: { color: colors.text.tertiary }, children: [
|
|
34366
34505
|
"D\xE9tect\xE9 le ",
|
|
34367
|
-
|
|
34506
|
+
formatDate5(incident.detected_date)
|
|
34368
34507
|
] })
|
|
34369
34508
|
] })
|
|
34370
34509
|
] }),
|
|
@@ -34489,7 +34628,7 @@ var SLAManagementModal = ({
|
|
|
34489
34628
|
const getNoteTypeIcon = (type) => {
|
|
34490
34629
|
switch (type) {
|
|
34491
34630
|
case "comment":
|
|
34492
|
-
return
|
|
34631
|
+
return MessageSquare3;
|
|
34493
34632
|
case "decision":
|
|
34494
34633
|
return CheckCircle18;
|
|
34495
34634
|
case "action":
|
|
@@ -34497,7 +34636,7 @@ var SLAManagementModal = ({
|
|
|
34497
34636
|
case "meeting":
|
|
34498
34637
|
return Users17;
|
|
34499
34638
|
default:
|
|
34500
|
-
return
|
|
34639
|
+
return MessageSquare3;
|
|
34501
34640
|
}
|
|
34502
34641
|
};
|
|
34503
34642
|
const getNoteTypeColor = (type) => {
|
|
@@ -34517,7 +34656,7 @@ var SLAManagementModal = ({
|
|
|
34517
34656
|
return /* @__PURE__ */ jsxs127("div", { className: "space-y-4", children: [
|
|
34518
34657
|
/* @__PURE__ */ jsxs127("div", { className: "flex items-center justify-between", children: [
|
|
34519
34658
|
/* @__PURE__ */ jsxs127("h3", { className: "text-lg font-semibold flex items-center gap-2", style: { color: colors.text.primary }, children: [
|
|
34520
|
-
/* @__PURE__ */ jsx139(
|
|
34659
|
+
/* @__PURE__ */ jsx139(MessageSquare3, { className: "w-5 h-5", style: { color: colors.primary } }),
|
|
34521
34660
|
"Notes et commentaires (",
|
|
34522
34661
|
notes.length,
|
|
34523
34662
|
")"
|
|
@@ -34601,7 +34740,7 @@ var SLAManagementModal = ({
|
|
|
34601
34740
|
] })
|
|
34602
34741
|
] }),
|
|
34603
34742
|
notesLoading ? /* @__PURE__ */ jsx139("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsx139(RefreshCw11, { className: "w-8 h-8 animate-spin", style: { color: colors.primary } }) }) : filteredNotes.length === 0 ? /* @__PURE__ */ jsxs127("div", { className: "text-center py-12", children: [
|
|
34604
|
-
/* @__PURE__ */ jsx139(
|
|
34743
|
+
/* @__PURE__ */ jsx139(MessageSquare3, { className: "w-12 h-12 mx-auto mb-4", style: { color: colors.text.tertiary } }),
|
|
34605
34744
|
/* @__PURE__ */ jsx139("p", { style: { color: colors.text.secondary }, children: "Aucune note" })
|
|
34606
34745
|
] }) : /* @__PURE__ */ jsx139("div", { className: "space-y-3", children: filteredNotes.map((note) => {
|
|
34607
34746
|
const Icon = getNoteTypeIcon(note.note_type);
|
|
@@ -34643,7 +34782,7 @@ var SLAManagementModal = ({
|
|
|
34643
34782
|
{ id: "evaluations", label: "Journal des \xE9valuations", icon: FileText23 },
|
|
34644
34783
|
{ id: "incidents", label: "Incidents", icon: AlertCircle10 },
|
|
34645
34784
|
{ id: "penalties", label: "P\xE9nalit\xE9s & Bonus", icon: DollarSign3 },
|
|
34646
|
-
{ id: "notes", label: "Notes", icon:
|
|
34785
|
+
{ id: "notes", label: "Notes", icon: MessageSquare3 }
|
|
34647
34786
|
];
|
|
34648
34787
|
return /* @__PURE__ */ jsxs127(
|
|
34649
34788
|
Modal,
|
|
@@ -35377,9 +35516,9 @@ export {
|
|
|
35377
35516
|
fileManagerApi,
|
|
35378
35517
|
findFolderById2 as findFolderById,
|
|
35379
35518
|
formatCurrency,
|
|
35380
|
-
formatDate,
|
|
35519
|
+
formatDate2 as formatDate,
|
|
35381
35520
|
formatDateFR,
|
|
35382
|
-
formatDateTime,
|
|
35521
|
+
formatDateTime2 as formatDateTime,
|
|
35383
35522
|
formatFileSize,
|
|
35384
35523
|
getAllFolders,
|
|
35385
35524
|
getAllSLATemplates,
|