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

[SL-38] Feat - Show attendee seat data on attendee report page. #3054

Merged
merged 29 commits into from
Jun 19, 2024

Conversation

rafsuntaskin
Copy link
Contributor

@rafsuntaskin rafsuntaskin commented Jun 4, 2024

🎫 Ticket

SL-38

πŸ—’οΈ Description

  • Display selected seat for attendee in the attendee reports.
  • Make the seat column sortable.
  • Displaye ASC ticket attendee with no seats as Unassigned.

πŸŽ₯ Artifacts

πŸŽ₯ screencast(s): https://www.loom.com/share/17940e6d91ee45a3a82bb72d9f740272
Update 2: https://www.loom.com/share/7b5575199bab42ca983ad2139799aece

βœ”οΈ Checklist

  • Changelog entry in the readme.txt file.
  • 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.

@rafsuntaskin rafsuntaskin changed the title Feat/sl 38 attendee seat data [SL-38] Feat - Show attendee seat data on attendee report page. Jun 4, 2024

return $seat_label;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

[phpcs] reported by reviewdog 🐢
PSR2.Files.EndFileNewline.NoneFound
Expected 1 newline at end of file; 0 found

$layout_id = get_post_meta( $event_id, Meta::META_KEY_LAYOUT_ID, true );
update_post_meta( $attendee->ID, Meta::META_KEY_LAYOUT_ID, $layout_id );
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

[phpcs] reported by reviewdog 🐢
PSR2.Files.EndFileNewline.TooMany
Expected 1 blank line at end of file; 2 found

public function render_seat_column( $value, $item, $column ) {
return $this->attendee->render_seat_column( $value, $item, $column );
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

[phpcs] reported by reviewdog 🐢
PSR2.Files.EndFileNewline.TooMany
Expected 1 blank line at end of file; 2 found

Base automatically changed from feat/layouts-cards to feat/slr-support June 5, 2024 08:26
@rafsuntaskin rafsuntaskin self-assigned this Jun 7, 2024
@rafsuntaskin rafsuntaskin marked this pull request as ready for review June 12, 2024 18:05
@rafsuntaskin rafsuntaskin requested a review from lucatume June 12, 2024 18:05
* @package TEC/Tickets/Seating/Orders
*/
class Controller extends Controller_Contract {

Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this blank space at the beginning, why?!

* @return void
*/
protected function do_register(): void {
// Todo: This is only handling seating info for TicketsCommerce for now, in future we have to include other actions for other providers.
Copy link
Contributor

Choose a reason for hiding this comment

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

Other commerce providers will be in ET+, though, right? I think this TODO can be removed from here.

public function add_attendee_seat_column( array $columns, int $event_id ): array {
$event_layout_id = get_post_meta( $event_id, Meta::META_KEY_LAYOUT_ID, true );

if ( empty( $event_layout_id ) && ! tribe( Attendees_Page::class )->is_on_page() ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This check on the current request being on the Attendee_Page is very late.
If we're not on the Attendee Page, by the time this bailed out, a number of queries and controller routing did happen.

I would move this check on this being the Attendee Page or not in the Controller and, there, hook this callback only if required.
Did you try that? Did it not work?

add_action( 'tec_tickets_commerce_flag_action_generated_attendee', [ $this, 'save_seat_data_for_attendee' ], 10, 7 );

// Add attendee seat data column to the attendee list.
add_filter( 'tribe_tickets_attendee_table_columns', [ $this, 'add_attendee_seat_column' ], 10, 2 );
Copy link
Contributor

Choose a reason for hiding this comment

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

As proposed in the Attendee class of this same namespace, I would be curious to know if we could hook these only in the context of the Attendees page.


namespace TEC\Tickets\Seating\Orders;

use Illuminate\Support\Str;
Copy link
Contributor

Choose a reason for hiding this comment

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

[phpcs] reported by reviewdog 🐢
SlevomatCodingStandard.Namespaces.UnusedUses.UnusedUse
Type Illuminate\Support\Str is not used in this file.

@rafsuntaskin rafsuntaskin requested a review from lucatume June 19, 2024 00:40
@rafsuntaskin rafsuntaskin added the code review Status: requires a code review. label Jun 19, 2024
@lucatume lucatume merged commit 157a85c into feat/slr-support Jun 19, 2024
13 of 15 checks passed
@lucatume lucatume deleted the feat/sl-38-attendee-seat-data branch June 19, 2024 08:27
@rafsuntaskin rafsuntaskin removed the code review Status: requires a code review. label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants