@plone/volto 14.0.0-alpha.37 → 14.0.0-alpha.38

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
@@ -1,5 +1,20 @@
1
1
  # Change Log
2
2
 
3
+ ## 14.0.0-alpha.38 (2021-11-30)
4
+
5
+ ### Bugfix
6
+
7
+ - Use subrequest in hero block to not lost locking token. @cekk
8
+ - Always add lang attr in html @nzambello
9
+ - Fix time widget position on 24h format @nzambello
10
+
11
+ ### Internal
12
+
13
+ - Remove getNavigation from Login.jsx @iRohitSingh
14
+ - Allow listing block to be used in non-content pages (when used in a slot it
15
+ shouldn't crash on add/edit pages) @tiberiuichim
16
+ - Fix typo "toolbalWidth" @iRohitSingh
17
+
3
18
  ## 14.0.0-alpha.37 (2021-11-26)
4
19
 
5
20
  ### Bugfix
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  }
10
10
  ],
11
11
  "license": "MIT",
12
- "version": "14.0.0-alpha.37",
12
+ "version": "14.0.0-alpha.38",
13
13
  "repository": {
14
14
  "type": "git",
15
15
  "url": "git@github.com:plone/volto.git"
@@ -274,15 +274,19 @@ class Edit extends Component {
274
274
  });
275
275
  readAsDataURL(file).then((data) => {
276
276
  const fields = data.match(/^data:(.*);(.*),(.*)$/);
277
- this.props.createContent(getBaseUrl(this.props.pathname), {
278
- '@type': 'Image',
279
- image: {
280
- data: fields[3],
281
- encoding: fields[2],
282
- 'content-type': fields[1],
283
- filename: file.name,
277
+ this.props.createContent(
278
+ getBaseUrl(this.props.pathname),
279
+ {
280
+ '@type': 'Image',
281
+ image: {
282
+ data: fields[3],
283
+ encoding: fields[2],
284
+ 'content-type': fields[1],
285
+ filename: file.name,
286
+ },
284
287
  },
285
- });
288
+ this.props.block,
289
+ );
286
290
  });
287
291
  }
288
292
 
@@ -459,9 +463,9 @@ class Edit extends Component {
459
463
  export default compose(
460
464
  injectIntl,
461
465
  connect(
462
- (state) => ({
463
- request: state.content.create,
464
- content: state.content.data,
466
+ (state, ownProps) => ({
467
+ request: state.content.subrequests[ownProps.block] || {},
468
+ content: state.content.subrequests[ownProps.block]?.data,
465
469
  }),
466
470
  { createContent },
467
471
  ),
@@ -8,11 +8,16 @@ import Edit from './Edit';
8
8
  global.__SERVER__ = true; // eslint-disable-line no-underscore-dangle
9
9
 
10
10
  const mockStore = configureStore();
11
+ const blockId = '1234';
12
+
11
13
  test('renders an edit hero block component', () => {
12
14
  const store = mockStore({
13
15
  content: {
14
16
  create: {},
15
17
  data: {},
18
+ subrequests: {
19
+ [blockId]: {},
20
+ },
16
21
  },
17
22
  intl: {
18
23
  locale: 'en',
@@ -24,7 +29,7 @@ test('renders an edit hero block component', () => {
24
29
  <Edit
25
30
  data={{ url: 'hero' }}
26
31
  selected={false}
27
- block="1234"
32
+ block={blockId}
28
33
  content={{}}
29
34
  request={{
30
35
  loading: false,
@@ -4,7 +4,7 @@ import hoistNonReactStatics from 'hoist-non-react-statics';
4
4
  import useDeepCompareEffect from 'use-deep-compare-effect';
5
5
 
6
6
  import { getContent, getQueryStringResults } from '@plone/volto/actions';
7
- import { usePagination } from '@plone/volto/helpers';
7
+ import { usePagination, getBaseUrl } from '@plone/volto/helpers';
8
8
 
9
9
  import config from '@plone/volto/registry';
10
10
 
@@ -22,7 +22,7 @@ export default function withQuerystringResults(WrappedComponent) {
22
22
  const { b_size = settings.defaultPageSize } = querystring; // batchsize
23
23
 
24
24
  // save the path so it won't trigger dispatch on eager router location change
25
- const [initialPath] = React.useState(path);
25
+ const [initialPath] = React.useState(getBaseUrl(path));
26
26
 
27
27
  const copyFields = ['limit', 'query', 'sort_on', 'sort_order', 'depth'];
28
28
 
@@ -8,7 +8,7 @@ import jwtDecode from 'jwt-decode';
8
8
  import PropTypes from 'prop-types';
9
9
  import { connect } from 'react-redux';
10
10
  import { compose } from 'redux';
11
- import { asyncConnect } from '@plone/volto/helpers';
11
+ import { asyncConnect, Helmet } from '@plone/volto/helpers';
12
12
  import { Segment } from 'semantic-ui-react';
13
13
  import { renderRoutes } from 'react-router-config';
14
14
  import { Slide, ToastContainer, toast } from 'react-toastify';
@@ -19,6 +19,7 @@ import cx from 'classnames';
19
19
  import config from '@plone/volto/registry';
20
20
  import { PluggablesProvider } from '@plone/volto/components/manage/Pluggable';
21
21
  import { visitBlocks } from '@plone/volto/helpers/Blocks/Blocks';
22
+ import { injectIntl } from 'react-intl';
22
23
 
23
24
  import Error from '@plone/volto/error';
24
25
 
@@ -109,8 +110,16 @@ class App extends Component {
109
110
  const isCmsUI = isCmsUi(this.props.pathname);
110
111
  const ConnectionRefusedView = views.errorViews.ECONNREFUSED;
111
112
 
113
+ const language =
114
+ this.props.content?.language?.token ?? this.props.intl?.locale;
115
+
112
116
  return (
113
117
  <PluggablesProvider>
118
+ {language && (
119
+ <Helmet>
120
+ <html lang={language} />
121
+ </Helmet>
122
+ )}
114
123
  <BodyClass className={`view-${action}view`} />
115
124
 
116
125
  {/* Body class depending on content type */}
@@ -262,6 +271,7 @@ export default compose(
262
271
  __SERVER__ && dispatch(getWorkflow(getBaseUrl(location.pathname))),
263
272
  },
264
273
  ]),
274
+ injectIntl,
265
275
  connect(
266
276
  (state, props) => ({
267
277
  pathname: props.location.pathname,
@@ -4,7 +4,6 @@ import config from '@plone/volto/registry';
4
4
 
5
5
  const ContentMetadataTags = (props) => {
6
6
  const {
7
- language,
8
7
  opengraph_title,
9
8
  opengraph_description,
10
9
  seo_title,
@@ -48,7 +47,6 @@ const ContentMetadataTags = (props) => {
48
47
  return (
49
48
  <>
50
49
  <Helmet>
51
- {language && <html lang={language.token} />}
52
50
  <title>{seo_title || title}</title>
53
51
  <meta name="description" content={seo_description || description} />
54
52
  <meta
@@ -22,7 +22,7 @@ import qs from 'query-string';
22
22
  import { withRouter } from 'react-router-dom';
23
23
 
24
24
  import { Icon } from '@plone/volto/components';
25
- import { getNavigation, login } from '@plone/volto/actions';
25
+ import { login } from '@plone/volto/actions';
26
26
  import { toast } from 'react-toastify';
27
27
  import { Toast } from '@plone/volto/components';
28
28
 
@@ -318,6 +318,6 @@ export default compose(
318
318
  .replace(/\/logout$/, '') ||
319
319
  '/',
320
320
  }),
321
- { login, getNavigation },
321
+ { login },
322
322
  ),
323
323
  )(Login);
package/test.py ADDED
@@ -0,0 +1,8 @@
1
+ asd = 1
2
+
3
+ if asd == 2:
4
+ print("if1")
5
+ elif asd:
6
+ print("elif1")
7
+ elif asd == 1:
8
+ print("elif2")
@@ -98,10 +98,10 @@
98
98
  }
99
99
 
100
100
  &.full-size {
101
- width: calc(100% - @toolbalWidth);
101
+ width: calc(100% - @toolbarWidth);
102
102
 
103
103
  &.no-toolbar {
104
- width: calc(100% - @toolbalWidthMin);
104
+ width: calc(100% - @toolbarWidthMin);
105
105
  }
106
106
  }
107
107
 
@@ -35,6 +35,7 @@
35
35
 
36
36
  .rc-time-picker-panel-inner {
37
37
  width: @timePickerWidthNarrow;
38
+ right: 84px;
38
39
  }
39
40
  }
40
41
 
@@ -245,7 +245,7 @@ body:not(.has-sidebar):not(.has-sidebar-collapsed) {
245
245
  justify-content: center;
246
246
 
247
247
  button {
248
- width: @toolbalWidth;
248
+ width: @toolbarWidth;
249
249
  height: 20px;
250
250
  padding: 0;
251
251
  border: 0;
@@ -342,23 +342,23 @@ body:not(.has-sidebar):not(.has-sidebar-collapsed) {
342
342
 
343
343
  @media only screen and (min-width: @largestMobileScreen) {
344
344
  .toolbar {
345
- width: @toolbalWidthMin;
345
+ width: @toolbarWidthMin;
346
346
  height: 100%;
347
347
  flex-direction: row;
348
348
  justify-content: flex-end;
349
349
  transition: width 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045);
350
350
 
351
351
  & + .pusher {
352
- margin-right: @toolbalWidthMin;
352
+ margin-right: @toolbarWidthMin;
353
353
  transition: margin-right 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045);
354
354
  }
355
355
 
356
356
  &.expanded {
357
- width: @toolbalWidth;
357
+ width: @toolbarWidth;
358
358
  height: 100%;
359
359
 
360
360
  & + .pusher {
361
- margin-right: @toolbalWidth;
361
+ margin-right: @toolbarWidth;
362
362
  transition: margin-right 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045);
363
363
  }
364
364
 
@@ -397,7 +397,7 @@ body:not(.has-sidebar):not(.has-sidebar-collapsed) {
397
397
 
398
398
  &-content {
399
399
  position: fixed;
400
- left: @toolbalWidth;
400
+ left: @toolbarWidth;
401
401
  width: 320px;
402
402
  }
403
403
 
@@ -458,14 +458,14 @@ body:not(.has-sidebar):not(.has-sidebar-collapsed) {
458
458
 
459
459
  &-handler {
460
460
  display: flex;
461
- width: @toolbalWidthMin;
461
+ width: @toolbarWidthMin;
462
462
  height: 100%;
463
463
  flex-direction: column;
464
464
  justify-content: center;
465
465
 
466
466
  button {
467
- width: @toolbalWidthMin;
468
- height: @toolbalWidth;
467
+ width: @toolbarWidthMin;
468
+ height: @toolbarWidth;
469
469
 
470
470
  &::before {
471
471
  left: 8px;
@@ -9,8 +9,8 @@
9
9
  @fontName : 'Poppins';
10
10
 
11
11
  @googleFontSizes : '300,400,500,700,400italic,700italic&display=swap';
12
- @toolbalWidth: 80px;
13
- @toolbalWidthMin: 20px;
12
+ @toolbarWidth: 80px;
13
+ @toolbarWidthMin: 20px;
14
14
  @fullSizeIcon: 36px;
15
15
 
16
16