dattatable 2.10.97 → 2.10.99

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/itemForm.d.ts +3 -0
  2. package/build/common/itemForm.js +45 -0
  3. package/build/common/listCfg.js +3 -0
  4. package/dist/dattatable.js +764 -764
  5. package/dist/dattatable.min.js +1 -1
  6. package/docs/assets/search.js +1 -1
  7. package/docs/classes/Accordion.html +2 -2
  8. package/docs/classes/AuditLog.html +2 -2
  9. package/docs/classes/CanvasForm.html +2 -2
  10. package/docs/classes/Comments.html +2 -2
  11. package/docs/classes/Dashboard.html +4 -4
  12. package/docs/classes/DataTable.html +3 -3
  13. package/docs/classes/Documents.html +6 -6
  14. package/docs/classes/FilterSlideout.html +2 -2
  15. package/docs/classes/Footer.html +2 -2
  16. package/docs/classes/Header.html +2 -2
  17. package/docs/classes/InstallationRequired.html +2 -2
  18. package/docs/classes/ItemForm.html +5 -4
  19. package/docs/classes/List.html +4 -4
  20. package/docs/classes/ListConfig.html +2 -2
  21. package/docs/classes/ListSecurity.html +2 -2
  22. package/docs/classes/LoadingDialog.html +2 -2
  23. package/docs/classes/Modal.html +2 -2
  24. package/docs/classes/Navigation.html +3 -3
  25. package/docs/classes/Tiles.html +2 -2
  26. package/docs/classes/Timeout.html +2 -2
  27. package/docs/enums/ActionButtonTypes.html +2 -2
  28. package/docs/functions/formatBytes.html +1 -1
  29. package/docs/functions/formatDateValue.html +1 -1
  30. package/docs/functions/formatTimeValue.html +1 -1
  31. package/docs/functions/getContextInfo.html +1 -1
  32. package/docs/functions/getFileExt.html +1 -1
  33. package/docs/functions/waitForTheme.html +1 -1
  34. package/docs/interfaces/IAccordion.html +2 -2
  35. package/docs/interfaces/IAccordionProps.html +2 -2
  36. package/docs/interfaces/IAuditLogItem.html +2 -2
  37. package/docs/interfaces/IAuditLogItemCreation.html +2 -2
  38. package/docs/interfaces/IAuditLogProps.html +2 -2
  39. package/docs/interfaces/IAuditLogViewProps.html +2 -2
  40. package/docs/interfaces/ICommentsItem.html +2 -2
  41. package/docs/interfaces/ICreateLookupData.html +2 -2
  42. package/docs/interfaces/IDashboardProps.html +2 -2
  43. package/docs/interfaces/IDataTable.html +2 -2
  44. package/docs/interfaces/IDataTableProps.html +2 -2
  45. package/docs/interfaces/IDocumentsProps.html +2 -2
  46. package/docs/interfaces/IFilterItem.html +2 -2
  47. package/docs/interfaces/IFilterProps.html +2 -2
  48. package/docs/interfaces/IFooterProps.html +2 -2
  49. package/docs/interfaces/IGenerateLookupDataProps.html +2 -2
  50. package/docs/interfaces/IHeaderProps.html +2 -2
  51. package/docs/interfaces/IInstallProps.html +2 -2
  52. package/docs/interfaces/IItemFormCreateProps.html +3 -2
  53. package/docs/interfaces/IItemFormEditProps.html +3 -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
@@ -27,6 +27,7 @@ export interface IItemFormCreateProps {
27
27
  onGetListInfo?: (props: Helper.IListFormProps) => Helper.IListFormProps;
28
28
  onResetForm?: () => void;
29
29
  onSave?: (values: any) => object | PromiseLike<object>;
30
+ onSaveError?: (err: any) => void;
30
31
  onSetFooter?: (el: HTMLElement) => void;
31
32
  onSetHeader?: (el: HTMLElement) => void;
32
33
  onShowForm?: (form?: CanvasForm | Modal) => void;
@@ -47,6 +48,7 @@ export interface IItemFormEditProps {
47
48
  onGetListInfo?: (props: Helper.IListFormProps) => Helper.IListFormProps;
48
49
  onResetForm?: () => void;
49
50
  onSave?: (values: any) => object | PromiseLike<object>;
51
+ onSaveError?: (err: any) => void;
50
52
  onSetFooter?: (el: HTMLElement) => void;
51
53
  onSetHeader?: (el: HTMLElement) => void;
52
54
  onShowForm?: (form?: CanvasForm | Modal) => void;
@@ -88,6 +90,7 @@ export declare class ItemForm {
88
90
  private static _onSetHeader?;
89
91
  private static _onShowForm?;
90
92
  private static _onSave;
93
+ private static _onSaveError;
91
94
  private static _onValidation;
92
95
  private static _requestDigest;
93
96
  private static _tabInfo;
@@ -111,6 +111,7 @@ var ItemForm = /** @class */ (function () {
111
111
  this._onGetListInfo = props.onGetListInfo;
112
112
  this._onResetForm = props.onResetForm;
113
113
  this._onSave = props.onSave;
114
+ this._onSaveError = props.onSaveError;
114
115
  this._onSetFooter = props.onSetFooter;
115
116
  this._onSetHeader = props.onSetHeader;
116
117
  this._onShowForm = props.onShowForm;
@@ -135,6 +136,7 @@ var ItemForm = /** @class */ (function () {
135
136
  this._onGetListInfo = props.onGetListInfo;
136
137
  this._onResetForm = props.onResetForm;
137
138
  this._onSave = props.onSave;
139
+ this._onSaveError = props.onSaveError;
138
140
  this._onSetFooter = props.onSetFooter;
139
141
  this._onSetHeader = props.onSetHeader;
140
142
  this._onShowForm = props.onShowForm;
@@ -198,6 +200,7 @@ var ItemForm = /** @class */ (function () {
198
200
  this._onSetHeader = null;
199
201
  this._onShowForm = null;
200
202
  this._onSave = null;
203
+ this._onSaveError = null;
201
204
  this._onValidation = null;
202
205
  this._requestDigest = null;
203
206
  this._tabInfo = null;
@@ -538,6 +541,47 @@ var ItemForm = /** @class */ (function () {
538
541
  // Close the dialogs
539
542
  (_this._useModal ? _1.Modal : _1.CanvasForm).hide();
540
543
  _1.LoadingDialog.hide();
544
+ }, function (err) {
545
+ // Try to get the error message
546
+ try {
547
+ var errorMessage = JSON.parse(err.response).error.message.value;
548
+ // See if the page timed out
549
+ if (errorMessage.indexOf("The security validation for this page is invalid") == 0) {
550
+ // Set the loading dialog
551
+ _1.LoadingDialog.setBody("The page timed out, retrying the request...");
552
+ // Get the context
553
+ (0, _1.getContextInfo)(_this._info.webUrl).then(function (requestDigest) {
554
+ // Set the request digest value
555
+ _this._requestDigest = requestDigest;
556
+ // Try to save the item again
557
+ defaultForm.save(values).then(function (item) {
558
+ // Call the update event
559
+ _this._updateEvent ? _this._updateEvent(item) : null;
560
+ // Close the dialogs
561
+ (_this._useModal ? _1.Modal : _1.CanvasForm).hide();
562
+ _1.LoadingDialog.hide();
563
+ }, function (err) {
564
+ // Log
565
+ console.error("[List Form] Unable to save the item after refreshing the context information.");
566
+ // Call the event
567
+ _this._onSaveError ? _this._onSaveError(err) : null;
568
+ });
569
+ }, function () {
570
+ // Log
571
+ console.error("[List Form] Unable to get the context for web.");
572
+ // Call the event
573
+ _this._onSaveError ? _this._onSaveError(err) : null;
574
+ });
575
+ }
576
+ else {
577
+ // Call the event
578
+ _this._onSaveError ? _this._onSaveError(err) : null;
579
+ }
580
+ }
581
+ catch (_a) {
582
+ // Call the event
583
+ _this._onSaveError ? _this._onSaveError(err) : null;
584
+ }
541
585
  });
542
586
  }
543
587
  };
@@ -603,6 +647,7 @@ var ItemForm = /** @class */ (function () {
603
647
  ItemForm._onSetHeader = null;
604
648
  ItemForm._onShowForm = null;
605
649
  ItemForm._onSave = null;
650
+ ItemForm._onSaveError = null;
606
651
  ItemForm._onValidation = null;
607
652
  ItemForm._requestDigest = null;
608
653
  ItemForm._tabInfo = null;
@@ -138,6 +138,7 @@ var ListConfig = /** @class */ (function () {
138
138
  AllowContentTypes: list.ListInfo.AllowContentTypes,
139
139
  BaseTemplate: list.ListInfo.BaseTemplate,
140
140
  ContentTypesEnabled: list.ListInfo.ContentTypesEnabled,
141
+ EnableAttachments: list.ListInfo.EnableAttachments,
141
142
  Title: props.srcList,
142
143
  Hidden: list.ListInfo.Hidden,
143
144
  NoCrawl: list.ListInfo.NoCrawl
@@ -207,6 +208,7 @@ var ListConfig = /** @class */ (function () {
207
208
  }
208
209
  // Add the list content type
209
210
  cfgProps.ListCfg[0].ContentTypes.push({
211
+ ClientFormCustomFormatter: ct.ClientFormCustomFormatter,
210
212
  Name: ct.Name,
211
213
  Description: ct.Description,
212
214
  ParentName: ct.Parent.Name,
@@ -252,6 +254,7 @@ var ListConfig = /** @class */ (function () {
252
254
  }
253
255
  // Add the view
254
256
  cfgProps.ListCfg[0].ViewInformation.push({
257
+ CustomFormatter: viewInfo.CustomFormatter,
255
258
  Default: viewInfo.DefaultView,
256
259
  Hidden: viewInfo.Hidden,
257
260
  JSLink: viewInfo.JSLink,