-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Plans: Add expired state to PlanStatus
#1780
Conversation
PlanStatus
@@ -7,7 +7,7 @@ function createSiteSpecificPlanObject( plan ) { | |||
return { | |||
currentPlan: Boolean( plan.current_plan ), | |||
expiry: plan.expiry, | |||
expiryMoment: moment( plan.expiry ), | |||
expiryMoment: moment( plan.expiry ).startOf( 'day' ), |
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.
@Tug The issue we encountered during the meetup is simplified a little bit by:
- Ensuring that all moments (those in this assembler and the current moment calculated with
moment()
) are set to the start of the day. - Using
moment().startOf( 'day' )
instead ofmoment().set( { hour: 0, ... } )
each time.
c2e90b8
to
f195578
Compare
This has been rebased to pull in changes from #1708 and is ready for review. |
return true; | ||
} | ||
|
||
return false; |
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.
What about the following simpler approach?
export function isInGracePeriod( plan ) {
return ( getDaysUntilUserFacingExpiry( plan ) <= 0 ) && ( getDaysUntilExpiry( plan ) >= 0 );
}
I added a few remarks but otherwise this works as advertised. |
5cf6219
to
4625845
Compare
Thanks for looking at this, @stephanethomas. I updated the commits to address your feedback with the following changes:
|
7a59eb6
to
b6780fb
Compare
Some margin must have been added or something, so it wasn't fitting into one line in english. Also added some comment and reviewed the code 👍 LGTM |
I really don't think we should change the size of the font to avoid having two lines of text. I bet it's longer in French and in other languages. If this is really an issue, we should prevent it from wrapping using the appropriate CSS property and take advantage of the flexbox layout to move the button below if there is no space left. |
For the font-size, the original intended size was For other languages it may still wrap but I'm ok with this. Stephane's suggestion could work too but we're not gaining too much with that method because the overall height of the section would be taller so it would just be a trade off of evils. |
b6780fb
to
dac331f
Compare
dac331f
to
f4eb05f
Compare
Plans: Add expired state to `PlanStatus`
I updated @Tug's commit to change the font size to |
Addresses part of #1471.
Testing
Reviews