@webiny/app-file-manager 5.20.0-beta.2 → 5.22.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/admin/index.d.ts +1 -1
- package/admin/plugins/index.d.ts +1 -1
- package/admin/plugins/index.js +1 -2
- package/admin/plugins/installation.js +1 -1
- package/admin/plugins/permissionRenderer/index.js +1 -1
- package/admin/views/FileManagerSettings.js +6 -5
- package/index.d.ts +2 -0
- package/index.js +22 -0
- package/package.json +21 -23
- package/admin/plugins/menus.d.ts +0 -5
- package/admin/plugins/menus.js +0 -101
package/admin/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: () => (() => (import("@webiny/app-admin/types").AdminInstallationPlugin |
|
|
1
|
+
declare const _default: () => (() => (import("@webiny/app-admin/types").AdminInstallationPlugin | import("@webiny/app-admin/types").AdminAppPermissionRendererPlugin)[])[];
|
|
2
2
|
export default _default;
|
package/admin/plugins/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: () => (import("@webiny/app-admin/types").AdminInstallationPlugin |
|
|
1
|
+
declare const _default: () => (import("@webiny/app-admin/types").AdminInstallationPlugin | import("@webiny/app-admin/types").AdminAppPermissionRendererPlugin)[];
|
|
2
2
|
export default _default;
|
package/admin/plugins/index.js
CHANGED
|
@@ -23,7 +23,7 @@ var SimpleFormPlaceholder = /*#__PURE__*/styled("div", {
|
|
|
23
23
|
});
|
|
24
24
|
var t = i18n.ns("app-file-manager/admin/installation");
|
|
25
25
|
var IS_INSTALLED = gql(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n query IsFileManagerInstalled {\n fileManager {\n version\n }\n }\n"])));
|
|
26
|
-
var INSTALL = gql(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n mutation InstallFileManager($srcPrefix: String) {\n fileManager {\n install(srcPrefix: $srcPrefix) {\n data\n error {\n code\n message\n }\n }\n }\n }\n"])));
|
|
26
|
+
var INSTALL = gql(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n mutation InstallFileManager($srcPrefix: String) {\n fileManager {\n install(srcPrefix: $srcPrefix) {\n data\n error {\n code\n message\n data\n }\n }\n }\n }\n"])));
|
|
27
27
|
|
|
28
28
|
var FMInstaller = function FMInstaller(_ref) {
|
|
29
29
|
var onInstalled = _ref.onInstalled;
|
|
@@ -4,7 +4,7 @@ var _templateObject, _templateObject2;
|
|
|
4
4
|
|
|
5
5
|
import React from "react";
|
|
6
6
|
import { AccordionItem } from "@webiny/ui/Accordion";
|
|
7
|
-
import { ReactComponent as FileManagerIcon } from "
|
|
7
|
+
import { ReactComponent as FileManagerIcon } from "../../assets/icons/folder-open.svg";
|
|
8
8
|
import { FileManagerPermissions } from "./FileManagerPermissions";
|
|
9
9
|
import { i18n } from "@webiny/app/i18n";
|
|
10
10
|
var t = i18n.ns("app-file-manager/admin/plugins/permissionRenderer");
|
|
@@ -11,6 +11,7 @@ import graphql from "../graphql";
|
|
|
11
11
|
import { CircularProgress } from "@webiny/ui/Progress";
|
|
12
12
|
import get from "lodash.get";
|
|
13
13
|
import { SimpleForm, SimpleFormFooter, SimpleFormContent, SimpleFormHeader } from "@webiny/app-admin/components/SimpleForm";
|
|
14
|
+
import { CenteredView } from "@webiny/app-admin";
|
|
14
15
|
|
|
15
16
|
var FileManagerSettings = function FileManagerSettings() {
|
|
16
17
|
var _useSnackbar = useSnackbar(),
|
|
@@ -26,7 +27,7 @@ var FileManagerSettings = function FileManagerSettings() {
|
|
|
26
27
|
}, function (update, _ref2) {
|
|
27
28
|
var mutationInProgress = _ref2.loading;
|
|
28
29
|
var settings = get(data, "fileManager.getSettings.data") || {};
|
|
29
|
-
return /*#__PURE__*/React.createElement(Form, {
|
|
30
|
+
return /*#__PURE__*/React.createElement(CenteredView, null, /*#__PURE__*/React.createElement(Form, {
|
|
30
31
|
data: settings,
|
|
31
32
|
onSubmit: /*#__PURE__*/function () {
|
|
32
33
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
|
|
@@ -63,11 +64,11 @@ var FileManagerSettings = function FileManagerSettings() {
|
|
|
63
64
|
var Bind = _ref4.Bind,
|
|
64
65
|
form = _ref4.form;
|
|
65
66
|
return /*#__PURE__*/React.createElement(SimpleForm, null, (queryInProgress || mutationInProgress) && /*#__PURE__*/React.createElement(CircularProgress, null), /*#__PURE__*/React.createElement(SimpleFormHeader, {
|
|
66
|
-
title: "General
|
|
67
|
+
title: "General Settings"
|
|
67
68
|
}), /*#__PURE__*/React.createElement(SimpleFormContent, null, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Cell, {
|
|
68
69
|
span: 12
|
|
69
70
|
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Cell, {
|
|
70
|
-
span:
|
|
71
|
+
span: 12
|
|
71
72
|
}, /*#__PURE__*/React.createElement(Bind, {
|
|
72
73
|
name: "uploadMinFileSize"
|
|
73
74
|
}, /*#__PURE__*/React.createElement(Input, {
|
|
@@ -77,7 +78,7 @@ var FileManagerSettings = function FileManagerSettings() {
|
|
|
77
78
|
}))))), /*#__PURE__*/React.createElement(Cell, {
|
|
78
79
|
span: 12
|
|
79
80
|
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Cell, {
|
|
80
|
-
span:
|
|
81
|
+
span: 12
|
|
81
82
|
}, /*#__PURE__*/React.createElement(Bind, {
|
|
82
83
|
name: "uploadMaxFileSize"
|
|
83
84
|
}, /*#__PURE__*/React.createElement(Input, {
|
|
@@ -87,7 +88,7 @@ var FileManagerSettings = function FileManagerSettings() {
|
|
|
87
88
|
}))))))), /*#__PURE__*/React.createElement(SimpleFormFooter, null, /*#__PURE__*/React.createElement(ButtonPrimary, {
|
|
88
89
|
onClick: form.submit
|
|
89
90
|
}, "Save")));
|
|
90
|
-
});
|
|
91
|
+
}));
|
|
91
92
|
});
|
|
92
93
|
});
|
|
93
94
|
};
|
package/index.d.ts
ADDED
package/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Plugins, Layout, AddMenu, AddRoute } from "@webiny/app-admin";
|
|
3
|
+
import { HasPermission } from "@webiny/app-security";
|
|
4
|
+
import FileManagerSettings from "./admin/views/FileManagerSettings";
|
|
5
|
+
export var FileManager = function FileManager() {
|
|
6
|
+
return /*#__PURE__*/React.createElement(Plugins, null, /*#__PURE__*/React.createElement(HasPermission, {
|
|
7
|
+
name: "fm.settings"
|
|
8
|
+
}, /*#__PURE__*/React.createElement(AddRoute, {
|
|
9
|
+
path: "/settings/file-manager/general"
|
|
10
|
+
}, /*#__PURE__*/React.createElement(Layout, {
|
|
11
|
+
title: "File Manager - General Settings"
|
|
12
|
+
}, /*#__PURE__*/React.createElement(FileManagerSettings, null))), /*#__PURE__*/React.createElement(AddMenu, {
|
|
13
|
+
name: "settings"
|
|
14
|
+
}, /*#__PURE__*/React.createElement(AddMenu, {
|
|
15
|
+
name: "settings.fileManager",
|
|
16
|
+
label: "File Manager"
|
|
17
|
+
}, /*#__PURE__*/React.createElement(AddMenu, {
|
|
18
|
+
name: "settings.fileManager.general",
|
|
19
|
+
label: "General",
|
|
20
|
+
path: "/settings/file-manager/general"
|
|
21
|
+
})))));
|
|
22
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app-file-manager",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.22.0-beta.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,38 +11,36 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@apollo/react-components": "3.1.5",
|
|
13
13
|
"@apollo/react-hooks": "3.1.5",
|
|
14
|
-
"@babel/runtime": "7.16.
|
|
15
|
-
"@emotion/core": "10.
|
|
16
|
-
"@emotion/styled": "10.0
|
|
14
|
+
"@babel/runtime": "7.16.7",
|
|
15
|
+
"@emotion/core": "10.3.1",
|
|
16
|
+
"@emotion/styled": "10.3.0",
|
|
17
17
|
"@types/react": "16.14.2",
|
|
18
|
-
"@webiny/app": "5.
|
|
19
|
-
"@webiny/app-admin": "5.
|
|
20
|
-
"@webiny/app-security": "5.
|
|
21
|
-
"@webiny/form": "5.
|
|
22
|
-
"@webiny/plugins": "5.
|
|
23
|
-
"@webiny/
|
|
24
|
-
"@webiny/ui": "5.20.0-beta.2",
|
|
18
|
+
"@webiny/app": "5.22.0-beta.0",
|
|
19
|
+
"@webiny/app-admin": "5.22.0-beta.0",
|
|
20
|
+
"@webiny/app-security": "5.22.0-beta.0",
|
|
21
|
+
"@webiny/form": "5.22.0-beta.0",
|
|
22
|
+
"@webiny/plugins": "5.22.0-beta.0",
|
|
23
|
+
"@webiny/ui": "5.22.0-beta.0",
|
|
25
24
|
"apollo-cache": "1.3.5",
|
|
26
25
|
"apollo-client": "2.6.10",
|
|
27
26
|
"apollo-link": "1.2.14",
|
|
28
27
|
"apollo-utilities": "1.3.4",
|
|
29
|
-
"graphql": "
|
|
28
|
+
"graphql": "15.8.0",
|
|
30
29
|
"graphql-tag": "2.12.6",
|
|
31
30
|
"lodash.get": "4.4.2",
|
|
32
|
-
"prop-types": "15.
|
|
31
|
+
"prop-types": "15.8.1",
|
|
33
32
|
"react": "16.14.0",
|
|
34
33
|
"react-dom": "16.14.0"
|
|
35
34
|
},
|
|
36
35
|
"devDependencies": {
|
|
37
|
-
"@babel/cli": "^7.
|
|
38
|
-
"@babel/core": "^7.
|
|
39
|
-
"@babel/preset-env": "^7.
|
|
40
|
-
"@babel/preset-react": "^7.
|
|
41
|
-
"@babel/preset-typescript": "^7.
|
|
42
|
-
"@svgr/webpack": "^
|
|
43
|
-
"@webiny/cli": "^5.
|
|
44
|
-
"@webiny/project-utils": "^5.
|
|
45
|
-
"babel-plugin-named-asset-import": "^1.0.0-next.3e165448",
|
|
36
|
+
"@babel/cli": "^7.16.0",
|
|
37
|
+
"@babel/core": "^7.16.0",
|
|
38
|
+
"@babel/preset-env": "^7.16.4",
|
|
39
|
+
"@babel/preset-react": "^7.16.0",
|
|
40
|
+
"@babel/preset-typescript": "^7.16.0",
|
|
41
|
+
"@svgr/webpack": "^6.1.1",
|
|
42
|
+
"@webiny/cli": "^5.22.0-beta.0",
|
|
43
|
+
"@webiny/project-utils": "^5.22.0-beta.0",
|
|
46
44
|
"rimraf": "^3.0.2",
|
|
47
45
|
"typescript": "^4.1.3"
|
|
48
46
|
},
|
|
@@ -54,5 +52,5 @@
|
|
|
54
52
|
"build": "yarn webiny run build",
|
|
55
53
|
"watch": "yarn webiny run watch"
|
|
56
54
|
},
|
|
57
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "487330472a07000c4845340f3b3dfa6b3ae98944"
|
|
58
56
|
}
|
package/admin/plugins/menus.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { NavigationView } from "@webiny/app-admin/ui/views/NavigationView";
|
|
2
|
-
import { RoutePlugin } from "@webiny/app/plugins/RoutePlugin";
|
|
3
|
-
import { UIViewPlugin } from "@webiny/app-admin/ui/UIView";
|
|
4
|
-
declare const _default: (RoutePlugin | UIViewPlugin<NavigationView>)[];
|
|
5
|
-
export default _default;
|
package/admin/plugins/menus.js
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
5
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
import { Route } from "@webiny/react-router";
|
|
8
|
-
import { AdminLayout } from "@webiny/app-admin/components/AdminLayout";
|
|
9
|
-
import { SecureRoute } from "@webiny/app-security/components";
|
|
10
|
-
import { NavigationMenuElement } from "@webiny/app-admin/ui/elements/NavigationMenuElement";
|
|
11
|
-
import { NavigationView } from "@webiny/app-admin/ui/views/NavigationView";
|
|
12
|
-
import { RoutePlugin } from "@webiny/app/plugins/RoutePlugin";
|
|
13
|
-
import { UIViewPlugin } from "@webiny/app-admin/ui/UIView";
|
|
14
|
-
import FileManagerSettings from "../views/FileManagerSettings";
|
|
15
|
-
var PERMISSION_FM_SETTINGS = "fm.settings";
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* !EXAMPLE!
|
|
19
|
-
* This demonstrates how you can create your sub-classes to expose a nicer public API.
|
|
20
|
-
*/
|
|
21
|
-
var ProtectedMenuElement = /*#__PURE__*/function (_NavigationMenuElemen) {
|
|
22
|
-
_inherits(ProtectedMenuElement, _NavigationMenuElemen);
|
|
23
|
-
|
|
24
|
-
var _super = _createSuper(ProtectedMenuElement);
|
|
25
|
-
|
|
26
|
-
function ProtectedMenuElement(id, config) {
|
|
27
|
-
var _this;
|
|
28
|
-
|
|
29
|
-
_classCallCheck(this, ProtectedMenuElement);
|
|
30
|
-
|
|
31
|
-
if (config.permission) {
|
|
32
|
-
config.shouldRender = function () {
|
|
33
|
-
var _this$getView$getSecu = _this.getView().getSecurityHook(),
|
|
34
|
-
identity = _this$getView$getSecu.identity;
|
|
35
|
-
|
|
36
|
-
return identity.getPermission(PERMISSION_FM_SETTINGS) !== undefined;
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return _this = _super.call(this, id, config);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return ProtectedMenuElement;
|
|
44
|
-
}(NavigationMenuElement);
|
|
45
|
-
|
|
46
|
-
export default [new RoutePlugin({
|
|
47
|
-
route: /*#__PURE__*/React.createElement(Route, {
|
|
48
|
-
path: "/settings/file-manager/general",
|
|
49
|
-
render: function render() {
|
|
50
|
-
return /*#__PURE__*/React.createElement(SecureRoute, {
|
|
51
|
-
permission: PERMISSION_FM_SETTINGS
|
|
52
|
-
}, /*#__PURE__*/React.createElement(AdminLayout, {
|
|
53
|
-
title: "File Manager Settings - General"
|
|
54
|
-
}, /*#__PURE__*/React.createElement(FileManagerSettings, null)));
|
|
55
|
-
}
|
|
56
|
-
})
|
|
57
|
-
}), new UIViewPlugin(NavigationView, /*#__PURE__*/function () {
|
|
58
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(view) {
|
|
59
|
-
var _view$getSecurityHook, identity, hasPermissions, fileManagerSettings;
|
|
60
|
-
|
|
61
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
62
|
-
while (1) {
|
|
63
|
-
switch (_context.prev = _context.next) {
|
|
64
|
-
case 0:
|
|
65
|
-
_context.next = 2;
|
|
66
|
-
return view.isRendered();
|
|
67
|
-
|
|
68
|
-
case 2:
|
|
69
|
-
_view$getSecurityHook = view.getSecurityHook(), identity = _view$getSecurityHook.identity;
|
|
70
|
-
hasPermissions = identity.getPermission(PERMISSION_FM_SETTINGS) !== undefined;
|
|
71
|
-
|
|
72
|
-
if (hasPermissions) {
|
|
73
|
-
_context.next = 6;
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return _context.abrupt("return");
|
|
78
|
-
|
|
79
|
-
case 6:
|
|
80
|
-
fileManagerSettings = new ProtectedMenuElement("menu.settings.fileManager", {
|
|
81
|
-
label: "File Manager",
|
|
82
|
-
permission: PERMISSION_FM_SETTINGS
|
|
83
|
-
});
|
|
84
|
-
fileManagerSettings.addElement(new NavigationMenuElement("menu.settings.fileManager.general", {
|
|
85
|
-
label: "General",
|
|
86
|
-
path: "/settings/file-manager/general"
|
|
87
|
-
}));
|
|
88
|
-
view.addSettingsMenuElement(fileManagerSettings);
|
|
89
|
-
|
|
90
|
-
case 9:
|
|
91
|
-
case "end":
|
|
92
|
-
return _context.stop();
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}, _callee);
|
|
96
|
-
}));
|
|
97
|
-
|
|
98
|
-
return function (_x) {
|
|
99
|
-
return _ref.apply(this, arguments);
|
|
100
|
-
};
|
|
101
|
-
}())];
|