Skip to content

Commit

Permalink
Merge pull request #33 from newfold-labs/linting
Browse files Browse the repository at this point in the history
plugin-provider to pls-provider
  • Loading branch information
ramyakrishnai authored Oct 22, 2024
2 parents dd8a8e1 + ff6a918 commit ff51b8c
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 175 deletions.
235 changes: 72 additions & 163 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions includes/Solutions.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ public function init_entitilements_apis(): void {
*/
public static function add_my_plugins_and_tools_tab( array $tabs ) {
$capability = new SiteCapabilities();

$hasSolutions = $capability->get( 'hasSolution' );

if( !$hasSolutions){
$has_solutions = $capability->get( 'hasSolution' );

if ( ! $has_solutions ) {
return $tabs;
}
$hiive = new HiiveConnection();
Expand All @@ -117,14 +117,14 @@ public static function add_my_plugins_and_tools_tab( array $tabs ) {
*/
public static function add_plugins_and_tools_menu_link() {
$capability = new SiteCapabilities();

$hasSolutions = $capability->get( 'hasSolution' );

if ( $hasSolutions ) {
$has_solutions = $capability->get( 'hasSolution' );

if ( $has_solutions ) {
$hiive = new HiiveConnection();
$api = new EntitlementsApi( $hiive );
$entitlements = $api->get_items();
if( is_array( $entitlements->data ) ? $entitlements->data['entitlements'] : $entitlements->data->entitlements ){
if ( is_array( $entitlements->data ) ? $entitlements->data['entitlements'] : $entitlements->data->entitlements ) {
add_submenu_page(
'plugins.php',
'nfd_my_plugins_and_tools',
Expand Down
10 changes: 5 additions & 5 deletions includes/js/myPluginsTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ class MyPluginTools {
return `<button
title="Activate Plugin"
data-nfd-installer-plugin-activate="${true}"
data-nfd-installer-plugin-slug="${pluginData?.plsSlug}"
data-nfd-installer-plugin-provider="${pluginData?.plsProviderName}"
data-nfd-installer-pls-slug="${pluginData?.plsSlug}"
data-nfd-installer-pls-provider="${pluginData?.plsProviderName}"
data-nfd-installer-plugin-name="${pluginData?.name}"
data-nfd-installer-plugin-url="${this.renderCTAUrl(pluginData?.cta?.url)}"
href="${this.renderCTAUrl(pluginData?.cta?.url)}"
Expand All @@ -86,16 +86,16 @@ class MyPluginTools {
title="Install Premium Plugin"
class="nfd-solutions-availble-list-item-button"
data-nfd-installer-plugin-activate="${true}"
data-nfd-installer-plugin-slug="${pluginData?.plsSlug}"
data-nfd-installer-plugin-provider="${pluginData?.plsProviderName}"
data-nfd-installer-pls-slug="${pluginData?.plsSlug}"
data-nfd-installer-pls-provider="${pluginData?.plsProviderName}"
data-nfd-installer-plugin-name="${pluginData?.name}"
data-nfd-installer-plugin-url="${this.renderCTAUrl(pluginData?.cta?.url)}"
>${pluginData?.cta?.text}</button>`;
} else if ( pluginData?.download ) { // free plugin
return `<button
title="Install Plugin"
class="nfd-solutions-availble-list-item-button"
data-nfd-installer-plugin-provider="${pluginData?.plsProviderName}"
data-nfd-installer-pls-provider="${pluginData?.plsProviderName}"
data-nfd-installer-plugin-activate="${true}"
data-nfd-installer-plugin-name="${pluginData?.name}"
data-nfd-installer-download-url="${pluginData?.download}"
Expand Down

0 comments on commit ff51b8c

Please sign in to comment.