@contentful/field-editor-slug 2.1.5-canary.5 → 2.2.0
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.
|
@@ -299,8 +299,7 @@ describe('SlugEditor', ()=>{
|
|
|
299
299
|
}));
|
|
300
300
|
await (0, _react1.waitFor)(()=>{
|
|
301
301
|
expect(sdk.cma.entry.getMany).toHaveBeenCalledTimes(1);
|
|
302
|
-
expect(queryByText('
|
|
303
|
-
expect(queryByText('This slug has already been published in another entry')).not.toBeInTheDocument();
|
|
302
|
+
expect(queryByText('This slug has already been published in another entry.')).toBeInTheDocument();
|
|
304
303
|
expect(getByTestId('cf-ui-text-input')).not.toHaveAttribute('aria-invalid');
|
|
305
304
|
});
|
|
306
305
|
});
|
|
@@ -19,6 +19,7 @@ _export(exports, {
|
|
|
19
19
|
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
20
20
|
const _f36components = require("@contentful/f36-components");
|
|
21
21
|
const _f36icons = require("@contentful/f36-icons");
|
|
22
|
+
const _f36note = require("@contentful/f36-note");
|
|
22
23
|
const _core = require("@lingui/core");
|
|
23
24
|
const _usedebounce = require("use-debounce");
|
|
24
25
|
const _makeSlug = require("./services/makeSlug");
|
|
@@ -145,12 +146,13 @@ function SlugEditorFieldStatic(props) {
|
|
|
145
146
|
}, _core.i18n._({
|
|
146
147
|
id: "FieldEditors.Slug.SlugEditorField.DuplicateSlugError",
|
|
147
148
|
message: "This slug has already been published in another entry"
|
|
148
|
-
})), hasDuplicate && !isUniqueValidationEnabled && /*#__PURE__*/ _react.createElement(
|
|
149
|
+
})), hasDuplicate && !isUniqueValidationEnabled && /*#__PURE__*/ _react.createElement(_f36note.Note, {
|
|
150
|
+
variant: "warning",
|
|
149
151
|
testId: "slug-editor-duplicate-warning",
|
|
150
152
|
className: _styles.uniqueValidationError
|
|
151
153
|
}, _core.i18n._({
|
|
152
154
|
id: "FieldEditors.Slug.SlugEditorField.DuplicateSlugWarning",
|
|
153
|
-
message:
|
|
155
|
+
message: "This slug has already been published in another entry."
|
|
154
156
|
})));
|
|
155
157
|
}
|
|
156
158
|
function SlugEditorField(props) {
|
|
@@ -254,8 +254,7 @@ describe('SlugEditor', ()=>{
|
|
|
254
254
|
}));
|
|
255
255
|
await waitFor(()=>{
|
|
256
256
|
expect(sdk.cma.entry.getMany).toHaveBeenCalledTimes(1);
|
|
257
|
-
expect(queryByText('
|
|
258
|
-
expect(queryByText('This slug has already been published in another entry')).not.toBeInTheDocument();
|
|
257
|
+
expect(queryByText('This slug has already been published in another entry.')).toBeInTheDocument();
|
|
259
258
|
expect(getByTestId('cf-ui-text-input')).not.toHaveAttribute('aria-invalid');
|
|
260
259
|
});
|
|
261
260
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Spinner, TextInput, ValidationMessage } from '@contentful/f36-components';
|
|
3
3
|
import { LinkSimpleIcon } from '@contentful/f36-icons';
|
|
4
|
+
import { Note } from '@contentful/f36-note';
|
|
4
5
|
import { i18n as $_i18n } from "@lingui/core";
|
|
5
6
|
import { useDebounce } from 'use-debounce';
|
|
6
7
|
import { makeSlug } from './services/makeSlug';
|
|
@@ -86,12 +87,13 @@ export function SlugEditorFieldStatic(props) {
|
|
|
86
87
|
}, $_i18n._({
|
|
87
88
|
id: "FieldEditors.Slug.SlugEditorField.DuplicateSlugError",
|
|
88
89
|
message: "This slug has already been published in another entry"
|
|
89
|
-
})), hasDuplicate && !isUniqueValidationEnabled && /*#__PURE__*/ React.createElement(
|
|
90
|
+
})), hasDuplicate && !isUniqueValidationEnabled && /*#__PURE__*/ React.createElement(Note, {
|
|
91
|
+
variant: "warning",
|
|
90
92
|
testId: "slug-editor-duplicate-warning",
|
|
91
93
|
className: styles.uniqueValidationError
|
|
92
94
|
}, $_i18n._({
|
|
93
95
|
id: "FieldEditors.Slug.SlugEditorField.DuplicateSlugWarning",
|
|
94
|
-
message:
|
|
96
|
+
message: "This slug has already been published in another entry."
|
|
95
97
|
})));
|
|
96
98
|
}
|
|
97
99
|
export function SlugEditorField(props) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-slug",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@contentful/f36-components": "^5.4.1",
|
|
40
40
|
"@contentful/f36-icons": "^5.4.1",
|
|
41
|
+
"@contentful/f36-note": "^5.4.1",
|
|
41
42
|
"@contentful/f36-tokens": "^5.1.0",
|
|
42
43
|
"@contentful/field-editor-shared": "^2.18.1",
|
|
43
44
|
"@types/speakingurl": "^13.0.2",
|
|
@@ -58,5 +59,5 @@
|
|
|
58
59
|
"publishConfig": {
|
|
59
60
|
"registry": "https://npm.pkg.github.com/"
|
|
60
61
|
},
|
|
61
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "7fc723378f59798b57cdf21c9e1503edca857311"
|
|
62
63
|
}
|