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-62] - Block editor capacity table show Assigned seating row. #3128

Merged
merged 18 commits into from
Jul 30, 2024

Conversation

rafsuntaskin
Copy link
Contributor

@rafsuntaskin rafsuntaskin commented Jul 24, 2024

🎫 Ticket

SL-62

πŸ—’οΈ Description

πŸŽ₯ Artifacts

πŸ“· screenshot(s): https://share.cleanshot.com/zGW7bt0p

βœ”οΈ Checklist

  • Ran npm run changelog to add changelog file(s).
  • 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 self-assigned this Jul 24, 2024
@rafsuntaskin rafsuntaskin changed the title Feat/sl 62 editor capacity table [SL-62] - Block editor capacity table show Assigned seating row. Jul 26, 2024
Base automatically changed from feat/sl-36-delete-attendee to feat/slr-support July 30, 2024 11:37
@rafsuntaskin rafsuntaskin marked this pull request as ready for review July 30, 2024 11:48
@rafsuntaskin rafsuntaskin added the code review Status: requires a code review. label Jul 30, 2024
import {addFilter} from "@wordpress/hooks";
import { getLocalizedString } from '@tec/tickets/seating/utils';

export function filterCapacityTableMappedProps(mappedProps) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Add doc-block.

const hasSeats = select(storeName).isUsingAssignedSeating();
const layoutLocked = select(storeName).isLayoutLocked();

if ( ! hasSeats || ! layoutLocked ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Collect into a !AND.

Suggested change
if ( ! hasSeats || ! layoutLocked ) {
if ( ! ( hasSeats && layoutLocked ) ) {

return mappedProps;
}

addFilter(
Copy link
Contributor

Choose a reason for hiding this comment

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

Move this to the filters.js file.
In that file import the filterCapacityTableMappedProps function and hook on the filter.

@@ -1,2 +1,3 @@
import './store';
import './filters.js';
import './capacity-table';
Copy link
Contributor

Choose a reason for hiding this comment

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

Do not import this file, import only the filters.js one, from that import the function that will hook on the filter.

'dashboard' => [ 'seats-action-label' => _x( 'Seats', 'Ticket Dashboard actions', 'event-tickets' ) ],
'maps' => [
'capacity-form' => $localization->get_capacity_form_strings(),
'capacity-table' => [ 'seats-row-label' => _x( 'Assigned Seating', 'Capacity table row label for assigned seating tickets', 'event-tickets' ) ],
Copy link
Contributor

Choose a reason for hiding this comment

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

This should come up in a snapshot; if not already covered by tests, cover it now.

@lucatume lucatume merged commit ab654eb into feat/slr-support Jul 30, 2024
14 checks passed
@lucatume lucatume deleted the feat/sl-62-editor-capacity-table branch July 30, 2024 17:29
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
2 participants