@commercetools-frontend/react-notifications 22.36.0 → 22.38.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.
- package/dist/commercetools-frontend-react-notifications.cjs.dev.js +93 -115
- package/dist/commercetools-frontend-react-notifications.cjs.prod.js +92 -114
- package/dist/commercetools-frontend-react-notifications.esm.js +93 -115
- package/dist/declarations/src/components/notification/notification.d.ts +2 -3
- package/dist/declarations/src/components/notifier/notifier.d.ts +1 -2
- package/package.json +7 -7
|
@@ -14,6 +14,7 @@ var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-
|
|
|
14
14
|
var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
|
|
15
15
|
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
|
|
16
16
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
17
|
+
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
17
18
|
var reactIntl = require('react-intl');
|
|
18
19
|
var constants = require('@commercetools-frontend/constants');
|
|
19
20
|
var hooks = require('@commercetools-uikit/hooks');
|
|
@@ -24,7 +25,6 @@ var _startsWithInstanceProperty = require('@babel/runtime-corejs3/core-js-stable
|
|
|
24
25
|
var omitBy = require('lodash/omitBy');
|
|
25
26
|
var react$1 = require('@emotion/react');
|
|
26
27
|
var designSystem = require('@commercetools-uikit/design-system');
|
|
27
|
-
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
28
28
|
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
29
29
|
var _valuesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/values');
|
|
30
30
|
var reactRedux = require('react-redux');
|
|
@@ -61,7 +61,7 @@ var _sliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_sliceInstanc
|
|
|
61
61
|
var isNumber__default = /*#__PURE__*/_interopDefault(isNumber);
|
|
62
62
|
|
|
63
63
|
// NOTE: This string will be replaced on build time with the package version.
|
|
64
|
-
var version = "22.
|
|
64
|
+
var version = "22.38.0";
|
|
65
65
|
|
|
66
66
|
const Context = /*#__PURE__*/react.createContext(() => null);
|
|
67
67
|
function NotificationProviderForCustomComponent(props) {
|
|
@@ -83,9 +83,8 @@ function filterDataAttributes(obj) {
|
|
|
83
83
|
|
|
84
84
|
var messages = reactIntl.defineMessages({
|
|
85
85
|
hideNotification: {
|
|
86
|
-
id:
|
|
87
|
-
|
|
88
|
-
defaultMessage: 'Hide notification'
|
|
86
|
+
id: "Notification.hideNotification",
|
|
87
|
+
defaultMessage: "Hide notification"
|
|
89
88
|
}
|
|
90
89
|
});
|
|
91
90
|
|
|
@@ -161,6 +160,7 @@ const getStylesForNotification = props => {
|
|
|
161
160
|
}
|
|
162
161
|
};
|
|
163
162
|
|
|
163
|
+
const _excluded$2 = ["fixed"];
|
|
164
164
|
function ownKeys$4(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
165
165
|
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$4(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$4(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
166
166
|
const sequentialId = utils.createSequentialId('notification-');
|
|
@@ -189,23 +189,29 @@ NotificationIcon.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
189
189
|
color: _pt__default["default"].oneOf(['error', 'warning', 'info', 'solid', 'neutral60', 'surface', 'primary', 'primary40']).isRequired
|
|
190
190
|
} : {};
|
|
191
191
|
NotificationIcon.displayName = 'NotificationIcon';
|
|
192
|
-
const
|
|
193
|
-
fixed
|
|
194
|
-
|
|
195
|
-
|
|
192
|
+
const Notification = _ref => {
|
|
193
|
+
let _ref$fixed = _ref.fixed,
|
|
194
|
+
fixed = _ref$fixed === void 0 ? false : _ref$fixed,
|
|
195
|
+
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
196
196
|
const intl = reactIntl.useIntl();
|
|
197
197
|
const id = hooks.useFieldId(undefined, sequentialId);
|
|
198
198
|
return jsxRuntime.jsxs("div", _objectSpread$4(_objectSpread$4({
|
|
199
199
|
role: "alertdialog",
|
|
200
200
|
"aria-describedby": id,
|
|
201
|
-
css: getStylesForNotification(
|
|
201
|
+
css: getStylesForNotification(_objectSpread$4({
|
|
202
|
+
fixed
|
|
203
|
+
}, props))
|
|
202
204
|
}, filterDataAttributes(props)), {}, {
|
|
203
205
|
children: [jsxRuntime.jsx("div", {
|
|
204
206
|
id: id,
|
|
205
|
-
css: getStylesForContent(
|
|
207
|
+
css: getStylesForContent(_objectSpread$4({
|
|
208
|
+
fixed
|
|
209
|
+
}, props)),
|
|
206
210
|
children: props.children
|
|
207
211
|
}), props.onCloseClick ? jsxRuntime.jsx("div", {
|
|
208
|
-
css: getStylesForCloseIcon(
|
|
212
|
+
css: getStylesForCloseIcon(_objectSpread$4({
|
|
213
|
+
fixed
|
|
214
|
+
}, props)),
|
|
209
215
|
children: jsxRuntime.jsx(SecondaryIconButton__default["default"], {
|
|
210
216
|
label: intl.formatMessage(messages.hideNotification),
|
|
211
217
|
onClick: props.onCloseClick,
|
|
@@ -213,7 +219,9 @@ const Notification = props => {
|
|
|
213
219
|
size: "30"
|
|
214
220
|
})
|
|
215
221
|
}) : null, props.domain === constants.NOTIFICATION_DOMAINS.SIDE ? jsxRuntime.jsx("div", {
|
|
216
|
-
css: getStylesForNotificationIcon(
|
|
222
|
+
css: getStylesForNotificationIcon(_objectSpread$4({
|
|
223
|
+
fixed
|
|
224
|
+
}, props)),
|
|
217
225
|
children: jsxRuntime.jsx(NotificationIcon, {
|
|
218
226
|
type: props.type,
|
|
219
227
|
color: "surface"
|
|
@@ -224,166 +232,135 @@ const Notification = props => {
|
|
|
224
232
|
Notification.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
225
233
|
domain: _pt__default["default"].any.isRequired,
|
|
226
234
|
type: _pt__default["default"].any.isRequired,
|
|
227
|
-
fixed: _pt__default["default"].bool
|
|
235
|
+
fixed: _pt__default["default"].bool,
|
|
228
236
|
onCloseClick: _pt__default["default"].func,
|
|
229
237
|
children: _pt__default["default"].node.isRequired
|
|
230
238
|
} : {};
|
|
231
239
|
Notification.displayName = 'Notification';
|
|
232
|
-
Notification.defaultProps = defaultProps$1;
|
|
233
240
|
|
|
234
241
|
var apiErrorMessages = reactIntl.defineMessages({
|
|
235
242
|
General: {
|
|
236
|
-
id:
|
|
237
|
-
|
|
238
|
-
defaultMessage: 'Sorry, but there seems to be something wrong. Please try again. If you are seeing this message for the second time, please contact our support team.'
|
|
243
|
+
id: "ApiError.General",
|
|
244
|
+
defaultMessage: "Sorry, but there seems to be something wrong. Please try again. If you are seeing this message for the second time, please contact our support team."
|
|
239
245
|
},
|
|
240
246
|
// Custom API Error messages (without a matching error.code)
|
|
241
247
|
OverlappingPrices: {
|
|
242
|
-
id:
|
|
243
|
-
|
|
244
|
-
defaultMessage: 'Sorry, but a price with these details already exists. Please amend the price details so that they do not overlap with another price before saving.'
|
|
248
|
+
id: "ApiError.OverlappingPrices",
|
|
249
|
+
defaultMessage: "Sorry, but a price with these details already exists. Please amend the price details so that they do not overlap with another price before saving."
|
|
245
250
|
},
|
|
246
251
|
ConcurrentModificationBulkEdit: {
|
|
247
|
-
id:
|
|
248
|
-
|
|
249
|
-
defaultMessage: 'Sorry, but we were unable to save your changes as someone else made changes to this same source while you were editing.'
|
|
252
|
+
id: "ApiError.ConcurrentModificationBulkEdit",
|
|
253
|
+
defaultMessage: "Sorry, but we were unable to save your changes as someone else made changes to this same source while you were editing."
|
|
250
254
|
},
|
|
251
255
|
// API errors
|
|
252
256
|
ConcurrentModification: {
|
|
253
|
-
id:
|
|
254
|
-
|
|
255
|
-
defaultMessage: 'Sorry, but we were unable to save your changes as someone else made changes to this same source while you were editing. Please refresh the page and re-enter your changes.'
|
|
257
|
+
id: "ApiError.ConcurrentModification",
|
|
258
|
+
defaultMessage: "Sorry, but we were unable to save your changes as someone else made changes to this same source while you were editing. Please refresh the page and re-enter your changes."
|
|
256
259
|
},
|
|
257
260
|
DuplicateAttributeValue: {
|
|
258
|
-
id:
|
|
259
|
-
|
|
260
|
-
defaultMessage: 'This value has already been used for another variant. The "{name}" value must be unique for all variants for this product. Please enter a different value.'
|
|
261
|
+
id: "ApiError.DuplicateAttributeValue",
|
|
262
|
+
defaultMessage: "This value has already been used for another variant. The \"{name}\" value must be unique for all variants for this product. Please enter a different value."
|
|
261
263
|
},
|
|
262
264
|
DuplicateAttributeValues: {
|
|
263
|
-
id:
|
|
264
|
-
|
|
265
|
-
defaultMessage: 'This combination has already been used for another variant. The combination of these attributes must be unique across all variants. Please enter a different version.'
|
|
265
|
+
id: "ApiError.DuplicateAttributeValues",
|
|
266
|
+
defaultMessage: "This combination has already been used for another variant. The combination of these attributes must be unique across all variants. Please enter a different version."
|
|
266
267
|
},
|
|
267
268
|
DuplicateField: {
|
|
268
|
-
id:
|
|
269
|
-
|
|
270
|
-
defaultMessage: 'The value for the field "{field}" has already been used. Please choose another value for this field.'
|
|
269
|
+
id: "ApiError.DuplicateField",
|
|
270
|
+
defaultMessage: "The value for the field \"{field}\" has already been used. Please choose another value for this field."
|
|
271
271
|
},
|
|
272
272
|
DuplicateSlug: {
|
|
273
|
-
id:
|
|
274
|
-
|
|
275
|
-
defaultMessage: '"{slugValue}" is already in use. Please enter a new slug value for this product.'
|
|
273
|
+
id: "ApiError.DuplicateSlug",
|
|
274
|
+
defaultMessage: "\"{slugValue}\" is already in use. Please enter a new slug value for this product."
|
|
276
275
|
},
|
|
277
276
|
DuplicatePriceScope: {
|
|
278
|
-
id:
|
|
279
|
-
|
|
280
|
-
defaultMessage: 'A price with the same scope already exists for this product variant. Make sure that the combination of currency, country, customer group, channel and valid dates is unique per price.'
|
|
277
|
+
id: "ApiError.DuplicatePriceScope",
|
|
278
|
+
defaultMessage: "A price with the same scope already exists for this product variant. Make sure that the combination of currency, country, customer group, channel and valid dates is unique per price."
|
|
281
279
|
},
|
|
282
280
|
DuplicateStandalonePriceScope: {
|
|
283
|
-
id:
|
|
284
|
-
|
|
285
|
-
defaultMessage: 'A price with the same scope already exists for this product variant. The combination of currency, country, customer group, channel and validity date must be unique for each price per SKU.'
|
|
281
|
+
id: "ApiError.DuplicateStandalonePriceScope",
|
|
282
|
+
defaultMessage: "A price with the same scope already exists for this product variant. The combination of currency, country, customer group, channel and validity date must be unique for each price per SKU."
|
|
286
283
|
},
|
|
287
284
|
DuplicateVariantValues: {
|
|
288
|
-
id:
|
|
289
|
-
|
|
290
|
-
defaultMessage: 'The same variant already exists for this product. Please enter different values for the fields.'
|
|
285
|
+
id: "ApiError.DuplicateVariantValues",
|
|
286
|
+
defaultMessage: "The same variant already exists for this product. Please enter different values for the fields."
|
|
291
287
|
},
|
|
292
288
|
InvalidDateRange: {
|
|
293
|
-
id:
|
|
294
|
-
|
|
295
|
-
defaultMessage: 'The value entered for the field {field} is invalid. The start date must be before the end date'
|
|
289
|
+
id: "ApiError.InvalidDateRange",
|
|
290
|
+
defaultMessage: "The value entered for the field {field} is invalid. The start date must be before the end date"
|
|
296
291
|
},
|
|
297
292
|
InvalidField: {
|
|
298
|
-
id:
|
|
299
|
-
|
|
300
|
-
defaultMessage: 'The value entered is not valid for the field "{field}".'
|
|
293
|
+
id: "ApiError.InvalidField",
|
|
294
|
+
defaultMessage: "The value entered is not valid for the field \"{field}\"."
|
|
301
295
|
},
|
|
302
296
|
InvalidSlug: {
|
|
303
|
-
id:
|
|
304
|
-
|
|
305
|
-
defaultMessage: 'Slugs may only contain alphanumeric (0-9A-Z) characters, underscores and hyphens and must have a length between 2 and 256 characters.'
|
|
297
|
+
id: "ApiError.InvalidSlug",
|
|
298
|
+
defaultMessage: "Slugs may only contain alphanumeric (0-9A-Z) characters, underscores and hyphens and must have a length between 2 and 256 characters."
|
|
306
299
|
},
|
|
307
300
|
OverlappingPriceValidity: {
|
|
308
|
-
id:
|
|
309
|
-
|
|
310
|
-
defaultMessage: 'Another price with overlapping validity dates exists. Each price combination needs to have unique validity dates.'
|
|
301
|
+
id: "ApiError.OverlappingPriceValidity",
|
|
302
|
+
defaultMessage: "Another price with overlapping validity dates exists. Each price combination needs to have unique validity dates."
|
|
311
303
|
},
|
|
312
304
|
OverlappingStandalonePriceValidity: {
|
|
313
|
-
id:
|
|
314
|
-
|
|
315
|
-
defaultMessage: 'Another price with overlapping validity dates exists. Each price combination needs to have unique validity dates.'
|
|
305
|
+
id: "ApiError.OverlappingStandalonePriceValidity",
|
|
306
|
+
defaultMessage: "Another price with overlapping validity dates exists. Each price combination needs to have unique validity dates."
|
|
316
307
|
},
|
|
317
308
|
PendingOperation: {
|
|
318
|
-
id:
|
|
319
|
-
|
|
320
|
-
defaultMessage: 'Sorry, but we are still processing the previous request. Please try again once it is complete.'
|
|
309
|
+
id: "ApiError.PendingOperation",
|
|
310
|
+
defaultMessage: "Sorry, but we are still processing the previous request. Please try again once it is complete."
|
|
321
311
|
},
|
|
322
312
|
ResourceNotFound: {
|
|
323
|
-
id:
|
|
324
|
-
|
|
325
|
-
defaultMessage: 'Sorry, but we cannot find what you are looking for.'
|
|
313
|
+
id: "ApiError.ResourceNotFound",
|
|
314
|
+
defaultMessage: "Sorry, but we cannot find what you are looking for."
|
|
326
315
|
},
|
|
327
316
|
ReferenceExists: {
|
|
328
|
-
id:
|
|
329
|
-
|
|
330
|
-
defaultMessage: 'Can not delete a source while it is referenced from at least one "{referencedBy}".'
|
|
317
|
+
id: "ApiError.ReferenceExists",
|
|
318
|
+
defaultMessage: "Can not delete a source while it is referenced from at least one \"{referencedBy}\"."
|
|
331
319
|
},
|
|
332
320
|
RequiredField: {
|
|
333
|
-
id:
|
|
334
|
-
|
|
335
|
-
defaultMessage: '"{field}" is a required field. Please enter a value.'
|
|
321
|
+
id: "ApiError.RequiredField",
|
|
322
|
+
defaultMessage: "\"{field}\" is a required field. Please enter a value."
|
|
336
323
|
},
|
|
337
324
|
RequiredFields: {
|
|
338
325
|
// Client side validation
|
|
339
|
-
id:
|
|
340
|
-
|
|
341
|
-
defaultMessage: 'Please enter values for the following required fields: {fields}'
|
|
326
|
+
id: "ApiError.RequiredFields",
|
|
327
|
+
defaultMessage: "Please enter values for the following required fields: {fields}"
|
|
342
328
|
},
|
|
343
329
|
SemanticError: {
|
|
344
|
-
id:
|
|
345
|
-
|
|
346
|
-
defaultMessage: 'Semantic error: the given Predicate is not valid. Please read the documentation to define a correct predicate.'
|
|
330
|
+
id: "ApiError.SemanticError",
|
|
331
|
+
defaultMessage: "Semantic error: the given Predicate is not valid. Please read the documentation to define a correct predicate."
|
|
347
332
|
},
|
|
348
333
|
SyntaxError: {
|
|
349
|
-
id:
|
|
350
|
-
|
|
351
|
-
defaultMessage: 'Syntax error: the given Predicate is not valid. Please read the documentation to define a correct predicate.'
|
|
334
|
+
id: "ApiError.SyntaxError",
|
|
335
|
+
defaultMessage: "Syntax error: the given Predicate is not valid. Please read the documentation to define a correct predicate."
|
|
352
336
|
},
|
|
353
337
|
Unauthorized: {
|
|
354
|
-
id:
|
|
355
|
-
|
|
356
|
-
defaultMessage: 'Sorry, but you are not authorized to access this feature.'
|
|
338
|
+
id: "ApiError.Unauthorized",
|
|
339
|
+
defaultMessage: "Sorry, but you are not authorized to access this feature."
|
|
357
340
|
},
|
|
358
341
|
Forbidden: {
|
|
359
|
-
id:
|
|
360
|
-
|
|
361
|
-
defaultMessage: 'You are not authorized to access this feature. Please contact your system administrator with any further questions.'
|
|
342
|
+
id: "ApiError.Forbidden",
|
|
343
|
+
defaultMessage: "You are not authorized to access this feature. Please contact your system administrator with any further questions."
|
|
362
344
|
},
|
|
363
345
|
ExtensionNoResponse: {
|
|
364
|
-
id:
|
|
365
|
-
|
|
366
|
-
defaultMessage: 'Sorry, we could not perform the requested action due to an API extension not responding.'
|
|
346
|
+
id: "ApiError.ExtensionNoResponse",
|
|
347
|
+
defaultMessage: "Sorry, we could not perform the requested action due to an API extension not responding."
|
|
367
348
|
},
|
|
368
349
|
ExtensionBadResponse: {
|
|
369
|
-
id:
|
|
370
|
-
|
|
371
|
-
defaultMessage: 'Sorry, we could not perform the requested action due to failed processing of an API extension response.'
|
|
350
|
+
id: "ApiError.ExtensionBadResponse",
|
|
351
|
+
defaultMessage: "Sorry, we could not perform the requested action due to failed processing of an API extension response."
|
|
372
352
|
},
|
|
373
353
|
ExtensionUpdateActionsFailed: {
|
|
374
|
-
id:
|
|
375
|
-
|
|
376
|
-
defaultMessage: 'Sorry, we could not perform the requested action. It is not possible to perform the update actions as instructed by the API extension.'
|
|
354
|
+
id: "ApiError.ExtensionUpdateActionsFailed",
|
|
355
|
+
defaultMessage: "Sorry, we could not perform the requested action. It is not possible to perform the update actions as instructed by the API extension."
|
|
377
356
|
},
|
|
378
357
|
TaxCategoryDuplicateCountry: {
|
|
379
|
-
id:
|
|
380
|
-
|
|
381
|
-
defaultMessage: 'Duplicate tax rates submitted. Please remove the duplicates.'
|
|
358
|
+
id: "ApiError.TaxCategoryDuplicateCountry",
|
|
359
|
+
defaultMessage: "Duplicate tax rates submitted. Please remove the duplicates."
|
|
382
360
|
},
|
|
383
361
|
MaxResourceLimitExceeded: {
|
|
384
|
-
id:
|
|
385
|
-
|
|
386
|
-
defaultMessage: 'The project reached the limit for the resource. To add more resources delete existing ones or reach out to the administrator or contact customer support.'
|
|
362
|
+
id: "ApiError.MaxResourceLimitExceeded",
|
|
363
|
+
defaultMessage: "The project reached the limit for the resource. To add more resources delete existing ones or reach out to the administrator or contact customer support."
|
|
387
364
|
}
|
|
388
365
|
});
|
|
389
366
|
|
|
@@ -620,7 +597,7 @@ const selectGlobalNotifications = reselect.createSelector(selectNotifications, n
|
|
|
620
597
|
const selectPageNotifications = reselect.createSelector(selectNotifications, notifications => _filterInstanceProperty__default["default"](notifications).call(notifications, notification => notification.domain === constants.NOTIFICATION_DOMAINS.PAGE));
|
|
621
598
|
const selectSideNotifications = reselect.createSelector(selectNotifications, notifications => _filterInstanceProperty__default["default"](notifications).call(notifications, notification => notification.domain === constants.NOTIFICATION_DOMAINS.SIDE));
|
|
622
599
|
|
|
623
|
-
const _excluded = ["values"],
|
|
600
|
+
const _excluded$1 = ["values"],
|
|
624
601
|
_excluded2 = ["text"],
|
|
625
602
|
_excluded3 = ["values"],
|
|
626
603
|
_excluded4 = ["text"],
|
|
@@ -652,7 +629,7 @@ const NotificationsListGlobal = props => {
|
|
|
652
629
|
case constants.NOTIFICATION_KINDS_GLOBAL.success:
|
|
653
630
|
{
|
|
654
631
|
_valuesInstanceProperty__default["default"](notification);
|
|
655
|
-
const genericNotification = _objectWithoutProperties(notification, _excluded);
|
|
632
|
+
const genericNotification = _objectWithoutProperties(notification, _excluded$1);
|
|
656
633
|
return jsxRuntime.jsx(GenericNotification, {
|
|
657
634
|
notification: genericNotification,
|
|
658
635
|
dismiss: () => {
|
|
@@ -799,18 +776,20 @@ const NotificationsList = props => {
|
|
|
799
776
|
};
|
|
800
777
|
NotificationsList.displayName = 'NotificationsList';
|
|
801
778
|
|
|
779
|
+
const _excluded = ["domain", "kind"];
|
|
802
780
|
function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
803
781
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
804
|
-
const
|
|
805
|
-
domain
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
782
|
+
const Notifier = _ref => {
|
|
783
|
+
let _ref$domain = _ref.domain,
|
|
784
|
+
domain = _ref$domain === void 0 ? constants.NOTIFICATION_DOMAINS.SIDE : _ref$domain,
|
|
785
|
+
_ref$kind = _ref.kind,
|
|
786
|
+
kind = _ref$kind === void 0 ? constants.NOTIFICATION_KINDS_SIDE.success : _ref$kind,
|
|
787
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
809
788
|
const showNotification = actionsGlobal.useShowNotification();
|
|
810
789
|
react.useEffect(() => {
|
|
811
790
|
const notification = showNotification({
|
|
812
|
-
domain:
|
|
813
|
-
kind:
|
|
791
|
+
domain: domain,
|
|
792
|
+
kind: kind,
|
|
814
793
|
text: props.text
|
|
815
794
|
}, isNumber__default["default"](props.dismissAfter) ? _objectSpread(_objectSpread({}, props.meta), {}, {
|
|
816
795
|
dismissAfter: props.dismissAfter
|
|
@@ -832,7 +811,6 @@ Notifier.propTypes = {
|
|
|
832
811
|
dismissAfter: _pt__default["default"].number
|
|
833
812
|
};
|
|
834
813
|
Notifier.displayName = 'Notifier';
|
|
835
|
-
Notifier.defaultProps = defaultProps;
|
|
836
814
|
|
|
837
815
|
exports.ApiErrorMessage = ApiErrorMessage;
|
|
838
816
|
exports.Notification = Notification;
|
|
@@ -14,6 +14,7 @@ var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-
|
|
|
14
14
|
var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
|
|
15
15
|
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
|
|
16
16
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
17
|
+
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
17
18
|
var reactIntl = require('react-intl');
|
|
18
19
|
var constants = require('@commercetools-frontend/constants');
|
|
19
20
|
var hooks = require('@commercetools-uikit/hooks');
|
|
@@ -24,7 +25,6 @@ var _startsWithInstanceProperty = require('@babel/runtime-corejs3/core-js-stable
|
|
|
24
25
|
var omitBy = require('lodash/omitBy');
|
|
25
26
|
var react$1 = require('@emotion/react');
|
|
26
27
|
var designSystem = require('@commercetools-uikit/design-system');
|
|
27
|
-
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
28
28
|
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
29
29
|
var _valuesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/values');
|
|
30
30
|
var reactRedux = require('react-redux');
|
|
@@ -61,7 +61,7 @@ var _sliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_sliceInstanc
|
|
|
61
61
|
var isNumber__default = /*#__PURE__*/_interopDefault(isNumber);
|
|
62
62
|
|
|
63
63
|
// NOTE: This string will be replaced on build time with the package version.
|
|
64
|
-
var version = "22.
|
|
64
|
+
var version = "22.38.0";
|
|
65
65
|
|
|
66
66
|
const Context = /*#__PURE__*/react.createContext(() => null);
|
|
67
67
|
function NotificationProviderForCustomComponent(props) {
|
|
@@ -80,9 +80,8 @@ function filterDataAttributes(obj) {
|
|
|
80
80
|
|
|
81
81
|
var messages = reactIntl.defineMessages({
|
|
82
82
|
hideNotification: {
|
|
83
|
-
id:
|
|
84
|
-
|
|
85
|
-
defaultMessage: 'Hide notification'
|
|
83
|
+
id: "Notification.hideNotification",
|
|
84
|
+
defaultMessage: "Hide notification"
|
|
86
85
|
}
|
|
87
86
|
});
|
|
88
87
|
|
|
@@ -158,6 +157,7 @@ const getStylesForNotification = props => {
|
|
|
158
157
|
}
|
|
159
158
|
};
|
|
160
159
|
|
|
160
|
+
const _excluded$2 = ["fixed"];
|
|
161
161
|
function ownKeys$4(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
162
162
|
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$4(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$4(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
163
163
|
const sequentialId = utils.createSequentialId('notification-');
|
|
@@ -183,23 +183,29 @@ const NotificationIcon = props => {
|
|
|
183
183
|
};
|
|
184
184
|
NotificationIcon.propTypes = {};
|
|
185
185
|
NotificationIcon.displayName = 'NotificationIcon';
|
|
186
|
-
const
|
|
187
|
-
fixed
|
|
188
|
-
|
|
189
|
-
|
|
186
|
+
const Notification = _ref => {
|
|
187
|
+
let _ref$fixed = _ref.fixed,
|
|
188
|
+
fixed = _ref$fixed === void 0 ? false : _ref$fixed,
|
|
189
|
+
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
190
190
|
const intl = reactIntl.useIntl();
|
|
191
191
|
const id = hooks.useFieldId(undefined, sequentialId);
|
|
192
192
|
return jsxRuntime.jsxs("div", _objectSpread$4(_objectSpread$4({
|
|
193
193
|
role: "alertdialog",
|
|
194
194
|
"aria-describedby": id,
|
|
195
|
-
css: getStylesForNotification(
|
|
195
|
+
css: getStylesForNotification(_objectSpread$4({
|
|
196
|
+
fixed
|
|
197
|
+
}, props))
|
|
196
198
|
}, filterDataAttributes(props)), {}, {
|
|
197
199
|
children: [jsxRuntime.jsx("div", {
|
|
198
200
|
id: id,
|
|
199
|
-
css: getStylesForContent(
|
|
201
|
+
css: getStylesForContent(_objectSpread$4({
|
|
202
|
+
fixed
|
|
203
|
+
}, props)),
|
|
200
204
|
children: props.children
|
|
201
205
|
}), props.onCloseClick ? jsxRuntime.jsx("div", {
|
|
202
|
-
css: getStylesForCloseIcon(
|
|
206
|
+
css: getStylesForCloseIcon(_objectSpread$4({
|
|
207
|
+
fixed
|
|
208
|
+
}, props)),
|
|
203
209
|
children: jsxRuntime.jsx(SecondaryIconButton__default["default"], {
|
|
204
210
|
label: intl.formatMessage(messages.hideNotification),
|
|
205
211
|
onClick: props.onCloseClick,
|
|
@@ -207,7 +213,9 @@ const Notification = props => {
|
|
|
207
213
|
size: "30"
|
|
208
214
|
})
|
|
209
215
|
}) : null, props.domain === constants.NOTIFICATION_DOMAINS.SIDE ? jsxRuntime.jsx("div", {
|
|
210
|
-
css: getStylesForNotificationIcon(
|
|
216
|
+
css: getStylesForNotificationIcon(_objectSpread$4({
|
|
217
|
+
fixed
|
|
218
|
+
}, props)),
|
|
211
219
|
children: jsxRuntime.jsx(NotificationIcon, {
|
|
212
220
|
type: props.type,
|
|
213
221
|
color: "surface"
|
|
@@ -217,161 +225,130 @@ const Notification = props => {
|
|
|
217
225
|
};
|
|
218
226
|
Notification.propTypes = {};
|
|
219
227
|
Notification.displayName = 'Notification';
|
|
220
|
-
Notification.defaultProps = defaultProps$1;
|
|
221
228
|
|
|
222
229
|
var apiErrorMessages = reactIntl.defineMessages({
|
|
223
230
|
General: {
|
|
224
|
-
id:
|
|
225
|
-
|
|
226
|
-
defaultMessage: 'Sorry, but there seems to be something wrong. Please try again. If you are seeing this message for the second time, please contact our support team.'
|
|
231
|
+
id: "ApiError.General",
|
|
232
|
+
defaultMessage: "Sorry, but there seems to be something wrong. Please try again. If you are seeing this message for the second time, please contact our support team."
|
|
227
233
|
},
|
|
228
234
|
// Custom API Error messages (without a matching error.code)
|
|
229
235
|
OverlappingPrices: {
|
|
230
|
-
id:
|
|
231
|
-
|
|
232
|
-
defaultMessage: 'Sorry, but a price with these details already exists. Please amend the price details so that they do not overlap with another price before saving.'
|
|
236
|
+
id: "ApiError.OverlappingPrices",
|
|
237
|
+
defaultMessage: "Sorry, but a price with these details already exists. Please amend the price details so that they do not overlap with another price before saving."
|
|
233
238
|
},
|
|
234
239
|
ConcurrentModificationBulkEdit: {
|
|
235
|
-
id:
|
|
236
|
-
|
|
237
|
-
defaultMessage: 'Sorry, but we were unable to save your changes as someone else made changes to this same source while you were editing.'
|
|
240
|
+
id: "ApiError.ConcurrentModificationBulkEdit",
|
|
241
|
+
defaultMessage: "Sorry, but we were unable to save your changes as someone else made changes to this same source while you were editing."
|
|
238
242
|
},
|
|
239
243
|
// API errors
|
|
240
244
|
ConcurrentModification: {
|
|
241
|
-
id:
|
|
242
|
-
|
|
243
|
-
defaultMessage: 'Sorry, but we were unable to save your changes as someone else made changes to this same source while you were editing. Please refresh the page and re-enter your changes.'
|
|
245
|
+
id: "ApiError.ConcurrentModification",
|
|
246
|
+
defaultMessage: "Sorry, but we were unable to save your changes as someone else made changes to this same source while you were editing. Please refresh the page and re-enter your changes."
|
|
244
247
|
},
|
|
245
248
|
DuplicateAttributeValue: {
|
|
246
|
-
id:
|
|
247
|
-
|
|
248
|
-
defaultMessage: 'This value has already been used for another variant. The "{name}" value must be unique for all variants for this product. Please enter a different value.'
|
|
249
|
+
id: "ApiError.DuplicateAttributeValue",
|
|
250
|
+
defaultMessage: "This value has already been used for another variant. The \"{name}\" value must be unique for all variants for this product. Please enter a different value."
|
|
249
251
|
},
|
|
250
252
|
DuplicateAttributeValues: {
|
|
251
|
-
id:
|
|
252
|
-
|
|
253
|
-
defaultMessage: 'This combination has already been used for another variant. The combination of these attributes must be unique across all variants. Please enter a different version.'
|
|
253
|
+
id: "ApiError.DuplicateAttributeValues",
|
|
254
|
+
defaultMessage: "This combination has already been used for another variant. The combination of these attributes must be unique across all variants. Please enter a different version."
|
|
254
255
|
},
|
|
255
256
|
DuplicateField: {
|
|
256
|
-
id:
|
|
257
|
-
|
|
258
|
-
defaultMessage: 'The value for the field "{field}" has already been used. Please choose another value for this field.'
|
|
257
|
+
id: "ApiError.DuplicateField",
|
|
258
|
+
defaultMessage: "The value for the field \"{field}\" has already been used. Please choose another value for this field."
|
|
259
259
|
},
|
|
260
260
|
DuplicateSlug: {
|
|
261
|
-
id:
|
|
262
|
-
|
|
263
|
-
defaultMessage: '"{slugValue}" is already in use. Please enter a new slug value for this product.'
|
|
261
|
+
id: "ApiError.DuplicateSlug",
|
|
262
|
+
defaultMessage: "\"{slugValue}\" is already in use. Please enter a new slug value for this product."
|
|
264
263
|
},
|
|
265
264
|
DuplicatePriceScope: {
|
|
266
|
-
id:
|
|
267
|
-
|
|
268
|
-
defaultMessage: 'A price with the same scope already exists for this product variant. Make sure that the combination of currency, country, customer group, channel and valid dates is unique per price.'
|
|
265
|
+
id: "ApiError.DuplicatePriceScope",
|
|
266
|
+
defaultMessage: "A price with the same scope already exists for this product variant. Make sure that the combination of currency, country, customer group, channel and valid dates is unique per price."
|
|
269
267
|
},
|
|
270
268
|
DuplicateStandalonePriceScope: {
|
|
271
|
-
id:
|
|
272
|
-
|
|
273
|
-
defaultMessage: 'A price with the same scope already exists for this product variant. The combination of currency, country, customer group, channel and validity date must be unique for each price per SKU.'
|
|
269
|
+
id: "ApiError.DuplicateStandalonePriceScope",
|
|
270
|
+
defaultMessage: "A price with the same scope already exists for this product variant. The combination of currency, country, customer group, channel and validity date must be unique for each price per SKU."
|
|
274
271
|
},
|
|
275
272
|
DuplicateVariantValues: {
|
|
276
|
-
id:
|
|
277
|
-
|
|
278
|
-
defaultMessage: 'The same variant already exists for this product. Please enter different values for the fields.'
|
|
273
|
+
id: "ApiError.DuplicateVariantValues",
|
|
274
|
+
defaultMessage: "The same variant already exists for this product. Please enter different values for the fields."
|
|
279
275
|
},
|
|
280
276
|
InvalidDateRange: {
|
|
281
|
-
id:
|
|
282
|
-
|
|
283
|
-
defaultMessage: 'The value entered for the field {field} is invalid. The start date must be before the end date'
|
|
277
|
+
id: "ApiError.InvalidDateRange",
|
|
278
|
+
defaultMessage: "The value entered for the field {field} is invalid. The start date must be before the end date"
|
|
284
279
|
},
|
|
285
280
|
InvalidField: {
|
|
286
|
-
id:
|
|
287
|
-
|
|
288
|
-
defaultMessage: 'The value entered is not valid for the field "{field}".'
|
|
281
|
+
id: "ApiError.InvalidField",
|
|
282
|
+
defaultMessage: "The value entered is not valid for the field \"{field}\"."
|
|
289
283
|
},
|
|
290
284
|
InvalidSlug: {
|
|
291
|
-
id:
|
|
292
|
-
|
|
293
|
-
defaultMessage: 'Slugs may only contain alphanumeric (0-9A-Z) characters, underscores and hyphens and must have a length between 2 and 256 characters.'
|
|
285
|
+
id: "ApiError.InvalidSlug",
|
|
286
|
+
defaultMessage: "Slugs may only contain alphanumeric (0-9A-Z) characters, underscores and hyphens and must have a length between 2 and 256 characters."
|
|
294
287
|
},
|
|
295
288
|
OverlappingPriceValidity: {
|
|
296
|
-
id:
|
|
297
|
-
|
|
298
|
-
defaultMessage: 'Another price with overlapping validity dates exists. Each price combination needs to have unique validity dates.'
|
|
289
|
+
id: "ApiError.OverlappingPriceValidity",
|
|
290
|
+
defaultMessage: "Another price with overlapping validity dates exists. Each price combination needs to have unique validity dates."
|
|
299
291
|
},
|
|
300
292
|
OverlappingStandalonePriceValidity: {
|
|
301
|
-
id:
|
|
302
|
-
|
|
303
|
-
defaultMessage: 'Another price with overlapping validity dates exists. Each price combination needs to have unique validity dates.'
|
|
293
|
+
id: "ApiError.OverlappingStandalonePriceValidity",
|
|
294
|
+
defaultMessage: "Another price with overlapping validity dates exists. Each price combination needs to have unique validity dates."
|
|
304
295
|
},
|
|
305
296
|
PendingOperation: {
|
|
306
|
-
id:
|
|
307
|
-
|
|
308
|
-
defaultMessage: 'Sorry, but we are still processing the previous request. Please try again once it is complete.'
|
|
297
|
+
id: "ApiError.PendingOperation",
|
|
298
|
+
defaultMessage: "Sorry, but we are still processing the previous request. Please try again once it is complete."
|
|
309
299
|
},
|
|
310
300
|
ResourceNotFound: {
|
|
311
|
-
id:
|
|
312
|
-
|
|
313
|
-
defaultMessage: 'Sorry, but we cannot find what you are looking for.'
|
|
301
|
+
id: "ApiError.ResourceNotFound",
|
|
302
|
+
defaultMessage: "Sorry, but we cannot find what you are looking for."
|
|
314
303
|
},
|
|
315
304
|
ReferenceExists: {
|
|
316
|
-
id:
|
|
317
|
-
|
|
318
|
-
defaultMessage: 'Can not delete a source while it is referenced from at least one "{referencedBy}".'
|
|
305
|
+
id: "ApiError.ReferenceExists",
|
|
306
|
+
defaultMessage: "Can not delete a source while it is referenced from at least one \"{referencedBy}\"."
|
|
319
307
|
},
|
|
320
308
|
RequiredField: {
|
|
321
|
-
id:
|
|
322
|
-
|
|
323
|
-
defaultMessage: '"{field}" is a required field. Please enter a value.'
|
|
309
|
+
id: "ApiError.RequiredField",
|
|
310
|
+
defaultMessage: "\"{field}\" is a required field. Please enter a value."
|
|
324
311
|
},
|
|
325
312
|
RequiredFields: {
|
|
326
313
|
// Client side validation
|
|
327
|
-
id:
|
|
328
|
-
|
|
329
|
-
defaultMessage: 'Please enter values for the following required fields: {fields}'
|
|
314
|
+
id: "ApiError.RequiredFields",
|
|
315
|
+
defaultMessage: "Please enter values for the following required fields: {fields}"
|
|
330
316
|
},
|
|
331
317
|
SemanticError: {
|
|
332
|
-
id:
|
|
333
|
-
|
|
334
|
-
defaultMessage: 'Semantic error: the given Predicate is not valid. Please read the documentation to define a correct predicate.'
|
|
318
|
+
id: "ApiError.SemanticError",
|
|
319
|
+
defaultMessage: "Semantic error: the given Predicate is not valid. Please read the documentation to define a correct predicate."
|
|
335
320
|
},
|
|
336
321
|
SyntaxError: {
|
|
337
|
-
id:
|
|
338
|
-
|
|
339
|
-
defaultMessage: 'Syntax error: the given Predicate is not valid. Please read the documentation to define a correct predicate.'
|
|
322
|
+
id: "ApiError.SyntaxError",
|
|
323
|
+
defaultMessage: "Syntax error: the given Predicate is not valid. Please read the documentation to define a correct predicate."
|
|
340
324
|
},
|
|
341
325
|
Unauthorized: {
|
|
342
|
-
id:
|
|
343
|
-
|
|
344
|
-
defaultMessage: 'Sorry, but you are not authorized to access this feature.'
|
|
326
|
+
id: "ApiError.Unauthorized",
|
|
327
|
+
defaultMessage: "Sorry, but you are not authorized to access this feature."
|
|
345
328
|
},
|
|
346
329
|
Forbidden: {
|
|
347
|
-
id:
|
|
348
|
-
|
|
349
|
-
defaultMessage: 'You are not authorized to access this feature. Please contact your system administrator with any further questions.'
|
|
330
|
+
id: "ApiError.Forbidden",
|
|
331
|
+
defaultMessage: "You are not authorized to access this feature. Please contact your system administrator with any further questions."
|
|
350
332
|
},
|
|
351
333
|
ExtensionNoResponse: {
|
|
352
|
-
id:
|
|
353
|
-
|
|
354
|
-
defaultMessage: 'Sorry, we could not perform the requested action due to an API extension not responding.'
|
|
334
|
+
id: "ApiError.ExtensionNoResponse",
|
|
335
|
+
defaultMessage: "Sorry, we could not perform the requested action due to an API extension not responding."
|
|
355
336
|
},
|
|
356
337
|
ExtensionBadResponse: {
|
|
357
|
-
id:
|
|
358
|
-
|
|
359
|
-
defaultMessage: 'Sorry, we could not perform the requested action due to failed processing of an API extension response.'
|
|
338
|
+
id: "ApiError.ExtensionBadResponse",
|
|
339
|
+
defaultMessage: "Sorry, we could not perform the requested action due to failed processing of an API extension response."
|
|
360
340
|
},
|
|
361
341
|
ExtensionUpdateActionsFailed: {
|
|
362
|
-
id:
|
|
363
|
-
|
|
364
|
-
defaultMessage: 'Sorry, we could not perform the requested action. It is not possible to perform the update actions as instructed by the API extension.'
|
|
342
|
+
id: "ApiError.ExtensionUpdateActionsFailed",
|
|
343
|
+
defaultMessage: "Sorry, we could not perform the requested action. It is not possible to perform the update actions as instructed by the API extension."
|
|
365
344
|
},
|
|
366
345
|
TaxCategoryDuplicateCountry: {
|
|
367
|
-
id:
|
|
368
|
-
|
|
369
|
-
defaultMessage: 'Duplicate tax rates submitted. Please remove the duplicates.'
|
|
346
|
+
id: "ApiError.TaxCategoryDuplicateCountry",
|
|
347
|
+
defaultMessage: "Duplicate tax rates submitted. Please remove the duplicates."
|
|
370
348
|
},
|
|
371
349
|
MaxResourceLimitExceeded: {
|
|
372
|
-
id:
|
|
373
|
-
|
|
374
|
-
defaultMessage: 'The project reached the limit for the resource. To add more resources delete existing ones or reach out to the administrator or contact customer support.'
|
|
350
|
+
id: "ApiError.MaxResourceLimitExceeded",
|
|
351
|
+
defaultMessage: "The project reached the limit for the resource. To add more resources delete existing ones or reach out to the administrator or contact customer support."
|
|
375
352
|
}
|
|
376
353
|
});
|
|
377
354
|
|
|
@@ -597,7 +574,7 @@ const selectGlobalNotifications = reselect.createSelector(selectNotifications, n
|
|
|
597
574
|
const selectPageNotifications = reselect.createSelector(selectNotifications, notifications => _filterInstanceProperty__default["default"](notifications).call(notifications, notification => notification.domain === constants.NOTIFICATION_DOMAINS.PAGE));
|
|
598
575
|
const selectSideNotifications = reselect.createSelector(selectNotifications, notifications => _filterInstanceProperty__default["default"](notifications).call(notifications, notification => notification.domain === constants.NOTIFICATION_DOMAINS.SIDE));
|
|
599
576
|
|
|
600
|
-
const _excluded = ["values"],
|
|
577
|
+
const _excluded$1 = ["values"],
|
|
601
578
|
_excluded2 = ["text"],
|
|
602
579
|
_excluded3 = ["values"],
|
|
603
580
|
_excluded4 = ["text"],
|
|
@@ -629,7 +606,7 @@ const NotificationsListGlobal = props => {
|
|
|
629
606
|
case constants.NOTIFICATION_KINDS_GLOBAL.success:
|
|
630
607
|
{
|
|
631
608
|
_valuesInstanceProperty__default["default"](notification);
|
|
632
|
-
const genericNotification = _objectWithoutProperties(notification, _excluded);
|
|
609
|
+
const genericNotification = _objectWithoutProperties(notification, _excluded$1);
|
|
633
610
|
return jsxRuntime.jsx(GenericNotification, {
|
|
634
611
|
notification: genericNotification,
|
|
635
612
|
dismiss: () => {
|
|
@@ -770,18 +747,20 @@ const NotificationsList = props => {
|
|
|
770
747
|
};
|
|
771
748
|
NotificationsList.displayName = 'NotificationsList';
|
|
772
749
|
|
|
750
|
+
const _excluded = ["domain", "kind"];
|
|
773
751
|
function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
774
752
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
775
|
-
const
|
|
776
|
-
domain
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
753
|
+
const Notifier = _ref => {
|
|
754
|
+
let _ref$domain = _ref.domain,
|
|
755
|
+
domain = _ref$domain === void 0 ? constants.NOTIFICATION_DOMAINS.SIDE : _ref$domain,
|
|
756
|
+
_ref$kind = _ref.kind,
|
|
757
|
+
kind = _ref$kind === void 0 ? constants.NOTIFICATION_KINDS_SIDE.success : _ref$kind,
|
|
758
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
780
759
|
const showNotification = actionsGlobal.useShowNotification();
|
|
781
760
|
react.useEffect(() => {
|
|
782
761
|
const notification = showNotification({
|
|
783
|
-
domain:
|
|
784
|
-
kind:
|
|
762
|
+
domain: domain,
|
|
763
|
+
kind: kind,
|
|
785
764
|
text: props.text
|
|
786
765
|
}, isNumber__default["default"](props.dismissAfter) ? _objectSpread(_objectSpread({}, props.meta), {}, {
|
|
787
766
|
dismissAfter: props.dismissAfter
|
|
@@ -803,7 +782,6 @@ Notifier.propTypes = {
|
|
|
803
782
|
dismissAfter: _pt__default["default"].number
|
|
804
783
|
};
|
|
805
784
|
Notifier.displayName = 'Notifier';
|
|
806
|
-
Notifier.defaultProps = defaultProps;
|
|
807
785
|
|
|
808
786
|
exports.ApiErrorMessage = ApiErrorMessage;
|
|
809
787
|
exports.Notification = Notification;
|
|
@@ -10,6 +10,7 @@ import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js-st
|
|
|
10
10
|
import _Object$defineProperties from '@babel/runtime-corejs3/core-js-stable/object/define-properties';
|
|
11
11
|
import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object/define-property';
|
|
12
12
|
import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
|
|
13
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/esm/objectWithoutProperties';
|
|
13
14
|
import { defineMessages, useIntl, FormattedMessage } from 'react-intl';
|
|
14
15
|
import { NOTIFICATION_DOMAINS, NOTIFICATION_KINDS_SIDE, NOTIFICATION_KINDS_GLOBAL, NOTIFICATION_KINDS_PAGE } from '@commercetools-frontend/constants';
|
|
15
16
|
import { useFieldId } from '@commercetools-uikit/hooks';
|
|
@@ -20,7 +21,6 @@ import _startsWithInstanceProperty from '@babel/runtime-corejs3/core-js-stable/i
|
|
|
20
21
|
import omitBy from 'lodash/omitBy';
|
|
21
22
|
import { keyframes, css } from '@emotion/react';
|
|
22
23
|
import { designTokens, customProperties } from '@commercetools-uikit/design-system';
|
|
23
|
-
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/esm/objectWithoutProperties';
|
|
24
24
|
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
25
25
|
import _valuesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/values';
|
|
26
26
|
import { useDispatch, useSelector } from 'react-redux';
|
|
@@ -35,7 +35,7 @@ import isNumber from 'lodash/isNumber';
|
|
|
35
35
|
import { useShowNotification } from '@commercetools-frontend/actions-global';
|
|
36
36
|
|
|
37
37
|
// NOTE: This string will be replaced on build time with the package version.
|
|
38
|
-
var version = "22.
|
|
38
|
+
var version = "22.38.0";
|
|
39
39
|
|
|
40
40
|
const Context = /*#__PURE__*/createContext(() => null);
|
|
41
41
|
function NotificationProviderForCustomComponent(props) {
|
|
@@ -57,9 +57,8 @@ function filterDataAttributes(obj) {
|
|
|
57
57
|
|
|
58
58
|
var messages = defineMessages({
|
|
59
59
|
hideNotification: {
|
|
60
|
-
id:
|
|
61
|
-
|
|
62
|
-
defaultMessage: 'Hide notification'
|
|
60
|
+
id: "Notification.hideNotification",
|
|
61
|
+
defaultMessage: "Hide notification"
|
|
63
62
|
}
|
|
64
63
|
});
|
|
65
64
|
|
|
@@ -135,6 +134,7 @@ const getStylesForNotification = props => {
|
|
|
135
134
|
}
|
|
136
135
|
};
|
|
137
136
|
|
|
137
|
+
const _excluded$2 = ["fixed"];
|
|
138
138
|
function ownKeys$4(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
139
139
|
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$4(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$4(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
140
140
|
const sequentialId = createSequentialId('notification-');
|
|
@@ -163,23 +163,29 @@ NotificationIcon.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
163
163
|
color: _pt.oneOf(['error', 'warning', 'info', 'solid', 'neutral60', 'surface', 'primary', 'primary40']).isRequired
|
|
164
164
|
} : {};
|
|
165
165
|
NotificationIcon.displayName = 'NotificationIcon';
|
|
166
|
-
const
|
|
167
|
-
fixed
|
|
168
|
-
|
|
169
|
-
|
|
166
|
+
const Notification = _ref => {
|
|
167
|
+
let _ref$fixed = _ref.fixed,
|
|
168
|
+
fixed = _ref$fixed === void 0 ? false : _ref$fixed,
|
|
169
|
+
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
170
170
|
const intl = useIntl();
|
|
171
171
|
const id = useFieldId(undefined, sequentialId);
|
|
172
172
|
return jsxs("div", _objectSpread$4(_objectSpread$4({
|
|
173
173
|
role: "alertdialog",
|
|
174
174
|
"aria-describedby": id,
|
|
175
|
-
css: getStylesForNotification(
|
|
175
|
+
css: getStylesForNotification(_objectSpread$4({
|
|
176
|
+
fixed
|
|
177
|
+
}, props))
|
|
176
178
|
}, filterDataAttributes(props)), {}, {
|
|
177
179
|
children: [jsx("div", {
|
|
178
180
|
id: id,
|
|
179
|
-
css: getStylesForContent(
|
|
181
|
+
css: getStylesForContent(_objectSpread$4({
|
|
182
|
+
fixed
|
|
183
|
+
}, props)),
|
|
180
184
|
children: props.children
|
|
181
185
|
}), props.onCloseClick ? jsx("div", {
|
|
182
|
-
css: getStylesForCloseIcon(
|
|
186
|
+
css: getStylesForCloseIcon(_objectSpread$4({
|
|
187
|
+
fixed
|
|
188
|
+
}, props)),
|
|
183
189
|
children: jsx(SecondaryIconButton, {
|
|
184
190
|
label: intl.formatMessage(messages.hideNotification),
|
|
185
191
|
onClick: props.onCloseClick,
|
|
@@ -187,7 +193,9 @@ const Notification = props => {
|
|
|
187
193
|
size: "30"
|
|
188
194
|
})
|
|
189
195
|
}) : null, props.domain === NOTIFICATION_DOMAINS.SIDE ? jsx("div", {
|
|
190
|
-
css: getStylesForNotificationIcon(
|
|
196
|
+
css: getStylesForNotificationIcon(_objectSpread$4({
|
|
197
|
+
fixed
|
|
198
|
+
}, props)),
|
|
191
199
|
children: jsx(NotificationIcon, {
|
|
192
200
|
type: props.type,
|
|
193
201
|
color: "surface"
|
|
@@ -198,166 +206,135 @@ const Notification = props => {
|
|
|
198
206
|
Notification.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
199
207
|
domain: _pt.any.isRequired,
|
|
200
208
|
type: _pt.any.isRequired,
|
|
201
|
-
fixed: _pt.bool
|
|
209
|
+
fixed: _pt.bool,
|
|
202
210
|
onCloseClick: _pt.func,
|
|
203
211
|
children: _pt.node.isRequired
|
|
204
212
|
} : {};
|
|
205
213
|
Notification.displayName = 'Notification';
|
|
206
|
-
Notification.defaultProps = defaultProps$1;
|
|
207
214
|
|
|
208
215
|
var apiErrorMessages = defineMessages({
|
|
209
216
|
General: {
|
|
210
|
-
id:
|
|
211
|
-
|
|
212
|
-
defaultMessage: 'Sorry, but there seems to be something wrong. Please try again. If you are seeing this message for the second time, please contact our support team.'
|
|
217
|
+
id: "ApiError.General",
|
|
218
|
+
defaultMessage: "Sorry, but there seems to be something wrong. Please try again. If you are seeing this message for the second time, please contact our support team."
|
|
213
219
|
},
|
|
214
220
|
// Custom API Error messages (without a matching error.code)
|
|
215
221
|
OverlappingPrices: {
|
|
216
|
-
id:
|
|
217
|
-
|
|
218
|
-
defaultMessage: 'Sorry, but a price with these details already exists. Please amend the price details so that they do not overlap with another price before saving.'
|
|
222
|
+
id: "ApiError.OverlappingPrices",
|
|
223
|
+
defaultMessage: "Sorry, but a price with these details already exists. Please amend the price details so that they do not overlap with another price before saving."
|
|
219
224
|
},
|
|
220
225
|
ConcurrentModificationBulkEdit: {
|
|
221
|
-
id:
|
|
222
|
-
|
|
223
|
-
defaultMessage: 'Sorry, but we were unable to save your changes as someone else made changes to this same source while you were editing.'
|
|
226
|
+
id: "ApiError.ConcurrentModificationBulkEdit",
|
|
227
|
+
defaultMessage: "Sorry, but we were unable to save your changes as someone else made changes to this same source while you were editing."
|
|
224
228
|
},
|
|
225
229
|
// API errors
|
|
226
230
|
ConcurrentModification: {
|
|
227
|
-
id:
|
|
228
|
-
|
|
229
|
-
defaultMessage: 'Sorry, but we were unable to save your changes as someone else made changes to this same source while you were editing. Please refresh the page and re-enter your changes.'
|
|
231
|
+
id: "ApiError.ConcurrentModification",
|
|
232
|
+
defaultMessage: "Sorry, but we were unable to save your changes as someone else made changes to this same source while you were editing. Please refresh the page and re-enter your changes."
|
|
230
233
|
},
|
|
231
234
|
DuplicateAttributeValue: {
|
|
232
|
-
id:
|
|
233
|
-
|
|
234
|
-
defaultMessage: 'This value has already been used for another variant. The "{name}" value must be unique for all variants for this product. Please enter a different value.'
|
|
235
|
+
id: "ApiError.DuplicateAttributeValue",
|
|
236
|
+
defaultMessage: "This value has already been used for another variant. The \"{name}\" value must be unique for all variants for this product. Please enter a different value."
|
|
235
237
|
},
|
|
236
238
|
DuplicateAttributeValues: {
|
|
237
|
-
id:
|
|
238
|
-
|
|
239
|
-
defaultMessage: 'This combination has already been used for another variant. The combination of these attributes must be unique across all variants. Please enter a different version.'
|
|
239
|
+
id: "ApiError.DuplicateAttributeValues",
|
|
240
|
+
defaultMessage: "This combination has already been used for another variant. The combination of these attributes must be unique across all variants. Please enter a different version."
|
|
240
241
|
},
|
|
241
242
|
DuplicateField: {
|
|
242
|
-
id:
|
|
243
|
-
|
|
244
|
-
defaultMessage: 'The value for the field "{field}" has already been used. Please choose another value for this field.'
|
|
243
|
+
id: "ApiError.DuplicateField",
|
|
244
|
+
defaultMessage: "The value for the field \"{field}\" has already been used. Please choose another value for this field."
|
|
245
245
|
},
|
|
246
246
|
DuplicateSlug: {
|
|
247
|
-
id:
|
|
248
|
-
|
|
249
|
-
defaultMessage: '"{slugValue}" is already in use. Please enter a new slug value for this product.'
|
|
247
|
+
id: "ApiError.DuplicateSlug",
|
|
248
|
+
defaultMessage: "\"{slugValue}\" is already in use. Please enter a new slug value for this product."
|
|
250
249
|
},
|
|
251
250
|
DuplicatePriceScope: {
|
|
252
|
-
id:
|
|
253
|
-
|
|
254
|
-
defaultMessage: 'A price with the same scope already exists for this product variant. Make sure that the combination of currency, country, customer group, channel and valid dates is unique per price.'
|
|
251
|
+
id: "ApiError.DuplicatePriceScope",
|
|
252
|
+
defaultMessage: "A price with the same scope already exists for this product variant. Make sure that the combination of currency, country, customer group, channel and valid dates is unique per price."
|
|
255
253
|
},
|
|
256
254
|
DuplicateStandalonePriceScope: {
|
|
257
|
-
id:
|
|
258
|
-
|
|
259
|
-
defaultMessage: 'A price with the same scope already exists for this product variant. The combination of currency, country, customer group, channel and validity date must be unique for each price per SKU.'
|
|
255
|
+
id: "ApiError.DuplicateStandalonePriceScope",
|
|
256
|
+
defaultMessage: "A price with the same scope already exists for this product variant. The combination of currency, country, customer group, channel and validity date must be unique for each price per SKU."
|
|
260
257
|
},
|
|
261
258
|
DuplicateVariantValues: {
|
|
262
|
-
id:
|
|
263
|
-
|
|
264
|
-
defaultMessage: 'The same variant already exists for this product. Please enter different values for the fields.'
|
|
259
|
+
id: "ApiError.DuplicateVariantValues",
|
|
260
|
+
defaultMessage: "The same variant already exists for this product. Please enter different values for the fields."
|
|
265
261
|
},
|
|
266
262
|
InvalidDateRange: {
|
|
267
|
-
id:
|
|
268
|
-
|
|
269
|
-
defaultMessage: 'The value entered for the field {field} is invalid. The start date must be before the end date'
|
|
263
|
+
id: "ApiError.InvalidDateRange",
|
|
264
|
+
defaultMessage: "The value entered for the field {field} is invalid. The start date must be before the end date"
|
|
270
265
|
},
|
|
271
266
|
InvalidField: {
|
|
272
|
-
id:
|
|
273
|
-
|
|
274
|
-
defaultMessage: 'The value entered is not valid for the field "{field}".'
|
|
267
|
+
id: "ApiError.InvalidField",
|
|
268
|
+
defaultMessage: "The value entered is not valid for the field \"{field}\"."
|
|
275
269
|
},
|
|
276
270
|
InvalidSlug: {
|
|
277
|
-
id:
|
|
278
|
-
|
|
279
|
-
defaultMessage: 'Slugs may only contain alphanumeric (0-9A-Z) characters, underscores and hyphens and must have a length between 2 and 256 characters.'
|
|
271
|
+
id: "ApiError.InvalidSlug",
|
|
272
|
+
defaultMessage: "Slugs may only contain alphanumeric (0-9A-Z) characters, underscores and hyphens and must have a length between 2 and 256 characters."
|
|
280
273
|
},
|
|
281
274
|
OverlappingPriceValidity: {
|
|
282
|
-
id:
|
|
283
|
-
|
|
284
|
-
defaultMessage: 'Another price with overlapping validity dates exists. Each price combination needs to have unique validity dates.'
|
|
275
|
+
id: "ApiError.OverlappingPriceValidity",
|
|
276
|
+
defaultMessage: "Another price with overlapping validity dates exists. Each price combination needs to have unique validity dates."
|
|
285
277
|
},
|
|
286
278
|
OverlappingStandalonePriceValidity: {
|
|
287
|
-
id:
|
|
288
|
-
|
|
289
|
-
defaultMessage: 'Another price with overlapping validity dates exists. Each price combination needs to have unique validity dates.'
|
|
279
|
+
id: "ApiError.OverlappingStandalonePriceValidity",
|
|
280
|
+
defaultMessage: "Another price with overlapping validity dates exists. Each price combination needs to have unique validity dates."
|
|
290
281
|
},
|
|
291
282
|
PendingOperation: {
|
|
292
|
-
id:
|
|
293
|
-
|
|
294
|
-
defaultMessage: 'Sorry, but we are still processing the previous request. Please try again once it is complete.'
|
|
283
|
+
id: "ApiError.PendingOperation",
|
|
284
|
+
defaultMessage: "Sorry, but we are still processing the previous request. Please try again once it is complete."
|
|
295
285
|
},
|
|
296
286
|
ResourceNotFound: {
|
|
297
|
-
id:
|
|
298
|
-
|
|
299
|
-
defaultMessage: 'Sorry, but we cannot find what you are looking for.'
|
|
287
|
+
id: "ApiError.ResourceNotFound",
|
|
288
|
+
defaultMessage: "Sorry, but we cannot find what you are looking for."
|
|
300
289
|
},
|
|
301
290
|
ReferenceExists: {
|
|
302
|
-
id:
|
|
303
|
-
|
|
304
|
-
defaultMessage: 'Can not delete a source while it is referenced from at least one "{referencedBy}".'
|
|
291
|
+
id: "ApiError.ReferenceExists",
|
|
292
|
+
defaultMessage: "Can not delete a source while it is referenced from at least one \"{referencedBy}\"."
|
|
305
293
|
},
|
|
306
294
|
RequiredField: {
|
|
307
|
-
id:
|
|
308
|
-
|
|
309
|
-
defaultMessage: '"{field}" is a required field. Please enter a value.'
|
|
295
|
+
id: "ApiError.RequiredField",
|
|
296
|
+
defaultMessage: "\"{field}\" is a required field. Please enter a value."
|
|
310
297
|
},
|
|
311
298
|
RequiredFields: {
|
|
312
299
|
// Client side validation
|
|
313
|
-
id:
|
|
314
|
-
|
|
315
|
-
defaultMessage: 'Please enter values for the following required fields: {fields}'
|
|
300
|
+
id: "ApiError.RequiredFields",
|
|
301
|
+
defaultMessage: "Please enter values for the following required fields: {fields}"
|
|
316
302
|
},
|
|
317
303
|
SemanticError: {
|
|
318
|
-
id:
|
|
319
|
-
|
|
320
|
-
defaultMessage: 'Semantic error: the given Predicate is not valid. Please read the documentation to define a correct predicate.'
|
|
304
|
+
id: "ApiError.SemanticError",
|
|
305
|
+
defaultMessage: "Semantic error: the given Predicate is not valid. Please read the documentation to define a correct predicate."
|
|
321
306
|
},
|
|
322
307
|
SyntaxError: {
|
|
323
|
-
id:
|
|
324
|
-
|
|
325
|
-
defaultMessage: 'Syntax error: the given Predicate is not valid. Please read the documentation to define a correct predicate.'
|
|
308
|
+
id: "ApiError.SyntaxError",
|
|
309
|
+
defaultMessage: "Syntax error: the given Predicate is not valid. Please read the documentation to define a correct predicate."
|
|
326
310
|
},
|
|
327
311
|
Unauthorized: {
|
|
328
|
-
id:
|
|
329
|
-
|
|
330
|
-
defaultMessage: 'Sorry, but you are not authorized to access this feature.'
|
|
312
|
+
id: "ApiError.Unauthorized",
|
|
313
|
+
defaultMessage: "Sorry, but you are not authorized to access this feature."
|
|
331
314
|
},
|
|
332
315
|
Forbidden: {
|
|
333
|
-
id:
|
|
334
|
-
|
|
335
|
-
defaultMessage: 'You are not authorized to access this feature. Please contact your system administrator with any further questions.'
|
|
316
|
+
id: "ApiError.Forbidden",
|
|
317
|
+
defaultMessage: "You are not authorized to access this feature. Please contact your system administrator with any further questions."
|
|
336
318
|
},
|
|
337
319
|
ExtensionNoResponse: {
|
|
338
|
-
id:
|
|
339
|
-
|
|
340
|
-
defaultMessage: 'Sorry, we could not perform the requested action due to an API extension not responding.'
|
|
320
|
+
id: "ApiError.ExtensionNoResponse",
|
|
321
|
+
defaultMessage: "Sorry, we could not perform the requested action due to an API extension not responding."
|
|
341
322
|
},
|
|
342
323
|
ExtensionBadResponse: {
|
|
343
|
-
id:
|
|
344
|
-
|
|
345
|
-
defaultMessage: 'Sorry, we could not perform the requested action due to failed processing of an API extension response.'
|
|
324
|
+
id: "ApiError.ExtensionBadResponse",
|
|
325
|
+
defaultMessage: "Sorry, we could not perform the requested action due to failed processing of an API extension response."
|
|
346
326
|
},
|
|
347
327
|
ExtensionUpdateActionsFailed: {
|
|
348
|
-
id:
|
|
349
|
-
|
|
350
|
-
defaultMessage: 'Sorry, we could not perform the requested action. It is not possible to perform the update actions as instructed by the API extension.'
|
|
328
|
+
id: "ApiError.ExtensionUpdateActionsFailed",
|
|
329
|
+
defaultMessage: "Sorry, we could not perform the requested action. It is not possible to perform the update actions as instructed by the API extension."
|
|
351
330
|
},
|
|
352
331
|
TaxCategoryDuplicateCountry: {
|
|
353
|
-
id:
|
|
354
|
-
|
|
355
|
-
defaultMessage: 'Duplicate tax rates submitted. Please remove the duplicates.'
|
|
332
|
+
id: "ApiError.TaxCategoryDuplicateCountry",
|
|
333
|
+
defaultMessage: "Duplicate tax rates submitted. Please remove the duplicates."
|
|
356
334
|
},
|
|
357
335
|
MaxResourceLimitExceeded: {
|
|
358
|
-
id:
|
|
359
|
-
|
|
360
|
-
defaultMessage: 'The project reached the limit for the resource. To add more resources delete existing ones or reach out to the administrator or contact customer support.'
|
|
336
|
+
id: "ApiError.MaxResourceLimitExceeded",
|
|
337
|
+
defaultMessage: "The project reached the limit for the resource. To add more resources delete existing ones or reach out to the administrator or contact customer support."
|
|
361
338
|
}
|
|
362
339
|
});
|
|
363
340
|
|
|
@@ -594,7 +571,7 @@ const selectGlobalNotifications = createSelector(selectNotifications, notificati
|
|
|
594
571
|
const selectPageNotifications = createSelector(selectNotifications, notifications => _filterInstanceProperty(notifications).call(notifications, notification => notification.domain === NOTIFICATION_DOMAINS.PAGE));
|
|
595
572
|
const selectSideNotifications = createSelector(selectNotifications, notifications => _filterInstanceProperty(notifications).call(notifications, notification => notification.domain === NOTIFICATION_DOMAINS.SIDE));
|
|
596
573
|
|
|
597
|
-
const _excluded = ["values"],
|
|
574
|
+
const _excluded$1 = ["values"],
|
|
598
575
|
_excluded2 = ["text"],
|
|
599
576
|
_excluded3 = ["values"],
|
|
600
577
|
_excluded4 = ["text"],
|
|
@@ -626,7 +603,7 @@ const NotificationsListGlobal = props => {
|
|
|
626
603
|
case NOTIFICATION_KINDS_GLOBAL.success:
|
|
627
604
|
{
|
|
628
605
|
_valuesInstanceProperty(notification);
|
|
629
|
-
const genericNotification = _objectWithoutProperties(notification, _excluded);
|
|
606
|
+
const genericNotification = _objectWithoutProperties(notification, _excluded$1);
|
|
630
607
|
return jsx(GenericNotification, {
|
|
631
608
|
notification: genericNotification,
|
|
632
609
|
dismiss: () => {
|
|
@@ -773,18 +750,20 @@ const NotificationsList = props => {
|
|
|
773
750
|
};
|
|
774
751
|
NotificationsList.displayName = 'NotificationsList';
|
|
775
752
|
|
|
753
|
+
const _excluded = ["domain", "kind"];
|
|
776
754
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
777
755
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
778
|
-
const
|
|
779
|
-
domain
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
756
|
+
const Notifier = _ref => {
|
|
757
|
+
let _ref$domain = _ref.domain,
|
|
758
|
+
domain = _ref$domain === void 0 ? NOTIFICATION_DOMAINS.SIDE : _ref$domain,
|
|
759
|
+
_ref$kind = _ref.kind,
|
|
760
|
+
kind = _ref$kind === void 0 ? NOTIFICATION_KINDS_SIDE.success : _ref$kind,
|
|
761
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
783
762
|
const showNotification = useShowNotification();
|
|
784
763
|
useEffect(() => {
|
|
785
764
|
const notification = showNotification({
|
|
786
|
-
domain:
|
|
787
|
-
kind:
|
|
765
|
+
domain: domain,
|
|
766
|
+
kind: kind,
|
|
788
767
|
text: props.text
|
|
789
768
|
}, isNumber(props.dismissAfter) ? _objectSpread(_objectSpread({}, props.meta), {}, {
|
|
790
769
|
dismissAfter: props.dismissAfter
|
|
@@ -806,6 +785,5 @@ Notifier.propTypes = {
|
|
|
806
785
|
dismissAfter: _pt.number
|
|
807
786
|
};
|
|
808
787
|
Notifier.displayName = 'Notifier';
|
|
809
|
-
Notifier.defaultProps = defaultProps;
|
|
810
788
|
|
|
811
789
|
export { ApiErrorMessage, Notification, NotificationProviderForCustomComponent, NotificationsList, Notifier, selectGlobalNotifications, selectPageNotifications, selectSideNotifications, version };
|
|
@@ -3,13 +3,12 @@ import type { TAppNotificationKind, TAppNotificationDomain } from '@commercetool
|
|
|
3
3
|
export type Props = {
|
|
4
4
|
domain: TAppNotificationDomain;
|
|
5
5
|
type: TAppNotificationKind;
|
|
6
|
-
fixed
|
|
6
|
+
fixed?: boolean;
|
|
7
7
|
onCloseClick?: (event: SyntheticEvent) => void;
|
|
8
8
|
children: ReactNode;
|
|
9
9
|
};
|
|
10
10
|
declare const Notification: {
|
|
11
|
-
(props: Props): import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
|
|
11
|
+
({ fixed, ...props }: Props): import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
|
|
12
12
|
displayName: string;
|
|
13
|
-
defaultProps: Pick<Props, "fixed">;
|
|
14
13
|
};
|
|
15
14
|
export default Notification;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/react-notifications",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.38.0",
|
|
4
4
|
"description": "React bindings for @commercetools-frontend/notifications",
|
|
5
5
|
"bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
6
|
"repository": {
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@babel/runtime": "^7.22.15",
|
|
32
32
|
"@babel/runtime-corejs3": "^7.22.15",
|
|
33
|
-
"@commercetools-frontend/actions-global": "22.
|
|
34
|
-
"@commercetools-frontend/application-components": "22.
|
|
35
|
-
"@commercetools-frontend/constants": "22.
|
|
36
|
-
"@commercetools-frontend/notifications": "22.
|
|
37
|
-
"@commercetools-frontend/sentry": "22.
|
|
33
|
+
"@commercetools-frontend/actions-global": "22.38.0",
|
|
34
|
+
"@commercetools-frontend/application-components": "22.38.0",
|
|
35
|
+
"@commercetools-frontend/constants": "22.38.0",
|
|
36
|
+
"@commercetools-frontend/notifications": "22.38.0",
|
|
37
|
+
"@commercetools-frontend/sentry": "22.38.0",
|
|
38
38
|
"@commercetools-uikit/design-system": "^19.17.1",
|
|
39
39
|
"@commercetools-uikit/hooks": "^19.17.1",
|
|
40
40
|
"@commercetools-uikit/icon-button": "^19.17.1",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@types/history": "^4.7.11",
|
|
48
48
|
"@types/lodash": "^4.14.198",
|
|
49
49
|
"@types/prop-types": "^15.7.5",
|
|
50
|
-
"@types/react": "^17.0.
|
|
50
|
+
"@types/react": "^17.0.83",
|
|
51
51
|
"@types/react-dom": "^17.0.19",
|
|
52
52
|
"@types/react-redux": "^7.1.26",
|
|
53
53
|
"@types/react-router": "^5.1.20",
|