dattatable 2.9.31 → 2.9.33
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/build/common/itemForm.d.ts +1 -0
- package/build/common/itemForm.js +27 -20
- package/build/common/list.d.ts +3 -1
- package/build/common/list.js +70 -34
- package/build/common/listSecurity.d.ts +1 -0
- package/build/common/listSecurity.js +23 -15
- package/build/common/methods.d.ts +1 -0
- package/build/common/methods.js +21 -1
- package/build/lib.d.ts +1 -0
- package/dist/dattatable.js +707 -707
- package/dist/dattatable.min.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/AuditLog.html +2 -2
- package/docs/classes/CanvasForm.html +2 -2
- package/docs/classes/Comments.html +2 -2
- package/docs/classes/Dashboard.html +4 -4
- package/docs/classes/DataTable.html +3 -3
- package/docs/classes/Documents.html +6 -6
- package/docs/classes/FilterSlideout.html +2 -2
- package/docs/classes/Footer.html +2 -2
- package/docs/classes/Header.html +2 -2
- package/docs/classes/InstallationRequired.html +2 -2
- package/docs/classes/ItemForm.html +5 -4
- package/docs/classes/List.html +6 -4
- package/docs/classes/ListSecurity.html +3 -2
- package/docs/classes/LoadingDialog.html +2 -2
- package/docs/classes/Modal.html +2 -2
- package/docs/classes/Navigation.html +3 -3
- package/docs/classes/Timeout.html +2 -2
- package/docs/enums/ActionButtonTypes.html +2 -2
- package/docs/functions/formatBytes.html +1 -1
- package/docs/functions/formatDateValue.html +1 -1
- package/docs/functions/formatTimeValue.html +1 -1
- package/docs/functions/getContextInfo.html +1 -0
- package/docs/functions/getFileExt.html +1 -1
- package/docs/functions/waitForTheme.html +1 -1
- package/docs/interfaces/IAuditLogItem.html +2 -2
- package/docs/interfaces/IAuditLogItemCreation.html +2 -2
- package/docs/interfaces/IAuditLogProps.html +2 -2
- package/docs/interfaces/IAuditLogViewProps.html +2 -2
- package/docs/interfaces/ICommentsItem.html +2 -2
- package/docs/interfaces/IDashboardProps.html +2 -2
- package/docs/interfaces/IDataTable.html +2 -2
- package/docs/interfaces/IDataTableProps.html +2 -2
- package/docs/interfaces/IDocumentsProps.html +2 -2
- package/docs/interfaces/IFilterItem.html +2 -2
- package/docs/interfaces/IFilterProps.html +2 -2
- package/docs/interfaces/IFooterProps.html +2 -2
- package/docs/interfaces/IHeaderProps.html +2 -2
- package/docs/interfaces/IInstallProps.html +2 -2
- package/docs/interfaces/IItemFormCreateProps.html +2 -2
- package/docs/interfaces/IItemFormEditProps.html +2 -2
- package/docs/interfaces/IItemFormTab.html +2 -2
- package/docs/interfaces/IItemFormTabInfo.html +2 -2
- package/docs/interfaces/IItemFormViewProps.html +2 -2
- package/docs/interfaces/IListProps.html +2 -2
- package/docs/interfaces/IListSecurity.html +2 -2
- package/docs/interfaces/IListSecurityItem.html +2 -2
- package/docs/interfaces/IShowDialogProps.html +2 -2
- package/docs/modules.html +1 -0
- package/docs/variables/DattaTable.html +1 -1
- package/docs/variables/ListSecurityDefaultGroups.html +1 -1
- package/package.json +2 -2
- package/pnpm-lock.yaml +10 -10
package/build/common/itemForm.js
CHANGED
|
@@ -185,28 +185,34 @@ var ItemForm = /** @class */ (function () {
|
|
|
185
185
|
// Resolve the request
|
|
186
186
|
resolve(null);
|
|
187
187
|
};
|
|
188
|
-
//
|
|
189
|
-
|
|
190
|
-
//
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
// Set the list form properties
|
|
195
|
-
var listProps = {
|
|
196
|
-
listName: _this.ListName,
|
|
197
|
-
itemId: itemId,
|
|
198
|
-
webUrl: webUrl
|
|
199
|
-
};
|
|
200
|
-
// Call the event
|
|
201
|
-
listProps = _this._onGetListInfo ? _this._onGetListInfo(listProps) : listProps;
|
|
202
|
-
// Load the form info
|
|
203
|
-
gd_sprest_bs_1.Helper.ListForm.create(listProps).then(function (info) {
|
|
204
|
-
// Save the information
|
|
205
|
-
_this._info = info;
|
|
188
|
+
// Get the context information
|
|
189
|
+
(0, _1.getContextInfo)(webUrl).then(function (requestDigest) {
|
|
190
|
+
// Set the request digest
|
|
191
|
+
_this._requestDigest = requestDigest;
|
|
192
|
+
// See if the info already exists
|
|
193
|
+
if (_this._info) {
|
|
206
194
|
// Form information is already loaded
|
|
207
195
|
onComplete();
|
|
208
|
-
}
|
|
209
|
-
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
// Set the list form properties
|
|
199
|
+
var listProps = {
|
|
200
|
+
listName: _this.ListName,
|
|
201
|
+
itemId: itemId,
|
|
202
|
+
requestDigest: requestDigest,
|
|
203
|
+
webUrl: webUrl
|
|
204
|
+
};
|
|
205
|
+
// Call the event
|
|
206
|
+
listProps = _this._onGetListInfo ? _this._onGetListInfo(listProps) : listProps;
|
|
207
|
+
// Load the form info
|
|
208
|
+
gd_sprest_bs_1.Helper.ListForm.create(listProps).then(function (info) {
|
|
209
|
+
// Save the information
|
|
210
|
+
_this._info = info;
|
|
211
|
+
// Form information is already loaded
|
|
212
|
+
onComplete();
|
|
213
|
+
}, reject);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
210
216
|
});
|
|
211
217
|
};
|
|
212
218
|
// Renders the display form
|
|
@@ -516,6 +522,7 @@ var ItemForm = /** @class */ (function () {
|
|
|
516
522
|
ItemForm._onShowForm = null;
|
|
517
523
|
ItemForm._onSave = null;
|
|
518
524
|
ItemForm._onValidation = null;
|
|
525
|
+
ItemForm._requestDigest = null;
|
|
519
526
|
ItemForm._tabInfo = null;
|
|
520
527
|
ItemForm._updateEvent = null;
|
|
521
528
|
// Display Form
|
package/build/common/list.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Types } from "gd-sprest-bs";
|
|
2
|
-
import { IItemFormCreateProps, IItemFormEditProps, IItemFormViewProps } from "
|
|
2
|
+
import { IItemFormCreateProps, IItemFormEditProps, IItemFormViewProps } from ".";
|
|
3
3
|
/** List Properties */
|
|
4
4
|
export interface IListProps<T = Types.SP.ListItem> {
|
|
5
5
|
itemQuery?: Types.IODataQuery;
|
|
@@ -51,6 +51,7 @@ export declare class List<T = Types.SP.ListItem> {
|
|
|
51
51
|
private _onLoadFormError;
|
|
52
52
|
private _onRefreshItems?;
|
|
53
53
|
private _onResetForm;
|
|
54
|
+
private _requestDigest;
|
|
54
55
|
constructor(props: IListProps<T>);
|
|
55
56
|
private clear;
|
|
56
57
|
createItem(values: any): PromiseLike<T>;
|
|
@@ -62,6 +63,7 @@ export declare class List<T = Types.SP.ListItem> {
|
|
|
62
63
|
private loadItemsByQuery;
|
|
63
64
|
private loadItemsByView;
|
|
64
65
|
refresh(query?: Types.IODataQuery): PromiseLike<T[]>;
|
|
66
|
+
private refreshContextInfo;
|
|
65
67
|
refreshItem(itemId: number, query?: Types.IODataQuery): PromiseLike<T>;
|
|
66
68
|
updateItem(itemId: number, values: any): PromiseLike<void>;
|
|
67
69
|
viewForm(props: IItemFormViewProps): void;
|
package/build/common/list.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.List = void 0;
|
|
4
4
|
var gd_sprest_bs_1 = require("gd-sprest-bs");
|
|
5
|
-
var
|
|
5
|
+
var _1 = require(".");
|
|
6
6
|
/**
|
|
7
7
|
* List
|
|
8
8
|
*/
|
|
@@ -45,6 +45,8 @@ var List = /** @class */ (function () {
|
|
|
45
45
|
this._onRefreshItems = null;
|
|
46
46
|
// Event triggered when the form is reset
|
|
47
47
|
this._onResetForm = null;
|
|
48
|
+
// The request digest value of the target site
|
|
49
|
+
this._requestDigest = null;
|
|
48
50
|
// Save the properties
|
|
49
51
|
this._listName = props.listName;
|
|
50
52
|
this._odata = props.itemQuery;
|
|
@@ -56,14 +58,25 @@ var List = /** @class */ (function () {
|
|
|
56
58
|
this._onResetForm = props.onResetForm;
|
|
57
59
|
this._viewName = props.viewName;
|
|
58
60
|
this._webUrl = props.webUrl || gd_sprest_bs_1.ContextInfo.webServerRelativeUrl;
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
// Set the context information
|
|
62
|
+
(0, _1.getContextInfo)(props.webUrl).then(function (requestDigest) {
|
|
63
|
+
_this._requestDigest = requestDigest;
|
|
64
|
+
// Load the list information
|
|
65
|
+
_this.init().then(function () {
|
|
66
|
+
// Load the items
|
|
67
|
+
_this.loadItems().then(function () {
|
|
68
|
+
// Call the event
|
|
69
|
+
_this._onInitialized ? _this._onInitialized() : null;
|
|
70
|
+
// Call the items loaded event
|
|
71
|
+
_this._onItemsLoaded ? _this._onItemsLoaded(_this.Items) : null;
|
|
72
|
+
}, function () {
|
|
73
|
+
var args = [];
|
|
74
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
75
|
+
args[_i] = arguments[_i];
|
|
76
|
+
}
|
|
77
|
+
// Call the init error event
|
|
78
|
+
_this._onInitError ? _this._onInitError.apply(_this, args) : null;
|
|
79
|
+
});
|
|
67
80
|
}, function () {
|
|
68
81
|
var args = [];
|
|
69
82
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -84,13 +97,13 @@ var List = /** @class */ (function () {
|
|
|
84
97
|
Object.defineProperty(List.prototype, "EditForm", {
|
|
85
98
|
/** Public Properties */
|
|
86
99
|
// Reference to the edit form
|
|
87
|
-
get: function () { return
|
|
100
|
+
get: function () { return _1.ItemForm.EditForm; },
|
|
88
101
|
enumerable: false,
|
|
89
102
|
configurable: true
|
|
90
103
|
});
|
|
91
104
|
Object.defineProperty(List.prototype, "EditForms", {
|
|
92
105
|
// Reference to the edit forms, if tabs are used
|
|
93
|
-
get: function () { return
|
|
106
|
+
get: function () { return _1.ItemForm.EditForms; },
|
|
94
107
|
enumerable: false,
|
|
95
108
|
configurable: true
|
|
96
109
|
});
|
|
@@ -136,13 +149,13 @@ var List = /** @class */ (function () {
|
|
|
136
149
|
});
|
|
137
150
|
Object.defineProperty(List.prototype, "ViewForm", {
|
|
138
151
|
// Reference to the display form
|
|
139
|
-
get: function () { return
|
|
152
|
+
get: function () { return _1.ItemForm.DisplayForm; },
|
|
140
153
|
enumerable: false,
|
|
141
154
|
configurable: true
|
|
142
155
|
});
|
|
143
156
|
Object.defineProperty(List.prototype, "ViewForms", {
|
|
144
157
|
// Reference to the display forms, if tabs are used
|
|
145
|
-
get: function () { return
|
|
158
|
+
get: function () { return _1.ItemForm.DisplayForms; },
|
|
146
159
|
enumerable: false,
|
|
147
160
|
configurable: true
|
|
148
161
|
});
|
|
@@ -164,9 +177,9 @@ var List = /** @class */ (function () {
|
|
|
164
177
|
// Clears the modal or canvas
|
|
165
178
|
List.prototype.clear = function () {
|
|
166
179
|
// Clear the modal/form
|
|
167
|
-
|
|
180
|
+
_1.ItemForm.UseModal ? _1.Modal.clear() : _1.CanvasForm.clear();
|
|
168
181
|
// Set the list name
|
|
169
|
-
|
|
182
|
+
_1.ItemForm.ListName = this.ListName;
|
|
170
183
|
// Call the event
|
|
171
184
|
this._onResetForm ? this._onResetForm() : null;
|
|
172
185
|
};
|
|
@@ -184,21 +197,21 @@ var List = /** @class */ (function () {
|
|
|
184
197
|
// Clear the modal/canvas
|
|
185
198
|
this.clear();
|
|
186
199
|
// Display the form
|
|
187
|
-
|
|
200
|
+
_1.ItemForm.create(props).then(null, this._onLoadFormError);
|
|
188
201
|
};
|
|
189
202
|
// Displays the edit form
|
|
190
203
|
List.prototype.editForm = function (props) {
|
|
191
204
|
// Clear the modal/canvas
|
|
192
205
|
this.clear();
|
|
193
206
|
// Display the form
|
|
194
|
-
|
|
207
|
+
_1.ItemForm.edit(props).then(null, this._onLoadFormError);
|
|
195
208
|
};
|
|
196
209
|
// Initializes the list component
|
|
197
210
|
List.prototype.init = function () {
|
|
198
211
|
var _this = this;
|
|
199
212
|
// Return a promise
|
|
200
213
|
return new Promise(function (resolve, reject) {
|
|
201
|
-
var list = (0, gd_sprest_bs_1.Web)(_this.WebUrl).Lists(_this.ListName);
|
|
214
|
+
var list = (0, gd_sprest_bs_1.Web)(_this.WebUrl, { requestDigest: _this._requestDigest }).Lists(_this.ListName);
|
|
202
215
|
// Query the list content types
|
|
203
216
|
list.execute(function (list) {
|
|
204
217
|
// Save the list information
|
|
@@ -260,7 +273,7 @@ var List = /** @class */ (function () {
|
|
|
260
273
|
// Return a promise
|
|
261
274
|
return new Promise(function (resolve, reject) {
|
|
262
275
|
// Query the items
|
|
263
|
-
(0, gd_sprest_bs_1.Web)(_this.WebUrl).Lists(_this.ListName).Items(itemId).query({
|
|
276
|
+
(0, gd_sprest_bs_1.Web)(_this.WebUrl, { requestDigest: _this._requestDigest }).Lists(_this.ListName).Items(itemId).query({
|
|
264
277
|
Custom: query ? query.Custom : null,
|
|
265
278
|
Expand: query ? query.Expand : null,
|
|
266
279
|
Select: query ? query.Select : null
|
|
@@ -319,7 +332,7 @@ var List = /** @class */ (function () {
|
|
|
319
332
|
return;
|
|
320
333
|
}
|
|
321
334
|
// Query the items
|
|
322
|
-
(0, gd_sprest_bs_1.Web)(_this.WebUrl).Lists(_this.ListName).Items().query(query).execute(function (items) {
|
|
335
|
+
(0, gd_sprest_bs_1.Web)(_this.WebUrl, { requestDigest: _this._requestDigest }).Lists(_this.ListName).Items().query(query).execute(function (items) {
|
|
323
336
|
// Save the items
|
|
324
337
|
_this._items = items.results;
|
|
325
338
|
// Resolve the request
|
|
@@ -345,7 +358,7 @@ var List = /** @class */ (function () {
|
|
|
345
358
|
return;
|
|
346
359
|
}
|
|
347
360
|
// Query the items
|
|
348
|
-
(0, gd_sprest_bs_1.Web)(_this.WebUrl).Lists(_this.ListName).getItems(_this.ViewXml).execute(function (items) {
|
|
361
|
+
(0, gd_sprest_bs_1.Web)(_this.WebUrl, { requestDigest: _this._requestDigest }).Lists(_this.ListName).getItems(_this.ViewXml).execute(function (items) {
|
|
349
362
|
// Save the items
|
|
350
363
|
_this._items = items.results;
|
|
351
364
|
// Resolve the request
|
|
@@ -368,21 +381,44 @@ var List = /** @class */ (function () {
|
|
|
368
381
|
this._items = null;
|
|
369
382
|
// Return a promise
|
|
370
383
|
return new Promise(function (resolve, reject) {
|
|
371
|
-
//
|
|
372
|
-
_this.
|
|
373
|
-
//
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
callback.then
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
384
|
+
// Refresh the context information
|
|
385
|
+
_this.refreshContextInfo().then(function () {
|
|
386
|
+
// Load the data
|
|
387
|
+
_this.loadItems(query).then(function (items) {
|
|
388
|
+
// Call the event
|
|
389
|
+
var callback = _this._onRefreshItems ? _this._onRefreshItems(items) : null;
|
|
390
|
+
if (callback && typeof (callback.then) === "function") {
|
|
391
|
+
// Wait for the request to complete
|
|
392
|
+
callback.then(resolve, reject);
|
|
393
|
+
}
|
|
394
|
+
else {
|
|
395
|
+
// Resolve the request
|
|
396
|
+
resolve(items);
|
|
397
|
+
}
|
|
398
|
+
}, reject);
|
|
383
399
|
}, reject);
|
|
384
400
|
});
|
|
385
401
|
};
|
|
402
|
+
// Refreshes the context information
|
|
403
|
+
List.prototype.refreshContextInfo = function () {
|
|
404
|
+
var _this = this;
|
|
405
|
+
// Return a promise
|
|
406
|
+
return new Promise(function (resolve, reject) {
|
|
407
|
+
// See if the request digest is set
|
|
408
|
+
if (_this._requestDigest) {
|
|
409
|
+
// Get the context information
|
|
410
|
+
(0, _1.getContextInfo)(_this.WebUrl).then(function (requestDigest) {
|
|
411
|
+
// Save the value and resolve the request
|
|
412
|
+
_this._requestDigest = requestDigest;
|
|
413
|
+
resolve();
|
|
414
|
+
}, reject);
|
|
415
|
+
}
|
|
416
|
+
else {
|
|
417
|
+
// Resolve the request
|
|
418
|
+
resolve();
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
};
|
|
386
422
|
// Refresh the data
|
|
387
423
|
List.prototype.refreshItem = function (itemId, query) {
|
|
388
424
|
if (query === void 0) { query = this.OData; }
|
|
@@ -403,7 +439,7 @@ var List = /** @class */ (function () {
|
|
|
403
439
|
// Clear the modal/canvas
|
|
404
440
|
this.clear();
|
|
405
441
|
// Display the form
|
|
406
|
-
|
|
442
|
+
_1.ItemForm.view(props).then(null, this._onLoadFormError);
|
|
407
443
|
};
|
|
408
444
|
return List;
|
|
409
445
|
}());
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ListSecurity = exports.ListSecurityDefaultGroups = void 0;
|
|
4
4
|
var gd_sprest_bs_1 = require("gd-sprest-bs");
|
|
5
5
|
var loadingDialog_1 = require("./loadingDialog");
|
|
6
|
+
var methods_1 = require("./methods");
|
|
6
7
|
var modal_1 = require("./modal");
|
|
7
8
|
// List Security Default Groups
|
|
8
9
|
exports.ListSecurityDefaultGroups = {
|
|
@@ -17,9 +18,11 @@ exports.ListSecurityDefaultGroups = {
|
|
|
17
18
|
var ListSecurity = /** @class */ (function () {
|
|
18
19
|
// Constructor
|
|
19
20
|
function ListSecurity(props) {
|
|
21
|
+
var _this = this;
|
|
20
22
|
this._ddlItems = null;
|
|
21
23
|
this._permissionTypes = null;
|
|
22
24
|
this._props = null;
|
|
25
|
+
this._requestDigest = null;
|
|
23
26
|
// Current User
|
|
24
27
|
this._currentUser = null;
|
|
25
28
|
// Security group information
|
|
@@ -28,12 +31,17 @@ var ListSecurity = /** @class */ (function () {
|
|
|
28
31
|
this._groupUsers = {};
|
|
29
32
|
// Save the properties
|
|
30
33
|
this._props = props;
|
|
31
|
-
// Get the
|
|
32
|
-
this.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
// Get the context information
|
|
35
|
+
(0, methods_1.getContextInfo)(this._props.webUrl).then(function (requestDigest) {
|
|
36
|
+
// Set the request digest value
|
|
37
|
+
_this._requestDigest = requestDigest;
|
|
38
|
+
// Get the current user information
|
|
39
|
+
_this.loadCurrentUser();
|
|
40
|
+
// Get the permission types
|
|
41
|
+
_this.getPermissionTypes();
|
|
42
|
+
// Load the groups
|
|
43
|
+
_this.loadGroups();
|
|
44
|
+
});
|
|
37
45
|
}
|
|
38
46
|
Object.defineProperty(ListSecurity.prototype, "CurrentUser", {
|
|
39
47
|
get: function () { return this._currentUser; },
|
|
@@ -109,7 +117,7 @@ var ListSecurity = /** @class */ (function () {
|
|
|
109
117
|
// Exists
|
|
110
118
|
function (groupId) {
|
|
111
119
|
// Add the group to the list
|
|
112
|
-
(0, gd_sprest_bs_1.Web)(_this._props.webUrl).Lists(listInfo.listName).RoleAssignments().addRoleAssignment(groupId, permissionId).execute(resolve, function () {
|
|
120
|
+
(0, gd_sprest_bs_1.Web)(_this._props.webUrl, { requestDigest: _this._requestDigest }).Lists(listInfo.listName).RoleAssignments().addRoleAssignment(groupId, permissionId).execute(resolve, function () {
|
|
113
121
|
// Log to the console
|
|
114
122
|
console.error("[".concat(listInfo.listName, "] Error adding the group '").concat(listInfo.groupName, "' with permission ").concat(listInfo.permission, " to the list."));
|
|
115
123
|
// Resolve the request
|
|
@@ -191,7 +199,7 @@ var ListSecurity = /** @class */ (function () {
|
|
|
191
199
|
// Call the event if it exists
|
|
192
200
|
props = _this._props.onGroupCreating ? _this._props.onGroupCreating(props) : props;
|
|
193
201
|
// Create the group
|
|
194
|
-
(0, gd_sprest_bs_1.Web)(_this._props.webUrl).SiteGroups().add(props).execute(
|
|
202
|
+
(0, gd_sprest_bs_1.Web)(_this._props.webUrl, { requestDigest: _this._requestDigest }).SiteGroups().add(props).execute(
|
|
195
203
|
// Successfully created the group
|
|
196
204
|
function (group) {
|
|
197
205
|
// Set the group id
|
|
@@ -229,7 +237,7 @@ var ListSecurity = /** @class */ (function () {
|
|
|
229
237
|
switch (key) {
|
|
230
238
|
// Default owner's group
|
|
231
239
|
case exports.ListSecurityDefaultGroups.Owners:
|
|
232
|
-
(0, gd_sprest_bs_1.Web)(_this._props.webUrl).AssociatedOwnerGroup().query({
|
|
240
|
+
(0, gd_sprest_bs_1.Web)(_this._props.webUrl, { requestDigest: _this._requestDigest }).AssociatedOwnerGroup().query({
|
|
233
241
|
Expand: ["Users"]
|
|
234
242
|
}).execute(function (group) {
|
|
235
243
|
_this.setGroup(key, group);
|
|
@@ -239,7 +247,7 @@ var ListSecurity = /** @class */ (function () {
|
|
|
239
247
|
break;
|
|
240
248
|
// Default member's group
|
|
241
249
|
case exports.ListSecurityDefaultGroups.Members:
|
|
242
|
-
(0, gd_sprest_bs_1.Web)(_this._props.webUrl).AssociatedMemberGroup().query({
|
|
250
|
+
(0, gd_sprest_bs_1.Web)(_this._props.webUrl, { requestDigest: _this._requestDigest }).AssociatedMemberGroup().query({
|
|
243
251
|
Expand: ["Users"]
|
|
244
252
|
}).execute(function (group) {
|
|
245
253
|
_this.setGroup(key, group);
|
|
@@ -249,7 +257,7 @@ var ListSecurity = /** @class */ (function () {
|
|
|
249
257
|
break;
|
|
250
258
|
// Default visitor's group
|
|
251
259
|
case exports.ListSecurityDefaultGroups.Visitors:
|
|
252
|
-
(0, gd_sprest_bs_1.Web)(_this._props.webUrl).AssociatedVisitorGroup().query({
|
|
260
|
+
(0, gd_sprest_bs_1.Web)(_this._props.webUrl, { requestDigest: _this._requestDigest }).AssociatedVisitorGroup().query({
|
|
253
261
|
Expand: ["Users"]
|
|
254
262
|
}).execute(function (group) {
|
|
255
263
|
_this.setGroup(key, group);
|
|
@@ -260,7 +268,7 @@ var ListSecurity = /** @class */ (function () {
|
|
|
260
268
|
// Default
|
|
261
269
|
default:
|
|
262
270
|
// Get the group
|
|
263
|
-
(0, gd_sprest_bs_1.Web)(_this._props.webUrl).SiteGroups().getByName(groupName).query({
|
|
271
|
+
(0, gd_sprest_bs_1.Web)(_this._props.webUrl, { requestDigest: _this._requestDigest }).SiteGroups().getByName(groupName).query({
|
|
264
272
|
Expand: ["Users"]
|
|
265
273
|
}).execute(function (group) {
|
|
266
274
|
_this.setGroup(key, group);
|
|
@@ -276,7 +284,7 @@ var ListSecurity = /** @class */ (function () {
|
|
|
276
284
|
// Return a promise
|
|
277
285
|
return new Promise(function (resolve) {
|
|
278
286
|
// Get the definitions
|
|
279
|
-
(0, gd_sprest_bs_1.Web)(_this._props.webUrl).RoleDefinitions().query({
|
|
287
|
+
(0, gd_sprest_bs_1.Web)(_this._props.webUrl, { requestDigest: _this._requestDigest }).RoleDefinitions().query({
|
|
280
288
|
OrderBy: ["Name"]
|
|
281
289
|
}).execute(function (roleDefs) {
|
|
282
290
|
// Clear the permissions and items
|
|
@@ -316,7 +324,7 @@ var ListSecurity = /** @class */ (function () {
|
|
|
316
324
|
ListSecurity.prototype.loadCurrentUser = function () {
|
|
317
325
|
var _this = this;
|
|
318
326
|
// Load the current user
|
|
319
|
-
(0, gd_sprest_bs_1.Web)(this._props.webUrl).CurrentUser().execute(
|
|
327
|
+
(0, gd_sprest_bs_1.Web)(this._props.webUrl, { requestDigest: this._requestDigest }).CurrentUser().execute(
|
|
320
328
|
// Success
|
|
321
329
|
function (user) {
|
|
322
330
|
// Set the user
|
|
@@ -539,7 +547,7 @@ var ListSecurity = /** @class */ (function () {
|
|
|
539
547
|
return new Promise(function (resolve) {
|
|
540
548
|
// Parse the list keys
|
|
541
549
|
for (var listName in lists) {
|
|
542
|
-
var list = (0, gd_sprest_bs_1.Web)(_this._props.webUrl).Lists(listName);
|
|
550
|
+
var list = (0, gd_sprest_bs_1.Web)(_this._props.webUrl, { requestDigest: _this._requestDigest }).Lists(listName);
|
|
543
551
|
// Reset the permissions
|
|
544
552
|
list.resetRoleInheritance().execute();
|
|
545
553
|
// Revert to the default
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const formatBytes: (bytes: number, decimals?: number) => string;
|
|
2
2
|
export declare const formatDateValue: (value: string, format?: string) => string;
|
|
3
3
|
export declare const formatTimeValue: (value: string, format?: string) => string;
|
|
4
|
+
export declare const getContextInfo: (webUrl: string) => PromiseLike<string>;
|
|
4
5
|
export declare const getFileExt: (fileName?: string) => string;
|
package/build/common/methods.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFileExt = exports.formatTimeValue = exports.formatDateValue = exports.formatBytes = void 0;
|
|
3
|
+
exports.getFileExt = exports.getContextInfo = exports.formatTimeValue = exports.formatDateValue = exports.formatBytes = void 0;
|
|
4
|
+
var gd_sprest_bs_1 = require("gd-sprest-bs");
|
|
4
5
|
var moment = require("moment");
|
|
5
6
|
// Formats file size into human readable form
|
|
6
7
|
var formatBytes = function (bytes, decimals) {
|
|
@@ -39,6 +40,25 @@ var formatTimeValue = function (value, format) {
|
|
|
39
40
|
return "";
|
|
40
41
|
};
|
|
41
42
|
exports.formatTimeValue = formatTimeValue;
|
|
43
|
+
// Gets the context information of the target site
|
|
44
|
+
var getContextInfo = function (webUrl) {
|
|
45
|
+
// Return a promise
|
|
46
|
+
return new Promise(function (resolve, reject) {
|
|
47
|
+
// See if the web url exists
|
|
48
|
+
if (webUrl) {
|
|
49
|
+
// Get the context info of the site
|
|
50
|
+
gd_sprest_bs_1.ContextInfo.getWeb(webUrl).execute(function (info) {
|
|
51
|
+
// Resolve the request
|
|
52
|
+
resolve(info.GetContextWebInformation.FormDigestValue);
|
|
53
|
+
}, reject);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
// Resolve the request
|
|
57
|
+
resolve(null);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
exports.getContextInfo = getContextInfo;
|
|
42
62
|
// Returns the extension of a file name
|
|
43
63
|
var getFileExt = function (fileName) {
|
|
44
64
|
if (fileName === void 0) { fileName = ""; }
|
package/build/lib.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export declare const DattaTable: {
|
|
|
29
29
|
formatBytes: (bytes: number, decimals?: number) => string;
|
|
30
30
|
formatDateValue: (value: string, format?: string) => string;
|
|
31
31
|
formatTimeValue: (value: string, format?: string) => string;
|
|
32
|
+
getContextInfo: (webUrl: string) => PromiseLike<string>;
|
|
32
33
|
getFileExt: (fileName?: string) => string;
|
|
33
34
|
Modal: typeof Common.Modal;
|
|
34
35
|
Timeout: typeof Common.Timeout;
|