@webiny/app-admin 5.37.8 → 5.38.0-beta.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/assets/icons/file_download.svg +1 -0
- package/assets/icons/file_upload.svg +1 -0
- package/base/Admin.js +3 -1
- package/base/Base.js +3 -1
- package/base/plugins/AddGraphQLQuerySelection.js +3 -1
- package/base/providers/ApolloProvider.js +3 -1
- package/base/providers/TelemetryProvider.js +3 -1
- package/base/providers/UiStateProvider.js +3 -1
- package/base/providers/ViewCompositionProvider.js +3 -1
- package/base/ui/Brand.js +3 -1
- package/base/ui/CenteredView.js +3 -1
- package/base/ui/Dashboard.js +3 -1
- package/base/ui/FileManager.js +3 -1
- package/base/ui/Layout.js +3 -1
- package/base/ui/LocaleSelector.js +3 -1
- package/base/ui/LoginScreen.js +3 -1
- package/base/ui/Logo.js +3 -1
- package/base/ui/Menu.js +3 -1
- package/base/ui/Navigation.js +3 -1
- package/base/ui/NotFound.js +3 -1
- package/base/ui/Search.js +3 -1
- package/base/ui/Tags.js +3 -1
- package/base/ui/UserMenu.js +3 -1
- package/components/AdminLayout.js +3 -1
- package/components/AppInstaller/AppInstaller.js +3 -1
- package/components/AppInstaller/Sidebar.js +3 -1
- package/components/AppInstaller/index.js +3 -1
- package/components/AppInstaller/styled.js +3 -1
- package/components/AppInstaller/useInstaller.js +3 -1
- package/components/BulkActions/Worker.d.ts +81 -0
- package/components/BulkActions/Worker.js +220 -0
- package/components/BulkActions/Worker.js.map +1 -0
- package/components/BulkActions/index.d.ts +2 -0
- package/components/BulkActions/index.js +29 -0
- package/components/BulkActions/index.js.map +1 -0
- package/components/BulkActions/useDialogWithReport/DialogMessage.d.ts +5 -0
- package/components/BulkActions/useDialogWithReport/DialogMessage.js +31 -0
- package/components/BulkActions/useDialogWithReport/DialogMessage.js.map +1 -0
- package/components/BulkActions/useDialogWithReport/index.d.ts +1 -0
- package/components/BulkActions/useDialogWithReport/index.js +18 -0
- package/components/BulkActions/useDialogWithReport/index.js.map +1 -0
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.d.ts +17 -0
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.js +96 -0
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.js.map +1 -0
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.styled.d.ts +22 -0
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.styled.js +28 -0
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.styled.js.map +1 -0
- package/components/Buttons/Buttons.d.ts +4 -1
- package/components/Buttons/Buttons.js +22 -3
- package/components/Buttons/Buttons.js.map +1 -1
- package/components/Buttons/Buttons.styles.js +3 -1
- package/components/Buttons/index.d.ts +1 -1
- package/components/Buttons/index.js +9 -1
- package/components/Buttons/index.js.map +1 -1
- package/components/Buttons/useButtons.js +3 -1
- package/components/EmptyView.js +3 -1
- package/components/Filters/Filters.d.ts +1 -0
- package/components/Filters/Filters.js +5 -3
- package/components/Filters/Filters.js.map +1 -1
- package/components/Filters/{Filters.styles.js → Filters.styled.js} +7 -5
- package/components/Filters/Filters.styled.js.map +1 -0
- package/components/Filters/index.js +3 -1
- package/components/FloatingActionButton.js +3 -1
- package/components/LexicalEditor/LexicalEditor.js +3 -1
- package/components/LexicalEditor/index.js +3 -1
- package/components/MultiImageUpload.js +3 -1
- package/components/OptionsMenu/OptionsMenu.js +3 -1
- package/components/OptionsMenu/OptionsMenu.styles.d.ts +7 -4
- package/components/OptionsMenu/OptionsMenu.styles.js +3 -1
- package/components/OptionsMenu/OptionsMenuItem.js +3 -1
- package/components/OptionsMenu/index.js +3 -1
- package/components/OptionsMenu/useOptionsMenuItem.js +3 -1
- package/components/OverlayLayout/OverlayLayout.js +3 -1
- package/components/OverlayLayout/index.js +3 -1
- package/components/Permissions/CannotUseAaclAlert.js +3 -1
- package/components/Permissions/Permissions.js +3 -1
- package/components/Permissions/StyledComponents.js +3 -1
- package/components/Permissions/index.js +3 -1
- package/components/RichTextEditor/RichTextEditor.js +3 -1
- package/components/RichTextEditor/index.js +3 -1
- package/components/RichTextEditor/tools/header/index.js +3 -1
- package/components/RichTextEditor/tools/image/index.js +3 -1
- package/components/RichTextEditor/tools/image/svgs.js +3 -1
- package/components/RichTextEditor/tools/image/tunes.js +3 -1
- package/components/RichTextEditor/tools/image/types.js +3 -1
- package/components/RichTextEditor/tools/image/ui.js +3 -1
- package/components/RichTextEditor/tools/paragraph/index.js +3 -1
- package/components/RichTextEditor/tools/textColor/index.js +3 -1
- package/components/RichTextEditor/tools/utils.js +3 -1
- package/components/Routes.js +3 -1
- package/components/SearchUI.js +3 -1
- package/components/SimpleForm/SimpleForm.d.ts +1 -1
- package/components/SimpleForm/SimpleForm.js +3 -1
- package/components/SimpleForm/SimpleForm.js.map +1 -1
- package/components/SimpleForm/index.js +3 -1
- package/components/SimpleUI/InputField.js +3 -1
- package/components/SingleImageUpload.js +3 -1
- package/components/SplitView/SplitView.js +3 -1
- package/components/SplitView/index.js +3 -1
- package/components/index.js +3 -1
- package/hooks/index.d.ts +3 -0
- package/hooks/index.js +40 -0
- package/hooks/index.js.map +1 -0
- package/hooks/useConfirmationDialog.js +3 -1
- package/hooks/useDialog.js +3 -1
- package/hooks/useSnackbar.js +3 -1
- package/index.d.ts +2 -3
- package/index.js +15 -25
- package/index.js.map +1 -1
- package/package.json +18 -17
- package/plugins/MenuPlugin.js +3 -1
- package/plugins/PermissionRendererPlugin.js +3 -1
- package/plugins/globalSearch/SearchBar.js +3 -1
- package/plugins/globalSearch/SearchBarDropdown.js +3 -1
- package/plugins/globalSearch/index.js +3 -1
- package/plugins/globalSearch/styled.js +3 -1
- package/plugins/uiLayoutRenderer/index.js +3 -1
- package/styles/material-theme-assignments.scss +1 -1
- package/types.js +3 -1
- package/ui/UIElement.js +3 -1
- package/ui/UILayout.js +3 -1
- package/ui/UIRenderer.js +3 -1
- package/ui/UIView.js +3 -1
- package/ui/elements/AccordionElement.js +3 -1
- package/ui/elements/ButtonElement.js +3 -1
- package/ui/elements/ButtonGroupElement.js +3 -1
- package/ui/elements/GenericElement.js +3 -1
- package/ui/elements/LabelElement.js +3 -1
- package/ui/elements/NavigationMenuElement.js +3 -1
- package/ui/elements/PanelElement.js +3 -1
- package/ui/elements/PlaceholderElement.js +3 -1
- package/ui/elements/SmallButtonElement.js +3 -1
- package/ui/elements/TypographyElement.js +3 -1
- package/ui/elements/ViewElement.js +3 -1
- package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.js +3 -1
- package/ui/elements/form/DynamicFieldsetElement.js +3 -1
- package/ui/elements/form/FileManagerElement/EmptyStateElement.js +3 -1
- package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.js +3 -1
- package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.js +3 -1
- package/ui/elements/form/FileManagerElement/styled.js +3 -1
- package/ui/elements/form/FileManagerElement.js +3 -1
- package/ui/elements/form/FormElement.js +3 -1
- package/ui/elements/form/FormFieldElement.js +3 -1
- package/ui/elements/form/HiddenElement.js +3 -1
- package/ui/elements/form/InputElement.js +3 -1
- package/ui/elements/form/PasswordElement.js +3 -1
- package/ui/elements/form/SelectElement.js +3 -1
- package/ui/elements/form/TextareaElement.js +3 -1
- package/ui/views/AdminView/ContentElement.js +3 -1
- package/ui/views/AdminView/HeaderElement.js +3 -1
- package/ui/views/AdminView/HeaderSectionCenterElement.js +3 -1
- package/ui/views/AdminView/HeaderSectionLeftElement.js +3 -1
- package/ui/views/AdminView/HeaderSectionRightElement.js +3 -1
- package/ui/views/AdminView/components/Dialog.js +3 -1
- package/ui/views/AdminView/components/Hamburger.js +3 -1
- package/ui/views/AdminView/components/Snackbar.js +3 -1
- package/ui/views/FormView/FormContainerElement.js +3 -1
- package/ui/views/FormView/FormContentElement.js +3 -1
- package/ui/views/FormView/FormFooterElement.js +3 -1
- package/ui/views/FormView/FormHeaderElement.js +3 -1
- package/ui/views/FormView.js +3 -1
- package/ui/views/OverlayView/ContentElement.js +3 -1
- package/ui/views/OverlayView/HeaderElement.js +3 -1
- package/ui/views/OverlayView/HeaderTitleElement.js +3 -1
- package/ui/views/OverlayView/useOverlayView.js +3 -1
- package/ui/views/OverlayView.js +3 -1
- package/ui/views/SplitView/SplitViewPanelElement.js +3 -1
- package/ui/views/SplitView.js +3 -1
- package/components/Filters/Filters.styles.js.map +0 -1
- /package/components/Filters/{Filters.styles.d.ts → Filters.styled.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><g><rect fill="none" height="24" width="24"/></g><g><path d="M16.59,9H15V4c0-0.55-0.45-1-1-1h-4C9.45,3,9,3.45,9,4v5H7.41c-0.89,0-1.34,1.08-0.71,1.71l4.59,4.59 c0.39,0.39,1.02,0.39,1.41,0l4.59-4.59C17.92,10.08,17.48,9,16.59,9z M5,19c0,0.55,0.45,1,1,1h12c0.55,0,1-0.45,1-1s-0.45-1-1-1H6 C5.45,18,5,18.45,5,19z"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><g><rect fill="none" height="24" width="24"/></g><g><path d="M7.4,10h1.59v5c0,0.55,0.45,1,1,1h4c0.55,0,1-0.45,1-1v-5h1.59c0.89,0,1.34-1.08,0.71-1.71L12.7,3.7 c-0.39-0.39-1.02-0.39-1.41,0L6.7,8.29C6.07,8.92,6.51,10,7.4,10z M5,19c0,0.55,0.45,1,1,1h12c0.55,0,1-0.45,1-1s-0.45-1-1-1H6 C5.45,18,5,18.45,5,19z"/></g></svg>
|
package/base/Admin.js
CHANGED
package/base/Base.js
CHANGED
|
@@ -72,4 +72,6 @@ var BaseExtension = function BaseExtension() {
|
|
|
72
72
|
}, /*#__PURE__*/_react.default.createElement(_.NotFound, null))));
|
|
73
73
|
};
|
|
74
74
|
var Base = /*#__PURE__*/(0, _react.memo)(BaseExtension);
|
|
75
|
-
exports.Base = Base;
|
|
75
|
+
exports.Base = Base;
|
|
76
|
+
|
|
77
|
+
//# sourceMappingURL=Base.js.map
|
|
@@ -24,4 +24,6 @@ var AddGraphQLQuerySelection = function AddGraphQLQuerySelection(props) {
|
|
|
24
24
|
}, []);
|
|
25
25
|
return null;
|
|
26
26
|
};
|
|
27
|
-
exports.AddGraphQLQuerySelection = AddGraphQLQuerySelection;
|
|
27
|
+
exports.AddGraphQLQuerySelection = AddGraphQLQuerySelection;
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=AddGraphQLQuerySelection.js.map
|
|
@@ -54,4 +54,6 @@ var createViewCompositionProvider = function createViewCompositionProvider() {
|
|
|
54
54
|
};
|
|
55
55
|
};
|
|
56
56
|
};
|
|
57
|
-
exports.createViewCompositionProvider = createViewCompositionProvider;
|
|
57
|
+
exports.createViewCompositionProvider = createViewCompositionProvider;
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=ViewCompositionProvider.js.map
|
package/base/ui/Brand.js
CHANGED
|
@@ -12,4 +12,6 @@ var Brand = (0, _app.makeComposable)("Brand", function () {
|
|
|
12
12
|
});
|
|
13
13
|
exports.Brand = Brand;
|
|
14
14
|
var BrandRenderer = (0, _app.makeComposable)("BrandRenderer");
|
|
15
|
-
exports.BrandRenderer = BrandRenderer;
|
|
15
|
+
exports.BrandRenderer = BrandRenderer;
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=Brand.js.map
|
package/base/ui/CenteredView.js
CHANGED
package/base/ui/Dashboard.js
CHANGED
|
@@ -12,4 +12,6 @@ var Dashboard = (0, _app.makeComposable)("Dashboard", function () {
|
|
|
12
12
|
});
|
|
13
13
|
exports.Dashboard = Dashboard;
|
|
14
14
|
var DashboardRenderer = (0, _app.makeComposable)("DashboardRenderer");
|
|
15
|
-
exports.DashboardRenderer = DashboardRenderer;
|
|
15
|
+
exports.DashboardRenderer = DashboardRenderer;
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=Dashboard.js.map
|
package/base/ui/FileManager.js
CHANGED
package/base/ui/Layout.js
CHANGED
|
@@ -16,4 +16,6 @@ var Layout = (0, _app.makeComposable)("Layout", function (_ref) {
|
|
|
16
16
|
});
|
|
17
17
|
exports.Layout = Layout;
|
|
18
18
|
var LayoutRenderer = (0, _app.makeComposable)("LayoutRenderer");
|
|
19
|
-
exports.LayoutRenderer = LayoutRenderer;
|
|
19
|
+
exports.LayoutRenderer = LayoutRenderer;
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=Layout.js.map
|
|
@@ -12,4 +12,6 @@ var LocaleSelector = (0, _app.makeComposable)("LocaleSelector", function () {
|
|
|
12
12
|
});
|
|
13
13
|
exports.LocaleSelector = LocaleSelector;
|
|
14
14
|
var LocaleSelectorRenderer = (0, _app.makeComposable)("LocaleSelectorRenderer");
|
|
15
|
-
exports.LocaleSelectorRenderer = LocaleSelectorRenderer;
|
|
15
|
+
exports.LocaleSelectorRenderer = LocaleSelectorRenderer;
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=LocaleSelector.js.map
|
package/base/ui/LoginScreen.js
CHANGED
|
@@ -18,4 +18,6 @@ var LoginScreen = function LoginScreen(_ref) {
|
|
|
18
18
|
};
|
|
19
19
|
exports.LoginScreen = LoginScreen;
|
|
20
20
|
var LoginScreenRenderer = (0, _app.makeComposable)("LoginScreenRenderer");
|
|
21
|
-
exports.LoginScreenRenderer = LoginScreenRenderer;
|
|
21
|
+
exports.LoginScreenRenderer = LoginScreenRenderer;
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=LoginScreen.js.map
|
package/base/ui/Logo.js
CHANGED
package/base/ui/Menu.js
CHANGED
package/base/ui/Navigation.js
CHANGED
|
@@ -148,4 +148,6 @@ var MenuItem = function MenuItem() {
|
|
|
148
148
|
};
|
|
149
149
|
exports.MenuItem = MenuItem;
|
|
150
150
|
var MenuItemRenderer = (0, _app.makeComposable)("MenuItemRenderer");
|
|
151
|
-
exports.MenuItemRenderer = MenuItemRenderer;
|
|
151
|
+
exports.MenuItemRenderer = MenuItemRenderer;
|
|
152
|
+
|
|
153
|
+
//# sourceMappingURL=Navigation.js.map
|
package/base/ui/NotFound.js
CHANGED
|
@@ -12,4 +12,6 @@ var NotFound = (0, _app.makeComposable)("NotFound", function () {
|
|
|
12
12
|
});
|
|
13
13
|
exports.NotFound = NotFound;
|
|
14
14
|
var NotFoundRenderer = (0, _app.makeComposable)("NotFoundRenderer");
|
|
15
|
-
exports.NotFoundRenderer = NotFoundRenderer;
|
|
15
|
+
exports.NotFoundRenderer = NotFoundRenderer;
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=NotFound.js.map
|
package/base/ui/Search.js
CHANGED
package/base/ui/Tags.js
CHANGED
package/base/ui/UserMenu.js
CHANGED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export interface CallbackParams<T> {
|
|
2
|
+
item: T;
|
|
3
|
+
allItems: T[];
|
|
4
|
+
report: Report;
|
|
5
|
+
}
|
|
6
|
+
export interface Result {
|
|
7
|
+
title: string;
|
|
8
|
+
status: "success" | "failure";
|
|
9
|
+
message?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Class for collecting processing results
|
|
13
|
+
*/
|
|
14
|
+
export declare class Report {
|
|
15
|
+
private _results;
|
|
16
|
+
/**
|
|
17
|
+
* Record a successful result in the report
|
|
18
|
+
* @param {Omit<Result, "status">} result - The successful result to be recorded
|
|
19
|
+
*/
|
|
20
|
+
success(result: Omit<Result, "status">): void;
|
|
21
|
+
/**
|
|
22
|
+
* Record an error result in the report.
|
|
23
|
+
* @param {Omit<Result, "status">} result - The error result to be recorded.
|
|
24
|
+
*/
|
|
25
|
+
error(result: Omit<Result, "status">): void;
|
|
26
|
+
/**
|
|
27
|
+
* Get the array of recorded results.
|
|
28
|
+
* @returns {Result[]} - An array of recorded results.
|
|
29
|
+
*/
|
|
30
|
+
get results(): Result[];
|
|
31
|
+
/**
|
|
32
|
+
* Internal method to add a result to the report.
|
|
33
|
+
* @private
|
|
34
|
+
* @param {Result} result - The result to be added to the report.
|
|
35
|
+
*/
|
|
36
|
+
private addResult;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A generic worker class for processing items.
|
|
40
|
+
* @template T - The type of items being processed.
|
|
41
|
+
*/
|
|
42
|
+
export declare class Worker<T> {
|
|
43
|
+
private _items;
|
|
44
|
+
private _report;
|
|
45
|
+
constructor();
|
|
46
|
+
/**
|
|
47
|
+
* Process the items using the provided callback function.
|
|
48
|
+
* @param callback - The callback function to process the items.
|
|
49
|
+
*/
|
|
50
|
+
process(callback: (items: T[]) => void): void;
|
|
51
|
+
/**
|
|
52
|
+
* Process the items in series with the given chunk size.
|
|
53
|
+
* @param callback - The callback function to process each item.
|
|
54
|
+
* @param {number} [chunkSize=10] - The size of each chunk for processing in series.
|
|
55
|
+
* @returns {Promise<void>}
|
|
56
|
+
*/
|
|
57
|
+
processInSeries(callback: ({ item, allItems, report }: CallbackParams<T>) => Promise<void>, chunkSize?: number): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Get the array of results collected by the worker.
|
|
60
|
+
* @returns {Result[]} - An array of collected results.
|
|
61
|
+
*/
|
|
62
|
+
get results(): Result[];
|
|
63
|
+
/**
|
|
64
|
+
* Get the current items in the worker.
|
|
65
|
+
* @returns {T[]} - An array of items in the worker.
|
|
66
|
+
*/
|
|
67
|
+
get items(): T[];
|
|
68
|
+
/**
|
|
69
|
+
* Set the items in the worker.
|
|
70
|
+
* @param {T[]} items - The items to be set in the worker.
|
|
71
|
+
*/
|
|
72
|
+
set items(items: T[]);
|
|
73
|
+
/**
|
|
74
|
+
* Internal method to process a chunk of items using the provided callback.
|
|
75
|
+
* @private
|
|
76
|
+
* @param callback - The callback function to process each item.
|
|
77
|
+
* @param {T[]} chunk - The chunk of items to be processed.
|
|
78
|
+
* @returns {Promise<void>}
|
|
79
|
+
*/
|
|
80
|
+
private processChunk;
|
|
81
|
+
}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.Worker = exports.Report = void 0;
|
|
8
|
+
var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
|
|
9
|
+
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
12
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
+
var _chunk = _interopRequireDefault(require("lodash/chunk"));
|
|
16
|
+
var _mobx = require("mobx");
|
|
17
|
+
/**
|
|
18
|
+
* Class for collecting processing results
|
|
19
|
+
*/
|
|
20
|
+
var Report = /*#__PURE__*/function () {
|
|
21
|
+
function Report() {
|
|
22
|
+
(0, _classCallCheck2.default)(this, Report);
|
|
23
|
+
(0, _defineProperty2.default)(this, "_results", []);
|
|
24
|
+
}
|
|
25
|
+
(0, _createClass2.default)(Report, [{
|
|
26
|
+
key: "success",
|
|
27
|
+
value:
|
|
28
|
+
/**
|
|
29
|
+
* Record a successful result in the report
|
|
30
|
+
* @param {Omit<Result, "status">} result - The successful result to be recorded
|
|
31
|
+
*/
|
|
32
|
+
function success(result) {
|
|
33
|
+
this.addResult((0, _objectSpread2.default)((0, _objectSpread2.default)({}, result), {}, {
|
|
34
|
+
status: "success"
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Record an error result in the report.
|
|
40
|
+
* @param {Omit<Result, "status">} result - The error result to be recorded.
|
|
41
|
+
*/
|
|
42
|
+
}, {
|
|
43
|
+
key: "error",
|
|
44
|
+
value: function error(result) {
|
|
45
|
+
this.addResult((0, _objectSpread2.default)((0, _objectSpread2.default)({}, result), {}, {
|
|
46
|
+
status: "failure"
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Get the array of recorded results.
|
|
52
|
+
* @returns {Result[]} - An array of recorded results.
|
|
53
|
+
*/
|
|
54
|
+
}, {
|
|
55
|
+
key: "results",
|
|
56
|
+
get: function get() {
|
|
57
|
+
return this._results;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Internal method to add a result to the report.
|
|
62
|
+
* @private
|
|
63
|
+
* @param {Result} result - The result to be added to the report.
|
|
64
|
+
*/
|
|
65
|
+
}, {
|
|
66
|
+
key: "addResult",
|
|
67
|
+
value: function addResult(result) {
|
|
68
|
+
this._results.push(result);
|
|
69
|
+
}
|
|
70
|
+
}]);
|
|
71
|
+
return Report;
|
|
72
|
+
}();
|
|
73
|
+
/**
|
|
74
|
+
* A generic worker class for processing items.
|
|
75
|
+
* @template T - The type of items being processed.
|
|
76
|
+
*/
|
|
77
|
+
exports.Report = Report;
|
|
78
|
+
var Worker = /*#__PURE__*/function () {
|
|
79
|
+
function Worker() {
|
|
80
|
+
(0, _classCallCheck2.default)(this, Worker);
|
|
81
|
+
this._items = [];
|
|
82
|
+
this._report = new Report();
|
|
83
|
+
(0, _mobx.makeAutoObservable)(this);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Process the items using the provided callback function.
|
|
88
|
+
* @param callback - The callback function to process the items.
|
|
89
|
+
*/
|
|
90
|
+
(0, _createClass2.default)(Worker, [{
|
|
91
|
+
key: "process",
|
|
92
|
+
value: function process(callback) {
|
|
93
|
+
callback(this._items);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Process the items in series with the given chunk size.
|
|
98
|
+
* @param callback - The callback function to process each item.
|
|
99
|
+
* @param {number} [chunkSize=10] - The size of each chunk for processing in series.
|
|
100
|
+
* @returns {Promise<void>}
|
|
101
|
+
*/
|
|
102
|
+
}, {
|
|
103
|
+
key: "processInSeries",
|
|
104
|
+
value: function () {
|
|
105
|
+
var _processInSeries = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(callback) {
|
|
106
|
+
var _this = this;
|
|
107
|
+
var chunkSize,
|
|
108
|
+
chunks,
|
|
109
|
+
promises,
|
|
110
|
+
_args = arguments;
|
|
111
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
112
|
+
while (1) switch (_context.prev = _context.next) {
|
|
113
|
+
case 0:
|
|
114
|
+
chunkSize = _args.length > 1 && _args[1] !== undefined ? _args[1] : 10;
|
|
115
|
+
chunks = (0, _chunk.default)(this._items, chunkSize);
|
|
116
|
+
promises = chunks.map(function (chunk) {
|
|
117
|
+
return _this.processChunk(callback, chunk);
|
|
118
|
+
});
|
|
119
|
+
_context.next = 5;
|
|
120
|
+
return Promise.all(promises);
|
|
121
|
+
case 5:
|
|
122
|
+
case "end":
|
|
123
|
+
return _context.stop();
|
|
124
|
+
}
|
|
125
|
+
}, _callee, this);
|
|
126
|
+
}));
|
|
127
|
+
function processInSeries(_x) {
|
|
128
|
+
return _processInSeries.apply(this, arguments);
|
|
129
|
+
}
|
|
130
|
+
return processInSeries;
|
|
131
|
+
}()
|
|
132
|
+
/**
|
|
133
|
+
* Get the array of results collected by the worker.
|
|
134
|
+
* @returns {Result[]} - An array of collected results.
|
|
135
|
+
*/
|
|
136
|
+
}, {
|
|
137
|
+
key: "results",
|
|
138
|
+
get: function get() {
|
|
139
|
+
return this._report.results;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Get the current items in the worker.
|
|
144
|
+
* @returns {T[]} - An array of items in the worker.
|
|
145
|
+
*/
|
|
146
|
+
}, {
|
|
147
|
+
key: "items",
|
|
148
|
+
get: function get() {
|
|
149
|
+
return this._items;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Set the items in the worker.
|
|
154
|
+
* @param {T[]} items - The items to be set in the worker.
|
|
155
|
+
*/,
|
|
156
|
+
set: function set(items) {
|
|
157
|
+
this._items = items;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Internal method to process a chunk of items using the provided callback.
|
|
162
|
+
* @private
|
|
163
|
+
* @param callback - The callback function to process each item.
|
|
164
|
+
* @param {T[]} chunk - The chunk of items to be processed.
|
|
165
|
+
* @returns {Promise<void>}
|
|
166
|
+
*/
|
|
167
|
+
}, {
|
|
168
|
+
key: "processChunk",
|
|
169
|
+
value: function () {
|
|
170
|
+
var _processChunk = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(callback, chunk) {
|
|
171
|
+
var _iterator, _step, item;
|
|
172
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
|
173
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
174
|
+
case 0:
|
|
175
|
+
_iterator = (0, _createForOfIteratorHelper2.default)(chunk);
|
|
176
|
+
_context2.prev = 1;
|
|
177
|
+
_iterator.s();
|
|
178
|
+
case 3:
|
|
179
|
+
if ((_step = _iterator.n()).done) {
|
|
180
|
+
_context2.next = 9;
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
item = _step.value;
|
|
184
|
+
_context2.next = 7;
|
|
185
|
+
return callback({
|
|
186
|
+
item: item,
|
|
187
|
+
allItems: this._items,
|
|
188
|
+
report: this._report
|
|
189
|
+
});
|
|
190
|
+
case 7:
|
|
191
|
+
_context2.next = 3;
|
|
192
|
+
break;
|
|
193
|
+
case 9:
|
|
194
|
+
_context2.next = 14;
|
|
195
|
+
break;
|
|
196
|
+
case 11:
|
|
197
|
+
_context2.prev = 11;
|
|
198
|
+
_context2.t0 = _context2["catch"](1);
|
|
199
|
+
_iterator.e(_context2.t0);
|
|
200
|
+
case 14:
|
|
201
|
+
_context2.prev = 14;
|
|
202
|
+
_iterator.f();
|
|
203
|
+
return _context2.finish(14);
|
|
204
|
+
case 17:
|
|
205
|
+
case "end":
|
|
206
|
+
return _context2.stop();
|
|
207
|
+
}
|
|
208
|
+
}, _callee2, this, [[1, 11, 14, 17]]);
|
|
209
|
+
}));
|
|
210
|
+
function processChunk(_x2, _x3) {
|
|
211
|
+
return _processChunk.apply(this, arguments);
|
|
212
|
+
}
|
|
213
|
+
return processChunk;
|
|
214
|
+
}()
|
|
215
|
+
}]);
|
|
216
|
+
return Worker;
|
|
217
|
+
}();
|
|
218
|
+
exports.Worker = Worker;
|
|
219
|
+
|
|
220
|
+
//# sourceMappingURL=Worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_chunk","_interopRequireDefault","require","_mobx","Report","_classCallCheck2","default","_defineProperty2","_createClass2","key","value","success","result","addResult","_objectSpread2","status","error","get","_results","push","exports","Worker","_items","_report","makeAutoObservable","process","callback","_processInSeries","_asyncToGenerator2","_regeneratorRuntime2","mark","_callee","_this","chunkSize","chunks","promises","_args","arguments","wrap","_callee$","_context","prev","next","length","undefined","chunk","map","processChunk","Promise","all","stop","processInSeries","_x","apply","results","set","items","_processChunk","_callee2","_iterator","_step","item","_callee2$","_context2","_createForOfIteratorHelper2","s","n","done","allItems","report","t0","e","f","finish","_x2","_x3"],"sources":["Worker.ts"],"sourcesContent":["import chunk from \"lodash/chunk\";\nimport { makeAutoObservable } from \"mobx\";\n\nexport interface CallbackParams<T> {\n item: T;\n allItems: T[];\n report: Report;\n}\n\nexport interface Result {\n title: string;\n status: \"success\" | \"failure\";\n message?: string;\n}\n\n/**\n * Class for collecting processing results\n */\nexport class Report {\n private _results: Result[] = [];\n\n /**\n * Record a successful result in the report\n * @param {Omit<Result, \"status\">} result - The successful result to be recorded\n */\n public success(result: Omit<Result, \"status\">): void {\n this.addResult({\n ...result,\n status: \"success\"\n });\n }\n\n /**\n * Record an error result in the report.\n * @param {Omit<Result, \"status\">} result - The error result to be recorded.\n */\n public error(result: Omit<Result, \"status\">): void {\n this.addResult({\n ...result,\n status: \"failure\"\n });\n }\n\n /**\n * Get the array of recorded results.\n * @returns {Result[]} - An array of recorded results.\n */\n get results(): Result[] {\n return this._results;\n }\n\n /**\n * Internal method to add a result to the report.\n * @private\n * @param {Result} result - The result to be added to the report.\n */\n private addResult(result: Result): void {\n this._results.push(result);\n }\n}\n\n/**\n * A generic worker class for processing items.\n * @template T - The type of items being processed.\n */\nexport class Worker<T> {\n private _items: T[];\n private _report: Report;\n\n constructor() {\n this._items = [];\n this._report = new Report();\n makeAutoObservable(this);\n }\n\n /**\n * Process the items using the provided callback function.\n * @param callback - The callback function to process the items.\n */\n public process(callback: (items: T[]) => void): void {\n callback(this._items);\n }\n\n /**\n * Process the items in series with the given chunk size.\n * @param callback - The callback function to process each item.\n * @param {number} [chunkSize=10] - The size of each chunk for processing in series.\n * @returns {Promise<void>}\n */\n public async processInSeries(\n callback: ({ item, allItems, report }: CallbackParams<T>) => Promise<void>,\n chunkSize = 10\n ): Promise<void> {\n const chunks = chunk(this._items, chunkSize);\n const promises = chunks.map(chunk => this.processChunk(callback, chunk));\n await Promise.all(promises);\n }\n\n /**\n * Get the array of results collected by the worker.\n * @returns {Result[]} - An array of collected results.\n */\n get results(): Result[] {\n return this._report.results;\n }\n\n /**\n * Get the current items in the worker.\n * @returns {T[]} - An array of items in the worker.\n */\n get items(): T[] {\n return this._items;\n }\n\n /**\n * Set the items in the worker.\n * @param {T[]} items - The items to be set in the worker.\n */\n set items(items: T[]) {\n this._items = items;\n }\n\n /**\n * Internal method to process a chunk of items using the provided callback.\n * @private\n * @param callback - The callback function to process each item.\n * @param {T[]} chunk - The chunk of items to be processed.\n * @returns {Promise<void>}\n */\n private async processChunk(\n callback: ({ item, allItems, report }: CallbackParams<T>) => void | Promise<void>,\n chunk: T[]\n ): Promise<void> {\n for (const item of chunk) {\n await callback({ item, allItems: this._items, report: this._report });\n }\n }\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _useDialogWithReport = require("./useDialogWithReport");
|
|
7
|
+
Object.keys(_useDialogWithReport).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _useDialogWithReport[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _useDialogWithReport[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _Worker = require("./Worker");
|
|
18
|
+
Object.keys(_Worker).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _Worker[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function get() {
|
|
24
|
+
return _Worker[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_useDialogWithReport","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_Worker"],"sources":["index.ts"],"sourcesContent":["export * from \"./useDialogWithReport\";\nexport * from \"./Worker\";\n"],"mappings":";;;;;AAAA,IAAAA,oBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,oBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,oBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,oBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,OAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,OAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,OAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAC,OAAA,CAAAL,GAAA;IAAA;EAAA;AAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ResultDialogMessage = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _error = require("@material-design-icons/svg/round/error.svg");
|
|
10
|
+
var _check_circle = require("@material-design-icons/svg/round/check_circle.svg");
|
|
11
|
+
var _Icon = require("@webiny/ui/Icon");
|
|
12
|
+
var _List = require("@webiny/ui/List");
|
|
13
|
+
var _useDialogWithReport = require("./useDialogWithReport.styled");
|
|
14
|
+
var ResultDialogMessage = function ResultDialogMessage(_ref) {
|
|
15
|
+
var results = _ref.results,
|
|
16
|
+
message = _ref.message;
|
|
17
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, message && /*#__PURE__*/_react.default.createElement(_useDialogWithReport.MessageContainer, null, message), /*#__PURE__*/_react.default.createElement(_List.List, {
|
|
18
|
+
nonInteractive: true
|
|
19
|
+
}, results.map(function (result, index) {
|
|
20
|
+
return /*#__PURE__*/_react.default.createElement(_useDialogWithReport.ListItem, {
|
|
21
|
+
key: "item-".concat(index)
|
|
22
|
+
}, /*#__PURE__*/_react.default.createElement(_useDialogWithReport.ListItemGraphic, {
|
|
23
|
+
status: result.status
|
|
24
|
+
}, /*#__PURE__*/_react.default.createElement(_Icon.Icon, {
|
|
25
|
+
icon: result.status === "success" ? /*#__PURE__*/_react.default.createElement(_check_circle.ReactComponent, null) : /*#__PURE__*/_react.default.createElement(_error.ReactComponent, null)
|
|
26
|
+
})), /*#__PURE__*/_react.default.createElement(_List.ListItemText, null, /*#__PURE__*/_react.default.createElement(_List.ListItemTextPrimary, null, result.title), /*#__PURE__*/_react.default.createElement(_List.ListItemTextSecondary, null, result.message)));
|
|
27
|
+
})));
|
|
28
|
+
};
|
|
29
|
+
exports.ResultDialogMessage = ResultDialogMessage;
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=DialogMessage.js.map
|