Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 11 additions & 0 deletions .pnpmfile.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,17 @@ async function fixDeps( pkg ) {
}
}

// lock()/unlock() pair through a module-scoped registry, so a prerelease
// private-apis range would resolve a second copy beside the stable one the
// repo pins and throw. Collapse it onto the version premium-analytics
// declares; the rule stops matching once no manifest asks for a prerelease.
if ( pkg.dependencies?.[ '@wordpress/private-apis' ]?.includes( '-next' ) ) {
pkg.dependencies[ '@wordpress/private-apis' ] =
require( './projects/packages/premium-analytics/package.json' ).dependencies[
'@wordpress/private-apis'
];
}

// Unused, vulnerable dep.
if (
pkg.name === '@automattic/components' &&
Expand Down
861 changes: 801 additions & 60 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

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

Dashboard: keep the four-column layout regardless of a stored columns preference.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Pin the widget dashboard packages and DataViews to the 202609031004 Gutenberg development release, picking up the widget dashboard policy API.
6 changes: 3 additions & 3 deletions projects/packages/premium-analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@wordpress/compose": "8.7.0",
"@wordpress/core-data": "7.54.0",
"@wordpress/data": "10.54.0",
"@wordpress/dataviews": "18.1.0",
"@wordpress/dataviews": "19.0.1-next.v.202609031004.0",
"@wordpress/date": "5.54.0",
"@wordpress/element": "8.6.0",
"@wordpress/html-entities": "4.54.0",
Expand All @@ -78,8 +78,8 @@
"@wordpress/theme": "2.0.0",
"@wordpress/ui": "0.21.0",
"@wordpress/url": "4.54.0",
"@wordpress/widget-dashboard": "0.6.0",
"@wordpress/widget-primitives": "0.6.0",
"@wordpress/widget-dashboard": "0.7.1-next.v.202609031004.0",
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0",
"clsx": "2.1.1",
"date-fns": "4.1.0",
"fast-deep-equal": "^3.1.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"dependencies": {
"@automattic/charts": "workspace:*",
"@automattic/ui": "1.0.2",
"@wordpress/dataviews": "18.1.0",
"@wordpress/dataviews": "19.0.1-next.v.202609031004.0",
"@wordpress/ui": "0.21.0",
"react": "18.3.1"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^15.0.0",
"@wordpress/private-apis": "1.54.0",
"@wordpress/widget-primitives": "0.6.0",
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0",
"date-fns": "4.1.0",
"react": "18.3.1"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@storybook/react": "10.4.6",
"@testing-library/react": "16.3.2",
"@testing-library/user-event": "14.6.1",
"@wordpress/dataviews": "18.1.0",
"@wordpress/dataviews": "19.0.1-next.v.202609031004.0",
"@wordpress/date": "5.54.0"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { act, renderHook } from '@testing-library/react';
import { dispatch } from '@wordpress/data';
import { store as preferencesStore } from '@wordpress/preferences';
import { ROW_HEIGHT_PRESETS, WIDGET_DASHBOARD_COLUMN_COUNT } from '@wordpress/widget-dashboard';
import { DASHBOARD_GRID_SETTINGS_KEY, DASHBOARD_PREFERENCES_SCOPE } from '../constants';
import { useDashboardGridSettings } from './use-dashboard-grid-settings';

describe( 'useDashboardGridSettings', () => {
beforeEach( () => {
dispatch( preferencesStore ).set(
DASHBOARD_PREFERENCES_SCOPE,
DASHBOARD_GRID_SETTINGS_KEY,
null
);
} );

it( 'pins the column count whatever the stored preference says', () => {
dispatch( preferencesStore ).set( DASHBOARD_PREFERENCES_SCOPE, DASHBOARD_GRID_SETTINGS_KEY, {
model: 'grid',
rowHeight: ROW_HEIGHT_PRESETS.medium,
columns: 2,
} );

const { result } = renderHook( () => useDashboardGridSettings() );

expect( result.current[ 0 ] ).toMatchObject( {
columns: WIDGET_DASHBOARD_COLUMN_COUNT,
rowHeight: ROW_HEIGHT_PRESETS.medium,
} );
} );

it( 'keeps the pinned count after a write', () => {
const { result } = renderHook( () => useDashboardGridSettings() );

act( () =>
result.current[ 1 ]( { model: 'grid', rowHeight: ROW_HEIGHT_PRESETS.large, columns: 1 } )
);

expect( result.current[ 0 ] ).toMatchObject( {
columns: WIDGET_DASHBOARD_COLUMN_COUNT,
rowHeight: ROW_HEIGHT_PRESETS.large,
} );
} );
} );
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { store as preferencesStore } from '@wordpress/preferences';
import {
DEFAULT_GRID,
ROW_HEIGHT_PRESETS,
WIDGET_DASHBOARD_COLUMN_COUNT,
normalizeGridSettings,
} from '@wordpress/widget-dashboard';
import fastDeepEqual from 'fast-deep-equal/es6/index.js';
Expand Down Expand Up @@ -47,7 +48,12 @@ export function useDashboardGridSettings(): [
get: ( scope: string, name: string ) => WidgetGridSettings | undefined;
}
).get( DASHBOARD_PREFERENCES_SCOPE, DASHBOARD_GRID_SETTINGS_KEY );
return normalizeGridSettings( stored ?? PA_DEFAULT_GRID, PA_DEFAULT_ROW_HEIGHT );
return {
...normalizeGridSettings( stored ?? PA_DEFAULT_GRID, PA_DEFAULT_ROW_HEIGHT ),
// Placements are authored for four columns, and preferences written by the
// removed Columns control may still carry another count: pin it on read.
columns: WIDGET_DASHBOARD_COLUMN_COUNT,
};
}, [] );

const { set } = useDispatch( preferencesStore ) as unknown as {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"@wordpress/i18n": "^6.9.0",
"@wordpress/preferences": "4.54.0",
"@wordpress/route": "0.20.0",
"@wordpress/widget-dashboard": "0.6.0",
"@wordpress/widget-primitives": "0.6.0",
"@wordpress/widget-dashboard": "0.7.1-next.v.202609031004.0",
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0",
"date-fns": "4.1.0",
"fast-deep-equal": "^3.1.3",
"react": "18.3.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"@wordpress/icons": "^15.0.0",
"@wordpress/preferences": "4.54.0",
"@wordpress/route": "0.20.0",
"@wordpress/widget-dashboard": "0.6.0",
"@wordpress/widget-primitives": "0.6.0",
"@wordpress/widget-dashboard": "0.7.1-next.v.202609031004.0",
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0",
"date-fns": "4.1.0",
"fast-deep-equal": "^3.1.3",
"react": "18.3.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"@wordpress/icons": "^15.0.0",
"@wordpress/preferences": "4.54.0",
"@wordpress/route": "0.20.0",
"@wordpress/widget-dashboard": "0.6.0",
"@wordpress/widget-primitives": "0.6.0",
"@wordpress/widget-dashboard": "0.7.1-next.v.202609031004.0",
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0",
"date-fns": "4.1.0",
"fast-deep-equal": "^3.1.3"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import '../../routes/dashboard/components/onboarding-tour/onboarding-tour.test';
import '../../routes/dashboard/components/onboarding-tour/steps.test';
import '../../routes/dashboard/hooks/use-dashboard-grid-settings/use-dashboard-grid-settings.test';
import '../../routes/reports/report-names.test';
import '../../routes/reports/search-terms/config/aggregate.test';
import '../../routes/reports/search-terms/config/fields.test';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"@jetpack-premium-analytics/widgets-toolkit": "link:../../packages/widgets-toolkit",
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^15.0.0",
"@wordpress/widget-primitives": "0.6.0",
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0",
"react": "18.3.1"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@jetpack-premium-analytics/widgets-toolkit": "link:../../packages/widgets-toolkit",
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^15.0.0",
"@wordpress/widget-primitives": "0.6.0",
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0",
"react": "18.3.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^15.0.0",
"@wordpress/ui": "0.21.0",
"@wordpress/widget-primitives": "0.6.0",
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0",
"react": "18.3.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@jetpack-premium-analytics/widgets-toolkit": "link:../../packages/widgets-toolkit",
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^15.0.0",
"@wordpress/widget-primitives": "0.6.0",
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0",
"react": "18.3.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@jetpack-premium-analytics/widgets-toolkit": "link:../../packages/widgets-toolkit",
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^15.0.0",
"@wordpress/widget-primitives": "0.6.0",
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0",
"react": "18.3.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@jetpack-premium-analytics/widgets-toolkit": "link:../../packages/widgets-toolkit",
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^15.0.0",
"@wordpress/widget-primitives": "0.6.0",
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0",
"react": "18.3.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@jetpack-premium-analytics/widgets-toolkit": "link:../../packages/widgets-toolkit",
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^15.0.0",
"@wordpress/widget-primitives": "0.6.0",
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0",
"react": "18.3.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@jetpack-premium-analytics/widgets-toolkit": "link:../../packages/widgets-toolkit",
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^15.0.0",
"@wordpress/widget-primitives": "0.6.0",
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0",
"react": "18.3.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@jetpack-premium-analytics/widgets-toolkit": "link:../../packages/widgets-toolkit",
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^15.0.0",
"@wordpress/widget-primitives": "0.6.0",
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0",
"react": "18.3.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^15.0.0",
"@wordpress/ui": "0.21.0",
"@wordpress/widget-primitives": "0.6.0"
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@jetpack-premium-analytics/widgets-toolkit": "link:../../packages/widgets-toolkit",
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^15.0.0",
"@wordpress/widget-primitives": "0.6.0",
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0",
"react": "18.3.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@jetpack-premium-analytics/widgets-toolkit": "link:../../packages/widgets-toolkit",
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^15.0.0",
"@wordpress/widget-primitives": "0.6.0",
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0",
"react": "18.3.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^15.0.0",
"@wordpress/ui": "0.21.0",
"@wordpress/widget-primitives": "0.6.0"
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^15.0.0",
"@wordpress/ui": "0.21.0",
"@wordpress/widget-primitives": "0.6.0"
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"@wordpress/element": "8.6.0",
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^15.0.0",
"@wordpress/widget-primitives": "0.6.0"
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"@wordpress/element": "8.6.0",
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^15.0.0",
"@wordpress/widget-primitives": "0.6.0"
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^15.0.0",
"@wordpress/ui": "0.21.0",
"@wordpress/widget-primitives": "0.6.0"
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"@wordpress/element": "8.6.0",
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^15.0.0",
"@wordpress/widget-primitives": "0.6.0"
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@jetpack-premium-analytics/widgets-toolkit": "link:../../packages/widgets-toolkit",
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^15.0.0",
"@wordpress/widget-primitives": "0.6.0",
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0",
"react": "18.3.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"@jetpack-premium-analytics/externals": "link:../../packages/externals",
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^15.0.0",
"@wordpress/widget-primitives": "0.6.0"
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0"
},
"devDependencies": {
"@wordpress/element": "8.6.0",
"@wordpress/widget-dashboard": "0.6.0"
"@wordpress/widget-dashboard": "0.7.1-next.v.202609031004.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"@wordpress/element": "8.6.0",
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^15.0.0",
"@wordpress/widget-primitives": "0.6.0"
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"@wordpress/element": "8.6.0",
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^15.0.0",
"@wordpress/widget-primitives": "0.6.0"
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@wordpress/element": "8.6.0",
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^15.0.0",
"@wordpress/widget-primitives": "0.6.0",
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0",
"react": "18.3.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@wordpress/element": "8.6.0",
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^15.0.0",
"@wordpress/widget-primitives": "0.6.0",
"@wordpress/widget-primitives": "0.6.2-next.v.202609031004.0",
"react": "18.3.1"
}
}
Loading
Loading