@burdenoff/microfe-support 2026.601.1 → 2026.624.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/support/components/PageLayout.js +8 -8
  2. package/dist/support/components/PageLayout.js.map +1 -1
  3. package/dist/support/components/analytics/CategoryBreakdown.js +2 -2
  4. package/dist/support/components/analytics/CategoryBreakdown.js.map +1 -1
  5. package/dist/support/components/analytics/PriorityBreakdown.js +1 -1
  6. package/dist/support/components/analytics/PriorityBreakdown.js.map +1 -1
  7. package/dist/support/components/analytics/SLAReport.js +5 -5
  8. package/dist/support/components/analytics/SLAReport.js.map +1 -1
  9. package/dist/support/components/analytics/SatisfactionDistribution.js +6 -6
  10. package/dist/support/components/analytics/SatisfactionDistribution.js.map +1 -1
  11. package/dist/support/components/analytics/TopAgents.js +3 -3
  12. package/dist/support/components/analytics/TopAgents.js.map +1 -1
  13. package/dist/support/components/analytics/TrendChart.js +2 -2
  14. package/dist/support/components/analytics/TrendChart.js.map +1 -1
  15. package/dist/support/components/kb/ArticleForm.js +23 -23
  16. package/dist/support/components/kb/ArticleForm.js.map +1 -1
  17. package/dist/support/components/settings/CannedResponsesSettings.js +10 -10
  18. package/dist/support/components/settings/CannedResponsesSettings.js.map +1 -1
  19. package/dist/support/components/settings/SLAPoliciesSettings.js +10 -10
  20. package/dist/support/components/settings/SLAPoliciesSettings.js.map +1 -1
  21. package/dist/support/components/settings/TicketCategoriesSettings.js +37 -37
  22. package/dist/support/components/settings/TicketCategoriesSettings.js.map +1 -1
  23. package/dist/support/components/tickets/AttachmentList.js +4 -4
  24. package/dist/support/components/tickets/AttachmentList.js.map +1 -1
  25. package/dist/support/components/tickets/MessageComposer.js +12 -12
  26. package/dist/support/components/tickets/MessageComposer.js.map +1 -1
  27. package/dist/support/components/tickets/MessageThread.js +6 -6
  28. package/dist/support/components/tickets/MessageThread.js.map +1 -1
  29. package/dist/support/components/tickets/TicketDetailHeader.js +4 -4
  30. package/dist/support/components/tickets/TicketDetailHeader.js.map +1 -1
  31. package/dist/support/components/tickets/TicketHeader.js +6 -6
  32. package/dist/support/components/tickets/TicketHeader.js.map +1 -1
  33. package/dist/support/components/tickets/TicketSidebar.js +44 -44
  34. package/dist/support/components/tickets/TicketSidebar.js.map +1 -1
  35. package/dist/support/pages/AnalyticsPage.js +2 -2
  36. package/dist/support/pages/AnalyticsPage.js.map +1 -1
  37. package/dist/support/pages/ArticleDetailAdminPage.js +11 -11
  38. package/dist/support/pages/ArticleDetailAdminPage.js.map +1 -1
  39. package/dist/support/pages/ArticleDetailUserPage.js +7 -7
  40. package/dist/support/pages/ArticleDetailUserPage.js.map +1 -1
  41. package/dist/support/pages/ContactInquiriesPage.js +5 -5
  42. package/dist/support/pages/ContactInquiriesPage.js.map +1 -1
  43. package/dist/support/pages/ContactInquiryDetailPage.js +2 -2
  44. package/dist/support/pages/ContactInquiryDetailPage.js.map +1 -1
  45. package/dist/support/pages/CreateArticlePage.js +4 -4
  46. package/dist/support/pages/CreateArticlePage.js.map +1 -1
  47. package/dist/support/pages/CreateTicketPage.js +18 -18
  48. package/dist/support/pages/CreateTicketPage.js.map +1 -1
  49. package/dist/support/pages/EditArticlePage.js +5 -5
  50. package/dist/support/pages/EditArticlePage.js.map +1 -1
  51. package/dist/support/pages/JobApplicationsPage.js +5 -5
  52. package/dist/support/pages/JobApplicationsPage.js.map +1 -1
  53. package/dist/support/pages/KnowledgeBaseAdminPage.js +16 -16
  54. package/dist/support/pages/KnowledgeBaseAdminPage.js.map +1 -1
  55. package/dist/support/pages/KnowledgeBaseUserPage.js +15 -15
  56. package/dist/support/pages/KnowledgeBaseUserPage.js.map +1 -1
  57. package/dist/support/pages/SettingsPage.js +3 -3
  58. package/dist/support/pages/SettingsPage.js.map +1 -1
  59. package/dist/support/pages/TicketDetailAdminPage.js +8 -8
  60. package/dist/support/pages/TicketDetailAdminPage.js.map +1 -1
  61. package/dist/support/pages/TicketDetailUserPage.js +17 -17
  62. package/dist/support/pages/TicketDetailUserPage.js.map +1 -1
  63. package/dist/support/pages/TicketListPage.js +18 -18
  64. package/dist/support/pages/TicketListPage.js.map +1 -1
  65. package/dist/support/utils/categoryColors.js +1 -1
  66. package/dist/support/utils/categoryColors.js.map +1 -1
  67. package/dist/support/utils/uiTokens.js +1 -1
  68. package/dist/support/utils/uiTokens.js.map +1 -1
  69. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CreateTicketPage.js","names":[],"sources":["../../../src/support/pages/CreateTicketPage.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { ArrowLeft, Loader2, Plus, Paperclip } from 'lucide-react';\nimport { Button, Input } from '../components/ui';\nimport { useTicketOperations } from '../hooks/useTicketOperations';\nimport { useGetTicketCategoriesQuery } from '../../generated/global-operations';\nimport { useNotification } from '../hooks/useNotification';\nimport { PageLayout } from '../components/PageLayout';\nimport { NotificationToast } from '../components/NotificationToast';\nimport { useSupport } from '../providers/SupportProvider';\nimport { joinPath } from '../utils';\nimport { extractErrorMessage } from '../utils/errors';\nimport {\n SUPPORT_ATTACHMENT_ACCEPT,\n partitionAttachments,\n rejectedAttachmentsMessage,\n} from '../utils/attachments';\nimport { uploadSupportAttachmentFiles } from '../utils/supportFiles';\nimport { ATTACHMENTS_FAILED_PARAM } from '../constants';\nimport { SupportTicketPriority, type CreateSupportTicketInput } from '../../generated/global-types';\n\n/**\n * Client-side minimum lengths. Keep these in lockstep with the server-side\n * validators in global-support-svc/src/modules/support/utils/validation.ts —\n * when the server tightens or loosens these, update them here too. These are\n * best-effort UX hints only; the server's validation error is authoritative\n * and surfaces through `extractErrorMessage` on the catch path.\n */\nconst MIN_SUBJECT_LENGTH = 5;\nconst MIN_DESCRIPTION_LENGTH = 10;\n\nexport function CreateTicketPage() {\n const navigate = useNavigate();\n const { basePath = '' } = useSupport();\n const { createTicket, createTicketLoading, updateTicket } = useTicketOperations();\n const { data: categoriesData, loading: categoriesLoading } = useGetTicketCategoriesQuery({\n variables: {\n filter: { isActive: true },\n limit: 100,\n offset: 0,\n },\n });\n const activeCategories = [...(categoriesData?.ticketCategories?.nodes ?? [])].sort(\n (first, second) => first.displayOrder - second.displayOrder\n );\n const [formData, setFormData] = useState<CreateSupportTicketInput>({\n subject: '',\n description: '',\n priority: SupportTicketPriority.Normal,\n categoryId: undefined,\n });\n const [attachedFiles, setAttachedFiles] = useState<File[]>([]);\n const [uploadingFileName, setUploadingFileName] = useState<string | null>(null);\n const { notification, notify: showNotification } = useNotification();\n\n // Track the post-success navigate timer so unmounting mid-flight (Cancel\n // / back button / fast subsequent create) doesn't fire a delayed navigate.\n const navigateTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const clearNavigateTimeout = (): void => {\n if (navigateTimeoutRef.current) {\n clearTimeout(navigateTimeoutRef.current);\n navigateTimeoutRef.current = null;\n }\n };\n\n useEffect(() => clearNavigateTimeout, []);\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n\n if (formData.subject.trim().length < MIN_SUBJECT_LENGTH) {\n showNotification('error', `Subject must be at least ${MIN_SUBJECT_LENGTH} characters long.`);\n return;\n }\n if ((formData.description ?? '').trim().length < MIN_DESCRIPTION_LENGTH) {\n showNotification(\n 'error',\n `Description must be at least ${MIN_DESCRIPTION_LENGTH} characters long.`\n );\n return;\n }\n\n try {\n const ticket = await createTicket({\n ...formData,\n priority: formData.priority ?? undefined,\n categoryId: formData.categoryId ?? undefined,\n });\n if (!ticket) {\n return;\n }\n\n if (attachedFiles.length > 0) {\n try {\n const uploadResult = await uploadSupportAttachmentFiles({\n ticketId: ticket.id,\n files: attachedFiles,\n onFileProgress: (fileName, progress) => {\n if (progress < 100) {\n setUploadingFileName(fileName);\n }\n },\n });\n\n await updateTicket(ticket.id, {\n metadata: {\n initialAttachmentIds: uploadResult.files.map((file) => file.id),\n },\n });\n setUploadingFileName(null);\n setAttachedFiles([]);\n } catch (uploadError) {\n setUploadingFileName(null);\n // Carry only a code-level flag in the URL — never the raw backend\n // error. Query strings persist in browser history, referer, proxy\n // logs, and analytics; a verbose server error (e.g. an S3 key, a\n // tenant id, a stack line) landing there is an information leak.\n // The destination page composes the user-facing message entirely\n // client-side via useAttachmentsFailedToast.\n console.error('[support] create ticket: attachments failed', uploadError);\n const nextParams = new URLSearchParams({\n [ATTACHMENTS_FAILED_PARAM]: '1',\n });\n navigate(joinPath(basePath, `tickets/${ticket.id}?${nextParams.toString()}`));\n return;\n }\n }\n\n showNotification('success', 'Ticket created successfully!');\n clearNavigateTimeout();\n navigateTimeoutRef.current = setTimeout(() => {\n navigate(joinPath(basePath, `tickets/${ticket.id}`));\n navigateTimeoutRef.current = null;\n }, 1000);\n } catch (error) {\n // Prefer the server error message when available — client-side\n // validation (`MIN_SUBJECT_LENGTH` etc.) is best-effort; the server\n // is authoritative and its message is what should reach the user\n // if we reached the `createTicket` call and it rejected.\n const message = extractErrorMessage(error, 'Failed to create ticket. Please try again.');\n showNotification('error', message, 5000);\n }\n };\n\n const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const files = Array.from(event.target.files || []);\n const { accepted, rejected } = partitionAttachments(files);\n if (accepted.length > 0) {\n setAttachedFiles((current) => [...current, ...accepted]);\n }\n if (rejected.length > 0) {\n showNotification('error', rejectedAttachmentsMessage(rejected), 6000);\n }\n event.target.value = '';\n };\n\n const removeAttachedFile = (fileIndex: number) => {\n setAttachedFiles((current) => current.filter((_, index) => index !== fileIndex));\n };\n\n return (\n <PageLayout showHeader={false}>\n <NotificationToast notification={notification} />\n\n {/* Header */}\n <div className=\"flex items-center gap-4 mb-6\">\n <Button variant=\"ghost\" size=\"sm\" onClick={() => navigate('..')} className=\"p-2\">\n <ArrowLeft size={20} />\n </Button>\n <div>\n <h1 className=\"text-2xl font-bold text-foreground\">Create New Ticket</h1>\n <p className=\"text-sm text-muted-foreground\">Submit a new support request</p>\n </div>\n </div>\n\n {/* Form */}\n <div className=\"max-w-2xl\">\n <form onSubmit={handleSubmit} className=\"space-y-6\">\n <div className=\"p-6 rounded-xl border bg-card space-y-6\">\n <div>\n <label\n htmlFor=\"support-ticket-subject\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Subject <span className=\"text-destructive\">*</span>\n </label>\n <Input\n id=\"support-ticket-subject\"\n data-tour=\"support-ticket-subject\"\n type=\"text\"\n required\n value={formData.subject}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) =>\n setFormData({ ...formData, subject: e.target.value })\n }\n placeholder=\"Brief description of your issue\"\n />\n </div>\n\n <div>\n <label\n htmlFor=\"support-ticket-description\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Description <span className=\"text-destructive\">*</span>\n </label>\n <textarea\n id=\"support-ticket-description\"\n data-tour=\"support-ticket-description\"\n aria-label=\"Description\"\n required\n rows={6}\n value={formData.description || ''}\n onChange={(e) => setFormData({ ...formData, description: e.target.value })}\n className=\"w-full px-4 py-3 rounded-lg border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors\"\n placeholder=\"Provide detailed information about your issue\"\n />\n <p className=\"mt-2 text-xs text-muted-foreground\">\n Markdown is supported, including fenced code blocks.\n </p>\n </div>\n\n <div>\n <label\n htmlFor=\"support-ticket-priority\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Priority\n </label>\n <select\n id=\"support-ticket-priority\"\n data-tour=\"support-ticket-priority\"\n value={formData.priority || 'NORMAL'}\n onChange={(e) =>\n setFormData({ ...formData, priority: e.target.value as SupportTicketPriority })\n }\n className=\"w-full px-4 py-3 rounded-lg border bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors\"\n >\n <option value=\"LOW\">Low - General question or minor issue</option>\n <option value=\"NORMAL\">Normal - Standard support request</option>\n <option value=\"HIGH\">High - Significant impact on work</option>\n <option value=\"CRITICAL\">Critical - Complete blocker, urgent</option>\n </select>\n </div>\n\n <div>\n <label\n htmlFor=\"support-ticket-category\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Category\n </label>\n <select\n id=\"support-ticket-category\"\n data-tour=\"support-ticket-category\"\n value={formData.categoryId || ''}\n onChange={(e) =>\n setFormData({\n ...formData,\n categoryId: e.target.value || undefined,\n })\n }\n className=\"w-full px-4 py-3 rounded-lg border bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors\"\n >\n <option value=\"\">\n {categoriesLoading ? 'Loading categories...' : 'Select a category'}\n </option>\n {activeCategories.map((category) => (\n <option key={category.id} value={category.id}>\n {category.name}\n </option>\n ))}\n </select>\n </div>\n\n <div>\n <span\n id=\"create-ticket-attachments-heading\"\n className=\"mb-2 block text-sm font-medium text-foreground\"\n >\n Attachments\n </span>\n <label\n data-tour=\"support-ticket-attachments\"\n className=\"flex cursor-pointer items-center justify-center gap-2 rounded-lg border border-dashed border-border bg-muted/20 p-4 text-sm text-muted-foreground transition-colors hover:bg-muted/40\"\n >\n <Paperclip size={16} />\n <span>Attach files, screenshots, logs, or documents</span>\n <input\n type=\"file\"\n multiple\n aria-labelledby=\"create-ticket-attachments-heading\"\n className=\"hidden\"\n accept={SUPPORT_ATTACHMENT_ACCEPT}\n onChange={handleFileChange}\n />\n </label>\n\n {attachedFiles.length > 0 && (\n <div className=\"mt-3 flex flex-wrap gap-2\">\n {attachedFiles.map((file, index) => (\n <div\n key={`${file.name}-${index}`}\n className=\"flex items-center gap-2 rounded-lg border bg-background px-3 py-2 text-sm\"\n >\n <Paperclip size={14} />\n <span className=\"max-w-[240px] truncate\">{file.name}</span>\n <button\n type=\"button\"\n className=\"flex min-h-11 min-w-11 items-center justify-center rounded text-muted-foreground hover:text-foreground\"\n onClick={() => removeAttachedFile(index)}\n aria-label={`Remove attachment ${file.name}`}\n >\n ×\n </button>\n </div>\n ))}\n </div>\n )}\n\n {uploadingFileName && (\n <p className=\"mt-2 text-xs text-muted-foreground\">\n Uploading {uploadingFileName}...\n </p>\n )}\n </div>\n </div>\n\n <div className=\"flex flex-col gap-3 sm:flex-row\">\n <Button\n type=\"submit\"\n data-tour=\"support-ticket-submit\"\n disabled={createTicketLoading || !formData.subject || !formData.description}\n className=\"flex-1\"\n >\n {createTicketLoading ? (\n <>\n <Loader2 size={18} className=\"animate-spin\" />\n Creating…\n </>\n ) : (\n <>\n <Plus size={18} />\n Create Ticket\n </>\n )}\n </Button>\n <Button type=\"button\" variant=\"outline\" onClick={() => navigate('..')}>\n Cancel\n </Button>\n </div>\n </form>\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA4BA,IAAM,IAAqB,GACrB,IAAyB;AAE/B,SAAgB,IAAmB;CACjC,IAAM,IAAW,GAAa,EACxB,EAAE,cAAW,OAAO,GAAY,EAChC,EAAE,iBAAc,wBAAqB,oBAAiB,GAAqB,EAC3E,EAAE,MAAM,GAAgB,SAAS,MAAsB,EAA4B,EACvF,WAAW;EACT,QAAQ,EAAE,UAAU,IAAM;EAC1B,OAAO;EACP,QAAQ;EACT,EACF,CAAC,EACI,IAAmB,CAAC,GAAI,GAAgB,kBAAkB,SAAS,EAAE,CAAE,CAAC,MAC3E,GAAO,MAAW,EAAM,eAAe,EAAO,aAChD,EACK,CAAC,GAAU,KAAe,EAAmC;EACjE,SAAS;EACT,aAAa;EACb,UAAU,EAAsB;EAChC,YAAY,KAAA;EACb,CAAC,EACI,CAAC,GAAe,KAAoB,EAAiB,EAAE,CAAC,EACxD,CAAC,GAAmB,KAAwB,EAAwB,KAAK,EACzE,EAAE,iBAAc,QAAQ,MAAqB,GAAiB,EAI9D,IAAqB,EAA6C,KAAK,EACvE,UAAmC;AACvC,EAEE,EAAmB,aADnB,aAAa,EAAmB,QAAQ,EACX;;AAIjC,SAAgB,GAAsB,EAAE,CAAC;CAEzC,IAAM,IAAe,OAAO,MAAuB;AAGjD,MAFA,EAAE,gBAAgB,EAEd,EAAS,QAAQ,MAAM,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,CAAA,CACL;QACD;;IACH,CAAA;GACK"}
1
+ {"version":3,"file":"CreateTicketPage.js","names":[],"sources":["../../../src/support/pages/CreateTicketPage.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { ArrowLeft, Loader2, Plus, Paperclip } from 'lucide-react';\nimport { Button, Input } from '../components/ui';\nimport { useTicketOperations } from '../hooks/useTicketOperations';\nimport { useGetTicketCategoriesQuery } from '../../generated/global-operations';\nimport { useNotification } from '../hooks/useNotification';\nimport { PageLayout } from '../components/PageLayout';\nimport { NotificationToast } from '../components/NotificationToast';\nimport { useSupport } from '../providers/SupportProvider';\nimport { joinPath } from '../utils';\nimport { extractErrorMessage } from '../utils/errors';\nimport {\n SUPPORT_ATTACHMENT_ACCEPT,\n partitionAttachments,\n rejectedAttachmentsMessage,\n} from '../utils/attachments';\nimport { uploadSupportAttachmentFiles } from '../utils/supportFiles';\nimport { ATTACHMENTS_FAILED_PARAM } from '../constants';\nimport { SupportTicketPriority, type CreateSupportTicketInput } from '../../generated/global-types';\n\n/**\n * Client-side minimum lengths. Keep these in lockstep with the server-side\n * validators in global-support-svc/src/modules/support/utils/validation.ts —\n * when the server tightens or loosens these, update them here too. These are\n * best-effort UX hints only; the server's validation error is authoritative\n * and surfaces through `extractErrorMessage` on the catch path.\n */\nconst MIN_SUBJECT_LENGTH = 5;\nconst MIN_DESCRIPTION_LENGTH = 10;\n\nexport function CreateTicketPage() {\n const navigate = useNavigate();\n const { basePath = '' } = useSupport();\n const { createTicket, createTicketLoading, updateTicket } = useTicketOperations();\n const { data: categoriesData, loading: categoriesLoading } = useGetTicketCategoriesQuery({\n variables: {\n filter: { isActive: true },\n limit: 100,\n offset: 0,\n },\n });\n const activeCategories = [...(categoriesData?.ticketCategories?.nodes ?? [])].sort(\n (first, second) => first.displayOrder - second.displayOrder\n );\n const [formData, setFormData] = useState<CreateSupportTicketInput>({\n subject: '',\n description: '',\n priority: SupportTicketPriority.Normal,\n categoryId: undefined,\n });\n const [attachedFiles, setAttachedFiles] = useState<File[]>([]);\n const [uploadingFileName, setUploadingFileName] = useState<string | null>(null);\n const { notification, notify: showNotification } = useNotification();\n\n // Track the post-success navigate timer so unmounting mid-flight (Cancel\n // / back button / fast subsequent create) doesn't fire a delayed navigate.\n const navigateTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const clearNavigateTimeout = (): void => {\n if (navigateTimeoutRef.current) {\n clearTimeout(navigateTimeoutRef.current);\n navigateTimeoutRef.current = null;\n }\n };\n\n useEffect(() => clearNavigateTimeout, []);\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n\n if (formData.subject.trim().length < MIN_SUBJECT_LENGTH) {\n showNotification('error', `Subject must be at least ${MIN_SUBJECT_LENGTH} characters long.`);\n return;\n }\n if ((formData.description ?? '').trim().length < MIN_DESCRIPTION_LENGTH) {\n showNotification(\n 'error',\n `Description must be at least ${MIN_DESCRIPTION_LENGTH} characters long.`\n );\n return;\n }\n\n try {\n const ticket = await createTicket({\n ...formData,\n priority: formData.priority ?? undefined,\n categoryId: formData.categoryId ?? undefined,\n });\n if (!ticket) {\n return;\n }\n\n if (attachedFiles.length > 0) {\n try {\n const uploadResult = await uploadSupportAttachmentFiles({\n ticketId: ticket.id,\n files: attachedFiles,\n onFileProgress: (fileName, progress) => {\n if (progress < 100) {\n setUploadingFileName(fileName);\n }\n },\n });\n\n await updateTicket(ticket.id, {\n metadata: {\n initialAttachmentIds: uploadResult.files.map((file) => file.id),\n },\n });\n setUploadingFileName(null);\n setAttachedFiles([]);\n } catch (uploadError) {\n setUploadingFileName(null);\n // Carry only a code-level flag in the URL — never the raw backend\n // error. Query strings persist in browser history, referer, proxy\n // logs, and analytics; a verbose server error (e.g. an S3 key, a\n // tenant id, a stack line) landing there is an information leak.\n // The destination page composes the user-facing message entirely\n // client-side via useAttachmentsFailedToast.\n console.error('[support] create ticket: attachments failed', uploadError);\n const nextParams = new URLSearchParams({\n [ATTACHMENTS_FAILED_PARAM]: '1',\n });\n navigate(joinPath(basePath, `tickets/${ticket.id}?${nextParams.toString()}`));\n return;\n }\n }\n\n showNotification('success', 'Ticket created successfully!');\n clearNavigateTimeout();\n navigateTimeoutRef.current = setTimeout(() => {\n navigate(joinPath(basePath, `tickets/${ticket.id}`));\n navigateTimeoutRef.current = null;\n }, 1000);\n } catch (error) {\n // Prefer the server error message when available — client-side\n // validation (`MIN_SUBJECT_LENGTH` etc.) is best-effort; the server\n // is authoritative and its message is what should reach the user\n // if we reached the `createTicket` call and it rejected.\n const message = extractErrorMessage(error, 'Failed to create ticket. Please try again.');\n showNotification('error', message, 5000);\n }\n };\n\n const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const files = Array.from(event.target.files || []);\n const { accepted, rejected } = partitionAttachments(files);\n if (accepted.length > 0) {\n setAttachedFiles((current) => [...current, ...accepted]);\n }\n if (rejected.length > 0) {\n showNotification('error', rejectedAttachmentsMessage(rejected), 6000);\n }\n event.target.value = '';\n };\n\n const removeAttachedFile = (fileIndex: number) => {\n setAttachedFiles((current) => current.filter((_, index) => index !== fileIndex));\n };\n\n return (\n <PageLayout showHeader={false}>\n <NotificationToast notification={notification} />\n\n {/* Header */}\n <div className=\"flex items-center gap-4 mb-6\">\n <Button variant=\"ghost\" size=\"sm\" onClick={() => navigate('..')} className=\"p-2\">\n <ArrowLeft size={20} />\n </Button>\n <div>\n <h1 className=\"text-2xl font-bold text-text-primary\">Create New Ticket</h1>\n <p className=\"text-sm text-text-secondary\">Submit a new support request</p>\n </div>\n </div>\n\n {/* Form */}\n <div className=\"max-w-2xl\">\n <form onSubmit={handleSubmit} className=\"space-y-6\">\n <div className=\"p-6 rounded-xl border bg-bg-surface space-y-6\">\n <div>\n <label\n htmlFor=\"support-ticket-subject\"\n className=\"mb-2 block text-sm font-medium text-text-primary\"\n >\n Subject <span className=\"text-status-error-text\">*</span>\n </label>\n <Input\n id=\"support-ticket-subject\"\n data-tour=\"support-ticket-subject\"\n type=\"text\"\n required\n value={formData.subject}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) =>\n setFormData({ ...formData, subject: e.target.value })\n }\n placeholder=\"Brief description of your issue\"\n />\n </div>\n\n <div>\n <label\n htmlFor=\"support-ticket-description\"\n className=\"mb-2 block text-sm font-medium text-text-primary\"\n >\n Description <span className=\"text-status-error-text\">*</span>\n </label>\n <textarea\n id=\"support-ticket-description\"\n data-tour=\"support-ticket-description\"\n aria-label=\"Description\"\n required\n rows={6}\n value={formData.description || ''}\n onChange={(e) => setFormData({ ...formData, description: e.target.value })}\n className=\"w-full px-4 py-3 rounded-lg border bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors\"\n placeholder=\"Provide detailed information about your issue\"\n />\n <p className=\"mt-2 text-xs text-text-secondary\">\n Markdown is supported, including fenced code blocks.\n </p>\n </div>\n\n <div>\n <label\n htmlFor=\"support-ticket-priority\"\n className=\"mb-2 block text-sm font-medium text-text-primary\"\n >\n Priority\n </label>\n <select\n id=\"support-ticket-priority\"\n data-tour=\"support-ticket-priority\"\n value={formData.priority || 'NORMAL'}\n onChange={(e) =>\n setFormData({ ...formData, priority: e.target.value as SupportTicketPriority })\n }\n className=\"w-full px-4 py-3 rounded-lg border bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors\"\n >\n <option value=\"LOW\">Low - General question or minor issue</option>\n <option value=\"NORMAL\">Normal - Standard support request</option>\n <option value=\"HIGH\">High - Significant impact on work</option>\n <option value=\"CRITICAL\">Critical - Complete blocker, urgent</option>\n </select>\n </div>\n\n <div>\n <label\n htmlFor=\"support-ticket-category\"\n className=\"mb-2 block text-sm font-medium text-text-primary\"\n >\n Category\n </label>\n <select\n id=\"support-ticket-category\"\n data-tour=\"support-ticket-category\"\n value={formData.categoryId || ''}\n onChange={(e) =>\n setFormData({\n ...formData,\n categoryId: e.target.value || undefined,\n })\n }\n className=\"w-full px-4 py-3 rounded-lg border bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors\"\n >\n <option value=\"\">\n {categoriesLoading ? 'Loading categories...' : 'Select a category'}\n </option>\n {activeCategories.map((category) => (\n <option key={category.id} value={category.id}>\n {category.name}\n </option>\n ))}\n </select>\n </div>\n\n <div>\n <span\n id=\"create-ticket-attachments-heading\"\n className=\"mb-2 block text-sm font-medium text-text-primary\"\n >\n Attachments\n </span>\n <label\n data-tour=\"support-ticket-attachments\"\n className=\"flex cursor-pointer items-center justify-center gap-2 rounded-lg border border-dashed border-border-subtle bg-bg-sunken/20 p-4 text-sm text-text-secondary transition-colors hover:bg-bg-sunken/40\"\n >\n <Paperclip size={16} />\n <span>Attach files, screenshots, logs, or documents</span>\n <input\n type=\"file\"\n multiple\n aria-labelledby=\"create-ticket-attachments-heading\"\n className=\"hidden\"\n accept={SUPPORT_ATTACHMENT_ACCEPT}\n onChange={handleFileChange}\n />\n </label>\n\n {attachedFiles.length > 0 && (\n <div className=\"mt-3 flex flex-wrap gap-2\">\n {attachedFiles.map((file, index) => (\n <div\n key={`${file.name}-${index}`}\n className=\"flex items-center gap-2 rounded-lg border bg-bg-surface px-3 py-2 text-sm\"\n >\n <Paperclip size={14} />\n <span className=\"max-w-[240px] truncate\">{file.name}</span>\n <button\n type=\"button\"\n className=\"flex min-h-11 min-w-11 items-center justify-center rounded text-text-secondary hover:text-text-primary\"\n onClick={() => removeAttachedFile(index)}\n aria-label={`Remove attachment ${file.name}`}\n >\n ×\n </button>\n </div>\n ))}\n </div>\n )}\n\n {uploadingFileName && (\n <p className=\"mt-2 text-xs text-text-secondary\">\n Uploading {uploadingFileName}...\n </p>\n )}\n </div>\n </div>\n\n <div className=\"flex flex-col gap-3 sm:flex-row\">\n <Button\n type=\"submit\"\n data-tour=\"support-ticket-submit\"\n disabled={createTicketLoading || !formData.subject || !formData.description}\n className=\"flex-1\"\n >\n {createTicketLoading ? (\n <>\n <Loader2 size={18} className=\"animate-spin\" />\n Creating…\n </>\n ) : (\n <>\n <Plus size={18} />\n Create Ticket\n </>\n )}\n </Button>\n <Button type=\"button\" variant=\"outline\" onClick={() => navigate('..')}>\n Cancel\n </Button>\n </div>\n </form>\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA4BA,IAAM,IAAqB,GACrB,IAAyB;AAE/B,SAAgB,IAAmB;CACjC,IAAM,IAAW,GAAa,EACxB,EAAE,cAAW,OAAO,GAAY,EAChC,EAAE,iBAAc,wBAAqB,oBAAiB,GAAqB,EAC3E,EAAE,MAAM,GAAgB,SAAS,MAAsB,EAA4B,EACvF,WAAW;EACT,QAAQ,EAAE,UAAU,IAAM;EAC1B,OAAO;EACP,QAAQ;EACT,EACF,CAAC,EACI,IAAmB,CAAC,GAAI,GAAgB,kBAAkB,SAAS,EAAE,CAAE,CAAC,MAC3E,GAAO,MAAW,EAAM,eAAe,EAAO,aAChD,EACK,CAAC,GAAU,KAAe,EAAmC;EACjE,SAAS;EACT,aAAa;EACb,UAAU,EAAsB;EAChC,YAAY,KAAA;EACb,CAAC,EACI,CAAC,GAAe,KAAoB,EAAiB,EAAE,CAAC,EACxD,CAAC,GAAmB,KAAwB,EAAwB,KAAK,EACzE,EAAE,iBAAc,QAAQ,MAAqB,GAAiB,EAI9D,IAAqB,EAA6C,KAAK,EACvE,UAAmC;AACvC,EAEE,EAAmB,aADnB,aAAa,EAAmB,QAAQ,EACX;;AAIjC,SAAgB,GAAsB,EAAE,CAAC;CAEzC,IAAM,IAAe,OAAO,MAAuB;AAGjD,MAFA,EAAE,gBAAgB,EAEd,EAAS,QAAQ,MAAM,CAAC,SAAS,GAAoB;AACvD,KAAiB,SAAS,4BAA4B,EAAmB,mBAAmB;AAC5F;;AAEF,OAAK,EAAS,eAAe,IAAI,MAAM,CAAC,SAAS,GAAwB;AACvE,KACE,SACA,gCAAgC,EAAuB,mBACxD;AACD;;AAGF,MAAI;GACF,IA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CAAA;UAC1D,kBAAC,SAAD;WACE,MAAK;WACL,UAAA;WACA,mBAAgB;WAChB,WAAU;WACV,QAAQ;WACR,UAAU;WACV,CAAA;UACI;;QAEP,EAAc,SAAS,KACtB,kBAAC,OAAD;SAAK,WAAU;mBACZ,EAAc,KAAK,GAAM,MACxB,kBAAC,OAAD;UAEE,WAAU;oBAFZ;WAIE,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;WACvB,kBAAC,QAAD;YAAM,WAAU;sBAA0B,EAAK;YAAY,CAAA;WAC3D,kBAAC,UAAD;YACE,MAAK;YACL,WAAU;YACV,eAAe,EAAmB,EAAM;YACxC,cAAY,qBAAqB,EAAK;sBACvC;YAEQ,CAAA;WACL;YAbC,GAAG,EAAK,KAAK,GAAG,IAajB,CACN;SACE,CAAA;QAGP,KACC,kBAAC,KAAD;SAAG,WAAU;mBAAb;UAAgD;UACnC;UAAkB;UAC3B;;QAEF,EAAA,CAAA;OACF;SAEN,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,GAAD;OACE,MAAK;OACL,aAAU;OACV,UAAU,KAAuB,CAAC,EAAS,WAAW,CAAC,EAAS;OAChE,WAAU;iBAET,IACC,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;QAAS,MAAM;QAAI,WAAU;QAAiB,CAAA,EAAA,YAE7C,EAAA,CAAA,GAEH,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA,EAAA,gBAEjB,EAAA,CAAA;OAEE,CAAA,EACT,kBAAC,GAAD;OAAQ,MAAK;OAAS,SAAQ;OAAU,eAAe,EAAS,KAAK;iBAAE;OAE9D,CAAA,CACL;QACD;;IACH,CAAA;GACK"}
@@ -67,11 +67,11 @@ function b() {
67
67
  className: "text-center py-12",
68
68
  children: [
69
69
  /* @__PURE__ */ _("h2", {
70
- className: "text-xl font-semibold text-foreground mb-2",
70
+ className: "text-xl font-semibold text-text-primary mb-2",
71
71
  children: "Article not found"
72
72
  }),
73
73
  /* @__PURE__ */ _("p", {
74
- className: "text-muted-foreground mb-4",
74
+ className: "text-text-secondary mb-4",
75
75
  children: "The article you're trying to edit doesn't exist."
76
76
  }),
77
77
  /* @__PURE__ */ _(t, {
@@ -118,16 +118,16 @@ function b() {
118
118
  }), /* @__PURE__ */ v("div", {
119
119
  className: "flex items-center gap-3",
120
120
  children: [/* @__PURE__ */ _("div", {
121
- className: "p-2 rounded-lg bg-primary/10",
121
+ className: "p-2 rounded-lg bg-action-primary-bg/10",
122
122
  children: /* @__PURE__ */ _(p, {
123
123
  size: 24,
124
124
  className: "text-primary"
125
125
  })
126
126
  }), /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("h1", {
127
- className: "text-2xl font-bold text-foreground",
127
+ className: "text-2xl font-bold text-text-primary",
128
128
  children: "Edit Article"
129
129
  }), /* @__PURE__ */ _("p", {
130
- className: "text-sm text-muted-foreground",
130
+ className: "text-sm text-text-secondary",
131
131
  children: T.title
132
132
  })] })]
133
133
  })]
@@ -1 +1 @@
1
- {"version":3,"file":"EditArticlePage.js","names":[],"sources":["../../../src/support/pages/EditArticlePage.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport { useNavigate, useParams } from 'react-router-dom';\nimport { ArrowLeft, FileEdit, AlertCircle, CheckCircle, ShieldAlert } from 'lucide-react';\nimport { Button } from '../components/ui';\nimport { ArticleForm, type ArticleFormData } from '../components/kb/ArticleForm';\nimport { useKnowledgeBaseOperations } from '../hooks/useKnowledgeBaseOperations';\nimport { PageLayout, LoadingState, EmptyState } from '../components/PageLayout';\nimport { useSupport } from '../providers/SupportProvider';\nimport { ArticleStatus } from '../../generated/global-types';\n\n/**\n * Check if the current user has admin privileges.\n */\nfunction isUserAdmin(role?: string): boolean {\n if (!role) return false;\n const adminRoles = ['admin', 'super_admin', 'workspace_admin', 'owner'];\n return adminRoles.includes(role.toLowerCase());\n}\n\nexport function EditArticlePage() {\n const navigate = useNavigate();\n const { slug } = useParams<{ slug: string }>();\n const { basePath = '', currentUser } = useSupport();\n const isAdmin = isUserAdmin(currentUser?.role);\n const { articleDetail, articleLoading, categories, updateArticle, updatingArticle } =\n useKnowledgeBaseOperations(slug);\n\n const [notification, setNotification] = useState<{\n type: 'success' | 'error';\n message: string;\n } | null>(null);\n const navigateTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const notificationTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(() => {\n return () => {\n if (navigateTimerRef.current) clearTimeout(navigateTimerRef.current);\n if (notificationTimerRef.current) clearTimeout(notificationTimerRef.current);\n };\n }, []);\n\n const handleSubmit = async (data: ArticleFormData) => {\n if (!articleDetail?.id) return;\n\n try {\n await updateArticle(articleDetail.id, {\n title: data.title,\n slug: data.slug,\n content: data.content,\n excerpt: data.excerpt || undefined,\n categoryId: data.categoryId || undefined,\n tags: data.tags.length > 0 ? data.tags : undefined,\n metaDescription: data.metaDescription || undefined,\n status: data.status as ArticleStatus,\n });\n\n setNotification({ type: 'success', message: 'Article updated successfully!' });\n if (navigateTimerRef.current) clearTimeout(navigateTimerRef.current);\n navigateTimerRef.current = setTimeout(() => navigate(`../../${data.slug}`), 1000);\n } catch {\n setNotification({ type: 'error', message: 'Failed to update article. Please try again.' });\n if (notificationTimerRef.current) clearTimeout(notificationTimerRef.current);\n notificationTimerRef.current = setTimeout(() => setNotification(null), 3000);\n }\n };\n\n const handleCancel = () => {\n navigate('..');\n };\n\n // Non-admin users cannot edit articles\n if (!isAdmin) {\n return (\n <PageLayout showHeader={false}>\n <EmptyState\n icon={<ShieldAlert size={48} />}\n title=\"Admin Access Required\"\n description=\"You need administrator privileges to edit knowledge base articles.\"\n action={\n <Button onClick={() => navigate(`${basePath}/kb`)}>\n <ArrowLeft size={18} />\n Back to Knowledge Base\n </Button>\n }\n />\n </PageLayout>\n );\n }\n\n if (articleLoading) {\n return (\n <PageLayout showHeader={false}>\n <LoadingState message=\"Loading article...\" />\n </PageLayout>\n );\n }\n\n if (!articleDetail) {\n return (\n <PageLayout showHeader={false}>\n <div className=\"text-center py-12\">\n <h2 className=\"text-xl font-semibold text-foreground mb-2\">Article not found</h2>\n <p className=\"text-muted-foreground mb-4\">\n The article you&apos;re trying to edit doesn&apos;t exist.\n </p>\n <Button onClick={() => navigate('../../..')}>Back to Knowledge Base</Button>\n </div>\n </PageLayout>\n );\n }\n\n const initialData: Partial<ArticleFormData> = {\n title: articleDetail.title,\n slug: articleDetail.slug,\n content: articleDetail.content,\n excerpt: articleDetail.excerpt || '',\n categoryId: articleDetail.categoryId || '',\n tags: articleDetail.tags || [],\n metaDescription: '',\n status: articleDetail.status as 'DRAFT' | 'PUBLISHED',\n };\n\n return (\n <PageLayout showHeader={false}>\n {/* Notification */}\n {notification && (\n <div\n className={`fixed right-4 top-[calc(var(--header-height,4rem)+1rem)] z-[200] flex items-center gap-3 px-5 py-3 rounded-xl shadow-2xl border-2 animate-in slide-in-from-top-4 duration-300 ${\n notification.type === 'success'\n ? 'bg-success/10 text-success border-success/30'\n : 'bg-error/10 text-error border-error/30'\n }`}\n >\n {notification.type === 'success' ? (\n <CheckCircle size={20} className=\"text-success\" />\n ) : (\n <AlertCircle size={20} className=\"text-error\" />\n )}\n <span className=\"font-medium\">{notification.message}</span>\n </div>\n )}\n\n {/* Header */}\n <div className=\"flex items-center gap-4 mb-6\">\n <Button variant=\"ghost\" size=\"sm\" onClick={() => navigate('..')} className=\"p-2\">\n <ArrowLeft size={20} />\n </Button>\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2 rounded-lg bg-primary/10\">\n <FileEdit size={24} className=\"text-primary\" />\n </div>\n <div>\n <h1 className=\"text-2xl font-bold text-foreground\">Edit Article</h1>\n <p className=\"text-sm text-muted-foreground\">{articleDetail.title}</p>\n </div>\n </div>\n </div>\n\n {/* Form */}\n <div className=\"max-w-3xl\">\n <ArticleForm\n initialData={initialData}\n categories={categories}\n onSubmit={handleSubmit}\n onCancel={handleCancel}\n isSub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,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,GAAD;KAAQ,SAAQ;KAAQ,MAAK;KAAK,eAAe,EAAS,KAAK;KAAE,WAAU;eACzE,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;KAChB,CAAA,EACT,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,OAAD;MAAK,WAAU;gBACb,kBAAC,GAAD;OAAU,MAAM;OAAI,WAAU;OAAiB,CAAA;MAC3C,CAAA,EACN,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;MAAI,WAAU;gBAAqC;MAAiB,CAAA,EACpE,kBAAC,KAAD;MAAG,WAAU;gBAAiC,EAAc;MAAU,CAAA,CAClE,EAAA,CAAA,CACF;OACF;;GAGN,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,GAAD;KACe;KACD;KACZ,UAAU;KACV,UAAU;KACV,cAAc;KACd,aAAY;KACZ,CAAA;IACE,CAAA;GACK"}
1
+ {"version":3,"file":"EditArticlePage.js","names":[],"sources":["../../../src/support/pages/EditArticlePage.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport { useNavigate, useParams } from 'react-router-dom';\nimport { ArrowLeft, FileEdit, AlertCircle, CheckCircle, ShieldAlert } from 'lucide-react';\nimport { Button } from '../components/ui';\nimport { ArticleForm, type ArticleFormData } from '../components/kb/ArticleForm';\nimport { useKnowledgeBaseOperations } from '../hooks/useKnowledgeBaseOperations';\nimport { PageLayout, LoadingState, EmptyState } from '../components/PageLayout';\nimport { useSupport } from '../providers/SupportProvider';\nimport { ArticleStatus } from '../../generated/global-types';\n\n/**\n * Check if the current user has admin privileges.\n */\nfunction isUserAdmin(role?: string): boolean {\n if (!role) return false;\n const adminRoles = ['admin', 'super_admin', 'workspace_admin', 'owner'];\n return adminRoles.includes(role.toLowerCase());\n}\n\nexport function EditArticlePage() {\n const navigate = useNavigate();\n const { slug } = useParams<{ slug: string }>();\n const { basePath = '', currentUser } = useSupport();\n const isAdmin = isUserAdmin(currentUser?.role);\n const { articleDetail, articleLoading, categories, updateArticle, updatingArticle } =\n useKnowledgeBaseOperations(slug);\n\n const [notification, setNotification] = useState<{\n type: 'success' | 'error';\n message: string;\n } | null>(null);\n const navigateTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const notificationTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(() => {\n return () => {\n if (navigateTimerRef.current) clearTimeout(navigateTimerRef.current);\n if (notificationTimerRef.current) clearTimeout(notificationTimerRef.current);\n };\n }, []);\n\n const handleSubmit = async (data: ArticleFormData) => {\n if (!articleDetail?.id) return;\n\n try {\n await updateArticle(articleDetail.id, {\n title: data.title,\n slug: data.slug,\n content: data.content,\n excerpt: data.excerpt || undefined,\n categoryId: data.categoryId || undefined,\n tags: data.tags.length > 0 ? data.tags : undefined,\n metaDescription: data.metaDescription || undefined,\n status: data.status as ArticleStatus,\n });\n\n setNotification({ type: 'success', message: 'Article updated successfully!' });\n if (navigateTimerRef.current) clearTimeout(navigateTimerRef.current);\n navigateTimerRef.current = setTimeout(() => navigate(`../../${data.slug}`), 1000);\n } catch {\n setNotification({ type: 'error', message: 'Failed to update article. Please try again.' });\n if (notificationTimerRef.current) clearTimeout(notificationTimerRef.current);\n notificationTimerRef.current = setTimeout(() => setNotification(null), 3000);\n }\n };\n\n const handleCancel = () => {\n navigate('..');\n };\n\n // Non-admin users cannot edit articles\n if (!isAdmin) {\n return (\n <PageLayout showHeader={false}>\n <EmptyState\n icon={<ShieldAlert size={48} />}\n title=\"Admin Access Required\"\n description=\"You need administrator privileges to edit knowledge base articles.\"\n action={\n <Button onClick={() => navigate(`${basePath}/kb`)}>\n <ArrowLeft size={18} />\n Back to Knowledge Base\n </Button>\n }\n />\n </PageLayout>\n );\n }\n\n if (articleLoading) {\n return (\n <PageLayout showHeader={false}>\n <LoadingState message=\"Loading article...\" />\n </PageLayout>\n );\n }\n\n if (!articleDetail) {\n return (\n <PageLayout showHeader={false}>\n <div className=\"text-center py-12\">\n <h2 className=\"text-xl font-semibold text-text-primary mb-2\">Article not found</h2>\n <p className=\"text-text-secondary mb-4\">\n The article you&apos;re trying to edit doesn&apos;t exist.\n </p>\n <Button onClick={() => navigate('../../..')}>Back to Knowledge Base</Button>\n </div>\n </PageLayout>\n );\n }\n\n const initialData: Partial<ArticleFormData> = {\n title: articleDetail.title,\n slug: articleDetail.slug,\n content: articleDetail.content,\n excerpt: articleDetail.excerpt || '',\n categoryId: articleDetail.categoryId || '',\n tags: articleDetail.tags || [],\n metaDescription: '',\n status: articleDetail.status as 'DRAFT' | 'PUBLISHED',\n };\n\n return (\n <PageLayout showHeader={false}>\n {/* Notification */}\n {notification && (\n <div\n className={`fixed right-4 top-[calc(var(--header-height,4rem)+1rem)] z-[200] flex items-center gap-3 px-5 py-3 rounded-xl shadow-2xl border-2 animate-in slide-in-from-top-4 duration-300 ${\n notification.type === 'success'\n ? 'bg-success/10 text-success border-success/30'\n : 'bg-error/10 text-error border-error/30'\n }`}\n >\n {notification.type === 'success' ? (\n <CheckCircle size={20} className=\"text-success\" />\n ) : (\n <AlertCircle size={20} className=\"text-error\" />\n )}\n <span className=\"font-medium\">{notification.message}</span>\n </div>\n )}\n\n {/* Header */}\n <div className=\"flex items-center gap-4 mb-6\">\n <Button variant=\"ghost\" size=\"sm\" onClick={() => navigate('..')} className=\"p-2\">\n <ArrowLeft size={20} />\n </Button>\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2 rounded-lg bg-action-primary-bg/10\">\n <FileEdit size={24} className=\"text-primary\" />\n </div>\n <div>\n <h1 className=\"text-2xl font-bold text-text-primary\">Edit Article</h1>\n <p className=\"text-sm text-text-secondary\">{articleDetail.title}</p>\n </div>\n </div>\n </div>\n\n {/* Form */}\n <div className=\"max-w-3xl\">\n <ArticleForm\n initialData={initialData}\n categories={categories}\n onSubmit={handleSubmit}\n onCancel={handleCancel}\n isSubmitting={updatingArticle}\n submitLabel=\"Update Article\"\n />\n </div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AC,GAAD;KAAQ,SAAQ;KAAQ,MAAK;KAAK,eAAe,EAAS,KAAK;KAAE,WAAU;eACzE,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;KAChB,CAAA,EACT,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,OAAD;MAAK,WAAU;gBACb,kBAAC,GAAD;OAAU,MAAM;OAAI,WAAU;OAAiB,CAAA;MAC3C,CAAA,EACN,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;MAAI,WAAU;gBAAuC;MAAiB,CAAA,EACtE,kBAAC,KAAD;MAAG,WAAU;gBAA+B,EAAc;MAAU,CAAA,CAChE,EAAA,CAAA,CACF;OACF;;GAGN,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,GAAD;KACe;KACD;KACZ,UAAU;KACV,UAAU;KACV,cAAc;KACd,aAAY;KACZ,CAAA;IACE,CAAA;GACK"}
@@ -131,7 +131,7 @@ function b() {
131
131
  children: "Careers form submissions"
132
132
  })] }),
133
133
  /* @__PURE__ */ h("span", {
134
- className: "ml-2 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-muted text-text-secondary",
134
+ className: "ml-2 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-bg-sunken text-text-secondary",
135
135
  children: V
136
136
  })
137
137
  ]
@@ -155,7 +155,7 @@ function b() {
155
155
  }), /* @__PURE__ */ g("button", {
156
156
  type: "button",
157
157
  onClick: () => j(!A),
158
- className: "inline-flex items-center gap-2 px-4 py-2 bg-surface border border-default rounded-lg text-sm text-text-secondary hover:text-text-primary hover:bg-muted transition-colors",
158
+ className: "inline-flex items-center gap-2 px-4 py-2 bg-surface border border-default rounded-lg text-sm text-text-secondary hover:text-text-primary hover:bg-bg-sunken transition-colors",
159
159
  children: [
160
160
  /* @__PURE__ */ h(s, { size: 16 }),
161
161
  "Filters",
@@ -236,7 +236,7 @@ function b() {
236
236
  className: "flex flex-col items-center justify-center py-16 text-center",
237
237
  children: [
238
238
  /* @__PURE__ */ h("div", {
239
- className: "p-4 rounded-2xl bg-muted mb-4",
239
+ className: "p-4 rounded-2xl bg-bg-sunken mb-4",
240
240
  children: /* @__PURE__ */ h(a, {
241
241
  size: 48,
242
242
  className: "text-text-secondary opacity-50"
@@ -256,7 +256,7 @@ function b() {
256
256
  children: B.map((e) => /* @__PURE__ */ h("button", {
257
257
  type: "button",
258
258
  onClick: () => b(`/support/applications/${e.id}${x}`),
259
- className: "w-full text-left p-4 bg-surface border border-default rounded-lg hover:bg-muted/50 hover:border-accent/30 transition-all duration-200 group",
259
+ className: "w-full text-left p-4 bg-surface border border-default rounded-lg hover:bg-bg-sunken/50 hover:border-accent/30 transition-all duration-200 group",
260
260
  children: /* @__PURE__ */ g("div", {
261
261
  className: "flex items-start justify-between gap-4",
262
262
  children: [/* @__PURE__ */ g("div", {
@@ -323,7 +323,7 @@ function b() {
323
323
  });
324
324
  },
325
325
  disabled: L,
326
- className: "inline-flex items-center gap-2 px-6 py-2 bg-surface border border-default rounded-lg text-sm text-text-secondary hover:text-text-primary hover:bg-muted transition-colors disabled:opacity-50",
326
+ className: "inline-flex items-center gap-2 px-6 py-2 bg-surface border border-default rounded-lg text-sm text-text-secondary hover:text-text-primary hover:bg-bg-sunken transition-colors disabled:opacity-50",
327
327
  children: [L ? /* @__PURE__ */ h(c, {
328
328
  size: 14,
329
329
  className: "animate-spin"
@@ -1 +1 @@
1
- {"version":3,"file":"JobApplicationsPage.js","names":[],"sources":["../../../src/support/pages/JobApplicationsPage.tsx"],"sourcesContent":["import { useState, useEffect, useRef } from 'react';\nimport { useNavigate, useLocation } from 'react-router-dom';\nimport {\n Briefcase,\n Search,\n Filter,\n Loader2,\n AlertCircle,\n ChevronDown,\n Paperclip,\n} from 'lucide-react';\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql/fetch';\nimport {\n useGetJobApplicationsQuery,\n type GetJobApplicationsQuery,\n} from '../../generated/global-operations';\nimport type { JobApplicationStatus, JobApplicationFilterInput } from '../../generated/global-types';\n\ntype JobApplication = GetJobApplicationsQuery['jobApplications']['items'][number];\n\nconst statusColors: Record<string, string> = {\n NEW: 'bg-status-info-bg-subtle text-status-info-text',\n SCREENING: 'bg-status-warning-bg-subtle text-status-warning-text',\n SHORTLISTED: 'bg-accent-purple-subtle text-accent-purple',\n INTERVIEW: 'bg-accent-blue-subtle text-accent-blue',\n HIRED: 'bg-status-success-bg-subtle text-status-success-text',\n REJECTED: 'bg-status-error-bg-subtle text-status-error-text',\n ARCHIVED: 'bg-bg-sunken text-text-secondary',\n};\n\nconst statusLabels: Record<string, string> = {\n NEW: 'New',\n SCREENING: 'Screening',\n SHORTLISTED: 'Shortlisted',\n INTERVIEW: 'Interview',\n HIRED: 'Hired',\n REJECTED: 'Rejected',\n ARCHIVED: 'Archived',\n};\n\nfunction formatDate(dateString: string): string {\n return new Date(dateString).toLocaleDateString('en-US', {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n });\n}\n\nexport function JobApplicationsPage() {\n const navigate = useNavigate();\n const location = useLocation();\n const queryParams = location.search;\n const [search, setSearch] = useState('');\n const [debouncedSearch, setDebouncedSearch] = useState('');\n const [statusFilter, setStatusFilter] = useState<JobApplicationStatus | ''>('');\n const [productFilter, setProductFilter] = useState('');\n const [showFilters, setShowFilters] = useState(false);\n const [productNames, setProductNames] = useState<Record<string, string>>({});\n // Mirror the latest map into a ref so the resolver effect can read it\n // without re-running every time we cache a freshly-resolved name.\n const productNamesRef = useRef(productNames);\n productNamesRef.current = productNames;\n\n // Debounce the search box so we don't fire a query on every keystroke.\n useEffect(() => {\n const t = setTimeout(() => setDebouncedSearch(search), 300);\n return () => clearTimeout(t);\n }, [search]);\n\n const filter: JobApplicationFilterInput = {};\n if (debouncedSearch) filter.search = debouncedSearch;\n if (statusFilter) filter.status = statusFilter;\n if (productFilter) filter.productId = productFilter;\n\n const { data, loading, error, fetchMore } = useGetJobApplicationsQuery({\n variables: { filter, limit: 50, offset: 0 },\n fetchPolicy: 'cache-and-network',\n });\n\n const applications = data?.jobApplications?.items ?? [];\n const total = data?.jobApplications?.total ?? 0;\n const hasMore = data?.jobApplications?.hasMore ?? false;\n\n // Resolve human-readable product names for the badges/filter (same one-shot\n // federated lookup the inquiries list uses).\n const productIds = Array.from(\n new Set(\n applications.flatMap((a: JobApplication): string[] => (a.productId ? [a.productId] : []))\n )\n ).sort() as string[];\n const productIdsKey = productIds.join(',');\n useEffect(() => {\n const unknownIds = productIdsKey\n ? productIdsKey.split(',').filter((pid) => !productNamesRef.current[pid])\n : [];\n if (unknownIds.length === 0) return;\n unknownIds.forEach((pid) => {\n graphqlFetch<{ platformProduct?: { name?: string } }>({\n gateway: 'global',\n query: 'query($id: ID!) { platformProduct(id: $id) { name } }',\n variables: { id: pid },\n })\n .then((result) => {\n const name = result.data?.platformProduct?.name;\n if (name) setProductNames((prev) => ({ ...prev, [pid]: name }));\n })\n .catch(() => {});\n });\n }, [productIdsKey]);\n\n const loadMore = () => {\n if (!hasMore) return;\n fetchMore({\n variables: { offset: applications.length },\n updateQuery: (prev, { fetchMoreResult }) => {\n if (!fetchMoreResult) return prev;\n return {\n jobApplications: {\n ...fetchMoreResult.jobApplications,\n items: [\n ...(prev.jobApplications?.items ?? []),\n ...(fetchMoreResult.jobApplications?.items ?? []),\n ],\n },\n };\n },\n });\n };\n\n // Loading state\n if (loading && applications.length === 0) {\n return (\n <div className=\"p-6\">\n <div className=\"flex items-center gap-3 mb-6\">\n <Briefcase size={24} className=\"text-text-primary\" />\n <h1 className=\"text-2xl font-bold text-text-primary\">Job Applications</h1>\n </div>\n <div className=\"flex flex-col items-center justify-center py-16\">\n <Loader2 size={32} className=\"animate-spin text-text-secondary mb-4\" />\n <p className=\"text-sm text-text-secondary\">Loading applications…</p>\n </div>\n </div>\n );\n }\n\n // Error state\n if (error) {\n return (\n <div className=\"p-6\">\n <div className=\"flex items-center gap-3 mb-6\">\n <Briefcase size={24} className=\"text-text-primary\" />\n <h1 className=\"text-2xl font-bold text-text-primary\">Job Applications</h1>\n </div>\n <div className=\"flex flex-col items-center justify-center py-16 text-center\">\n <div className=\"p-4 rounded-2xl bg-status-error-bg-subtle text-status-error-text mb-4\">\n <AlertCircle size={48} />\n </div>\n <h3 className=\"text-lg font-semibold text-text-primary mb-2\">\n Failed to load applications\n </h3>\n <p className=\"text-sm text-text-secondary\">{error.message}</p>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"p-6\">\n {/* Header */}\n <div className=\"flex items-center justify-between mb-6\">\n <div className=\"flex items-center gap-3\">\n <Briefcase size={24} className=\"text-text-primary\" />\n <div>\n <h1 className=\"text-2xl font-bold text-text-primary\">Job Applications</h1>\n <p className=\"text-sm text-text-secondary\">Careers form submissions</p>\n </div>\n <span className=\"ml-2 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-muted text-text-secondary\">\n {total}\n </span>\n </div>\n </div>\n\n {/* Toolbar */}\n <div className=\"flex flex-col sm:flex-row gap-3 mb-6\">\n {/* Search */}\n <div className=\"relative flex-1\">\n <Search\n size={16}\n className=\"absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary\"\n />\n <input\n type=\"text\"\n aria-label=\"Search applications\"\n placeholder=\"Search by name, email, or position...\"\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n className=\"w-full pl-9 pr-4 py-2 bg-surface border border-default rounded-lg text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-accent/50\"\n />\n </div>\n\n {/* Filter toggle */}\n <button\n type=\"button\"\n onClick={() => setShowFilters(!showFilters)}\n className=\"inline-flex items-center gap-2 px-4 py-2 bg-surface border border-default rounded-lg text-sm text-text-secondary hover:text-text-primary hover:bg-muted transition-colors\"\n >\n <Filter size={16} />\n Filters\n <ChevronDown\n size={14}\n className={showFilters ? 'rotate-180 transition-transform' : 'transition-transform'}\n />\n </button>\n </div>\n\n {/* Filters panel */}\n {showFilters && (\n <div className=\"mb-6 p-4 bg-surface border border-default rounded-lg\">\n <div className=\"flex flex-wrap gap-4\">\n <div>\n <label\n htmlFor=\"job-app-status-filter\"\n className=\"block text-xs font-medium text-text-secondary mb-1\"\n >\n Status\n </label>\n <select\n id=\"job-app-status-filter\"\n value={statusFilter}\n onChange={(e) => setStatusFilter(e.target.value as JobApplicationStatus | '')}\n className=\"px-3 py-2 bg-surface border border-default rounded-lg text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-accent/50\"\n >\n <option value=\"\">All statuses</option>\n <option value=\"NEW\">New</option>\n <option value=\"SCREENING\">Screening</option>\n <option value=\"SHORTLISTED\">Shortlisted</option>\n <option value=\"INTERVIEW\">Interview</option>\n <option value=\"HIRED\">Hired</option>\n <option value=\"REJECTED\">Rejected</option>\n <option value=\"ARCHIVED\">Archived</option>\n </select>\n </div>\n <div>\n <label\n htmlFor=\"job-app-product-filter\"\n className=\"block text-xs font-medium text-text-secondary mb-1\"\n >\n Product\n </label>\n <select\n id=\"job-app-product-filter\"\n value={productFilter}\n onChange={(e) => setProductFilter(e.target.value)}\n className=\"px-3 py-2 bg-surface border border-default rounded-lg text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-accent/50\"\n >\n <option value=\"\">All products</option>\n {productIds.map((pid) => (\n <option key={pid} value={pid}>\n {productNames[pid] || pid}\n </option>\n ))}\n </select>\n </div>\n </div>\n </div>\n )}\n\n {/* Empty state */}\n {applications.length === 0 ? (\n <div className=\"flex flex-col items-center justify-center py-16 text-center\">\n <div className=\"p-4 rounded-2xl bg-muted mb-4\">\n <Briefcase size={48} className=\"text-text-secondary opacity-50\" />\n </div>\n <h3 className=\"text-lg font-semibold text-text-primary mb-2\">No applications yet</h3>\n <p className=\"text-sm text-text-secondary\">\n Job applications from your careers pages will appear here.\n </p>\n </div>\n ) : (\n <>\n {/* Application list */}\n <div className=\"space-y-3\">\n {applications.map((application: JobApplication) => (\n <button\n type=\"button\"\n key={application.id}\n onClick={() => navigate(`/support/applications/${application.id}${queryParams}`)}\n className=\"w-full text-left p-4 bg-surface border border-default rounded-lg hover:bg-muted/50 hover:border-accent/30 transition-all duration-200 group\"\n >\n <div className=\"flex items-start justify-between gap-4\">\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2 mb-1 flex-wrap\">\n <h3 className=\"text-sm font-semibold text-text-primary truncate group-hover:text-accent transition-colors\">\n {application.firstName} {application.lastName}\n </h3>\n <span\n className={`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium ${statusColors[application.status] || statusColors.NEW}`}\n >\n {statusLabels[application.status] || application.status}\n </span>\n {application.productId && productNames[application.productId] && (\n <span\n className=\"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-accent-purple-subtle text-accent-purple\"\n title={`Product: ${productNames[application.productId]}`}\n >\n {productNames[application.productId]}\n </span>\n )}\n {application.resumeFileName && (\n <span className=\"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-accent-blue-subtle text-accent-blue\">\n <Paperclip size={11} />\n Resume\n </span>\n )}\n </div>\n <p className=\"text-sm text-text-secondary mb-1\">\n <span className=\"font-medium\">{application.position}</span>\n {application.department && (\n <>\n <span className=\"mx-1.5 text-text-secondary/50\">&middot;</span>\n <span>{application.department}</span>\n </>\n )}\n </p>\n <p className=\"text-xs text-text-secondary truncate\">{application.email}</p>\n </div>\n <div className=\"text-xs text-text-secondary whitespace-nowrap\">\n {formatDate(application.createdAt)}\n </div>\n </div>\n </button>\n ))}\n </div>\n\n {/* Load more */}\n {hasMore && (\n <div className=\"flex justify-center mt-6\">\n <button\n type=\"button\"\n onClick={loadMore}\n disabled={loading}\n className=\"inline-flex items-center gap-2 px-6 py-2 bg-surface border border-default rounded-lg text-sm text-text-secondary hover:text-text-primary hover:bg-muted transition-colors disabled:opacity-50\"\n >\n {loading ? <Loader2 size={14} className=\"animate-spin\" /> : null}\n Load more\n </button>\n </div>\n )}\n </>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;AAoBA,IAAM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WhC,CAAC;;KAsNU,UAAU;KACV,WAAU;eAJZ,CAMG,IAAU,kBAAC,GAAD;MAAS,MAAM;MAAI,WAAU;MAAiB,CAAA,GAAG,MAAK,YAE1D;;IACL,CAAA,CAEP,EAAA,CAAA;GAED"}
1
+ {"version":3,"file":"JobApplicationsPage.js","names":[],"sources":["../../../src/support/pages/JobApplicationsPage.tsx"],"sourcesContent":["import { useState, useEffect, useRef } from 'react';\nimport { useNavigate, useLocation } from 'react-router-dom';\nimport {\n Briefcase,\n Search,\n Filter,\n Loader2,\n AlertCircle,\n ChevronDown,\n Paperclip,\n} from 'lucide-react';\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql/fetch';\nimport {\n useGetJobApplicationsQuery,\n type GetJobApplicationsQuery,\n} from '../../generated/global-operations';\nimport type { JobApplicationStatus, JobApplicationFilterInput } from '../../generated/global-types';\n\ntype JobApplication = GetJobApplicationsQuery['jobApplications']['items'][number];\n\nconst statusColors: Record<string, string> = {\n NEW: 'bg-status-info-bg-subtle text-status-info-text',\n SCREENING: 'bg-status-warning-bg-subtle text-status-warning-text',\n SHORTLISTED: 'bg-accent-purple-subtle text-accent-purple',\n INTERVIEW: 'bg-accent-blue-subtle text-accent-blue',\n HIRED: 'bg-status-success-bg-subtle text-status-success-text',\n REJECTED: 'bg-status-error-bg-subtle text-status-error-text',\n ARCHIVED: 'bg-bg-sunken text-text-secondary',\n};\n\nconst statusLabels: Record<string, string> = {\n NEW: 'New',\n SCREENING: 'Screening',\n SHORTLISTED: 'Shortlisted',\n INTERVIEW: 'Interview',\n HIRED: 'Hired',\n REJECTED: 'Rejected',\n ARCHIVED: 'Archived',\n};\n\nfunction formatDate(dateString: string): string {\n return new Date(dateString).toLocaleDateString('en-US', {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n });\n}\n\nexport function JobApplicationsPage() {\n const navigate = useNavigate();\n const location = useLocation();\n const queryParams = location.search;\n const [search, setSearch] = useState('');\n const [debouncedSearch, setDebouncedSearch] = useState('');\n const [statusFilter, setStatusFilter] = useState<JobApplicationStatus | ''>('');\n const [productFilter, setProductFilter] = useState('');\n const [showFilters, setShowFilters] = useState(false);\n const [productNames, setProductNames] = useState<Record<string, string>>({});\n // Mirror the latest map into a ref so the resolver effect can read it\n // without re-running every time we cache a freshly-resolved name.\n const productNamesRef = useRef(productNames);\n productNamesRef.current = productNames;\n\n // Debounce the search box so we don't fire a query on every keystroke.\n useEffect(() => {\n const t = setTimeout(() => setDebouncedSearch(search), 300);\n return () => clearTimeout(t);\n }, [search]);\n\n const filter: JobApplicationFilterInput = {};\n if (debouncedSearch) filter.search = debouncedSearch;\n if (statusFilter) filter.status = statusFilter;\n if (productFilter) filter.productId = productFilter;\n\n const { data, loading, error, fetchMore } = useGetJobApplicationsQuery({\n variables: { filter, limit: 50, offset: 0 },\n fetchPolicy: 'cache-and-network',\n });\n\n const applications = data?.jobApplications?.items ?? [];\n const total = data?.jobApplications?.total ?? 0;\n const hasMore = data?.jobApplications?.hasMore ?? false;\n\n // Resolve human-readable product names for the badges/filter (same one-shot\n // federated lookup the inquiries list uses).\n const productIds = Array.from(\n new Set(\n applications.flatMap((a: JobApplication): string[] => (a.productId ? [a.productId] : []))\n )\n ).sort() as string[];\n const productIdsKey = productIds.join(',');\n useEffect(() => {\n const unknownIds = productIdsKey\n ? productIdsKey.split(',').filter((pid) => !productNamesRef.current[pid])\n : [];\n if (unknownIds.length === 0) return;\n unknownIds.forEach((pid) => {\n graphqlFetch<{ platformProduct?: { name?: string } }>({\n gateway: 'global',\n query: 'query($id: ID!) { platformProduct(id: $id) { name } }',\n variables: { id: pid },\n })\n .then((result) => {\n const name = result.data?.platformProduct?.name;\n if (name) setProductNames((prev) => ({ ...prev, [pid]: name }));\n })\n .catch(() => {});\n });\n }, [productIdsKey]);\n\n const loadMore = () => {\n if (!hasMore) return;\n fetchMore({\n variables: { offset: applications.length },\n updateQuery: (prev, { fetchMoreResult }) => {\n if (!fetchMoreResult) return prev;\n return {\n jobApplications: {\n ...fetchMoreResult.jobApplications,\n items: [\n ...(prev.jobApplications?.items ?? []),\n ...(fetchMoreResult.jobApplications?.items ?? []),\n ],\n },\n };\n },\n });\n };\n\n // Loading state\n if (loading && applications.length === 0) {\n return (\n <div className=\"p-6\">\n <div className=\"flex items-center gap-3 mb-6\">\n <Briefcase size={24} className=\"text-text-primary\" />\n <h1 className=\"text-2xl font-bold text-text-primary\">Job Applications</h1>\n </div>\n <div className=\"flex flex-col items-center justify-center py-16\">\n <Loader2 size={32} className=\"animate-spin text-text-secondary mb-4\" />\n <p className=\"text-sm text-text-secondary\">Loading applications…</p>\n </div>\n </div>\n );\n }\n\n // Error state\n if (error) {\n return (\n <div className=\"p-6\">\n <div className=\"flex items-center gap-3 mb-6\">\n <Briefcase size={24} className=\"text-text-primary\" />\n <h1 className=\"text-2xl font-bold text-text-primary\">Job Applications</h1>\n </div>\n <div className=\"flex flex-col items-center justify-center py-16 text-center\">\n <div className=\"p-4 rounded-2xl bg-status-error-bg-subtle text-status-error-text mb-4\">\n <AlertCircle size={48} />\n </div>\n <h3 className=\"text-lg font-semibold text-text-primary mb-2\">\n Failed to load applications\n </h3>\n <p className=\"text-sm text-text-secondary\">{error.message}</p>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"p-6\">\n {/* Header */}\n <div className=\"flex items-center justify-between mb-6\">\n <div className=\"flex items-center gap-3\">\n <Briefcase size={24} className=\"text-text-primary\" />\n <div>\n <h1 className=\"text-2xl font-bold text-text-primary\">Job Applications</h1>\n <p className=\"text-sm text-text-secondary\">Careers form submissions</p>\n </div>\n <span className=\"ml-2 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-bg-sunken text-text-secondary\">\n {total}\n </span>\n </div>\n </div>\n\n {/* Toolbar */}\n <div className=\"flex flex-col sm:flex-row gap-3 mb-6\">\n {/* Search */}\n <div className=\"relative flex-1\">\n <Search\n size={16}\n className=\"absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary\"\n />\n <input\n type=\"text\"\n aria-label=\"Search applications\"\n placeholder=\"Search by name, email, or position...\"\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n className=\"w-full pl-9 pr-4 py-2 bg-surface border border-default rounded-lg text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-accent/50\"\n />\n </div>\n\n {/* Filter toggle */}\n <button\n type=\"button\"\n onClick={() => setShowFilters(!showFilters)}\n className=\"inline-flex items-center gap-2 px-4 py-2 bg-surface border border-default rounded-lg text-sm text-text-secondary hover:text-text-primary hover:bg-bg-sunken transition-colors\"\n >\n <Filter size={16} />\n Filters\n <ChevronDown\n size={14}\n className={showFilters ? 'rotate-180 transition-transform' : 'transition-transform'}\n />\n </button>\n </div>\n\n {/* Filters panel */}\n {showFilters && (\n <div className=\"mb-6 p-4 bg-surface border border-default rounded-lg\">\n <div className=\"flex flex-wrap gap-4\">\n <div>\n <label\n htmlFor=\"job-app-status-filter\"\n className=\"block text-xs font-medium text-text-secondary mb-1\"\n >\n Status\n </label>\n <select\n id=\"job-app-status-filter\"\n value={statusFilter}\n onChange={(e) => setStatusFilter(e.target.value as JobApplicationStatus | '')}\n className=\"px-3 py-2 bg-surface border border-default rounded-lg text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-accent/50\"\n >\n <option value=\"\">All statuses</option>\n <option value=\"NEW\">New</option>\n <option value=\"SCREENING\">Screening</option>\n <option value=\"SHORTLISTED\">Shortlisted</option>\n <option value=\"INTERVIEW\">Interview</option>\n <option value=\"HIRED\">Hired</option>\n <option value=\"REJECTED\">Rejected</option>\n <option value=\"ARCHIVED\">Archived</option>\n </select>\n </div>\n <div>\n <label\n htmlFor=\"job-app-product-filter\"\n className=\"block text-xs font-medium text-text-secondary mb-1\"\n >\n Product\n </label>\n <select\n id=\"job-app-product-filter\"\n value={productFilter}\n onChange={(e) => setProductFilter(e.target.value)}\n className=\"px-3 py-2 bg-surface border border-default rounded-lg text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-accent/50\"\n >\n <option value=\"\">All products</option>\n {productIds.map((pid) => (\n <option key={pid} value={pid}>\n {productNames[pid] || pid}\n </option>\n ))}\n </select>\n </div>\n </div>\n </div>\n )}\n\n {/* Empty state */}\n {applications.length === 0 ? (\n <div className=\"flex flex-col items-center justify-center py-16 text-center\">\n <div className=\"p-4 rounded-2xl bg-bg-sunken mb-4\">\n <Briefcase size={48} className=\"text-text-secondary opacity-50\" />\n </div>\n <h3 className=\"text-lg font-semibold text-text-primary mb-2\">No applications yet</h3>\n <p className=\"text-sm text-text-secondary\">\n Job applications from your careers pages will appear here.\n </p>\n </div>\n ) : (\n <>\n {/* Application list */}\n <div className=\"space-y-3\">\n {applications.map((application: JobApplication) => (\n <button\n type=\"button\"\n key={application.id}\n onClick={() => navigate(`/support/applications/${application.id}${queryParams}`)}\n className=\"w-full text-left p-4 bg-surface border border-default rounded-lg hover:bg-bg-sunken/50 hover:border-accent/30 transition-all duration-200 group\"\n >\n <div className=\"flex items-start justify-between gap-4\">\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2 mb-1 flex-wrap\">\n <h3 className=\"text-sm font-semibold text-text-primary truncate group-hover:text-accent transition-colors\">\n {application.firstName} {application.lastName}\n </h3>\n <span\n className={`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium ${statusColors[application.status] || statusColors.NEW}`}\n >\n {statusLabels[application.status] || application.status}\n </span>\n {application.productId && productNames[application.productId] && (\n <span\n className=\"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-accent-purple-subtle text-accent-purple\"\n title={`Product: ${productNames[application.productId]}`}\n >\n {productNames[application.productId]}\n </span>\n )}\n {application.resumeFileName && (\n <span className=\"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-accent-blue-subtle text-accent-blue\">\n <Paperclip size={11} />\n Resume\n </span>\n )}\n </div>\n <p className=\"text-sm text-text-secondary mb-1\">\n <span className=\"font-medium\">{application.position}</span>\n {application.department && (\n <>\n <span className=\"mx-1.5 text-text-secondary/50\">&middot;</span>\n <span>{application.department}</span>\n </>\n )}\n </p>\n <p className=\"text-xs text-text-secondary truncate\">{application.email}</p>\n </div>\n <div className=\"text-xs text-text-secondary whitespace-nowrap\">\n {formatDate(application.createdAt)}\n </div>\n </div>\n </button>\n ))}\n </div>\n\n {/* Load more */}\n {hasMore && (\n <div className=\"flex justify-center mt-6\">\n <button\n type=\"button\"\n onClick={loadMore}\n disabled={loading}\n className=\"inline-flex items-center gap-2 px-6 py-2 bg-surface border border-default rounded-lg text-sm text-text-secondary hover:text-text-primary hover:bg-bg-sunken transition-colors disabled:opacity-50\"\n >\n {loading ? <Loader2 size={14} className=\"animate-spin\" /> : null}\n Load more\n </button>\n </div>\n )}\n </>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;AAoBA,IAAM,IAAuC;CAC3C,KAAK;CACL,WAAW;CACX,aAAa;CACb,WAAW;CACX,OAAO;CACP,UAAU;CACV,UAAU;CACX,EAEK,IAAuC;CAC3C,KAAK;CACL,WAAW;CACX,aAAa;CACb,WAAW;CACX,OAAO;CACP,UAAU;CACV,UAAU;CACX;AAED,SAAS,EAAW,GAA4B;AAC9C,QAAO,IAAI,KAAK,EAAW,CAAC,mBAAmB,SAAS;EACtD,OAAO;EACP,KAAK;EACL,MAAM;EACN,MAAM;EACN,QAAQ;EACT,CAAC;;AAGJ,SAAgB,IAAsB;CACpC,IAAM,IAAW,GAAa,EAExB,IADW,GAAa,CACD,QACvB,CAAC,GAAQ,KAAa,EAAS,GAAG,EAClC,CAAC,GAAiB,KAAsB,EAAS,GAAG,EACpD,CAAC,GAAc,KAAmB,EAAoC,GAAG,EACzE,CAAC,GAAe,KAAoB,EAAS,GAAG,EAChD,CAAC,GAAa,KAAkB,EAAS,GAAM,EAC/C,CAAC,GAAc,KAAmB,EAAiC,EAAE,CAAC,EAGtE,IAAkB,EAAO,EAAa;AAI5C,CAHA,EAAgB,UAAU,GAG1B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AO,EAAY,YAAkB,CAAA,CACpC,EAAA,CAAA,CAEH;;QACJ,kBAAC,KAAD;SAAG,WAAU;mBAAwC,EAAY;SAAU,CAAA;QACvE;UACN,kBAAC,OAAD;OAAK,WAAU;iBACZ,EAAW,EAAY,UAAU;OAC9B,CAAA,CACF;;KACC,EA7CF,EAAY,GA6CV,CACT;IACE,CAAA,EAGL,KACC,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,UAAD;KACE,MAAK;KACL,eArOS;AAChB,WACL,EAAU;OACR,WAAW,EAAE,QAAQ,EAAa,QAAQ;OAC1C,cAAc,GAAM,EAAE,yBACf,IACE,EACL,iBAAiB;QACf,GAAG,EAAgB;QACnB,OAAO,CACL,GAAI,EAAK,iBAAiB,SAAS,EAAE,EACrC,GAAI,EAAgB,iBAAiB,SAAS,EAAE,CACjD;QACF,EACF,GAT4B;OAWhC,CAAC;;KAsNU,UAAU;KACV,WAAU;eAJZ,CAMG,IAAU,kBAAC,GAAD;MAAS,MAAM;MAAI,WAAU;MAAiB,CAAA,GAAG,MAAK,YAE1D;;IACL,CAAA,CAEP,EAAA,CAAA;GAED"}
@@ -34,7 +34,7 @@ function C() {
34
34
  children: [
35
35
  /* @__PURE__ */ x(g, {
36
36
  size: 20,
37
- className: "absolute left-4 top-1/2 -translate-y-1/2 text-muted-foreground"
37
+ className: "absolute left-4 top-1/2 -translate-y-1/2 text-text-secondary"
38
38
  }),
39
39
  /* @__PURE__ */ x(r, {
40
40
  type: "text",
@@ -55,7 +55,7 @@ function C() {
55
55
  })
56
56
  }),
57
57
  !V && !j && D.length > 0 && /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ S("h2", {
58
- className: "text-lg font-semibold mb-4 flex items-center gap-2 text-foreground",
58
+ className: "text-lg font-semibold mb-4 flex items-center gap-2 text-text-primary",
59
59
  children: [/* @__PURE__ */ x(p, {
60
60
  size: 20,
61
61
  className: "text-primary"
@@ -67,25 +67,25 @@ function C() {
67
67
  onClick: () => {
68
68
  B(e.id), H(!1), P({ categoryId: e.id });
69
69
  },
70
- className: `p-4 rounded-xl border text-left transition-all hover:shadow-md hover:border-primary/50 bg-card ${z === e.id ? "border-primary ring-2 ring-primary/20" : ""}`,
70
+ className: `p-4 rounded-xl border text-left transition-all hover:shadow-md hover:border-primary/50 bg-bg-surface ${z === e.id ? "border-primary ring-2 ring-primary/20" : ""}`,
71
71
  children: [
72
72
  /* @__PURE__ */ x("div", {
73
73
  className: "text-2xl mb-2",
74
74
  children: e.icon || "📁"
75
75
  }),
76
76
  /* @__PURE__ */ x("p", {
77
- className: "font-medium text-foreground mb-1",
77
+ className: "font-medium text-text-primary mb-1",
78
78
  children: e.name
79
79
  }),
80
80
  /* @__PURE__ */ S("p", {
81
- className: "text-xs text-muted-foreground",
81
+ className: "text-xs text-text-secondary",
82
82
  children: [e.articleCount || 0, " articles"]
83
83
  })
84
84
  ]
85
85
  }, e.id))
86
86
  })] }),
87
87
  !V && !A && E.length > 0 && /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ S("h2", {
88
- className: "text-lg font-semibold mb-4 flex items-center gap-2 text-foreground",
88
+ className: "text-lg font-semibold mb-4 flex items-center gap-2 text-text-primary",
89
89
  children: [/* @__PURE__ */ x(v, {
90
90
  size: 20,
91
91
  className: "text-primary"
@@ -95,18 +95,18 @@ function C() {
95
95
  children: E.map((e) => /* @__PURE__ */ S("button", {
96
96
  type: "button",
97
97
  onClick: () => C(`${w}/kb/articles/${e.slug}`),
98
- className: "p-5 rounded-xl border bg-card text-left transition-all hover:shadow-md hover:border-primary/50 group",
98
+ className: "p-5 rounded-xl border bg-bg-surface text-left transition-all hover:shadow-md hover:border-primary/50 group",
99
99
  children: [
100
100
  /* @__PURE__ */ x("h3", {
101
- className: "font-semibold text-foreground mb-2 group-hover:text-primary transition-colors",
101
+ className: "font-semibold text-text-primary mb-2 group-hover:text-primary transition-colors",
102
102
  children: e.title
103
103
  }),
104
104
  /* @__PURE__ */ x("p", {
105
- className: "text-sm text-muted-foreground mb-3 line-clamp-2",
105
+ className: "text-sm text-text-secondary mb-3 line-clamp-2",
106
106
  children: e.excerpt
107
107
  }),
108
108
  /* @__PURE__ */ S("div", {
109
- className: "flex items-center gap-4 text-xs text-muted-foreground",
109
+ className: "flex items-center gap-4 text-xs text-text-secondary",
110
110
  children: [/* @__PURE__ */ S("span", {
111
111
  className: "flex items-center gap-1",
112
112
  children: [
@@ -129,7 +129,7 @@ function C() {
129
129
  /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ S("div", {
130
130
  className: "flex items-center justify-between mb-4",
131
131
  children: [/* @__PURE__ */ x("h2", {
132
- className: "text-lg font-semibold text-foreground",
132
+ className: "text-lg font-semibold text-text-primary",
133
133
  children: V && L ? `Search Results for "${L}"` : G || "All Articles"
134
134
  }), (V || z) && /* @__PURE__ */ x(n, {
135
135
  variant: "outline",
@@ -142,7 +142,7 @@ function C() {
142
142
  children: K.map((e) => /* @__PURE__ */ S("button", {
143
143
  type: "button",
144
144
  onClick: () => C(`${w}/kb/articles/${e.slug}`),
145
- className: "p-6 rounded-xl border bg-card text-left transition-all hover:shadow-md hover:border-primary/50 group",
145
+ className: "p-6 rounded-xl border bg-bg-surface text-left transition-all hover:shadow-md hover:border-primary/50 group",
146
146
  children: [
147
147
  /* @__PURE__ */ S("div", {
148
148
  className: "flex items-center gap-2 mb-2 flex-wrap",
@@ -160,7 +160,7 @@ function C() {
160
160
  }), "Draft"]
161
161
  }),
162
162
  e.status === "ARCHIVED" && /* @__PURE__ */ S(t, {
163
- className: "bg-muted text-muted-foreground text-xs",
163
+ className: "bg-bg-sunken text-text-secondary text-xs",
164
164
  children: [/* @__PURE__ */ x(u, {
165
165
  size: 10,
166
166
  className: "mr-1"
@@ -169,15 +169,15 @@ function C() {
169
169
  ]
170
170
  }),
171
171
  /* @__PURE__ */ x("h3", {
172
- className: "font-semibold text-lg text-foreground mb-2 group-hover:text-primary transition-colors",
172
+ className: "font-semibold text-lg text-text-primary mb-2 group-hover:text-primary transition-colors",
173
173
  children: e.title
174
174
  }),
175
175
  /* @__PURE__ */ x("p", {
176
- className: "text-sm text-muted-foreground mb-4 line-clamp-3",
176
+ className: "text-sm text-text-secondary mb-4 line-clamp-3",
177
177
  children: e.excerpt
178
178
  }),
179
179
  /* @__PURE__ */ S("div", {
180
- className: "flex items-center justify-between text-xs text-muted-foreground",
180
+ className: "flex items-center justify-between text-xs text-text-secondary",
181
181
  children: [/* @__PURE__ */ S("span", {
182
182
  className: "flex items-center gap-1",
183
183
  children: [/* @__PURE__ */ x(f, { size: 14 }), e.viewCount]
@@ -1 +1 @@
1
- {"version":3,"file":"KnowledgeBaseAdminPage.js","names":[],"sources":["../../../src/support/pages/KnowledgeBaseAdminPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport {\n BookOpen,\n Search,\n TrendingUp,\n FolderOpen,\n Eye,\n ThumbsUp,\n Plus,\n GlobeLock,\n Archive,\n} from 'lucide-react';\nimport { Button, Input, Badge } from '../components/ui';\nimport { useKnowledgeBaseOperations } from '../hooks/useKnowledgeBaseOperations';\nimport { PageLayout, LoadingState, EmptyState } from '../components/PageLayout';\nimport { useSupport } from '../providers/SupportProvider';\nimport { getCategoryBadgeClass } from '../utils/categoryColors';\nimport type { TicketCategory, KnowledgeBaseArticle } from '../../generated/global-types';\n\n/**\n * Admin-facing knowledge base page.\n *\n * Shows all articles (published, draft, archived) with status badges.\n * Includes \"New Article\" button for creating KB content.\n */\nexport function KnowledgeBaseAdminPage() {\n const navigate = useNavigate();\n const { basePath = '' } = useSupport();\n const {\n articles,\n popularArticles,\n categories,\n searchResults,\n articlesLoading,\n popularLoading,\n categoriesLoading,\n searchLoading,\n searchArticles,\n filterArticles,\n hasMoreArticles,\n loadMoreArticles,\n } = useKnowledgeBaseOperations();\n\n const [query, setQuery] = useState('');\n const [selectedCategory, setSelectedCategory] = useState<string | null>(null);\n const [showSearch, setShowSearch] = useState(false);\n\n const handleSearch = (e: React.FormEvent) => {\n e.preventDefault();\n if (query.trim()) {\n searchArticles(query, { categoryId: selectedCategory ?? undefined });\n setShowSearch(true);\n }\n };\n\n const handleClearSearch = () => {\n setQuery('');\n setShowSearch(false);\n setSelectedCategory(null);\n filterArticles({ categoryId: undefined, tags: [] });\n };\n\n const selectedCategoryName = categories.find(\n (category: TicketCategory) => category.id === selectedCategory\n )?.name;\n\n const displayArticles: KnowledgeBaseArticle[] =\n showSearch && query ? (searchResults as unknown as KnowledgeBaseArticle[]) : articles;\n const isLoading = showSearch ? searchLoading : articlesLoading;\n\n return (\n <PageLayout\n title=\"Knowledge Base\"\n subtitle=\"Manage help articles and documentation\"\n icon={<BookOpen size={24} />}\n headerActions={\n <Button onClick={() => navigate(`${basePath}/kb/articles/new`)}>\n <Plus size={18} />\n New Article\n </Button>\n }\n >\n {/* Search */}\n <div className=\"relative max-w-2xl\">\n <form onSubmit={handleSearch} className=\"relative\">\n <Search\n size={20}\n className=\"absolute left-4 top-1/2 -translate-y-1/2 text-muted-foreground\"\n />\n <Input\n type=\"text\"\n value={query}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => setQuery(e.target.value)}\n placeholder=\"Search for help articles...\"\n className=\"pl-12 pr-4 py-6 text-lg\"\n />\n {query && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={handleClearSearch}\n className=\"absolute right-2 top-1/2 -translate-y-1/2\"\n >\n Clear\n </Button>\n )}\n </form>\n </div>\n\n {/* Categories */}\n {!showSearch && !categoriesLoading && categories.length > 0 && (\n <div>\n <h2 className=\"text-lg font-semibold mb-4 flex items-center gap-2 text-foreground\">\n <FolderOpen size={20} className=\"text-primary\" />\n Browse by Category\n </h2>\n <div className=\"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4\">\n {categories.slice(0, 8).map((category: TicketCategory) => (\n <button\n type=\"button\"\n key={category.id}\n onClick={() => {\n setSelectedCategory(category.id);\n setShowSearch(false);\n filterArticles({ categoryId: category.id });\n }}\n className={`p-4 rounded-xl border text-left transition-all hover:shadow-md hover:border-primary/50 bg-card ${\n selectedCategory === category.id ? 'border-primary ring-2 ring-primary/20' : ''\n }`}\n >\n <div className=\"text-2xl mb-2\">{category.icon || '📁'}</div>\n <p className=\"font-medium text-foreground mb-1\">{category.name}</p>\n <p className=\"text-xs text-muted-foreground\">\n {category.articleCount || 0} articles\n </p>\n </button>\n ))}\n </div>\n </div>\n )}\n\n {/* Popular Articles */}\n {!showSearch && !popularLoading && popularArticles.length > 0 && (\n <div>\n <h2 className=\"text-lg font-semibold mb-4 flex items-center gap-2 text-foreground\">\n <TrendingUp size={20} className=\"text-primary\" />\n Popular Articles\n </h2>\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n {popularArticles.map((article: KnowledgeBaseArticle) => (\n <button\n type=\"button\"\n key={article.id}\n onClick={() => navigate(`${basePath}/kb/articles/${article.slug}`)}\n className=\"p-5 rounded-xl border bg-card text-left transition-all hover:shadow-md hover:border-primary/50 group\"\n >\n <h3 className=\"font-semibold text-foreground mb-2 group-hover:text-primary transition-colors\">\n {article.title}\n </h3>\n <p className=\"text-sm text-muted-foreground mb-3 line-clamp-2\">{article.excerpt}</p>\n <div className=\"flex items-center gap-4 text-xs text-muted-foreground\">\n <span className=\"flex items-center gap-1\">\n <Eye size={14} />\n {article.viewCount} views\n </span>\n <span className=\"flex items-center gap-1\">\n <ThumbsUp size={14} />\n {article.helpfulCount} helpful\n </span>\n </div>\n </button>\n ))}\n </div>\n </div>\n )}\n\n {/* Articles List */}\n <div>\n <div className=\"flex items-center justify-between mb-4\">\n <h2 className=\"text-lg font-semibold text-foreground\">\n {showSearch && query\n ? `Search Results for \"${query}\"`\n : selectedCategoryName || 'All Articles'}\n </h2>\n {(showSearch || selectedCategory) && (\n <Button variant=\"outline\" size=\"sm\" onClick={handleClearSearch}>\n {showSearch ? 'Clear Search' : 'All Articles'}\n </Button>\n )}\n </div>\n\n {isLoading ? (\n <LoadingState message=\"Loading articles...\" />\n ) : displayArticles.length > 0 ? (\n <>\n <div className=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\">\n {displayArticles.map((article: KnowledgeBaseArticle) => (\n <button\n type=\"button\"\n key={article.id}\n onClick={() => navigate(`${basePath}/kb/articles/${article.slug}`)}\n className=\"p-6 rounded-xl border bg-card text-left transition-all hover:shadow-md hover:border-primary/50 group\"\n >\n <div className=\"flex items-center gap-2 mb-2 flex-wrap\">\n {article.category && (\n <Badge\n variant=\"outline\"\n className={getCategoryBadgeClass(article.category.color)}\n >\n {article.category.name}\n </Badge>\n )}\n {article.status === 'DRAFT' && (\n <Badge className=\"bg-status-warning-bg-subtle text-status-warning-text text-xs\">\n <GlobeLock size={10} className=\"mr-1\" />\n Draft\n </Badge>\n )}\n {article.status === 'ARCHIVED' && (\n <Badge className=\"bg-muted text-muted-foreground text-xs\">\n <Archive size={10} className=\"mr-1\" />\n Archived\n </Badge>\n )}\n </div>\n <h3 className=\"font-semibold text-lg text-foreground mb-2 group-hover:text-primary transition-colors\">\n {article.title}\n </h3>\n <p className=\"text-sm text-muted-foreground mb-4 line-clamp-3\">\n {article.excerpt}\n </p>\n <div className=\"flex items-center justify-between text-xs text-muted-foreground\">\n <span className=\"flex items-center gap-1\">\n <Eye size={14} />\n {article.viewCount}\n </span>\n <span className=\"flex items-center gap-1\">\n <ThumbsUp size={14} />\n {article.helpfulCount}\n </span>\n </div>\n </button>\n ))}\n </div>\n\n {hasMoreArticles && (\n <div className=\"flex justify-center mt-6\">\n <Button variant=\"outline\" onClick={loadMoreArticles}>\n Load More\n </Button>\n </div>\n )}\n </>\n ) : (\n <EmptyState\n icon={<BookOpen size={48} />}\n title={showSearch ? 'No articles found' : 'No articles available'}\n description={\n showSearch\n ? 'Try adjusting your search terms or browse by category'\n : 'Check back later for helpful articles and guides'\n }\n />\n )}\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;AA0BA,SAAgB,IAAyB;CACvC,IAAM,IAAW,GAAa,EACx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,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,QAAD;QAAM,WAAU;kBAAhB,CACE,kBAAC,GAAD,EAAK,MAAM,IAAM,CAAA,EAChB,EAAQ,UACJ;WACP,kBAAC,QAAD;QAAM,WAAU;kBAAhB,CACE,kBAAC,GAAD,EAAU,MAAM,IAAM,CAAA,EACrB,EAAQ,aACJ;UACH;;MACC;OA1CF,EAAQ,GA0CN,CACT;IACE,CAAA,EAEL,KACC,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,GAAD;KAAQ,SAAQ;KAAU,SAAS;eAAkB;KAE5C,CAAA;IACL,CAAA,CAEP,EAAA,CAAA,GAEH,kBAAC,GAAD;IACE,MAAM,kBAAC,GAAD,EAAU,MAAM,IAAM,CAAA;IAC5B,OAAO,IAAa,sBAAsB;IAC1C,aACE,IACI,0DACA;IAEN,CAAA,CAEA,EAAA,CAAA;GACK"}
1
+ {"version":3,"file":"KnowledgeBaseAdminPage.js","names":[],"sources":["../../../src/support/pages/KnowledgeBaseAdminPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport {\n BookOpen,\n Search,\n TrendingUp,\n FolderOpen,\n Eye,\n ThumbsUp,\n Plus,\n GlobeLock,\n Archive,\n} from 'lucide-react';\nimport { Button, Input, Badge } from '../components/ui';\nimport { useKnowledgeBaseOperations } from '../hooks/useKnowledgeBaseOperations';\nimport { PageLayout, LoadingState, EmptyState } from '../components/PageLayout';\nimport { useSupport } from '../providers/SupportProvider';\nimport { getCategoryBadgeClass } from '../utils/categoryColors';\nimport type { TicketCategory, KnowledgeBaseArticle } from '../../generated/global-types';\n\n/**\n * Admin-facing knowledge base page.\n *\n * Shows all articles (published, draft, archived) with status badges.\n * Includes \"New Article\" button for creating KB content.\n */\nexport function KnowledgeBaseAdminPage() {\n const navigate = useNavigate();\n const { basePath = '' } = useSupport();\n const {\n articles,\n popularArticles,\n categories,\n searchResults,\n articlesLoading,\n popularLoading,\n categoriesLoading,\n searchLoading,\n searchArticles,\n filterArticles,\n hasMoreArticles,\n loadMoreArticles,\n } = useKnowledgeBaseOperations();\n\n const [query, setQuery] = useState('');\n const [selectedCategory, setSelectedCategory] = useState<string | null>(null);\n const [showSearch, setShowSearch] = useState(false);\n\n const handleSearch = (e: React.FormEvent) => {\n e.preventDefault();\n if (query.trim()) {\n searchArticles(query, { categoryId: selectedCategory ?? undefined });\n setShowSearch(true);\n }\n };\n\n const handleClearSearch = () => {\n setQuery('');\n setShowSearch(false);\n setSelectedCategory(null);\n filterArticles({ categoryId: undefined, tags: [] });\n };\n\n const selectedCategoryName = categories.find(\n (category: TicketCategory) => category.id === selectedCategory\n )?.name;\n\n const displayArticles: KnowledgeBaseArticle[] =\n showSearch && query ? (searchResults as unknown as KnowledgeBaseArticle[]) : articles;\n const isLoading = showSearch ? searchLoading : articlesLoading;\n\n return (\n <PageLayout\n title=\"Knowledge Base\"\n subtitle=\"Manage help articles and documentation\"\n icon={<BookOpen size={24} />}\n headerActions={\n <Button onClick={() => navigate(`${basePath}/kb/articles/new`)}>\n <Plus size={18} />\n New Article\n </Button>\n }\n >\n {/* Search */}\n <div className=\"relative max-w-2xl\">\n <form onSubmit={handleSearch} className=\"relative\">\n <Search\n size={20}\n className=\"absolute left-4 top-1/2 -translate-y-1/2 text-text-secondary\"\n />\n <Input\n type=\"text\"\n value={query}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => setQuery(e.target.value)}\n placeholder=\"Search for help articles...\"\n className=\"pl-12 pr-4 py-6 text-lg\"\n />\n {query && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={handleClearSearch}\n className=\"absolute right-2 top-1/2 -translate-y-1/2\"\n >\n Clear\n </Button>\n )}\n </form>\n </div>\n\n {/* Categories */}\n {!showSearch && !categoriesLoading && categories.length > 0 && (\n <div>\n <h2 className=\"text-lg font-semibold mb-4 flex items-center gap-2 text-text-primary\">\n <FolderOpen size={20} className=\"text-primary\" />\n Browse by Category\n </h2>\n <div className=\"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4\">\n {categories.slice(0, 8).map((category: TicketCategory) => (\n <button\n type=\"button\"\n key={category.id}\n onClick={() => {\n setSelectedCategory(category.id);\n setShowSearch(false);\n filterArticles({ categoryId: category.id });\n }}\n className={`p-4 rounded-xl border text-left transition-all hover:shadow-md hover:border-primary/50 bg-bg-surface ${\n selectedCategory === category.id ? 'border-primary ring-2 ring-primary/20' : ''\n }`}\n >\n <div className=\"text-2xl mb-2\">{category.icon || '📁'}</div>\n <p className=\"font-medium text-text-primary mb-1\">{category.name}</p>\n <p className=\"text-xs text-text-secondary\">\n {category.articleCount || 0} articles\n </p>\n </button>\n ))}\n </div>\n </div>\n )}\n\n {/* Popular Articles */}\n {!showSearch && !popularLoading && popularArticles.length > 0 && (\n <div>\n <h2 className=\"text-lg font-semibold mb-4 flex items-center gap-2 text-text-primary\">\n <TrendingUp size={20} className=\"text-primary\" />\n Popular Articles\n </h2>\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n {popularArticles.map((article: KnowledgeBaseArticle) => (\n <button\n type=\"button\"\n key={article.id}\n onClick={() => navigate(`${basePath}/kb/articles/${article.slug}`)}\n className=\"p-5 rounded-xl border bg-bg-surface text-left transition-all hover:shadow-md hover:border-primary/50 group\"\n >\n <h3 className=\"font-semibold text-text-primary mb-2 group-hover:text-primary transition-colors\">\n {article.title}\n </h3>\n <p className=\"text-sm text-text-secondary mb-3 line-clamp-2\">{article.excerpt}</p>\n <div className=\"flex items-center gap-4 text-xs text-text-secondary\">\n <span className=\"flex items-center gap-1\">\n <Eye size={14} />\n {article.viewCount} views\n </span>\n <span className=\"flex items-center gap-1\">\n <ThumbsUp size={14} />\n {article.helpfulCount} helpful\n </span>\n </div>\n </button>\n ))}\n </div>\n </div>\n )}\n\n {/* Articles List */}\n <div>\n <div className=\"flex items-center justify-between mb-4\">\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {showSearch && query\n ? `Search Results for \"${query}\"`\n : selectedCategoryName || 'All Articles'}\n </h2>\n {(showSearch || selectedCategory) && (\n <Button variant=\"outline\" size=\"sm\" onClick={handleClearSearch}>\n {showSearch ? 'Clear Search' : 'All Articles'}\n </Button>\n )}\n </div>\n\n {isLoading ? (\n <LoadingState message=\"Loading articles...\" />\n ) : displayArticles.length > 0 ? (\n <>\n <div className=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\">\n {displayArticles.map((article: KnowledgeBaseArticle) => (\n <button\n type=\"button\"\n key={article.id}\n onClick={() => navigate(`${basePath}/kb/articles/${article.slug}`)}\n className=\"p-6 rounded-xl border bg-bg-surface text-left transition-all hover:shadow-md hover:border-primary/50 group\"\n >\n <div className=\"flex items-center gap-2 mb-2 flex-wrap\">\n {article.category && (\n <Badge\n variant=\"outline\"\n className={getCategoryBadgeClass(article.category.color)}\n >\n {article.category.name}\n </Badge>\n )}\n {article.status === 'DRAFT' && (\n <Badge className=\"bg-status-warning-bg-subtle text-status-warning-text text-xs\">\n <GlobeLock size={10} className=\"mr-1\" />\n Draft\n </Badge>\n )}\n {article.status === 'ARCHIVED' && (\n <Badge className=\"bg-bg-sunken text-text-secondary text-xs\">\n <Archive size={10} className=\"mr-1\" />\n Archived\n </Badge>\n )}\n </div>\n <h3 className=\"font-semibold text-lg text-text-primary mb-2 group-hover:text-primary transition-colors\">\n {article.title}\n </h3>\n <p className=\"text-sm text-text-secondary mb-4 line-clamp-3\">\n {article.excerpt}\n </p>\n <div className=\"flex items-center justify-between text-xs text-text-secondary\">\n <span className=\"flex items-center gap-1\">\n <Eye size={14} />\n {article.viewCount}\n </span>\n <span className=\"flex items-center gap-1\">\n <ThumbsUp size={14} />\n {article.helpfulCount}\n </span>\n </div>\n </button>\n ))}\n </div>\n\n {hasMoreArticles && (\n <div className=\"flex justify-center mt-6\">\n <Button variant=\"outline\" onClick={loadMoreArticles}>\n Load More\n </Button>\n </div>\n )}\n </>\n ) : (\n <EmptyState\n icon={<BookOpen size={48} />}\n title={showSearch ? 'No articles found' : 'No articles available'}\n description={\n showSearch\n ? 'Try adjusting your search terms or browse by category'\n : 'Check back later for helpful articles and guides'\n }\n />\n )}\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;AA0BA,SAAgB,IAAyB;CACvC,IAAM,IAAW,GAAa,EACxB,EAAE,cAAW,OAAO,GAAY,EAChC,EACJ,aACA,oBACA,eACA,kBACA,oBACA,mBACA,sBACA,kBACA,mBACA,mBACA,oBACA,wBACE,GAA4B,EAE1B,CAAC,GAAO,KAAY,EAAS,GAAG,EAChC,CAAC,GAAkB,KAAuB,EAAwB,KAAK,EACvE,CAAC,GAAY,KAAiB,EAAS,GAAM,EAE7C,KAAgB,MAAuB;AAE3C,EADA,EAAE,gBAAgB,EACd,EAAM,MAAM,KACd,EAAe,GAAO,EAAE,YAAY,KAAoB,KAAA,GAAW,CAAC,EACpE,EAAc,GAAK;IAIjB,UAA0B;AAI9B,EAHA,EAAS,GAAG,EACZ,EAAc,GAAM,EACpB,EAAoB,KAAK,EACzB,EAAe;GAAE,YAAY,KAAA;GAAW,MAAM,EAAE;GAAE,CAAC;IAG/C,IAAuB,EAAW,MACrC,MAA6B,EAAS,OAAO,EAC/C,EAAE,MAEG,IACJ,KAAc,IAAS,IAAsD,GACzE,IAAY,IAAa,IAAgB;AAE/C,QACE,kBAAC,GAAD;EACE,OAAM;EACN,UAAS;EACT,MAAM,kBAAC,GAAD,EAAU,MAAM,IAAM,CAAA;EAC5B,eACE,kBAAC,GAAD;GAAQ,eAAe,EAAS,GAAG,EAAS,kBAAkB;aAA9D,CACE,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA,EAAA,cAEX;;YARb;GAYE,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,QAAD;KAAM,UAAU;KAAc,WAAU;eAAxC;MACE,kBAAC,GAAD;OACE,MAAM;OACN,WAAU;OACV,CAAA;MACF,kBAAC,GAAD;OACE,MAAK;OACL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