Skip to content

Conversation

@hmacr
Copy link
Collaborator

@hmacr hmacr commented Jul 19, 2025

Closes #6884

Document download menu is replaced with a dialog that has an option to include child documents.

@hmacr hmacr requested a review from tommoor July 19, 2025 12:44
return;
}

const id = toast.loading(`${t("Exporting")}…`);
Copy link
Collaborator Author

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);
Copy link
Collaborator Author

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..?

@github-actions
Copy link
Contributor

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

@github-actions github-actions bot added the stale label Sep 18, 2025
@hmacr hmacr removed the stale label Sep 18, 2025
@hmacr
Copy link
Collaborator Author

hmacr commented Sep 21, 2025

@tommoor - resolved the merge conflicts here too ✌️

Comment on lines +181 to +183
public async exportDocument(): Promise<string> {
throw new Error("JSON export unsupported for individual document.");
}
Copy link
Contributor

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.

Suggested change
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

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

Comment on lines +771 to +782
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"
);
Copy link
Contributor

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:

  1. Moving the PDF format check inside the includeChildDocuments block if PDF export should be allowed for single documents, or
  2. 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

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

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

@github-actions github-actions bot added the stale label Dec 5, 2025
@tommoor tommoor removed the stale label Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Export as Markdown & Export as HTML does not export nested documents but only the root document

3 participants