Skip to content

Commit

Permalink
[Data Liberation] wp-admin importer page (#2003)
Browse files Browse the repository at this point in the history
## Motivation for the change, related issues

A rough mockup of a wp-admin page for data liberation imports:

![CleanShot 2024-11-18 at 19 23
52@2x](https://github.com/user-attachments/assets/0b0990cb-d4f8-476b-8df4-78475816b5fc)

It actually allows you to import a WXR file, but almost nothing else
works. This PR is only meant to provide a starting point to expand.

## Testing Instructions (or ideally a Blueprint)

* Run Playground with the data-liberation plugin installed:

```bash
cd packages/playground/data-liberation/tests/import
bash run.sh
```

* Go to http://127.0.0.1:9400/wp-admin/admin.php?page=data-liberation
* Confirm you can see the screen from the picture above

cc @brandonpayton @zaerl
  • Loading branch information
adamziel authored Nov 18, 2024
1 parent 9aeb038 commit 1d18f36
Show file tree
Hide file tree
Showing 6 changed files with 425 additions and 48 deletions.
4 changes: 4 additions & 0 deletions packages/php-wasm/compile/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,9 @@ export ASYNCIFY_ONLY=$'"rc_dtor_func",\
"stream_resource_regular_dtor",\
"stream_array_from_fd_set",\
"zend_call_function",\
"zend_call_method_if_exists",\
"zend_call_known_function",\
"php_userstreamop_set_option",\
"zend_close_rsrc_list",\
"zend_deactivate",\
"zend_destroy_rsrc_list",\
Expand All @@ -826,6 +828,7 @@ export ASYNCIFY_ONLY=$'"rc_dtor_func",\
"zend_execute",\
"zend_execute_scripts",\
"zend_error",\
"zend_deprecated_function",\
"zend_error_va_list",\
"zend_hash_apply",\
"zend_hash_graceful_reverse_destroy",\
Expand All @@ -842,6 +845,7 @@ export ASYNCIFY_ONLY=$'"rc_dtor_func",\
"zif_call_user_func",\
"zif_json_encode",\
"zif_call_user_func_array",\
"zend_user_it_get_current_data",\
"zif_fclose",\
"zif_feof",\
"zif_file_get_contents",\
Expand Down
14 changes: 14 additions & 0 deletions packages/playground/data-liberation/import-screen.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { store, getContext } from '@wordpress/interactivity';
const { state } = store('dataLiberation', {
state: {
selectedImportType: 'wxr_file',
get isImportTypeSelected() {
return getContext().importType === state.selectedImportType;
},
},
actions: {
setImportType: () => {
state.selectedImportType = getContext().importType;
},
},
});
Loading

0 comments on commit 1d18f36

Please sign in to comment.