-
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
Purchases: Add option to remove expiring purchases #2602
Conversation
|
||
getInitialState() { | ||
return { | ||
isDialogOpen: 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.
Shouldn't we name this property showDialog
as we did in other components? That's also what the readme file suggests in its examples.
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'm a fan of prefixing boolean values with "is" to indicate that they are boolean. showDialog
without context sounds like it actually shows the dialog (like closeDialog
, which is a method name this file uses). A couple checkout components use isDialogVisible
for this value, presumably for the same reason.
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'm this sort of fan as well - I just wanted to stay consistent with the rest of our code. Looks like you updated it to isDialogVisible
, that's perfect.
361fa31
to
b7a4342
Compare
One outstanding issue here (possibly the only one) is that when the |
@@ -21,6 +22,7 @@ import NoticeAction from 'components/notice/notice-action'; | |||
import { oldShowcaseUrl } from 'lib/themes/helpers'; | |||
import paths from '../paths'; | |||
import PaymentLogo from 'components/payment-logo'; | |||
import RemovePurchase from '../remove-purchase'; |
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.
This should be one line below in order to keep imports sorted.
I've removed some old code, fixed expired purchases that weren't taken into account, and updated the remove link to look as requested. |
5b25c11
to
da94c39
Compare
Thanks @stephanethomas. I added da94c39 to remove purchases from the |
|
||
return ( | ||
<CompactCard className="remove-purchase__card" onClick={ this.openDialog }> | ||
<a > |
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.
@stephanethomas Do you think it is better to use an anchor with no href
attribute here, or use cursor: pointer;
?
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.
The problem with using an href
attribute in this anchor is that the cursor will only change if you hover the link itself whereas we probably want to change it whenever the cursor enters the card (especially since the onclick
event applies to the whole card). So cursor: pointer;
would be needed anyway (@ebinnion or @lezama: that's probably something you want to fix in the <DeleteUser />
component).
Note I had to inject this anchor in this CompactCard
because I wasn't able to use its href
prop in a way which would give me similar results.
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.
Note I don't mind adding href="#"
to this anchor since this is pretty much a convention. If not, we should get rid of this unnecessary white space though.
We have a different copy for the dialog when removing domains (#1402 (comment)):
Right now, it shows the same copy for all kinds of upgrades: I wonder if we should tweak the confirmation notice as well. Right now it says |
I tried removing the domain fabianaupgrades20151120125457.net from my account, but that left the Domain Mapping associated to it behind: I haven't been able to test this with a domain that had privacy enabled as well. I'd expect that to leave a subscription in the admin tools which won't be displayed in Edit: Just tested that case. It does exactly what I expected above ^. |
Right now, removing a plan will leave the domain associated to it behind. That can be confusing to users looking to get rid of all their purchases with WordPress.com. We should add some messaging explaining the domain will remain in the account. cc @mikeshelton1503 |
Related to the issue I reported here, I noticed that removing a domain does not cancel its registration. I've tested this with both testingupgrades.org and fabianaupgrades20151120125457.net, and the registrations should have been canceled with WWD. |
@Lochlaer I'm curious how well this flow works for Google Apps. Could you give it a try? You should see:
Seems everything works as expected on WordPress.com. Is it all OK from Google's end as well? |
I have updated the dialog to display a custom text for domain registrations. I have also fixed the heading on small screens. I'm not a big fan of this fix but otherwise it would mean updating styles from the |
`ManagePurchase`
…se page We don't need this text any longer since we moved removal of purchase into a dedicated component.
Users should now be able to remove any purchase that is not subscribed expect when it is included in a plan.
This also removes the chevron on the right.
Previously, purchases that were absent from the request to `/me/purchases` were kept in memory.
…ge Purchase page This fixes a display issue that happens with small screens when the product name or the domain name are too long.
… Purchase page This fixes a display issue that happens with small screens when the product name or the domain name are too long and can't be wrapped.
…Purchase page This also adds a default url to an empty anchor.
This adds the name of the purchase - except for domains where this removes the site url - to match the copy used in the dialog. This also removes an unnecessary component in a translation as well as a variable.
This also adds information for translators and removes a tag that cannot contain block-level elements.
4e058a6
to
4eb6160
Compare
Purchases: Add option to remove expiring purchases
Fixes #1402 by adding an option to
ManagePurchase
that opens a dialog to remove an expiring purchase.Testing
/purchases/:site/:purchase_id
for a site/purchase that has auto-renew disabled and is outside the refund period./purchases
with a notice indicating that the purchase was removed.