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

Initial purchaser edit modal. #3222

Open
wants to merge 20 commits into
base: bucket/order-management-p2b
Choose a base branch
from

Conversation

stratease
Copy link
Contributor

@stratease stratease commented Sep 4, 2024

🎫 Ticket

ET-2164

🗒️ Description

Edit purchaser modal.

🎥 Artifacts

image

✔️ Checklist

  • Ran npm run changelog to add changelog file(s). More info here
  • Code is covered by NEW wpunit or integration tests.
  • Code is covered by EXISTING wpunit or integration tests.
  • Are all the required tests passing?
  • Automated code review comments are addressed.
  • Have you added Artifacts?
  • Check the base branch for your PR.
  • Add your PR to the project board for the release.

@stratease stratease added needs changelog Needs a changelog entry before merging. needs tests Needs tests before merging. labels Sep 4, 2024
@stratease stratease self-assigned this Sep 4, 2024
Copy link
Contributor

@tec-bot tec-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

phpcs

[phpcs] reported by reviewdog 🐶
WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterOpenParenthesis
No space after opening parenthesis is prohibited


[phpcs] reported by reviewdog 🐶
Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword
Expected 1 space after IF keyword; 0 found


[phpcs] reported by reviewdog 🐶
WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBeforeCloseParenthesis
No space before closing parenthesis is prohibited


[phpcs] reported by reviewdog 🐶
Generic.WhiteSpace.ScopeIndent.Incorrect
Line indented incorrectly; expected at least 7 tabs, found 3


[phpcs] reported by reviewdog 🐶
Generic.WhiteSpace.ScopeIndent.IncorrectExact
Line indented incorrectly; expected 6 tabs, found 2


[phpcs] reported by reviewdog 🐶
Generic.WhiteSpace.ScopeIndent.Incorrect
Line indented incorrectly; expected at least 7 tabs, found 3

wp_send_json_error("Failed updating purchaser.");


[phpcs] reported by reviewdog 🐶
PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket
Expected 1 spaces after opening parenthesis; 0 found

wp_send_json_error("Failed updating purchaser.");


[phpcs] reported by reviewdog 🐶
Squiz.Strings.DoubleQuoteUsage.NotRequired
String "Failed updating purchaser." does not require double quotes; use single quotes instead

wp_send_json_error("Failed updating purchaser.");


[phpcs] reported by reviewdog 🐶
PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket
Expected 1 spaces before closing parenthesis; 0 found

wp_send_json_error("Failed updating purchaser.");


[phpcs] reported by reviewdog 🐶
Generic.WhiteSpace.ScopeIndent.IncorrectExact
Line indented incorrectly; expected 6 tabs, found 2


[phpcs] reported by reviewdog 🐶
Generic.WhiteSpace.ScopeIndent.IncorrectExact
Line indented incorrectly; expected 3 tabs, found 1


[phpcs] reported by reviewdog 🐶
Generic.WhiteSpace.ScopeIndent.Incorrect
Line indented incorrectly; expected at least 4 tabs, found 2


[phpcs] reported by reviewdog 🐶
Generic.Formatting.MultipleStatementAlignment.NotSameWarning
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space


[phpcs] reported by reviewdog 🐶
PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket
Expected 1 spaces after opening parenthesis; 0 found


[phpcs] reported by reviewdog 🐶
WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
Detected usage of a non-sanitized input variable: $_GET['ID']


[phpcs] reported by reviewdog 🐶
WordPress.Security.ValidatedSanitizedInput.InputNotValidated
Detected usage of a possibly undefined superglobal array index: $_GET['ID']. Use isset() or empty() to check the index exists before using it


[phpcs] reported by reviewdog 🐶
PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket
Expected 1 spaces before closing parenthesis; 0 found


[phpcs] reported by reviewdog 🐶
Generic.WhiteSpace.ScopeIndent.Incorrect
Line indented incorrectly; expected at least 4 tabs, found 2

$order = tec_tc_get_order( $post );


[phpcs] reported by reviewdog 🐶
Generic.WhiteSpace.ScopeIndent.Incorrect
Line indented incorrectly; expected at least 4 tabs, found 2

wp_send_json_success($order->purchaser);


[phpcs] reported by reviewdog 🐶
PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket
Expected 1 spaces after opening parenthesis; 0 found

wp_send_json_success($order->purchaser);


[phpcs] reported by reviewdog 🐶
PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket
Expected 1 spaces before closing parenthesis; 0 found

wp_send_json_success($order->purchaser);


[phpcs] reported by reviewdog 🐶
Generic.WhiteSpace.ScopeIndent.IncorrectExact
Line indented incorrectly; expected 2 tabs, found 0


[phpcs] reported by reviewdog 🐶
Squiz.Commenting.FunctionComment.Missing
Missing doc comment for function render_modal()

public function render_modal($html, $file, $name, $template, $context) {


[phpcs] reported by reviewdog 🐶
Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterOpen
Expected 1 spaces after opening parenthesis; 0 found

public function render_modal($html, $file, $name, $template, $context) {


[phpcs] reported by reviewdog 🐶
Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingBeforeClose
Expected 1 spaces before closing parenthesis; 0 found

public function render_modal($html, $file, $name, $template, $context) {


[phpcs] reported by reviewdog 🐶
PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket
Expected 1 spaces after opening parenthesis; 0 found

$this->template('edit-purchaser-modal', $context),


[phpcs] reported by reviewdog 🐶
PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket
Expected 1 spaces before closing parenthesis; 0 found

$this->template('edit-purchaser-modal', $context),


[phpcs] reported by reviewdog 🐶
WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
Array double arrow not aligned correctly; expected 13 space(s) between "'id'" and double arrow, but found 1.


[phpcs] reported by reviewdog 🐶
WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
Array double arrow not aligned correctly; expected 2 space(s) between "'append_target'" and double arrow, but found 1.

'append_target' => '#edit-purchaser-modal-container',


[phpcs] reported by reviewdog 🐶
WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
Array double arrow not aligned correctly; expected 1 space(s) between "'button_display'" and double arrow, but found 10.


[phpcs] reported by reviewdog 🐶
WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
Array double arrow not aligned correctly; expected 10 space(s) between "'title'" and double arrow, but found 1.

'title' => esc_html_x( 'Edit purchaser', 'Edit purchaser modal title.', 'event-tickets'),


[phpcs] reported by reviewdog 🐶
PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket
Expected 1 spaces before closing parenthesis; 0 found

'title' => esc_html_x( 'Edit purchaser', 'Edit purchaser modal title.', 'event-tickets'),


[phpcs] reported by reviewdog 🐶
WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
Array double arrow not aligned correctly; expected 4 space(s) between "'close_event'" and double arrow, but found 13.

'close_event' => 'tecTicketsCommerceClosePurchaserModal',


[phpcs] reported by reviewdog 🐶
WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
Array double arrow not aligned correctly; expected 5 space(s) between "'show_event'" and double arrow, but found 14.

'show_event' => 'tecTicketsCommerceOpenPurchaserModal',


[phpcs] reported by reviewdog 🐶
StellarWP.XSS.EscapeOutput.OutputNotEscaped
Expected next thing to be an escaping function (see Codex for 'Data Validation'), not '$modal'


[phpcs] reported by reviewdog 🐶
WordPress.Security.EscapeOutput.OutputNotEscaped
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$modal'.


[phpcs] reported by reviewdog 🐶
Squiz.Commenting.FunctionComment.Missing
Missing doc comment for function template()

public function template( $name, $context = [] ) { // phpcs:ignore Universal.NamingConventions.NoReservedKeywordParameterNames.echoFound


[phpcs] reported by reviewdog 🐶
PSR2.Classes.ClassDeclaration.CloseBraceAfterBody
The closing brace for the class must go on the next line after the body


[phpcs] reported by reviewdog 🐶
Squiz.PHP.EmbeddedPhp.SpacingBeforeClose
Expected 1 space before closing PHP tag; 0 found

<input type="hidden" value="<?php echo esc_attr( $order->ID );?>" name="ID" />

Copy link
Contributor

@tec-bot tec-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

phpcs

[phpcs] reported by reviewdog 🐶
WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
Array double arrow not aligned correctly; expected 1 space(s) between "'button_display'" and double arrow, but found 10.


[phpcs] reported by reviewdog 🐶
WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
Array double arrow not aligned correctly; expected 10 space(s) between "'title'" and double arrow, but found 1.

'title' => esc_html_x( 'Edit purchaser', 'Edit purchaser modal title.', 'event-tickets'),


[phpcs] reported by reviewdog 🐶
PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket
Expected 1 spaces before closing parenthesis; 0 found

'title' => esc_html_x( 'Edit purchaser', 'Edit purchaser modal title.', 'event-tickets'),


[phpcs] reported by reviewdog 🐶
WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
Array double arrow not aligned correctly; expected 4 space(s) between "'close_event'" and double arrow, but found 13.

'close_event' => 'tecTicketsCommerceClosePurchaserModal',


[phpcs] reported by reviewdog 🐶
WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
Array double arrow not aligned correctly; expected 5 space(s) between "'show_event'" and double arrow, but found 14.

'show_event' => 'tecTicketsCommerceOpenPurchaserModal',


[phpcs] reported by reviewdog 🐶
StellarWP.XSS.EscapeOutput.OutputNotEscaped
Expected next thing to be an escaping function (see Codex for 'Data Validation'), not '$modal'


[phpcs] reported by reviewdog 🐶
WordPress.Security.EscapeOutput.OutputNotEscaped
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$modal'.


[phpcs] reported by reviewdog 🐶
Squiz.Commenting.FunctionComment.Missing
Missing doc comment for function template()

public function template( $name, $context = [] ) { // phpcs:ignore Universal.NamingConventions.NoReservedKeywordParameterNames.echoFound


[phpcs] reported by reviewdog 🐶
Squiz.PHP.NonExecutableCode.Unreachable
Code after the RETURN statement on line 150 cannot be executed


[phpcs] reported by reviewdog 🐶
Squiz.PHP.NonExecutableCode.Unreachable
Code after the RETURN statement on line 150 cannot be executed

$this->template = new Tribe__Template();


[phpcs] reported by reviewdog 🐶
Squiz.PHP.NonExecutableCode.Unreachable
Code after the RETURN statement on line 150 cannot be executed

$this->template->set_template_origin( Tribe__Tickets__Main::instance() );


[phpcs] reported by reviewdog 🐶
Squiz.PHP.CommentedOutCode.Found
This comment is 64% valid code; is this commented out code?

// $this->template->set_template_folder( 'src/admin-views/commerce/orders/single' );


[phpcs] reported by reviewdog 🐶
Generic.WhiteSpace.ScopeIndent.Incorrect
Line indented incorrectly; expected at least 3 tabs, found 2

// $this->template->set_template_folder( 'src/admin-views/commerce/orders/single' );


[phpcs] reported by reviewdog 🐶
Universal.WhiteSpace.DisallowInlineTabs.NonIndentTabsUsed
Spaces must be used for mid-line alignment; tabs are not allowed

// $this->template->set_template_folder( 'src/admin-views/commerce/orders/single' );


[phpcs] reported by reviewdog 🐶
Squiz.Commenting.InlineComment.SpacingBefore
Expected 1 space before comment text but found 2; use block comment if you need indentation

// $this->template->set_template_folder( 'src/admin-views/commerce/orders/single' );


[phpcs] reported by reviewdog 🐶
Squiz.PHP.NonExecutableCode.Unreachable
Code after the RETURN statement on line 150 cannot be executed

$this->template->set_template_context_extract( true );


[phpcs] reported by reviewdog 🐶
Squiz.PHP.NonExecutableCode.Unreachable
Code after the RETURN statement on line 150 cannot be executed

$this->template->set_template_folder_lookup( true );


[phpcs] reported by reviewdog 🐶
Squiz.PHP.NonExecutableCode.Unreachable
Code after the RETURN statement on line 150 cannot be executed

return $this->template->template( $name, $context, false );


[phpcs] reported by reviewdog 🐶
PSR2.Classes.ClassDeclaration.CloseBraceAfterBody
The closing brace for the class must go on the next line after the body


[phpcs] reported by reviewdog 🐶
Squiz.Commenting.InlineComment.Empty
Blank comments are not allowed


[phpcs] reported by reviewdog 🐶
Squiz.PHP.EmbeddedPhp.SpacingBeforeClose
Expected 1 space before closing PHP tag; 0 found

<input type="hidden" value="<?php echo esc_attr( $order->ID );?>" name="ID" />


[phpcs] reported by reviewdog 🐶
Squiz.Strings.ConcatenationSpacing.PaddingFound
Concat operator must be surrounded by a single space

$name = $order->purchaser['first_name'].' '.$order->purchaser['last_name'];


[phpcs] reported by reviewdog 🐶
Squiz.Strings.ConcatenationSpacing.PaddingFound
Concat operator must be surrounded by a single space

$name = $order->purchaser['first_name'].' '.$order->purchaser['last_name'];

Copy link
Contributor

@tec-bot tec-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

phpcs

[phpcs] reported by reviewdog 🐶
PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket
Expected 1 spaces before closing parenthesis; 0 found

'title' => esc_html_x( 'Edit purchaser', 'Edit purchaser modal title.', 'event-tickets'),


[phpcs] reported by reviewdog 🐶
WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
Array double arrow not aligned correctly; expected 4 space(s) between "'close_event'" and double arrow, but found 13.

'close_event' => 'tecTicketsCommerceClosePurchaserModal',


[phpcs] reported by reviewdog 🐶
WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
Array double arrow not aligned correctly; expected 5 space(s) between "'show_event'" and double arrow, but found 14.

'show_event' => 'tecTicketsCommerceOpenPurchaserModal',


[phpcs] reported by reviewdog 🐶
StellarWP.XSS.EscapeOutput.OutputNotEscaped
Expected next thing to be an escaping function (see Codex for 'Data Validation'), not '$modal'


[phpcs] reported by reviewdog 🐶
WordPress.Security.EscapeOutput.OutputNotEscaped
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$modal'.


[phpcs] reported by reviewdog 🐶
Squiz.Commenting.FunctionComment.Missing
Missing doc comment for function template()

public function template( $name, $context = [] ) { // phpcs:ignore Universal.NamingConventions.NoReservedKeywordParameterNames.echoFound


[phpcs] reported by reviewdog 🐶
Squiz.PHP.NonExecutableCode.Unreachable
Code after the RETURN statement on line 146 cannot be executed


[phpcs] reported by reviewdog 🐶
Squiz.PHP.NonExecutableCode.Unreachable
Code after the RETURN statement on line 146 cannot be executed

$this->template = new Tribe__Template();


[phpcs] reported by reviewdog 🐶
Squiz.PHP.NonExecutableCode.Unreachable
Code after the RETURN statement on line 146 cannot be executed

$this->template->set_template_origin( Tribe__Tickets__Main::instance() );


[phpcs] reported by reviewdog 🐶
Squiz.PHP.CommentedOutCode.Found
This comment is 64% valid code; is this commented out code?

// $this->template->set_template_folder( 'src/admin-views/commerce/orders/single' );


[phpcs] reported by reviewdog 🐶
Generic.WhiteSpace.ScopeIndent.Incorrect
Line indented incorrectly; expected at least 3 tabs, found 2

// $this->template->set_template_folder( 'src/admin-views/commerce/orders/single' );


[phpcs] reported by reviewdog 🐶
Universal.WhiteSpace.DisallowInlineTabs.NonIndentTabsUsed
Spaces must be used for mid-line alignment; tabs are not allowed

// $this->template->set_template_folder( 'src/admin-views/commerce/orders/single' );


[phpcs] reported by reviewdog 🐶
Squiz.Commenting.InlineComment.SpacingBefore
Expected 1 space before comment text but found 2; use block comment if you need indentation

// $this->template->set_template_folder( 'src/admin-views/commerce/orders/single' );


[phpcs] reported by reviewdog 🐶
Squiz.PHP.NonExecutableCode.Unreachable
Code after the RETURN statement on line 146 cannot be executed

$this->template->set_template_context_extract( true );


[phpcs] reported by reviewdog 🐶
Squiz.PHP.NonExecutableCode.Unreachable
Code after the RETURN statement on line 146 cannot be executed

$this->template->set_template_folder_lookup( true );


[phpcs] reported by reviewdog 🐶
Squiz.PHP.NonExecutableCode.Unreachable
Code after the RETURN statement on line 146 cannot be executed

return $this->template->template( $name, $context, false );


[phpcs] reported by reviewdog 🐶
PSR2.Classes.ClassDeclaration.CloseBraceAfterBody
The closing brace for the class must go on the next line after the body


[phpcs] reported by reviewdog 🐶
Squiz.Commenting.InlineComment.Empty
Blank comments are not allowed


[phpcs] reported by reviewdog 🐶
Squiz.PHP.EmbeddedPhp.SpacingBeforeClose
Expected 1 space before closing PHP tag; 0 found

<input type="hidden" value="<?php echo esc_attr( $order->ID );?>" name="ID" />


[phpcs] reported by reviewdog 🐶
Squiz.Strings.ConcatenationSpacing.PaddingFound
Concat operator must be surrounded by a single space

$name = $order->purchaser['first_name'].' '.$order->purchaser['last_name'];


[phpcs] reported by reviewdog 🐶
Squiz.Strings.ConcatenationSpacing.PaddingFound
Concat operator must be surrounded by a single space

$name = $order->purchaser['first_name'].' '.$order->purchaser['last_name'];

Copy link
Contributor

@tec-bot tec-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

phpcs

[phpcs] reported by reviewdog 🐶
PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket
Expected 1 spaces after opening parenthesis; 0 found

$this->template('src/admin-views/commerce/orders/single/edit-purchaser-modal', $context),


[phpcs] reported by reviewdog 🐶
PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket
Expected 1 spaces before closing parenthesis; 0 found

$this->template('src/admin-views/commerce/orders/single/edit-purchaser-modal', $context),


[phpcs] reported by reviewdog 🐶
WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
Array double arrow not aligned correctly; expected 13 space(s) between "'id'" and double arrow, but found 1.


[phpcs] reported by reviewdog 🐶
WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
Array double arrow not aligned correctly; expected 2 space(s) between "'append_target'" and double arrow, but found 1.

'append_target' => '#edit-purchaser-modal-container',


[phpcs] reported by reviewdog 🐶
WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
Array double arrow not aligned correctly; expected 1 space(s) between "'button_display'" and double arrow, but found 10.


[phpcs] reported by reviewdog 🐶
WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
Array double arrow not aligned correctly; expected 10 space(s) between "'title'" and double arrow, but found 1.

'title' => esc_html_x( 'Edit purchaser', 'Edit purchaser modal title.', 'event-tickets'),


[phpcs] reported by reviewdog 🐶
PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket
Expected 1 spaces before closing parenthesis; 0 found

'title' => esc_html_x( 'Edit purchaser', 'Edit purchaser modal title.', 'event-tickets'),


[phpcs] reported by reviewdog 🐶
WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
Array double arrow not aligned correctly; expected 4 space(s) between "'close_event'" and double arrow, but found 13.

'close_event' => 'tecTicketsCommerceClosePurchaserModal',


[phpcs] reported by reviewdog 🐶
WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
Array double arrow not aligned correctly; expected 5 space(s) between "'show_event'" and double arrow, but found 14.

'show_event' => 'tecTicketsCommerceOpenPurchaserModal',


[phpcs] reported by reviewdog 🐶
StellarWP.XSS.EscapeOutput.OutputNotEscaped
Expected next thing to be an escaping function (see Codex for 'Data Validation'), not '$modal'


[phpcs] reported by reviewdog 🐶
WordPress.Security.EscapeOutput.OutputNotEscaped
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$modal'.


[phpcs] reported by reviewdog 🐶
Squiz.Commenting.FunctionComment.Missing
Missing doc comment for function template()

public function template( $name, $context = [] ) { // phpcs:ignore Universal.NamingConventions.NoReservedKeywordParameterNames.echoFound


[phpcs] reported by reviewdog 🐶
Squiz.PHP.NonExecutableCode.Unreachable
Code after the RETURN statement on line 163 cannot be executed


[phpcs] reported by reviewdog 🐶
Squiz.PHP.NonExecutableCode.Unreachable
Code after the RETURN statement on line 163 cannot be executed

$this->template = new Tribe__Template();


[phpcs] reported by reviewdog 🐶
Squiz.PHP.NonExecutableCode.Unreachable
Code after the RETURN statement on line 163 cannot be executed

$this->template->set_template_origin( Tribe__Tickets__Main::instance() );


[phpcs] reported by reviewdog 🐶
Squiz.PHP.CommentedOutCode.Found
This comment is 64% valid code; is this commented out code?

// $this->template->set_template_folder( 'src/admin-views/commerce/orders/single' );


[phpcs] reported by reviewdog 🐶
Generic.WhiteSpace.ScopeIndent.Incorrect
Line indented incorrectly; expected at least 3 tabs, found 2

// $this->template->set_template_folder( 'src/admin-views/commerce/orders/single' );


[phpcs] reported by reviewdog 🐶
Universal.WhiteSpace.DisallowInlineTabs.NonIndentTabsUsed
Spaces must be used for mid-line alignment; tabs are not allowed

// $this->template->set_template_folder( 'src/admin-views/commerce/orders/single' );


[phpcs] reported by reviewdog 🐶
Squiz.Commenting.InlineComment.SpacingBefore
Expected 1 space before comment text but found 2; use block comment if you need indentation

// $this->template->set_template_folder( 'src/admin-views/commerce/orders/single' );


[phpcs] reported by reviewdog 🐶
Squiz.PHP.NonExecutableCode.Unreachable
Code after the RETURN statement on line 163 cannot be executed

$this->template->set_template_context_extract( true );


[phpcs] reported by reviewdog 🐶
Squiz.PHP.NonExecutableCode.Unreachable
Code after the RETURN statement on line 163 cannot be executed

$this->template->set_template_folder_lookup( true );


[phpcs] reported by reviewdog 🐶
Squiz.PHP.NonExecutableCode.Unreachable
Code after the RETURN statement on line 163 cannot be executed

return $this->template->template( $name, $context, false );


[phpcs] reported by reviewdog 🐶
PSR2.Classes.ClassDeclaration.CloseBraceAfterBody
The closing brace for the class must go on the next line after the body


[phpcs] reported by reviewdog 🐶
WordPress.Arrays.ArrayIndentation.ItemNotAligned
Array item not aligned correctly; expected 16 spaces but found 20


[phpcs] reported by reviewdog 🐶
WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
Array double arrow not aligned correctly; expected 1 space(s) between "'localize'" and double arrow, but found 5.


[phpcs] reported by reviewdog 🐶
WordPress.Arrays.ArrayIndentation.MultiLineArrayItemNotAligned
Multi-line array item not aligned correctly; expected 20 spaces, but found 24

'name' => 'TicketsEditPurchaserOptions',


[phpcs] reported by reviewdog 🐶
Squiz.PHP.EmbeddedPhp.SpacingBeforeClose
Expected 1 space before closing PHP tag; 0 found

<input type="hidden" value="<?php echo esc_attr( $order->ID );?>" name="ID" />


[phpcs] reported by reviewdog 🐶
PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket
Expected 1 spaces after opening parenthesis; 0 found

<button type="button" id="tec-tickets-commerce-edit-purchaser-cancel" class="button button-secondary"><?php echo esc_html_x('Cancel', 'Cancel button.', 'event-tickets' ); ?></button>


[phpcs] reported by reviewdog 🐶
PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket
Expected 1 spaces after opening parenthesis; 0 found

<button type="submit" id="tec-tickets-commerce-edit-purchaser-save" disabled class="button button-primary"><?php echo esc_html_x('Save', 'Save button.', 'event-tickets' ); ?></button>


[phpcs] reported by reviewdog 🐶
PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket
Expected 1 spaces after opening parenthesis; 0 found

<button type="button" id="tec-tickets-commerce-edit-purchaser-save-and-email" disabled class="button button-primary"><?php echo esc_html_x('Save and send email', 'Save and send email button.', 'event-tickets' ); ?></button>


[phpcs] reported by reviewdog 🐶
Squiz.Strings.ConcatenationSpacing.PaddingFound
Concat operator must be surrounded by a single space

$name = $order->purchaser['first_name'].' '.$order->purchaser['last_name'];


[phpcs] reported by reviewdog 🐶
Squiz.Strings.ConcatenationSpacing.PaddingFound
Concat operator must be surrounded by a single space

$name = $order->purchaser['first_name'].' '.$order->purchaser['last_name'];

@stratease stratease removed the needs changelog Needs a changelog entry before merging. label Sep 17, 2024
@stratease stratease marked this pull request as ready for review September 17, 2024 18:05
@stratease stratease added code review Status: requires a code review. and removed needs tests Needs tests before merging. labels Sep 18, 2024
Copy link
Member

@Camwyn Camwyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few suggestions, some nitpicks on using custom props.
Also: can we get at least one snapshot of the HTML output?


if ( is_user_logged_in() ) {
if ( ( empty( $data['purchaser'] ) || empty( $data['purchaser']['name'] ) )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure you need both here TBH - just check empty( $data['purchaser']['name'] ) - it will trigger if $data['purchaser'] is empty

src/Tickets/Commerce/Admin/Edit_Purchaser_Provider.php Outdated Show resolved Hide resolved
Comment on lines 254 to 256
echo $modal;

return $html;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we echoing and then returning? Append the modal to the HTML and then return?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That HTML will skip the template, it's an override and we want to append.

composer.json Outdated
@@ -43,7 +43,34 @@
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"scripts": {
"strauss": [
"test -f ./bin/strauss.phar || curl -o bin/strauss.phar -L -C - https://github.com/BrianHenryIE/strauss/releases/download/0.13.0/strauss.phar",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the version of Strauss here, to version 19.X

Comment on lines 252 to 256
// phpcs:ignore StellarWP.XSS.EscapeOutput.OutputNotEscaped, WordPress.Security.EscapeOutput.OutputNotEscaped
echo $modal;

// Always return $html - we are not overriding the template, simply "appending" our modal.
return $html;
Copy link
Contributor

@codingmusician codingmusician Sep 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of more questions about this (sorry):

  1. Since we're filtering a template, what happens when the template is set to be returned and not rendered (echoed)?
  2. Wouldn't appending be return $html . $modal;?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This filter is an override. If I return ANY result it will short-circuit the template being loaded. So in order to "append" I output directly, and leave the $html var alone so it continues rendering the template.

right: 0;
top: 0;
width: 100%;
z-index: var(--tec-z-index-spinner-container);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

Camwyn
Camwyn previously approved these changes Sep 23, 2024
Copy link
Member

@Camwyn Camwyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me - but Mike has a question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code review Status: requires a code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants