@plone/volto 17.0.1 → 17.1.1
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 +41 -0
- package/README.md +36 -252
- package/addon-registry.js +6 -8
- package/cypress/support/commands.js +1 -2
- package/cypress/support/reset-fixture.js +2 -4
- package/jest-extender-plugin.js +3 -1
- package/locales/pt_BR/LC_MESSAGES/volto.po +1 -1
- package/locales/pt_BR.json +1 -1
- package/package.json +5 -4
- package/packages/volto-slate/package.json +1 -1
- package/pre-build-transpiling.js +1 -1
- package/razzle.config.js +6 -10
- package/src/components/manage/Blocks/LeadImage/LeadImageSidebar.test.jsx +3 -2
- package/src/components/manage/Blocks/LeadImage/View.jsx +1 -7
- package/src/components/manage/Blocks/LeadImage/View.test.jsx +22 -0
- package/src/components/manage/Blocks/LeadImage/utils.js +9 -0
- package/src/components/manage/Blocks/Listing/ListingData.jsx +3 -3
- package/src/components/manage/Blocks/Listing/ListingData.test.jsx +2 -0
- package/src/components/manage/UniversalLink/UniversalLink.jsx +3 -1
- package/src/components/theme/Comments/CommentEditModal.stories.jsx +64 -0
- package/src/components/theme/EventDetails/EventDetails.stories.jsx +88 -0
- package/src/components/theme/Header/Header.stories.jsx +47 -0
- package/src/components/theme/Image/Image.jsx +8 -11
- package/src/components/theme/Image/Image.test.jsx +11 -11
- package/src/components/theme/Login/Login.jsx +1 -1
- package/src/components/theme/Login/Login.stories.jsx +1 -1
- package/src/components/theme/Logo/Logo.Multilingual.test.jsx +5 -25
- package/src/components/theme/Logo/Logo.jsx +8 -6
- package/src/components/theme/Logo/Logo.stories.jsx +25 -1
- package/src/components/theme/Logo/Logo.test.jsx +6 -19
- package/src/components/theme/SearchWidget/SearchWidget.stories.jsx +36 -0
- package/src/config/Blocks.jsx +2 -0
- package/src/helpers/Url/Url.js +29 -0
- package/src/helpers/Url/Url.test.js +104 -0
- package/src/helpers/index.js +1 -0
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
checkAndNormalizeUrl,
|
|
19
19
|
normaliseMail,
|
|
20
20
|
normalizeTelephone,
|
|
21
|
+
flattenScales,
|
|
21
22
|
} from './Url';
|
|
22
23
|
|
|
23
24
|
beforeEach(() => {
|
|
@@ -350,4 +351,107 @@ describe('Url', () => {
|
|
|
350
351
|
);
|
|
351
352
|
});
|
|
352
353
|
});
|
|
354
|
+
describe('flattenScales', () => {
|
|
355
|
+
it('flattenScales image is not set', () => {
|
|
356
|
+
const id = '/halfdome2022-2.jpg';
|
|
357
|
+
const image = undefined;
|
|
358
|
+
expect(flattenScales(id, image)).toBe(undefined);
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
it('flattenScales test from the catalog', () => {
|
|
362
|
+
const id = '/halfdome2022-2.jpg';
|
|
363
|
+
const image = {
|
|
364
|
+
'content-type': 'image/jpeg',
|
|
365
|
+
download: '@@images/image-1182-cf763ae23c52340d8a17a7afdb26c8cb.jpeg',
|
|
366
|
+
filename: 'halfdome2022.jpg',
|
|
367
|
+
height: 665,
|
|
368
|
+
scales: {
|
|
369
|
+
great: {
|
|
370
|
+
download:
|
|
371
|
+
'@@images/image-1200-539ab119ebadc7d011798980a4a5e8d4.jpeg',
|
|
372
|
+
height: 665,
|
|
373
|
+
width: 1182,
|
|
374
|
+
},
|
|
375
|
+
huge: {
|
|
376
|
+
download:
|
|
377
|
+
'@@images/image-1600-188968febc677890c1b99d5339f9bef1.jpeg',
|
|
378
|
+
height: 665,
|
|
379
|
+
width: 1182,
|
|
380
|
+
},
|
|
381
|
+
},
|
|
382
|
+
size: 319364,
|
|
383
|
+
width: 1182,
|
|
384
|
+
};
|
|
385
|
+
expect(flattenScales(id, image)).toStrictEqual({
|
|
386
|
+
'content-type': 'image/jpeg',
|
|
387
|
+
download: '@@images/image-1182-cf763ae23c52340d8a17a7afdb26c8cb.jpeg',
|
|
388
|
+
filename: 'halfdome2022.jpg',
|
|
389
|
+
height: 665,
|
|
390
|
+
scales: {
|
|
391
|
+
great: {
|
|
392
|
+
download:
|
|
393
|
+
'@@images/image-1200-539ab119ebadc7d011798980a4a5e8d4.jpeg',
|
|
394
|
+
height: 665,
|
|
395
|
+
width: 1182,
|
|
396
|
+
},
|
|
397
|
+
huge: {
|
|
398
|
+
download:
|
|
399
|
+
'@@images/image-1600-188968febc677890c1b99d5339f9bef1.jpeg',
|
|
400
|
+
height: 665,
|
|
401
|
+
width: 1182,
|
|
402
|
+
},
|
|
403
|
+
},
|
|
404
|
+
size: 319364,
|
|
405
|
+
width: 1182,
|
|
406
|
+
});
|
|
407
|
+
});
|
|
408
|
+
it('flattenScales test from serialization', () => {
|
|
409
|
+
const id = 'http://localhost:3000/halfdome2022-2.jpg';
|
|
410
|
+
const image = {
|
|
411
|
+
'content-type': 'image/jpeg',
|
|
412
|
+
download:
|
|
413
|
+
'http://localhost:3000/halfdome2022-2.jpg/@@images/image-1182-cf763ae23c52340d8a17a7afdb26c8cb.jpeg',
|
|
414
|
+
filename: 'halfdome2022.jpg',
|
|
415
|
+
height: 665,
|
|
416
|
+
scales: {
|
|
417
|
+
great: {
|
|
418
|
+
download:
|
|
419
|
+
'http://localhost:3000/halfdome2022-2.jpg/@@images/image-1200-539ab119ebadc7d011798980a4a5e8d4.jpeg',
|
|
420
|
+
height: 665,
|
|
421
|
+
width: 1182,
|
|
422
|
+
},
|
|
423
|
+
huge: {
|
|
424
|
+
download:
|
|
425
|
+
'http://localhost:3000/halfdome2022-2.jpg/@@images/image-1600-188968febc677890c1b99d5339f9bef1.jpeg',
|
|
426
|
+
height: 665,
|
|
427
|
+
width: 1182,
|
|
428
|
+
},
|
|
429
|
+
},
|
|
430
|
+
size: 319364,
|
|
431
|
+
width: 1182,
|
|
432
|
+
};
|
|
433
|
+
expect(flattenScales(id, image)).toStrictEqual({
|
|
434
|
+
'content-type': 'image/jpeg',
|
|
435
|
+
download: '@@images/image-1182-cf763ae23c52340d8a17a7afdb26c8cb.jpeg',
|
|
436
|
+
filename: 'halfdome2022.jpg',
|
|
437
|
+
height: 665,
|
|
438
|
+
scales: {
|
|
439
|
+
great: {
|
|
440
|
+
download:
|
|
441
|
+
'@@images/image-1200-539ab119ebadc7d011798980a4a5e8d4.jpeg',
|
|
442
|
+
height: 665,
|
|
443
|
+
width: 1182,
|
|
444
|
+
},
|
|
445
|
+
huge: {
|
|
446
|
+
download:
|
|
447
|
+
'@@images/image-1600-188968febc677890c1b99d5339f9bef1.jpeg',
|
|
448
|
+
height: 665,
|
|
449
|
+
width: 1182,
|
|
450
|
+
},
|
|
451
|
+
},
|
|
452
|
+
size: 319364,
|
|
453
|
+
width: 1182,
|
|
454
|
+
});
|
|
455
|
+
});
|
|
456
|
+
});
|
|
353
457
|
});
|