-
Notifications
You must be signed in to change notification settings - Fork 63
[WIP] React refactoring of the 'Edit Block' UI #478
Commits on Nov 24, 2019
-
Begin the proof of concept for the refactoring
It looks like it is possible to edit the post content directly from a meta box. Now, this meta box is rendered with React. There's still a lot of work left, including porting much of the PHP and JS into this.
Configuration menu - View commit details
-
Copy full SHA for 4a583f2 - Browse repository at this point
Copy the full SHA 4a583f2View commit details -
At least for now, delete PHP saving of Block Properties meta box
This can overwrite what's saved in the main block fields meta box. Also, the Block Properties meta box might have to be rendered by React, as the 'Slug' field gets its initial value from the post title.
Configuration menu - View commit details
-
Copy full SHA for dae00a8 - Browse repository at this point
Copy the full SHA dae00a8View commit details -
Port PHP rendering to React, mainly copying
Port some of the PHP from render_fields_meta_box() into the React component. Still, it doesn't actuall add fields, and doesn't save anything.
Configuration menu - View commit details
-
Copy full SHA for 558fdf7 - Browse repository at this point
Copy the full SHA 558fdf7View commit details -
Render basic field rows from the post content
Add a helper function to get the post content. Port render_fields_meta_box_row() into the component <FieldRow>, and render a row.
Configuration menu - View commit details
-
Copy full SHA for f85c315 - Browse repository at this point
Copy the full SHA f85c315View commit details -
I copied these from BlockLabEditor, so update them for the new component.
Configuration menu - View commit details
-
Copy full SHA for 8c6212a - Browse repository at this point
Copy the full SHA 8c6212aView commit details
Commits on Dec 17, 2019
-
Merge in develop, resolve conflicts
There were conflicts in: php/post-types/class-block-post.php tests/php/unit/post-types/test-class-block-post.php These were trivial, mainly from the [] array syntax.
Configuration menu - View commit details
-
Copy full SHA for 52fd0b3 - Browse repository at this point
Copy the full SHA 52fd0b3View commit details -
Add a basic JS unit test setup, modeled after AMP plugin
tests/js/jest.config.js is mainly copied from the AMP plugin, though several values are removed. This should begin the work for Jest unit tests, and new helper functions should all have tests.
Configuration menu - View commit details
-
Copy full SHA for 32aa1d9 - Browse repository at this point
Copy the full SHA 32aa1d9View commit details -
Attempt to fix failed Travis build
Do npm install before running npm run lint:js.
Configuration menu - View commit details
-
Copy full SHA for a0c8510 - Browse repository at this point
Copy the full SHA a0c8510View commit details -
Move comment to the relevant file, do npm run lint:js:fix
There's a comment for loader/index.js. But that probably fits better in that file.
Configuration menu - View commit details
-
Copy full SHA for 3486c27 - Browse repository at this point
Copy the full SHA 3486c27View commit details
Commits on Dec 21, 2019
-
Restructure js files into js/src
There are now 2 directories in that:: block-editor/ block-lab-editor/ This might be changed, but I think it's a first step in making the directories a little easier to understand.
Configuration menu - View commit details
-
Copy full SHA for 95384cf - Browse repository at this point
Copy the full SHA 95384cfView commit details
Commits on Dec 22, 2019
-
Add the build/ directory to the ignored test paths
There's no need to look for Jest tests in the js/build directory.
Configuration menu - View commit details
-
Copy full SHA for 4d667fd - Browse repository at this point
Copy the full SHA 4d667fdView commit details -
Rename function to getBlockLabAttributes, add unit test
There's already a getBlockAttributes() function in Gutenberg, so give this a differernt name.
Configuration menu - View commit details
-
Copy full SHA for 8bdaf09 - Browse repository at this point
Copy the full SHA 8bdaf09View commit details -
Remove .gitkeep, as the directory isn't empty anymore
It looks like .gitkeep is only so that GIT keeps the directory, even though it's empty. Now that jest.config.js is in the directory, it's not empty anymore.
Configuration menu - View commit details
-
Copy full SHA for a947395 - Browse repository at this point
Copy the full SHA a947395View commit details -
Add a Jest unit test for getSimplifiedFields()
@todo: consider if the compare function is still needed.
Configuration menu - View commit details
-
Copy full SHA for 4e7ef28 - Browse repository at this point
Copy the full SHA 4e7ef28View commit details
Commits on Dec 26, 2019
-
Add a unit test for getBlockLabAttributes()
There wasn't a test for this before. Also, add parameters for it.
Configuration menu - View commit details
-
Copy full SHA for 84755bb - Browse repository at this point
Copy the full SHA 84755bbView commit details
Commits on Dec 27, 2019
-
Add a unit test for registerBlocks()
Test not registering any block, registering 1, and registering 2.
Configuration menu - View commit details
-
Copy full SHA for ce9c437 - Browse repository at this point
Copy the full SHA ce9c437View commit details -
Add more unit tests for registerBlocks()
Test not registering any block, registering 1, and registering 2.
Configuration menu - View commit details
-
Copy full SHA for 89b15e0 - Browse repository at this point
Copy the full SHA 89b15e0View commit details -
In this case, there is no need to pluralize this.
Configuration menu - View commit details
-
Copy full SHA for 1648af2 - Browse repository at this point
Copy the full SHA 1648af2View commit details -
Apply Rob's HTML and CSS for the new UI
Copy Rob's markup for the fields, and the CSS file.
Configuration menu - View commit details
-
Copy full SHA for 422f024 - Browse repository at this point
Copy the full SHA 422f024View commit details
Commits on Dec 30, 2019
-
Add a function to save a new field value
Also, add a unit test for that. @todo: test the 'happy path' of that function.
Configuration menu - View commit details
-
Copy full SHA for 8350ee6 - Browse repository at this point
Copy the full SHA 8350ee6View commit details -
Fix an issue with saving fields
When attempting to save field values, it looks like the block editor might have been overwriting the values
Configuration menu - View commit details
-
Copy full SHA for 5b8a702 - Browse repository at this point
Copy the full SHA 5b8a702View commit details -
Address an issue where the rich text editor wasn't disabled
It looks like the updateEditorSettings() call wasn't actually disabling rich text editing.
Configuration menu - View commit details
-
Copy full SHA for 4099e6f - Browse repository at this point
Copy the full SHA 4099e6fView commit details -
Address an issue where the rich text editor wasn't disabled
It looks like the updateEditorSettings() call wasn't actually disabling rich text editing.
Configuration menu - View commit details
-
Copy full SHA for 9ef2653 - Browse repository at this point
Copy the full SHA 9ef2653View commit details -
Port the slugify function from the previous JS file
Also, add a unit test for it. @TOOD: use this in the component.
Configuration menu - View commit details
-
Copy full SHA for ce65b45 - Browse repository at this point
Copy the full SHA ce65b45View commit details
Commits on Dec 31, 2019
-
Add a function to save the block
This is used in 2 functions, so put it in a single function.
Configuration menu - View commit details
-
Copy full SHA for 6da5177 - Browse repository at this point
Copy the full SHA 6da5177View commit details -
Add a function to get a new field's name
The first field will be 'new-field', the next 'new-field-1', etc.. This mainly follows the previous implementation.
Configuration menu - View commit details
-
Copy full SHA for b540f7b - Browse repository at this point
Copy the full SHA b540f7bView commit details -
Add a function to remove the slug format
For example, 'new-field-4' will be 'New Field 4'.
Configuration menu - View commit details
-
Copy full SHA for 5b82bc5 - Browse repository at this point
Copy the full SHA 5b82bc5View commit details -
Add helper functions to an index.js file
To make it easier to import the helper functions, like with import { foo } from '../helpers';
Configuration menu - View commit details
-
Copy full SHA for 34988cd - Browse repository at this point
Copy the full SHA 34988cdView commit details -
Allow toggling the field editing area open and closed
Add a method toggleEditArea() to enable opening and closing this.
Configuration menu - View commit details
-
Copy full SHA for 3f12879 - Browse repository at this point
Copy the full SHA 3f12879View commit details
Commits on Jan 14, 2020
-
Merge in develop, resolve conflicts
There were several conflicts, including in: js/blocks/components/block-lab-inspector.js js/blocks/components/edit.js
Configuration menu - View commit details
-
Copy full SHA for 4f36644 - Browse repository at this point
Copy the full SHA 4f36644View commit details