dattatable 2.8.5 → 2.8.7

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 (57) hide show
  1. package/build/common/index.d.ts +1 -0
  2. package/build/common/index.js +1 -0
  3. package/build/common/listSecurity.d.ts +13 -4
  4. package/build/common/listSecurity.js +84 -23
  5. package/build/lib.d.ts +1 -0
  6. package/dist/dattatable.js +12 -1
  7. package/dist/dattatable.min.js +1 -1
  8. package/docs/assets/search.js +1 -1
  9. package/docs/classes/AuditLog.html +13 -13
  10. package/docs/classes/CanvasForm.html +17 -17
  11. package/docs/classes/Comments.html +12 -12
  12. package/docs/classes/Dashboard.html +20 -20
  13. package/docs/classes/DataTable.html +12 -12
  14. package/docs/classes/Documents.html +45 -45
  15. package/docs/classes/FilterSlideout.html +14 -14
  16. package/docs/classes/Footer.html +4 -4
  17. package/docs/classes/Header.html +4 -4
  18. package/docs/classes/InstallationRequired.html +12 -12
  19. package/docs/classes/ItemForm.html +47 -47
  20. package/docs/classes/List.html +47 -47
  21. package/docs/classes/ListSecurity.html +245 -0
  22. package/docs/classes/LoadingDialog.html +12 -12
  23. package/docs/classes/Modal.html +26 -26
  24. package/docs/classes/Navigation.html +6 -6
  25. package/docs/classes/Timeout.html +7 -7
  26. package/docs/enums/ActionButtonTypes.html +6 -6
  27. package/docs/functions/formatBytes.html +4 -1
  28. package/docs/functions/formatDateValue.html +4 -1
  29. package/docs/functions/formatTimeValue.html +4 -1
  30. package/docs/functions/getFileExt.html +4 -1
  31. package/docs/index.html +3 -0
  32. package/docs/interfaces/IAuditLogItem.html +9 -9
  33. package/docs/interfaces/IAuditLogItemCreation.html +7 -7
  34. package/docs/interfaces/IAuditLogProps.html +5 -5
  35. package/docs/interfaces/IAuditLogViewProps.html +6 -6
  36. package/docs/interfaces/ICommentsItem.html +6 -6
  37. package/docs/interfaces/IDashboardProps.html +14 -14
  38. package/docs/interfaces/IDataTable.html +8 -8
  39. package/docs/interfaces/IDataTableProps.html +6 -6
  40. package/docs/interfaces/IDocumentsProps.html +25 -25
  41. package/docs/interfaces/IFilterItem.html +5 -5
  42. package/docs/interfaces/IFilterProps.html +4 -4
  43. package/docs/interfaces/IFooterProps.html +6 -6
  44. package/docs/interfaces/IHeaderProps.html +5 -5
  45. package/docs/interfaces/IInstallProps.html +4 -4
  46. package/docs/interfaces/IItemFormCreateProps.html +14 -14
  47. package/docs/interfaces/IItemFormEditProps.html +15 -15
  48. package/docs/interfaces/IItemFormTab.html +8 -8
  49. package/docs/interfaces/IItemFormTabInfo.html +3 -3
  50. package/docs/interfaces/IItemFormViewProps.html +12 -12
  51. package/docs/interfaces/IListProps.html +11 -11
  52. package/docs/interfaces/IListSecurity.html +122 -0
  53. package/docs/interfaces/IListSecurityItem.html +82 -0
  54. package/docs/interfaces/IShowDialogProps.html +7 -7
  55. package/docs/modules.html +6 -0
  56. package/docs/variables/DattaTable.html +9 -6
  57. package/package.json +1 -1
@@ -5,6 +5,7 @@ export * from "./documents";
5
5
  export * from "./installRequired";
6
6
  export * from "./itemForm";
7
7
  export * from "./list";
8
+ export * from "./listSecurity";
8
9
  export * from "./loadingDialog";
9
10
  export * from "./methods";
10
11
  export * from "./modal";
@@ -21,6 +21,7 @@ __exportStar(require("./documents"), exports);
21
21
  __exportStar(require("./installRequired"), exports);
22
22
  __exportStar(require("./itemForm"), exports);
23
23
  __exportStar(require("./list"), exports);
24
+ __exportStar(require("./listSecurity"), exports);
24
25
  __exportStar(require("./loadingDialog"), exports);
25
26
  __exportStar(require("./methods"), exports);
26
27
  __exportStar(require("./modal"), exports);
@@ -1,3 +1,11 @@
1
+ import { Types } from "gd-sprest-bs";
2
+ export interface IListSecurity {
3
+ createFl?: boolean;
4
+ listItems: IListSecurityItem[];
5
+ onGroupCreating?: (props: Types.SP.GroupCreationInformation) => Types.SP.GroupCreationInformation;
6
+ onGroupCreated?: (group: Types.SP.Group) => void;
7
+ webUrl?: string;
8
+ }
1
9
  export interface IListSecurityItem {
2
10
  groupName: string;
3
11
  listName: string;
@@ -9,14 +17,15 @@ export interface IListSecurityItem {
9
17
  */
10
18
  export declare class ListSecurity {
11
19
  private _ddlItems;
12
- private _listItems;
13
20
  private _permissionTypes;
14
- private _webUrl;
15
- constructor(listItems: IListSecurityItem[], webUrl?: string);
21
+ private _props;
22
+ constructor(props: IListSecurity);
16
23
  private configureList;
17
24
  private configureLists;
18
- private _groupIds;
25
+ private createGroups;
26
+ private _groups;
19
27
  private getGroupId;
28
+ private setGroupId;
20
29
  private renderModal;
21
30
  private getPermissionTypes;
22
31
  private resetPermissions;
@@ -10,18 +10,21 @@ var modal_1 = require("./modal");
10
10
  */
11
11
  var ListSecurity = /** @class */ (function () {
12
12
  // Constructor
13
- function ListSecurity(listItems, webUrl) {
13
+ function ListSecurity(props) {
14
14
  this._ddlItems = null;
15
- this._listItems = null;
16
15
  this._permissionTypes = null;
17
- this._webUrl = null;
16
+ this._props = null;
18
17
  // Gets the group id
19
- this._groupIds = {};
18
+ this._groups = {};
20
19
  // Save the properties
21
- this._listItems = listItems;
22
- this._webUrl = webUrl;
20
+ this._props = props;
23
21
  // Get the permission types
24
22
  this.getPermissionTypes();
23
+ // See if we are creating the groups
24
+ if (typeof (props.createFl) === "undefined" || props.createFl) {
25
+ // Create the groups
26
+ this.createGroups();
27
+ }
25
28
  }
26
29
  // Configures a list
27
30
  ListSecurity.prototype.configureList = function (listInfo) {
@@ -36,7 +39,7 @@ var ListSecurity = /** @class */ (function () {
36
39
  // Exists
37
40
  function (groupId) {
38
41
  // Add the group to the list
39
- (0, gd_sprest_bs_1.Web)(_this._webUrl).Lists(listInfo.listName).RoleAssignments().addRoleAssignment(groupId, permissionId).execute(resolve, function () {
42
+ (0, gd_sprest_bs_1.Web)(_this._props.webUrl).Lists(listInfo.listName).RoleAssignments().addRoleAssignment(groupId, permissionId).execute(resolve, function () {
40
43
  // Log to the console
41
44
  console.error("[".concat(listInfo.listName, "] Error adding the group '").concat(listInfo.groupName, "' with permission ").concat(listInfo.permission, " to the list."));
42
45
  // Resolve the request
@@ -79,46 +82,104 @@ var ListSecurity = /** @class */ (function () {
79
82
  });
80
83
  });
81
84
  };
85
+ // Creates the security groups
86
+ ListSecurity.prototype.createGroups = function () {
87
+ var _this = this;
88
+ // Return a promise
89
+ return new Promise(function (resolve, reject) {
90
+ // Parse the list items
91
+ var data = {};
92
+ for (var i = 0; i < _this._props.listItems.length; i++) {
93
+ // Add the group name
94
+ data[_this._props.listItems[i].groupName.toLowerCase()] = true;
95
+ }
96
+ // Get the group names
97
+ var groupNames = [];
98
+ for (var key in data) {
99
+ groupNames.push(key);
100
+ }
101
+ // Parse the group names
102
+ gd_sprest_bs_1.Helper.Executor(groupNames, function (groupName) {
103
+ // Return a promise
104
+ return new Promise(function (resolve) {
105
+ // Get the group
106
+ _this.getGroupId(groupName).then(
107
+ // Group exists
108
+ function (group) {
109
+ // Check the next group
110
+ resolve(group);
111
+ },
112
+ // Group doesn't exist
113
+ function () {
114
+ // Create the properties
115
+ var props = {
116
+ Title: groupName
117
+ };
118
+ // Call the event if it exists
119
+ props = _this._props.onGroupCreating ? _this._props.onGroupCreating(props) : props;
120
+ // Create the group
121
+ (0, gd_sprest_bs_1.Web)(_this._props.webUrl).SiteGroups().add(props).execute(
122
+ // Successfully created the group
123
+ function (group) {
124
+ // Set the group id
125
+ _this.setGroupId(groupName.toLowerCase(), group);
126
+ // Call the event
127
+ _this._props.onGroupCreated ? _this._props.onGroupCreated(group) : null;
128
+ // Check the next group
129
+ resolve(group);
130
+ },
131
+ // Error creating the group
132
+ function () {
133
+ // Log to the console
134
+ console.error("Site Group '".concat(groupName, "' was unable to be created."));
135
+ // Check the next group
136
+ resolve(null);
137
+ });
138
+ });
139
+ });
140
+ });
141
+ });
142
+ };
82
143
  ListSecurity.prototype.getGroupId = function (groupName) {
83
144
  var _this = this;
84
145
  // Return a promise
85
146
  return new Promise(function (resolve, reject) {
86
147
  var key = groupName.toLowerCase();
87
148
  // See if we have already have it
88
- if (_this._groupIds[key]) {
149
+ if (_this._groups[key]) {
89
150
  // Resolve the request
90
- resolve(_this._groupIds[key]);
151
+ resolve(_this._groups[key].Id);
91
152
  return;
92
153
  }
93
- // Saves the group information
94
- var saveGroupInfo = function (group) {
95
- // Save the info
96
- _this._groupIds[key] = group.Id;
97
- // Resolve the request
98
- resolve(group.Id);
99
- };
100
154
  // Get the group information
101
155
  switch (key) {
102
156
  // Default owner's group
103
157
  case "owner":
104
- (0, gd_sprest_bs_1.Web)(_this._webUrl).AssociatedOwnerGroup().execute(saveGroupInfo, reject);
158
+ (0, gd_sprest_bs_1.Web)(_this._props.webUrl).AssociatedOwnerGroup().execute(function (group) { resolve(_this.setGroupId(key, group)); }, reject);
105
159
  break;
106
160
  // Default member's group
107
161
  case "member":
108
- (0, gd_sprest_bs_1.Web)(_this._webUrl).AssociatedMemberGroup().execute(saveGroupInfo, reject);
162
+ (0, gd_sprest_bs_1.Web)(_this._props.webUrl).AssociatedMemberGroup().execute(function (group) { resolve(_this.setGroupId(key, group)); }, reject);
109
163
  break;
110
164
  // Default visitor's group
111
165
  case "visitor":
112
- (0, gd_sprest_bs_1.Web)(_this._webUrl).AssociatedVisitorGroup().execute(saveGroupInfo, reject);
166
+ (0, gd_sprest_bs_1.Web)(_this._props.webUrl).AssociatedVisitorGroup().execute(function (group) { resolve(_this.setGroupId(key, group)); }, reject);
113
167
  break;
114
168
  // Default
115
169
  default:
116
170
  // Get the group
117
- (0, gd_sprest_bs_1.Web)(_this._webUrl).SiteGroups().getByName(groupName).execute(saveGroupInfo, reject);
171
+ (0, gd_sprest_bs_1.Web)(_this._props.webUrl).SiteGroups().getByName(groupName).execute(function (group) { resolve(_this.setGroupId(key, group)); }, reject);
118
172
  break;
119
173
  }
120
174
  });
121
175
  };
176
+ // Saves the group information
177
+ ListSecurity.prototype.setGroupId = function (key, group) {
178
+ // Save the info
179
+ this._groups[key] = group;
180
+ // Return the group id
181
+ return group.Id;
182
+ };
122
183
  // Render the modal
123
184
  ListSecurity.prototype.renderModal = function () {
124
185
  var _this = this;
@@ -128,8 +189,8 @@ var ListSecurity = /** @class */ (function () {
128
189
  modal_1.Modal.setHeader("List Security");
129
190
  // Parse the lists
130
191
  var rows = [];
131
- for (var i = 0; i < this._listItems.length; i++) {
132
- var listItem = this._listItems[i];
192
+ for (var i = 0; i < this._props.listItems.length; i++) {
193
+ var listItem = this._props.listItems[i];
133
194
  // Add the row
134
195
  rows.push({
135
196
  isAutoSized: true,
@@ -251,7 +312,7 @@ var ListSecurity = /** @class */ (function () {
251
312
  return new Promise(function (resolve) {
252
313
  // Parse the list keys
253
314
  for (var listName in lists) {
254
- var list = (0, gd_sprest_bs_1.Web)(_this._webUrl).Lists(listName);
315
+ var list = (0, gd_sprest_bs_1.Web)(_this._props.webUrl).Lists(listName);
255
316
  // Reset the permissions
256
317
  list.resetRoleInheritance().execute();
257
318
  // Revert to the default
package/build/lib.d.ts CHANGED
@@ -19,6 +19,7 @@ export declare const DattaTable: {
19
19
  InstallationRequired: typeof Common.InstallationRequired;
20
20
  ItemForm: typeof Common.ItemForm;
21
21
  List: typeof Common.List;
22
+ ListSecurity: typeof Common.ListSecurity;
22
23
  LoadingDialog: typeof Common.LoadingDialog;
23
24
  formatBytes: (bytes: number, decimals?: number) => string;
24
25
  formatDateValue: (value: string, format?: string) => string;
@@ -71,7 +71,7 @@ eval("\r\nvar __assign = (this && this.__assign) || function () {\r\n __assig
71
71
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
72
72
 
73
73
  "use strict";
74
- eval("\r\n/** Common Components */\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n__exportStar(__webpack_require__(/*! ./canvas */ \"./build/common/canvas.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./comments */ \"./build/common/comments.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./documents */ \"./build/common/documents.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./installRequired */ \"./build/common/installRequired.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./itemForm */ \"./build/common/itemForm.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./list */ \"./build/common/list.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./loadingDialog */ \"./build/common/loadingDialog.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./methods */ \"./build/common/methods.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./modal */ \"./build/common/modal.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./timeout */ \"./build/common/timeout.js\"), exports);\r\n\n\n//# sourceURL=webpack://dattatable/./build/common/index.js?");
74
+ eval("\r\n/** Common Components */\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n__exportStar(__webpack_require__(/*! ./canvas */ \"./build/common/canvas.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./comments */ \"./build/common/comments.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./documents */ \"./build/common/documents.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./installRequired */ \"./build/common/installRequired.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./itemForm */ \"./build/common/itemForm.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./list */ \"./build/common/list.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./listSecurity */ \"./build/common/listSecurity.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./loadingDialog */ \"./build/common/loadingDialog.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./methods */ \"./build/common/methods.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./modal */ \"./build/common/modal.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./timeout */ \"./build/common/timeout.js\"), exports);\r\n\n\n//# sourceURL=webpack://dattatable/./build/common/index.js?");
75
75
 
76
76
  /***/ }),
77
77
 
@@ -108,6 +108,17 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
108
108
 
109
109
  /***/ }),
110
110
 
111
+ /***/ "./build/common/listSecurity.js":
112
+ /*!**************************************!*\
113
+ !*** ./build/common/listSecurity.js ***!
114
+ \**************************************/
115
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
116
+
117
+ "use strict";
118
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ListSecurity = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.10.59/node_modules/gd-sprest-bs/build/index.js\");\r\nvar loadingDialog_1 = __webpack_require__(/*! ./loadingDialog */ \"./build/common/loadingDialog.js\");\r\nvar modal_1 = __webpack_require__(/*! ./modal */ \"./build/common/modal.js\");\r\n/**\r\n * List Security\r\n * This component is used for setting the security group/permissions for a list.\r\n */\r\nvar ListSecurity = /** @class */ (function () {\r\n // Constructor\r\n function ListSecurity(props) {\r\n this._ddlItems = null;\r\n this._permissionTypes = null;\r\n this._props = null;\r\n // Gets the group id\r\n this._groups = {};\r\n // Save the properties\r\n this._props = props;\r\n // Get the permission types\r\n this.getPermissionTypes();\r\n // See if we are creating the groups\r\n if (typeof (props.createFl) === \"undefined\" || props.createFl) {\r\n // Create the groups\r\n this.createGroups();\r\n }\r\n }\r\n // Configures a list\r\n ListSecurity.prototype.configureList = function (listInfo) {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Ensure a permission exists\r\n var permissionId = _this._permissionTypes[listInfo.permission];\r\n if (permissionId > 0) {\r\n // Get the group id\r\n _this.getGroupId(listInfo.groupName).then(\r\n // Exists\r\n function (groupId) {\r\n // Add the group to the list\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).Lists(listInfo.listName).RoleAssignments().addRoleAssignment(groupId, permissionId).execute(resolve, function () {\r\n // Log to the console\r\n console.error(\"[\".concat(listInfo.listName, \"] Error adding the group '\").concat(listInfo.groupName, \"' with permission \").concat(listInfo.permission, \" to the list.\"));\r\n // Resolve the request\r\n resolve();\r\n });\r\n }, \r\n // Error\r\n function () {\r\n // Log to the console\r\n console.error(\"[\".concat(listInfo.listName, \"] Site Group '\").concat(listInfo.groupName, \"' doesn't exist\"));\r\n // Resolve the request\r\n resolve();\r\n });\r\n }\r\n else {\r\n // Resolve the request\r\n resolve();\r\n }\r\n });\r\n };\r\n // Configures the lists\r\n ListSecurity.prototype.configureLists = function (lists) {\r\n var _this = this;\r\n var counter = 0;\r\n // Show a loading dialog\r\n loadingDialog_1.LoadingDialog.setHeader(\"Configuring Lists\");\r\n loadingDialog_1.LoadingDialog.setBody(\"This will close after the lists are configured...\");\r\n loadingDialog_1.LoadingDialog.show();\r\n // Reset the lists\r\n this.resetPermissions(lists).then(function () {\r\n // Parse the lists\r\n gd_sprest_bs_1.Helper.Executor(lists, function (list) {\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Update the loading dialog\r\n loadingDialog_1.LoadingDialog.setBody(\"Configuring \".concat(++counter, \" of \").concat(lists.length, \" lists...\"));\r\n // Configure the list\r\n _this.configureList(list).then(resolve);\r\n });\r\n });\r\n });\r\n };\r\n // Creates the security groups\r\n ListSecurity.prototype.createGroups = function () {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // Parse the list items\r\n var data = {};\r\n for (var i = 0; i < _this._props.listItems.length; i++) {\r\n // Add the group name\r\n data[_this._props.listItems[i].groupName.toLowerCase()] = true;\r\n }\r\n // Get the group names\r\n var groupNames = [];\r\n for (var key in data) {\r\n groupNames.push(key);\r\n }\r\n // Parse the group names\r\n gd_sprest_bs_1.Helper.Executor(groupNames, function (groupName) {\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Get the group\r\n _this.getGroupId(groupName).then(\r\n // Group exists\r\n function (group) {\r\n // Check the next group\r\n resolve(group);\r\n }, \r\n // Group doesn't exist\r\n function () {\r\n // Create the properties\r\n var props = {\r\n Title: groupName\r\n };\r\n // Call the event if it exists\r\n props = _this._props.onGroupCreating ? _this._props.onGroupCreating(props) : props;\r\n // Create the group\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).SiteGroups().add(props).execute(\r\n // Successfully created the group\r\n function (group) {\r\n // Set the group id\r\n _this.setGroupId(groupName.toLowerCase(), group);\r\n // Call the event\r\n _this._props.onGroupCreated ? _this._props.onGroupCreated(group) : null;\r\n // Check the next group\r\n resolve(group);\r\n }, \r\n // Error creating the group\r\n function () {\r\n // Log to the console\r\n console.error(\"Site Group '\".concat(groupName, \"' was unable to be created.\"));\r\n // Check the next group\r\n resolve(null);\r\n });\r\n });\r\n });\r\n });\r\n });\r\n };\r\n ListSecurity.prototype.getGroupId = function (groupName) {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n var key = groupName.toLowerCase();\r\n // See if we have already have it\r\n if (_this._groups[key]) {\r\n // Resolve the request\r\n resolve(_this._groups[key].Id);\r\n return;\r\n }\r\n // Get the group information\r\n switch (key) {\r\n // Default owner's group\r\n case \"owner\":\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).AssociatedOwnerGroup().execute(function (group) { resolve(_this.setGroupId(key, group)); }, reject);\r\n break;\r\n // Default member's group\r\n case \"member\":\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).AssociatedMemberGroup().execute(function (group) { resolve(_this.setGroupId(key, group)); }, reject);\r\n break;\r\n // Default visitor's group\r\n case \"visitor\":\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).AssociatedVisitorGroup().execute(function (group) { resolve(_this.setGroupId(key, group)); }, reject);\r\n break;\r\n // Default\r\n default:\r\n // Get the group\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).SiteGroups().getByName(groupName).execute(function (group) { resolve(_this.setGroupId(key, group)); }, reject);\r\n break;\r\n }\r\n });\r\n };\r\n // Saves the group information\r\n ListSecurity.prototype.setGroupId = function (key, group) {\r\n // Save the info\r\n this._groups[key] = group;\r\n // Return the group id\r\n return group.Id;\r\n };\r\n // Render the modal\r\n ListSecurity.prototype.renderModal = function () {\r\n var _this = this;\r\n // Clear the modal\r\n modal_1.Modal.clear();\r\n // Set the header\r\n modal_1.Modal.setHeader(\"List Security\");\r\n // Parse the lists\r\n var rows = [];\r\n for (var i = 0; i < this._props.listItems.length; i++) {\r\n var listItem = this._props.listItems[i];\r\n // Add the row\r\n rows.push({\r\n isAutoSized: true,\r\n columns: [\r\n {\r\n control: {\r\n name: \"listName_\" + i,\r\n label: \"List Name\",\r\n type: gd_sprest_bs_1.Components.FormControlTypes.Readonly,\r\n value: listItem.listName\r\n }\r\n },\r\n {\r\n control: {\r\n name: \"groupName_\" + i,\r\n label: \"Group Name\",\r\n type: gd_sprest_bs_1.Components.FormControlTypes.Readonly,\r\n value: listItem.groupName\r\n }\r\n },\r\n {\r\n control: {\r\n name: \"permission_\" + i,\r\n label: \"Permission\",\r\n type: gd_sprest_bs_1.Components.FormControlTypes.Dropdown,\r\n items: this._ddlItems,\r\n required: true,\r\n value: listItem.permission\r\n }\r\n }\r\n ]\r\n });\r\n }\r\n // Render the form\r\n var form = gd_sprest_bs_1.Components.Form({\r\n el: modal_1.Modal.BodyElement,\r\n rows: rows\r\n });\r\n // Render the footer\r\n gd_sprest_bs_1.Components.TooltipGroup({\r\n el: modal_1.Modal.FooterElement,\r\n tooltips: [\r\n {\r\n content: \"Closes the modal\",\r\n btnProps: {\r\n text: \"Cancel\",\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlineDanger,\r\n onClick: function () {\r\n // Close the modal\r\n modal_1.Modal.hide();\r\n }\r\n }\r\n },\r\n {\r\n content: \"Configures the security for the lists.\",\r\n btnProps: {\r\n text: \"Configure\",\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlinePrimary,\r\n onClick: function () {\r\n var lists = [];\r\n // Get the form values\r\n var tableData = form.getValues();\r\n // Parse the # of rows\r\n for (var i = 0; i < rows.length; i++) {\r\n // Add the list information\r\n lists.push({\r\n groupName: tableData[\"groupName_\" + i],\r\n listName: tableData[\"listName_\" + i],\r\n permission: tableData[\"permission_\" + i]\r\n });\r\n }\r\n // Configure the lists\r\n _this.configureLists(lists);\r\n }\r\n }\r\n }\r\n ]\r\n });\r\n // Show the modal\r\n modal_1.Modal.show();\r\n };\r\n // Get the permission types\r\n ListSecurity.prototype.getPermissionTypes = function () {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Get the definitions\r\n (0, gd_sprest_bs_1.Web)().RoleDefinitions().query({\r\n OrderBy: [\"Name\"]\r\n }).execute(function (roleDefs) {\r\n // Clear the permissions and items\r\n _this._ddlItems = [{ text: \"No Permission\" }];\r\n _this._permissionTypes = {};\r\n // Parse the role definitions\r\n for (var i = 0; i < roleDefs.results.length; i++) {\r\n var roleDef = roleDefs.results[i];\r\n // Add the role and item\r\n var value = roleDef.RoleTypeKind > 0 ? roleDef.RoleTypeKind : roleDef.Name;\r\n _this._permissionTypes[value] = roleDef.Id;\r\n _this._ddlItems.push({\r\n data: roleDef,\r\n text: roleDef.Name,\r\n value: value.toString()\r\n });\r\n }\r\n });\r\n });\r\n };\r\n // Reset list permissions\r\n ListSecurity.prototype.resetPermissions = function (listItems) {\r\n var _this = this;\r\n // Parse the lists\r\n var lists = {};\r\n for (var i = 0; i < listItems.length; i++) {\r\n // Add the list\r\n lists[listItems[i].listName] = true;\r\n }\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Parse the list keys\r\n for (var listName in lists) {\r\n var list = (0, gd_sprest_bs_1.Web)(_this._props.webUrl).Lists(listName);\r\n // Reset the permissions\r\n list.resetRoleInheritance().execute();\r\n // Revert to the default\r\n list.breakRoleInheritance(false, true).execute(true);\r\n // Wait for the requests to complete\r\n list.done(resolve);\r\n }\r\n });\r\n };\r\n // Shows the modal\r\n ListSecurity.prototype.show = function () {\r\n var _this = this;\r\n // Ensure the permissions are loaded\r\n var loopId = setInterval(function () {\r\n // See if the permissions exist\r\n if (_this._ddlItems && _this._permissionTypes) {\r\n // Show the modal\r\n _this.renderModal();\r\n // Stop the loop\r\n clearInterval(loopId);\r\n }\r\n }, 10);\r\n };\r\n return ListSecurity;\r\n}());\r\nexports.ListSecurity = ListSecurity;\r\n\n\n//# sourceURL=webpack://dattatable/./build/common/listSecurity.js?");
119
+
120
+ /***/ }),
121
+
111
122
  /***/ "./build/common/loadingDialog.js":
112
123
  /*!***************************************!*\
113
124
  !*** ./build/common/loadingDialog.js ***!