@commercetools-frontend/react-notifications 22.0.0 → 22.1.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.d.ts +1 -0
- package/dist/commercetools-frontend-react-notifications.cjs.d.ts.map +1 -0
- package/dist/commercetools-frontend-react-notifications.cjs.dev.js +14 -4
- package/dist/commercetools-frontend-react-notifications.cjs.prod.js +14 -4
- package/dist/commercetools-frontend-react-notifications.esm.js +14 -4
- package/dist/declarations/src/components/notifications-list/selectors.d.ts +3 -3
- package/package.json +6 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commercetools-frontend-react-notifications.cjs.d.ts","sourceRoot":"","sources":["./declarations/src/index.d.ts"],"names":[],"mappings":"AAAA"}
|
|
@@ -64,7 +64,7 @@ var _sliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_sliceInstanc
|
|
|
64
64
|
var isNumber__default = /*#__PURE__*/_interopDefault(isNumber);
|
|
65
65
|
|
|
66
66
|
// NOTE: This string will be replaced on build time with the package version.
|
|
67
|
-
var version = "22.
|
|
67
|
+
var version = "22.1.0";
|
|
68
68
|
|
|
69
69
|
const Context = /*#__PURE__*/react.createContext(() => null);
|
|
70
70
|
|
|
@@ -502,9 +502,19 @@ function getSpecialFormattedMessageByErrorCode(error, intl) {
|
|
|
502
502
|
if (!extensionErrorCode || extensionErrorCode === 'InvalidInput') return intl.formatMessage(apiErrorMessages.General); // TODO: this is a temporary solution until we have proper pages about 403
|
|
503
503
|
|
|
504
504
|
if (extensionErrorCode === 'insufficient_scope') return intl.formatMessage(apiErrorMessages.Forbidden);
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
505
|
+
|
|
506
|
+
if (extensionErrorCode === 'DuplicateField') {
|
|
507
|
+
if (error.field === 'slug') {
|
|
508
|
+
return intl.formatMessage(apiErrorMessages.DuplicateSlug, {
|
|
509
|
+
slugValue: error.duplicateValue
|
|
510
|
+
});
|
|
511
|
+
} else {
|
|
512
|
+
return intl.formatMessage(apiErrorMessages.DuplicateField, {
|
|
513
|
+
field: error.field
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
} // Try to match the error with a custom error message
|
|
517
|
+
|
|
508
518
|
|
|
509
519
|
if (has__default["default"](error, 'invalidValue') && has__default["default"](error.invalidValue, 'overlappingPrices')) return intl.formatMessage(apiErrorMessages.OverlappingPrices);
|
|
510
520
|
|
|
@@ -64,7 +64,7 @@ var _sliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_sliceInstanc
|
|
|
64
64
|
var isNumber__default = /*#__PURE__*/_interopDefault(isNumber);
|
|
65
65
|
|
|
66
66
|
// NOTE: This string will be replaced on build time with the package version.
|
|
67
|
-
var version = "22.
|
|
67
|
+
var version = "22.1.0";
|
|
68
68
|
|
|
69
69
|
const Context = /*#__PURE__*/react.createContext(() => null);
|
|
70
70
|
|
|
@@ -487,9 +487,19 @@ function getSpecialFormattedMessageByErrorCode(error, intl) {
|
|
|
487
487
|
if (!extensionErrorCode || extensionErrorCode === 'InvalidInput') return intl.formatMessage(apiErrorMessages.General); // TODO: this is a temporary solution until we have proper pages about 403
|
|
488
488
|
|
|
489
489
|
if (extensionErrorCode === 'insufficient_scope') return intl.formatMessage(apiErrorMessages.Forbidden);
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
490
|
+
|
|
491
|
+
if (extensionErrorCode === 'DuplicateField') {
|
|
492
|
+
if (error.field === 'slug') {
|
|
493
|
+
return intl.formatMessage(apiErrorMessages.DuplicateSlug, {
|
|
494
|
+
slugValue: error.duplicateValue
|
|
495
|
+
});
|
|
496
|
+
} else {
|
|
497
|
+
return intl.formatMessage(apiErrorMessages.DuplicateField, {
|
|
498
|
+
field: error.field
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
} // Try to match the error with a custom error message
|
|
502
|
+
|
|
493
503
|
|
|
494
504
|
if (has__default["default"](error, 'invalidValue') && has__default["default"](error.invalidValue, 'overlappingPrices')) return intl.formatMessage(apiErrorMessages.OverlappingPrices);
|
|
495
505
|
|
|
@@ -37,7 +37,7 @@ import isNumber from 'lodash/isNumber';
|
|
|
37
37
|
import { useShowNotification } from '@commercetools-frontend/actions-global';
|
|
38
38
|
|
|
39
39
|
// NOTE: This string will be replaced on build time with the package version.
|
|
40
|
-
var version = "22.
|
|
40
|
+
var version = "22.1.0";
|
|
41
41
|
|
|
42
42
|
const Context = /*#__PURE__*/createContext(() => null);
|
|
43
43
|
|
|
@@ -475,9 +475,19 @@ function getSpecialFormattedMessageByErrorCode(error, intl) {
|
|
|
475
475
|
if (!extensionErrorCode || extensionErrorCode === 'InvalidInput') return intl.formatMessage(apiErrorMessages.General); // TODO: this is a temporary solution until we have proper pages about 403
|
|
476
476
|
|
|
477
477
|
if (extensionErrorCode === 'insufficient_scope') return intl.formatMessage(apiErrorMessages.Forbidden);
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
478
|
+
|
|
479
|
+
if (extensionErrorCode === 'DuplicateField') {
|
|
480
|
+
if (error.field === 'slug') {
|
|
481
|
+
return intl.formatMessage(apiErrorMessages.DuplicateSlug, {
|
|
482
|
+
slugValue: error.duplicateValue
|
|
483
|
+
});
|
|
484
|
+
} else {
|
|
485
|
+
return intl.formatMessage(apiErrorMessages.DuplicateField, {
|
|
486
|
+
field: error.field
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
} // Try to match the error with a custom error message
|
|
490
|
+
|
|
481
491
|
|
|
482
492
|
if (has(error, 'invalidValue') && has(error.invalidValue, 'overlappingPrices')) return intl.formatMessage(apiErrorMessages.OverlappingPrices);
|
|
483
493
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type { TAppNotificationGlobal, TAppNotificationPage, TAppNotificationSide } from '@commercetools-frontend/constants';
|
|
2
2
|
import type { TAppState } from './types';
|
|
3
3
|
export declare const selectNotifications: (state: TAppState) => (TAppNotificationGlobal | TAppNotificationPage | TAppNotificationSide)[];
|
|
4
|
-
export declare const selectGlobalNotifications: ((state: TAppState) => TAppNotificationGlobal[]) & import("reselect").OutputSelectorFields<(args_0: (TAppNotificationGlobal | TAppNotificationPage | TAppNotificationSide)[]) => TAppNotificationGlobal[]
|
|
4
|
+
export declare const selectGlobalNotifications: ((state: TAppState) => TAppNotificationGlobal[]) & import("reselect").OutputSelectorFields<(args_0: (TAppNotificationGlobal | TAppNotificationPage | TAppNotificationSide)[]) => TAppNotificationGlobal[], {
|
|
5
5
|
clearCache: () => void;
|
|
6
6
|
}> & {
|
|
7
7
|
clearCache: () => void;
|
|
8
8
|
};
|
|
9
|
-
export declare const selectPageNotifications: ((state: TAppState) => TAppNotificationPage[]) & import("reselect").OutputSelectorFields<(args_0: (TAppNotificationGlobal | TAppNotificationPage | TAppNotificationSide)[]) => TAppNotificationPage[]
|
|
9
|
+
export declare const selectPageNotifications: ((state: TAppState) => TAppNotificationPage[]) & import("reselect").OutputSelectorFields<(args_0: (TAppNotificationGlobal | TAppNotificationPage | TAppNotificationSide)[]) => TAppNotificationPage[], {
|
|
10
10
|
clearCache: () => void;
|
|
11
11
|
}> & {
|
|
12
12
|
clearCache: () => void;
|
|
13
13
|
};
|
|
14
|
-
export declare const selectSideNotifications: ((state: TAppState) => TAppNotificationSide[]) & import("reselect").OutputSelectorFields<(args_0: (TAppNotificationGlobal | TAppNotificationPage | TAppNotificationSide)[]) => TAppNotificationSide[]
|
|
14
|
+
export declare const selectSideNotifications: ((state: TAppState) => TAppNotificationSide[]) & import("reselect").OutputSelectorFields<(args_0: (TAppNotificationGlobal | TAppNotificationPage | TAppNotificationSide)[]) => TAppNotificationSide[], {
|
|
15
15
|
clearCache: () => void;
|
|
16
16
|
}> & {
|
|
17
17
|
clearCache: () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/react-notifications",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.1.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": {
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@babel/runtime": "^7.20.13",
|
|
22
22
|
"@babel/runtime-corejs3": "^7.20.13",
|
|
23
|
-
"@commercetools-frontend/actions-global": "22.
|
|
24
|
-
"@commercetools-frontend/constants": "22.
|
|
25
|
-
"@commercetools-frontend/notifications": "22.
|
|
26
|
-
"@commercetools-frontend/sentry": "22.
|
|
23
|
+
"@commercetools-frontend/actions-global": "22.1.0",
|
|
24
|
+
"@commercetools-frontend/constants": "22.1.0",
|
|
25
|
+
"@commercetools-frontend/notifications": "22.1.0",
|
|
26
|
+
"@commercetools-frontend/sentry": "22.1.0",
|
|
27
27
|
"@commercetools-uikit/design-system": "^16.0.0",
|
|
28
28
|
"@commercetools-uikit/hooks": "^16.0.0",
|
|
29
29
|
"@commercetools-uikit/icon-button": "^16.0.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"moment": "^2.29.4",
|
|
46
46
|
"moment-timezone": "^0.5.40",
|
|
47
47
|
"prop-types": "15.8.1",
|
|
48
|
-
"reselect": "4.1.
|
|
48
|
+
"reselect": "4.1.8"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@testing-library/react": "12.1.5",
|