@contentful/field-editor-shared 1.5.1 → 1.5.2
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.
|
@@ -166,37 +166,18 @@ function getEntryStatus(sys, localeCodes) {
|
|
|
166
166
|
}
|
|
167
167
|
if (sys.deletedVersion) {
|
|
168
168
|
return 'deleted';
|
|
169
|
-
}
|
|
169
|
+
}
|
|
170
|
+
if (sys.archivedVersion) {
|
|
170
171
|
return 'archived';
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
const condition = (locale)=>{
|
|
174
|
-
if (Array.isArray(localeCodes)) {
|
|
175
|
-
return localeCodes.includes(locale);
|
|
176
|
-
}
|
|
177
|
-
return localeCodes ? localeCodes === locale : true;
|
|
178
|
-
};
|
|
179
|
-
Object.entries(sys.fieldStatus['*']).forEach(([localeCode, fieldStatus])=>{
|
|
180
|
-
if (condition(localeCode)) {
|
|
181
|
-
if (fieldStatus === 'changed') {
|
|
182
|
-
status = fieldStatus;
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
if (fieldStatus === 'published') {
|
|
186
|
-
status = fieldStatus;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
return status;
|
|
191
|
-
} else if (sys.publishedVersion) {
|
|
172
|
+
}
|
|
173
|
+
if (sys.publishedVersion) {
|
|
192
174
|
if (sys.version > sys.publishedVersion + 1) {
|
|
193
175
|
return 'changed';
|
|
194
176
|
} else {
|
|
195
177
|
return 'published';
|
|
196
178
|
}
|
|
197
|
-
} else {
|
|
198
|
-
return 'draft';
|
|
199
179
|
}
|
|
180
|
+
return 'draft';
|
|
200
181
|
}
|
|
201
182
|
const getEntryImage = async ({ entry, contentType, localeCode }, getAsset)=>{
|
|
202
183
|
if (!contentType) {
|
|
@@ -122,37 +122,18 @@ export function getEntryStatus(sys, localeCodes) {
|
|
|
122
122
|
}
|
|
123
123
|
if (sys.deletedVersion) {
|
|
124
124
|
return 'deleted';
|
|
125
|
-
}
|
|
125
|
+
}
|
|
126
|
+
if (sys.archivedVersion) {
|
|
126
127
|
return 'archived';
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
const condition = (locale)=>{
|
|
130
|
-
if (Array.isArray(localeCodes)) {
|
|
131
|
-
return localeCodes.includes(locale);
|
|
132
|
-
}
|
|
133
|
-
return localeCodes ? localeCodes === locale : true;
|
|
134
|
-
};
|
|
135
|
-
Object.entries(sys.fieldStatus['*']).forEach(([localeCode, fieldStatus])=>{
|
|
136
|
-
if (condition(localeCode)) {
|
|
137
|
-
if (fieldStatus === 'changed') {
|
|
138
|
-
status = fieldStatus;
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
if (fieldStatus === 'published') {
|
|
142
|
-
status = fieldStatus;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
return status;
|
|
147
|
-
} else if (sys.publishedVersion) {
|
|
128
|
+
}
|
|
129
|
+
if (sys.publishedVersion) {
|
|
148
130
|
if (sys.version > sys.publishedVersion + 1) {
|
|
149
131
|
return 'changed';
|
|
150
132
|
} else {
|
|
151
133
|
return 'published';
|
|
152
134
|
}
|
|
153
|
-
} else {
|
|
154
|
-
return 'draft';
|
|
155
135
|
}
|
|
136
|
+
return 'draft';
|
|
156
137
|
}
|
|
157
138
|
export const getEntryImage = async ({ entry, contentType, localeCode }, getAsset)=>{
|
|
158
139
|
if (!contentType) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-shared",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"registry": "https://npm.pkg.github.com/"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "4ec14a5b5611b2bfa17bfa10b4ac5942c2c25406"
|
|
55
55
|
}
|