@plone/volto 17.11.3 → 17.11.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -17,6 +17,30 @@ myst:
17
17
 
18
18
  <!-- towncrier release notes start -->
19
19
 
20
+ ## 17.11.5 (2024-01-26)
21
+
22
+ ### Bugfix
23
+
24
+ - handle addons that have not been migrated to the new structure of po files @erral [#5704](https://github.com/plone/volto/issues/5704)
25
+
26
+ ### Internal
27
+
28
+ - Upgrade to @plone/scripts 3.3.2 @sneridagh [#5706](https://github.com/plone/volto/issues/5706)
29
+
30
+ ## 17.11.4 (2024-01-25)
31
+
32
+ ### Bugfix
33
+
34
+ - In the recurrence widget, set the vertical alignment of the `edit` button to `middle`. @Ravi-kumar9347 [#5359](https://github.com/plone/volto/issues/5359)
35
+ - Fix multilingual redirector where it doesn't take into account the stored cookie in SSR. @robgietema [#5628](https://github.com/plone/volto/issues/5628)
36
+ - [#5647](https://github.com/plone/volto/issues/5647)
37
+ - Fix `links-to-item` should be a protected route. @iFlameing [#5666](https://github.com/plone/volto/issues/5666)
38
+ - Removed git merge conflicts from french volto.po locale file. @ichim-david [#5681](https://github.com/plone/volto/issues/5681)
39
+
40
+ ### Internal
41
+
42
+ - Add cypress tests for the "links-to-item" view of content items @jackahl [#5427](https://github.com/plone/volto/issues/5427)
43
+
20
44
  ## 17.11.3 (2024-01-25)
21
45
 
22
46
  ### Bugfix
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  }
10
10
  ],
11
11
  "license": "MIT",
12
- "version": "17.11.3",
12
+ "version": "17.11.5",
13
13
  "repository": {
14
14
  "type": "git",
15
15
  "url": "git@github.com:plone/volto.git"
@@ -247,7 +247,7 @@
247
247
  "@loadable/component": "5.14.1",
248
248
  "@loadable/server": "5.14.0",
249
249
  "@loadable/webpack-plugin": "5.15.2",
250
- "@plone/scripts": "^3.3.1",
250
+ "@plone/scripts": "^3.3.2",
251
251
  "@testing-library/cypress": "9.0.0",
252
252
  "@testing-library/jest-dom": "5.16.4",
253
253
  "@testing-library/react": "12.1.5",
@@ -0,0 +1 @@
1
+ Fix code button in slate. @pbauer
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plone/volto-slate",
3
- "version": "17.11.3",
3
+ "version": "17.11.5",
4
4
  "description": "Slate.js integration with Volto",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -18,7 +18,6 @@ import superindexIcon from '@plone/volto/icons/superindex.svg';
18
18
  import { createEmptyParagraph } from '@plone/volto-slate/utils';
19
19
 
20
20
  import {
21
- MarkButton,
22
21
  MarkElementButton,
23
22
  BlockButton,
24
23
  ClearFormattingButton,
@@ -96,7 +95,7 @@ export const buttons = {
96
95
  />
97
96
  ),
98
97
  code: (props) => (
99
- <MarkButton title="Code" format="code" icon={codeIcon} {...props} />
98
+ <MarkElementButton title="Code" format="code" icon={codeIcon} {...props} />
100
99
  ),
101
100
  'heading-two': (props) => (
102
101
  <BlockButton
@@ -10,12 +10,16 @@ import { Portal } from 'react-portal';
10
10
  import { Container, Segment, Table } from 'semantic-ui-react';
11
11
  import { FormattedMessage, defineMessages, useIntl } from 'react-intl';
12
12
  import { useDispatch, useSelector } from 'react-redux';
13
- import { getContent, queryRelations } from '@plone/volto/actions';
13
+ import { getContent, queryRelations, listActions } from '@plone/volto/actions';
14
+ import { asyncConnect } from '@plone/volto/helpers';
15
+
14
16
  import {
15
17
  Icon as IconNext,
16
18
  Toolbar,
17
19
  UniversalLink,
20
+ Unauthorized,
18
21
  } from '@plone/volto/components';
22
+ import { compose } from 'redux';
19
23
 
20
24
  import { getBaseUrl } from '@plone/volto/helpers';
21
25
  import backSVG from '@plone/volto/icons/back.svg';
@@ -41,6 +45,8 @@ const LinksToItem = (props) => {
41
45
  const dispatch = useDispatch();
42
46
  const pathname = props.location.pathname;
43
47
  const itempath = getBaseUrl(pathname);
48
+ const objectActions = useSelector((state) => state.actions.actions.object);
49
+ const editPermission = find(objectActions, { id: 'edit' });
44
50
 
45
51
  const title = useSelector((state) => state.content.data?.title || '');
46
52
  const myrelations = useSelector(
@@ -77,6 +83,9 @@ const LinksToItem = (props) => {
77
83
  });
78
84
 
79
85
  const relations_found = Object.keys(links_ordered).length > 0;
86
+ if (!editPermission) {
87
+ return <Unauthorized />;
88
+ }
80
89
  return (
81
90
  <Container id="linkstoitem">
82
91
  <Helmet title={intl.formatMessage(messages.linkstoitem)} />
@@ -206,4 +215,15 @@ const LinksToItem = (props) => {
206
215
  );
207
216
  };
208
217
 
209
- export default LinksToItem;
218
+ export const __test__ = LinksToItem;
219
+ export default compose(
220
+ asyncConnect([
221
+ {
222
+ key: 'actions',
223
+ // Dispatch async/await to make the operation synchronous, otherwise it returns
224
+ // before the promise is resolved
225
+ promise: async ({ location, store: { dispatch } }) =>
226
+ await dispatch(listActions(getBaseUrl(location.pathname))),
227
+ },
228
+ ]),
229
+ )(LinksToItem);
@@ -5,7 +5,7 @@ import configureMockStore from 'redux-mock-store';
5
5
  import thunk from 'redux-thunk';
6
6
  import { MemoryRouter } from 'react-router-dom';
7
7
 
8
- import LinksToItem from './LinksToItem';
8
+ import { __test__ as LinksToItem } from './LinksToItem';
9
9
 
10
10
  const middlewares = [thunk];
11
11
  const mockStore = configureMockStore(middlewares);
@@ -18,6 +18,18 @@ jest.mock('../Toolbar/More', () => jest.fn(() => <div className="More" />));
18
18
  describe('LinksToItem', () => {
19
19
  it('renders "links and references" view', () => {
20
20
  const store = mockStore({
21
+ actions: {
22
+ actions: {
23
+ document_actions: [],
24
+ object: [
25
+ {
26
+ icon: '',
27
+ id: 'edit',
28
+ title: 'Edit',
29
+ },
30
+ ],
31
+ },
32
+ },
21
33
  relations: {
22
34
  subrequests: {
23
35
  '/page-1': {
@@ -794,7 +794,7 @@ class RecurrenceWidget extends Component {
794
794
  id={`${fieldSet || 'field'}-${id}`}
795
795
  >
796
796
  <Grid>
797
- <Grid.Row stretched>
797
+ <Grid.Row stretched verticalAlign="middle">
798
798
  <Grid.Column width="4">
799
799
  <div className="wrapper">
800
800
  <label htmlFor={`field-${id}`}>{title}</label>
@@ -14,7 +14,7 @@ beforeAll(
14
14
 
15
15
  const mockStore = configureStore();
16
16
 
17
- test('renders a recurrence widget component', async () => {
17
+ test('renders a recurrence widget component with aligned columns', async () => {
18
18
  const store = mockStore({
19
19
  intl: {
20
20
  locale: 'en',
package/src/server.jsx CHANGED
@@ -239,7 +239,7 @@ server.get('/*', (req, res) => {
239
239
  : store.getState().content.data?.language?.token ||
240
240
  config.settings.defaultLanguage;
241
241
 
242
- if (toBackendLang(initialLang) !== contentLang) {
242
+ if (toBackendLang(initialLang) !== contentLang && url !== '/') {
243
243
  const newLang = toReactIntlLang(
244
244
  new locale.Locales(contentLang).best(supported).toString(),
245
245
  );
@@ -785,6 +785,7 @@ body.has-toolbar.has-sidebar-collapsed .ui.wrapper > .ui.inner.block.full {
785
785
  display: initial;
786
786
  }
787
787
  .ui.form .ui.input input {
788
+ padding-left: 5px;
788
789
  //reset for semantic-ui outline:none
789
790
  border-width: @1px;
790
791
  border-color: transparent;
@@ -1187,4 +1188,10 @@ body.has-toolbar.has-sidebar-collapsed .ui.wrapper > .ui.inner.block.full {
1187
1188
  }
1188
1189
  }
1189
1190
 
1191
+ // If using popperjs, we need also to set preference too to the
1192
+ // popperjs container. The sidebar container has 150, so it has to be higher.
1193
+ [data-popper-placement] {
1194
+ z-index: 200;
1195
+ }
1196
+
1190
1197
  @import 'teaser';
@@ -1,2 +1,3 @@
1
- export default LinksToItem;
2
- declare function LinksToItem(props: any): JSX.Element;
1
+ export function __test__(props: any): JSX.Element;
2
+ declare const _default: import("react-redux").ConnectedComponent<any, any>;
3
+ export default _default;