Skip to content

Commit

Permalink
Merge branch 'add/action-dataviews-3' of github.com:gigitux/gutenberg…
Browse files Browse the repository at this point in the history
… into add/action-dataviews-3
  • Loading branch information
gigitux committed Dec 2, 2024
2 parents 4583cf8 + 8857196 commit 02da400
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion packages/fields/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ Undocumented declaration.

### duplicateTemplatePart

Undocumented declaration.
This action is used to duplicate a template part.

_Type_

- `Action< TemplatePart >`

### exportPattern

Expand Down
3 changes: 3 additions & 0 deletions packages/fields/src/actions/duplicate-template-part.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ import type { Post, TemplatePart } from '../types';
import { CreateTemplatePartModalContents } from '../components/create-template-part-modal';
import { getItemTitle } from './utils';

/**
* This action is used to duplicate a template part.
*/
const duplicateTemplatePart: Action< TemplatePart > = {
id: 'duplicate-template-part',
label: _x( 'Duplicate', 'action label' ),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {
} from '@wordpress/icons';
import { store as noticesStore } from '@wordpress/notices';
// @ts-ignore
// @ts-ignore
import { serialize } from '@wordpress/blocks';

/**
Expand Down Expand Up @@ -128,7 +127,7 @@ export function CreateTemplatePartModalContents( {

const defaultTemplatePartAreas = useSelect( ( select ) => {
const areas =
// @ts-expect-error The default_template_part_areas is not part of the core store type.
// @ts-expect-error getEntityRecord is not typed with unstableBase as argument.
select( coreStore ).getEntityRecord< {
default_template_part_areas: Array< {
area: string;
Expand Down

0 comments on commit 02da400

Please sign in to comment.