@webiny/app-security-access-management 5.23.0 → 5.24.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/components/GroupAutocomplete/graphql.d.ts +1 -1
- package/components/GroupAutocomplete/index.d.ts +5 -2
- package/components/NotAuthorizedError/NotAuthorizedError.d.ts +2 -2
- package/index.d.ts +4 -0
- package/index.js +6 -0
- package/package.json +13 -12
- package/plugins/permissionRenderer/SecurityPermissions.d.ts +8 -5
- package/types.d.ts +15 -0
- package/types.js +1 -0
- package/ui/elements/GroupAutocompleteElement.d.ts +2 -1
- package/ui/elements/GroupAutocompleteElement.js +4 -4
- package/ui/views/ApiKeys/ApiKeyForm.d.ts +5 -3
- package/ui/views/ApiKeys/ApiKeyForm.js +2 -5
- package/ui/views/ApiKeys/ApiKeys.d.ts +8 -3
- package/ui/views/ApiKeys/ApiKeys.js +8 -9
- package/ui/views/ApiKeys/ApiKeysDataList.d.ts +5 -3
- package/ui/views/ApiKeys/ApiKeysDataList.js +14 -26
- package/ui/views/ApiKeys/graphql.d.ts +5 -5
- package/ui/views/ApiKeys/index.d.ts +1 -1
- package/ui/views/ApiKeys/index.js +1 -1
- package/ui/views/ApiKeys/utils.d.ts +2 -1
- package/ui/views/Groups/Groups.d.ts +8 -3
- package/ui/views/Groups/Groups.js +9 -10
- package/ui/views/Groups/GroupsDataList.d.ts +5 -3
- package/ui/views/Groups/GroupsDataList.js +15 -27
- package/ui/views/Groups/GroupsForm.d.ts +5 -3
- package/ui/views/Groups/GroupsForm.js +2 -5
- package/ui/views/Groups/graphql.d.ts +5 -5
- package/ui/views/Groups/index.d.ts +1 -1
- package/ui/views/Groups/index.js +1 -1
- package/ui/views/utils.d.ts +3 -2
- package/ui/views/utils.js +5 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIST_GROUPS:
|
|
1
|
+
export declare const LIST_GROUPS: import("graphql").DocumentNode;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { AutoCompleteProps } from "@webiny/ui/AutoComplete";
|
|
3
|
+
declare type GroupAutocompleteProps = Partial<AutoCompleteProps>;
|
|
4
|
+
export declare const GroupAutocomplete: React.FC<GroupAutocompleteProps>;
|
|
5
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const NotAuthorizedError:
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export declare const NotAuthorizedError: React.FC;
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
declare const _default: () => any[];
|
|
3
|
+
/**
|
|
4
|
+
* TODO @ts-refactor
|
|
5
|
+
* Find out why is there empty default export
|
|
6
|
+
*/
|
|
3
7
|
export default _default;
|
|
4
8
|
export declare const AccessManagementExtension: () => JSX.Element;
|
|
5
9
|
export declare const AccessManagement: React.MemoExoticComponent<() => JSX.Element>;
|
package/index.js
CHANGED
|
@@ -6,6 +6,12 @@ import { Permission } from "./plugins/constants";
|
|
|
6
6
|
import { Groups } from "./ui/views/Groups";
|
|
7
7
|
import { ApiKeys } from "./ui/views/ApiKeys";
|
|
8
8
|
import accessManagementPugins from "./plugins";
|
|
9
|
+
/**
|
|
10
|
+
* TODO @ts-refactor
|
|
11
|
+
* Find out why is there empty default export
|
|
12
|
+
*/
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
|
|
9
15
|
export default (function () {
|
|
10
16
|
return [];
|
|
11
17
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app-security-access-management",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.24.0-beta.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@apollo/react-hooks": "3.1.5",
|
|
17
17
|
"@emotion/styled": "10.3.0",
|
|
18
|
-
"@webiny/app": "5.
|
|
19
|
-
"@webiny/app-admin": "5.
|
|
20
|
-
"@webiny/app-security": "5.
|
|
21
|
-
"@webiny/form": "5.
|
|
22
|
-
"@webiny/plugins": "5.
|
|
23
|
-
"@webiny/react-router": "5.
|
|
24
|
-
"@webiny/ui": "5.
|
|
25
|
-
"@webiny/validation": "5.
|
|
18
|
+
"@webiny/app": "5.24.0-beta.0",
|
|
19
|
+
"@webiny/app-admin": "5.24.0-beta.0",
|
|
20
|
+
"@webiny/app-security": "5.24.0-beta.0",
|
|
21
|
+
"@webiny/form": "5.24.0-beta.0",
|
|
22
|
+
"@webiny/plugins": "5.24.0-beta.0",
|
|
23
|
+
"@webiny/react-router": "5.24.0-beta.0",
|
|
24
|
+
"@webiny/ui": "5.24.0-beta.0",
|
|
25
|
+
"@webiny/validation": "5.24.0-beta.0",
|
|
26
26
|
"emotion": "10.0.27",
|
|
27
27
|
"graphql-tag": "2.12.6",
|
|
28
28
|
"lodash": "4.17.21",
|
|
@@ -37,8 +37,9 @@
|
|
|
37
37
|
"@babel/preset-env": "^7.16.4",
|
|
38
38
|
"@babel/preset-react": "^7.16.0",
|
|
39
39
|
"@babel/preset-typescript": "^7.16.0",
|
|
40
|
-
"@
|
|
41
|
-
"@webiny/
|
|
40
|
+
"@types/react-helmet": "^6.1.5",
|
|
41
|
+
"@webiny/cli": "^5.24.0-beta.0",
|
|
42
|
+
"@webiny/project-utils": "^5.24.0-beta.0",
|
|
42
43
|
"babel-plugin-emotion": "^9.2.8",
|
|
43
44
|
"babel-plugin-lodash": "^3.3.4",
|
|
44
45
|
"rimraf": "^3.0.2",
|
|
@@ -60,5 +61,5 @@
|
|
|
60
61
|
]
|
|
61
62
|
}
|
|
62
63
|
},
|
|
63
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "05b90b92bbaf2ef3adf275d008c4641580cf5f42"
|
|
64
65
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SecurityPermission } from "@webiny/app-security/types";
|
|
3
|
+
interface SecurityPermissionsProps {
|
|
4
|
+
value: SecurityPermission[];
|
|
5
|
+
onChange: (value: SecurityPermission[]) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const SecurityPermissions: React.FC<SecurityPermissionsProps>;
|
|
8
|
+
export {};
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SecurityPermission } from "@webiny/app-security/types";
|
|
2
|
+
export interface Group {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
slug: string;
|
|
7
|
+
system?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface ApiKey {
|
|
10
|
+
id: string;
|
|
11
|
+
token: string;
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
permissions: SecurityPermission[];
|
|
15
|
+
}
|
package/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { InputElement } from "@webiny/app-admin/ui/elements/form/InputElement";
|
|
3
|
+
import { FormFieldElementRenderProps } from "@webiny/app-admin/ui/elements/form/FormFieldElement";
|
|
3
4
|
export declare class GroupAutocompleteElement extends InputElement {
|
|
4
|
-
render(
|
|
5
|
+
render(props: FormFieldElementRenderProps): React.ReactElement;
|
|
5
6
|
}
|
|
@@ -18,10 +18,10 @@ export var GroupAutocompleteElement = /*#__PURE__*/function (_InputElement) {
|
|
|
18
18
|
|
|
19
19
|
_createClass(GroupAutocompleteElement, [{
|
|
20
20
|
key: "render",
|
|
21
|
-
value: function render(
|
|
22
|
-
var formProps =
|
|
23
|
-
var
|
|
24
|
-
Bind =
|
|
21
|
+
value: function render(props) {
|
|
22
|
+
var formProps = props.formProps;
|
|
23
|
+
var _ref = formProps,
|
|
24
|
+
Bind = _ref.Bind;
|
|
25
25
|
return /*#__PURE__*/React.createElement(Bind, {
|
|
26
26
|
name: this.id,
|
|
27
27
|
validators: this.config.validators
|
|
@@ -36,8 +36,7 @@ var ButtonWrapper = /*#__PURE__*/styled("div", {
|
|
|
36
36
|
display: "flex",
|
|
37
37
|
justifyContent: "space-between"
|
|
38
38
|
});
|
|
39
|
-
|
|
40
|
-
var ApiKeyForm = function ApiKeyForm() {
|
|
39
|
+
export var ApiKeyForm = function ApiKeyForm() {
|
|
41
40
|
var _useRouter = useRouter(),
|
|
42
41
|
location = _useRouter.location,
|
|
43
42
|
history = _useRouter.history;
|
|
@@ -239,6 +238,4 @@ var ApiKeyForm = function ApiKeyForm() {
|
|
|
239
238
|
onClick: form.submit
|
|
240
239
|
}, t(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["Save API key"])))))));
|
|
241
240
|
});
|
|
242
|
-
};
|
|
243
|
-
|
|
244
|
-
export default ApiKeyForm;
|
|
241
|
+
};
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { SplitView, LeftPanel, RightPanel } from "@webiny/app-admin/components/SplitView";
|
|
3
|
-
import ApiKeysDataList from "./ApiKeysDataList";
|
|
4
|
-
import ApiKeyForm from "./ApiKeyForm";
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
listProps = _ref.listProps
|
|
3
|
+
import { ApiKeysDataList } from "./ApiKeysDataList";
|
|
4
|
+
import { ApiKeyForm } from "./ApiKeyForm";
|
|
5
|
+
export var ApiKeys = function ApiKeys(_ref) {
|
|
6
|
+
var _ref$formProps = _ref.formProps,
|
|
7
|
+
formProps = _ref$formProps === void 0 ? {} : _ref$formProps,
|
|
8
|
+
_ref$listProps = _ref.listProps,
|
|
9
|
+
listProps = _ref$listProps === void 0 ? {} : _ref$listProps;
|
|
9
10
|
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)));
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export default ApiKeys;
|
|
11
|
+
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface ApiKeysDataListProps {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
export declare const ApiKeysDataList: React.FC<ApiKeysDataListProps>;
|
|
@@ -21,37 +21,28 @@ import { useConfirmationDialog } from "@webiny/app-admin/hooks/useConfirmationDi
|
|
|
21
21
|
import * as GQL from "./graphql";
|
|
22
22
|
import { ReactComponent as AddIcon } from "@webiny/app-admin/assets/icons/add-18px.svg";
|
|
23
23
|
import { ReactComponent as FilterIcon } from "@webiny/app-admin/assets/icons/filter-24px.svg";
|
|
24
|
-
import {
|
|
24
|
+
import { deserializeSorters } from "../utils";
|
|
25
25
|
var t = i18n.ns("app-security/admin/groups/data-list");
|
|
26
26
|
var SORTERS = [{
|
|
27
27
|
label: t(_templateObject || (_templateObject = _taggedTemplateLiteral(["Newest to oldest"]))),
|
|
28
|
-
|
|
29
|
-
createdOn: "desc"
|
|
30
|
-
}
|
|
28
|
+
sorter: "createdOn_DESC"
|
|
31
29
|
}, {
|
|
32
30
|
label: t(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["Oldest to newest"]))),
|
|
33
|
-
|
|
34
|
-
createdOn: "asc"
|
|
35
|
-
}
|
|
31
|
+
sorter: "createdOn_ASC"
|
|
36
32
|
}, {
|
|
37
33
|
label: t(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["Name A-Z"]))),
|
|
38
|
-
|
|
39
|
-
name: "asc"
|
|
40
|
-
}
|
|
34
|
+
sorter: "name_ASC"
|
|
41
35
|
}, {
|
|
42
36
|
label: t(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["Name Z-A"]))),
|
|
43
|
-
|
|
44
|
-
name: "desc"
|
|
45
|
-
}
|
|
37
|
+
sorter: "name_DESC"
|
|
46
38
|
}];
|
|
47
|
-
|
|
48
|
-
var ApiKeysDataList = function ApiKeysDataList() {
|
|
39
|
+
export var ApiKeysDataList = function ApiKeysDataList() {
|
|
49
40
|
var _useState = useState(""),
|
|
50
41
|
_useState2 = _slicedToArray(_useState, 2),
|
|
51
42
|
filter = _useState2[0],
|
|
52
43
|
setFilter = _useState2[1];
|
|
53
44
|
|
|
54
|
-
var _useState3 = useState(
|
|
45
|
+
var _useState3 = useState(SORTERS[0].sorter),
|
|
55
46
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
56
47
|
sort = _useState4[0],
|
|
57
48
|
setSort = _useState4[1];
|
|
@@ -78,11 +69,10 @@ var ApiKeysDataList = function ApiKeysDataList() {
|
|
|
78
69
|
return list;
|
|
79
70
|
}
|
|
80
71
|
|
|
81
|
-
var
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
value = _Object$entries2$[1];
|
|
72
|
+
var _deserializeSorters = deserializeSorters(sort),
|
|
73
|
+
_deserializeSorters2 = _slicedToArray(_deserializeSorters, 2),
|
|
74
|
+
key = _deserializeSorters2[0],
|
|
75
|
+
value = _deserializeSorters2[1];
|
|
86
76
|
|
|
87
77
|
return orderBy(list, [key], [value]);
|
|
88
78
|
}, [sort]);
|
|
@@ -153,10 +143,10 @@ var ApiKeysDataList = function ApiKeysDataList() {
|
|
|
153
143
|
label: t(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["Sort by"])))
|
|
154
144
|
}, SORTERS.map(function (_ref3) {
|
|
155
145
|
var label = _ref3.label,
|
|
156
|
-
|
|
146
|
+
sorter = _ref3.sorter;
|
|
157
147
|
return /*#__PURE__*/React.createElement("option", {
|
|
158
148
|
key: label,
|
|
159
|
-
value:
|
|
149
|
+
value: sorter
|
|
160
150
|
}, label);
|
|
161
151
|
})))));
|
|
162
152
|
}, [sort]);
|
|
@@ -204,6 +194,4 @@ var ApiKeysDataList = function ApiKeysDataList() {
|
|
|
204
194
|
}))));
|
|
205
195
|
}));
|
|
206
196
|
});
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
export default ApiKeysDataList;
|
|
197
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const LIST_API_KEYS:
|
|
2
|
-
export declare const READ_API_KEY:
|
|
3
|
-
export declare const CREATE_API_KEY:
|
|
4
|
-
export declare const UPDATE_API_KEY:
|
|
5
|
-
export declare const DELETE_API_KEY:
|
|
1
|
+
export declare const LIST_API_KEYS: import("graphql").DocumentNode;
|
|
2
|
+
export declare const READ_API_KEY: import("graphql").DocumentNode;
|
|
3
|
+
export declare const CREATE_API_KEY: import("graphql").DocumentNode;
|
|
4
|
+
export declare const UPDATE_API_KEY: import("graphql").DocumentNode;
|
|
5
|
+
export declare const DELETE_API_KEY: import("graphql").DocumentNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./ApiKeys";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./ApiKeys";
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { ApiKey } from "../../../types";
|
|
2
|
+
export declare const pickDataForAPI: (data: ApiKey) => Pick<ApiKey, "name" | "description" | "permissions">;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { GroupsDataListProps } from "./GroupsDataList";
|
|
3
|
+
import { GroupsFormProps } from "./GroupsForm";
|
|
4
|
+
export interface GroupsProps {
|
|
5
|
+
listProps?: GroupsDataListProps;
|
|
6
|
+
formProps?: GroupsFormProps;
|
|
7
|
+
}
|
|
8
|
+
export declare const Groups: React.FC<GroupsProps>;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { SplitView, LeftPanel, RightPanel } from "@webiny/app-admin/components/SplitView";
|
|
3
|
-
import GroupsDataList from "./GroupsDataList";
|
|
4
|
-
import GroupsForm from "./GroupsForm";
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
listProps = _ref.listProps
|
|
3
|
+
import { GroupsDataList } from "./GroupsDataList";
|
|
4
|
+
import { GroupsForm } from "./GroupsForm";
|
|
5
|
+
export var Groups = function Groups(_ref) {
|
|
6
|
+
var _ref$formProps = _ref.formProps,
|
|
7
|
+
formProps = _ref$formProps === void 0 ? {} : _ref$formProps,
|
|
8
|
+
_ref$listProps = _ref.listProps,
|
|
9
|
+
listProps = _ref$listProps === void 0 ? {} : _ref$listProps;
|
|
9
10
|
return /*#__PURE__*/React.createElement(SplitView, null, /*#__PURE__*/React.createElement(LeftPanel, null, /*#__PURE__*/React.createElement(GroupsDataList, listProps)), /*#__PURE__*/React.createElement(RightPanel, null, /*#__PURE__*/React.createElement(GroupsForm, formProps)));
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export default Groups;
|
|
11
|
+
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface GroupsDataListProps {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
export declare const GroupsDataList: React.FC<GroupsDataListProps>;
|
|
@@ -22,37 +22,28 @@ import { Select } from "@webiny/ui/Select";
|
|
|
22
22
|
import SearchUI from "@webiny/app-admin/components/SearchUI";
|
|
23
23
|
import { ReactComponent as AddIcon } from "@webiny/app-admin/assets/icons/add-18px.svg";
|
|
24
24
|
import { ReactComponent as FilterIcon } from "@webiny/app-admin/assets/icons/filter-24px.svg";
|
|
25
|
-
import { deserializeSorters
|
|
25
|
+
import { deserializeSorters } from "../utils";
|
|
26
26
|
var t = i18n.ns("app-security/admin/groups/data-list");
|
|
27
27
|
var SORTERS = [{
|
|
28
28
|
label: t(_templateObject || (_templateObject = _taggedTemplateLiteral(["Newest to oldest"]))),
|
|
29
|
-
|
|
30
|
-
createdOn: "desc"
|
|
31
|
-
}
|
|
29
|
+
sorter: "createdOn_DESC"
|
|
32
30
|
}, {
|
|
33
31
|
label: t(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["Oldest to newest"]))),
|
|
34
|
-
|
|
35
|
-
createdOn: "asc"
|
|
36
|
-
}
|
|
32
|
+
sorter: "createdOn_ASC"
|
|
37
33
|
}, {
|
|
38
34
|
label: t(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["Name A-Z"]))),
|
|
39
|
-
|
|
40
|
-
name: "asc"
|
|
41
|
-
}
|
|
35
|
+
sorter: "name_ASC"
|
|
42
36
|
}, {
|
|
43
37
|
label: t(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["Name Z-A"]))),
|
|
44
|
-
|
|
45
|
-
name: "desc"
|
|
46
|
-
}
|
|
38
|
+
sorter: "name_DESC"
|
|
47
39
|
}];
|
|
48
|
-
|
|
49
|
-
var GroupsDataList = function GroupsDataList() {
|
|
40
|
+
export var GroupsDataList = function GroupsDataList() {
|
|
50
41
|
var _useState = useState(""),
|
|
51
42
|
_useState2 = _slicedToArray(_useState, 2),
|
|
52
43
|
filter = _useState2[0],
|
|
53
44
|
setFilter = _useState2[1];
|
|
54
45
|
|
|
55
|
-
var _useState3 = useState(
|
|
46
|
+
var _useState3 = useState(SORTERS[0].sorter),
|
|
56
47
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
57
48
|
sort = _useState4[0],
|
|
58
49
|
setSort = _useState4[1];
|
|
@@ -95,13 +86,12 @@ var GroupsDataList = function GroupsDataList() {
|
|
|
95
86
|
return groups;
|
|
96
87
|
}
|
|
97
88
|
|
|
98
|
-
var
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
value = _Object$entries2$[1];
|
|
89
|
+
var _deserializeSorters = deserializeSorters(sort),
|
|
90
|
+
_deserializeSorters2 = _slicedToArray(_deserializeSorters, 2),
|
|
91
|
+
key = _deserializeSorters2[0],
|
|
92
|
+
sortBy = _deserializeSorters2[1];
|
|
103
93
|
|
|
104
|
-
return orderBy(groups, [key], [
|
|
94
|
+
return orderBy(groups, [key], [sortBy]);
|
|
105
95
|
}, [sort]);
|
|
106
96
|
var deleteItem = useCallback(function (item) {
|
|
107
97
|
showConfirmation( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
@@ -154,10 +144,10 @@ var GroupsDataList = function GroupsDataList() {
|
|
|
154
144
|
label: t(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["Sort by"])))
|
|
155
145
|
}, SORTERS.map(function (_ref3) {
|
|
156
146
|
var label = _ref3.label,
|
|
157
|
-
|
|
147
|
+
sorter = _ref3.sorter;
|
|
158
148
|
return /*#__PURE__*/React.createElement("option", {
|
|
159
149
|
key: label,
|
|
160
|
-
value:
|
|
150
|
+
value: sorter
|
|
161
151
|
}, label);
|
|
162
152
|
})))));
|
|
163
153
|
}, [sort]);
|
|
@@ -210,6 +200,4 @@ var GroupsDataList = function GroupsDataList() {
|
|
|
210
200
|
})))));
|
|
211
201
|
}));
|
|
212
202
|
});
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
export default GroupsDataList;
|
|
203
|
+
};
|
|
@@ -36,8 +36,7 @@ var ButtonWrapper = /*#__PURE__*/styled("div", {
|
|
|
36
36
|
display: "flex",
|
|
37
37
|
justifyContent: "space-between"
|
|
38
38
|
});
|
|
39
|
-
|
|
40
|
-
var GroupForm = function GroupForm() {
|
|
39
|
+
export var GroupsForm = function GroupsForm() {
|
|
41
40
|
var _useRouter = useRouter(),
|
|
42
41
|
location = _useRouter.location,
|
|
43
42
|
history = _useRouter.history;
|
|
@@ -229,6 +228,4 @@ var GroupForm = function GroupForm() {
|
|
|
229
228
|
onClick: form.submit
|
|
230
229
|
}, t(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["Save group"])))))));
|
|
231
230
|
});
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
export default GroupForm;
|
|
231
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const LIST_GROUPS:
|
|
2
|
-
export declare const READ_GROUP:
|
|
3
|
-
export declare const CREATE_GROUP:
|
|
4
|
-
export declare const UPDATE_GROUP:
|
|
5
|
-
export declare const DELETE_GROUP:
|
|
1
|
+
export declare const LIST_GROUPS: import("graphql").DocumentNode;
|
|
2
|
+
export declare const READ_GROUP: import("graphql").DocumentNode;
|
|
3
|
+
export declare const CREATE_GROUP: import("graphql").DocumentNode;
|
|
4
|
+
export declare const UPDATE_GROUP: import("graphql").DocumentNode;
|
|
5
|
+
export declare const DELETE_GROUP: import("graphql").DocumentNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./Groups";
|
package/ui/views/Groups/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./Groups";
|
package/ui/views/utils.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const deserializeSorters: (data: string) =>
|
|
1
|
+
declare type SortTypes = "asc" | "desc";
|
|
2
|
+
export declare const deserializeSorters: (data: string) => [string, SortTypes];
|
|
3
|
+
export {};
|
package/ui/views/utils.js
CHANGED
|
@@ -1,27 +1,14 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
export var serializeSorters = function serializeSorters(data) {
|
|
4
|
-
if (!data) {
|
|
5
|
-
return data;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
var _Object$entries = Object.entries(data),
|
|
9
|
-
_Object$entries2 = _slicedToArray(_Object$entries, 1),
|
|
10
|
-
_Object$entries2$ = _slicedToArray(_Object$entries2[0], 2),
|
|
11
|
-
key = _Object$entries2$[0],
|
|
12
|
-
value = _Object$entries2$[1];
|
|
13
|
-
|
|
14
|
-
return "".concat(key, ":").concat(value);
|
|
15
|
-
};
|
|
16
2
|
export var deserializeSorters = function deserializeSorters(data) {
|
|
17
3
|
if (typeof data !== "string") {
|
|
18
4
|
return data;
|
|
19
5
|
}
|
|
20
6
|
|
|
21
|
-
var _ref = data.split("
|
|
7
|
+
var _ref = data.split("_"),
|
|
22
8
|
_ref2 = _slicedToArray(_ref, 2),
|
|
23
|
-
|
|
24
|
-
|
|
9
|
+
field = _ref2[0],
|
|
10
|
+
orderBy = _ref2[1];
|
|
25
11
|
|
|
26
|
-
|
|
12
|
+
var order = String(orderBy).toLowerCase() === "asc" ? "asc" : "desc";
|
|
13
|
+
return [field, order];
|
|
27
14
|
};
|