-
-
Notifications
You must be signed in to change notification settings - Fork 3k
feat: Option to export nested documents #9679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| return; | ||
| } | ||
|
|
||
| const id = toast.loading(`${t("Exporting")}…`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems a toast is being rendered for PDF export.
This is removed in this PR - should this be maintained?
| includeState: !accept?.includes("text/markdown"), | ||
| }); | ||
|
|
||
| authorize(user, "download", document); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This policy check was missing in the API earlier.
Right now guests can download a document.. I'm thinking this policy should be changed to restrict them..?
|
This PR is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days |
|
@tommoor - resolved the merge conflicts here too ✌️ |
| public async exportDocument(): Promise<string> { | ||
| throw new Error("JSON export unsupported for individual document."); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The exportDocument method signature in ExportJSONTask doesn't match the abstract method defined in the parent ExportTask class. It's missing the required parameters:
// Current implementation
public async exportDocument(): Promise<string> {
throw new Error("JSON export unsupported for individual document.");
}
// Should match the abstract method signature
public async exportDocument(
document: Document,
documentStructure: NavigationNode[]
): Promise<string> {
throw new Error("JSON export unsupported for individual document.");
}Please update the method signature to include the required parameters to properly implement the abstract method.
| public async exportDocument(): Promise<string> { | |
| throw new Error("JSON export unsupported for individual document."); | |
| } | |
| public async exportDocument( | |
| document: Document, | |
| documentStructure: NavigationNode[] | |
| ): Promise<string> { | |
| throw new Error("JSON export unsupported for individual document."); | |
| } |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
| const format = accept?.includes("text/html") | ||
| ? FileOperationFormat.HTMLZip | ||
| : accept?.includes("text/markdown") | ||
| ? FileOperationFormat.MarkdownZip | ||
| : accept?.includes("application/pdf") | ||
| ? FileOperationFormat.PDF | ||
| : null; | ||
|
|
||
| if (format === FileOperationFormat.PDF) { | ||
| throw IncorrectEditionError( | ||
| "PDF export is not available in the community edition" | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PDF export error check is positioned before the includeChildDocuments condition, which will prevent any PDF export regardless of whether it's for a single document or nested documents. This inconsistency should be addressed by either:
- Moving the PDF format check inside the
includeChildDocumentsblock if PDF export should be allowed for single documents, or - Keeping the check where it is if PDF export should be blocked for all scenarios
Ensuring consistent behavior for both single and nested document exports will provide a better user experience.
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
|
This PR is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days |
Closes #6884
Document download menu is replaced with a dialog that has an option to include child documents.