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

SLR - SL-149 plugin side work #3118

Merged
merged 6 commits into from
Jul 22, 2024
Merged
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
2 changes: 1 addition & 1 deletion common
73 changes: 2 additions & 71 deletions src/Tickets/Seating/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use TEC\Tickets\Seating\Admin\Tabs\Layouts;
use TEC\Tickets\Seating\Admin\Tabs\Map_Edit;
use TEC\Tickets\Seating\Admin\Tabs\Maps;
use TEC\Tickets\Seating\Orders\Seats_Report;
use TEC\Tickets\Seating\Service\Service;
use Tribe__Tickets__Main as Tickets;

Expand Down Expand Up @@ -133,21 +132,6 @@ public function add_embed_submenu_page(): void {
);
}

/**
* Returns the Ajax data for the Seating feature.
*
* @since TBD
*
* @return array{
* urls: array<string, string>
* } The Ajax data for the Seating feature.
*/
public function get_ajax_data(): array {
return [
'urls' => $this->container->get( Ajax::class )->get_urls(),
];
}

/**
* Register the admin area bindings and hooks on the required hooks.
*
Expand All @@ -169,8 +153,6 @@ protected function do_register(): void {
$this->reqister_layouts_assets();
$this->register_map_edit_assets();
$this->reqister_layout_edit_assets();
$this->register_ajax_assets();
$this->register_seats_report_assets();

add_action( 'admin_menu', [ $this, 'add_submenu_page' ], 1000 );

Expand Down Expand Up @@ -284,7 +266,7 @@ private function reqister_layout_edit_assets(): void {
$action = 'tec_tickets_seating_tab_' . Layout_Edit::get_id();
Asset::add(
'tec-tickets-seating-admin-layout-edit',
$this->built_asset_url( 'admin/layout-edit.js' ),
$this->built_asset_url( 'admin/layoutEdit.js' ),
Tickets::VERSION
)
->add_dependency( 'tec-tickets-seating-service-bundle' )
Expand All @@ -295,7 +277,7 @@ private function reqister_layout_edit_assets(): void {

Asset::add(
'tec-tickets-seating-admin-layout-edit-style',
$this->built_asset_url( 'admin/layout-edit.css' ),
$this->built_asset_url( 'admin/layoutEdit.css' ),
Tickets::VERSION
)
->add_to_group( 'tec-tickets-seating-admin' )
Expand All @@ -304,55 +286,4 @@ private function reqister_layout_edit_assets(): void {
->add_to_group( 'tec-tickets-seating-admin' )
->register();
}

/**
* Registers the assets used by the AJAX component.
*
* @since TBD
*/
private function register_ajax_assets(): void {
Asset::add(
'tec-tickets-seating-ajax',
$this->built_asset_url( 'ajax.js' ),
Tickets::VERSION
)
->add_localize_script( 'tec.tickets.seating.ajax', [ $this, 'get_ajax_data' ] )
->add_to_group( 'tec-tickets-seating' )
->register();
}

/**
* Registers the assets used by the Seats Report tab under individual event views.
*
* @since TBD
*
* @return void
*/
private function register_seats_report_assets(): void {
Asset::add(
'tec-tickets-seating-admin-seats-report',
$this->built_asset_url( 'admin/seatsReport.js' ),
Tickets::VERSION
)
->add_dependency( 'tec-tickets-seating-service-bundle' )
->enqueue_on( Seats_Report::$asset_action )
->add_localize_script(
'tec.tickets.seating.admin.seatsReport.data',
fn() => Seats_Report::get_localized_data( get_the_ID() )
)
->add_to_group( 'tec-tickets-seating-admin' )
->add_to_group( 'tec-tickets-seating' )
->register();

Asset::add(
'tec-tickets-seating-admin-seats-report-style',
$this->built_asset_url( 'admin/seatsReport.css' ),
Tickets::VERSION
)
->add_to_group( 'tec-tickets-seating-admin' )
->add_to_group( 'tec-tickets-seating' )
->enqueue_on( Seats_Report::$asset_action )
->add_to_group( 'tec-tickets-seating-admin' )
->register();
}
}
Loading
Loading