dattatable 2.11.29 → 2.11.30

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 (69) hide show
  1. package/build/common/listCfg.d.ts +1 -0
  2. package/build/common/listCfg.js +77 -3
  3. package/dist/dattatable.js +578 -578
  4. package/dist/dattatable.min.js +1 -1
  5. package/docs/assets/search.js +1 -1
  6. package/docs/classes/Accordion.html +2 -2
  7. package/docs/classes/AuditLog.html +2 -2
  8. package/docs/classes/CanvasForm.html +2 -2
  9. package/docs/classes/Comments.html +2 -2
  10. package/docs/classes/Dashboard.html +4 -4
  11. package/docs/classes/DataTable.html +3 -3
  12. package/docs/classes/Documents.html +6 -6
  13. package/docs/classes/FilterSlideout.html +2 -2
  14. package/docs/classes/Footer.html +2 -2
  15. package/docs/classes/Header.html +2 -2
  16. package/docs/classes/InstallationRequired.html +2 -2
  17. package/docs/classes/ItemForm.html +4 -4
  18. package/docs/classes/List.html +4 -4
  19. package/docs/classes/ListConfig.html +3 -2
  20. package/docs/classes/ListSecurity.html +2 -2
  21. package/docs/classes/LoadingDialog.html +2 -2
  22. package/docs/classes/Modal.html +2 -2
  23. package/docs/classes/Navigation.html +3 -3
  24. package/docs/classes/Tiles.html +2 -2
  25. package/docs/classes/Timeout.html +2 -2
  26. package/docs/enums/ActionButtonTypes.html +2 -2
  27. package/docs/functions/formatBytes.html +1 -1
  28. package/docs/functions/formatDateValue.html +1 -1
  29. package/docs/functions/formatTimeValue.html +1 -1
  30. package/docs/functions/getContextInfo.html +1 -1
  31. package/docs/functions/getFileExt.html +1 -1
  32. package/docs/functions/waitForTheme.html +1 -1
  33. package/docs/interfaces/IAccordion.html +2 -2
  34. package/docs/interfaces/IAccordionProps.html +2 -2
  35. package/docs/interfaces/IAuditLogItem.html +2 -2
  36. package/docs/interfaces/IAuditLogItemCreation.html +2 -2
  37. package/docs/interfaces/IAuditLogProps.html +2 -2
  38. package/docs/interfaces/IAuditLogViewProps.html +2 -2
  39. package/docs/interfaces/ICommentsItem.html +2 -2
  40. package/docs/interfaces/ICreateLookupData.html +2 -2
  41. package/docs/interfaces/IDashboardProps.html +2 -2
  42. package/docs/interfaces/IDataTable.html +2 -2
  43. package/docs/interfaces/IDataTableProps.html +2 -2
  44. package/docs/interfaces/IDocumentsProps.html +2 -2
  45. package/docs/interfaces/IFilterItem.html +2 -2
  46. package/docs/interfaces/IFilterProps.html +2 -2
  47. package/docs/interfaces/IFooterProps.html +2 -2
  48. package/docs/interfaces/IGenerateLookupDataProps.html +2 -2
  49. package/docs/interfaces/IHeaderProps.html +2 -2
  50. package/docs/interfaces/IInstallProps.html +2 -2
  51. package/docs/interfaces/IItemFormCreateProps.html +2 -2
  52. package/docs/interfaces/IItemFormEditProps.html +2 -2
  53. package/docs/interfaces/IItemFormSaveProps.html +2 -2
  54. package/docs/interfaces/IItemFormTab.html +2 -2
  55. package/docs/interfaces/IItemFormTabInfo.html +2 -2
  56. package/docs/interfaces/IItemFormViewProps.html +2 -2
  57. package/docs/interfaces/IListConfig.html +2 -2
  58. package/docs/interfaces/IListConfigProps.html +2 -2
  59. package/docs/interfaces/IListProps.html +2 -2
  60. package/docs/interfaces/IListSecurity.html +2 -2
  61. package/docs/interfaces/IListSecurityItem.html +2 -2
  62. package/docs/interfaces/ILookupData.html +2 -2
  63. package/docs/interfaces/IShowDialogProps.html +2 -2
  64. package/docs/interfaces/ITiles.html +2 -2
  65. package/docs/interfaces/ITilesProps.html +2 -2
  66. package/docs/interfaces/IValidateLookupsProps.html +2 -2
  67. package/docs/variables/DattaTable.html +1 -1
  68. package/docs/variables/ListSecurityDefaultGroups.html +1 -1
  69. 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[]>;
@@ -103,7 +103,67 @@ var ListConfig = /** @class */ (function () {
103
103
  });
104
104
  });
105
105
  };
106
- // Fixes the MMS fields to ensure the list property is configured correctly
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 fields
115
+ (0, gd_sprest_bs_1.Web)(webUrl).Lists(listName).query({ Expand: ["ContentTypes", "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 field
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 field
157
+ resolve(null);
158
+ });
159
+ });
160
+ }
161
+ }).then(resolve, reject);
162
+ }, reject);
163
+ }, reject);
164
+ });
165
+ };
166
+ // Fixes the fields to ensure the list property is configured correctly
107
167
  ListConfig.fixMMSFields = function (webUrl, listName) {
108
168
  var _this = this;
109
169
  // Return a promise
@@ -263,9 +323,16 @@ var ListConfig = /** @class */ (function () {
263
323
  });
264
324
  }
265
325
  }
326
+ // Replace the source list id in the JSON config
327
+ var customFormatter = ct.ClientFormCustomFormatter;
328
+ if (customFormatter) {
329
+ while (customFormatter.indexOf(list.ListId) >= 0) {
330
+ customFormatter = customFormatter.replace(list.ListId, "[[ListId]]");
331
+ }
332
+ }
266
333
  // Add the list content type
267
334
  cfgProps.ListCfg[0].ContentTypes.push({
268
- ClientFormCustomFormatter: ct.ClientFormCustomFormatter,
335
+ ClientFormCustomFormatter: customFormatter,
269
336
  Name: ct.Name,
270
337
  Description: ct.Description,
271
338
  ParentName: ct.Parent.Name,
@@ -309,9 +376,16 @@ var ListConfig = /** @class */ (function () {
309
376
  }
310
377
  }
311
378
  }
379
+ // Replace the source list id in the JSON config
380
+ var customFormatter = viewInfo.CustomFormatter;
381
+ if (customFormatter) {
382
+ while (customFormatter.indexOf(list.ListId) >= 0) {
383
+ customFormatter = customFormatter.replace(list.ListId, "[[ListId]]");
384
+ }
385
+ }
312
386
  // Add the view
313
387
  cfgProps.ListCfg[0].ViewInformation.push({
314
- CustomFormatter: viewInfo.CustomFormatter,
388
+ CustomFormatter: customFormatter,
315
389
  Default: viewInfo.DefaultView,
316
390
  Hidden: viewInfo.Hidden,
317
391
  JSLink: viewInfo.JSLink,