@bigbinary/neeto-image-uploader-frontend 2.2.2 → 2.2.3
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/AssetLibrary.js +2 -18
- package/dist/AssetLibrary.js.map +1 -1
- package/dist/cjs/AssetLibrary.js +1 -17
- package/dist/cjs/AssetLibrary.js.map +1 -1
- package/package.json +27 -27
package/dist/cjs/AssetLibrary.js
CHANGED
|
@@ -642,21 +642,6 @@ function _typeof$1(o) {
|
|
|
642
642
|
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
643
643
|
}, _typeof$1(o);
|
|
644
644
|
}
|
|
645
|
-
|
|
646
|
-
var hasPermission = function hasPermission() {
|
|
647
|
-
var _globalProps$permissi;
|
|
648
|
-
var permissions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
649
|
-
var type = _typeof$1(permissions);
|
|
650
|
-
var userPermissions = (_globalProps$permissi = initializers.globalProps.permissions) !== null && _globalProps$permissi !== void 0 ? _globalProps$permissi : [];
|
|
651
|
-
if (Object.is(type, "string")) {
|
|
652
|
-
return userPermissions.includes(permissions);
|
|
653
|
-
} else if (Array.isArray(permissions)) {
|
|
654
|
-
return permissions.some(function (permission) {
|
|
655
|
-
return userPermissions.includes(permission);
|
|
656
|
-
});
|
|
657
|
-
}
|
|
658
|
-
return false;
|
|
659
|
-
};
|
|
660
645
|
var isOverflown = function isOverflown(_ref) {
|
|
661
646
|
var clientWidth = _ref.clientWidth,
|
|
662
647
|
clientHeight = _ref.clientHeight,
|
|
@@ -9757,7 +9742,6 @@ var InfiniteScroller = function InfiniteScroller(_ref) {
|
|
|
9757
9742
|
var _useBulkDestroyAssets = useBulkDestroyAssets(utils$3.ASSETS_DESTROY_URL),
|
|
9758
9743
|
isPending = _useBulkDestroyAssets.isPending,
|
|
9759
9744
|
bulkDelete = _useBulkDestroyAssets.mutate;
|
|
9760
|
-
var hasPermissioToDeleteImage = hasPermission(VIEW_ROLES_PERMISSION);
|
|
9761
9745
|
var handleDelete = require$$0.useCallback(function () {
|
|
9762
9746
|
bulkDelete(deleteConfirmation.imageIds, {
|
|
9763
9747
|
onSuccess: function onSuccess() {
|
|
@@ -9812,7 +9796,7 @@ var InfiniteScroller = function InfiniteScroller(_ref) {
|
|
|
9812
9796
|
children: [image === null || image === void 0 || (_image$user2 = image.user) === null || _image$user2 === void 0 ? void 0 : _image$user2.name, " | ", " ", t("neetoImageUploader.labels.unsplash")]
|
|
9813
9797
|
})]
|
|
9814
9798
|
}), tab === utils$3.TABS[0].key && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
9815
|
-
children: [
|
|
9799
|
+
children: [utils$4.hasPermission(VIEW_ROLES_PERMISSION) && /*#__PURE__*/jsxRuntime.jsx(Dropdown__default["default"], {
|
|
9816
9800
|
buttonSize: "small",
|
|
9817
9801
|
buttonStyle: "tertiary",
|
|
9818
9802
|
"data-cy": "image-library-image-options-".concat(index),
|