@webiny/app-security-access-management 0.0.0-mt-3 → 0.0.0-unstable.5e7233243f

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.
Files changed (74) hide show
  1. package/components/GroupAutocomplete/graphql.d.ts +1 -1
  2. package/components/GroupAutocomplete/graphql.js +14 -3
  3. package/components/GroupAutocomplete/graphql.js.map +1 -0
  4. package/components/GroupAutocomplete/index.d.ts +5 -2
  5. package/components/GroupAutocomplete/index.js +25 -10
  6. package/components/GroupAutocomplete/index.js.map +1 -0
  7. package/components/NotAuthorizedError/NotAuthorizedError.d.ts +2 -2
  8. package/components/NotAuthorizedError/NotAuthorizedError.js +39 -18
  9. package/components/NotAuthorizedError/NotAuthorizedError.js.map +1 -0
  10. package/components/NotAuthorizedError/index.js +13 -1
  11. package/components/NotAuthorizedError/index.js.map +1 -0
  12. package/index.d.ts +8 -1
  13. package/index.js +80 -4
  14. package/index.js.map +1 -0
  15. package/package.json +25 -30
  16. package/plugins/constants.js +9 -2
  17. package/plugins/constants.js.map +1 -0
  18. package/plugins/index.js +20 -8
  19. package/plugins/index.js.map +1 -0
  20. package/plugins/installation.js +47 -25
  21. package/plugins/installation.js.map +1 -0
  22. package/plugins/permissionRenderer/SecurityPermissions.d.ts +8 -5
  23. package/plugins/permissionRenderer/SecurityPermissions.js +69 -46
  24. package/plugins/permissionRenderer/SecurityPermissions.js.map +1 -0
  25. package/plugins/permissionRenderer/index.js +33 -15
  26. package/plugins/permissionRenderer/index.js.map +1 -0
  27. package/plugins/routes.js +37 -19
  28. package/plugins/routes.js.map +1 -0
  29. package/plugins/secureRouteError.js +16 -4
  30. package/plugins/secureRouteError.js.map +1 -0
  31. package/types.d.ts +15 -0
  32. package/types.js +5 -0
  33. package/types.js.map +1 -0
  34. package/ui/elements/GroupAutocompleteElement.d.ts +2 -1
  35. package/ui/elements/GroupAutocompleteElement.js +52 -23
  36. package/ui/elements/GroupAutocompleteElement.js.map +1 -0
  37. package/ui/views/ApiKeys/ApiKeyForm.d.ts +5 -3
  38. package/ui/views/ApiKeys/ApiKeyForm.js +127 -83
  39. package/ui/views/ApiKeys/ApiKeyForm.js.map +1 -0
  40. package/ui/views/ApiKeys/ApiKeys.d.ts +8 -3
  41. package/ui/views/ApiKeys/ApiKeys.js +22 -8
  42. package/ui/views/ApiKeys/ApiKeys.js.map +1 -0
  43. package/ui/views/ApiKeys/ApiKeysDataList.d.ts +5 -3
  44. package/ui/views/ApiKeys/ApiKeysDataList.js +105 -82
  45. package/ui/views/ApiKeys/ApiKeysDataList.js.map +1 -0
  46. package/ui/views/ApiKeys/graphql.d.ts +5 -5
  47. package/ui/views/ApiKeys/graphql.js +22 -7
  48. package/ui/views/ApiKeys/graphql.js.map +1 -0
  49. package/ui/views/ApiKeys/index.d.ts +1 -1
  50. package/ui/views/ApiKeys/index.js +18 -1
  51. package/ui/views/ApiKeys/index.js.map +1 -0
  52. package/ui/views/ApiKeys/utils.d.ts +2 -1
  53. package/ui/views/ApiKeys/utils.js +18 -5
  54. package/ui/views/ApiKeys/utils.js.map +1 -0
  55. package/ui/views/Groups/Groups.d.ts +8 -3
  56. package/ui/views/Groups/Groups.js +22 -8
  57. package/ui/views/Groups/Groups.js.map +1 -0
  58. package/ui/views/Groups/GroupsDataList.d.ts +5 -3
  59. package/ui/views/Groups/GroupsDataList.js +111 -87
  60. package/ui/views/Groups/GroupsDataList.js.map +1 -0
  61. package/ui/views/Groups/GroupsForm.d.ts +5 -3
  62. package/ui/views/Groups/GroupsForm.js +131 -87
  63. package/ui/views/Groups/GroupsForm.js.map +1 -0
  64. package/ui/views/Groups/graphql.d.ts +5 -5
  65. package/ui/views/Groups/graphql.js +23 -8
  66. package/ui/views/Groups/graphql.js.map +1 -0
  67. package/ui/views/Groups/index.d.ts +1 -1
  68. package/ui/views/Groups/index.js +18 -1
  69. package/ui/views/Groups/index.js.map +1 -0
  70. package/ui/views/utils.d.ts +3 -2
  71. package/ui/views/utils.js +19 -20
  72. package/ui/views/utils.js.map +1 -0
  73. package/plugins/menus.d.ts +0 -4
  74. package/plugins/menus.js +0 -61
@@ -1,35 +1,73 @@
1
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports.ApiKeyForm = void 0;
11
+
12
+ var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
13
+
14
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
15
+
16
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
17
+
18
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
19
+
20
+ var _react = _interopRequireWildcard(require("react"));
21
+
22
+ var _reactHooks = require("@apollo/react-hooks");
23
+
24
+ var _get = _interopRequireDefault(require("lodash/get"));
25
+
26
+ var _reactRouter = require("@webiny/react-router");
27
+
28
+ var _i18n = require("@webiny/app/i18n");
29
+
30
+ var _form = require("@webiny/form");
31
+
32
+ var _Grid = require("@webiny/ui/Grid");
33
+
34
+ var _Input = require("@webiny/ui/Input");
35
+
36
+ var _Button = require("@webiny/ui/Button");
37
+
38
+ var _Progress = require("@webiny/ui/Progress");
39
+
40
+ var _FormElementMessage = require("@webiny/ui/FormElementMessage");
41
+
42
+ var _Permissions = require("@webiny/app-admin/components/Permissions");
43
+
44
+ var _validation = require("@webiny/validation");
45
+
46
+ var _SimpleForm = require("@webiny/app-admin/components/SimpleForm");
47
+
48
+ var _Typography = require("@webiny/ui/Typography");
49
+
50
+ var _useSnackbar2 = require("@webiny/app-admin/hooks/useSnackbar");
51
+
52
+ var _utils = require("./utils");
53
+
54
+ var GQL = _interopRequireWildcard(require("./graphql"));
55
+
56
+ var _Snackbar = require("@webiny/ui/Snackbar");
57
+
58
+ var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
59
+
60
+ var _EmptyView = _interopRequireDefault(require("@webiny/app-admin/components/EmptyView"));
61
+
62
+ var _add18px = require("@webiny/app-admin/assets/icons/add-18px.svg");
63
+
64
+ var _styled = _interopRequireDefault(require("@emotion/styled"));
4
65
 
5
66
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
6
67
 
7
- import _regeneratorRuntime from "@babel/runtime/regenerator";
8
- import React, { useCallback } from "react";
9
- import { useMutation, useQuery } from "@apollo/react-hooks";
10
- import get from "lodash/get";
11
- import { useRouter } from "@webiny/react-router";
12
- import { i18n } from "@webiny/app/i18n";
13
- import { Form } from "@webiny/form";
14
- import { Grid, Cell } from "@webiny/ui/Grid";
15
- import { Input } from "@webiny/ui/Input";
16
- import { ButtonDefault, ButtonIcon, ButtonPrimary, CopyButton } from "@webiny/ui/Button";
17
- import { CircularProgress } from "@webiny/ui/Progress";
18
- import { FormElementMessage } from "@webiny/ui/FormElementMessage";
19
- import { Permissions } from "@webiny/app-admin/components/Permissions";
20
- import { validation } from "@webiny/validation";
21
- import { SimpleForm, SimpleFormFooter, SimpleFormContent, SimpleFormHeader } from "@webiny/app-admin/components/SimpleForm";
22
- import { Typography } from "@webiny/ui/Typography";
23
- import { useSnackbar } from "@webiny/app-admin/hooks/useSnackbar";
24
- import { pickDataForAPI } from "./utils";
25
- import * as GQL from "./graphql";
26
- import { SnackbarAction } from "@webiny/ui/Snackbar";
27
- import isEmpty from "lodash/isEmpty";
28
- import EmptyView from "@webiny/app-admin/components/EmptyView";
29
- import { ReactComponent as AddIcon } from "@svgr/webpack!@webiny/app-admin/assets/icons/add-18px.svg";
30
- import styled from "@emotion/styled";
31
- var t = i18n.ns("app-security-admin-users/admin/api-keys/form");
32
- var ButtonWrapper = /*#__PURE__*/styled("div", {
68
+ var t = _i18n.i18n.ns("app-security-admin-users/admin/api-keys/form");
69
+
70
+ var ButtonWrapper = /*#__PURE__*/(0, _styled.default)("div", {
33
71
  target: "e18bg2x40",
34
72
  label: "ButtonWrapper"
35
73
  })({
@@ -38,16 +76,16 @@ var ButtonWrapper = /*#__PURE__*/styled("div", {
38
76
  });
39
77
 
40
78
  var ApiKeyForm = function ApiKeyForm() {
41
- var _useRouter = useRouter(),
79
+ var _useRouter = (0, _reactRouter.useRouter)(),
42
80
  location = _useRouter.location,
43
81
  history = _useRouter.history;
44
82
 
45
- var _useSnackbar = useSnackbar(),
83
+ var _useSnackbar = (0, _useSnackbar2.useSnackbar)(),
46
84
  showSnackbar = _useSnackbar.showSnackbar;
47
85
 
48
86
  var newEntry = new URLSearchParams(location.search).get("new") === "true";
49
87
  var id = new URLSearchParams(location.search).get("id");
50
- var getQuery = useQuery(GQL.READ_API_KEY, {
88
+ var getQuery = (0, _reactHooks.useQuery)(GQL.READ_API_KEY, {
51
89
  variables: {
52
90
  id: id
53
91
  },
@@ -66,32 +104,32 @@ var ApiKeyForm = function ApiKeyForm() {
66
104
  }
67
105
  });
68
106
 
69
- var _useMutation = useMutation(GQL.CREATE_API_KEY, {
107
+ var _useMutation = (0, _reactHooks.useMutation)(GQL.CREATE_API_KEY, {
70
108
  refetchQueries: [{
71
109
  query: GQL.LIST_API_KEYS
72
110
  }]
73
111
  }),
74
- _useMutation2 = _slicedToArray(_useMutation, 2),
112
+ _useMutation2 = (0, _slicedToArray2.default)(_useMutation, 2),
75
113
  create = _useMutation2[0],
76
114
  createMutation = _useMutation2[1];
77
115
 
78
- var _useMutation3 = useMutation(GQL.UPDATE_API_KEY, {
116
+ var _useMutation3 = (0, _reactHooks.useMutation)(GQL.UPDATE_API_KEY, {
79
117
  refetchQueries: [{
80
118
  query: GQL.LIST_API_KEYS
81
119
  }]
82
120
  }),
83
- _useMutation4 = _slicedToArray(_useMutation3, 2),
121
+ _useMutation4 = (0, _slicedToArray2.default)(_useMutation3, 2),
84
122
  update = _useMutation4[0],
85
123
  updateMutation = _useMutation4[1];
86
124
 
87
125
  var loading = [getQuery, createMutation, updateMutation].find(function (item) {
88
126
  return item.loading;
89
127
  });
90
- var onSubmit = useCallback( /*#__PURE__*/function () {
91
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
128
+ var onSubmit = (0, _react.useCallback)( /*#__PURE__*/function () {
129
+ var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(data) {
92
130
  var isUpdate, _ref2, _ref3, operation, args, response, error, id;
93
131
 
94
- return _regeneratorRuntime.wrap(function _callee$(_context) {
132
+ return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
95
133
  while (1) {
96
134
  switch (_context.prev = _context.next) {
97
135
  case 0:
@@ -100,10 +138,10 @@ var ApiKeyForm = function ApiKeyForm() {
100
138
  break;
101
139
  }
102
140
 
103
- showSnackbar(t(_templateObject || (_templateObject = _taggedTemplateLiteral(["You must configure permissions before saving!"]))), {
141
+ showSnackbar(t(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["You must configure permissions before saving!"]))), {
104
142
  timeout: 60000,
105
143
  dismissesOnAction: true,
106
- action: /*#__PURE__*/React.createElement(SnackbarAction, {
144
+ action: /*#__PURE__*/_react.default.createElement(_Snackbar.SnackbarAction, {
107
145
  label: "OK"
108
146
  })
109
147
  });
@@ -114,13 +152,13 @@ var ApiKeyForm = function ApiKeyForm() {
114
152
  _ref2 = isUpdate ? [update, {
115
153
  variables: {
116
154
  id: data.id,
117
- data: pickDataForAPI(data)
155
+ data: (0, _utils.pickDataForAPI)(data)
118
156
  }
119
157
  }] : [create, {
120
158
  variables: {
121
- data: pickDataForAPI(data)
159
+ data: (0, _utils.pickDataForAPI)(data)
122
160
  }
123
- }], _ref3 = _slicedToArray(_ref2, 2), operation = _ref3[0], args = _ref3[1];
161
+ }], _ref3 = (0, _slicedToArray2.default)(_ref2, 2), operation = _ref3[0], args = _ref3[1];
124
162
  _context.next = 7;
125
163
  return operation(args);
126
164
 
@@ -138,7 +176,7 @@ var ApiKeyForm = function ApiKeyForm() {
138
176
  case 11:
139
177
  id = response.data.security.apiKey.data.id;
140
178
  !isUpdate && history.push("/access-management/api-keys?id=".concat(id));
141
- showSnackbar(t(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["API key saved successfully."]))));
179
+ showSnackbar(t(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["API key saved successfully."]))));
142
180
 
143
181
  case 14:
144
182
  case "end":
@@ -152,93 +190,99 @@ var ApiKeyForm = function ApiKeyForm() {
152
190
  return _ref.apply(this, arguments);
153
191
  };
154
192
  }(), [id]);
155
- var data = get(getQuery, "data.security.apiKey.data", {});
156
- var showEmptyView = !newEntry && !loading && isEmpty(data); // Render "No content" selected view.
193
+ var data = (0, _get.default)(getQuery, "data.security.apiKey.data", {});
194
+ var showEmptyView = !newEntry && !loading && (0, _isEmpty.default)(data); // Render "No content" selected view.
157
195
 
158
196
  if (showEmptyView) {
159
- return /*#__PURE__*/React.createElement(EmptyView, {
160
- title: t(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["Click on the left side list to display API key details or create a..."]))),
161
- action: /*#__PURE__*/React.createElement(ButtonDefault, {
197
+ return /*#__PURE__*/_react.default.createElement(_EmptyView.default, {
198
+ title: t(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["Click on the left side list to display API key details or create a..."]))),
199
+ action: /*#__PURE__*/_react.default.createElement(_Button.ButtonDefault, {
162
200
  "data-testid": "new-record-button",
163
201
  onClick: function onClick() {
164
202
  return history.push("/access-management/api-keys?new=true");
165
203
  }
166
- }, /*#__PURE__*/React.createElement(ButtonIcon, {
167
- icon: /*#__PURE__*/React.createElement(AddIcon, null)
168
- }), " ", t(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["New API Key"]))))
204
+ }, /*#__PURE__*/_react.default.createElement(_Button.ButtonIcon, {
205
+ icon: /*#__PURE__*/_react.default.createElement(_add18px.ReactComponent, null)
206
+ }), " ", t(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["New API Key"]))))
169
207
  });
170
208
  }
171
209
 
172
- return /*#__PURE__*/React.createElement(Form, {
210
+ return /*#__PURE__*/_react.default.createElement(_form.Form, {
173
211
  data: data,
174
212
  onSubmit: onSubmit
175
213
  }, function (_ref4) {
176
214
  var data = _ref4.data,
177
215
  form = _ref4.form,
178
216
  Bind = _ref4.Bind;
179
- return /*#__PURE__*/React.createElement(SimpleForm, null, loading && /*#__PURE__*/React.createElement(CircularProgress, null), /*#__PURE__*/React.createElement(SimpleFormHeader, {
217
+ return /*#__PURE__*/_react.default.createElement(_SimpleForm.SimpleForm, null, loading && /*#__PURE__*/_react.default.createElement(_Progress.CircularProgress, null), /*#__PURE__*/_react.default.createElement(_SimpleForm.SimpleFormHeader, {
180
218
  title: data.name ? data.name : "Untitled"
181
- }), /*#__PURE__*/React.createElement(SimpleFormContent, null, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Cell, {
219
+ }), /*#__PURE__*/_react.default.createElement(_SimpleForm.SimpleFormContent, null, /*#__PURE__*/_react.default.createElement(_Grid.Grid, null, /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
182
220
  span: 12
183
- }, /*#__PURE__*/React.createElement(Bind, {
221
+ }, /*#__PURE__*/_react.default.createElement(Bind, {
184
222
  name: "name",
185
- validators: validation.create("required")
186
- }, /*#__PURE__*/React.createElement(Input, {
187
- label: t(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["Name"])))
188
- })))), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Cell, {
223
+ validators: _validation.validation.create("required")
224
+ }, /*#__PURE__*/_react.default.createElement(_Input.Input, {
225
+ label: t(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["Name"]))),
226
+ "data-testid": "sam.key.new.form.name"
227
+ })))), /*#__PURE__*/_react.default.createElement(_Grid.Grid, null, /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
189
228
  span: 12
190
- }, /*#__PURE__*/React.createElement(Bind, {
229
+ }, /*#__PURE__*/_react.default.createElement(Bind, {
191
230
  name: "description",
192
- validators: validation.create("required")
193
- }, /*#__PURE__*/React.createElement(Input, {
194
- label: t(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["Description"]))),
195
- rows: 4
196
- })))), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Cell, {
231
+ validators: _validation.validation.create("required")
232
+ }, /*#__PURE__*/_react.default.createElement(_Input.Input, {
233
+ label: t(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["Description"]))),
234
+ rows: 4,
235
+ "data-testid": "sam.key.new.form.description"
236
+ })))), /*#__PURE__*/_react.default.createElement(_Grid.Grid, null, /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
197
237
  span: 12
198
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Typography, {
238
+ }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Typography.Typography, {
199
239
  use: "subtitle1"
200
- }, t(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["Token"])))), data.token ? /*#__PURE__*/React.createElement("div", {
240
+ }, t(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["Token"])))), data.token ? /*#__PURE__*/_react.default.createElement("div", {
201
241
  style: {
202
242
  background: "var(--mdc-theme-background)",
203
243
  padding: "8px",
204
244
  paddingLeft: "16px"
205
245
  }
206
- }, /*#__PURE__*/React.createElement("span", {
246
+ }, /*#__PURE__*/_react.default.createElement("span", {
207
247
  style: {
208
248
  lineHeight: "48px",
209
249
  verticalAlign: "middle"
210
250
  }
211
- }, data.token), /*#__PURE__*/React.createElement("span", {
251
+ }, data.token), /*#__PURE__*/_react.default.createElement("span", {
212
252
  style: {
213
253
  position: "absolute",
214
254
  right: "32px"
215
255
  }
216
- }, /*#__PURE__*/React.createElement(CopyButton, {
256
+ }, /*#__PURE__*/_react.default.createElement(_Button.CopyButton, {
217
257
  value: data.token,
218
258
  onCopy: function onCopy() {
219
259
  return showSnackbar("Successfully copied!");
220
260
  }
221
- }))) : /*#__PURE__*/React.createElement(FormElementMessage, null, "Your token will be shown once you submit the form.")))), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Cell, {
261
+ }))) : /*#__PURE__*/_react.default.createElement(_FormElementMessage.FormElementMessage, null, "Your token will be shown once you submit the form.")))), /*#__PURE__*/_react.default.createElement(_Grid.Grid, null, /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
222
262
  span: 12
223
- }, /*#__PURE__*/React.createElement(Typography, {
263
+ }, /*#__PURE__*/_react.default.createElement(_Typography.Typography, {
224
264
  use: "subtitle1"
225
- }, t(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["Permissions"]))))), /*#__PURE__*/React.createElement(Cell, {
265
+ }, t(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["Permissions"]))))), /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
226
266
  span: 12
227
- }, /*#__PURE__*/React.createElement(Bind, {
267
+ }, /*#__PURE__*/_react.default.createElement(Bind, {
228
268
  name: "permissions",
229
269
  defaultValue: []
230
270
  }, function (bind) {
231
- return /*#__PURE__*/React.createElement(Permissions, Object.assign({
271
+ return /*#__PURE__*/_react.default.createElement(_Permissions.Permissions, Object.assign({
232
272
  id: data.id || "new"
233
273
  }, bind));
234
- })))), /*#__PURE__*/React.createElement(SimpleFormFooter, null, /*#__PURE__*/React.createElement(ButtonWrapper, null, /*#__PURE__*/React.createElement(ButtonDefault, {
274
+ })))), /*#__PURE__*/_react.default.createElement(_SimpleForm.SimpleFormFooter, null, /*#__PURE__*/_react.default.createElement(ButtonWrapper, null, /*#__PURE__*/_react.default.createElement(_Button.ButtonDefault, {
235
275
  onClick: function onClick() {
236
276
  return history.push("/access-management/api-keys");
237
- }
238
- }, t(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["Cancel"])))), /*#__PURE__*/React.createElement(ButtonPrimary, {
239
- onClick: form.submit
240
- }, t(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["Save API key"])))))));
277
+ },
278
+ "data-testid": "sam.key.new.form.button.cancel"
279
+ }, t(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["Cancel"])))), /*#__PURE__*/_react.default.createElement(_Button.ButtonPrimary, {
280
+ onClick: function onClick(ev) {
281
+ form.submit(ev);
282
+ },
283
+ "data-testid": "sam.key.new.form.button.save"
284
+ }, t(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["Save API key"])))))));
241
285
  });
242
286
  };
243
287
 
244
- export default ApiKeyForm;
288
+ exports.ApiKeyForm = ApiKeyForm;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["t","i18n","ns","ButtonWrapper","styled","display","justifyContent","ApiKeyForm","useRouter","location","history","useSnackbar","showSnackbar","newEntry","URLSearchParams","search","get","id","getQuery","useQuery","GQL","READ_API_KEY","variables","skip","onCompleted","data","error","security","apiKey","push","message","useMutation","CREATE_API_KEY","refetchQueries","query","LIST_API_KEYS","create","createMutation","UPDATE_API_KEY","update","updateMutation","loading","find","item","onSubmit","useCallback","permissions","length","timeout","dismissesOnAction","action","isUpdate","createdOn","pickDataForAPI","operation","args","response","showEmptyView","isEmpty","form","Bind","name","validation","token","background","padding","paddingLeft","lineHeight","verticalAlign","position","right","bind","ev","submit"],"sources":["ApiKeyForm.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { useMutation, useQuery } from \"@apollo/react-hooks\";\nimport get from \"lodash/get\";\nimport { useRouter } from \"@webiny/react-router\";\nimport { i18n } from \"@webiny/app/i18n\";\nimport { Form } from \"@webiny/form\";\nimport { Grid, Cell } from \"@webiny/ui/Grid\";\nimport { Input } from \"@webiny/ui/Input\";\nimport { ButtonDefault, ButtonIcon, ButtonPrimary, CopyButton } from \"@webiny/ui/Button\";\nimport { CircularProgress } from \"@webiny/ui/Progress\";\nimport { FormElementMessage } from \"@webiny/ui/FormElementMessage\";\nimport { Permissions } from \"@webiny/app-admin/components/Permissions\";\nimport { validation } from \"@webiny/validation\";\nimport {\n SimpleForm,\n SimpleFormFooter,\n SimpleFormContent,\n SimpleFormHeader\n} from \"@webiny/app-admin/components/SimpleForm\";\nimport { Typography } from \"@webiny/ui/Typography\";\nimport { useSnackbar } from \"@webiny/app-admin/hooks/useSnackbar\";\nimport { pickDataForAPI } from \"./utils\";\nimport * as GQL from \"./graphql\";\nimport { SnackbarAction } from \"@webiny/ui/Snackbar\";\nimport isEmpty from \"lodash/isEmpty\";\nimport EmptyView from \"@webiny/app-admin/components/EmptyView\";\nimport { ReactComponent as AddIcon } from \"@webiny/app-admin/assets/icons/add-18px.svg\";\nimport styled from \"@emotion/styled\";\nimport { ApiKey } from \"~/types\";\n\nconst t = i18n.ns(\"app-security-admin-users/admin/api-keys/form\");\n\nconst ButtonWrapper = styled(\"div\")({\n display: \"flex\",\n justifyContent: \"space-between\"\n});\nexport interface ApiKeyFormProps {\n // TODO @ts-refactor delete and go up the tree and sort it out\n [key: string]: any;\n}\nexport const ApiKeyForm: React.FC<ApiKeyFormProps> = () => {\n const { location, history } = useRouter();\n const { showSnackbar } = useSnackbar();\n const newEntry = new URLSearchParams(location.search).get(\"new\") === \"true\";\n const id = new URLSearchParams(location.search).get(\"id\");\n\n const getQuery = useQuery(GQL.READ_API_KEY, {\n variables: { id },\n skip: !id,\n onCompleted: data => {\n if (!data) {\n return;\n }\n\n const { error } = data.security.apiKey;\n if (error) {\n history.push(\"/access-management/api-keys\");\n showSnackbar(error.message);\n }\n }\n });\n\n const [create, createMutation] = useMutation(GQL.CREATE_API_KEY, {\n refetchQueries: [{ query: GQL.LIST_API_KEYS }]\n });\n\n const [update, updateMutation] = useMutation(GQL.UPDATE_API_KEY, {\n refetchQueries: [{ query: GQL.LIST_API_KEYS }]\n });\n\n const loading = [getQuery, createMutation, updateMutation].find(item => item.loading);\n\n const onSubmit = useCallback(\n async data => {\n if (!data.permissions || !data.permissions.length) {\n showSnackbar(t`You must configure permissions before saving!`, {\n timeout: 60000,\n dismissesOnAction: true,\n action: <SnackbarAction label={\"OK\"} />\n });\n return;\n }\n\n const isUpdate = data.createdOn;\n const [operation, args] = isUpdate\n ? [update, { variables: { id: data.id, data: pickDataForAPI(data) } }]\n : [create, { variables: { data: pickDataForAPI(data) } }];\n\n const response = await operation(args);\n\n const { error } = response.data.security.apiKey;\n if (error) {\n return showSnackbar(error.message);\n }\n\n const { id } = response.data.security.apiKey.data;\n\n !isUpdate && history.push(`/access-management/api-keys?id=${id}`);\n showSnackbar(t`API key saved successfully.`);\n },\n [id]\n );\n\n const data: ApiKey[] = get(getQuery, \"data.security.apiKey.data\", {});\n\n const showEmptyView = !newEntry && !loading && isEmpty(data);\n // Render \"No content\" selected view.\n if (showEmptyView) {\n return (\n <EmptyView\n title={t`Click on the left side list to display API key details or create a...`}\n action={\n <ButtonDefault\n data-testid=\"new-record-button\"\n onClick={() => history.push(\"/access-management/api-keys?new=true\")}\n >\n <ButtonIcon icon={<AddIcon />} /> {t`New API Key`}\n </ButtonDefault>\n }\n />\n );\n }\n\n return (\n <Form data={data} onSubmit={onSubmit}>\n {({ data, form, Bind }) => {\n return (\n <SimpleForm>\n {loading && <CircularProgress />}\n <SimpleFormHeader title={data.name ? data.name : \"Untitled\"} />\n <SimpleFormContent>\n <Grid>\n <Cell span={12}>\n <Bind name=\"name\" validators={validation.create(\"required\")}>\n <Input\n label={t`Name`}\n data-testid=\"sam.key.new.form.name\"\n />\n </Bind>\n </Cell>\n </Grid>\n <Grid>\n <Cell span={12}>\n <Bind\n name=\"description\"\n validators={validation.create(\"required\")}\n >\n <Input\n label={t`Description`}\n rows={4}\n data-testid=\"sam.key.new.form.description\"\n />\n </Bind>\n </Cell>\n </Grid>\n <Grid>\n <Cell span={12}>\n <div>\n <Typography use={\"subtitle1\"}>{t`Token`}</Typography>\n {data.token ? (\n <div\n style={{\n background: \"var(--mdc-theme-background)\",\n padding: \"8px\",\n paddingLeft: \"16px\"\n }}\n >\n <span\n style={{\n lineHeight: \"48px\",\n verticalAlign: \"middle\"\n }}\n >\n {data.token}\n </span>\n <span\n style={{ position: \"absolute\", right: \"32px\" }}\n >\n <CopyButton\n value={data.token}\n onCopy={() =>\n showSnackbar(\"Successfully copied!\")\n }\n />\n </span>\n </div>\n ) : (\n <FormElementMessage>\n Your token will be shown once you submit the form.\n </FormElementMessage>\n )}\n </div>\n </Cell>\n </Grid>\n <Grid>\n <Cell span={12}>\n <Typography use={\"subtitle1\"}>{t`Permissions`}</Typography>\n </Cell>\n <Cell span={12}>\n <Bind name={\"permissions\"} defaultValue={[]}>\n {bind => <Permissions id={data.id || \"new\"} {...bind} />}\n </Bind>\n </Cell>\n </Grid>\n </SimpleFormContent>\n <SimpleFormFooter>\n <ButtonWrapper>\n <ButtonDefault\n onClick={() => history.push(\"/access-management/api-keys\")}\n data-testid=\"sam.key.new.form.button.cancel\"\n >{t`Cancel`}</ButtonDefault>\n <ButtonPrimary\n onClick={ev => {\n form.submit(ev);\n }}\n data-testid=\"sam.key.new.form.button.save\"\n >{t`Save API key`}</ButtonPrimary>\n </ButtonWrapper>\n </SimpleFormFooter>\n </SimpleForm>\n );\n }}\n </Form>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAGA,IAAMA,CAAC,GAAGC,UAAA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AE,UAAZ;QAAwBC,KAAK,EAAE;MAA/B;IADX,gBAGI,6BAAC,kBAAD;MACI,KAAK,EAAE7C,IAAI,CAACsC,KADhB;MAEI,MAAM,EAAE;QAAA,OACJnD,YAAY,CAAC,sBAAD,CADR;MAAA;IAFZ,EAHJ,CAfJ,CADH,gBA4BG,6BAAC,sCAAD,6DA9BR,CADJ,CADJ,CAzBJ,eAgEI,6BAAC,UAAD,qBACI,6BAAC,UAAD;MAAM,IAAI,EAAE;IAAZ,gBACI,6BAAC,sBAAD;MAAY,GAAG,EAAE;IAAjB,GAA+BZ,CAA/B,iGADJ,CADJ,eAII,6BAAC,UAAD;MAAM,IAAI,EAAE;IAAZ,gBACI,6BAAC,IAAD;MAAM,IAAI,EAAE,aAAZ;MAA2B,YAAY,EAAE;IAAzC,GACK,UAAAuE,IAAI;MAAA,oBAAI,6BAAC,wBAAD;QAAa,EAAE,EAAE9C,IAAI,CAACR,EAAL,IAAW;MAA5B,GAAuCsD,IAAvC,EAAJ;IAAA,CADT,CADJ,CAJJ,CAhEJ,CAHJ,eA8EI,6BAAC,4BAAD,qBACI,6BAAC,aAAD,qBACI,6BAAC,qBAAD;MACI,OAAO,EAAE;QAAA,OAAM7D,OAAO,CAACmB,IAAR,CAAa,6BAAb,CAAN;MAAA,CADb;MAEI,eAAY;IAFhB,GAGE7B,CAHF,4FADJ,eAKI,6BAAC,qBAAD;MACI,OAAO,EAAE,iBAAAwE,EAAE,EAAI;QACXb,IAAI,CAACc,MAAL,CAAYD,EAAZ;MACH,CAHL;MAII,eAAY;IAJhB,GAKExE,CALF,oGALJ,CADJ,CA9EJ,CADJ;EA+FH,CAjGL,CADJ;AAqGH,CAxLM"}
@@ -1,3 +1,8 @@
1
- /// <reference types="react" />
2
- declare const ApiKeys: ({ formProps, listProps }: any) => JSX.Element;
3
- export default ApiKeys;
1
+ import * as React from "react";
2
+ import { ApiKeysDataListProps } from "./ApiKeysDataList";
3
+ import { ApiKeyFormProps } from "./ApiKeyForm";
4
+ export interface ApiKeysProps {
5
+ listProps?: ApiKeysDataListProps;
6
+ formProps?: ApiKeyFormProps;
7
+ }
8
+ export declare const ApiKeys: React.FC<ApiKeysProps>;
@@ -1,12 +1,26 @@
1
- import * as React from "react";
2
- import { SplitView, LeftPanel, RightPanel } from "@webiny/app-admin/components/SplitView";
3
- import ApiKeysDataList from "./ApiKeysDataList";
4
- import ApiKeyForm from "./ApiKeyForm";
1
+ "use strict";
2
+
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.ApiKeys = void 0;
9
+
10
+ var React = _interopRequireWildcard(require("react"));
11
+
12
+ var _SplitView = require("@webiny/app-admin/components/SplitView");
13
+
14
+ var _ApiKeysDataList = require("./ApiKeysDataList");
15
+
16
+ var _ApiKeyForm = require("./ApiKeyForm");
5
17
 
6
18
  var ApiKeys = function ApiKeys(_ref) {
7
- var formProps = _ref.formProps,
8
- listProps = _ref.listProps;
9
- return /*#__PURE__*/React.createElement(SplitView, null, /*#__PURE__*/React.createElement(LeftPanel, null, /*#__PURE__*/React.createElement(ApiKeysDataList, listProps)), /*#__PURE__*/React.createElement(RightPanel, null, /*#__PURE__*/React.createElement(ApiKeyForm, formProps)));
19
+ var _ref$formProps = _ref.formProps,
20
+ formProps = _ref$formProps === void 0 ? {} : _ref$formProps,
21
+ _ref$listProps = _ref.listProps,
22
+ listProps = _ref$listProps === void 0 ? {} : _ref$listProps;
23
+ return /*#__PURE__*/React.createElement(_SplitView.SplitView, null, /*#__PURE__*/React.createElement(_SplitView.LeftPanel, null, /*#__PURE__*/React.createElement(_ApiKeysDataList.ApiKeysDataList, listProps)), /*#__PURE__*/React.createElement(_SplitView.RightPanel, null, /*#__PURE__*/React.createElement(_ApiKeyForm.ApiKeyForm, formProps)));
10
24
  };
11
25
 
12
- export default ApiKeys;
26
+ exports.ApiKeys = ApiKeys;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ApiKeys","formProps","listProps"],"sources":["ApiKeys.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { SplitView, LeftPanel, RightPanel } from \"@webiny/app-admin/components/SplitView\";\nimport { ApiKeysDataList, ApiKeysDataListProps } from \"./ApiKeysDataList\";\nimport { ApiKeyForm, ApiKeyFormProps } from \"./ApiKeyForm\";\n\nexport interface ApiKeysProps {\n listProps?: ApiKeysDataListProps;\n formProps?: ApiKeyFormProps;\n}\nexport const ApiKeys: React.FC<ApiKeysProps> = ({ formProps = {}, listProps = {} }) => {\n return (\n <SplitView>\n <LeftPanel>\n <ApiKeysDataList {...listProps} />\n </LeftPanel>\n <RightPanel>\n <ApiKeyForm {...formProps} />\n </RightPanel>\n </SplitView>\n );\n};\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAMO,IAAMA,OAA+B,GAAG,SAAlCA,OAAkC,OAAwC;EAAA,0BAArCC,SAAqC;EAAA,IAArCA,SAAqC,+BAAzB,EAAyB;EAAA,0BAArBC,SAAqB;EAAA,IAArBA,SAAqB,+BAAT,EAAS;EACnF,oBACI,oBAAC,oBAAD,qBACI,oBAAC,oBAAD,qBACI,oBAAC,gCAAD,EAAqBA,SAArB,CADJ,CADJ,eAII,oBAAC,qBAAD,qBACI,oBAAC,sBAAD,EAAgBD,SAAhB,CADJ,CAJJ,CADJ;AAUH,CAXM"}
@@ -1,3 +1,5 @@
1
- /// <reference types="react" />
2
- declare const ApiKeysDataList: () => JSX.Element;
3
- export default ApiKeysDataList;
1
+ import React from "react";
2
+ export interface ApiKeysDataListProps {
3
+ [key: string]: any;
4
+ }
5
+ export declare const ApiKeysDataList: React.FC<ApiKeysDataListProps>;