Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 6 additions & 15 deletions classes/controllers/FrmAddonsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ class FrmAddonsController {
*/
private static $categories = array();

/**
* @var string
*/
private static $request_addon_url;

/**
* @var string
*/
Expand All @@ -38,8 +33,6 @@ public static function load_admin_hooks() {
return;
}

self::$request_addon_url = 'https://connect.formidableforms.com/add-on-request/';

add_action( 'admin_enqueue_scripts', self::class . '::enqueue_assets', 15 );
add_filter( 'frm_show_footer_links', '__return_false' );
}
Expand Down Expand Up @@ -87,8 +80,7 @@ public static function enqueue_assets() {
*/
private static function get_js_variables() {
return array(
'proIsIncluded' => FrmAppHelper::pro_is_included(),
'addonRequestURL' => self::$request_addon_url,
'proIsIncluded' => FrmAppHelper::pro_is_included(),
);
}

Expand Down Expand Up @@ -138,12 +130,11 @@ function () {
public static function list_addons() {
FrmAppHelper::include_svg();

$view_path = FrmAppHelper::plugin_path() . '/classes/views/addons/';
$installed_addons = apply_filters( 'frm_installed_addons', array() );
$addons = self::get_api_addons();
$errors = array();
$license_type = '';
$request_addon_url = self::$request_addon_url;
$view_path = FrmAppHelper::plugin_path() . '/classes/views/addons/';
$installed_addons = apply_filters( 'frm_installed_addons', array() );
$addons = self::get_api_addons();
$errors = array();
$license_type = '';

if ( isset( $addons['error'] ) ) {
$api = new FrmFormApi();
Expand Down
1 change: 0 additions & 1 deletion classes/views/addons/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* @var array<string, array> $addons Available add-ons keyed by slug.
* @var array $errors API errors, if any.
* @var string $license_type Current license type or empty string.
* @var string $request_addon_url URL for requesting a new add-on.
* @var array $pro Pro add-on entry prepended to $addons.
* @var string $pricing Upgrade URL used for CTAs.
* @var array<string, array> $categories Add-on categories keyed by slug, each with 'name' and 'count'.
Expand Down
6 changes: 0 additions & 6 deletions classes/views/addons/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*
* @var array<string, array> $addons Available add-ons keyed by slug.
* @var string $view_path Absolute path to the views/addons/ directory, with trailing slash.
* @var string $request_addon_url URL for requesting a new add-on.
* @var string $license_type Current license type or empty string.
* @var string $pricing Upgrade URL used for CTAs.
*/
Expand All @@ -26,8 +25,3 @@
}
?>
</ul>

<div class="frm-addons-request-addon frm-py-2xs frm-mt-xs">
<span><?php esc_html_e( 'Not finding what you need?', 'formidable' ); ?></span>
<a class="frm-font-semibold" href="<?php echo esc_url( $request_addon_url ); ?>" target="_blank"><?php esc_html_e( 'Request Add-On', 'formidable' ); ?></a>
</div>
2 changes: 1 addition & 1 deletion css/font_icons.css

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

2 changes: 1 addition & 1 deletion css/frm_admin.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/addons-page.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion js/src/addons-page/constants.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export const { addonRequestURL } = window.frmAddonsVars;
export const PREFIX = 'frm-addons';

export const VIEWS = {
Expand Down
10 changes: 3 additions & 7 deletions js/src/addons-page/ui/showEmptyState.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ import { __ } from '@wordpress/i18n';
/**
* External dependencies
*/
import { showElements } from 'core/utils';
import { showElements, hideElements } from 'core/utils';

/**
* Internal dependencies
*/
import { getElements } from '../elements';
import { getState } from '../shared';
import { addonRequestURL } from '../constants';

/**
* Display the search-empty state.
Expand All @@ -33,9 +32,6 @@ export function showEmptyState() {
'formidable'
);

emptyStateButton.textContent = __( 'Request Add-On', 'formidable' );
emptyStateButton.href = addonRequestURL;
emptyStateButton.setAttribute( 'target', '_blank' );

showElements( [ emptyState, emptyStateButton ] );
hideElements( [ emptyStateButton ] );
showElements( [ emptyState ] );
}
9 changes: 1 addition & 8 deletions tests/cypress/e2e/Add-Ons/validateAddOnsPage.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -645,13 +645,6 @@ describe( 'Add-Ons page', () => {
cy.get( 'a[aria-label="Upgrade Now"]' ).should( 'have.attr', 'target', '_blank' )
.and( 'have.attr', 'href' ).and( 'include', 'https://formidableforms.com/lite-upgrade/' );
} );

cy.get( 'div.frm-addons-request-addon' ).should( 'exist' ).within( () => {
cy.get( 'span' ).should( 'have.text', 'Not finding what you need?' );
cy.get( 'a.frm-font-semibold' ).should( 'have.text', 'Request Add-On' )
.and( 'have.attr', 'href', 'https://connect.formidableforms.com/add-on-request/' )
.and( 'have.attr', 'target', '_blank' );
} );
} );

it( 'should search for add-ons', () => {
Expand All @@ -668,6 +661,6 @@ describe( 'Add-Ons page', () => {
cy.get( '#frm-page-skeleton-empty-state > img' ).should( 'exist' );
cy.get( '.frm-page-skeleton-title' ).should( 'contain', 'No add-ons found' );
cy.get( '.frm-page-skeleton-text' ).should( 'contain', "Sorry, we didn't find any add-ons that match your criteria." );
cy.get( '#frm-page-skeleton-empty-state > .button' ).should( 'contain', 'Request Add-On' ).click();
cy.get( '#frm-page-skeleton-empty-state > .button' ).should( 'not.be.visible' );
} );
} );
Loading