-
Notifications
You must be signed in to change notification settings - Fork 2
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
Refactor Admin to Work with New UI #31
base: master
Are you sure you want to change the base?
Conversation
will fix linting, later, have to go make dinner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great.
*/ | ||
public static function add_promotions_form_inputs($before_payment_options) | ||
{ | ||
public static function add_promotions_form_inputs(EE_Form_Section_Proper $before_payment_options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public static function add_promotions_form_inputs(EE_Form_Section_Proper $before_payment_options | |
public static function add_promotions_form_inputs(EE_Form_Section_Proper $before_payment_options): EE_Form_Section_Proper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Most of my suggestions are formatting, so sorry if I'm a visual nerd 😅 But I think it helps readability. Although I don't like the excess of indenting and when brackets float in the mid air to line up 😁
let i = 0; | ||
let num = 0; | ||
let out = ''; | ||
let ts=String(new Date().getTime()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let ts=String(new Date().getTime()); | |
let ts = String(new Date().getTime()); |
uniqid: function() { | ||
var ts=String(new Date().getTime()), i = 0, out = '',num=0; | ||
var host = window.location.host; | ||
uniqID: function() { | ||
const host = window.location.host; | ||
let i = 0; | ||
let num = 0; | ||
let out = ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -151,7 +160,7 @@ jQuery(document).ready(function($){ | |||
* @return {eePromotionsHelper} | |||
*/ | |||
getScopeSelectionItems: function(page) { | |||
var data={}; | |||
const data={}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const data={}; | |
const data = {}; |
var doingstart = data.context == 'start' ? true : false; | ||
dttPickerHelper.resetpicker().setDefaultDateRange('months', 1).picker(start, end, next, doingstart); | ||
const data= $(this).data(); | ||
// const container = data.container === 'main' ? '#promotion-details-mbox' : '#promotions-applied-to-mbox'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed, is it ?
$postBody.on( 'click', '.ee-toggle-datepicker', function(e) { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
const data = $(this).data(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const data = $(this).data(); | |
const data = $(this).data(); |
throw new EE_Error(sprintf(__('Something might be wrong with the models or the given Promotion ID in the request (%s) is not for a valid Promotion in the DB.', 'event_espresso'), $this->_req_data['PRO_ID'])); | ||
throw new EE_Error( | ||
sprintf( | ||
__( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__( | |
esc_html__( |
add_meta_box('promotions-applied-to-mbox', __('Promotion applies to...', 'event_espresso'), array( $this, 'promotions_applied_to_metabox'), $this->_wp_page_slug, 'side', 'default'); | ||
add_meta_box( | ||
'promotion-details-mbox', | ||
__('Promotions', 'event_espresso'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__('Promotions', 'event_espresso'), | |
esc_html__('Promotions', 'event_espresso'), |
); | ||
add_meta_box( | ||
'promotions-applied-to-mbox', | ||
__('Promotion applies to...', 'event_espresso'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__('Promotion applies to...', 'event_espresso'), | |
esc_html__('Promotion applies to...', 'event_espresso'), |
*/ | ||
public function promotions_applied_to_metabox() | ||
{ | ||
// we use the scope to get the metabox content. | ||
$scope = $this->_promotion->scope_obj(); | ||
|
||
// if there is no scope then this is a default promotion object so the content will for promotions metabox will be generic. | ||
$content = empty($scope) ? __('When you select a scope for the promotion this area will have options related to the selection.', 'event_espresso') : $scope->get_admin_applies_to_selector($this->_promotion->ID()); | ||
$content = empty($scope) ? __( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$content = empty($scope) ? __( | |
$content = empty($scope) ? esc_html__( |
A lot of these in this file. If even interested in fixing those here.
} elseif ( | ||
property_exists($this->_config, $property) | ||
&& $this->_config->{$property} | ||
!== $value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} elseif ( | |
property_exists($this->_config, $property) | |
&& $this->_config->{$property} | |
!== $value | |
} elseif ( | |
property_exists($this->_config, $property) | |
&& $this->_config->{$property} | |
!== $value |
From the customer reporting the issue: https://secure.helpscout.net/conversation/1844626136/896914?folderId=284418
|
This is one of the sites having issues on ES: https://originatorconnect.eventsmart.com/wp-admin/admin.php?page=espresso_promotions |
fix pushed to MENW && the plz confirm the fix. you will need to create a lot of events (10+) |
These are the issues I'm having here: https://garth47.makeeventsnotwar.com/wp-admin/admin.php?page=espresso_promotions&action=create_new |
Still having these issues on the promotions editor as reported above ^. |
This PR:
better datepickers
better filters
better events list
better pagination