@consilioweb/payload-support 0.16.0 → 1.1.0
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/README.md +357 -435
- package/dist/components/TicketConversation/RewriteDropdown.cjs +98 -0
- package/dist/components/TicketConversation/RewriteDropdown.js +93 -0
- package/dist/components/TicketConversation/SkeletonText.cjs +21 -0
- package/dist/components/TicketConversation/SkeletonText.js +20 -0
- package/dist/components/TicketConversation/constants.cjs +27 -0
- package/dist/components/TicketConversation/constants.js +26 -1
- package/dist/components/TicketConversation/hooks/useDocumentIdFromUrl.cjs +20 -0
- package/dist/components/TicketConversation/hooks/useDocumentIdFromUrl.js +19 -0
- package/dist/components/TicketConversation/index.cjs +10 -147
- package/dist/components/TicketConversation/index.js +4 -141
- package/dist/index.cjs +1763 -677
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1760 -677
- package/dist/views/BillingView/client.cjs +40 -54
- package/dist/views/BillingView/client.js +40 -54
- package/dist/views/ChatView/client.cjs +4 -3
- package/dist/views/ChatView/client.js +4 -3
- package/dist/views/CrmView/client.cjs +7 -7
- package/dist/views/CrmView/client.js +7 -7
- package/dist/views/EmailTrackingView/client.cjs +6 -5
- package/dist/views/EmailTrackingView/client.js +6 -5
- package/dist/views/ImportConversationView/client.cjs +4 -4
- package/dist/views/ImportConversationView/client.js +4 -4
- package/dist/views/LogsView/client.cjs +3 -2
- package/dist/views/LogsView/client.js +3 -2
- package/dist/views/NewTicketView/client.cjs +1 -1
- package/dist/views/NewTicketView/client.js +1 -1
- package/dist/views/PendingEmailsView/client.cjs +7 -6
- package/dist/views/PendingEmailsView/client.js +7 -6
- package/dist/views/SupportDashboardView/client.cjs +19 -22
- package/dist/views/SupportDashboardView/client.js +19 -22
- package/dist/views/TicketDetailView/NextActionItem.cjs +40 -0
- package/dist/views/TicketDetailView/NextActionItem.js +34 -0
- package/dist/views/TicketDetailView/RewriteDropdown.cjs +80 -0
- package/dist/views/TicketDetailView/RewriteDropdown.js +78 -0
- package/dist/views/TicketDetailView/client.cjs +59 -190
- package/dist/views/TicketDetailView/client.js +52 -183
- package/dist/views/TicketDetailView/constants.cjs +20 -0
- package/dist/views/TicketDetailView/constants.js +16 -0
- package/dist/views/TicketDetailView/helpers.cjs +23 -0
- package/dist/views/TicketDetailView/helpers.js +20 -0
- package/dist/views/TicketDetailView/types.cjs +2 -0
- package/dist/views/TicketDetailView/types.js +1 -0
- package/dist/views/TicketInboxView/client.cjs +14 -10
- package/dist/views/TicketInboxView/client.js +14 -10
- package/dist/views/TicketingSettingsView/client.cjs +101 -96
- package/dist/views/TicketingSettingsView/client.js +92 -88
- package/dist/views/TimeDashboardView/client.cjs +2 -2
- package/dist/views/TimeDashboardView/client.js +2 -2
- package/dist/views/shared/StatusPill.cjs +23 -12
- package/dist/views/shared/StatusPill.js +23 -12
- package/dist/views/shared/dateLocale.cjs +5 -0
- package/dist/views/shared/dateLocale.js +3 -0
- package/package.json +28 -15
- package/src/__tests__/generateTrackingToken.test.ts +53 -0
- package/src/__tests__/integration/ai-agent.test.ts +46 -0
- package/src/__tests__/integration/auth.test.ts +43 -0
- package/src/__tests__/integration/automation-rules.test.ts +68 -0
- package/src/__tests__/integration/buildTestPayload.ts +52 -0
- package/src/__tests__/integration/channels.test.ts +52 -0
- package/src/__tests__/integration/core-behaviors.test.ts +58 -0
- package/src/__tests__/integration/dashboard-volume.test.ts +31 -0
- package/src/__tests__/integration/digest.test.ts +48 -0
- package/src/__tests__/integration/invoice-pdf.test.ts +30 -0
- package/src/__tests__/integration/isolation.test.ts +81 -0
- package/src/__tests__/integration/mentions-invoice.test.ts +50 -0
- package/src/__tests__/integration/nps.test.ts +37 -0
- package/src/__tests__/integration/per-team-sla.test.ts +44 -0
- package/src/__tests__/integration/push.test.ts +75 -0
- package/src/__tests__/integration/sanitization.test.ts +35 -0
- package/src/__tests__/integration/sla-pause.test.ts +39 -0
- package/src/__tests__/integration/smoke.test.ts +26 -0
- package/src/__tests__/integration/snooze.test.ts +68 -0
- package/src/__tests__/integration/teams.test.ts +38 -0
- package/src/__tests__/rateLimiter.test.ts +89 -0
- package/src/__tests__/sanitizeHtml.test.ts +165 -0
- package/src/__tests__/sla.test.ts +258 -0
- package/src/collections/AutomationRules.ts +66 -0
- package/src/collections/NotificationQueue.ts +30 -0
- package/src/collections/PushSubscription.ts +28 -0
- package/src/collections/SatisfactionSurveys.ts +11 -2
- package/src/collections/SlaPolicies.ts +10 -0
- package/src/collections/SupportClients.ts +58 -1
- package/src/collections/SupportTeam.ts +27 -0
- package/src/collections/TicketActivityLog.ts +9 -4
- package/src/collections/TicketMessages.ts +140 -31
- package/src/collections/Tickets.ts +31 -73
- package/src/collections/index.ts +4 -0
- package/src/components/TicketConversation/RewriteDropdown.tsx +86 -0
- package/src/components/TicketConversation/SkeletonText.tsx +23 -0
- package/src/components/TicketConversation/constants.ts +29 -0
- package/src/components/TicketConversation/hooks/useDocumentIdFromUrl.ts +21 -0
- package/src/components/TicketConversation/index.tsx +4 -152
- package/src/endpoints/admin-chat-stream.ts +3 -4
- package/src/endpoints/admin-chat.ts +11 -20
- package/src/endpoints/admin-stats.ts +77 -35
- package/src/endpoints/ai-agent.ts +36 -0
- package/src/endpoints/apply-macro.ts +8 -14
- package/src/endpoints/auth-2fa.ts +12 -12
- package/src/endpoints/auto-close.ts +6 -10
- package/src/endpoints/billing.ts +17 -4
- package/src/endpoints/bulk-action.ts +7 -12
- package/src/endpoints/channels.ts +89 -0
- package/src/endpoints/chat-stream.ts +3 -4
- package/src/endpoints/chat.ts +7 -12
- package/src/endpoints/chatbot.ts +2 -2
- package/src/endpoints/client-intelligence.ts +4 -4
- package/src/endpoints/delete-account.ts +9 -16
- package/src/endpoints/email-stats.ts +2 -2
- package/src/endpoints/escalate.ts +2 -2
- package/src/endpoints/export-csv.ts +2 -2
- package/src/endpoints/export-data.ts +5 -8
- package/src/endpoints/import-conversation.ts +6 -10
- package/src/endpoints/index.ts +22 -1
- package/src/endpoints/invite-collaborator.ts +30 -15
- package/src/endpoints/invoice.ts +127 -0
- package/src/endpoints/kb-search.ts +2 -2
- package/src/endpoints/login.ts +12 -4
- package/src/endpoints/merge-clients.ts +14 -19
- package/src/endpoints/merge-tickets.ts +11 -18
- package/src/endpoints/oauth-google.ts +86 -39
- package/src/endpoints/pending-emails-process.ts +15 -25
- package/src/endpoints/process-digests.ts +93 -0
- package/src/endpoints/process-scheduled.ts +6 -10
- package/src/endpoints/process-snooze.ts +78 -0
- package/src/endpoints/purge-logs.ts +2 -2
- package/src/endpoints/push.ts +49 -0
- package/src/endpoints/resend-notification.ts +3 -4
- package/src/endpoints/round-robin-config.ts +3 -4
- package/src/endpoints/satisfaction.ts +21 -14
- package/src/endpoints/search.ts +5 -8
- package/src/endpoints/seed-kb.ts +3 -4
- package/src/endpoints/send-reminder.ts +6 -9
- package/src/endpoints/settings.ts +5 -2
- package/src/endpoints/signature.ts +3 -4
- package/src/endpoints/sla-check.ts +2 -2
- package/src/endpoints/split-ticket.ts +7 -12
- package/src/endpoints/statuses.ts +2 -2
- package/src/endpoints/ticket-feedback.ts +4 -6
- package/src/endpoints/ticket-synthesis.ts +2 -2
- package/src/endpoints/track-open.ts +16 -28
- package/src/endpoints/transfer-ticket.ts +21 -9
- package/src/endpoints/user-prefs.ts +3 -4
- package/src/hooks/automationRules.ts +84 -0
- package/src/hooks/checkSLA.ts +63 -17
- package/src/plugin.ts +8 -0
- package/src/portal/LiveChat.tsx +2 -63
- package/src/portal/auth/tickets/detail/CloseTicketButton.tsx +10 -0
- package/src/portal/auth/tickets/detail/MarkSolutionButton.tsx +14 -2
- package/src/portal/auth/tickets/detail/MessageActions.tsx +37 -18
- package/src/portal/auth/tickets/detail/ReopenTicketButton.tsx +10 -0
- package/src/portal/auth/tickets/detail/TransferAndInviteActions.tsx +3 -2
- package/src/portal/auth/tickets/detail/page.tsx +2 -2
- package/src/portal/helpers.ts +46 -0
- package/src/portal/login/page.tsx +3 -8
- package/src/portal/types.ts +15 -0
- package/src/types/lucide-react.d.ts +34 -0
- package/src/types/payload-config.d.ts +10 -0
- package/src/utils/adminNotification.ts +2 -2
- package/src/utils/aiAgent.ts +147 -0
- package/src/utils/auth.ts +5 -4
- package/src/utils/channels.ts +36 -0
- package/src/utils/db.ts +73 -0
- package/src/utils/emailTemplate.ts +8 -1
- package/src/utils/fireWebhooks.ts +4 -6
- package/src/utils/generateTicketSynthesis.ts +7 -12
- package/src/utils/invoicePdf.ts +88 -0
- package/src/utils/notificationQueue.ts +36 -0
- package/src/utils/push.ts +63 -0
- package/src/utils/readSettings.ts +22 -6
- package/src/utils/sanitizeHtml.ts +57 -0
- package/src/utils/slugs.ts +8 -0
- package/src/utils/teamAccess.ts +27 -0
- package/src/utils/ticketAccess.ts +53 -0
- package/src/utils/webhookDispatcher.ts +4 -6
- package/src/views/BillingView/client.tsx +49 -37
- package/src/views/ChatView/client.tsx +4 -3
- package/src/views/CrmView/client.tsx +7 -7
- package/src/views/EmailTrackingView/client.tsx +7 -6
- package/src/views/ImportConversationView/client.tsx +4 -4
- package/src/views/LogsView/client.tsx +3 -2
- package/src/views/NewTicketView/client.tsx +1 -1
- package/src/views/PendingEmailsView/client.tsx +7 -6
- package/src/views/SupportDashboardView/client.tsx +21 -21
- package/src/views/TicketDetailView/NextActionItem.tsx +30 -0
- package/src/views/TicketDetailView/RewriteDropdown.tsx +63 -0
- package/src/views/TicketDetailView/client.tsx +54 -179
- package/src/views/TicketDetailView/constants.ts +23 -0
- package/src/views/TicketDetailView/helpers.ts +17 -0
- package/src/views/TicketDetailView/types.ts +10 -0
- package/src/views/TicketInboxView/client.tsx +16 -10
- package/src/views/TicketingSettingsView/client.tsx +90 -87
- package/src/views/TimeDashboardView/client.tsx +2 -2
- package/src/views/shared/StatusPill.tsx +24 -12
- package/src/views/shared/dateLocale.ts +5 -0
- package/src/views/shared/locales/en.json +708 -0
- package/src/views/shared/locales/fr.json +708 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import { useState, useEffect } from 'react';
|
|
3
|
+
import React, { useState, useEffect } from 'react';
|
|
4
4
|
import { Settings, Mail, Bot, Clock, Timer, Globe, FileSignature } from 'lucide-react';
|
|
5
|
-
import {
|
|
5
|
+
import { btnStyle, V } from '../shared/adminTokens.js';
|
|
6
6
|
import { AdminViewHeader } from '../shared/AdminViewHeader.js';
|
|
7
7
|
import { getFeatures, saveFeatures, DEFAULT_FEATURES } from '../../components/TicketConversation/config.js';
|
|
8
8
|
import { useTranslation } from '../../components/TicketConversation/hooks/useTranslation.js';
|
|
@@ -97,31 +97,35 @@ async function saveUserPrefs(prefs) {
|
|
|
97
97
|
return false;
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
100
|
+
function getFeatureList(t) {
|
|
101
|
+
return [
|
|
102
|
+
// Core
|
|
103
|
+
{ key: "canned", label: t("settingsView.features.canned.label"), description: t("settingsView.features.canned.description"), category: "core" },
|
|
104
|
+
{ key: "scheduledReplies", label: t("settingsView.features.scheduledReplies.label"), description: t("settingsView.features.scheduledReplies.description"), category: "core" },
|
|
105
|
+
{ key: "activityLog", label: t("settingsView.features.activityLog.label"), description: t("settingsView.features.activityLog.description"), category: "core" },
|
|
106
|
+
// Communication
|
|
107
|
+
{ key: "emailTracking", label: t("settingsView.features.emailTracking.label"), description: t("settingsView.features.emailTracking.description"), category: "communication" },
|
|
108
|
+
{ key: "chat", label: t("settingsView.features.chat.label"), description: t("settingsView.features.chat.description"), category: "communication" },
|
|
109
|
+
{ key: "externalMessages", label: t("settingsView.features.externalMessages.label"), description: t("settingsView.features.externalMessages.description"), category: "communication" },
|
|
110
|
+
// Productivity
|
|
111
|
+
{ key: "ai", label: t("settingsView.features.ai.label"), description: t("settingsView.features.ai.description"), category: "productivity" },
|
|
112
|
+
{ key: "timeTracking", label: t("settingsView.features.timeTracking.label"), description: t("settingsView.features.timeTracking.description"), category: "productivity" },
|
|
113
|
+
{ key: "satisfaction", label: t("settingsView.features.satisfaction.label"), description: t("settingsView.features.satisfaction.description"), category: "productivity" },
|
|
114
|
+
// Advanced
|
|
115
|
+
{ key: "merge", label: t("settingsView.features.merge.label"), description: t("settingsView.features.merge.description"), category: "advanced" },
|
|
116
|
+
{ key: "splitTicket", label: t("settingsView.features.splitTicket.label"), description: t("settingsView.features.splitTicket.description"), category: "advanced" },
|
|
117
|
+
{ key: "snooze", label: t("settingsView.features.snooze.label"), description: t("settingsView.features.snooze.description"), category: "advanced" },
|
|
118
|
+
{ key: "clientHistory", label: t("settingsView.features.clientHistory.label"), description: t("settingsView.features.clientHistory.description"), category: "advanced" }
|
|
119
|
+
];
|
|
120
|
+
}
|
|
121
|
+
function getCategories(t) {
|
|
122
|
+
return [
|
|
123
|
+
{ key: "core", label: t("settingsView.categories.core"), color: V.blue },
|
|
124
|
+
{ key: "communication", label: t("settingsView.categories.communication"), color: V.green },
|
|
125
|
+
{ key: "productivity", label: t("settingsView.categories.productivity"), color: V.amber },
|
|
126
|
+
{ key: "advanced", label: t("settingsView.categories.advanced"), color: "#7c3aed" }
|
|
127
|
+
];
|
|
128
|
+
}
|
|
125
129
|
const Toggle = ({ checked, onChange, color = V.blue, size = "md" }) => {
|
|
126
130
|
const w = size === "sm" ? 36 : 40;
|
|
127
131
|
const h = size === "sm" ? 20 : 22;
|
|
@@ -200,6 +204,8 @@ const FieldRow = ({ label, description, children }) => /* @__PURE__ */ jsxs("div
|
|
|
200
204
|
] });
|
|
201
205
|
const TicketingSettingsClient = () => {
|
|
202
206
|
const { t } = useTranslation();
|
|
207
|
+
const FEATURE_LIST = React.useMemo(() => getFeatureList(t), [t]);
|
|
208
|
+
const CATEGORIES = React.useMemo(() => getCategories(t), [t]);
|
|
203
209
|
const [features, setFeatures] = useState(() => getFeatures());
|
|
204
210
|
const [settings, setSettings] = useState(DEFAULT_SETTINGS);
|
|
205
211
|
const [signature, setSignature] = useState("");
|
|
@@ -345,13 +351,13 @@ const TicketingSettingsClient = () => {
|
|
|
345
351
|
/* @__PURE__ */ jsxs(
|
|
346
352
|
CollapsibleSection,
|
|
347
353
|
{
|
|
348
|
-
title: "
|
|
354
|
+
title: t("settingsView.emailConfig"),
|
|
349
355
|
icon: /* @__PURE__ */ jsx(Mail, { size: 16 }),
|
|
350
356
|
color: "#ea580c",
|
|
351
357
|
defaultOpen: false,
|
|
352
358
|
children: [
|
|
353
|
-
/* @__PURE__ */ jsx("p", { className: ts.sectionDescription, children: "
|
|
354
|
-
/* @__PURE__ */ jsx(FieldRow, { label: "
|
|
359
|
+
/* @__PURE__ */ jsx("p", { className: ts.sectionDescription, children: t("settingsView.emailDescription") }),
|
|
360
|
+
/* @__PURE__ */ jsx(FieldRow, { label: t("settingsView.senderAddress"), description: t("settingsView.senderAddressDesc"), children: /* @__PURE__ */ jsx(
|
|
355
361
|
"input",
|
|
356
362
|
{
|
|
357
363
|
type: "email",
|
|
@@ -361,7 +367,7 @@ const TicketingSettingsClient = () => {
|
|
|
361
367
|
className: ts.input
|
|
362
368
|
}
|
|
363
369
|
) }),
|
|
364
|
-
/* @__PURE__ */ jsx(FieldRow, { label: "
|
|
370
|
+
/* @__PURE__ */ jsx(FieldRow, { label: t("settingsView.senderName"), description: t("settingsView.senderNameDesc"), children: /* @__PURE__ */ jsx(
|
|
365
371
|
"input",
|
|
366
372
|
{
|
|
367
373
|
type: "text",
|
|
@@ -371,7 +377,7 @@ const TicketingSettingsClient = () => {
|
|
|
371
377
|
className: ts.input
|
|
372
378
|
}
|
|
373
379
|
) }),
|
|
374
|
-
/* @__PURE__ */ jsx(FieldRow, { label: "
|
|
380
|
+
/* @__PURE__ */ jsx(FieldRow, { label: t("settingsView.replyTo"), description: t("settingsView.replyToDesc"), children: /* @__PURE__ */ jsx(
|
|
375
381
|
"input",
|
|
376
382
|
{
|
|
377
383
|
type: "email",
|
|
@@ -382,7 +388,7 @@ const TicketingSettingsClient = () => {
|
|
|
382
388
|
}
|
|
383
389
|
) }),
|
|
384
390
|
/* @__PURE__ */ jsx("div", { className: ts.separator }),
|
|
385
|
-
/* @__PURE__ */ jsx(FieldRow, { label: "
|
|
391
|
+
/* @__PURE__ */ jsx(FieldRow, { label: t("settingsView.smtpServer"), description: t("settingsView.smtpServerDesc"), children: /* @__PURE__ */ jsx(
|
|
386
392
|
"input",
|
|
387
393
|
{
|
|
388
394
|
type: "text",
|
|
@@ -391,7 +397,7 @@ const TicketingSettingsClient = () => {
|
|
|
391
397
|
className: ts.inputReadonly
|
|
392
398
|
}
|
|
393
399
|
) }),
|
|
394
|
-
/* @__PURE__ */ jsx(FieldRow, { label: "
|
|
400
|
+
/* @__PURE__ */ jsx(FieldRow, { label: t("settingsView.smtpPort"), children: /* @__PURE__ */ jsx(
|
|
395
401
|
"input",
|
|
396
402
|
{
|
|
397
403
|
type: "text",
|
|
@@ -407,14 +413,14 @@ const TicketingSettingsClient = () => {
|
|
|
407
413
|
/* @__PURE__ */ jsxs(
|
|
408
414
|
CollapsibleSection,
|
|
409
415
|
{
|
|
410
|
-
title: "
|
|
416
|
+
title: t("settingsView.aiTitle"),
|
|
411
417
|
icon: /* @__PURE__ */ jsx(Bot, { size: 16 }),
|
|
412
418
|
color: "#7c3aed",
|
|
413
419
|
defaultOpen: false,
|
|
414
|
-
badge: features.ai ? /* @__PURE__ */ jsx("span", { className: ts.badge, style: { backgroundColor: "#dcfce7", color: "#166534" }, children: "
|
|
420
|
+
badge: features.ai ? /* @__PURE__ */ jsx("span", { className: ts.badge, style: { backgroundColor: "#dcfce7", color: "#166534" }, children: t("settingsView.aiBadgeActive") }) : /* @__PURE__ */ jsx("span", { className: ts.badge, style: { backgroundColor: "#fee2e2", color: "#991b1b" }, children: t("settingsView.aiBadgeInactive") }),
|
|
415
421
|
children: [
|
|
416
|
-
/* @__PURE__ */ jsx("p", { className: ts.sectionDescription, children:
|
|
417
|
-
/* @__PURE__ */ jsx(FieldRow, { label: "
|
|
422
|
+
/* @__PURE__ */ jsx("p", { className: ts.sectionDescription, children: t("settingsView.aiDescription") }),
|
|
423
|
+
/* @__PURE__ */ jsx(FieldRow, { label: t("settingsView.aiProvider"), description: t("settingsView.aiProviderDesc"), children: /* @__PURE__ */ jsxs(
|
|
418
424
|
"select",
|
|
419
425
|
{
|
|
420
426
|
value: settings.ai.provider,
|
|
@@ -428,7 +434,7 @@ const TicketingSettingsClient = () => {
|
|
|
428
434
|
]
|
|
429
435
|
}
|
|
430
436
|
) }),
|
|
431
|
-
settings.ai.provider !== "ollama" && /* @__PURE__ */ jsx(FieldRow, { label: "
|
|
437
|
+
settings.ai.provider !== "ollama" && /* @__PURE__ */ jsx(FieldRow, { label: t("settingsView.aiApiKey"), description: t("settingsView.aiApiKeyDesc"), children: /* @__PURE__ */ jsxs("div", { className: ts.apiKeyRow, children: [
|
|
432
438
|
/* @__PURE__ */ jsx(
|
|
433
439
|
"input",
|
|
434
440
|
{
|
|
@@ -445,11 +451,11 @@ const TicketingSettingsClient = () => {
|
|
|
445
451
|
{
|
|
446
452
|
onClick: () => setShowApiKey(!showApiKey),
|
|
447
453
|
className: ts.apiKeyToggle,
|
|
448
|
-
children: showApiKey ? "
|
|
454
|
+
children: showApiKey ? t("settingsView.hideKey") : t("settingsView.showKey")
|
|
449
455
|
}
|
|
450
456
|
)
|
|
451
457
|
] }) }),
|
|
452
|
-
/* @__PURE__ */ jsx(FieldRow, { label: "
|
|
458
|
+
/* @__PURE__ */ jsx(FieldRow, { label: t("settingsView.aiModel"), description: t("settingsView.aiModelDesc"), children: /* @__PURE__ */ jsx(
|
|
453
459
|
"input",
|
|
454
460
|
{
|
|
455
461
|
type: "text",
|
|
@@ -460,12 +466,12 @@ const TicketingSettingsClient = () => {
|
|
|
460
466
|
}
|
|
461
467
|
) }),
|
|
462
468
|
/* @__PURE__ */ jsx("div", { className: ts.separator }),
|
|
463
|
-
/* @__PURE__ */ jsx("p", { className: ts.aiSubFeaturesLabel, children: "
|
|
469
|
+
/* @__PURE__ */ jsx("p", { className: ts.aiSubFeaturesLabel, children: t("settingsView.aiSubFeatures") }),
|
|
464
470
|
[
|
|
465
|
-
{ key: "enableSentiment", label: "
|
|
466
|
-
{ key: "enableSynthesis", label: "
|
|
467
|
-
{ key: "enableSuggestion", label: "
|
|
468
|
-
{ key: "enableRewrite", label: "
|
|
471
|
+
{ key: "enableSentiment", label: t("settingsView.aiSentiment"), desc: t("settingsView.aiSentimentDesc") },
|
|
472
|
+
{ key: "enableSynthesis", label: t("settingsView.aiSynthesis"), desc: t("settingsView.aiSynthesisDesc") },
|
|
473
|
+
{ key: "enableSuggestion", label: t("settingsView.aiSuggestion"), desc: t("settingsView.aiSuggestionDesc") },
|
|
474
|
+
{ key: "enableRewrite", label: t("settingsView.aiRewrite"), desc: t("settingsView.aiRewriteDesc") }
|
|
469
475
|
].map((item) => /* @__PURE__ */ jsxs("div", { className: ts.aiToggleRow, children: [
|
|
470
476
|
/* @__PURE__ */ jsx(
|
|
471
477
|
Toggle,
|
|
@@ -487,13 +493,13 @@ const TicketingSettingsClient = () => {
|
|
|
487
493
|
/* @__PURE__ */ jsxs(
|
|
488
494
|
CollapsibleSection,
|
|
489
495
|
{
|
|
490
|
-
title: "
|
|
496
|
+
title: t("settingsView.slaTitle"),
|
|
491
497
|
icon: /* @__PURE__ */ jsx(Clock, { size: 16 }),
|
|
492
498
|
color: "#0891b2",
|
|
493
499
|
defaultOpen: false,
|
|
494
500
|
children: [
|
|
495
|
-
/* @__PURE__ */ jsx("p", { className: ts.sectionDescription, children: "
|
|
496
|
-
/* @__PURE__ */ jsx(FieldRow, { label: "
|
|
501
|
+
/* @__PURE__ */ jsx("p", { className: ts.sectionDescription, children: t("settingsView.slaDescription") }),
|
|
502
|
+
/* @__PURE__ */ jsx(FieldRow, { label: t("settingsView.slaFirstResponse"), description: t("settingsView.slaFirstResponseDesc"), children: /* @__PURE__ */ jsxs("div", { className: ts.slaInline, children: [
|
|
497
503
|
/* @__PURE__ */ jsx(
|
|
498
504
|
"input",
|
|
499
505
|
{
|
|
@@ -505,14 +511,15 @@ const TicketingSettingsClient = () => {
|
|
|
505
511
|
}
|
|
506
512
|
),
|
|
507
513
|
/* @__PURE__ */ jsxs("span", { className: ts.slaHint, children: [
|
|
508
|
-
"minutes
|
|
514
|
+
t("settingsView.minutes"),
|
|
515
|
+
" (",
|
|
509
516
|
Math.floor(settings.sla.firstResponseMinutes / 60),
|
|
510
517
|
"h",
|
|
511
518
|
String(settings.sla.firstResponseMinutes % 60).padStart(2, "0"),
|
|
512
519
|
")"
|
|
513
520
|
] })
|
|
514
521
|
] }) }),
|
|
515
|
-
/* @__PURE__ */ jsx(FieldRow, { label: "
|
|
522
|
+
/* @__PURE__ */ jsx(FieldRow, { label: t("settingsView.slaResolution"), description: t("settingsView.slaResolutionDesc"), children: /* @__PURE__ */ jsxs("div", { className: ts.slaInline, children: [
|
|
516
523
|
/* @__PURE__ */ jsx(
|
|
517
524
|
"input",
|
|
518
525
|
{
|
|
@@ -524,7 +531,8 @@ const TicketingSettingsClient = () => {
|
|
|
524
531
|
}
|
|
525
532
|
),
|
|
526
533
|
/* @__PURE__ */ jsxs("span", { className: ts.slaHint, children: [
|
|
527
|
-
"minutes
|
|
534
|
+
t("settingsView.minutes"),
|
|
535
|
+
" (",
|
|
528
536
|
Math.floor(settings.sla.resolutionMinutes / 60),
|
|
529
537
|
"h",
|
|
530
538
|
String(settings.sla.resolutionMinutes % 60).padStart(2, "0"),
|
|
@@ -542,12 +550,12 @@ const TicketingSettingsClient = () => {
|
|
|
542
550
|
}
|
|
543
551
|
),
|
|
544
552
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
545
|
-
/* @__PURE__ */ jsx("span", { className: ts.inlineLabel, children: "
|
|
546
|
-
/* @__PURE__ */ jsx("div", { className: ts.inlineDesc, children: "
|
|
553
|
+
/* @__PURE__ */ jsx("span", { className: ts.inlineLabel, children: t("settingsView.businessHoursOnly") }),
|
|
554
|
+
/* @__PURE__ */ jsx("div", { className: ts.inlineDesc, children: t("settingsView.businessHoursDesc") })
|
|
547
555
|
] })
|
|
548
556
|
] }),
|
|
549
557
|
/* @__PURE__ */ jsx("div", { className: ts.separator }),
|
|
550
|
-
/* @__PURE__ */ jsx(FieldRow, { label: "
|
|
558
|
+
/* @__PURE__ */ jsx(FieldRow, { label: t("settingsView.escalationEmail"), description: t("settingsView.escalationEmailDesc"), children: /* @__PURE__ */ jsx(
|
|
551
559
|
"input",
|
|
552
560
|
{
|
|
553
561
|
type: "email",
|
|
@@ -563,7 +571,7 @@ const TicketingSettingsClient = () => {
|
|
|
563
571
|
/* @__PURE__ */ jsxs(
|
|
564
572
|
CollapsibleSection,
|
|
565
573
|
{
|
|
566
|
-
title: "
|
|
574
|
+
title: t("settingsView.autoCloseTitle"),
|
|
567
575
|
icon: /* @__PURE__ */ jsx(Timer, { size: 16 }),
|
|
568
576
|
color: "#d97706",
|
|
569
577
|
defaultOpen: false,
|
|
@@ -572,7 +580,7 @@ const TicketingSettingsClient = () => {
|
|
|
572
580
|
"j"
|
|
573
581
|
] }) : /* @__PURE__ */ jsx("span", { className: ts.badge, style: { backgroundColor: "#e5e7eb", color: "#374151" }, children: "Off" }),
|
|
574
582
|
children: [
|
|
575
|
-
/* @__PURE__ */ jsx("p", { className: ts.sectionDescription, children: "
|
|
583
|
+
/* @__PURE__ */ jsx("p", { className: ts.sectionDescription, children: t("settingsView.autoCloseDescription") }),
|
|
576
584
|
/* @__PURE__ */ jsxs("div", { className: ts.toggleRow, style: { paddingBottom: 14 }, children: [
|
|
577
585
|
/* @__PURE__ */ jsx(
|
|
578
586
|
Toggle,
|
|
@@ -582,10 +590,10 @@ const TicketingSettingsClient = () => {
|
|
|
582
590
|
color: "#d97706"
|
|
583
591
|
}
|
|
584
592
|
),
|
|
585
|
-
/* @__PURE__ */ jsx("span", { className: ts.inlineLabel, children: "
|
|
593
|
+
/* @__PURE__ */ jsx("span", { className: ts.inlineLabel, children: t("settingsView.autoCloseEnable") })
|
|
586
594
|
] }),
|
|
587
595
|
settings.autoClose.enabled && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
588
|
-
/* @__PURE__ */ jsx(FieldRow, { label: "
|
|
596
|
+
/* @__PURE__ */ jsx(FieldRow, { label: t("settingsView.autoCloseDelay"), description: t("settingsView.autoCloseDelayDesc"), children: /* @__PURE__ */ jsxs("div", { className: ts.slaInline, children: [
|
|
589
597
|
/* @__PURE__ */ jsx(
|
|
590
598
|
"input",
|
|
591
599
|
{
|
|
@@ -597,9 +605,9 @@ const TicketingSettingsClient = () => {
|
|
|
597
605
|
className: ts.numberInput
|
|
598
606
|
}
|
|
599
607
|
),
|
|
600
|
-
/* @__PURE__ */ jsx("span", { className: ts.slaHint, children: "
|
|
608
|
+
/* @__PURE__ */ jsx("span", { className: ts.slaHint, children: t("settingsView.days") })
|
|
601
609
|
] }) }),
|
|
602
|
-
/* @__PURE__ */ jsx(FieldRow, { label: "
|
|
610
|
+
/* @__PURE__ */ jsx(FieldRow, { label: t("settingsView.autoCloseReminder"), description: t("settingsView.autoCloseReminderDesc"), children: /* @__PURE__ */ jsxs("div", { className: ts.slaInline, children: [
|
|
603
611
|
/* @__PURE__ */ jsx(
|
|
604
612
|
"input",
|
|
605
613
|
{
|
|
@@ -611,11 +619,7 @@ const TicketingSettingsClient = () => {
|
|
|
611
619
|
className: ts.numberInput
|
|
612
620
|
}
|
|
613
621
|
),
|
|
614
|
-
/* @__PURE__ */
|
|
615
|
-
"jours avant (rappel a J-",
|
|
616
|
-
settings.autoClose.reminderDaysBefore,
|
|
617
|
-
")"
|
|
618
|
-
] })
|
|
622
|
+
/* @__PURE__ */ jsx("span", { className: ts.slaHint, children: t("settingsView.autoCloseDaysBeforeReminder", { count: String(settings.autoClose.reminderDaysBefore) }) })
|
|
619
623
|
] }) })
|
|
620
624
|
] })
|
|
621
625
|
]
|
|
@@ -629,27 +633,27 @@ const TicketingSettingsClient = () => {
|
|
|
629
633
|
background: "linear-gradient(135deg, #dbeafe 0%, #ede9fe 100%)",
|
|
630
634
|
border: "1px solid #c7d2fe"
|
|
631
635
|
}, children: [
|
|
632
|
-
/* @__PURE__ */ jsx("div", { style: { fontWeight: 700, fontSize: 15, color: "#1e293b" }, children: "
|
|
633
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 13, color: "#64748b", marginTop: 2 }, children: "
|
|
636
|
+
/* @__PURE__ */ jsx("div", { style: { fontWeight: 700, fontSize: 15, color: "#1e293b" }, children: t("settingsView.myPreferences") }),
|
|
637
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 13, color: "#64748b", marginTop: 2 }, children: t("settingsView.myPreferencesDesc") })
|
|
634
638
|
] }),
|
|
635
639
|
/* @__PURE__ */ jsxs(
|
|
636
640
|
CollapsibleSection,
|
|
637
641
|
{
|
|
638
|
-
title: "
|
|
642
|
+
title: t("settingsView.localeTitle"),
|
|
639
643
|
icon: /* @__PURE__ */ jsx(Globe, { size: 16 }),
|
|
640
644
|
color: "#16a34a",
|
|
641
645
|
defaultOpen: false,
|
|
642
646
|
children: [
|
|
643
|
-
/* @__PURE__ */ jsx("p", { className: ts.sectionDescription, children: "
|
|
644
|
-
/* @__PURE__ */ jsx(FieldRow, { label: "
|
|
647
|
+
/* @__PURE__ */ jsx("p", { className: ts.sectionDescription, children: t("settingsView.localeDescription") }),
|
|
648
|
+
/* @__PURE__ */ jsx(FieldRow, { label: t("settingsView.language"), description: t("settingsView.languageDesc"), children: /* @__PURE__ */ jsxs(
|
|
645
649
|
"select",
|
|
646
650
|
{
|
|
647
651
|
value: settings.locale.language,
|
|
648
652
|
onChange: (e) => updateLocale("language", e.target.value),
|
|
649
653
|
className: ts.select,
|
|
650
654
|
children: [
|
|
651
|
-
/* @__PURE__ */ jsx("option", { value: "fr", children: "
|
|
652
|
-
/* @__PURE__ */ jsx("option", { value: "en", children: "
|
|
655
|
+
/* @__PURE__ */ jsx("option", { value: "fr", children: t("settingsView.french") }),
|
|
656
|
+
/* @__PURE__ */ jsx("option", { value: "en", children: t("settingsView.english") })
|
|
653
657
|
]
|
|
654
658
|
}
|
|
655
659
|
) })
|
|
@@ -659,12 +663,12 @@ const TicketingSettingsClient = () => {
|
|
|
659
663
|
/* @__PURE__ */ jsxs(
|
|
660
664
|
CollapsibleSection,
|
|
661
665
|
{
|
|
662
|
-
title: "
|
|
666
|
+
title: t("settingsView.signatureTitle"),
|
|
663
667
|
icon: /* @__PURE__ */ jsx(FileSignature, { size: 16 }),
|
|
664
668
|
color: "#6366f1",
|
|
665
669
|
defaultOpen: false,
|
|
666
670
|
children: [
|
|
667
|
-
/* @__PURE__ */ jsx("p", { className: ts.sectionDescription, children: "
|
|
671
|
+
/* @__PURE__ */ jsx("p", { className: ts.sectionDescription, children: t("settingsView.signatureDescription") }),
|
|
668
672
|
/* @__PURE__ */ jsx(
|
|
669
673
|
"textarea",
|
|
670
674
|
{
|
|
@@ -673,7 +677,7 @@ const TicketingSettingsClient = () => {
|
|
|
673
677
|
setSignature(e.target.value);
|
|
674
678
|
setSaved(false);
|
|
675
679
|
},
|
|
676
|
-
placeholder: "
|
|
680
|
+
placeholder: t("settingsView.signaturePlaceholder"),
|
|
677
681
|
rows: 6,
|
|
678
682
|
className: ts.signatureTextarea
|
|
679
683
|
}
|
|
@@ -681,28 +685,28 @@ const TicketingSettingsClient = () => {
|
|
|
681
685
|
]
|
|
682
686
|
}
|
|
683
687
|
),
|
|
684
|
-
/* @__PURE__ */ jsxs(CollapsibleSection, { title: "
|
|
685
|
-
/* @__PURE__ */ jsx("p", { className: ts.sectionDescription, children: "
|
|
688
|
+
/* @__PURE__ */ jsxs(CollapsibleSection, { title: t("settingsView.purgeTitle"), icon: /* @__PURE__ */ jsx(Settings, { size: 18 }), color: "#ef4444", defaultOpen: false, children: [
|
|
689
|
+
/* @__PURE__ */ jsx("p", { className: ts.sectionDescription, children: t("settingsView.purgeDescription") }),
|
|
686
690
|
/* @__PURE__ */ jsx("div", { className: ts.purgeGroup, children: ["email-logs", "auth-logs"].map((col) => /* @__PURE__ */ jsxs("div", { className: ts.purgeCategory, children: [
|
|
687
|
-
/* @__PURE__ */ jsx("span", { className: ts.purgeCategoryLabel, children: col === "email-logs" ? "
|
|
691
|
+
/* @__PURE__ */ jsx("span", { className: ts.purgeCategoryLabel, children: col === "email-logs" ? t("settingsView.purgeEmailLogs") : t("settingsView.purgeAuthLogs") }),
|
|
688
692
|
/* @__PURE__ */ jsx("div", { className: ts.purgeButtons, children: [
|
|
689
|
-
{ label: "
|
|
690
|
-
{ label: "
|
|
691
|
-
{ label: "
|
|
692
|
-
{ label: "
|
|
693
|
+
{ label: t("settingsView.purge7days"), days: 7 },
|
|
694
|
+
{ label: t("settingsView.purge30days"), days: 30 },
|
|
695
|
+
{ label: t("settingsView.purge90days"), days: 90 },
|
|
696
|
+
{ label: t("settingsView.purgeAllLabel"), days: 0 }
|
|
693
697
|
].map((opt) => /* @__PURE__ */ jsx(
|
|
694
698
|
"button",
|
|
695
699
|
{
|
|
696
700
|
onClick: async () => {
|
|
697
|
-
if (!window.confirm(
|
|
701
|
+
if (!window.confirm(t("settingsView.purgeConfirm", { collection: col, days: opt.days === 0 ? t("settingsView.purgeAllLabel") : String(opt.days) }))) return;
|
|
698
702
|
try {
|
|
699
703
|
const res = await fetch(`/api/support/purge-logs?collection=${col}&days=${opt.days}`, { method: "DELETE", credentials: "include" });
|
|
700
704
|
if (res.ok) {
|
|
701
705
|
const d = await res.json();
|
|
702
|
-
alert(`${d.purged}
|
|
706
|
+
alert(`${d.purged} ${t("settingsView.purgeDone")}`);
|
|
703
707
|
}
|
|
704
708
|
} catch {
|
|
705
|
-
alert("
|
|
709
|
+
alert(t("import.errorTitle"));
|
|
706
710
|
}
|
|
707
711
|
},
|
|
708
712
|
style: { ...btnStyle(opt.days === 0 ? "#ef4444" : "var(--theme-elevation-500)", { small: true }), fontSize: 11 },
|
|
@@ -713,14 +717,14 @@ const TicketingSettingsClient = () => {
|
|
|
713
717
|
] }, col)) })
|
|
714
718
|
] }),
|
|
715
719
|
/* @__PURE__ */ jsxs("div", { className: ts.bottomBar, children: [
|
|
716
|
-
/* @__PURE__ */ jsx("button", { onClick: handleReset, style: btnStyle("var(--theme-elevation-400)", { small: true }), children: "
|
|
720
|
+
/* @__PURE__ */ jsx("button", { onClick: handleReset, style: btnStyle("var(--theme-elevation-400)", { small: true }), children: t("settingsView.resetAll") }),
|
|
717
721
|
/* @__PURE__ */ jsx(
|
|
718
722
|
"button",
|
|
719
723
|
{
|
|
720
724
|
onClick: handleSave,
|
|
721
725
|
disabled: saving,
|
|
722
726
|
style: btnStyle(saved ? V.green : V.blue, { small: true }),
|
|
723
|
-
children: saving ? "
|
|
727
|
+
children: saving ? t("settingsView.saving") : saved ? t("settingsView.saved2") : t("settingsView.saveChanges")
|
|
724
728
|
}
|
|
725
729
|
)
|
|
726
730
|
] })
|
|
@@ -65,14 +65,14 @@ const TimeDashboardClient = () => {
|
|
|
65
65
|
for (const entry of entries) {
|
|
66
66
|
let key;
|
|
67
67
|
if (groupBy === "day") {
|
|
68
|
-
key = entry.date ? entry.date.split("T")[0] : "
|
|
68
|
+
key = entry.date ? entry.date.split("T")[0] : t("timeDashboard.noDate");
|
|
69
69
|
} else if (groupBy === "week") {
|
|
70
70
|
const d = new Date(entry.date);
|
|
71
71
|
key = `Semaine ${getWeekNumber(d)} (${MONTHS_FR[d.getMonth()]} ${d.getFullYear()})`;
|
|
72
72
|
} else {
|
|
73
73
|
const ticket = typeof entry.ticket === "object" ? entry.ticket : null;
|
|
74
74
|
const project = ticket && typeof ticket.project === "object" ? ticket.project : null;
|
|
75
|
-
key = project?.name || "
|
|
75
|
+
key = project?.name || t("billing.noProject");
|
|
76
76
|
}
|
|
77
77
|
if (!map.has(key)) map.set(key, []);
|
|
78
78
|
map.get(key).push(entry);
|
|
@@ -59,14 +59,14 @@ const TimeDashboardClient = () => {
|
|
|
59
59
|
for (const entry of entries) {
|
|
60
60
|
let key;
|
|
61
61
|
if (groupBy === "day") {
|
|
62
|
-
key = entry.date ? entry.date.split("T")[0] : "
|
|
62
|
+
key = entry.date ? entry.date.split("T")[0] : t("timeDashboard.noDate");
|
|
63
63
|
} else if (groupBy === "week") {
|
|
64
64
|
const d = new Date(entry.date);
|
|
65
65
|
key = `Semaine ${getWeekNumber(d)} (${MONTHS_FR[d.getMonth()]} ${d.getFullYear()})`;
|
|
66
66
|
} else {
|
|
67
67
|
const ticket = typeof entry.ticket === "object" ? entry.ticket : null;
|
|
68
68
|
const project = ticket && typeof ticket.project === "object" ? ticket.project : null;
|
|
69
|
-
key = project?.name || "
|
|
69
|
+
key = project?.name || t("billing.noProject");
|
|
70
70
|
}
|
|
71
71
|
if (!map.has(key)) map.set(key, []);
|
|
72
72
|
map.get(key).push(entry);
|
|
@@ -1,30 +1,41 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var useTranslation = require('../../components/TicketConversation/hooks/useTranslation');
|
|
4
5
|
var s = require('./StatusPill.module.scss');
|
|
5
6
|
|
|
6
7
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
8
|
|
|
8
9
|
var s__default = /*#__PURE__*/_interopDefault(s);
|
|
9
10
|
|
|
10
|
-
const
|
|
11
|
-
open:
|
|
12
|
-
pending:
|
|
13
|
-
waiting_client:
|
|
14
|
-
resolved:
|
|
15
|
-
closed:
|
|
16
|
-
escalated:
|
|
17
|
-
"sla-breach":
|
|
11
|
+
const VARIANT_CLS = {
|
|
12
|
+
open: s__default.default.open,
|
|
13
|
+
pending: s__default.default.pending,
|
|
14
|
+
waiting_client: s__default.default.pending,
|
|
15
|
+
resolved: s__default.default.resolved,
|
|
16
|
+
closed: s__default.default.neutral,
|
|
17
|
+
escalated: s__default.default.escalated,
|
|
18
|
+
"sla-breach": s__default.default.breach
|
|
19
|
+
};
|
|
20
|
+
const STATUS_I18N_KEY = {
|
|
21
|
+
open: "ticket.status.open",
|
|
22
|
+
pending: "ticket.status.pending",
|
|
23
|
+
waiting_client: "ticket.status.waitingClient",
|
|
24
|
+
resolved: "ticket.status.resolved",
|
|
25
|
+
closed: "ticket.status.closed",
|
|
26
|
+
escalated: "ticket.status.escalated",
|
|
27
|
+
"sla-breach": "ticket.status.slaBreached"
|
|
18
28
|
};
|
|
19
29
|
const StatusPill = ({ status, label, className }) => {
|
|
20
|
-
const
|
|
21
|
-
const
|
|
30
|
+
const { t } = useTranslation.useTranslation();
|
|
31
|
+
const cls = VARIANT_CLS[status] || VARIANT_CLS.open;
|
|
32
|
+
const text = label ?? (STATUS_I18N_KEY[status] ? t(STATUS_I18N_KEY[status]) : status);
|
|
22
33
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
23
34
|
"span",
|
|
24
35
|
{
|
|
25
|
-
className: [s__default.default.pill,
|
|
36
|
+
className: [s__default.default.pill, cls, className].filter(Boolean).join(" "),
|
|
26
37
|
role: "status",
|
|
27
|
-
"aria-label":
|
|
38
|
+
"aria-label": `${t("ticket.status.label")} : ${text}`,
|
|
28
39
|
children: [
|
|
29
40
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: s__default.default.dot, "aria-hidden": true }),
|
|
30
41
|
text
|
|
@@ -1,24 +1,35 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useTranslation } from '../../components/TicketConversation/hooks/useTranslation.js';
|
|
2
3
|
import s from './StatusPill.module.scss';
|
|
3
4
|
|
|
4
|
-
const
|
|
5
|
-
open:
|
|
6
|
-
pending:
|
|
7
|
-
waiting_client:
|
|
8
|
-
resolved:
|
|
9
|
-
closed:
|
|
10
|
-
escalated:
|
|
11
|
-
"sla-breach":
|
|
5
|
+
const VARIANT_CLS = {
|
|
6
|
+
open: s.open,
|
|
7
|
+
pending: s.pending,
|
|
8
|
+
waiting_client: s.pending,
|
|
9
|
+
resolved: s.resolved,
|
|
10
|
+
closed: s.neutral,
|
|
11
|
+
escalated: s.escalated,
|
|
12
|
+
"sla-breach": s.breach
|
|
13
|
+
};
|
|
14
|
+
const STATUS_I18N_KEY = {
|
|
15
|
+
open: "ticket.status.open",
|
|
16
|
+
pending: "ticket.status.pending",
|
|
17
|
+
waiting_client: "ticket.status.waitingClient",
|
|
18
|
+
resolved: "ticket.status.resolved",
|
|
19
|
+
closed: "ticket.status.closed",
|
|
20
|
+
escalated: "ticket.status.escalated",
|
|
21
|
+
"sla-breach": "ticket.status.slaBreached"
|
|
12
22
|
};
|
|
13
23
|
const StatusPill = ({ status, label, className }) => {
|
|
14
|
-
const
|
|
15
|
-
const
|
|
24
|
+
const { t } = useTranslation();
|
|
25
|
+
const cls = VARIANT_CLS[status] || VARIANT_CLS.open;
|
|
26
|
+
const text = label ?? (STATUS_I18N_KEY[status] ? t(STATUS_I18N_KEY[status]) : status);
|
|
16
27
|
return /* @__PURE__ */ jsxs(
|
|
17
28
|
"span",
|
|
18
29
|
{
|
|
19
|
-
className: [s.pill,
|
|
30
|
+
className: [s.pill, cls, className].filter(Boolean).join(" "),
|
|
20
31
|
role: "status",
|
|
21
|
-
"aria-label":
|
|
32
|
+
"aria-label": `${t("ticket.status.label")} : ${text}`,
|
|
22
33
|
children: [
|
|
23
34
|
/* @__PURE__ */ jsx("span", { className: s.dot, "aria-hidden": true }),
|
|
24
35
|
text
|