dattatable 2.4.2 → 2.4.4
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/auditLog/cfg.js +4 -4
- package/build/auditLog/index.d.ts +12 -4
- package/build/auditLog/index.js +82 -76
- package/dist/dattatable.js +2 -2
- package/dist/dattatable.min.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/AuditLog.html +34 -32
- package/docs/classes/CanvasForm.html +17 -17
- package/docs/classes/Comments.html +12 -12
- package/docs/classes/Dashboard.html +17 -17
- package/docs/classes/DataTable.html +11 -11
- package/docs/classes/Documents.html +45 -45
- package/docs/classes/FilterSlideout.html +14 -14
- package/docs/classes/Footer.html +4 -4
- package/docs/classes/Header.html +4 -4
- package/docs/classes/InstallationRequired.html +12 -12
- package/docs/classes/ItemForm.html +47 -47
- package/docs/classes/List.html +36 -36
- package/docs/classes/LoadingDialog.html +12 -12
- package/docs/classes/Modal.html +26 -26
- package/docs/classes/Navigation.html +6 -6
- package/docs/enums/ActionButtonTypes.html +6 -6
- package/docs/functions/formatBytes.html +2 -1
- package/docs/functions/formatDateValue.html +2 -1
- package/docs/functions/formatTimeValue.html +2 -1
- package/docs/functions/getFileExt.html +2 -1
- package/docs/index.html +1 -0
- package/docs/interfaces/IAuditLogItem.html +18 -18
- package/docs/interfaces/IAuditLogItemCreation.html +16 -16
- package/docs/interfaces/IAuditLogProps.html +5 -5
- package/docs/interfaces/IAuditLogViewProps.html +115 -0
- package/docs/interfaces/ICommentsItem.html +6 -6
- package/docs/interfaces/IDashboardProps.html +14 -14
- package/docs/interfaces/IDataTable.html +7 -7
- package/docs/interfaces/IDataTableProps.html +6 -6
- package/docs/interfaces/IDocumentsProps.html +25 -25
- package/docs/interfaces/IFilterItem.html +5 -5
- package/docs/interfaces/IFilterProps.html +4 -4
- package/docs/interfaces/IFooterProps.html +6 -6
- package/docs/interfaces/IHeaderProps.html +5 -5
- package/docs/interfaces/IItemFormCreateProps.html +14 -14
- package/docs/interfaces/IItemFormEditProps.html +15 -15
- package/docs/interfaces/IItemFormTab.html +7 -7
- package/docs/interfaces/IItemFormTabInfo.html +3 -3
- package/docs/interfaces/IItemFormViewProps.html +12 -12
- package/docs/interfaces/IListProps.html +9 -9
- package/docs/interfaces/IShowDialogProps.html +5 -5
- package/docs/modules.html +2 -0
- package/docs/variables/DattaTable.html +2 -1
- package/package.json +1 -1
package/build/auditLog/cfg.js
CHANGED
|
@@ -20,10 +20,10 @@ exports.Configuration = gd_sprest_bs_1.Helper.SPConfig({
|
|
|
20
20
|
}],
|
|
21
21
|
CustomFields: [
|
|
22
22
|
{
|
|
23
|
-
name: "
|
|
24
|
-
title: "Parent
|
|
25
|
-
description: "The
|
|
26
|
-
type: gd_sprest_bs_1.Helper.SPCfgFieldType.
|
|
23
|
+
name: "ParentIId",
|
|
24
|
+
title: "Parent Id",
|
|
25
|
+
description: "The parent identifier linked to this item.",
|
|
26
|
+
type: gd_sprest_bs_1.Helper.SPCfgFieldType.Text,
|
|
27
27
|
indexed: true
|
|
28
28
|
},
|
|
29
29
|
{
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Helper, Types } from "gd-sprest-bs";
|
|
2
2
|
import { List } from "../common/list";
|
|
3
|
+
import { IDataTableProps } from "../dashboard/table";
|
|
3
4
|
export interface IAuditLogItemCreation {
|
|
4
5
|
LogComment?: string;
|
|
5
6
|
LogData?: string;
|
|
6
|
-
|
|
7
|
+
ParentIId?: string;
|
|
7
8
|
ParentListName: string;
|
|
8
|
-
LogUserId
|
|
9
|
+
LogUserId?: number;
|
|
9
10
|
Title: string;
|
|
10
11
|
}
|
|
11
12
|
export interface IAuditLogItem extends IAuditLogItemCreation, Types.SP.IListItem {
|
|
@@ -22,6 +23,12 @@ export interface IAuditLogProps {
|
|
|
22
23
|
onInitialized?: () => void;
|
|
23
24
|
webUrl?: string;
|
|
24
25
|
}
|
|
26
|
+
export interface IAuditLogViewProps {
|
|
27
|
+
id: string;
|
|
28
|
+
listName: string;
|
|
29
|
+
onQuery?: (query: Types.IODataQuery) => Types.IODataQuery;
|
|
30
|
+
onTableRendering?: (props: IDataTableProps) => IDataTableProps;
|
|
31
|
+
}
|
|
25
32
|
/**
|
|
26
33
|
* Audit Log
|
|
27
34
|
*/
|
|
@@ -32,9 +39,10 @@ export declare class AuditLog {
|
|
|
32
39
|
private _list;
|
|
33
40
|
get List(): List<IAuditLogItem>;
|
|
34
41
|
constructor(props: IAuditLogProps);
|
|
35
|
-
|
|
42
|
+
private displayModal;
|
|
43
|
+
getItems(id: string, listName: string, onQuery?: (query: Types.IODataQuery) => Types.IODataQuery): PromiseLike<IAuditLogItem[]>;
|
|
36
44
|
install(): PromiseLike<void>;
|
|
37
45
|
logItem(values: IAuditLogItemCreation): PromiseLike<IAuditLogItem>;
|
|
38
46
|
uninstall(): PromiseLike<void>;
|
|
39
|
-
viewLog(
|
|
47
|
+
viewLog(props: IAuditLogViewProps): void;
|
|
40
48
|
}
|
package/build/auditLog/index.js
CHANGED
|
@@ -52,12 +52,85 @@ var AuditLog = /** @class */ (function () {
|
|
|
52
52
|
enumerable: false,
|
|
53
53
|
configurable: true
|
|
54
54
|
});
|
|
55
|
-
//
|
|
56
|
-
AuditLog.prototype.
|
|
55
|
+
// Method to view the audit log information for an item
|
|
56
|
+
AuditLog.prototype.displayModal = function (items, viewProps) {
|
|
57
|
+
// Clear the modal
|
|
58
|
+
modal_1.Modal.clear();
|
|
59
|
+
// Set the size
|
|
60
|
+
modal_1.Modal.setType(gd_sprest_bs_1.Components.ModalTypes.Large);
|
|
61
|
+
// Set the header
|
|
62
|
+
modal_1.Modal.setHeader("Audit History");
|
|
63
|
+
// Set the properties
|
|
64
|
+
var dtProps = {
|
|
65
|
+
el: modal_1.Modal.BodyElement,
|
|
66
|
+
rows: items,
|
|
67
|
+
dtProps: {
|
|
68
|
+
dom: 'rt<"row"<"col-sm-4"l><"col-sm-4"i><"col-sm-4"p>>',
|
|
69
|
+
columnDefs: [
|
|
70
|
+
{
|
|
71
|
+
"targets": [3],
|
|
72
|
+
"orderable": false,
|
|
73
|
+
"searchable": false
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
createdRow: function (row, data, index) {
|
|
77
|
+
jQuery('td', row).addClass('align-middle');
|
|
78
|
+
},
|
|
79
|
+
drawCallback: function (settings) {
|
|
80
|
+
var api = new jQuery.fn.dataTable.Api(settings);
|
|
81
|
+
jQuery(api.context[0].nTable).removeClass('no-footer');
|
|
82
|
+
jQuery(api.context[0].nTable).addClass('tbl-footer');
|
|
83
|
+
jQuery(api.context[0].nTable).addClass('table-striped');
|
|
84
|
+
jQuery(api.context[0].nTableWrapper).find('.dataTables_info').addClass('text-center');
|
|
85
|
+
jQuery(api.context[0].nTableWrapper).find('.dataTables_length').addClass('pt-2');
|
|
86
|
+
jQuery(api.context[0].nTableWrapper).find('.dataTables_paginate').addClass('pt-03');
|
|
87
|
+
},
|
|
88
|
+
headerCallback: function (thead, data, start, end, display) {
|
|
89
|
+
jQuery('th', thead).addClass('align-middle');
|
|
90
|
+
},
|
|
91
|
+
// Set the empty text
|
|
92
|
+
language: {
|
|
93
|
+
emptyTable: "No logs exist for this item."
|
|
94
|
+
},
|
|
95
|
+
// Order by the 1st column by default; ascending
|
|
96
|
+
order: [[0, "desc"]]
|
|
97
|
+
},
|
|
98
|
+
columns: [
|
|
99
|
+
{
|
|
100
|
+
name: "Created",
|
|
101
|
+
title: "Created"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: "Title",
|
|
105
|
+
title: "Title"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: "",
|
|
109
|
+
title: "User",
|
|
110
|
+
onRenderCell: function (el, col, item) {
|
|
111
|
+
// Render the user information
|
|
112
|
+
item.LogUser ? el.innerHTML = item.LogUser.Title : null;
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: "LogComment",
|
|
117
|
+
title: "Comment"
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
};
|
|
121
|
+
// Call the event
|
|
122
|
+
dtProps = viewProps.onTableRendering ? viewProps.onTableRendering(dtProps) : dtProps;
|
|
123
|
+
// Render the table
|
|
124
|
+
new table_1.DataTable(dtProps);
|
|
125
|
+
// Show the modal
|
|
126
|
+
modal_1.Modal.show();
|
|
127
|
+
};
|
|
128
|
+
// Gets data for an associated item, matching the ParentId value
|
|
129
|
+
AuditLog.prototype.getItems = function (id, listName, onQuery) {
|
|
57
130
|
// Set the odata query
|
|
58
131
|
var odata = {
|
|
59
132
|
Expand: ["LogUser"],
|
|
60
|
-
Filter: "ParentListName eq '".concat(listName, "' and
|
|
133
|
+
Filter: "ParentListName eq '".concat(listName, "' and ParentId eq '").concat(id, "'"),
|
|
61
134
|
OrderBy: ["Created desc"],
|
|
62
135
|
Select: ["*", "LogUser/EMail", "LogUser/Id", "LogUser/Title"]
|
|
63
136
|
};
|
|
@@ -81,86 +154,19 @@ var AuditLog = /** @class */ (function () {
|
|
|
81
154
|
// Remove the audit log list
|
|
82
155
|
return this.Configuration.uninstall();
|
|
83
156
|
};
|
|
84
|
-
// Method to view the audit log
|
|
85
|
-
AuditLog.prototype.viewLog = function (
|
|
157
|
+
// Method to view the audit log by specified id
|
|
158
|
+
AuditLog.prototype.viewLog = function (props) {
|
|
159
|
+
var _this = this;
|
|
86
160
|
// Display a loading dialog
|
|
87
161
|
loadingDialog_1.LoadingDialog.setHeader("Loading Audit History");
|
|
88
162
|
loadingDialog_1.LoadingDialog.setBody("This will close after the information is loaded...");
|
|
89
163
|
loadingDialog_1.LoadingDialog.show();
|
|
90
164
|
// Load the information
|
|
91
|
-
this.getItems(
|
|
92
|
-
//
|
|
93
|
-
|
|
94
|
-
// Set the size
|
|
95
|
-
modal_1.Modal.setType(gd_sprest_bs_1.Components.ModalTypes.Large);
|
|
96
|
-
// Set the header
|
|
97
|
-
modal_1.Modal.setHeader("Audit History");
|
|
98
|
-
// Render the table
|
|
99
|
-
new table_1.DataTable({
|
|
100
|
-
el: modal_1.Modal.BodyElement,
|
|
101
|
-
rows: items,
|
|
102
|
-
dtProps: {
|
|
103
|
-
dom: 'rt<"row"<"col-sm-4"l><"col-sm-4"i><"col-sm-4"p>>',
|
|
104
|
-
columnDefs: [
|
|
105
|
-
{
|
|
106
|
-
"targets": [3, 4],
|
|
107
|
-
"orderable": false,
|
|
108
|
-
"searchable": false
|
|
109
|
-
}
|
|
110
|
-
],
|
|
111
|
-
createdRow: function (row, data, index) {
|
|
112
|
-
jQuery('td', row).addClass('align-middle');
|
|
113
|
-
},
|
|
114
|
-
drawCallback: function (settings) {
|
|
115
|
-
var api = new jQuery.fn.dataTable.Api(settings);
|
|
116
|
-
jQuery(api.context[0].nTable).removeClass('no-footer');
|
|
117
|
-
jQuery(api.context[0].nTable).addClass('tbl-footer');
|
|
118
|
-
jQuery(api.context[0].nTable).addClass('table-striped');
|
|
119
|
-
jQuery(api.context[0].nTableWrapper).find('.dataTables_info').addClass('text-center');
|
|
120
|
-
jQuery(api.context[0].nTableWrapper).find('.dataTables_length').addClass('pt-2');
|
|
121
|
-
jQuery(api.context[0].nTableWrapper).find('.dataTables_paginate').addClass('pt-03');
|
|
122
|
-
},
|
|
123
|
-
headerCallback: function (thead, data, start, end, display) {
|
|
124
|
-
jQuery('th', thead).addClass('align-middle');
|
|
125
|
-
},
|
|
126
|
-
// Set the empty text
|
|
127
|
-
language: {
|
|
128
|
-
emptyTable: "No logs exist for this item."
|
|
129
|
-
},
|
|
130
|
-
// Order by the 1st column by default; ascending
|
|
131
|
-
order: [[0, "desc"]]
|
|
132
|
-
},
|
|
133
|
-
columns: [
|
|
134
|
-
{
|
|
135
|
-
name: "Created",
|
|
136
|
-
title: "Created"
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
name: "Title",
|
|
140
|
-
title: "Title"
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
name: "",
|
|
144
|
-
title: "User",
|
|
145
|
-
onRenderCell: function (el, col, item) {
|
|
146
|
-
// Render the user information
|
|
147
|
-
item.LogUser ? el.innerHTML = item.LogUser.Title : null;
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
name: "LogComment",
|
|
152
|
-
title: "Comment"
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
name: "LogData",
|
|
156
|
-
title: "Data"
|
|
157
|
-
}
|
|
158
|
-
]
|
|
159
|
-
});
|
|
165
|
+
this.getItems(props.id, props.listName, props.onQuery).then(function (items) {
|
|
166
|
+
// Display the modal
|
|
167
|
+
_this.displayModal(items, props);
|
|
160
168
|
// Hide the loading dialog
|
|
161
169
|
loadingDialog_1.LoadingDialog.hide();
|
|
162
|
-
// Show the modal
|
|
163
|
-
modal_1.Modal.show();
|
|
164
170
|
});
|
|
165
171
|
};
|
|
166
172
|
return AuditLog;
|
package/dist/dattatable.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
17
17
|
|
|
18
18
|
"use strict";
|
|
19
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Configuration = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.10.4/node_modules/gd-sprest-bs/build/index.js\");\r\n// Configuration\r\nexports.Configuration = gd_sprest_bs_1.Helper.SPConfig({\r\n ListCfg: [{\r\n ListInformation: {\r\n BaseTemplate: gd_sprest_bs_1.SPTypes.ListTemplateType.GenericList,\r\n Title: \"Audit Log\",\r\n Hidden: true,\r\n NoCrawl: true\r\n },\r\n TitleFieldIndexed: true,\r\n ContentTypes: [{\r\n Name: \"Item\",\r\n FieldRefs: [\r\n \"Title\",\r\n ]\r\n }],\r\n CustomFields: [\r\n {\r\n name: \"
|
|
19
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Configuration = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.10.4/node_modules/gd-sprest-bs/build/index.js\");\r\n// Configuration\r\nexports.Configuration = gd_sprest_bs_1.Helper.SPConfig({\r\n ListCfg: [{\r\n ListInformation: {\r\n BaseTemplate: gd_sprest_bs_1.SPTypes.ListTemplateType.GenericList,\r\n Title: \"Audit Log\",\r\n Hidden: true,\r\n NoCrawl: true\r\n },\r\n TitleFieldIndexed: true,\r\n ContentTypes: [{\r\n Name: \"Item\",\r\n FieldRefs: [\r\n \"Title\",\r\n ]\r\n }],\r\n CustomFields: [\r\n {\r\n name: \"ParentIId\",\r\n title: \"Parent Id\",\r\n description: \"The parent identifier linked to this item.\",\r\n type: gd_sprest_bs_1.Helper.SPCfgFieldType.Text,\r\n indexed: true\r\n },\r\n {\r\n name: \"ParentListName\",\r\n title: \"Parent List Name\",\r\n description: \"The list name linked to this item.\",\r\n type: gd_sprest_bs_1.Helper.SPCfgFieldType.Text,\r\n indexed: true\r\n },\r\n {\r\n name: \"LogComment\",\r\n title: \"LogComment\",\r\n description: \"The comment to write to the audit log.\",\r\n type: gd_sprest_bs_1.Helper.SPCfgFieldType.Note,\r\n noteType: gd_sprest_bs_1.SPTypes.FieldNoteType.TextOnly\r\n },\r\n {\r\n name: \"LogData\",\r\n title: \"Log Data\",\r\n description: \"The data to write to the audit log.\",\r\n type: gd_sprest_bs_1.Helper.SPCfgFieldType.Note,\r\n noteType: gd_sprest_bs_1.SPTypes.FieldNoteType.TextOnly\r\n },\r\n {\r\n name: \"LogUser\",\r\n title: \"Log User\",\r\n description: \"The user who is associated with this log entry.\",\r\n type: gd_sprest_bs_1.Helper.SPCfgFieldType.User\r\n }\r\n ]\r\n }]\r\n});\r\n\n\n//# sourceURL=webpack://dattatable/./build/auditLog/cfg.js?");
|
|
20
20
|
|
|
21
21
|
/***/ }),
|
|
22
22
|
|
|
@@ -27,7 +27,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
27
27
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
28
28
|
|
|
29
29
|
"use strict";
|
|
30
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.AuditLog = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.10.4/node_modules/gd-sprest-bs/build/index.js\");\r\nvar jQuery = __webpack_require__(/*! jquery */ \"./node_modules/.pnpm/jquery@3.6.1/node_modules/jquery/dist/jquery.min.js\");\r\nvar modal_1 = __webpack_require__(/*! ../common/modal */ \"./build/common/modal.js\");\r\nvar list_1 = __webpack_require__(/*! ../common/list */ \"./build/common/list.js\");\r\nvar loadingDialog_1 = __webpack_require__(/*! ../common/loadingDialog */ \"./build/common/loadingDialog.js\");\r\nvar table_1 = __webpack_require__(/*! ../dashboard/table */ \"./build/dashboard/table.js\");\r\nvar cfg_1 = __webpack_require__(/*! ./cfg */ \"./build/auditLog/cfg.js\");\r\n/**\r\n * Audit Log\r\n */\r\nvar AuditLog = /** @class */ (function () {\r\n // Constructor\r\n function AuditLog(props) {\r\n // Configuration\r\n this._cfg = null;\r\n // List\r\n this._list = null;\r\n // Set the configuration\r\n this._cfg = cfg_1.Configuration;\r\n // Update the list name\r\n var listName = props.listName ? props.listName : this._cfg._configuration.ListCfg[0].ListInformation.Title;\r\n props.listName ? this._cfg._configuration.ListCfg[0].ListInformation.Title = listName : null;\r\n // Create the list component\r\n this._list = new list_1.List({\r\n listName: listName,\r\n webUrl: props.webUrl,\r\n onInitError: props.onInitError,\r\n onInitialized: props.onInitialized,\r\n itemQuery: {\r\n Filter: \"Id eq 0\"\r\n }\r\n });\r\n }\r\n Object.defineProperty(AuditLog.prototype, \"Configuration\", {\r\n get: function () { return this._cfg; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(AuditLog.prototype, \"AuditListName\", {\r\n get: function () {\r\n // Return the list name\r\n return this.Configuration._configuration.ListCfg[0].ListInformation.Title;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(AuditLog.prototype, \"List\", {\r\n get: function () { return this._list; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n //
|
|
30
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.AuditLog = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.10.4/node_modules/gd-sprest-bs/build/index.js\");\r\nvar jQuery = __webpack_require__(/*! jquery */ \"./node_modules/.pnpm/jquery@3.6.1/node_modules/jquery/dist/jquery.min.js\");\r\nvar modal_1 = __webpack_require__(/*! ../common/modal */ \"./build/common/modal.js\");\r\nvar list_1 = __webpack_require__(/*! ../common/list */ \"./build/common/list.js\");\r\nvar loadingDialog_1 = __webpack_require__(/*! ../common/loadingDialog */ \"./build/common/loadingDialog.js\");\r\nvar table_1 = __webpack_require__(/*! ../dashboard/table */ \"./build/dashboard/table.js\");\r\nvar cfg_1 = __webpack_require__(/*! ./cfg */ \"./build/auditLog/cfg.js\");\r\n/**\r\n * Audit Log\r\n */\r\nvar AuditLog = /** @class */ (function () {\r\n // Constructor\r\n function AuditLog(props) {\r\n // Configuration\r\n this._cfg = null;\r\n // List\r\n this._list = null;\r\n // Set the configuration\r\n this._cfg = cfg_1.Configuration;\r\n // Update the list name\r\n var listName = props.listName ? props.listName : this._cfg._configuration.ListCfg[0].ListInformation.Title;\r\n props.listName ? this._cfg._configuration.ListCfg[0].ListInformation.Title = listName : null;\r\n // Create the list component\r\n this._list = new list_1.List({\r\n listName: listName,\r\n webUrl: props.webUrl,\r\n onInitError: props.onInitError,\r\n onInitialized: props.onInitialized,\r\n itemQuery: {\r\n Filter: \"Id eq 0\"\r\n }\r\n });\r\n }\r\n Object.defineProperty(AuditLog.prototype, \"Configuration\", {\r\n get: function () { return this._cfg; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(AuditLog.prototype, \"AuditListName\", {\r\n get: function () {\r\n // Return the list name\r\n return this.Configuration._configuration.ListCfg[0].ListInformation.Title;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(AuditLog.prototype, \"List\", {\r\n get: function () { return this._list; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n // Method to view the audit log information for an item\r\n AuditLog.prototype.displayModal = function (items, viewProps) {\r\n // Clear the modal\r\n modal_1.Modal.clear();\r\n // Set the size\r\n modal_1.Modal.setType(gd_sprest_bs_1.Components.ModalTypes.Large);\r\n // Set the header\r\n modal_1.Modal.setHeader(\"Audit History\");\r\n // Set the properties\r\n var dtProps = {\r\n el: modal_1.Modal.BodyElement,\r\n rows: items,\r\n dtProps: {\r\n dom: 'rt<\"row\"<\"col-sm-4\"l><\"col-sm-4\"i><\"col-sm-4\"p>>',\r\n columnDefs: [\r\n {\r\n \"targets\": [3],\r\n \"orderable\": false,\r\n \"searchable\": false\r\n }\r\n ],\r\n createdRow: function (row, data, index) {\r\n jQuery('td', row).addClass('align-middle');\r\n },\r\n drawCallback: function (settings) {\r\n var api = new jQuery.fn.dataTable.Api(settings);\r\n jQuery(api.context[0].nTable).removeClass('no-footer');\r\n jQuery(api.context[0].nTable).addClass('tbl-footer');\r\n jQuery(api.context[0].nTable).addClass('table-striped');\r\n jQuery(api.context[0].nTableWrapper).find('.dataTables_info').addClass('text-center');\r\n jQuery(api.context[0].nTableWrapper).find('.dataTables_length').addClass('pt-2');\r\n jQuery(api.context[0].nTableWrapper).find('.dataTables_paginate').addClass('pt-03');\r\n },\r\n headerCallback: function (thead, data, start, end, display) {\r\n jQuery('th', thead).addClass('align-middle');\r\n },\r\n // Set the empty text\r\n language: {\r\n emptyTable: \"No logs exist for this item.\"\r\n },\r\n // Order by the 1st column by default; ascending\r\n order: [[0, \"desc\"]]\r\n },\r\n columns: [\r\n {\r\n name: \"Created\",\r\n title: \"Created\"\r\n },\r\n {\r\n name: \"Title\",\r\n title: \"Title\"\r\n },\r\n {\r\n name: \"\",\r\n title: \"User\",\r\n onRenderCell: function (el, col, item) {\r\n // Render the user information\r\n item.LogUser ? el.innerHTML = item.LogUser.Title : null;\r\n }\r\n },\r\n {\r\n name: \"LogComment\",\r\n title: \"Comment\"\r\n }\r\n ]\r\n };\r\n // Call the event\r\n dtProps = viewProps.onTableRendering ? viewProps.onTableRendering(dtProps) : dtProps;\r\n // Render the table\r\n new table_1.DataTable(dtProps);\r\n // Show the modal\r\n modal_1.Modal.show();\r\n };\r\n // Gets data for an associated item, matching the ParentId value\r\n AuditLog.prototype.getItems = function (id, listName, onQuery) {\r\n // Set the odata query\r\n var odata = {\r\n Expand: [\"LogUser\"],\r\n Filter: \"ParentListName eq '\".concat(listName, \"' and ParentId eq '\").concat(id, \"'\"),\r\n OrderBy: [\"Created desc\"],\r\n Select: [\"*\", \"LogUser/EMail\", \"LogUser/Id\", \"LogUser/Title\"]\r\n };\r\n // Call the event\r\n odata = onQuery ? onQuery(odata) : odata;\r\n // Get the list data\r\n return this.List.refresh(odata);\r\n };\r\n // Installs the list\r\n AuditLog.prototype.install = function () {\r\n // Installs the list\r\n return this.Configuration.install();\r\n };\r\n // Logs an item to the audit log\r\n AuditLog.prototype.logItem = function (values) {\r\n // Create the item\r\n return this.List.createItem(values);\r\n };\r\n // Removes the audit log list\r\n AuditLog.prototype.uninstall = function () {\r\n // Remove the audit log list\r\n return this.Configuration.uninstall();\r\n };\r\n // Method to view the audit log by specified id\r\n AuditLog.prototype.viewLog = function (props) {\r\n var _this = this;\r\n // Display a loading dialog\r\n loadingDialog_1.LoadingDialog.setHeader(\"Loading Audit History\");\r\n loadingDialog_1.LoadingDialog.setBody(\"This will close after the information is loaded...\");\r\n loadingDialog_1.LoadingDialog.show();\r\n // Load the information\r\n this.getItems(props.id, props.listName, props.onQuery).then(function (items) {\r\n // Display the modal\r\n _this.displayModal(items, props);\r\n // Hide the loading dialog\r\n loadingDialog_1.LoadingDialog.hide();\r\n });\r\n };\r\n return AuditLog;\r\n}());\r\nexports.AuditLog = AuditLog;\r\n\n\n//# sourceURL=webpack://dattatable/./build/auditLog/index.js?");
|
|
31
31
|
|
|
32
32
|
/***/ }),
|
|
33
33
|
|