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

PRESS0-2285 fixes #22

Merged
merged 4 commits into from
Oct 15, 2024
Merged

PRESS0-2285 fixes #22

merged 4 commits into from
Oct 15, 2024

Conversation

aratidgr8
Copy link
Contributor

Proposed changes

Let's eliminate the "Install" and "Activate" button states and always show the CTA label on all the buttons. The URL on the buttons should be the CTA URL from the entitlements API.

Currently, we have a {siteUrl} placeholder in the CTA URLs returned from the Hiive entitlements API. This must be replaced with the NewfoldRuntime.siteUrl value to ensure the link points to the correct place.

Data attributes should be dynamically set on all the buttons as follows:

If the "type" attribute in the entitlements API is not "plugin", do not add any data attributes.
Don't set any data attributes if a plugin is installed and active. Doing so will let the button link to the destination in the href attribute.
If the plugin has a download URL in the entitlements API, then set the value of the data-nfd-installer-download-url attribute to that URL.
If the plugin has a PLS slug and provider name, set the data-nfd-installer-plugin-slug and data-nfd-installer-provider-name attributes accordingly.
Ensure no buttons have a target="_blank" attribute.

Please apply these updates to both "My Plugins & Tools" pages in the Bluehost plugin page (/wp-admin/admin.php?page=bluehost#/my_plugins_and_tools)

Type of Change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Video

Checklist

  • I have read the CONTRIBUTING doc
  • I have viewed my change in a web-browser
  • Linting and tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

diwanshuster
diwanshuster previously approved these changes Oct 14, 2024
href={ renderCTAUrl(entitlement.cta.url) }
variant="secondary"
>
{ __(`${entitlement.cta.text}`, "wp-module-solutions") }
Copy link
Member

Choose a reason for hiding this comment

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

@aratidgr8 - This isn't going to translate. You can't use dynamic values in a call to the __ function. See https://ottopress.com/2012/internationalization-youre-probably-doing-it-wrong/

@wpscholar wpscholar merged commit 14d6b21 into main Oct 15, 2024
3 of 4 checks passed
@wpscholar wpscholar deleted the fix/PRESS0-2285 branch October 15, 2024 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants