Skip to content

Commit

Permalink
Merge pull request #202 from awesomemotive/release/4.7.8
Browse files Browse the repository at this point in the history
`release/4.7.8`
  • Loading branch information
spencerfinnell authored Aug 2, 2023
2 parents f91a931 + 8ca161d commit ec70460
Show file tree
Hide file tree
Showing 22 changed files with 539 additions and 79 deletions.
91 changes: 87 additions & 4 deletions includes/core/assets/css/admin/admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,10 @@
position: relative;
flex: 0 0 25%;

@media screen and (min-width: 1400px) {
flex-basis: 22%;
}

@media screen and (max-width: 782px) {
flex-basis: 100%;
flex-grow: 1;
Expand All @@ -363,7 +367,7 @@
padding: 0;

&:first-child {
margin-top: -1px;
margin-top: 12px;
}

&:last-child {
Expand Down Expand Up @@ -430,7 +434,7 @@
align-items: center;
line-height: 20px;
margin: 0;
padding: 10px 10px 10px 14px;
padding: 8px 10px 8px 14px;
text-decoration: none;
transition: all 0.05s ease-in-out;

Expand All @@ -447,10 +451,11 @@
outline: 0;
position: relative;
z-index: 3;
box-shadow: inset 0 0 0 2px currentColor;
box-shadow: inset 0 0 0 1px currentColor, 0 0 0 1px currentColor;
}

&[href="#purchase-restrictions-settings-panel"] {
&[href="#purchase-restrictions-settings-panel"],
&[href="#payment-page-settings-panel"] {
margin-bottom: 20px;
position: relative;

Expand All @@ -465,6 +470,14 @@
background: #eaeaea;
}
}

span > span {
color: #f18500;
font-size: 12px;
font-weight: 600;
margin: 0 0 0 5px;
display: inline-block;
}
}

&:not(.active) {
Expand All @@ -490,6 +503,10 @@
flex: 0 0 75%;
display: flex;

@media screen and (min-width: 1400px) {
flex-basis: 78%;
}

@media screen and (max-width: 782px) {
flex-basis: 100%;
}
Expand Down Expand Up @@ -2277,6 +2294,72 @@ select.simpay-currency-symbol {
}
}

.simpay-form-builder-automations {

&__cta {
margin: 24px 0 6px;
text-align: center;
}
}

.simpay-form-builder-automator {
padding: 16px 4px 26px !important;

&,
* {
box-sizing: border-box;
}

input[type="search"] {
font-size: 15px;
padding: 2px 8px;
}

&__integrations {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
grid-column-gap: 16px;
grid-row-gap: 16px;
margin: 18px -18px 0;
padding: 0 18px 10px;
width: calc(100% + 36px);
max-height: 400px;
overflow-y: scroll;
}

&__integrations-integration {
color: initial;
text-align: center;
text-decoration: none;
background: #fff;
border: 1px solid #eee;
border-radius: 4px;
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.03);
transition: all ease-in 0.15s;

img {
display: block;
margin: 16px auto;
height: 50px;
}

span {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding: 8px 16px;
display: block;
border-top: 1px solid #eee;
}

&:hover {
cursor: pointer;
border-color: #ddd;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}
}
}

body.site-health #wpbody-content,
body.post-type-simple-pay #wpbody-content {
padding-bottom: 200px;
Expand Down
2 changes: 1 addition & 1 deletion includes/core/assets/css/simpay-admin.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions includes/core/assets/images/simple-pay-uncanny.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions includes/core/assets/js/admin/payment-form/automations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**
* WordPress dependencies
*/
import domReady from '@wordpress/dom-ready';

/**
* Filters the integrations list based on a fuzzy search of data-name and
* data-description attributes on the integrations.
*
* @since 4.7.8
*/
domReady( () => {
const searchEl = document.getElementById( 'automations-search' );

if ( ! searchEl ) {
return;
}

const integrationEls = document.querySelectorAll(
'.simpay-form-builder-automator__integrations-integration'
);

searchEl.addEventListener( 'input', () => {
const search = searchEl.value.toLowerCase();

integrationEls.forEach( ( integrationEl ) => {
const fields = Object.values( integrationEl.dataset );

for ( let i = 0; i < fields.length; i++ ) {
const fieldValue = fields[ i ].toLowerCase();

if ( fieldValue.includes( search ) ) {
integrationEl.style.display = 'block';
return;
}

integrationEl.style.display = 'none';
}
} );

if ( '' === search ) {
integrationEls.forEach( ( integrationEl ) => {
if ( integrationEl.dataset.overflow === 'yes' ) {
integrationEl.style.display = 'none';
}
} );
}
} );
} );
1 change: 1 addition & 0 deletions includes/core/assets/js/admin/payment-form/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ import './custom-fields.js';
import './stripe-checkout.js';
import './payment-page.js';
import './purchase-restrictions.js';
import './automations.js';
10 changes: 5 additions & 5 deletions includes/core/assets/js/admin/payment-form/prices.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,14 @@ function onToggleCanRecur( priceEl, checkbox ) {
* Handles displaying the current price's custom amount settings.
*
* @param {HTMLElement} priceEl Price container element.
* @param {HTMLElement} checkbox Custom amount toggle element.
*/
function onToggleCustomAmount( priceEl ) {
function onToggleCustomAmount( priceEl, checkbox ) {
const customAmountSettings = priceEl.querySelector(
'.simpay-price-custom-amount'
);

customAmountSettings.style.display =
'none' === customAmountSettings.style.display ? 'block' : 'none';
customAmountSettings.style.display = checkbox.checked ? 'table' : 'none';
}

/**
Expand Down Expand Up @@ -610,8 +610,8 @@ function bindPriceOptions() {
'.simpay-price-enable-custom-amount'
);

customAmountToggle.addEventListener( 'click', () => {
onToggleCustomAmount( priceEl );
customAmountToggle.addEventListener( 'change', () => {
onToggleCustomAmount( priceEl, customAmountToggle );
onChangeLabel( priceEl );
} );

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => '9b527dabbf6325253c12ff2ddfdb65b3');
<?php return array('dependencies' => array('lodash', 'react', 'wp-api-fetch', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => '4aff03f69181385113accdc15b5e0c51');
4 changes: 2 additions & 2 deletions includes/core/assets/js/simpay-admin-page-setup-wizard.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion includes/core/assets/js/simpay-admin.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions includes/core/class-simplepay.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ public function load_admin() {
require_once( SIMPLE_PAY_INC . 'core/post-types/simple-pay/edit-form-custom-fields.php' );
require_once( SIMPLE_PAY_INC . 'core/post-types/simple-pay/edit-form-payment-page.php' );
require_once( SIMPLE_PAY_INC . 'core/post-types/simple-pay/edit-form-purchase-restrictions.php' );
require_once( SIMPLE_PAY_INC . 'core/post-types/simple-pay/edit-form-automations.php' );
require_once( SIMPLE_PAY_INC . 'core/post-types/simple-pay/actions.php' );

// Load core back-end only functions.
Expand Down
12 changes: 12 additions & 0 deletions includes/core/functions/shared.php
Original file line number Diff line number Diff line change
Expand Up @@ -1457,6 +1457,18 @@ function __unstable_simpay_get_payment_form_templates() {

$template_files = glob( SIMPLE_PAY_DIR . '/data/templates/*.json' );

/**
* Filters the list of payment form templates.
*
* @since [--next--]
*
* @param array<string> $template_files List of template file paths.
*/
$template_files = apply_filters(
'__unstable__simpay_payment_form_templates',
$template_files
);

if ( false === $template_files ) {
return array();
}
Expand Down
Loading

0 comments on commit ec70460

Please sign in to comment.