Skip to content

Conversation

@michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Aug 7, 2025

Resolves #17836

Summary by CodeRabbit

  • New Features

    • Added support for handling image fields when creating documents from templates. Users can now provide image URLs for image blocks in the template, which will be included in the created document.
  • Chores

    • Updated the package version to 1.0.2.

@vercel
Copy link

vercel bot commented Aug 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Ignored (Inspect) Aug 7, 2025 8:55pm
pipedream-docs ⬜️ Ignored (Inspect) Aug 7, 2025 8:55pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Aug 7, 2025 8:55pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 7, 2025

Walkthrough

The PandaDoc "Create Document from Template" action was updated to support image fields. The code now detects image blocks in the template, exposes them as optional string URL properties, and includes user-supplied image URLs in the API payload. The package version was also incremented.

Changes

Cohort / File(s) Change Summary
Action: Image Support & Version Bump
components/pandadoc/actions/create-document-from-template/create-document-from-template.mjs
Enhanced to detect image blocks in templates, expose them as optional string properties, collect image URLs, and include an images array in the API payload. Version updated from 0.0.7 to 0.0.8.
Package Version Bump
components/pandadoc/package.json
Package version incremented from 1.0.1 to 1.0.2. No other changes.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Action
    participant PandaDocAPI

    User->>Action: Provide templateId and image URLs
    Action->>PandaDocAPI: GET /templates/:id/details
    PandaDocAPI-->>Action: Return template fields & images
    Action->>Action: Build props for fields & images
    User->>Action: Submit document creation with image URLs
    Action->>PandaDocAPI: POST /documents (with images array)
    PandaDocAPI-->>Action: Return document creation result
    Action-->>User: Return result
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Assessment against linked issues

Objective Addressed Explanation
Add optional image props for each image block in the template (#17836)
Fetch template details to identify image blocks and expose them as props (#17836)
Include user-supplied image URLs in the "images" array in the API payload (#17836)
Update documentation or code to reference the PandaDoc API for image support (#17836)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes found.

Poem

A bunny hopped through PandaDoc’s code,
Now images can join your template’s load!
With URLs in hand, and a version anew,
Creating docs with pictures is easy to do.
🐇✨
“Upload your panda, your chart, or your bear—
Now every doc’s got visual flair!”

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue-17836

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
components/pandadoc/actions/create-document-from-template/create-document-from-template.mjs (1)

122-135: Image processing logic correctly implemented.

The implementation properly:

  • Initializes an empty images array
  • Iterates through template images only if they exist
  • Checks for user-provided image URLs using the block_uuid as the property key
  • Constructs image objects with the correct structure (name and urls array) as per PandaDoc API specification

Consider adding URL validation for better error handling:

+ if (this[image.block_uuid] && this[image.block_uuid].trim()) {
+   // Optionally validate URL format here
    images.push({
      name: image.name,
      urls: [
        this[image.block_uuid],
      ],
    });
+ }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eca7334 and c82c199.

📒 Files selected for processing (2)
  • components/pandadoc/actions/create-document-from-template/create-document-from-template.mjs (6 hunks)
  • components/pandadoc/package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.

Applied to files:

  • components/pandadoc/package.json
📚 Learning: 2024-10-30T15:24:39.294Z
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".

Applied to files:

  • components/pandadoc/actions/create-document-from-template/create-document-from-template.mjs
🔇 Additional comments (7)
components/pandadoc/package.json (1)

3-3: LGTM! Appropriate version bump for feature addition.

The version increment from 1.0.1 to 1.0.2 correctly reflects the addition of image support functionality to the PandaDoc component.

components/pandadoc/actions/create-document-from-template/create-document-from-template.mjs (6)

8-8: LGTM! Version increment aligns with feature addition.

The action version bump from 0.0.7 to 0.0.8 correctly reflects the addition of image support functionality.


55-57: Good optimization to prevent unnecessary API calls.

The early return when templateId is not set prevents unnecessary template fetching, improving performance.


58-62: Template fetch correctly extended to include images.

The destructuring now includes both fields and images from the template, aligning with the PR objective to support image handling.


73-81: Image properties correctly implemented.

The implementation properly creates dynamic properties for each image using block_uuid as the key and provides descriptive labels. This follows the same pattern as field handling and aligns with PandaDoc API requirements.


108-112: Template fetch consistently updated to include images.

The destructuring correctly includes both fields (aliased as items) and images (aliased as templateImages) from the template response.


146-146: Images correctly included in API payload.

The images array is properly added to the data payload sent to the createDocument API call, completing the image support implementation.

Copy link
Collaborator

@GTFalcao GTFalcao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@vunguyenhung vunguyenhung merged commit 647eb7d into master Aug 8, 2025
11 checks passed
@vunguyenhung vunguyenhung deleted the issue-17836 branch August 8, 2025 03:04
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.

[ACTION] PandaDoc: Create Document from Template *with Image*

4 participants