Skip to content

Commit 1d18f36

Browse files
authored
[Data Liberation] wp-admin importer page (#2003)
## 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
1 parent 9aeb038 commit 1d18f36

File tree

6 files changed

+425
-48
lines changed

6 files changed

+425
-48
lines changed

packages/php-wasm/compile/php/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,9 @@ export ASYNCIFY_ONLY=$'"rc_dtor_func",\
815815
"stream_resource_regular_dtor",\
816816
"stream_array_from_fd_set",\
817817
"zend_call_function",\
818+
"zend_call_method_if_exists",\
818819
"zend_call_known_function",\
820+
"php_userstreamop_set_option",\
819821
"zend_close_rsrc_list",\
820822
"zend_deactivate",\
821823
"zend_destroy_rsrc_list",\
@@ -826,6 +828,7 @@ export ASYNCIFY_ONLY=$'"rc_dtor_func",\
826828
"zend_execute",\
827829
"zend_execute_scripts",\
828830
"zend_error",\
831+
"zend_deprecated_function",\
829832
"zend_error_va_list",\
830833
"zend_hash_apply",\
831834
"zend_hash_graceful_reverse_destroy",\
@@ -842,6 +845,7 @@ export ASYNCIFY_ONLY=$'"rc_dtor_func",\
842845
"zif_call_user_func",\
843846
"zif_json_encode",\
844847
"zif_call_user_func_array",\
848+
"zend_user_it_get_current_data",\
845849
"zif_fclose",\
846850
"zif_feof",\
847851
"zif_file_get_contents",\
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { store, getContext } from '@wordpress/interactivity';
2+
const { state } = store('dataLiberation', {
3+
state: {
4+
selectedImportType: 'wxr_file',
5+
get isImportTypeSelected() {
6+
return getContext().importType === state.selectedImportType;
7+
},
8+
},
9+
actions: {
10+
setImportType: () => {
11+
state.selectedImportType = getContext().importType;
12+
},
13+
},
14+
});

0 commit comments

Comments
 (0)