diff --git a/app/javascript/dashboard/api/helpCenter/pdfDocuments.js b/app/javascript/dashboard/api/helpCenter/pdfDocuments.js
new file mode 100644
index 000000000..876678edf
--- /dev/null
+++ b/app/javascript/dashboard/api/helpCenter/pdfDocuments.js
@@ -0,0 +1,29 @@
+/* global axios */
+import ApiClient from '../ApiClient';
+
+class PdfDocumentsAPI extends ApiClient {
+ constructor() {
+ super('portals', { accountScoped: true });
+ }
+
+ uploadContent(portalSlug, formData) {
+ return axios.post(`${this.url}/${portalSlug}/upload_content`, formData, {
+ headers: {
+ 'Content-Type': 'multipart/form-data',
+ },
+ });
+ }
+
+ getGeneratedContent(portalSlug) {
+ return axios.get(`${this.url}/${portalSlug}/generated_content`);
+ }
+
+ publishContent(portalSlug, responseIds, categoryId = null) {
+ return axios.post(`${this.url}/${portalSlug}/publish_content`, {
+ response_ids: responseIds,
+ category_id: categoryId
+ });
+ }
+}
+
+export default PdfDocumentsAPI;
\ No newline at end of file
diff --git a/app/javascript/dashboard/components-next/HelpCenter/Pages/PdfDocumentsPage/ContentGeneration.vue b/app/javascript/dashboard/components-next/HelpCenter/Pages/PdfDocumentsPage/ContentGeneration.vue
new file mode 100644
index 000000000..028bf090b
--- /dev/null
+++ b/app/javascript/dashboard/components-next/HelpCenter/Pages/PdfDocumentsPage/ContentGeneration.vue
@@ -0,0 +1,284 @@
+
+
+
+
+ {{ $t('HELP_CENTER.CONTENT_GENERATION.TITLE') }}
+
+
+ {{ $t('HELP_CENTER.CONTENT_GENERATION.DESCRIPTION') }}
+
+
+
+
+
+
+ {{ $t('HELP_CENTER.CONTENT_GENERATION.UPLOAD_TITLE') }}
+
+
+
+
+
+
+ {{ $t('HELP_CENTER.CONTENT_GENERATION.DRAG_DROP') }}
+
+
+
+
+
+
+
+
{{ $t('HELP_CENTER.CONTENT_GENERATION.UPLOADING') }}
+
+
+
+
+
{{ $t('HELP_CENTER.CONTENT_GENERATION.UPLOAD_SUCCESS') }}
+
+
+
+
+
+
+
+
+
+
+ {{ $t('HELP_CENTER.CONTENT_GENERATION.GENERATED_CONTENT') }}
+
+
+
+
+
+
+
+
+
+
+ {{ response.question }}
+
+
+ {{ response.answer }}
+
+
+ {{ $t('HELP_CENTER.CONTENT_GENERATION.FROM_DOCUMENT') }}: {{ response.documentable?.name }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('HELP_CENTER.CONTENT_GENERATION.NO_CONTENT') }}
+
+
+
+
+
+
+
{{ $t('HELP_CENTER.CONTENT_GENERATION.LOADING') }}
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/javascript/dashboard/components-next/HelpCenter/Pages/PdfDocumentsPage/PdfDocumentsPage.vue b/app/javascript/dashboard/components-next/HelpCenter/Pages/PdfDocumentsPage/PdfDocumentsPage.vue
new file mode 100644
index 000000000..a10219513
--- /dev/null
+++ b/app/javascript/dashboard/components-next/HelpCenter/Pages/PdfDocumentsPage/PdfDocumentsPage.vue
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+ {{ $t('HELP_CENTER.CONTENT_GENERATION.TITLE') }}
+
+
+ {{ $t('HELP_CENTER.CONTENT_GENERATION.DESCRIPTION') }}
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/javascript/dashboard/components-next/captain/assistant/DocumentCard.vue b/app/javascript/dashboard/components-next/captain/assistant/DocumentCard.vue
index d6e546581..94fdf6c64 100644
--- a/app/javascript/dashboard/components-next/captain/assistant/DocumentCard.vue
+++ b/app/javascript/dashboard/components-next/captain/assistant/DocumentCard.vue
@@ -63,6 +63,18 @@ const menuItems = computed(() => {
const createdAt = computed(() => dynamicTime(props.createdAt));
+const isPdfDocument = computed(() => props.externalLink?.startsWith('PDF:'));
+const displayLink = computed(() => {
+ if (isPdfDocument.value) {
+ // Remove 'PDF: ' prefix and timestamp suffix for display
+ const fullName = props.externalLink.substring(5);
+ // Remove timestamp suffix (_YYYYMMDDHHMMSS) if present
+ return fullName.replace(/_\d{14}$/, '');
+ }
+ return props.externalLink;
+});
+const linkIcon = computed(() => isPdfDocument.value ? 'i-ph-file-pdf' : 'i-ph-link-simple');
+
const handleAction = ({ action, value }) => {
toggleDropdown(false);
emit('action', { action, value, id: props.id });
@@ -106,8 +118,8 @@ const handleAction = ({ action, value }) => {
-
- {{ externalLink }}
+
+ {{ displayLink }}
{{ createdAt }}
diff --git a/app/javascript/dashboard/components-next/captain/pageComponents/document/CreateDocumentDialog.vue b/app/javascript/dashboard/components-next/captain/pageComponents/document/CreateDocumentDialog.vue
index 7db74f523..fc7591966 100644
--- a/app/javascript/dashboard/components-next/captain/pageComponents/document/CreateDocumentDialog.vue
+++ b/app/javascript/dashboard/components-next/captain/pageComponents/document/CreateDocumentDialog.vue
@@ -23,7 +23,9 @@ const handleSubmit = async newDocument => {
dialogRef.value.close();
} catch (error) {
const errorMessage =
- error?.response?.message || t(`${i18nKey}.ERROR_MESSAGE`);
+ error?.response?.data?.message ||
+ error?.response?.message ||
+ t(`${i18nKey}.ERROR_MESSAGE`);
useAlert(errorMessage);
}
};
diff --git a/app/javascript/dashboard/components-next/captain/pageComponents/document/DocumentForm.vue b/app/javascript/dashboard/components-next/captain/pageComponents/document/DocumentForm.vue
index d85ba8a06..a191fc184 100644
--- a/app/javascript/dashboard/components-next/captain/pageComponents/document/DocumentForm.vue
+++ b/app/javascript/dashboard/components-next/captain/pageComponents/document/DocumentForm.vue
@@ -1,9 +1,10 @@