@blaze-cms/react-page-builder 0.128.0-admin-updates.3 → 0.128.0-admin-updates.7
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 +24 -0
- package/lib/components/Card/Card.js +1 -1
- package/lib/components/Card/Card.js.map +1 -1
- package/lib/components/Card/CardsContainer.js +53 -24
- package/lib/components/Card/CardsContainer.js.map +1 -1
- package/lib/components/Card/CardsRender.js +2 -2
- package/lib/components/Card/CardsRender.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/ItemDetailsSummary/ItemDetailsSummaryContent.js +3 -1
- package/lib/components/DataSummary/DataSummaryTypes/ItemDetailsSummary/ItemDetailsSummaryContent.js.map +1 -1
- package/lib/components/Image/Image.js +1 -1
- package/lib/components/Image/Image.js.map +1 -1
- package/lib/components/List/components/Full/FullRender.js.map +1 -1
- package/lib/components/List/components/helpers/check-if-should-render-banner.js +27 -5
- package/lib/components/List/components/helpers/check-if-should-render-banner.js.map +1 -1
- package/lib/components/List/components/helpers/index.js +8 -2
- package/lib/components/List/components/helpers/index.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
- package/lib/components/SearchFilter/components/Checkbox.js +6 -1
- package/lib/components/SearchFilter/components/Checkbox.js.map +1 -1
- package/lib/components/SearchFilter/components/Range.js +9 -5
- package/lib/components/SearchFilter/components/Range.js.map +1 -1
- package/lib/components/SearchFilter/components/Select.js +9 -5
- package/lib/components/SearchFilter/components/Select.js.map +1 -1
- package/lib/components/SearchFilter/components/TextSearch.js +9 -5
- package/lib/components/SearchFilter/components/TextSearch.js.map +1 -1
- package/lib-es/components/Card/Card.js +1 -1
- package/lib-es/components/Card/Card.js.map +1 -1
- package/lib-es/components/Card/CardsContainer.js +59 -35
- package/lib-es/components/Card/CardsContainer.js.map +1 -1
- package/lib-es/components/Card/CardsRender.js +1 -1
- package/lib-es/components/Card/CardsRender.js.map +1 -1
- package/lib-es/components/DataSummary/DataSummaryTypes/ItemDetailsSummary/ItemDetailsSummaryContent.js +3 -1
- package/lib-es/components/DataSummary/DataSummaryTypes/ItemDetailsSummary/ItemDetailsSummaryContent.js.map +1 -1
- package/lib-es/components/Image/Image.js +1 -1
- package/lib-es/components/Image/Image.js.map +1 -1
- package/lib-es/components/List/components/Full/FullRender.js.map +1 -1
- package/lib-es/components/List/components/helpers/check-if-should-render-banner.js +29 -3
- package/lib-es/components/List/components/helpers/check-if-should-render-banner.js.map +1 -1
- package/lib-es/components/List/components/helpers/index.js +3 -2
- package/lib-es/components/List/components/helpers/index.js.map +1 -1
- package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
- package/lib-es/components/SearchFilter/components/Checkbox.js +6 -1
- package/lib-es/components/SearchFilter/components/Checkbox.js.map +1 -1
- package/lib-es/components/SearchFilter/components/Range.js +9 -5
- package/lib-es/components/SearchFilter/components/Range.js.map +1 -1
- package/lib-es/components/SearchFilter/components/Select.js +9 -5
- package/lib-es/components/SearchFilter/components/Select.js.map +1 -1
- package/lib-es/components/SearchFilter/components/TextSearch.js +9 -5
- package/lib-es/components/SearchFilter/components/TextSearch.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Card/Card.js +2 -2
- package/src/components/Card/CardsContainer.js +54 -35
- package/src/components/Card/CardsRender.js +9 -7
- package/src/components/DataSummary/DataSummaryTypes/ItemDetailsSummary/ItemDetailsSummaryContent.js +1 -1
- package/src/components/Image/Image.js +1 -1
- package/src/components/List/components/Full/FullRender.js +0 -1
- package/src/components/List/components/helpers/check-if-should-render-banner.js +24 -3
- package/src/components/List/components/helpers/index.js +4 -2
- package/src/components/SearchFilter/SearchFilter/SearchFilter.js +0 -1
- package/src/components/SearchFilter/components/Checkbox.js +4 -0
- package/src/components/SearchFilter/components/Range.js +7 -4
- package/src/components/SearchFilter/components/Select.js +23 -17
- package/src/components/SearchFilter/components/TextSearch.js +30 -26
- package/tests/unit/src/components/Card/__snapshots__/Card.test.js.snap +10 -10
- package/tests/unit/src/components/Card/__snapshots__/CardContainer.test.js.snap +8 -8
- package/tests/unit/src/components/DataSummary/DataSummaryTypes/__snapshots__/ItemDetailsSummary.test.js.snap +24 -4
- package/tests/unit/src/components/List/components/Cards/__snapshots__/CardsRender.test.js.snap +12 -12
- package/tests/unit/src/components/List/components/helpers/check-if-should-render-banner.test.js +59 -28
|
@@ -13,12 +13,22 @@ exports[`ItemDetailsSummary component should render without throwing an error an
|
|
|
13
13
|
<span
|
|
14
14
|
class=""
|
|
15
15
|
>
|
|
16
|
-
|
|
16
|
+
<span
|
|
17
|
+
class="item-details-summary-label"
|
|
18
|
+
>
|
|
19
|
+
first
|
|
20
|
+
</span>
|
|
21
|
+
something
|
|
17
22
|
</span>
|
|
18
23
|
<span
|
|
19
24
|
class=""
|
|
20
25
|
>
|
|
21
|
-
|
|
26
|
+
<span
|
|
27
|
+
class="item-details-summary-label"
|
|
28
|
+
>
|
|
29
|
+
second
|
|
30
|
+
</span>
|
|
31
|
+
other thing
|
|
22
32
|
</span>
|
|
23
33
|
</div>
|
|
24
34
|
</DocumentFragment>
|
|
@@ -37,12 +47,22 @@ exports[`ItemDetailsSummary component should render without throwing an error if
|
|
|
37
47
|
<span
|
|
38
48
|
class=""
|
|
39
49
|
>
|
|
40
|
-
|
|
50
|
+
<span
|
|
51
|
+
class="item-details-summary-label"
|
|
52
|
+
>
|
|
53
|
+
first
|
|
54
|
+
</span>
|
|
55
|
+
something
|
|
41
56
|
</span>
|
|
42
57
|
<span
|
|
43
58
|
class=""
|
|
44
59
|
>
|
|
45
|
-
|
|
60
|
+
<span
|
|
61
|
+
class="item-details-summary-label"
|
|
62
|
+
>
|
|
63
|
+
second
|
|
64
|
+
</span>
|
|
65
|
+
other thing
|
|
46
66
|
</span>
|
|
47
67
|
</div>
|
|
48
68
|
</DocumentFragment>
|
package/tests/unit/src/components/List/components/Cards/__snapshots__/CardsRender.test.js.snap
CHANGED
|
@@ -25,11 +25,11 @@ exports[`CardsRender component should render based on listData received 1`] = `
|
|
|
25
25
|
<div
|
|
26
26
|
class="card__content card__content--portrait"
|
|
27
27
|
>
|
|
28
|
-
<
|
|
28
|
+
<div
|
|
29
29
|
class="card__title card__title--portrait "
|
|
30
30
|
>
|
|
31
31
|
item 1
|
|
32
|
-
</
|
|
32
|
+
</div>
|
|
33
33
|
</div>
|
|
34
34
|
</div>
|
|
35
35
|
</div>
|
|
@@ -46,11 +46,11 @@ exports[`CardsRender component should render based on listData received 1`] = `
|
|
|
46
46
|
<div
|
|
47
47
|
class="card__content card__content--portrait"
|
|
48
48
|
>
|
|
49
|
-
<
|
|
49
|
+
<div
|
|
50
50
|
class="card__title card__title--portrait "
|
|
51
51
|
>
|
|
52
52
|
item 1
|
|
53
|
-
</
|
|
53
|
+
</div>
|
|
54
54
|
</div>
|
|
55
55
|
</div>
|
|
56
56
|
</div>
|
|
@@ -67,11 +67,11 @@ exports[`CardsRender component should render based on listData received 1`] = `
|
|
|
67
67
|
<div
|
|
68
68
|
class="card__content card__content--portrait"
|
|
69
69
|
>
|
|
70
|
-
<
|
|
70
|
+
<div
|
|
71
71
|
class="card__title card__title--portrait "
|
|
72
72
|
>
|
|
73
73
|
item 1
|
|
74
|
-
</
|
|
74
|
+
</div>
|
|
75
75
|
</div>
|
|
76
76
|
</div>
|
|
77
77
|
</div>
|
|
@@ -100,11 +100,11 @@ exports[`CardsRender component should render without wrapper, when requested 1`]
|
|
|
100
100
|
<div
|
|
101
101
|
class="card__content card__content--portrait"
|
|
102
102
|
>
|
|
103
|
-
<
|
|
103
|
+
<div
|
|
104
104
|
class="card__title card__title--portrait "
|
|
105
105
|
>
|
|
106
106
|
item 1
|
|
107
|
-
</
|
|
107
|
+
</div>
|
|
108
108
|
</div>
|
|
109
109
|
</div>
|
|
110
110
|
</div>
|
|
@@ -121,11 +121,11 @@ exports[`CardsRender component should render without wrapper, when requested 1`]
|
|
|
121
121
|
<div
|
|
122
122
|
class="card__content card__content--portrait"
|
|
123
123
|
>
|
|
124
|
-
<
|
|
124
|
+
<div
|
|
125
125
|
class="card__title card__title--portrait "
|
|
126
126
|
>
|
|
127
127
|
item 1
|
|
128
|
-
</
|
|
128
|
+
</div>
|
|
129
129
|
</div>
|
|
130
130
|
</div>
|
|
131
131
|
</div>
|
|
@@ -142,11 +142,11 @@ exports[`CardsRender component should render without wrapper, when requested 1`]
|
|
|
142
142
|
<div
|
|
143
143
|
class="card__content card__content--portrait"
|
|
144
144
|
>
|
|
145
|
-
<
|
|
145
|
+
<div
|
|
146
146
|
class="card__title card__title--portrait "
|
|
147
147
|
>
|
|
148
148
|
item 1
|
|
149
|
-
</
|
|
149
|
+
</div>
|
|
150
150
|
</div>
|
|
151
151
|
</div>
|
|
152
152
|
</div>
|
package/tests/unit/src/components/List/components/helpers/check-if-should-render-banner.test.js
CHANGED
|
@@ -1,44 +1,75 @@
|
|
|
1
|
-
import checkIfShouldRenderBanner from '../../../../../../../src/components/List/components/helpers/check-if-should-render-banner';
|
|
1
|
+
import { checkIfShouldRenderBanner } from '../../../../../../../src/components/List/components/helpers/check-if-should-render-banner';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
});
|
|
9
|
-
const noInterval = checkIfShouldRenderBanner(1, {
|
|
10
|
-
interval: 2,
|
|
11
|
-
repeat: false,
|
|
12
|
-
hasBanner: false
|
|
13
|
-
});
|
|
14
|
-
const positionMatch = checkIfShouldRenderBanner(1, {
|
|
15
|
-
interval: 2,
|
|
16
|
-
repeat: false,
|
|
17
|
-
hasBanner: true
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
const repeatOffMatch = checkIfShouldRenderBanner(3, {
|
|
21
|
-
interval: 2,
|
|
22
|
-
repeat: false,
|
|
23
|
-
hasBanner: true
|
|
24
|
-
});
|
|
25
|
-
const repeatOnMatch = checkIfShouldRenderBanner(3, {
|
|
26
|
-
interval: 2,
|
|
27
|
-
repeat: true,
|
|
28
|
-
hasBanner: true
|
|
29
|
-
});
|
|
3
|
+
const BANNER_MOCK = {
|
|
4
|
+
repeatEvery: 3,
|
|
5
|
+
startingPoint: 5,
|
|
6
|
+
maxRepetitions: 2
|
|
7
|
+
};
|
|
30
8
|
|
|
9
|
+
describe('checkIfShouldRenderBanner helper function', () => {
|
|
31
10
|
it('should return false if no interval or hasBanner is false', () => {
|
|
11
|
+
const noBanner = checkIfShouldRenderBanner(1, {
|
|
12
|
+
interval: 2,
|
|
13
|
+
repeat: false,
|
|
14
|
+
hasBanner: false
|
|
15
|
+
});
|
|
16
|
+
const noInterval = checkIfShouldRenderBanner(1, {
|
|
17
|
+
interval: 2,
|
|
18
|
+
repeat: false,
|
|
19
|
+
hasBanner: false
|
|
20
|
+
});
|
|
32
21
|
expect(noBanner).toBe(false);
|
|
33
22
|
expect(noInterval).toBe(false);
|
|
34
23
|
});
|
|
35
24
|
it('should return true if interval matches position', () => {
|
|
25
|
+
const positionMatch = checkIfShouldRenderBanner(1, {
|
|
26
|
+
interval: 2,
|
|
27
|
+
repeat: false,
|
|
28
|
+
hasBanner: true
|
|
29
|
+
});
|
|
36
30
|
expect(positionMatch).toBe(true);
|
|
37
31
|
});
|
|
38
32
|
it('should return false if repeat is false and position repeat mtaches', () => {
|
|
33
|
+
const repeatOffMatch = checkIfShouldRenderBanner(3, {
|
|
34
|
+
interval: 2,
|
|
35
|
+
repeat: false,
|
|
36
|
+
hasBanner: true
|
|
37
|
+
});
|
|
39
38
|
expect(repeatOffMatch).toBe(false);
|
|
40
39
|
});
|
|
41
40
|
it('should return true if repeat is true and position repeat mtaches', () => {
|
|
41
|
+
const repeatOnMatch = checkIfShouldRenderBanner(3, {
|
|
42
|
+
interval: 2,
|
|
43
|
+
repeat: true,
|
|
44
|
+
hasBanner: true
|
|
45
|
+
});
|
|
42
46
|
expect(repeatOnMatch).toBe(true);
|
|
43
47
|
});
|
|
48
|
+
|
|
49
|
+
it('should return false if no banner is present', () => {
|
|
50
|
+
const noBanner = checkIfShouldRenderBanner(1);
|
|
51
|
+
expect(noBanner).toBe(false);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('should return false if index is lower than startingPoint', () => {
|
|
55
|
+
const lowIndex = checkIfShouldRenderBanner(3, BANNER_MOCK);
|
|
56
|
+
expect(lowIndex).toBe(false);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('should return true if index matches startingPoint', () => {
|
|
60
|
+
const startingPointMatch = checkIfShouldRenderBanner(4, BANNER_MOCK);
|
|
61
|
+
expect(startingPointMatch).toBe(true);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('should return true if repeat point matches and max repetitions hasnt been reached', () => {
|
|
65
|
+
const repetitionMatch = checkIfShouldRenderBanner(7, BANNER_MOCK);
|
|
66
|
+
const finalRepetitionMatch = checkIfShouldRenderBanner(10, BANNER_MOCK);
|
|
67
|
+
expect(repetitionMatch).toBe(true);
|
|
68
|
+
expect(finalRepetitionMatch).toBe(false);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('should return false if repeat point matches and max repetitions has been reached', () => {
|
|
72
|
+
const maxRepetitionReached = checkIfShouldRenderBanner(13, BANNER_MOCK);
|
|
73
|
+
expect(maxRepetitionReached).toBe(false);
|
|
74
|
+
});
|
|
44
75
|
});
|