Skip to content

Notion Database Page - Support End Dates #14556

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 3 commits into from
Nov 8, 2024
Merged

Notion Database Page - Support End Dates #14556

merged 3 commits into from
Nov 8, 2024

Conversation

michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Nov 5, 2024

Resolves #14451

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced date property handling in Notion, now supporting both single date strings and date ranges.
  • Version Updates

    • Updated versions for various Notion actions:
      • notion-append-block: 0.2.15 → 0.2.16
      • create-page-from-database: 0.1.13 → 0.1.14
      • create-page: 0.2.11 → 0.2.12
      • duplicate-page: 0.0.7 → 0.0.8
      • update-page: 1.1.1 → 1.1.2
      • Overall package version: 0.2.4 → 0.2.5

Copy link

vercel bot commented Nov 5, 2024

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) Visit Preview Nov 5, 2024 7:02pm
pipedream-docs ⬜️ Ignored (Inspect) Nov 5, 2024 7:02pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Nov 5, 2024 7:02pm

Copy link
Contributor

coderabbitai bot commented Nov 5, 2024

Warning

Rate limit exceeded

@michelle0927 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 35 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 8f9e1cc and c44847c.

Walkthrough

This pull request primarily involves updating the version numbers across several Notion action files and the package.json file. The version increments are as follows: notion-append-block from 0.2.15 to 0.2.16, create-page-from-database from 0.1.13 to 0.1.14, create-page from 0.2.11 to 0.2.12, duplicate-page from 0.0.7 to 0.0.8, update-page from 1.1.1 to 1.1.2, and the package.json from 0.2.4 to 0.2.5. Additionally, the date property in NOTION_PAGE_PROPERTIES has been modified to support both single date strings and date ranges.

Changes

File Path Change Summary
components/notion/actions/append-block/append-block.mjs Version updated from "0.2.15" to "0.2.16"
components/notion/actions/create-page-from-database/create-page-from-database.mjs Version updated from "0.1.13" to "0.1.14"
components/notion/actions/create-page/create-page.mjs Version updated from "0.2.11" to "0.2.12"
components/notion/actions/duplicate-page/duplicate-page.mjs Version updated from "0.0.7" to "0.0.8"
components/notion/actions/update-page/update-page.mjs Version updated from "1.1.1" to "1.1.2"
components/notion/common/notion-page-properties.mjs Updated date property example and logic
components/notion/package.json Version updated from "0.2.4" to "0.2.5"

Assessment against linked issues

Objective Addressed Explanation
Support end dates in Notion date property (#14451)

Possibly related PRs

Suggested labels

enhancement, bug

🐰 In the garden of code, we hop with glee,
Version numbers rise, as bright as can be!
From 0.2.15 to 0.2.16,
Each change we make, a little link!
With dates that now dance, both start and end,
In Notion's embrace, our joy we send! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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 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: 1

🧹 Outside diff range and nitpick comments (1)
components/notion/common/notion-page-properties.mjs (1)

67-67: Consider improving the example format for better readability.

The example effectively shows both formats but could be more intuitive with:

  1. More readable dates (e.g., showing a meaningful date range like a week)
  2. Unescaped quotes for better readability
-    example: "2022-05-15T18:47:00.000Z or { \"start\": \"2022-05-15T18:47:00.000Z\", \"end\": \"2022-06-15T18:47:00.000Z\" }",
+    example: "2024-01-01T00:00:00.000Z or { 'start': '2024-01-01T00:00:00.000Z', 'end': '2024-01-07T00:00:00.000Z' }",
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 545c4a7 and 8f9e1cc.

📒 Files selected for processing (7)
  • components/notion/actions/append-block/append-block.mjs (1 hunks)
  • components/notion/actions/create-page-from-database/create-page-from-database.mjs (1 hunks)
  • components/notion/actions/create-page/create-page.mjs (1 hunks)
  • components/notion/actions/duplicate-page/duplicate-page.mjs (1 hunks)
  • components/notion/actions/update-page/update-page.mjs (1 hunks)
  • components/notion/common/notion-page-properties.mjs (1 hunks)
  • components/notion/package.json (1 hunks)
✅ Files skipped from review due to trivial changes (6)
  • components/notion/actions/append-block/append-block.mjs
  • components/notion/actions/create-page-from-database/create-page-from-database.mjs
  • components/notion/actions/create-page/create-page.mjs
  • components/notion/actions/duplicate-page/duplicate-page.mjs
  • components/notion/actions/update-page/update-page.mjs
  • components/notion/package.json
🔇 Additional comments (1)
components/notion/common/notion-page-properties.mjs (1)

67-76: Verify existing usage patterns of the date property.

Let's ensure this change doesn't break existing implementations and identify any places that need updates.

✅ Verification successful

Based on the analysis of the codebase, particularly the base-page-builder.mjs implementation, I can now provide a final response:

The date property implementation is safe to use

The date property handling is well-isolated and the changes are safe because:

  • The property conversion happens through a generic converter system in base-page-builder.mjs
  • Properties are processed individually through _convertPropertiesToNotion() method
  • The implementation is flexible enough to handle both string and object formats
  • No direct dependencies on the specific date format were found in other components
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for usage patterns of the date property in Notion page creation/updates

echo "Checking for direct date property usage..."
rg -l "date.*property" --type js --type mjs

echo "\nChecking for date value assignments..."
rg -B 2 -A 2 "date['\"]?\s*:\s*[{\"]" --type js --type mjs

echo "\nChecking for potential test files that might need updates..."
fd -e test.js -e test.mjs -e spec.js -e spec.mjs

Length of output: 535


Script:

#!/bin/bash
# Let's modify the commands to work without file type specifications

echo "Checking for direct date property usage..."
rg -l "date.*property"

echo -e "\nChecking for date value assignments..."
rg -B 2 -A 2 'date["\']?\s*:\s*[{\"]'

echo -e "\nChecking for files importing or using notion-page-properties..."
rg -l "notion-page-properties"

Length of output: 882


Script:

#!/bin/bash
# Let's check specific usage patterns in relevant files

echo "Checking notion-page-properties usage and imports..."
rg -p "notion-page-properties" components/notion/

echo -e "\nChecking date property usage in update-page action..."
rg -p -B 2 -A 2 "date.*property" components/notion/actions/update-page/update-page.mjs

echo -e "\nChecking actual date value formats in tests or examples..."
rg -p "\"date\":\s*[{\"]" components/notion/

Length of output: 1123


Script:

#!/bin/bash
# Let's examine the base-page-builder.mjs since it imports the properties

echo "Checking base-page-builder.mjs implementation..."
cat components/notion/actions/common/base-page-builder.mjs

echo -e "\nChecking for any test files in notion component..."
find components/notion -type f -name "*test*"

echo -e "\nChecking for example usage in documentation..."
rg -p "date.*example" components/notion/

Length of output: 10314

@michelle0927 michelle0927 merged commit a10c719 into master Nov 8, 2024
12 checks passed
@michelle0927 michelle0927 deleted the issue-14451 branch November 8, 2024 15:49
lcaresia pushed a commit that referenced this pull request Dec 3, 2024
* update data property

* versions

* update object detection
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Notion Database Page Does Not Support End Dates
2 participants