dattatable 2.10.72 → 2.10.74
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/listCfg.d.ts +3 -1
- package/build/common/listCfg.js +57 -37
- package/dist/dattatable.js +581 -581
- package/dist/dattatable.min.js +1 -1
- package/docs/classes/Accordion.html +2 -2
- 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 +4 -4
- package/docs/classes/List.html +4 -4
- package/docs/classes/ListConfig.html +2 -2
- package/docs/classes/ListSecurity.html +2 -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/Tiles.html +2 -2
- 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 -1
- package/docs/functions/getFileExt.html +1 -1
- package/docs/functions/waitForTheme.html +1 -1
- package/docs/interfaces/IAccordion.html +2 -2
- package/docs/interfaces/IAccordionProps.html +2 -2
- 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/ICreateLookupData.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/IGenerateLookupDataProps.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/IListConfig.html +2 -2
- package/docs/interfaces/IListConfigProps.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/ILookupData.html +2 -2
- package/docs/interfaces/IShowDialogProps.html +2 -2
- package/docs/interfaces/ITiles.html +2 -2
- package/docs/interfaces/ITilesProps.html +2 -2
- package/docs/interfaces/IValidateLookupsProps.html +2 -2
- package/docs/variables/DattaTable.html +1 -1
- package/docs/variables/ListSecurityDefaultGroups.html +1 -1
- package/package.json +2 -2
|
@@ -16,7 +16,9 @@ export interface IListConfigProps {
|
|
|
16
16
|
export interface ILookupData {
|
|
17
17
|
field: string;
|
|
18
18
|
list: string;
|
|
19
|
-
items:
|
|
19
|
+
items: {
|
|
20
|
+
[key: string]: string;
|
|
21
|
+
}[];
|
|
20
22
|
}
|
|
21
23
|
export interface IGenerateLookupDataProps {
|
|
22
24
|
lookupFields: Types.SP.FieldLookup[];
|
package/build/common/listCfg.js
CHANGED
|
@@ -45,31 +45,14 @@ var ListConfig = /** @class */ (function () {
|
|
|
45
45
|
var dstList = (0, gd_sprest_bs_1.Web)(props.webUrl, { requestDigest: contextInfo.GetContextWebInformation.FormDigestValue }).Lists(lookupData.list);
|
|
46
46
|
// Update the dialog
|
|
47
47
|
props.showDialog ? loadingDialog_1.LoadingDialog.setBody("Importing the list data: " + lookupData.list) : null;
|
|
48
|
-
var _loop_1 = function (i) {
|
|
49
|
-
var addItem = true;
|
|
50
|
-
var value = lookupData.items[i];
|
|
51
|
-
// See if the items exists
|
|
52
|
-
currItems.results.find(function (a) {
|
|
53
|
-
// See if the item exists
|
|
54
|
-
if (a[lookupData.field] == value) {
|
|
55
|
-
// Set the flag
|
|
56
|
-
addItem = false;
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
// See if we are adding the item
|
|
60
|
-
if (addItem) {
|
|
61
|
-
// Create the item
|
|
62
|
-
var dstItem = {};
|
|
63
|
-
dstItem[lookupData.field] = value;
|
|
64
|
-
dstList.Items().add(dstItem).batch(function (item) {
|
|
65
|
-
// Log
|
|
66
|
-
console.log("[" + lookupData.list + "] Item added: " + item[lookupData.field]);
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
48
|
// Parse the list items
|
|
71
49
|
for (var i = 0; i < lookupData.items.length; i++) {
|
|
72
|
-
|
|
50
|
+
var lookupItem = lookupData.items[i];
|
|
51
|
+
// Create the item
|
|
52
|
+
dstList.Items().add(lookupItem).batch(function (item) {
|
|
53
|
+
// Log
|
|
54
|
+
console.log("[" + lookupData.list + "] Item added: " + item[lookupData.field]);
|
|
55
|
+
});
|
|
73
56
|
}
|
|
74
57
|
// Execute the batch job
|
|
75
58
|
dstList.execute(function () {
|
|
@@ -147,6 +130,10 @@ var ListConfig = /** @class */ (function () {
|
|
|
147
130
|
var fieldRefs = [];
|
|
148
131
|
for (var j = 0; j < ct.FieldLinks.results.length; j++) {
|
|
149
132
|
var fieldLink = ct.FieldLinks.results[j];
|
|
133
|
+
// Ignore the Taxonomy fields, they will get added automatically
|
|
134
|
+
if (fieldLink.Name == "TaxCatchAll" || fieldLink.Name == "TaxCatchAllLabel") {
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
150
137
|
// Get the field
|
|
151
138
|
var field = list.getField(fieldLink.Name);
|
|
152
139
|
// See if this is a lookup field
|
|
@@ -328,18 +315,33 @@ var ListConfig = /** @class */ (function () {
|
|
|
328
315
|
// Remove all properties, except for the TextField property
|
|
329
316
|
var removeProps = [];
|
|
330
317
|
var props_1 = schemaXml.querySelector("ArrayOfProperty");
|
|
331
|
-
|
|
318
|
+
var _loop_1 = function (j) {
|
|
332
319
|
// See if this isn't the text field property
|
|
333
320
|
var prop = props_1.children[j];
|
|
334
321
|
if (prop.querySelector("Name").innerHTML == "TextField") {
|
|
335
322
|
// Find the hidden text field for this MMS field
|
|
336
|
-
var
|
|
337
|
-
if (
|
|
338
|
-
//
|
|
339
|
-
fields[
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
323
|
+
var field_1 = list.getFieldById(prop.querySelector("Value").innerHTML);
|
|
324
|
+
if (field_1) {
|
|
325
|
+
// Ensure we haven't already added it
|
|
326
|
+
if (fields[field_1.InternalName] != true) {
|
|
327
|
+
// Append the field
|
|
328
|
+
fields[field_1.InternalName] = true;
|
|
329
|
+
cfgProps.ListCfg[0].CustomFields.push({
|
|
330
|
+
name: field_1.InternalName,
|
|
331
|
+
schemaXml: field_1.SchemaXml
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
// Parse the content types
|
|
335
|
+
gd_sprest_bs_1.Helper.Executor(cfgProps.ListCfg[0].ContentTypes, function (ct) {
|
|
336
|
+
// Parse the field links
|
|
337
|
+
for (var i = 0; i < ct.FieldRefs.length; i++) {
|
|
338
|
+
// See if this is the target field
|
|
339
|
+
if (ct.FieldRefs[i] == field_1.InternalName) {
|
|
340
|
+
// Remove this from the content types
|
|
341
|
+
ct.FieldRefs.splice(i, 1);
|
|
342
|
+
break;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
343
345
|
});
|
|
344
346
|
}
|
|
345
347
|
}
|
|
@@ -347,6 +349,9 @@ var ListConfig = /** @class */ (function () {
|
|
|
347
349
|
// Remove it
|
|
348
350
|
removeProps.push(prop);
|
|
349
351
|
}
|
|
352
|
+
};
|
|
353
|
+
for (var j = props_1.children.length - 1; j >= 0; j--) {
|
|
354
|
+
_loop_1(j);
|
|
350
355
|
}
|
|
351
356
|
// Remove the properties
|
|
352
357
|
for (var i = 0; i < removeProps.length; i++) {
|
|
@@ -404,23 +409,38 @@ var ListConfig = /** @class */ (function () {
|
|
|
404
409
|
return new Promise(function (resolve) {
|
|
405
410
|
// Get the source list
|
|
406
411
|
(0, gd_sprest_bs_1.Web)(props.srcWebUrl).Lists().getById(lookupField.LookupList).execute(function (list) {
|
|
412
|
+
var fields = [];
|
|
413
|
+
// Get the list content type fields
|
|
414
|
+
list.ContentTypes().query({ Expand: ["FieldLinks"] }).execute(function (cts) {
|
|
415
|
+
// Parse the content type fields
|
|
416
|
+
for (var i = 0; i < cts.results[0].FieldLinks.results.length; i++) {
|
|
417
|
+
var field = cts.results[0].FieldLinks.results[i];
|
|
418
|
+
// Add the field link
|
|
419
|
+
fields.push(field.Name);
|
|
420
|
+
}
|
|
421
|
+
});
|
|
407
422
|
// Get the list items
|
|
408
423
|
list.Items().query({
|
|
409
424
|
GetAllItems: true,
|
|
410
425
|
Top: 5000,
|
|
411
426
|
OrderBy: ["Id"]
|
|
412
427
|
}).execute(function (items) {
|
|
413
|
-
var
|
|
428
|
+
var lookupItems = [];
|
|
414
429
|
// Parse the items
|
|
415
430
|
for (var i = 0; i < items.results.length; i++) {
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
431
|
+
var lookupItem = {};
|
|
432
|
+
// Parse the field links
|
|
433
|
+
for (var j = 0; j < fields.length; j++) {
|
|
434
|
+
// Add the value
|
|
435
|
+
lookupItem[fields[j]] = items.results[i][fields[j]];
|
|
436
|
+
}
|
|
437
|
+
// Add the lookup item
|
|
438
|
+
lookupItems.push(lookupItem);
|
|
419
439
|
}
|
|
420
440
|
// Save the item data
|
|
421
441
|
lookupListData.push({
|
|
422
442
|
field: lookupField.LookupField,
|
|
423
|
-
items:
|
|
443
|
+
items: lookupItems,
|
|
424
444
|
list: list.Title
|
|
425
445
|
});
|
|
426
446
|
// Set the flag
|
|
@@ -431,7 +451,7 @@ var ListConfig = /** @class */ (function () {
|
|
|
431
451
|
}, function () {
|
|
432
452
|
// Check the next list
|
|
433
453
|
resolve(null);
|
|
434
|
-
});
|
|
454
|
+
}, true); // Set the flag to run this after the previous request completes
|
|
435
455
|
});
|
|
436
456
|
}).then(function () {
|
|
437
457
|
// Resolve the request
|