Wp-calypso: Gutenboarding: domains - add notice for specific TLDs requiring HSTS

Created on 9 Apr 2020  路  10Comments  路  Source: Automattic/wp-calypso

Domains returning hsts_required:true from the API need a special HSTS notification.

Designs for Gutenboarding

Screenshot 2020-05-14 at 13 20 43

Plus similar popover like in Calypso.

Implementation in Calypso:

image

Screenshot 2020-04-24 at 16 07 01

Design Needed Domains [Goal] New Onboarding [Type] Question [Type] Task

Most helpful comment

I've just deployed D43163-code - it returns hsts_required: true in the payload when HSTS is required, and does not include the flag otherwise.

All 10 comments

@dubielzyk can we add similar i -icon that's visible here in screenshots to the domains list?

It could open either core popover or tooltip with the exact same text.

Yep. Let's stick with the same pattern. I'll update a designs.

@daledupreez hi!

What do you think if requires_hsts: true|false info would be coming directly from the domains suggestions API? I think that would simplify a lot of things.

Currently checking for hsts requires passing a slug such as product_slug: "dotequipment_domain" to this helper, which then compares it to _product list_.

https://github.com/Automattic/wp-calypso/blob/0699b68413f1d1692392fd5a354ec35e5ea2c21f/client/lib/domains/index.js#L161-L165

That works fine in Calypso, but if we'd like this feature to be easy to port to wp-admin context (and we do!), it would be great if we don't need to deal with massive Calypso state.

With API approach, the check in UI would become super simple:

{ suggestion.hsts_required && <HstsInfo tld={ domainTld } /> }

Thoughts?

@simison, I think we can refactor the logic here somewhat, but I don't think we can escape the dependency on the products -- we need the product data to show accurate pricing details. We can shift that out of the state if need be, but I think you're still going to need the relevant data in the component.

@simison, I looked into this some more, and I realized that we're sending the cost back in the response data -- we should be able to do the same for the HSTS required flag. I'll work on a diff for that tomorrow, using the name hsts_required as a boolean.

馃槏馃槏馃槏馃槏馃尰馃尰馃帀

OK, the back end change to add the flag in D43163-code has been reviewed and approved but not deployed. Feel free to ping me if you want/need that deployed before Monday, which is when I am planning on deploying for now.

馃憤 Monday works great for me, thanks! I'll add the UI on Monday as well.

I've just deployed D43163-code - it returns hsts_required: true in the payload when HSTS is required, and does not include the flag otherwise.

I've created a separate issue https://github.com/Automattic/wp-calypso/issues/45449 for the UI tooltip component that is also needed in other parts of Gutenboarding (eg: plans grid).

Was this page helpful?
0 / 5 - 0 ratings