dattatable 2.11.29 → 2.11.31
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 +1 -0
- package/build/common/listCfg.js +115 -3
- package/dist/dattatable.js +578 -578
- package/dist/dattatable.min.js +1 -1
- package/docs/assets/search.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 +3 -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/IItemFormSaveProps.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
|
@@ -40,6 +40,7 @@ export interface IValidateLookupsProps {
|
|
|
40
40
|
export declare class ListConfig {
|
|
41
41
|
private static InternalFields;
|
|
42
42
|
static createLookupListData(props: ICreateLookupData): PromiseLike<void>;
|
|
43
|
+
static fixCustomFormatters(webUrl: string, listName: string): PromiseLike<void>;
|
|
43
44
|
static fixMMSFields(webUrl: string, listName: string): PromiseLike<void>;
|
|
44
45
|
static generate(props: IListConfigProps): PromiseLike<IListConfig>;
|
|
45
46
|
static generateLookupListData(props: IGenerateLookupDataProps): PromiseLike<ILookupData[]>;
|
package/build/common/listCfg.js
CHANGED
|
@@ -103,7 +103,91 @@ var ListConfig = /** @class */ (function () {
|
|
|
103
103
|
});
|
|
104
104
|
});
|
|
105
105
|
};
|
|
106
|
-
// Fixes the
|
|
106
|
+
// Fixes the custom formatter list id values
|
|
107
|
+
ListConfig.fixCustomFormatters = function (webUrl, listName) {
|
|
108
|
+
// Return a promise
|
|
109
|
+
return new Promise(function (resolve, reject) {
|
|
110
|
+
// Show a loading dialog
|
|
111
|
+
loadingDialog_1.LoadingDialog.setHeader("Validating Custom Formatters");
|
|
112
|
+
loadingDialog_1.LoadingDialog.setBody("Getting the list '" + listName + "' information...");
|
|
113
|
+
loadingDialog_1.LoadingDialog.show();
|
|
114
|
+
// Load the list information
|
|
115
|
+
(0, gd_sprest_bs_1.Web)(webUrl).Lists(listName).query({ Expand: ["ContentTypes", "Fields", "Views"], Select: ["Id"] }).execute(function (list) {
|
|
116
|
+
// Parse the content types
|
|
117
|
+
gd_sprest_bs_1.Helper.Executor(list.ContentTypes.results, function (ct) {
|
|
118
|
+
// See if the custom formatter exists and needs the list id
|
|
119
|
+
if (ct.ClientFormCustomFormatter && ct.ClientFormCustomFormatter.indexOf("[[ListId]]") >= 0) {
|
|
120
|
+
// Return a promise
|
|
121
|
+
return new Promise(function (resolve) {
|
|
122
|
+
var customFormatter = ct.ClientFormCustomFormatter;
|
|
123
|
+
// Replace the list id
|
|
124
|
+
while (customFormatter.indexOf("[[ListId]]") >= 0) {
|
|
125
|
+
customFormatter = customFormatter.replace("[[ListId]]", list.Id);
|
|
126
|
+
}
|
|
127
|
+
// Update the content type
|
|
128
|
+
ct.update({
|
|
129
|
+
ClientFormCustomFormatter: customFormatter
|
|
130
|
+
}).execute(resolve, function () {
|
|
131
|
+
// Log the error
|
|
132
|
+
console.error("Error updating the custom formatter for the content type: " + ct.Name);
|
|
133
|
+
// Check the next content type
|
|
134
|
+
resolve(null);
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
}).then(function () {
|
|
139
|
+
// Parse the views
|
|
140
|
+
gd_sprest_bs_1.Helper.Executor(list.Views.results, function (view) {
|
|
141
|
+
// See if the custom formatter exists and needs the list id
|
|
142
|
+
if (view.CustomFormatter && view.CustomFormatter.indexOf("[[ListId]]") >= 0) {
|
|
143
|
+
// Return a promise
|
|
144
|
+
return new Promise(function (resolve) {
|
|
145
|
+
var customFormatter = view.CustomFormatter;
|
|
146
|
+
// Replace the list id
|
|
147
|
+
while (customFormatter.indexOf("[[ListId]]") >= 0) {
|
|
148
|
+
customFormatter = customFormatter.replace("[[ListId]]", list.Id);
|
|
149
|
+
}
|
|
150
|
+
// Update the content type
|
|
151
|
+
view.update({
|
|
152
|
+
CustomFormatter: customFormatter
|
|
153
|
+
}).execute(resolve, function () {
|
|
154
|
+
// Log the error
|
|
155
|
+
console.error("Error updating the custom formatter for the view: " + view.Title);
|
|
156
|
+
// Check the next view
|
|
157
|
+
resolve(null);
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}).then(function () {
|
|
162
|
+
// Parse the views
|
|
163
|
+
gd_sprest_bs_1.Helper.Executor(list.Fields.results, function (field) {
|
|
164
|
+
// See if the custom formatter exists and needs the list id
|
|
165
|
+
if (field.SchemaXml && field.SchemaXml.indexOf("[[ListId]]") >= 0) {
|
|
166
|
+
// Return a promise
|
|
167
|
+
return new Promise(function (resolve) {
|
|
168
|
+
var schemaXml = field.SchemaXml;
|
|
169
|
+
// Replace the list id
|
|
170
|
+
while (schemaXml.indexOf("[[ListId]]") >= 0) {
|
|
171
|
+
schemaXml = schemaXml.replace("[[ListId]]", list.Id);
|
|
172
|
+
}
|
|
173
|
+
// Update the content type
|
|
174
|
+
field.update({
|
|
175
|
+
SchemaXml: schemaXml
|
|
176
|
+
}).execute(resolve, function () {
|
|
177
|
+
// Log the error
|
|
178
|
+
console.error("Error updating the custom formatter for the field: " + field.InternalName);
|
|
179
|
+
// Check the next field
|
|
180
|
+
resolve(null);
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
}).then(resolve, reject);
|
|
185
|
+
}, reject);
|
|
186
|
+
}, reject);
|
|
187
|
+
}, reject);
|
|
188
|
+
});
|
|
189
|
+
};
|
|
190
|
+
// Fixes the fields to ensure the list property is configured correctly
|
|
107
191
|
ListConfig.fixMMSFields = function (webUrl, listName) {
|
|
108
192
|
var _this = this;
|
|
109
193
|
// Return a promise
|
|
@@ -255,6 +339,13 @@ var ListConfig = /** @class */ (function () {
|
|
|
255
339
|
}
|
|
256
340
|
// Else, ensure the field hasn't been added
|
|
257
341
|
else if (fields[field.InternalName] == null) {
|
|
342
|
+
// Replace the source list id in the JSON config
|
|
343
|
+
var schemaXml = field.SchemaXml;
|
|
344
|
+
if (schemaXml) {
|
|
345
|
+
while (schemaXml.indexOf(list.ListId) >= 0) {
|
|
346
|
+
schemaXml = schemaXml.replace(list.ListId, "[[ListId]]");
|
|
347
|
+
}
|
|
348
|
+
}
|
|
258
349
|
// Add the field information
|
|
259
350
|
fields[field.InternalName] = true;
|
|
260
351
|
cfgProps.ListCfg[0].CustomFields.push({
|
|
@@ -263,9 +354,16 @@ var ListConfig = /** @class */ (function () {
|
|
|
263
354
|
});
|
|
264
355
|
}
|
|
265
356
|
}
|
|
357
|
+
// Replace the source list id in the JSON config
|
|
358
|
+
var customFormatter = ct.ClientFormCustomFormatter;
|
|
359
|
+
if (customFormatter) {
|
|
360
|
+
while (customFormatter.indexOf(list.ListId) >= 0) {
|
|
361
|
+
customFormatter = customFormatter.replace(list.ListId, "[[ListId]]");
|
|
362
|
+
}
|
|
363
|
+
}
|
|
266
364
|
// Add the list content type
|
|
267
365
|
cfgProps.ListCfg[0].ContentTypes.push({
|
|
268
|
-
ClientFormCustomFormatter:
|
|
366
|
+
ClientFormCustomFormatter: customFormatter,
|
|
269
367
|
Name: ct.Name,
|
|
270
368
|
Description: ct.Description,
|
|
271
369
|
ParentName: ct.Parent.Name,
|
|
@@ -300,6 +398,13 @@ var ListConfig = /** @class */ (function () {
|
|
|
300
398
|
mmsFields[field.InternalName] = field;
|
|
301
399
|
}
|
|
302
400
|
else {
|
|
401
|
+
// Replace the source list id in the JSON config
|
|
402
|
+
var schemaXml = field.SchemaXml;
|
|
403
|
+
if (schemaXml) {
|
|
404
|
+
while (schemaXml.indexOf(list.ListId) >= 0) {
|
|
405
|
+
schemaXml = schemaXml.replace(list.ListId, "[[ListId]]");
|
|
406
|
+
}
|
|
407
|
+
}
|
|
303
408
|
// Append the field
|
|
304
409
|
fields[field.InternalName] = true;
|
|
305
410
|
cfgProps.ListCfg[0].CustomFields.push({
|
|
@@ -309,9 +414,16 @@ var ListConfig = /** @class */ (function () {
|
|
|
309
414
|
}
|
|
310
415
|
}
|
|
311
416
|
}
|
|
417
|
+
// Replace the source list id in the JSON config
|
|
418
|
+
var customFormatter = viewInfo.CustomFormatter;
|
|
419
|
+
if (customFormatter) {
|
|
420
|
+
while (customFormatter.indexOf(list.ListId) >= 0) {
|
|
421
|
+
customFormatter = customFormatter.replace(list.ListId, "[[ListId]]");
|
|
422
|
+
}
|
|
423
|
+
}
|
|
312
424
|
// Add the view
|
|
313
425
|
cfgProps.ListCfg[0].ViewInformation.push({
|
|
314
|
-
CustomFormatter:
|
|
426
|
+
CustomFormatter: customFormatter,
|
|
315
427
|
Default: viewInfo.DefaultView,
|
|
316
428
|
Hidden: viewInfo.Hidden,
|
|
317
429
|
JSLink: viewInfo.JSLink,
|