@contentful/field-editor-validation-errors 3.2.3-canary.28 → 3.2.3-canary.31
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.
|
@@ -132,18 +132,18 @@ function UniquenessError({ error, cma, localeCode, defaultLocaleCode, getEntryUR
|
|
|
132
132
|
defaultLocaleCode,
|
|
133
133
|
getEntryURL
|
|
134
134
|
]);
|
|
135
|
-
return
|
|
135
|
+
return _react.createElement(_f36components.List, {
|
|
136
136
|
className: _styles.errorList,
|
|
137
137
|
testId: "validation-errors-uniqueness"
|
|
138
|
-
},
|
|
138
|
+
}, _react.createElement(_f36components.ListItem, {
|
|
139
139
|
className: _styles.entryLink
|
|
140
|
-
}, state.loading ?
|
|
140
|
+
}, state.loading ? _react.createElement("div", null, _core.i18n._({
|
|
141
141
|
id: "FieldEditors.ValidationErrors.UniquenessError.LoadingMessage",
|
|
142
142
|
message: "Loading title for conflicting entry…"
|
|
143
|
-
})) : displayEntries.map((entry)
|
|
143
|
+
})) : displayEntries.map((entry)=>_react.createElement(_f36components.TextLink, {
|
|
144
144
|
key: entry.id,
|
|
145
145
|
href: entry.href,
|
|
146
|
-
icon:
|
|
146
|
+
icon: _react.createElement(_f36icons.ArrowSquareOutIcon, null),
|
|
147
147
|
alignIcon: "end",
|
|
148
148
|
variant: "negative",
|
|
149
149
|
target: "_blank",
|
|
@@ -163,21 +163,21 @@ function ValidationErrorsInternal({ field, cma, locales, errorMessageOverride, g
|
|
|
163
163
|
if (errors.length === 0) {
|
|
164
164
|
return null;
|
|
165
165
|
}
|
|
166
|
-
return
|
|
166
|
+
return _react.createElement(_f36components.List, {
|
|
167
167
|
className: _styles.errorList,
|
|
168
168
|
testId: "validation-errors"
|
|
169
169
|
}, errors.map((error, index)=>{
|
|
170
|
-
return
|
|
170
|
+
return _react.createElement("li", {
|
|
171
171
|
key: index,
|
|
172
172
|
role: "status",
|
|
173
173
|
"aria-roledescription": "field-locale-schema",
|
|
174
174
|
"data-error-code": `entry.schema.${error.name}`,
|
|
175
175
|
className: _styles.errorItem
|
|
176
|
-
},
|
|
176
|
+
}, _react.createElement(_f36icons.InfoIcon, {
|
|
177
177
|
color: _f36tokens.default.colorNegative
|
|
178
|
-
}),
|
|
178
|
+
}), _react.createElement("div", {
|
|
179
179
|
className: _styles.errorMessage
|
|
180
|
-
}, errorMessageOverride?.(error.message) ?? error.message, error.name === 'unique' &&
|
|
180
|
+
}, errorMessageOverride?.(error.message) ?? error.message, error.name === 'unique' && _react.createElement(UniquenessError, {
|
|
181
181
|
cma: cma,
|
|
182
182
|
error: error,
|
|
183
183
|
localeCode: field.locale,
|
|
@@ -187,5 +187,5 @@ function ValidationErrorsInternal({ field, cma, locales, errorMessageOverride, g
|
|
|
187
187
|
}));
|
|
188
188
|
}
|
|
189
189
|
function ValidationErrors(props) {
|
|
190
|
-
return
|
|
190
|
+
return _react.createElement(_reactquery.SharedQueryClientProvider, null, _react.createElement(ValidationErrorsInternal, props));
|
|
191
191
|
}
|
|
@@ -99,7 +99,7 @@ const cma = {
|
|
|
99
99
|
(0, _vitest.afterEach)(_react1.cleanup);
|
|
100
100
|
(0, _vitest.it)('renders without crashing', ()=>{
|
|
101
101
|
const [field] = _fieldeditortestutils.createFakeFieldAPI();
|
|
102
|
-
const { container } = (0, _react1.render)(
|
|
102
|
+
const { container } = (0, _react1.render)(_react.createElement(_ValidationErrors.ValidationErrors, {
|
|
103
103
|
field: field,
|
|
104
104
|
cma: cma,
|
|
105
105
|
locales: _fieldeditortestutils.createFakeLocalesAPI(),
|
|
@@ -116,7 +116,7 @@ const cma = {
|
|
|
116
116
|
}
|
|
117
117
|
];
|
|
118
118
|
const [field, emitter] = _fieldeditortestutils.createFakeFieldAPI();
|
|
119
|
-
const { findByText } = (0, _react1.render)(
|
|
119
|
+
const { findByText } = (0, _react1.render)(_react.createElement(_ValidationErrors.ValidationErrors, {
|
|
120
120
|
field: field,
|
|
121
121
|
cma: cma,
|
|
122
122
|
locales: _fieldeditortestutils.createFakeLocalesAPI(),
|
|
@@ -157,7 +157,7 @@ const cma = {
|
|
|
157
157
|
cma.entry.getMany.mockResolvedValue({
|
|
158
158
|
items: ids.map(createEntry)
|
|
159
159
|
});
|
|
160
|
-
const { findByText, findAllByTestId } = (0, _react1.render)(
|
|
160
|
+
const { findByText, findAllByTestId } = (0, _react1.render)(_react.createElement(_ValidationErrors.ValidationErrors, {
|
|
161
161
|
field: field,
|
|
162
162
|
cma: cma,
|
|
163
163
|
locales: _fieldeditortestutils.createFakeLocalesAPI(),
|
package/dist/cjs/styles.js
CHANGED
|
@@ -5,20 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
entryLink
|
|
12
|
+
get entryLink () {
|
|
13
13
|
return entryLink;
|
|
14
14
|
},
|
|
15
|
-
errorItem
|
|
15
|
+
get errorItem () {
|
|
16
16
|
return errorItem;
|
|
17
17
|
},
|
|
18
|
-
errorList
|
|
18
|
+
get errorList () {
|
|
19
19
|
return errorList;
|
|
20
20
|
},
|
|
21
|
-
errorMessage
|
|
21
|
+
get errorMessage () {
|
|
22
22
|
return errorMessage;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
@@ -76,18 +76,18 @@ function UniquenessError({ error, cma, localeCode, defaultLocaleCode, getEntryUR
|
|
|
76
76
|
defaultLocaleCode,
|
|
77
77
|
getEntryURL
|
|
78
78
|
]);
|
|
79
|
-
return
|
|
79
|
+
return React.createElement(List, {
|
|
80
80
|
className: styles.errorList,
|
|
81
81
|
testId: "validation-errors-uniqueness"
|
|
82
|
-
},
|
|
82
|
+
}, React.createElement(ListItem, {
|
|
83
83
|
className: styles.entryLink
|
|
84
|
-
}, state.loading ?
|
|
84
|
+
}, state.loading ? React.createElement("div", null, $_i18n._({
|
|
85
85
|
id: "FieldEditors.ValidationErrors.UniquenessError.LoadingMessage",
|
|
86
86
|
message: "Loading title for conflicting entry…"
|
|
87
|
-
})) : displayEntries.map((entry)
|
|
87
|
+
})) : displayEntries.map((entry)=>React.createElement(TextLink, {
|
|
88
88
|
key: entry.id,
|
|
89
89
|
href: entry.href,
|
|
90
|
-
icon:
|
|
90
|
+
icon: React.createElement(ArrowSquareOutIcon, null),
|
|
91
91
|
alignIcon: "end",
|
|
92
92
|
variant: "negative",
|
|
93
93
|
target: "_blank",
|
|
@@ -107,21 +107,21 @@ function ValidationErrorsInternal({ field, cma, locales, errorMessageOverride, g
|
|
|
107
107
|
if (errors.length === 0) {
|
|
108
108
|
return null;
|
|
109
109
|
}
|
|
110
|
-
return
|
|
110
|
+
return React.createElement(List, {
|
|
111
111
|
className: styles.errorList,
|
|
112
112
|
testId: "validation-errors"
|
|
113
113
|
}, errors.map((error, index)=>{
|
|
114
|
-
return
|
|
114
|
+
return React.createElement("li", {
|
|
115
115
|
key: index,
|
|
116
116
|
role: "status",
|
|
117
117
|
"aria-roledescription": "field-locale-schema",
|
|
118
118
|
"data-error-code": `entry.schema.${error.name}`,
|
|
119
119
|
className: styles.errorItem
|
|
120
|
-
},
|
|
120
|
+
}, React.createElement(InfoIcon, {
|
|
121
121
|
color: tokens.colorNegative
|
|
122
|
-
}),
|
|
122
|
+
}), React.createElement("div", {
|
|
123
123
|
className: styles.errorMessage
|
|
124
|
-
}, errorMessageOverride?.(error.message) ?? error.message, error.name === 'unique' &&
|
|
124
|
+
}, errorMessageOverride?.(error.message) ?? error.message, error.name === 'unique' && React.createElement(UniquenessError, {
|
|
125
125
|
cma: cma,
|
|
126
126
|
error: error,
|
|
127
127
|
localeCode: field.locale,
|
|
@@ -131,5 +131,5 @@ function ValidationErrorsInternal({ field, cma, locales, errorMessageOverride, g
|
|
|
131
131
|
}));
|
|
132
132
|
}
|
|
133
133
|
export function ValidationErrors(props) {
|
|
134
|
-
return
|
|
134
|
+
return React.createElement(SharedQueryClientProvider, null, React.createElement(ValidationErrorsInternal, props));
|
|
135
135
|
}
|
|
@@ -54,7 +54,7 @@ describe('ValidationErrors', ()=>{
|
|
|
54
54
|
afterEach(cleanup);
|
|
55
55
|
it('renders without crashing', ()=>{
|
|
56
56
|
const [field] = utils.createFakeFieldAPI();
|
|
57
|
-
const { container } = render(
|
|
57
|
+
const { container } = render(React.createElement(ValidationErrors, {
|
|
58
58
|
field: field,
|
|
59
59
|
cma: cma,
|
|
60
60
|
locales: utils.createFakeLocalesAPI(),
|
|
@@ -71,7 +71,7 @@ describe('ValidationErrors', ()=>{
|
|
|
71
71
|
}
|
|
72
72
|
];
|
|
73
73
|
const [field, emitter] = utils.createFakeFieldAPI();
|
|
74
|
-
const { findByText } = render(
|
|
74
|
+
const { findByText } = render(React.createElement(ValidationErrors, {
|
|
75
75
|
field: field,
|
|
76
76
|
cma: cma,
|
|
77
77
|
locales: utils.createFakeLocalesAPI(),
|
|
@@ -112,7 +112,7 @@ describe('ValidationErrors', ()=>{
|
|
|
112
112
|
cma.entry.getMany.mockResolvedValue({
|
|
113
113
|
items: ids.map(createEntry)
|
|
114
114
|
});
|
|
115
|
-
const { findByText, findAllByTestId } = render(
|
|
115
|
+
const { findByText, findAllByTestId } = render(React.createElement(ValidationErrors, {
|
|
116
116
|
field: field,
|
|
117
117
|
cma: cma,
|
|
118
118
|
locales: utils.createFakeLocalesAPI(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-validation-errors",
|
|
3
|
-
"version": "3.2.3-canary.
|
|
3
|
+
"version": "3.2.3-canary.31+1fb5b692",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
"@contentful/f36-components": "^6.7.1",
|
|
42
42
|
"@contentful/f36-icons": "^6.7.1",
|
|
43
43
|
"@contentful/f36-tokens": "^6.1.2",
|
|
44
|
-
"@contentful/field-editor-shared": "^4.6.3-canary.
|
|
44
|
+
"@contentful/field-editor-shared": "^4.6.3-canary.31+1fb5b692",
|
|
45
45
|
"@emotion/css": "^11.13.5"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@contentful/field-editor-test-utils": "^3.2.1",
|
|
49
|
-
"@lingui/core": "5.
|
|
49
|
+
"@lingui/core": "5.9.5"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@lingui/core": "^5.3.0",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"prettier --write"
|
|
64
64
|
]
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "1fb5b69244b523826081471d8fe4e721b2e6c5ed"
|
|
67
67
|
}
|