@contentful/field-editor-shared 2.13.7 → 2.13.9
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/dist/cjs/ReleaseEntityStatusBadge/ReleaseEntityStatusPopover.js +13 -11
- package/dist/cjs/hooks/useReleaseStatus.js +3 -0
- package/dist/cjs/hooks/useReleaseStatus.spec.js +2 -0
- package/dist/esm/ReleaseEntityStatusBadge/ReleaseEntityStatusPopover.js +13 -11
- package/dist/esm/hooks/useReleaseStatus.js +3 -0
- package/dist/esm/hooks/useReleaseStatus.spec.js +2 -0
- package/package.json +3 -3
|
@@ -70,17 +70,19 @@ const getColor = ({ secondary, tertiary, isHover })=>{
|
|
|
70
70
|
};
|
|
71
71
|
const generateDynamicStyles = (status)=>{
|
|
72
72
|
const wrapperClass = (0, _emotion.css)({
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
73
|
+
...status?.secondary && {
|
|
74
|
+
'& svg[data-status="secondary"]': {
|
|
75
|
+
fill: getColor({
|
|
76
|
+
secondary: status?.secondary,
|
|
77
|
+
isHover: false
|
|
78
|
+
})
|
|
79
|
+
},
|
|
80
|
+
'&:hover svg[data-status="secondary"]': {
|
|
81
|
+
fill: getColor({
|
|
82
|
+
secondary: status?.secondary,
|
|
83
|
+
isHover: true
|
|
84
|
+
})
|
|
85
|
+
}
|
|
84
86
|
},
|
|
85
87
|
...status?.tertiary && {
|
|
86
88
|
'& svg[data-status="tertiary"]': {
|
|
@@ -86,6 +86,9 @@ function useReleaseStatus({ entity, release, locales, previousEntityOnTimeline }
|
|
|
86
86
|
]);
|
|
87
87
|
const releaseEntityStatus = (0, _react.useMemo)(()=>{
|
|
88
88
|
const releaseArray = Array.from(releaseStatusMap.values());
|
|
89
|
+
if (releaseArray.find(({ status })=>status === 'published')) {
|
|
90
|
+
return 'published';
|
|
91
|
+
}
|
|
89
92
|
if (releaseArray.find(({ status })=>status === 'willPublish')) {
|
|
90
93
|
return 'willPublish';
|
|
91
94
|
}
|
|
@@ -207,6 +207,7 @@ describe('useReleaseStatus', ()=>{
|
|
|
207
207
|
code: 'en-US'
|
|
208
208
|
}
|
|
209
209
|
});
|
|
210
|
+
expect(result.current.releaseEntityStatus).toBe('published');
|
|
210
211
|
});
|
|
211
212
|
});
|
|
212
213
|
describe(`${entityType} with locale based publishing`, ()=>{
|
|
@@ -306,6 +307,7 @@ describe('useReleaseStatus', ()=>{
|
|
|
306
307
|
code: 'en-US'
|
|
307
308
|
}
|
|
308
309
|
});
|
|
310
|
+
expect(result.current.releaseEntityStatus).toBe('published');
|
|
309
311
|
});
|
|
310
312
|
});
|
|
311
313
|
});
|
|
@@ -14,17 +14,19 @@ const getColor = ({ secondary, tertiary, isHover })=>{
|
|
|
14
14
|
};
|
|
15
15
|
const generateDynamicStyles = (status)=>{
|
|
16
16
|
const wrapperClass = css({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
...status?.secondary && {
|
|
18
|
+
'& svg[data-status="secondary"]': {
|
|
19
|
+
fill: getColor({
|
|
20
|
+
secondary: status?.secondary,
|
|
21
|
+
isHover: false
|
|
22
|
+
})
|
|
23
|
+
},
|
|
24
|
+
'&:hover svg[data-status="secondary"]': {
|
|
25
|
+
fill: getColor({
|
|
26
|
+
secondary: status?.secondary,
|
|
27
|
+
isHover: true
|
|
28
|
+
})
|
|
29
|
+
}
|
|
28
30
|
},
|
|
29
31
|
...status?.tertiary && {
|
|
30
32
|
'& svg[data-status="tertiary"]': {
|
|
@@ -76,6 +76,9 @@ export function useReleaseStatus({ entity, release, locales, previousEntityOnTim
|
|
|
76
76
|
]);
|
|
77
77
|
const releaseEntityStatus = useMemo(()=>{
|
|
78
78
|
const releaseArray = Array.from(releaseStatusMap.values());
|
|
79
|
+
if (releaseArray.find(({ status })=>status === 'published')) {
|
|
80
|
+
return 'published';
|
|
81
|
+
}
|
|
79
82
|
if (releaseArray.find(({ status })=>status === 'willPublish')) {
|
|
80
83
|
return 'willPublish';
|
|
81
84
|
}
|
|
@@ -203,6 +203,7 @@ describe('useReleaseStatus', ()=>{
|
|
|
203
203
|
code: 'en-US'
|
|
204
204
|
}
|
|
205
205
|
});
|
|
206
|
+
expect(result.current.releaseEntityStatus).toBe('published');
|
|
206
207
|
});
|
|
207
208
|
});
|
|
208
209
|
describe(`${entityType} with locale based publishing`, ()=>{
|
|
@@ -302,6 +303,7 @@ describe('useReleaseStatus', ()=>{
|
|
|
302
303
|
code: 'en-US'
|
|
303
304
|
}
|
|
304
305
|
});
|
|
306
|
+
expect(result.current.releaseEntityStatus).toBe('published');
|
|
305
307
|
});
|
|
306
308
|
});
|
|
307
309
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-shared",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.9",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@contentful/f36-components": "^5.4.1",
|
|
46
46
|
"@contentful/f36-note": "^5.1.0",
|
|
47
47
|
"@contentful/f36-tokens": "^5.1.0",
|
|
48
|
-
"contentful-management": "^11.
|
|
48
|
+
"contentful-management": "^11.60.4",
|
|
49
49
|
"emotion": "^10.0.17",
|
|
50
50
|
"fast-deep-equal": "^3.1.3",
|
|
51
51
|
"lodash": "^4.17.15"
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"registry": "https://npm.pkg.github.com/"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "079953700877edc82c587553a9ffe6460874ac48"
|
|
62
62
|
}
|