Skip to content
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

Place scheduled on sectionQuery, use startDate from schedule. #249

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/section-query-generator/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ module.exports = async ({
else: '$expires',
},
},
scheduled: '$startDate',
Copy link
Member

Choose a reason for hiding this comment

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

What's this intended to be used for?

Copy link
Member Author

Choose a reason for hiding this comment

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

Currently there isn't a field on sectionQuery if the schedule has a startDate set prior to the content published date (why this is a "thing" beats me). This adds one.

Screen Shot 2022-02-15 at 2 40 29 PM

Screen Shot 2022-02-15 at 2 40 24 PM

Copy link
Member

Choose a reason for hiding this comment

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

For what purpose? Section query intentionally uses published date to correct certain schedule start dates... in that example, that start date is actually wrong... you shouldn't be able to start content before it's actually published. Nothing in the interface prevents this, per se, hence why section query enforces this

Copy link
Member Author

@Shinsina Shinsina Feb 15, 2022

Choose a reason for hiding this comment

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

https://trello.com/c/XpVjx5vG/277-incorrect-date-being-displayed-on-content-list-items-for-non-primary-sites

I don't agree with the idea of putting dates prior to the publish date anywhere.

},
},
{ $sort: { start: -1 } },
Expand All @@ -82,6 +83,7 @@ module.exports = async ({
siteId: '$siteId',
start: '$start',
end: '$end',
scheduled: '$scheduled',
},
},
},
Expand Down