Skip to content

Commit

Permalink
Update dependency @wordpress/dataviews to v4.10.0 (#40598)
Browse files Browse the repository at this point in the history
* Update dependency @wordpress/dataviews to v4.10.0

* Add hack for WordPress/gutenberg#67897

* ThreatsDataViews: Fix defaultLayouts (#40600)

* Updates defaultLayouts fields

* Changelog

* Update title field label

---------

Co-authored-by: Brad Jorsch <brad.jorsch@automattic.com>

---------

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Brad Jorsch <brad.jorsch@automattic.com>
Co-authored-by: dkmyta <43220201+dkmyta@users.noreply.github.com>
  • Loading branch information
4 people authored Dec 13, 2024
1 parent 36d84a3 commit 5047d0a
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 42 deletions.
15 changes: 15 additions & 0 deletions .pnpm-patches/@wordpress__dataviews@4.10.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Hack for https://github.com/WordPress/gutenberg/issues/67897

diff --git a/package.json b/package.json
index d7af17fea3f59f807a9d7234cf9ce79131538383..c862b012af312c9fc5cf1d2d884ec332ee079d0b 100644
--- a/package.json
+++ b/package.json
@@ -27,7 +27,7 @@
"exports": {
".": {
"types": "./build-types/index.d.ts",
- "import": "./build-module/index.js"
+ "default": "./build/index.js"
},
"./wp": {
"types": "./build-types/index.d.ts",
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,10 @@
"node": "^22.9.0",
"pnpm": "^9.3.0 <9.12.0"
},
"packageManager": "pnpm@9.3.0"
"packageManager": "pnpm@9.3.0",
"pnpm": {
"patchedDependencies": {
"@wordpress/dataviews@4.10.0": ".pnpm-patches/@wordpress__dataviews@4.10.0.patch"
}
}
}
33 changes: 19 additions & 14 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: changed

Fixes ThreatsDataViews defaultLayouts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Updated package dependencies.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export const THREAT_TYPES = [
];

export const THREAT_ICONS = {
plugin: pluginIcon,
theme: themeIcon,
plugins: pluginIcon,
themes: themeIcon,
core: coreIcon,
file: fileIcon,
default: shieldIcon,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import {
THREAT_FIELD_SIGNATURE,
THREAT_FIELD_STATUS,
THREAT_FIELD_THEME,
THREAT_FIELD_THREAT,
THREAT_FIELD_TITLE,
THREAT_FIELD_TYPE,
THREAT_ICONS,
Expand Down Expand Up @@ -101,23 +100,10 @@ export default function ThreatsDataViews( {
const defaultLayouts: SupportedLayouts = {
table: {
...baseView,
fields: [
THREAT_FIELD_SEVERITY,
THREAT_FIELD_THREAT,
THREAT_FIELD_TYPE,
THREAT_FIELD_AUTO_FIX,
],
layout: {
primaryField: THREAT_FIELD_SEVERITY,
combinedFields: [
{
id: THREAT_FIELD_THREAT,
label: __( 'Threat', 'jetpack-components' ),
children: [ THREAT_FIELD_TITLE, THREAT_FIELD_DESCRIPTION ],
direction: 'vertical',
},
],
},
fields: [ THREAT_FIELD_SEVERITY, THREAT_FIELD_TYPE, THREAT_FIELD_AUTO_FIX ],
titleField: THREAT_FIELD_TITLE,
descriptionField: THREAT_FIELD_DESCRIPTION,
showMedia: false,
},
list: {
...baseView,
Expand All @@ -127,10 +113,9 @@ export default function ThreatsDataViews( {
THREAT_FIELD_EXTENSION,
THREAT_FIELD_SIGNATURE,
],
layout: {
primaryField: THREAT_FIELD_TITLE,
mediaField: THREAT_FIELD_ICON,
},
titleField: THREAT_FIELD_TITLE,
mediaField: THREAT_FIELD_ICON,
showMedia: true,
},
};

Expand Down Expand Up @@ -222,7 +207,7 @@ export default function ThreatsDataViews( {
const result: Field< Threat >[] = [
{
id: THREAT_FIELD_TITLE,
label: __( 'Title', 'jetpack-components' ),
label: __( 'Threat', 'jetpack-components' ),
enableGlobalSearch: true,
enableHiding: false,
render: ( { item }: { item: Threat } ) => (
Expand Down
2 changes: 1 addition & 1 deletion projects/js-packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@wordpress/components": "29.0.0",
"@wordpress/compose": "7.14.0",
"@wordpress/data": "10.14.0",
"@wordpress/dataviews": "4.9.0",
"@wordpress/dataviews": "4.10.0",
"@wordpress/date": "5.14.0",
"@wordpress/element": "6.14.0",
"@wordpress/i18n": "5.14.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Updated package dependencies.
2 changes: 1 addition & 1 deletion projects/js-packages/publicize-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@wordpress/compose": "7.14.0",
"@wordpress/core-data": "7.14.0",
"@wordpress/data": "10.14.0",
"@wordpress/dataviews": "4.9.0",
"@wordpress/dataviews": "4.10.0",
"@wordpress/date": "5.14.0",
"@wordpress/edit-post": "8.14.0",
"@wordpress/editor": "14.14.0",
Expand Down

0 comments on commit 5047d0a

Please sign in to comment.