Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
da18be9
Extract everything we can and refactor
david-szabo97 Sep 30, 2020
186b244
Autodrafting for theme templates
david-szabo97 Sep 30, 2020
6c720c2
Remove unneccessary code
david-szabo97 Sep 30, 2020
dd60398
Extend findTemplate
david-szabo97 Sep 30, 2020
790ac20
Rename args
david-szabo97 Sep 30, 2020
5921992
Move optional parameters to the end
david-szabo97 Sep 30, 2020
4036921
Fix old name
david-szabo97 Sep 30, 2020
5b76047
Show all template parts
david-szabo97 Sep 30, 2020
9e74cc1
Remove current theme and preview
david-szabo97 Oct 1, 2020
4195108
Remove unused styles
david-szabo97 Oct 1, 2020
8cb3123
Remove current template group
david-szabo97 Oct 1, 2020
b9b2c02
Cleanup component and styles
david-szabo97 Oct 1, 2020
3d6a135
Remove template switcher folder
david-szabo97 Oct 1, 2020
637354a
Use original NavigationItem
david-szabo97 Oct 1, 2020
f34fc16
Remove NavigationItemWithIcon
david-szabo97 Oct 1, 2020
af092c0
Remove unused styles
david-szabo97 Oct 1, 2020
06faa7c
Remove unused prop
david-szabo97 Oct 2, 2020
3ba796d
Fix typo
david-szabo97 Oct 2, 2020
969ff62
Remove unused property
david-szabo97 Oct 2, 2020
6e1c693
Return template directly
david-szabo97 Oct 2, 2020
c40e390
Merge selects
david-szabo97 Oct 2, 2020
9c6e04a
Extract templates as a hook
david-szabo97 Oct 5, 2020
9e2b8e8
Extract useTemplates to its own file
david-szabo97 Oct 5, 2020
88e3f45
Create TemplateNavigationItems component
david-szabo97 Oct 5, 2020
485f5fb
Fix prop
david-szabo97 Oct 5, 2020
1608e3a
Add titles
david-szabo97 Oct 5, 2020
0817526
Move preview to TemplateNavigationItems
david-szabo97 Oct 5, 2020
0d8ab08
Add description to items
david-szabo97 Oct 5, 2020
e694a7b
Use destructuring
david-szabo97 Oct 5, 2020
e5711c2
Fix height of item
david-szabo97 Oct 5, 2020
1a56595
Use slug for template parts too
david-szabo97 Oct 5, 2020
ba847e8
Create slot-fill for preview panel
david-szabo97 Oct 5, 2020
c6b07a0
Add query args to show all
david-szabo97 Oct 5, 2020
4f7c00a
NavigationMenu must be rendered
david-szabo97 Oct 5, 2020
6ba556d
Add posts
david-szabo97 Oct 5, 2020
976ed93
Add titles and descriptions for items
david-szabo97 Oct 5, 2020
e72bba7
Fix stying
david-szabo97 Oct 5, 2020
4e3b47b
Fix typo
david-szabo97 Oct 5, 2020
d4873a6
Add page title and desc
david-szabo97 Oct 5, 2020
1218680
Use ID for activeItem
david-szabo97 Oct 6, 2020
086e39e
Fix cache invalidation
david-szabo97 Oct 6, 2020
c8b1d4c
Add documentation
david-szabo97 Oct 6, 2020
71ceb5b
Return template file content
david-szabo97 Oct 6, 2020
7990a9b
Sort by slug to make order deterministic
david-szabo97 Oct 6, 2020
bf02206
Revert "Use ID for activeItem"
david-szabo97 Oct 6, 2020
a081994
Add comment
david-szabo97 Oct 6, 2020
24d2293
Use destructured
david-szabo97 Oct 6, 2020
d239fbb
Extract constants
david-szabo97 Oct 6, 2020
7a2600d
Create auto-draft automatically when templates are requested
david-szabo97 Oct 6, 2020
38c4ce5
Revert "Revert "Use ID for activeItem""
david-szabo97 Oct 6, 2020
787e076
Inline useTemplates
david-szabo97 Oct 6, 2020
2cc0c62
Format PHP
david-szabo97 Oct 6, 2020
a369fd7
Update e2e tests
david-szabo97 Oct 6, 2020
34d5078
Use entityType
david-szabo97 Oct 6, 2020
83b3597
Use title and excerpt if available
david-szabo97 Oct 6, 2020
d74ae61
Format PHP
david-szabo97 Oct 6, 2020
51c9075
Rename constants
david-szabo97 Oct 6, 2020
abfcfa5
Standarize activate prop
david-szabo97 Oct 6, 2020
41c0bd3
Fix title
david-szabo97 Oct 6, 2020
6a4d721
Add all templates menu
david-szabo97 Oct 6, 2020
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
Prev Previous commit
Next Next commit
Use entityType
  • Loading branch information
david-szabo97 committed Oct 6, 2020
commit 34d5078b8391c91284146e40092ca0af58817755
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ const NavigationPanel = () => {
<Navigation
activeItem={
'wp_template' === templateType
? `template-${ templateId }`
: `template-part-${ templatePartId }`
? `${ templateType }-${ templateId }`
: `${ templateType }-${ templatePartId }`
}
onActivateMenu={ setActiveMenu }
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,13 @@ export default function TemplateNavigationItems( {
templates = [ templates ];
}

const itemPrefix =
entityType === 'wp_template_part' ? 'template-part' : 'template';

return (
<>
{ templates.map( ( template ) => {
const { title, description } =
ITEM_CONTENTS[ template.slug ] ?? {};
const key = `${ itemPrefix }-${ template.id }`;
const key = `${ entityType }-${ template.id }`;


return (
<NavigationItem
Expand Down