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

Merge single product backup body component master #14056

Merged
merged 31 commits into from
Nov 18, 2019

Conversation

gravityrail
Copy link
Contributor

@gravityrail gravityrail commented Nov 16, 2019

Replacement for #14027 which targets master

Changes proposed in this Pull Request:

Is this a new feature or does it add/remove features to an existing part of Jetpack?

See the P2 here for the design of this PR: p1HpG7-7MK-p2 (specifically the part titled "WP Admin Desktop")
See the P2 here for the overall MT: p1HpG7-7ET-p2

Testing instructions:

Proposed changelog entry for your changes:

  • No changelog entry needed.

robertf4 and others added 30 commits November 15, 2019 08:51
Co-Authored-By: Marin Atanasov <8436925+tyxla@users.noreply.github.com>
Co-Authored-By: Marin Atanasov <8436925+tyxla@users.noreply.github.com>
Co-Authored-By: Marin Atanasov <8436925+tyxla@users.noreply.github.com>
Co-Authored-By: Marin Atanasov <8436925+tyxla@users.noreply.github.com>
@jetpackbot
Copy link

jetpackbot commented Nov 16, 2019

Warnings
⚠️

pre-commit hook was skipped for one or more commits

⚠️

The PR is missing at least one [Status] label. Suggestions: [Status] In Progress, [Status] Needs Review

This is an automated check which relies on PULL_REQUEST_TEMPLATE. We encourage you to follow that template as it helps Jetpack maintainers do their job. If you think 'Testing instructions' or 'Proposed changelog entry' are not needed for your PR - please explain why you think so. Thanks for cooperation 🤖

Generated by 🚫 dangerJS against 50d6894

@gravityrail gravityrail added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. [Feature] Backup & Scan Plans labels Nov 16, 2019
@jeherve jeherve added this to the 8.0 milestone Nov 18, 2019
planPrice,
} ) {
export function PlanPriceDisplay( { backupPlanPrices, currencySymbol } ) {
const dailyBackupYearlyPrice = backupPlanPrices.jetpack_backup_daily.yearly;
Copy link
Member

Choose a reason for hiding this comment

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

Do we need any sort of property existence guards here?

Copy link
Contributor

Choose a reason for hiding this comment

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

In this case I don't think so. This is really just a helper component for the header component that comes in the final PR, where the property is guaranteed to exist. I prefer checking for existence much closer to the Redux connection so that helper components like this can be kept free of prop validation to keep them as simple as possible.

Copy link
Member

Choose a reason for hiding this comment

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

the property is guaranteed to exist

These are famous last words 😉

{
type: 'daily',
name: __( 'Daily Backups' ),
price: backupPlanPrices.jetpack_backup_daily.yearly,
Copy link
Member

Choose a reason for hiding this comment

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

It feels odd that we're passing an entire backupPlanPrices object to this component and only using pieces of it like this. Are we passing more than we need here?

static propTypes = {
backupPlanPrices: PropTypes.object,
currencySymbol: PropTypes.string,
setSelectedBackupType: PropTypes.func,
Copy link
Member

Choose a reason for hiding this comment

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

Are any of those props required?

daily: __( 'Upgrade to Daily Backups' ),
};

const backupOptions = [
Copy link
Member

Choose a reason for hiding this comment

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

Feels odd to be defining this in every re-render.

@@ -36,3 +81,85 @@ export function PlanRadioButton( {
</label>
);
}

// eslint-disable-next-line no-unused-vars
class SingleProductBackupBody extends React.Component {
Copy link
Member

Choose a reason for hiding this comment

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

Feels odd that we have so many components in this same file. I'd suggest keeping one component per file for consistency and readability.

render() {
const { currencySymbol, backupPlanPrices, selectedBackupType, upgradeLinks } = this.props;

const upgradeTitles = {
Copy link
Member

Choose a reason for hiding this comment

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

Feels odd to be defining this and upgradeTitles in every re-render.

radioValue,
planPrice,
} ) {
export function PlanPriceDisplay( { backupPlanPrices, currencySymbol } ) {
Copy link
Member

Choose a reason for hiding this comment

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

Seems like this component name is pretty generic but functionality-wise it's pretty backup-specific. Should we rename? Or should we allow for products to be specified and keep this as a simple presentational component?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather make it specific, as I did not design this with it being generic in mind. We can always make it generic later if we need to.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good to me 👍 Happy to change this name to a more specific one.

Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

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

Since we have issues logged for the remaining issues, this should be good to merge. Merging now.

Edit: Nevermind, I missed @tyxla's feedback, I should have refreshed. Too many PRs opened, sorry.

@jeherve jeherve added [Status] Ready to Merge Go ahead, you can push that green button! [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. [Status] Ready to Merge Go ahead, you can push that green button! labels Nov 18, 2019
@tyxla
Copy link
Member

tyxla commented Nov 18, 2019

Since we have issues logged for the remaining issues, this should be good to merge. Merging now.

Edit: Nevermind, I missed @tyxla's feedback, I should have refreshed. Too many PRs opened, sorry.

😅

I'm not even sure if I left this feedback in the right place, but please let me know if I didn't.

@gravityrail
Copy link
Contributor Author

@tyxla @robertf4 @jeherve I strongly recommend at this point that we get this merged and then open a separate PR for @tyxla's fixes. I realise that is not ideal, but the testing and feedback loop on these changes has gotten way too complicated and I think the greater good here is to get them merged, integrated and refined all together.

@robertf4
Copy link
Contributor

@tyxla @robertf4 @jeherve I strongly recommend at this point that we get this merged and then open a separate PR for @tyxla's fixes. I realise that is not ideal, but the testing and feedback loop on these changes has gotten way too complicated and I think the greater good here is to get them merged, integrated and refined all together.

I will create issues for the feedback here and get this merged, then rebase #14018 and get that merged.

Copy link
Member

@tyxla tyxla left a comment

Choose a reason for hiding this comment

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

Totally, go ahead. I don't think any of those are blocking. 🚢

@robertf4
Copy link
Contributor

Created #14065 to keep track of feedback

@robertf4 robertf4 added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! labels Nov 18, 2019
@robertf4 robertf4 merged commit 84c6664 into master Nov 18, 2019
@robertf4 robertf4 deleted the add/single-product-backup-body-component-master branch November 18, 2019 16:23
@matticbot matticbot added [Status] Needs Changelog and removed [Status] Ready to Merge Go ahead, you can push that green button! labels Nov 18, 2019
@simison
Copy link
Member

simison commented Nov 21, 2019

I think this PR introduced some unrelated yarn.lock changes... follow up: #14094

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants