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

Allow editing TNP auto-import block's data #16

Open
john-hix opened this issue Jan 20, 2021 · 0 comments
Open

Allow editing TNP auto-import block's data #16

john-hix opened this issue Jan 20, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@john-hix
Copy link
Collaborator

Add ability to "add in an event manually, or edit one" to the TNP auto-import block.

Building off GH-13, code from #15 , refactor to make the block allow an arbitrary number of events, all editable (and thus saved by TNP as data). The automatic part would be giving the user the option to "import" events into the list, with the data pre-filled.

So, start by making an events-list with arbitrary number of events, which sensible markup that a script can read/create. Need an "add" button. Reordering events is likely need as well.

"Auto" import would require making an AJAX call from our TNP edit panel, to create items in the list. The AJAX call would need to be routed through WP, rather than to CES directly, because of CORS. The admin-ajax endpoint must return only the fields required for the block, because doing otherwise (saving the entire JSON payload) will run into upload size limits in PHP when it comes time to save the events list (the POST request size was ~ 32 KB for a prototype I made before).

So, add a separate button in the editor panel that triggers the import event, rather than running it every time the block is generated, as was done for GH-13's simpler implementation.

@john-hix john-hix added the enhancement New feature or request label Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant