dattatable 2.6.2 → 2.6.3
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/README.md +14 -14
- package/build/common/installRequired.d.ts +1 -0
- package/build/common/installRequired.js +2 -0
- package/dist/dattatable.js +1 -1
- package/dist/dattatable.min.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/AuditLog.html +13 -13
- 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 +40 -40
- 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 +1 -1
- package/docs/functions/formatDateValue.html +1 -1
- package/docs/functions/formatTimeValue.html +1 -1
- package/docs/functions/getFileExt.html +1 -1
- package/docs/index.html +14 -14
- package/docs/interfaces/IAuditLogItem.html +9 -9
- package/docs/interfaces/IAuditLogItemCreation.html +7 -7
- package/docs/interfaces/IAuditLogProps.html +5 -5
- package/docs/interfaces/IAuditLogViewProps.html +6 -6
- 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/IInstallProps.html +4 -4
- 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 +22 -7
- package/docs/variables/DattaTable.html +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -13,26 +13,26 @@ This library will help generate a dashboard or an interactive [datatables.net](h
|
|
|
13
13
|
|
|
14
14
|
Follow this [code walkthrough](https://github.com/gunjandatta/sp-dashboard/wiki) to build a basic example of this solution.
|
|
15
15
|
|
|
16
|
-
## [Documentation](https://datta-
|
|
16
|
+
## [Documentation](https://datta-register.github.io/dattatable/)
|
|
17
17
|
|
|
18
18
|
### Common Methods
|
|
19
19
|
|
|
20
|
-
* [formatDateTimeValue](https://datta-
|
|
21
|
-
* [formatDateValue](https://datta-
|
|
20
|
+
* [formatDateTimeValue](https://datta-register.github.io/dattatable/modules.html#formatDateTimeValue)
|
|
21
|
+
* [formatDateValue](https://datta-register.github.io/dattatable/modules.html#formatDateValue)
|
|
22
22
|
|
|
23
23
|
### Components
|
|
24
24
|
|
|
25
|
-
* [Canvas Form](https://datta-
|
|
26
|
-
* [Dashboard](https://datta-
|
|
27
|
-
* [Installation Required](https://datta-
|
|
28
|
-
* [Item Form](https://datta-
|
|
29
|
-
* [Loading Dialog](https://datta-
|
|
30
|
-
* [Modal](https://datta-
|
|
25
|
+
* [Canvas Form](https://datta-register.github.io/dattatable/classes/CanvasForm.html)
|
|
26
|
+
* [Dashboard](https://datta-register.github.io/dattatable/classes/Dashboard.html)
|
|
27
|
+
* [Installation Required](https://datta-register.github.io/dattatable/classes/InstallationRequired.html)
|
|
28
|
+
* [Item Form](https://datta-register.github.io/dattatable/classes/ItemForm.html)
|
|
29
|
+
* [Loading Dialog](https://datta-register.github.io/dattatable/classes/LoadingDialog.html)
|
|
30
|
+
* [Modal](https://datta-register.github.io/dattatable/classes/Modal.html)
|
|
31
31
|
|
|
32
32
|
### Dashboard Components
|
|
33
33
|
|
|
34
|
-
* [DataTable](https://datta-
|
|
35
|
-
* [FilterSlideout](https://datta-
|
|
36
|
-
* [Footer](https://datta-
|
|
37
|
-
* [Header](https://datta-
|
|
38
|
-
* [Navigation](https://datta-
|
|
34
|
+
* [DataTable](https://datta-register.github.io/dattatable/classes/DataTable.html)
|
|
35
|
+
* [FilterSlideout](https://datta-register.github.io/dattatable/classes/FilterSlideout.html)
|
|
36
|
+
* [Footer](https://datta-register.github.io/dattatable/classes/Footer.html)
|
|
37
|
+
* [Header](https://datta-register.github.io/dattatable/classes/Header.html)
|
|
38
|
+
* [Navigation](https://datta-register.github.io/dattatable/classes/Navigation.html)
|
|
@@ -7,6 +7,7 @@ export interface IInstallProps {
|
|
|
7
7
|
export interface IShowDialogProps {
|
|
8
8
|
errors?: Components.IListGroupItem[];
|
|
9
9
|
onBodyRendered?(el: HTMLElement): any;
|
|
10
|
+
onCompleted?: () => void;
|
|
10
11
|
onFooterRendered?(el: HTMLElement): any;
|
|
11
12
|
onHeaderRendered?(el: HTMLElement): any;
|
|
12
13
|
onInstalled?: (cfg?: Helper.ISPConfig) => void;
|
package/dist/dattatable.js
CHANGED
|
@@ -82,7 +82,7 @@ eval("\r\n/** Common Components */\r\nvar __createBinding = (this && this.__crea
|
|
|
82
82
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
83
83
|
|
|
84
84
|
"use strict";
|
|
85
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.InstallationRequired = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.10.6/node_modules/gd-sprest-bs/build/index.js\");\r\nvar loadingDialog_1 = __webpack_require__(/*! ./loadingDialog */ \"./build/common/loadingDialog.js\");\r\nvar modal_1 = __webpack_require__(/*! ./modal */ \"./build/common/modal.js\");\r\n/**\r\n * Installation Required\r\n * Checks the SharePoint configuration file to see if an install is required.\r\n */\r\nvar InstallationRequired = /** @class */ (function () {\r\n function InstallationRequired() {\r\n }\r\n Object.defineProperty(InstallationRequired, \"CustomActionsExist\", {\r\n get: function () { return this._customActionsExist; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n // Checks the custom actions\r\n InstallationRequired.checkCustomActions = function (cfg) {\r\n var _this = this;\r\n // Clear the flag\r\n this._customActionsExist = true;\r\n // Method to check the web custom actions\r\n var checkWeb = function () {\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Ensure custom actions exist\r\n if (cfg._configuration.CustomActionCfg == null || cfg._configuration.CustomActionCfg.Web == null || cfg._configuration.CustomActionCfg.Web.length == 0) {\r\n // Resolve the request\r\n resolve(null);\r\n return;\r\n }\r\n // Load the web custom actions\r\n var web = (0, gd_sprest_bs_1.Web)();\r\n web.UserCustomActions().execute(function (webCustomActions) {\r\n // Parse the web custom actions\r\n for (var i = 0; i < cfg._configuration.CustomActionCfg.Web.length; i++) {\r\n var customAction = cfg._configuration.CustomActionCfg.Web[i];\r\n var found = false;\r\n // Parse the web custom actions\r\n for (var j = 0; j < webCustomActions.results.length; j++) {\r\n // See if they match\r\n if (customAction.Title == webCustomActions.results[j].Title) {\r\n // Set the flag\r\n found = true;\r\n }\r\n }\r\n // See if it was not found\r\n if (!found) {\r\n // Set the error\r\n _this._report.push(\"Web Custom Action '\" + customAction.Title + \"' is missing.\");\r\n // Set the flag\r\n _this._customActionsExist = false;\r\n }\r\n }\r\n // Resolve the request\r\n resolve(null);\r\n });\r\n });\r\n };\r\n // Method to check the site custom actions\r\n var checkSite = function () {\r\n return new Promise(function (resolve) {\r\n // Ensure custom actions exist\r\n if (cfg._configuration.CustomActionCfg == null || cfg._configuration.CustomActionCfg.Site == null || cfg._configuration.CustomActionCfg.Site.length == 0) {\r\n // Resolve the request\r\n resolve(null);\r\n return;\r\n }\r\n // Load the site custom actions\r\n (0, gd_sprest_bs_1.Site)().UserCustomActions().execute(function (siteCustomActions) {\r\n // Parse the site custom actions\r\n for (var i = 0; i < cfg._configuration.CustomActionCfg.Site.length; i++) {\r\n var customAction = cfg._configuration.CustomActionCfg.Site[i];\r\n var found = false;\r\n // Parse the web custom actions\r\n for (var j = 0; j < siteCustomActions.results.length; j++) {\r\n // See if they match\r\n if (customAction.Title == siteCustomActions.results[j].Title) {\r\n // Set the flag\r\n found = true;\r\n }\r\n }\r\n // See if it was not found\r\n if (!found) {\r\n // Set the error\r\n _this._report.push(\"Site Custom Action '\" + customAction.Title + \"' is missing.\");\r\n // Set the flag\r\n _this._customActionsExist = false;\r\n }\r\n }\r\n // Resolve the request\r\n resolve(null);\r\n });\r\n });\r\n };\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Check the site & web\r\n Promise.all([\r\n checkSite(),\r\n checkWeb()\r\n ]).then(function () {\r\n // Resolve the request\r\n resolve();\r\n });\r\n });\r\n };\r\n Object.defineProperty(InstallationRequired, \"ListsExist\", {\r\n get: function () { return this._listsExist; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n // Checks the lists\r\n InstallationRequired.checkLists = function (cfg) {\r\n var _this = this;\r\n // Clear the flag\r\n this._listsExist = true;\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Ensure lists exist\r\n if (cfg._configuration.ListCfg == null || cfg._configuration.ListCfg.length == 0) {\r\n // Resolve the request\r\n resolve(null);\r\n return;\r\n }\r\n // Parse the lists\r\n gd_sprest_bs_1.Helper.Executor(cfg._configuration.ListCfg, function (listCfg) {\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Get the list\r\n (0, gd_sprest_bs_1.Web)().Lists(listCfg.ListInformation.Title).query({\r\n Expand: [\"Fields\"]\r\n }).execute(\r\n // Success\r\n function (list) {\r\n // Parse the custom fields\r\n gd_sprest_bs_1.Helper.Executor(listCfg.CustomFields, function (cfg) {\r\n var exists = false;\r\n // Parse the list fields\r\n for (var i = 0; i < list.Fields.results.length; i++) {\r\n // See if the field exists\r\n if (list.Fields.results[i].InternalName == cfg.name) {\r\n // Set the flag\r\n exists = true;\r\n break;\r\n }\r\n }\r\n // See if the field doesn't exist\r\n if (!exists) {\r\n // Field doesn't exist\r\n _this._report.push(\"List '\" + listCfg.ListInformation.Title + \"' is missing a field: \" + cfg.name);\r\n }\r\n }).then(function () {\r\n // Resolve the promise\r\n resolve(null);\r\n });\r\n }, \r\n // Error\r\n function () {\r\n // List doesn't exist\r\n _this._report.push(\"List '\" + listCfg.ListInformation.Title + \"' does not exist\");\r\n // Set the flag\r\n _this._listsExist = false;\r\n // Resolve the promise\r\n resolve(null);\r\n });\r\n });\r\n }).then(function () {\r\n // Resolve the request\r\n resolve();\r\n });\r\n });\r\n };\r\n // Checks the configuration to see if an installation is required\r\n InstallationRequired.requiresInstall = function (props) {\r\n var _this = this;\r\n // Save the configuration\r\n this._cfg = props.cfg;\r\n // Clear the report\r\n this._report = [];\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Ensure this is an array\r\n var cfgs = typeof (_this._cfg.length) === \"number\" ? _this._cfg : [_this._cfg];\r\n // Parse the configurations\r\n gd_sprest_bs_1.Helper.Executor(cfgs, function (cfg) {\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n var numbOfErrors = _this._report.length;\r\n // Check the configuration\r\n Promise.all([\r\n // Check the custom actions\r\n _this.checkCustomActions(cfg),\r\n // Check the lists\r\n _this.checkLists(cfg)\r\n ]).then(function () {\r\n // See if there are errors\r\n if (_this._report.length > numbOfErrors) {\r\n // Execute the event\r\n props.onError ? props.onError(cfg) : null;\r\n }\r\n // Execute the event and see if a promise was returned\r\n var returnVal = props.onCompleted ? props.onCompleted() : null;\r\n if (returnVal && typeof (returnVal[\"then\"]) === \"function\") {\r\n // Wait for the request to complete\r\n returnVal.then(function () {\r\n // Resolve the request\r\n resolve(_this._report.length > 0);\r\n });\r\n }\r\n else {\r\n // Resolve the request\r\n resolve(_this._report.length > 0);\r\n }\r\n });\r\n });\r\n }).then(function () {\r\n // Resolve the request\r\n resolve(_this._report.length > 0);\r\n });\r\n });\r\n };\r\n InstallationRequired.showDialog = function (props) {\r\n var _this = this;\r\n if (props === void 0) { props = {}; }\r\n // Clear the modal\r\n modal_1.Modal.clear();\r\n // Ensure the configuration exists\r\n if (this._cfg == null || this._report == null) {\r\n // Show the error dialog\r\n this.showErrorDialog();\r\n return;\r\n }\r\n // Set the header\r\n modal_1.Modal.setHeader(\"Installation Required\");\r\n // Set the body\r\n modal_1.Modal.setBody(gd_sprest_bs_1.Components.Card({\r\n body: [\r\n {\r\n text: this._report.length > 0 || (props.errors && props.errors.length > 0) ?\r\n \"An installation is required. The following were missing in your environment:\" :\r\n \"No errors were detected.\"\r\n },\r\n {\r\n onRender: function (el) {\r\n var items = props.errors || [];\r\n // Parse the report\r\n for (var i = 0; i < _this._report.length; i++) {\r\n // Add the item\r\n items.push({ content: _this._report[i] });\r\n }\r\n // Render a list\r\n gd_sprest_bs_1.Components.ListGroup({\r\n el: el,\r\n items: items\r\n });\r\n }\r\n }\r\n ]\r\n }).el);\r\n // Render the install button\r\n var btnInstall = null;\r\n gd_sprest_bs_1.Components.Tooltip({\r\n el: modal_1.Modal.FooterElement,\r\n content: \"Installs the SharePoint Assets\",\r\n btnProps: {\r\n assignTo: function (btn) { btnInstall = btn; },\r\n text: \"Install\",\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlineSuccess,\r\n onClick: function () {\r\n // Show a loading dialog\r\n loadingDialog_1.LoadingDialog.setHeader(\"Installing the Solution\");\r\n loadingDialog_1.LoadingDialog.setBody(\"This will close after the assets are installed.\");\r\n loadingDialog_1.LoadingDialog.show();\r\n // Ensure this is an array\r\n var cfgs = typeof (_this._cfg.length) === \"number\" ? _this._cfg : [_this._cfg];\r\n // Parse the configurations\r\n gd_sprest_bs_1.Helper.Executor(cfgs, function (cfg) {\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n cfg.install().then(function () {\r\n // Hide the button\r\n btnInstall.hide();\r\n // Show the refresh button\r\n btnRefresh.show();\r\n // Call the event\r\n props.onInstalled ? props.onInstalled(cfg) : null;\r\n // Check the next configuration\r\n resolve(null);\r\n });\r\n });\r\n }).then(function () {\r\n // Close the dialog\r\n loadingDialog_1.LoadingDialog.hide();\r\n });\r\n }\r\n }\r\n });\r\n // Render the refresh button\r\n var btnRefresh = null;\r\n gd_sprest_bs_1.Components.Tooltip({\r\n el: modal_1.Modal.FooterElement,\r\n content: \"Refresh the Page\",\r\n btnProps: {\r\n assignTo: function (btn) { btnRefresh = btn; },\r\n className: \"d-none\",\r\n text: \"Refresh\",\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlinePrimary,\r\n onClick: function () {\r\n // Refresh the page\r\n window.location.reload();\r\n }\r\n }\r\n });\r\n // Call the events\r\n props.onHeaderRendered ? props.onHeaderRendered(modal_1.Modal.HeaderElement) : null;\r\n props.onBodyRendered ? props.onBodyRendered(modal_1.Modal.BodyElement) : null;\r\n props.onFooterRendered ? props.onFooterRendered(modal_1.Modal.FooterElement) : null;\r\n // Show the modal\r\n modal_1.Modal.show();\r\n };\r\n InstallationRequired.showErrorDialog = function () {\r\n // Set the header\r\n modal_1.Modal.setHeader(\"Not Configured\");\r\n // Set the body\r\n modal_1.Modal.setBody(\"The component has not been configured. The SPConfiguration definition hasn't been initialized.\");\r\n // Show the dialog\r\n modal_1.Modal.show();\r\n };\r\n InstallationRequired._cfg = null;\r\n InstallationRequired._report = null;\r\n // Custom Actions exists\r\n InstallationRequired._customActionsExist = null;\r\n // Lists exists\r\n InstallationRequired._listsExist = null;\r\n return InstallationRequired;\r\n}());\r\nexports.InstallationRequired = InstallationRequired;\r\n\n\n//# sourceURL=webpack://dattatable/./build/common/installRequired.js?");
|
|
85
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.InstallationRequired = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.10.6/node_modules/gd-sprest-bs/build/index.js\");\r\nvar loadingDialog_1 = __webpack_require__(/*! ./loadingDialog */ \"./build/common/loadingDialog.js\");\r\nvar modal_1 = __webpack_require__(/*! ./modal */ \"./build/common/modal.js\");\r\n/**\r\n * Installation Required\r\n * Checks the SharePoint configuration file to see if an install is required.\r\n */\r\nvar InstallationRequired = /** @class */ (function () {\r\n function InstallationRequired() {\r\n }\r\n Object.defineProperty(InstallationRequired, \"CustomActionsExist\", {\r\n get: function () { return this._customActionsExist; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n // Checks the custom actions\r\n InstallationRequired.checkCustomActions = function (cfg) {\r\n var _this = this;\r\n // Clear the flag\r\n this._customActionsExist = true;\r\n // Method to check the web custom actions\r\n var checkWeb = function () {\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Ensure custom actions exist\r\n if (cfg._configuration.CustomActionCfg == null || cfg._configuration.CustomActionCfg.Web == null || cfg._configuration.CustomActionCfg.Web.length == 0) {\r\n // Resolve the request\r\n resolve(null);\r\n return;\r\n }\r\n // Load the web custom actions\r\n var web = (0, gd_sprest_bs_1.Web)();\r\n web.UserCustomActions().execute(function (webCustomActions) {\r\n // Parse the web custom actions\r\n for (var i = 0; i < cfg._configuration.CustomActionCfg.Web.length; i++) {\r\n var customAction = cfg._configuration.CustomActionCfg.Web[i];\r\n var found = false;\r\n // Parse the web custom actions\r\n for (var j = 0; j < webCustomActions.results.length; j++) {\r\n // See if they match\r\n if (customAction.Title == webCustomActions.results[j].Title) {\r\n // Set the flag\r\n found = true;\r\n }\r\n }\r\n // See if it was not found\r\n if (!found) {\r\n // Set the error\r\n _this._report.push(\"Web Custom Action '\" + customAction.Title + \"' is missing.\");\r\n // Set the flag\r\n _this._customActionsExist = false;\r\n }\r\n }\r\n // Resolve the request\r\n resolve(null);\r\n });\r\n });\r\n };\r\n // Method to check the site custom actions\r\n var checkSite = function () {\r\n return new Promise(function (resolve) {\r\n // Ensure custom actions exist\r\n if (cfg._configuration.CustomActionCfg == null || cfg._configuration.CustomActionCfg.Site == null || cfg._configuration.CustomActionCfg.Site.length == 0) {\r\n // Resolve the request\r\n resolve(null);\r\n return;\r\n }\r\n // Load the site custom actions\r\n (0, gd_sprest_bs_1.Site)().UserCustomActions().execute(function (siteCustomActions) {\r\n // Parse the site custom actions\r\n for (var i = 0; i < cfg._configuration.CustomActionCfg.Site.length; i++) {\r\n var customAction = cfg._configuration.CustomActionCfg.Site[i];\r\n var found = false;\r\n // Parse the web custom actions\r\n for (var j = 0; j < siteCustomActions.results.length; j++) {\r\n // See if they match\r\n if (customAction.Title == siteCustomActions.results[j].Title) {\r\n // Set the flag\r\n found = true;\r\n }\r\n }\r\n // See if it was not found\r\n if (!found) {\r\n // Set the error\r\n _this._report.push(\"Site Custom Action '\" + customAction.Title + \"' is missing.\");\r\n // Set the flag\r\n _this._customActionsExist = false;\r\n }\r\n }\r\n // Resolve the request\r\n resolve(null);\r\n });\r\n });\r\n };\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Check the site & web\r\n Promise.all([\r\n checkSite(),\r\n checkWeb()\r\n ]).then(function () {\r\n // Resolve the request\r\n resolve();\r\n });\r\n });\r\n };\r\n Object.defineProperty(InstallationRequired, \"ListsExist\", {\r\n get: function () { return this._listsExist; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n // Checks the lists\r\n InstallationRequired.checkLists = function (cfg) {\r\n var _this = this;\r\n // Clear the flag\r\n this._listsExist = true;\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Ensure lists exist\r\n if (cfg._configuration.ListCfg == null || cfg._configuration.ListCfg.length == 0) {\r\n // Resolve the request\r\n resolve(null);\r\n return;\r\n }\r\n // Parse the lists\r\n gd_sprest_bs_1.Helper.Executor(cfg._configuration.ListCfg, function (listCfg) {\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Get the list\r\n (0, gd_sprest_bs_1.Web)().Lists(listCfg.ListInformation.Title).query({\r\n Expand: [\"Fields\"]\r\n }).execute(\r\n // Success\r\n function (list) {\r\n // Parse the custom fields\r\n gd_sprest_bs_1.Helper.Executor(listCfg.CustomFields, function (cfg) {\r\n var exists = false;\r\n // Parse the list fields\r\n for (var i = 0; i < list.Fields.results.length; i++) {\r\n // See if the field exists\r\n if (list.Fields.results[i].InternalName == cfg.name) {\r\n // Set the flag\r\n exists = true;\r\n break;\r\n }\r\n }\r\n // See if the field doesn't exist\r\n if (!exists) {\r\n // Field doesn't exist\r\n _this._report.push(\"List '\" + listCfg.ListInformation.Title + \"' is missing a field: \" + cfg.name);\r\n }\r\n }).then(function () {\r\n // Resolve the promise\r\n resolve(null);\r\n });\r\n }, \r\n // Error\r\n function () {\r\n // List doesn't exist\r\n _this._report.push(\"List '\" + listCfg.ListInformation.Title + \"' does not exist\");\r\n // Set the flag\r\n _this._listsExist = false;\r\n // Resolve the promise\r\n resolve(null);\r\n });\r\n });\r\n }).then(function () {\r\n // Resolve the request\r\n resolve();\r\n });\r\n });\r\n };\r\n // Checks the configuration to see if an installation is required\r\n InstallationRequired.requiresInstall = function (props) {\r\n var _this = this;\r\n // Save the configuration\r\n this._cfg = props.cfg;\r\n // Clear the report\r\n this._report = [];\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Ensure this is an array\r\n var cfgs = typeof (_this._cfg.length) === \"number\" ? _this._cfg : [_this._cfg];\r\n // Parse the configurations\r\n gd_sprest_bs_1.Helper.Executor(cfgs, function (cfg) {\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n var numbOfErrors = _this._report.length;\r\n // Check the configuration\r\n Promise.all([\r\n // Check the custom actions\r\n _this.checkCustomActions(cfg),\r\n // Check the lists\r\n _this.checkLists(cfg)\r\n ]).then(function () {\r\n // See if there are errors\r\n if (_this._report.length > numbOfErrors) {\r\n // Execute the event\r\n props.onError ? props.onError(cfg) : null;\r\n }\r\n // Execute the event and see if a promise was returned\r\n var returnVal = props.onCompleted ? props.onCompleted() : null;\r\n if (returnVal && typeof (returnVal[\"then\"]) === \"function\") {\r\n // Wait for the request to complete\r\n returnVal.then(function () {\r\n // Resolve the request\r\n resolve(_this._report.length > 0);\r\n });\r\n }\r\n else {\r\n // Resolve the request\r\n resolve(_this._report.length > 0);\r\n }\r\n });\r\n });\r\n }).then(function () {\r\n // Resolve the request\r\n resolve(_this._report.length > 0);\r\n });\r\n });\r\n };\r\n InstallationRequired.showDialog = function (props) {\r\n var _this = this;\r\n if (props === void 0) { props = {}; }\r\n // Clear the modal\r\n modal_1.Modal.clear();\r\n // Ensure the configuration exists\r\n if (this._cfg == null || this._report == null) {\r\n // Show the error dialog\r\n this.showErrorDialog();\r\n return;\r\n }\r\n // Set the header\r\n modal_1.Modal.setHeader(\"Installation Required\");\r\n // Set the body\r\n modal_1.Modal.setBody(gd_sprest_bs_1.Components.Card({\r\n body: [\r\n {\r\n text: this._report.length > 0 || (props.errors && props.errors.length > 0) ?\r\n \"An installation is required. The following were missing in your environment:\" :\r\n \"No errors were detected.\"\r\n },\r\n {\r\n onRender: function (el) {\r\n var items = props.errors || [];\r\n // Parse the report\r\n for (var i = 0; i < _this._report.length; i++) {\r\n // Add the item\r\n items.push({ content: _this._report[i] });\r\n }\r\n // Render a list\r\n gd_sprest_bs_1.Components.ListGroup({\r\n el: el,\r\n items: items\r\n });\r\n }\r\n }\r\n ]\r\n }).el);\r\n // Render the install button\r\n var btnInstall = null;\r\n gd_sprest_bs_1.Components.Tooltip({\r\n el: modal_1.Modal.FooterElement,\r\n content: \"Installs the SharePoint Assets\",\r\n btnProps: {\r\n assignTo: function (btn) { btnInstall = btn; },\r\n text: \"Install\",\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlineSuccess,\r\n onClick: function () {\r\n // Show a loading dialog\r\n loadingDialog_1.LoadingDialog.setHeader(\"Installing the Solution\");\r\n loadingDialog_1.LoadingDialog.setBody(\"This will close after the assets are installed.\");\r\n loadingDialog_1.LoadingDialog.show();\r\n // Ensure this is an array\r\n var cfgs = typeof (_this._cfg.length) === \"number\" ? _this._cfg : [_this._cfg];\r\n // Parse the configurations\r\n gd_sprest_bs_1.Helper.Executor(cfgs, function (cfg) {\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n cfg.install().then(function () {\r\n // Hide the button\r\n btnInstall.hide();\r\n // Show the refresh button\r\n btnRefresh.show();\r\n // Call the event\r\n props.onInstalled ? props.onInstalled(cfg) : null;\r\n // Check the next configuration\r\n resolve(null);\r\n });\r\n });\r\n }).then(function () {\r\n // Call the event\r\n props.onCompleted ? props.onCompleted() : null;\r\n // Close the dialog\r\n loadingDialog_1.LoadingDialog.hide();\r\n });\r\n }\r\n }\r\n });\r\n // Render the refresh button\r\n var btnRefresh = null;\r\n gd_sprest_bs_1.Components.Tooltip({\r\n el: modal_1.Modal.FooterElement,\r\n content: \"Refresh the Page\",\r\n btnProps: {\r\n assignTo: function (btn) { btnRefresh = btn; },\r\n className: \"d-none\",\r\n text: \"Refresh\",\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlinePrimary,\r\n onClick: function () {\r\n // Refresh the page\r\n window.location.reload();\r\n }\r\n }\r\n });\r\n // Call the events\r\n props.onHeaderRendered ? props.onHeaderRendered(modal_1.Modal.HeaderElement) : null;\r\n props.onBodyRendered ? props.onBodyRendered(modal_1.Modal.BodyElement) : null;\r\n props.onFooterRendered ? props.onFooterRendered(modal_1.Modal.FooterElement) : null;\r\n // Show the modal\r\n modal_1.Modal.show();\r\n };\r\n InstallationRequired.showErrorDialog = function () {\r\n // Set the header\r\n modal_1.Modal.setHeader(\"Not Configured\");\r\n // Set the body\r\n modal_1.Modal.setBody(\"The component has not been configured. The SPConfiguration definition hasn't been initialized.\");\r\n // Show the dialog\r\n modal_1.Modal.show();\r\n };\r\n InstallationRequired._cfg = null;\r\n InstallationRequired._report = null;\r\n // Custom Actions exists\r\n InstallationRequired._customActionsExist = null;\r\n // Lists exists\r\n InstallationRequired._listsExist = null;\r\n return InstallationRequired;\r\n}());\r\nexports.InstallationRequired = InstallationRequired;\r\n\n\n//# sourceURL=webpack://dattatable/./build/common/installRequired.js?");
|
|
86
86
|
|
|
87
87
|
/***/ }),
|
|
88
88
|
|