-
Notifications
You must be signed in to change notification settings - Fork 427
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
fix(core): update getPublishDateFromRelease, add ScheduledRelease type #7754
base: corel
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
@@ -64,28 +64,12 @@ export function getCreateVersionOrigin(documentId: string): VersionOriginTypes { | |||
} | |||
|
|||
/** @internal */ | |||
export function getPublishDateFromRelease(release: ReleaseDocument): Date { | |||
export function getPublishDateFromRelease(release: ScheduledRelease): Date { |
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.
Updated the type to ScheduledRelease
to assert that a date will always be returned.
No changes to documentation |
Component Testing Report Updated Nov 5, 2024 12:47 PM (UTC) ✅ All Tests Passed -- expand for details
|
⚡️ Editor Performance ReportUpdated Tue, 05 Nov 2024 12:49:49 GMT
Detailed information🏠 Reference resultThe performance result of
🧪 Experiment resultThe performance result of this branch
📚 Glossary
|
7dda639
to
a1a7b98
Compare
/** | ||
* @internal | ||
*/ | ||
export const isScheduledRelease = (release: ReleaseDocument): release is ScheduledRelease => |
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.
Hmm, the naming here is vague to me, because a scheduled release to me has state
of scheduled
or scheduling
. This is like a prescheduled release, no? I wonder if we should introduce a name like intendedScheduledRelease
?
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.
Yes, I think you are right, we need to find a better name for the intended schedule releases
@@ -170,7 +170,7 @@ export const GlobalPerspectiveMenuItem = forwardRef< | |||
</Text> | |||
{!isPublishedPerspective(release) && | |||
release.metadata.releaseType !== 'undecided' && | |||
(release.publishAt || release.metadata.intendedPublishAt) && ( |
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.
These aren't a like for like swap I don't think, since isScheduledRelease
only looks at intendedPublishAt
. I can't recall exactly but it might be worth verifying that when a scheduled release is actually scheduled, and it's possible to reconfirm the scheduled datetime, whether we also update the intendedPublishAt
to reflex this too.
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.
Are we removing the intendedPublishAt
when scheduling it?
It's confusing how close this names are.
Maybe we need to find a better name for the releaseType ="scheduled"
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.
I think we leave intendedPublishAt
as whatever it was, and only persist this new date into publishAt
via the schedule action. We should agree either to clear it or always keep it aligned. But of course the schedule action can also be triggered outwith studio, so guaranteeing they match isn't possible
Description
We had two functions with similar names doing different things:
This PR removes the
getReleasePublishDate
function and updatesgetPublishDateFromRelease
to always return a date and assert the correct type is passed.What to review
Testing
Notes for release