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

Gutenberg Data Tutorial 5: Adding a Delete Button #40940

Merged
merged 34 commits into from
Jul 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
0493edd
First draft of the fifth part of the Create Your First App With Guten…
adamziel May 9, 2022
bc500c3
Finish the first draft of 5-adding-a-delete-button.md (visuals and ed…
adamziel May 16, 2022
cc66b15
Improve the visuals
adamziel May 16, 2022
d146ee8
Remove the spinner-in-button class
adamziel May 18, 2022
f6ec688
Don't display the loading indicator in PagesList if there are pages a…
adamziel May 16, 2022
200fb4e
Improve grammar
adamziel May 17, 2022
9a68897
Add useState and useSelect imports
adamziel May 18, 2022
9586bac
Show error messages using a snackbar (draft)
adamziel Jun 24, 2022
0887d4c
Link the correct screenshot at the beginning of the page
adamziel Jun 24, 2022
643b70f
Update docs/how-to-guides/data-basics/5-adding-a-delete-button.md
adamziel Jun 30, 2022
403d2ba
Update docs/how-to-guides/data-basics/1-data-basics-setup.md
adamziel Jun 30, 2022
a23765a
Update docs/how-to-guides/data-basics/5-adding-a-delete-button.md
adamziel Jun 30, 2022
1872fc8
Update docs/how-to-guides/data-basics/5-adding-a-delete-button.md
adamziel Jun 30, 2022
9139edd
Update docs/how-to-guides/data-basics/5-adding-a-delete-button.md
adamziel Jun 30, 2022
b4f2738
Update docs/how-to-guides/data-basics/5-adding-a-delete-button.md
adamziel Jun 30, 2022
610e2ac
Replace pageId *= -1 with pageId = -1
adamziel Jun 30, 2022
edafeb5
Edit for clarity
adamziel Jun 30, 2022
eb48695
Do not hide the pages that are being currently deleted
adamziel Jun 30, 2022
d4a28e0
Revert embedding if ( !hasResolved ) inside of the if ( !pages?.length )
adamziel Jun 30, 2022
5946951
Reverse the order of hasResolved and pages.length checks
adamziel Jun 30, 2022
af80061
Adjust visuals
adamziel Jun 30, 2022
bc06a11
Crop visuals a bit more
adamziel Jun 30, 2022
9faef92
Update docs/how-to-guides/data-basics/5-adding-a-delete-button.md
adamziel Jun 30, 2022
5e7a743
Update docs/how-to-guides/data-basics/5-adding-a-delete-button.md
adamziel Jun 30, 2022
fea482f
Update docs/how-to-guides/data-basics/5-adding-a-delete-button.md
adamziel Jun 30, 2022
40280c0
Update docs/how-to-guides/data-basics/5-adding-a-delete-button.md
adamziel Jun 30, 2022
3b990d5
Update docs/how-to-guides/data-basics/5-adding-a-delete-button.md
adamziel Jun 30, 2022
e21ccd4
Update docs/how-to-guides/data-basics/5-adding-a-delete-button.md
adamziel Jul 1, 2022
55a4f51
Clear up the comment about the lastError
adamziel Jul 1, 2022
442bbbe
Add a few words of transition to the "Displaying notifications" secti…
adamziel Jul 1, 2022
936da5c
Replace "update" with "delete" to fix the copypasta mistake
adamziel Jul 1, 2022
fe0ccf7
Highlight the change in the PagesList component
adamziel Jul 1, 2022
77f4ade
Add an arrow to the snackbar-example.png
adamziel Jul 1, 2022
dbc73de
Add a small introduction
adamziel Jul 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 28 additions & 9 deletions docs/how-to-guides/data-basics/1-data-basics-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,34 +43,53 @@ window.addEventListener(
background: #fff;
height: 1000px;
}
#my-first-gutenberg-app {
max-width: 500px;
button .components-spinner {
width: 15px;
height: 15px;
margin-top: 0;
margin-bottom: 0;
margin-left: 0;
}
#my-first-gutenberg-app ul,
#my-first-gutenberg-app ul li {
list-style-type: disc;
.form-buttons {
display: flex;
}
.my-gutenberg-form .form-buttons {
display: flex;
margin-top: 20px;
margin-left: 1px;
}
.my-gutenberg-form .form-error {
.form-error {
color: #cc1818;
}
.my-gutenberg-form .form-buttons button {
.form-buttons button {
margin-right: 4px;
}
.my-gutenberg-form .form-buttons .components-spinner {
.form-buttons .components-spinner {
margin-top: 0;
}
#my-first-gutenberg-app {
max-width: 500px;
}
#my-first-gutenberg-app ul,
#my-first-gutenberg-app ul li {
list-style-type: disc;
}
#my-first-gutenberg-app ul {
padding-left: 20px;
}
#my-first-gutenberg-app .components-search-control__input {
height: 36px;
margin-left: 0;
}

#my-first-gutenberg-app .list-controls {
display: flex;
width: 100%;
}

#my-first-gutenberg-app .list-controls .components-search-control {
flex-grow: 1;
margin-right: 8px;
}
```

**my-first-gutenberg-app.php:**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ All that’s left is to refresh the page and enjoy the form:

## What's next?

* **Next part:** [Adding a delete button](/docs/how-to-guides/data-basics/5-adding-a-delete-button.md)
* **Previous part:** [Building an edit form](/docs/how-to-guides/data-basics/3-building-an-edit-form.md)
* (optional) Review
the [finished app](https://github.com/WordPress/gutenberg-examples/tree/trunk/09-code-data-basics-esnext) in the
gutenberg-examples repository
* (optional) Review the [finished app](https://github.com/WordPress/gutenberg-examples/tree/trunk/09-code-data-basics-esnext) in the gutenberg-examples repository
Loading