-
Notifications
You must be signed in to change notification settings - Fork 43
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
Conversation
β¦city-table # Conflicts: # src/Tickets/Seating/app/blockEditor/filters.js # src/Tickets/Seating/app/blockEditor/store/index.js
β¦nts-calendar/event-tickets into feat/sl-62-editor-capacity-table
import {addFilter} from "@wordpress/hooks"; | ||
import { getLocalizedString } from '@tec/tickets/seating/utils'; | ||
|
||
export function filterCapacityTableMappedProps(mappedProps) { |
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.
Add doc-block.
const hasSeats = select(storeName).isUsingAssignedSeating(); | ||
const layoutLocked = select(storeName).isLayoutLocked(); | ||
|
||
if ( ! hasSeats || ! layoutLocked ) { |
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.
Collect into a !AND.
if ( ! hasSeats || ! layoutLocked ) { | |
if ( ! ( hasSeats && layoutLocked ) ) { |
return mappedProps; | ||
} | ||
|
||
addFilter( |
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.
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'; |
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.
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' ) ], |
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.
This should come up in a snapshot; if not already covered by tests, cover it now.
π« Ticket
SL-62
ποΈ Description
π₯ Artifacts
π· screenshot(s): https://share.cleanshot.com/zGW7bt0p
βοΈ Checklist
npm run changelog
to add changelog file(s).wpunit
orintegration
tests.wpunit
orintegration
tests.