From 89a867504adfef05c2b5de62d1288f4af9bed22f Mon Sep 17 00:00:00 2001 From: "me@jeffersonbledsoe.com" Date: Fri, 7 Oct 2022 00:00:28 +0100 Subject: [PATCH 1/6] Sort control panels alphabetically by title --- .../manage/Controlpanels/Controlpanels.jsx | 38 +++++++++++-------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/src/components/manage/Controlpanels/Controlpanels.jsx b/src/components/manage/Controlpanels/Controlpanels.jsx index 3e6cd60514..e048479e52 100644 --- a/src/components/manage/Controlpanels/Controlpanels.jsx +++ b/src/components/manage/Controlpanels/Controlpanels.jsx @@ -8,7 +8,7 @@ import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { compose } from 'redux'; import { Link } from 'react-router-dom'; -import { concat, filter, last, map, uniqBy } from 'lodash'; +import { concat, filter, last, map, sortBy, uniqBy } from 'lodash'; import { Portal } from 'react-portal'; import { Helmet } from '@plone/volto/helpers'; import { Container, Grid, Header, Segment } from 'semantic-ui-react'; @@ -241,21 +241,27 @@ class Controlpanels extends Component { - {map(filter(controlpanels, { group }), (controlpanel) => ( - - -
- - - {controlpanel.title} - -
- -
- ))} + {map( + sortBy( + filter(controlpanels, { group }), + (controlpanel) => controlpanel.title, + ), + (controlpanel) => ( + + +
+ + + {controlpanel.title} + +
+ +
+ ), + )}
, From 2306a55fec8c513258d4667861c27d890d88d129 Mon Sep 17 00:00:00 2001 From: Jefferson Bledsoe Date: Sun, 16 Oct 2022 09:54:04 +0200 Subject: [PATCH 2/6] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b334f0bd4b..7b46faff8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ ### Internal +- Changed the control panel listing page to SSR the list of control panels @JefffersonBledsoe #3737 + ### Documentation ## 16.0.0-alpha.42 (2022-10-06) From 01526187d17d808aeaae5f15bc6e9442db67ea1e Mon Sep 17 00:00:00 2001 From: Jefferson Bledsoe Date: Sun, 16 Oct 2022 09:58:04 +0200 Subject: [PATCH 3/6] Fix changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b46faff8b..096d4dfc5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,9 +8,9 @@ ### Bugfix -### Internal +- Sort control panels alphabetically within each group @JeffersonBledsoe #3737 -- Changed the control panel listing page to SSR the list of control panels @JefffersonBledsoe #3737 +### Internal ### Documentation From df0d1e8a3671901eb4117b012d2961aa9bad0afa Mon Sep 17 00:00:00 2001 From: "me@jeffersonbledsoe.com" Date: Mon, 17 Oct 2022 10:02:51 +0100 Subject: [PATCH 4/6] Update snapshot --- .../__snapshots__/Controlpanels.test.jsx.snap | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/components/manage/Controlpanels/__snapshots__/Controlpanels.test.jsx.snap b/src/components/manage/Controlpanels/__snapshots__/Controlpanels.test.jsx.snap index e933494e57..ee1b39e595 100644 --- a/src/components/manage/Controlpanels/__snapshots__/Controlpanels.test.jsx.snap +++ b/src/components/manage/Controlpanels/__snapshots__/Controlpanels.test.jsx.snap @@ -33,7 +33,7 @@ exports[`Controlpanels renders a controlpanels component 1`] = ` className="column" >

- Date and Time + Add-Ons

@@ -69,7 +69,7 @@ exports[`Controlpanels renders a controlpanels component 1`] = ` className="column" >

- Language + Database

@@ -105,7 +105,7 @@ exports[`Controlpanels renders a controlpanels component 1`] = ` className="column" >

- Add-Ons + Date and Time

@@ -141,7 +141,7 @@ exports[`Controlpanels renders a controlpanels component 1`] = ` className="column" >

- Database + Language

@@ -177,7 +177,7 @@ exports[`Controlpanels renders a controlpanels component 1`] = ` className="column" >

- Undo + URL Management

@@ -213,7 +213,7 @@ exports[`Controlpanels renders a controlpanels component 1`] = ` className="column" >

- URL Management + Undo

@@ -408,7 +408,7 @@ exports[`Controlpanels renders a controlpanels component 1`] = ` className="column" >

- Users + Groups

@@ -480,7 +480,7 @@ exports[`Controlpanels renders a controlpanels component 1`] = ` className="column" >

- Groups + Users

@@ -693,7 +693,7 @@ exports[`Controlpanels renders an additional control panel 1`] = ` className="column" >

- Undo + URL Management

@@ -729,7 +729,7 @@ exports[`Controlpanels renders an additional control panel 1`] = ` className="column" >

- URL Management + Undo

@@ -835,7 +835,7 @@ exports[`Controlpanels renders an additional control panel 1`] = ` className="column" >

- Users + Groups

@@ -907,7 +907,7 @@ exports[`Controlpanels renders an additional control panel 1`] = ` className="column" >

- Groups + Users

From 72358fa54216c6506a4da8c6c48865838db5e486 Mon Sep 17 00:00:00 2001 From: "me@jeffersonbledsoe.com" Date: Thu, 17 Nov 2022 13:08:14 +0000 Subject: [PATCH 5/6] Update snapshot --- .../__snapshots__/Controlpanels.test.jsx.snap | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/manage/Controlpanels/__snapshots__/Controlpanels.test.jsx.snap b/src/components/manage/Controlpanels/__snapshots__/Controlpanels.test.jsx.snap index d40e509a32..48d070e4d1 100644 --- a/src/components/manage/Controlpanels/__snapshots__/Controlpanels.test.jsx.snap +++ b/src/components/manage/Controlpanels/__snapshots__/Controlpanels.test.jsx.snap @@ -266,7 +266,7 @@ exports[`Controlpanels renders a controlpanels component 1`] = ` className="column" >

- Editing + Content Rules

@@ -302,7 +302,7 @@ exports[`Controlpanels renders a controlpanels component 1`] = ` className="column" >

- Content Rules + Editing

From 988502d620bda767778c1baab6f8334b1a8fee69 Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Mon, 6 Nov 2023 18:33:56 +0100 Subject: [PATCH 6/6] Fix code, there was no filterControlPanels by then --- .../manage/Controlpanels/Controlpanels.jsx | 2 +- .../__snapshots__/Controlpanels.test.jsx.snap | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/manage/Controlpanels/Controlpanels.jsx b/src/components/manage/Controlpanels/Controlpanels.jsx index e341d95bc9..263be3b02f 100644 --- a/src/components/manage/Controlpanels/Controlpanels.jsx +++ b/src/components/manage/Controlpanels/Controlpanels.jsx @@ -222,7 +222,7 @@ function Controlpanels({ {map( sortBy( - filter(controlpanels, { group }), + filter(filteredControlPanels, { group }), (controlpanel) => controlpanel.title, ), (controlpanel) => ( diff --git a/src/components/manage/Controlpanels/__snapshots__/Controlpanels.test.jsx.snap b/src/components/manage/Controlpanels/__snapshots__/Controlpanels.test.jsx.snap index cffb664665..de99eecd17 100644 --- a/src/components/manage/Controlpanels/__snapshots__/Controlpanels.test.jsx.snap +++ b/src/components/manage/Controlpanels/__snapshots__/Controlpanels.test.jsx.snap @@ -338,7 +338,7 @@ exports[`Controlpanels renders a controlpanels component 1`] = ` className="column" >

- Relations + Moderate Comments

@@ -374,7 +374,7 @@ exports[`Controlpanels renders a controlpanels component 1`] = ` className="column" >

- Moderate Comments + Relations

@@ -940,7 +940,7 @@ exports[`Controlpanels renders an additional control panel 1`] = ` className="column" >

- Relations + Moderate Comments

@@ -976,7 +976,7 @@ exports[`Controlpanels renders an additional control panel 1`] = ` className="column" >

- Moderate Comments + Relations