@webiny/app-file-manager 5.20.0 → 5.21.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 CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: () => (() => (import("@webiny/app-admin/types").AdminInstallationPlugin | import("@webiny/app-admin/types").AdminAppPermissionRendererPlugin | (import("@webiny/app/plugins/RoutePlugin").RoutePlugin | import("@webiny/ui-composer/UIView").UIViewPlugin<import("@webiny/app-admin/ui/views/NavigationView").NavigationView>)[])[])[];
1
+ declare const _default: () => (() => (import("@webiny/app-admin/types").AdminInstallationPlugin | import("@webiny/app-admin/types").AdminAppPermissionRendererPlugin)[])[];
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: () => (import("@webiny/app-admin/types").AdminInstallationPlugin | import("@webiny/app-admin/types").AdminAppPermissionRendererPlugin | (import("@webiny/app/plugins/RoutePlugin").RoutePlugin | import("@webiny/ui-composer/UIView").UIViewPlugin<import("@webiny/app-admin/ui/views/NavigationView").NavigationView>)[])[];
1
+ declare const _default: () => (import("@webiny/app-admin/types").AdminInstallationPlugin | import("@webiny/app-admin/types").AdminAppPermissionRendererPlugin)[];
2
2
  export default _default;
@@ -1,6 +1,5 @@
1
1
  import installation from "./installation";
2
- import menus from "./menus";
3
2
  import permissionRenderer from "./permissionRenderer";
4
3
  export default (function () {
5
- return [installation, menus, permissionRenderer];
4
+ return [installation, permissionRenderer];
6
5
  });
@@ -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 File Manager Settings"
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: 6
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: 6
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
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const FileManager: () => JSX.Element;
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.20.0",
3
+ "version": "5.21.0-beta.0",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,13 +15,12 @@
15
15
  "@emotion/core": "10.1.1",
16
16
  "@emotion/styled": "10.0.27",
17
17
  "@types/react": "16.14.2",
18
- "@webiny/app": "5.20.0",
19
- "@webiny/app-admin": "5.20.0",
20
- "@webiny/app-security": "5.20.0",
21
- "@webiny/form": "5.20.0",
22
- "@webiny/plugins": "5.20.0",
23
- "@webiny/react-router": "5.20.0",
24
- "@webiny/ui": "5.20.0",
18
+ "@webiny/app": "5.21.0-beta.0",
19
+ "@webiny/app-admin": "5.21.0-beta.0",
20
+ "@webiny/app-security": "5.21.0-beta.0",
21
+ "@webiny/form": "5.21.0-beta.0",
22
+ "@webiny/plugins": "5.21.0-beta.0",
23
+ "@webiny/ui": "5.21.0-beta.0",
25
24
  "apollo-cache": "1.3.5",
26
25
  "apollo-client": "2.6.10",
27
26
  "apollo-link": "1.2.14",
@@ -40,8 +39,8 @@
40
39
  "@babel/preset-react": "^7.0.0",
41
40
  "@babel/preset-typescript": "^7.8.3",
42
41
  "@svgr/webpack": "^4.3.2",
43
- "@webiny/cli": "^5.20.0",
44
- "@webiny/project-utils": "^5.20.0",
42
+ "@webiny/cli": "^5.21.0-beta.0",
43
+ "@webiny/project-utils": "^5.21.0-beta.0",
45
44
  "babel-plugin-named-asset-import": "^1.0.0-next.3e165448",
46
45
  "rimraf": "^3.0.2",
47
46
  "typescript": "^4.1.3"
@@ -54,5 +53,5 @@
54
53
  "build": "yarn webiny run build",
55
54
  "watch": "yarn webiny run watch"
56
55
  },
57
- "gitHead": "816632961750d4ae7f3af0d32d4e8a46c3f287a6"
56
+ "gitHead": "cad155812edbdd577a1cc858b41038fdd7a6d2d9"
58
57
  }
@@ -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;
@@ -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
- }())];