UNPKG

app365-settingslogs

Version:

A package for EO365 onboarding approval workflows.

108 lines (107 loc) 6.64 kB
"use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var React = _interopRequireWildcard(require("react")); var _react2 = require("@fluentui/react"); var _APIWrappers = require("../PosAPI/APIWrappers"); require("../assets/viewsettingsauditlogsCSS.css"); function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; } var ViewSettingsAuditLogs = function ViewSettingsAuditLogs(_ref) { var _auditLog$User; var isOpen = _ref.isOpen, _onDismiss = _ref.onDismiss, DateFormat = _ref.DateFormat, auditLog = _ref.auditLog, timeFormat = _ref.timeFormat, strings = _ref.strings, isReverseLanguage = _ref.isReverseLanguage; var AllLogsData = (0, _APIWrappers.isStringValidated)(auditLog === null || auditLog === void 0 ? void 0 : auditLog.Details) ? JSON.parse(auditLog === null || auditLog === void 0 ? void 0 : auditLog.Details) : {}; return /*#__PURE__*/React.createElement(_react2.Panel, { isOpen: isOpen, onDismiss: function onDismiss() { return _onDismiss(false); }, headerText: (strings === null || strings === void 0 ? void 0 : strings.AuditLogDetails) || "Audit Log Details", closeButtonAriaLabel: "Close", type: _react2.PanelType.custom, customWidth: "480px", className: isReverseLanguage ? "SettingAuditLogsPanel panelRTL" : "SettingAuditLogsPanel" }, /*#__PURE__*/React.createElement("div", { style: { direction: isReverseLanguage ? "rtl" : "ltr" } }, /*#__PURE__*/React.createElement(_react2.Stack, { tokens: { childrenGap: 15 }, className: "auditPanelContent" }, /*#__PURE__*/React.createElement("div", { className: "sectionHeader" }, (strings === null || strings === void 0 ? void 0 : strings.GeneralInformation) || "General Information"), /*#__PURE__*/React.createElement(_react2.Stack, { tokens: { childrenGap: 8 }, className: "sectionBody" }, /*#__PURE__*/React.createElement(_react2.Text, { style: { display: "flex", gap: "5px" } }, /*#__PURE__*/React.createElement("span", { className: "label" }, (strings === null || strings === void 0 ? void 0 : strings.DateandTime) || "Date and Time", ":"), /*#__PURE__*/React.createElement("span", null, auditLog !== null && auditLog !== void 0 && auditLog.Timestamp ? (0, _APIWrappers.CurrentDataAndTime)(auditLog === null || auditLog === void 0 ? void 0 : auditLog.Timestamp, DateFormat, timeFormat) : "")), /*#__PURE__*/React.createElement(_react2.Text, { style: { display: "flex", gap: "5px" } }, /*#__PURE__*/React.createElement("span", { className: "label" }, (strings === null || strings === void 0 ? void 0 : strings.User) || "User", ":"), /*#__PURE__*/React.createElement("span", null, auditLog === null || auditLog === void 0 || (_auditLog$User = auditLog.User) === null || _auditLog$User === void 0 ? void 0 : _auditLog$User.Title)), /*#__PURE__*/React.createElement(_react2.Text, { style: { display: "flex", gap: "5px" } }, /*#__PURE__*/React.createElement("span", { className: "label" }, (strings === null || strings === void 0 ? void 0 : strings.ActionType) || "Action Type", ":"), /*#__PURE__*/React.createElement("span", null, auditLog === null || auditLog === void 0 ? void 0 : auditLog.ActionType))), /*#__PURE__*/React.createElement("div", { className: "sectionHeader" }, (strings === null || strings === void 0 ? void 0 : strings.ChangedSettings) || "Changed Settings"), /*#__PURE__*/React.createElement(_react2.Stack, { tokens: { childrenGap: 8 }, className: "sectionBody" }, /*#__PURE__*/React.createElement(_react2.Text, { style: { display: "flex", gap: "5px" } }, /*#__PURE__*/React.createElement("span", { className: "label" }, (strings === null || strings === void 0 ? void 0 : strings.SettingName) || "Setting Name", ":"), /*#__PURE__*/React.createElement("span", null, (AllLogsData === null || AllLogsData === void 0 ? void 0 : AllLogsData.settingName) || "N/A")), /*#__PURE__*/React.createElement(_react2.Text, { style: { display: "flex", gap: "5px" } }, /*#__PURE__*/React.createElement("span", { className: "label" }, (strings === null || strings === void 0 ? void 0 : strings.PreviousValue) || "Previous Value", ":"), /*#__PURE__*/React.createElement("span", null, (AllLogsData === null || AllLogsData === void 0 ? void 0 : AllLogsData.previousValue) || "N/A")), /*#__PURE__*/React.createElement(_react2.Text, { style: { display: "flex", gap: "5px" } }, /*#__PURE__*/React.createElement("span", { className: "label" }, (strings === null || strings === void 0 ? void 0 : strings.NewValue) || "New Value", ":"), /*#__PURE__*/React.createElement("span", null, (AllLogsData === null || AllLogsData === void 0 ? void 0 : AllLogsData.newValue) || "N/A")), !(AllLogsData !== null && AllLogsData !== void 0 && AllLogsData.previousValue) && !(AllLogsData !== null && AllLogsData !== void 0 && AllLogsData.newValue) && /*#__PURE__*/React.createElement(_react2.Text, { style: { display: "flex", gap: "5px" } }, /*#__PURE__*/React.createElement("span", { className: "label" }, (strings === null || strings === void 0 ? void 0 : strings.OperationPerformed) || "Operation Performed", ":"), /*#__PURE__*/React.createElement("span", null, (AllLogsData === null || AllLogsData === void 0 ? void 0 : AllLogsData.others) || "N/A")))))); }; var _default = exports["default"] = ViewSettingsAuditLogs;