authscape 1.0.634 → 1.0.636
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/index.js +3711 -357
- package/package.json +1 -1
- package/src/components/dropzone.js +0 -1
- package/src/components/mapping/assignMapping.js +237 -0
- package/src/components/mapping/conditionBasedTool.js +99 -0
- package/src/components/mapping/datasources.js +259 -0
- package/src/components/mapping/fileMapping.js +72 -0
- package/src/components/mapping/manageMappingDocuments.js +525 -0
- package/src/components/mapping/mappedColumn.js +70 -0
- package/src/components/mapping/matchExisting.js +135 -0
- package/src/components/mapping/newMappingColumn.js +132 -0
- package/src/components/mapping/sortableColumn.js +33 -0
- package/src/components/mapping/uploadMappedFile.js +124 -0
- package/src/components/privateLabel/AddDomainModal.js +404 -0
- package/src/components/privateLabel/privateLabelEditor.js +483 -0
package/index.js
CHANGED
|
@@ -1504,7 +1504,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1504
1504
|
value: true
|
|
1505
1505
|
});
|
|
1506
1506
|
exports.Dropzone = void 0;
|
|
1507
|
-
var _AspectRatio = _interopRequireDefault(require("@mui/icons-material/AspectRatio"));
|
|
1508
1507
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
1509
1508
|
var _react = _interopRequireWildcard(require("react"));
|
|
1510
1509
|
var _reactDropzone = require("react-dropzone");
|
|
@@ -2577,9 +2576,19 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2577
2576
|
Object.defineProperty(exports, "__esModule", {
|
|
2578
2577
|
value: true
|
|
2579
2578
|
});
|
|
2580
|
-
exports.
|
|
2579
|
+
exports.AssignMapping = AssignMapping;
|
|
2581
2580
|
var _react = _interopRequireWildcard(require("react"));
|
|
2582
|
-
var
|
|
2581
|
+
var _system = require("@mui/system");
|
|
2582
|
+
var _Container = _interopRequireDefault(require("@mui/material/Container"));
|
|
2583
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
2584
|
+
var _material = require("@mui/material");
|
|
2585
|
+
var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
|
|
2586
|
+
var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions"));
|
|
2587
|
+
var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
|
|
2588
|
+
var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
|
|
2589
|
+
var _Close = _interopRequireDefault(require("@mui/icons-material/Close"));
|
|
2590
|
+
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
2591
|
+
var _ArrowRightAltRounded = _interopRequireDefault(require("@mui/icons-material/ArrowRightAltRounded"));
|
|
2583
2592
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
2584
2593
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
2585
2594
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -2591,430 +2600,3775 @@ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructur
|
|
|
2591
2600
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
2592
2601
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
2593
2602
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
2594
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
_ref$
|
|
2603
|
-
|
|
2604
|
-
_ref$
|
|
2605
|
-
|
|
2606
|
-
|
|
2603
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import { apiService } from 'authscape';
|
|
2604
|
+
// import MappedColumn from './MappedColumn';
|
|
2605
|
+
// import ConditionBasedTool from './conditionBasedTool';
|
|
2606
|
+
// import SpreadsheetViewer from '../spreadsheetViewer';
|
|
2607
|
+
function AssignMapping(_ref) {
|
|
2608
|
+
var currentUser = _ref.currentUser,
|
|
2609
|
+
documentComponentId = _ref.documentComponentId,
|
|
2610
|
+
_ref$setIsLoading = _ref.setIsLoading,
|
|
2611
|
+
setIsLoading = _ref$setIsLoading === void 0 ? null : _ref$setIsLoading,
|
|
2612
|
+
_ref$onCancel = _ref.onCancel,
|
|
2613
|
+
onCancel = _ref$onCancel === void 0 ? null : _ref$onCancel,
|
|
2614
|
+
_ref$onPublished = _ref.onPublished,
|
|
2615
|
+
onPublished = _ref$onPublished === void 0 ? null : _ref$onPublished;
|
|
2616
|
+
var _useState = (0, _react.useState)(documentComponentId),
|
|
2607
2617
|
_useState2 = _slicedToArray(_useState, 2),
|
|
2608
|
-
|
|
2609
|
-
|
|
2618
|
+
documentId = _useState2[0],
|
|
2619
|
+
setDocumentId = _useState2[1];
|
|
2610
2620
|
var _useState3 = (0, _react.useState)(null),
|
|
2611
2621
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
2612
|
-
|
|
2613
|
-
|
|
2622
|
+
fromColumnOptions = _useState4[0],
|
|
2623
|
+
setFromColumnOptions = _useState4[1];
|
|
2624
|
+
var _useState5 = (0, _react.useState)(null),
|
|
2625
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
2626
|
+
toColumnOptions = _useState6[0],
|
|
2627
|
+
setToColumnOptions = _useState6[1];
|
|
2628
|
+
var _useState7 = (0, _react.useState)(null),
|
|
2629
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
2630
|
+
documentType = _useState8[0],
|
|
2631
|
+
setDocumentType = _useState8[1];
|
|
2632
|
+
var _useState9 = (0, _react.useState)(null),
|
|
2633
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
2634
|
+
documentName = _useState10[0],
|
|
2635
|
+
setDocumentName = _useState10[1];
|
|
2636
|
+
var _useState11 = (0, _react.useState)(1),
|
|
2637
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
2638
|
+
urlTick = _useState12[0],
|
|
2639
|
+
setURLTick = _useState12[1];
|
|
2640
|
+
var _useState13 = (0, _react.useState)(null),
|
|
2641
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
2642
|
+
spreadSheetAddress = _useState14[0],
|
|
2643
|
+
setSpreadSheetAddress = _useState14[1];
|
|
2644
|
+
var _useState15 = (0, _react.useState)(false),
|
|
2645
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
2646
|
+
showPreviewDialog = _useState16[0],
|
|
2647
|
+
setShowPreviewDialog = _useState16[1];
|
|
2648
|
+
var _useState17 = (0, _react.useState)(null),
|
|
2649
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
2650
|
+
advanceQuery = _useState18[0],
|
|
2651
|
+
setAdvanceQuery = _useState18[1];
|
|
2652
|
+
var spreadSheetRef = (0, _react.useRef)(null);
|
|
2653
|
+
var fetchMappingTo = /*#__PURE__*/function () {
|
|
2654
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
2655
|
+
var response;
|
|
2656
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2657
|
+
while (1) switch (_context.prev = _context.next) {
|
|
2658
|
+
case 0:
|
|
2659
|
+
_context.next = 2;
|
|
2660
|
+
return apiService().get("/DocumentMapping/GetMappedDynamicFieldsForCompany?companyId=" + currentUser.companyId + "&documentId=" + documentComponentId);
|
|
2661
|
+
case 2:
|
|
2662
|
+
response = _context.sent;
|
|
2663
|
+
if (response != null) {
|
|
2664
|
+
setToColumnOptions(response.data);
|
|
2665
|
+
}
|
|
2666
|
+
case 4:
|
|
2667
|
+
case "end":
|
|
2668
|
+
return _context.stop();
|
|
2669
|
+
}
|
|
2670
|
+
}, _callee);
|
|
2671
|
+
}));
|
|
2672
|
+
return function fetchMappingTo() {
|
|
2673
|
+
return _ref2.apply(this, arguments);
|
|
2674
|
+
};
|
|
2675
|
+
}();
|
|
2676
|
+
var fetchMappingFrom = /*#__PURE__*/function () {
|
|
2677
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
2678
|
+
var response;
|
|
2679
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2680
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
2681
|
+
case 0:
|
|
2682
|
+
_context2.next = 2;
|
|
2683
|
+
return apiService().post("/DocumentMapping/GetMapping", {
|
|
2684
|
+
documentComponentId: documentComponentId,
|
|
2685
|
+
companyId: currentUser.companyId
|
|
2686
|
+
});
|
|
2687
|
+
case 2:
|
|
2688
|
+
response = _context2.sent;
|
|
2689
|
+
if (response != null) {
|
|
2690
|
+
setFromColumnOptions(response.data.documentMappings);
|
|
2691
|
+
setDocumentName(response.data.name);
|
|
2692
|
+
setDocumentType(response.data.documentType);
|
|
2693
|
+
}
|
|
2694
|
+
case 4:
|
|
2695
|
+
case "end":
|
|
2696
|
+
return _context2.stop();
|
|
2697
|
+
}
|
|
2698
|
+
}, _callee2);
|
|
2699
|
+
}));
|
|
2700
|
+
return function fetchMappingFrom() {
|
|
2701
|
+
return _ref3.apply(this, arguments);
|
|
2702
|
+
};
|
|
2703
|
+
}();
|
|
2614
2704
|
(0, _react.useEffect)(function () {
|
|
2615
|
-
if (
|
|
2705
|
+
if (documentComponentId != null) {
|
|
2706
|
+
if (setIsLoading != null) {
|
|
2707
|
+
setIsLoading(true);
|
|
2708
|
+
}
|
|
2709
|
+
setSpreadSheetAddress("/DocumentMappingPreview/PreviewMappedData?companyId=" + currentUser.companyId + "&documentComponentId=" + documentComponentId);
|
|
2616
2710
|
var fetchData = /*#__PURE__*/function () {
|
|
2617
|
-
var
|
|
2618
|
-
return _regeneratorRuntime().wrap(function
|
|
2619
|
-
while (1) switch (
|
|
2711
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
2712
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
2713
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
2620
2714
|
case 0:
|
|
2621
|
-
|
|
2622
|
-
return
|
|
2623
|
-
setImageSrc(data);
|
|
2624
|
-
}, true);
|
|
2715
|
+
_context3.next = 2;
|
|
2716
|
+
return fetchMappingFrom();
|
|
2625
2717
|
case 2:
|
|
2718
|
+
_context3.next = 4;
|
|
2719
|
+
return fetchMappingTo();
|
|
2720
|
+
case 4:
|
|
2721
|
+
if (setIsLoading != null) {
|
|
2722
|
+
setIsLoading(false);
|
|
2723
|
+
}
|
|
2724
|
+
case 5:
|
|
2626
2725
|
case "end":
|
|
2627
|
-
return
|
|
2726
|
+
return _context3.stop();
|
|
2628
2727
|
}
|
|
2629
|
-
},
|
|
2728
|
+
}, _callee3);
|
|
2630
2729
|
}));
|
|
2631
2730
|
return function fetchData() {
|
|
2632
|
-
return
|
|
2731
|
+
return _ref4.apply(this, arguments);
|
|
2633
2732
|
};
|
|
2634
2733
|
}();
|
|
2635
2734
|
fetchData();
|
|
2636
2735
|
}
|
|
2637
|
-
}, [
|
|
2638
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2736
|
+
}, [documentComponentId]);
|
|
2737
|
+
return /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_Container["default"], {
|
|
2738
|
+
maxWidth: "xl",
|
|
2739
|
+
sx: {
|
|
2740
|
+
marginTop: 2
|
|
2741
|
+
}
|
|
2742
|
+
}, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
2743
|
+
container: true,
|
|
2744
|
+
spacing: 2
|
|
2745
|
+
}, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
2746
|
+
item: true,
|
|
2747
|
+
xs: 6
|
|
2748
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
2749
|
+
sx: {
|
|
2750
|
+
position: "sticky",
|
|
2751
|
+
top: 20
|
|
2752
|
+
}
|
|
2753
|
+
}, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
2754
|
+
variant: "h4",
|
|
2755
|
+
gutterBottom: true,
|
|
2756
|
+
sx: {
|
|
2757
|
+
paddingBottom: 2
|
|
2758
|
+
}
|
|
2759
|
+
}, "File Uploaded: ", /*#__PURE__*/_react["default"].createElement("br", null), " ", documentName), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
2760
|
+
variant: "subtitle1",
|
|
2761
|
+
gutterBottom: true,
|
|
2762
|
+
sx: {
|
|
2763
|
+
paddingBottom: 2
|
|
2764
|
+
}
|
|
2765
|
+
}, "You have ", fromColumnOptions != null && fromColumnOptions.length, " columns that can be created or mapped"), /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
2766
|
+
variant: "outlined",
|
|
2767
|
+
sx: {
|
|
2768
|
+
marginRight: 2
|
|
2645
2769
|
},
|
|
2646
|
-
|
|
2647
|
-
return
|
|
2770
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
2771
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
2772
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
2773
|
+
case 0:
|
|
2774
|
+
if (onCancel != null) {
|
|
2775
|
+
onCancel();
|
|
2776
|
+
}
|
|
2777
|
+
case 1:
|
|
2778
|
+
case "end":
|
|
2779
|
+
return _context4.stop();
|
|
2780
|
+
}
|
|
2781
|
+
}, _callee4);
|
|
2782
|
+
}))
|
|
2783
|
+
}, "Cancel"), /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
2784
|
+
variant: "contained",
|
|
2785
|
+
endIcon: /*#__PURE__*/_react["default"].createElement(_ArrowRightAltRounded["default"], null),
|
|
2786
|
+
sx: {
|
|
2787
|
+
marginRight: 2
|
|
2788
|
+
},
|
|
2789
|
+
onClick: function onClick() {
|
|
2790
|
+
setShowPreviewDialog(true);
|
|
2648
2791
|
}
|
|
2649
|
-
}
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2792
|
+
}, "Next, Preview your mapping"))), /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
2793
|
+
item: true,
|
|
2794
|
+
xs: 5
|
|
2795
|
+
}, fromColumnOptions != null && fromColumnOptions.map(function (column) {
|
|
2796
|
+
return /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(MappedColumn, {
|
|
2797
|
+
companyId: currentUser.companyId,
|
|
2798
|
+
documentId: documentId,
|
|
2799
|
+
documentType: documentType,
|
|
2800
|
+
documentMappingId: column.id,
|
|
2801
|
+
name: column.name,
|
|
2802
|
+
toName: column.toName,
|
|
2803
|
+
isMapped: column.toName == null || column.toName == "" ? true : false,
|
|
2804
|
+
toOptions: toColumnOptions,
|
|
2805
|
+
onResponse: function onResponse() {
|
|
2806
|
+
fetchMappingFrom();
|
|
2807
|
+
fetchMappingTo();
|
|
2808
|
+
}
|
|
2809
|
+
}));
|
|
2810
|
+
})))), /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
2811
|
+
open: showPreviewDialog,
|
|
2812
|
+
onClose: function onClose() {
|
|
2813
|
+
setShowPreviewDialog(false);
|
|
2656
2814
|
},
|
|
2657
|
-
|
|
2658
|
-
|
|
2815
|
+
fullWidth: true,
|
|
2816
|
+
maxWidth: "xl",
|
|
2817
|
+
"aria-labelledby": "alert-dialog-title",
|
|
2818
|
+
"aria-describedby": "alert-dialog-description"
|
|
2819
|
+
}, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
|
|
2820
|
+
id: "alert-dialog-title",
|
|
2821
|
+
sx: {
|
|
2822
|
+
fontSize: "25px",
|
|
2823
|
+
paddingTop: 4
|
|
2659
2824
|
}
|
|
2660
|
-
})
|
|
2661
|
-
|
|
2662
|
-
|
|
2825
|
+
}, "Preview your mapping"), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
2826
|
+
sx: {
|
|
2827
|
+
paddingLeft: 3
|
|
2828
|
+
}
|
|
2829
|
+
}, "Ensure that the data uploaded is accurately mapped and all (Required) fields are completed."), /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
|
|
2830
|
+
"aria-label": "close",
|
|
2831
|
+
onClick: function onClick() {
|
|
2832
|
+
setShowPreviewDialog(false);
|
|
2833
|
+
},
|
|
2834
|
+
sx: {
|
|
2835
|
+
position: 'absolute',
|
|
2836
|
+
right: 8,
|
|
2837
|
+
top: 8,
|
|
2838
|
+
color: function color(theme) {
|
|
2839
|
+
return theme.palette.grey[500];
|
|
2840
|
+
}
|
|
2841
|
+
}
|
|
2842
|
+
}, /*#__PURE__*/_react["default"].createElement(_Close["default"], null)), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
2843
|
+
sx: {
|
|
2844
|
+
paddingBottom: 1
|
|
2845
|
+
}
|
|
2846
|
+
}, /*#__PURE__*/_react["default"].createElement(ConditionBasedTool, {
|
|
2847
|
+
toColumnOptions: toColumnOptions,
|
|
2848
|
+
documentId: documentId,
|
|
2849
|
+
onConditionApplied: function onConditionApplied(currentQuery) {
|
|
2850
|
+
var incrementNum = urlTick + 1;
|
|
2851
|
+
setURLTick(incrementNum);
|
|
2852
|
+
setAdvanceQuery(currentQuery);
|
|
2853
|
+
|
|
2854
|
+
// setSpreadSheetAddress("/DocumentMappingPreview/PreviewMappedData?companyId=" + currentUser.companyId + "&documentComponentId=" + documentComponentId + "&tick=" + incrementNum);
|
|
2855
|
+
}
|
|
2856
|
+
})), spreadSheetAddress != null && /*#__PURE__*/_react["default"].createElement(SpreadsheetViewer, {
|
|
2857
|
+
ref: spreadSheetRef,
|
|
2858
|
+
url: spreadSheetAddress,
|
|
2859
|
+
advanceQuery: advanceQuery,
|
|
2860
|
+
currentUser: currentUser,
|
|
2861
|
+
hideToolbar: true,
|
|
2862
|
+
loadedUser: true
|
|
2863
|
+
})), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
2864
|
+
onClick: function onClick() {
|
|
2865
|
+
setShowPreviewDialog(false);
|
|
2866
|
+
}
|
|
2867
|
+
}, "Cancel"), /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
2868
|
+
variant: "contained",
|
|
2869
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
2870
|
+
var publishedRows, response;
|
|
2871
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
2872
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
2873
|
+
case 0:
|
|
2874
|
+
if (setIsLoading != null) {
|
|
2875
|
+
setIsLoading(true);
|
|
2876
|
+
}
|
|
2877
|
+
publishedRows = spreadSheetRef.current.getRows();
|
|
2878
|
+
_context5.next = 4;
|
|
2879
|
+
return apiService().post("/DocumentMapping/Publish", {
|
|
2880
|
+
companyId: currentUser.companyId,
|
|
2881
|
+
documentId: documentId,
|
|
2882
|
+
publishedRows: publishedRows
|
|
2883
|
+
});
|
|
2884
|
+
case 4:
|
|
2885
|
+
response = _context5.sent;
|
|
2886
|
+
if (response != null && response.status == 200) {
|
|
2887
|
+
setShowPreviewDialog(false);
|
|
2888
|
+
if (onPublished != null) {
|
|
2889
|
+
onPublished();
|
|
2890
|
+
}
|
|
2891
|
+
} else {
|
|
2892
|
+
alert(JSON.stringify(response.data));
|
|
2893
|
+
}
|
|
2894
|
+
if (setIsLoading != null) {
|
|
2895
|
+
setIsLoading(false);
|
|
2896
|
+
}
|
|
2897
|
+
case 7:
|
|
2898
|
+
case "end":
|
|
2899
|
+
return _context5.stop();
|
|
2900
|
+
}
|
|
2901
|
+
}, _callee5);
|
|
2902
|
+
}))
|
|
2903
|
+
}, "Publish"))));
|
|
2904
|
+
}
|
|
2663
2905
|
"use strict";
|
|
2664
2906
|
|
|
2665
2907
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2666
2908
|
Object.defineProperty(exports, "__esModule", {
|
|
2667
2909
|
value: true
|
|
2668
2910
|
});
|
|
2669
|
-
exports.
|
|
2911
|
+
exports.ConditionBasedTool = ConditionBasedTool;
|
|
2670
2912
|
var _react = _interopRequireWildcard(require("react"));
|
|
2671
|
-
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
2672
|
-
var _html2canvas = _interopRequireDefault(require("html2canvas"));
|
|
2673
|
-
var _jspdf = require("jspdf");
|
|
2674
2913
|
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
2675
|
-
var
|
|
2914
|
+
var _system = require("@mui/system");
|
|
2915
|
+
var _Accordion = _interopRequireDefault(require("@mui/material/Accordion"));
|
|
2916
|
+
var _AccordionSummary = _interopRequireDefault(require("@mui/material/AccordionSummary"));
|
|
2917
|
+
var _AccordionDetails = _interopRequireDefault(require("@mui/material/AccordionDetails"));
|
|
2918
|
+
var _ExpandMore = _interopRequireDefault(require("@mui/icons-material/ExpandMore"));
|
|
2919
|
+
var _reactQuerybuilder = require("react-querybuilder");
|
|
2676
2920
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
2677
2921
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
2678
2922
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
2679
|
-
var PageToPDF = function PageToPDF(_ref) {
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
var
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
onShowElements();
|
|
2733
|
-
};
|
|
2734
|
-
return /*#__PURE__*/_react["default"].createElement(_Box["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
2735
|
-
startIcon: startIcon,
|
|
2736
|
-
variant: variant,
|
|
2737
|
-
onClick: function onClick() {
|
|
2738
|
-
printElement();
|
|
2923
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
2924
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
2925
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
2926
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2927
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
2928
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
2929
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
2930
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
2931
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import { apiService, FileUploader} from 'authscape';
|
|
2932
|
+
function ConditionBasedTool(_ref) {
|
|
2933
|
+
var toColumnOptions = _ref.toColumnOptions,
|
|
2934
|
+
documentId = _ref.documentId,
|
|
2935
|
+
onConditionApplied = _ref.onConditionApplied;
|
|
2936
|
+
var _useState = (0, _react.useState)(null),
|
|
2937
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
2938
|
+
currentQuery = _useState2[0],
|
|
2939
|
+
setCurrentQuery = _useState2[1];
|
|
2940
|
+
|
|
2941
|
+
// const fields = [
|
|
2942
|
+
// { name: 'firstName', label: 'First Name' },
|
|
2943
|
+
// { name: 'lastName', label: 'Last Name' }
|
|
2944
|
+
// ];
|
|
2945
|
+
|
|
2946
|
+
(0, _react.useEffect)(function () {
|
|
2947
|
+
if (documentId != null) {
|
|
2948
|
+
var fetchData = /*#__PURE__*/function () {
|
|
2949
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
2950
|
+
var response;
|
|
2951
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2952
|
+
while (1) switch (_context.prev = _context.next) {
|
|
2953
|
+
case 0:
|
|
2954
|
+
_context.next = 2;
|
|
2955
|
+
return apiService().get("/DocumentMapping/GetRules?documentComponentId=" + documentId);
|
|
2956
|
+
case 2:
|
|
2957
|
+
response = _context.sent;
|
|
2958
|
+
if (response != null && response.status == 200) {
|
|
2959
|
+
if (response.data != null && response.data != "") {
|
|
2960
|
+
setCurrentQuery(response.data);
|
|
2961
|
+
} else {
|
|
2962
|
+
setCurrentQuery(null);
|
|
2963
|
+
}
|
|
2964
|
+
}
|
|
2965
|
+
case 4:
|
|
2966
|
+
case "end":
|
|
2967
|
+
return _context.stop();
|
|
2968
|
+
}
|
|
2969
|
+
}, _callee);
|
|
2970
|
+
}));
|
|
2971
|
+
return function fetchData() {
|
|
2972
|
+
return _ref2.apply(this, arguments);
|
|
2973
|
+
};
|
|
2974
|
+
}();
|
|
2975
|
+
fetchData();
|
|
2739
2976
|
}
|
|
2740
|
-
},
|
|
2741
|
-
|
|
2742
|
-
|
|
2977
|
+
}, [documentId]);
|
|
2978
|
+
var getFields = function getFields() {
|
|
2979
|
+
var fields = [];
|
|
2980
|
+
for (var index = 0; index < toColumnOptions.length; index++) {
|
|
2981
|
+
var toColumn = toColumnOptions[index];
|
|
2982
|
+
if (toColumn.isMapped)
|
|
2983
|
+
// only show filters that are mapped
|
|
2984
|
+
{
|
|
2985
|
+
fields.push({
|
|
2986
|
+
name: toColumn.name,
|
|
2987
|
+
label: toColumn.visibleName
|
|
2988
|
+
});
|
|
2989
|
+
}
|
|
2990
|
+
}
|
|
2991
|
+
return fields;
|
|
2992
|
+
};
|
|
2993
|
+
var customOperators = [{
|
|
2994
|
+
name: 'contains',
|
|
2995
|
+
label: 'Contains'
|
|
2996
|
+
}, {
|
|
2997
|
+
name: 'notContains',
|
|
2998
|
+
label: 'Does not contain'
|
|
2999
|
+
}];
|
|
3000
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_Accordion["default"], null, /*#__PURE__*/_react["default"].createElement(_AccordionSummary["default"], {
|
|
3001
|
+
expandIcon: /*#__PURE__*/_react["default"].createElement(_ExpandMore["default"], null),
|
|
3002
|
+
"aria-controls": "panel1-content",
|
|
3003
|
+
id: "panel1-header"
|
|
3004
|
+
}, "Advance filtering"), /*#__PURE__*/_react["default"].createElement(_AccordionDetails["default"], null, /*#__PURE__*/_react["default"].createElement(_reactQuerybuilder.QueryBuilder, {
|
|
3005
|
+
fields: getFields(),
|
|
3006
|
+
operators: customOperators,
|
|
3007
|
+
query: currentQuery,
|
|
3008
|
+
onQueryChange: setCurrentQuery
|
|
3009
|
+
}), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
3010
|
+
variant: "contained",
|
|
3011
|
+
sx: {
|
|
3012
|
+
marginTop: 1
|
|
3013
|
+
},
|
|
3014
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
3015
|
+
var response;
|
|
3016
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
3017
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
3018
|
+
case 0:
|
|
3019
|
+
_context2.next = 2;
|
|
3020
|
+
return apiService().put("/DocumentMapping/ApplyFilterForViewer", {
|
|
3021
|
+
documentComponentId: documentId,
|
|
3022
|
+
rules: JSON.stringify(currentQuery)
|
|
3023
|
+
});
|
|
3024
|
+
case 2:
|
|
3025
|
+
response = _context2.sent;
|
|
3026
|
+
if (response != null && response.status == 200) {
|
|
3027
|
+
onConditionApplied(currentQuery);
|
|
3028
|
+
}
|
|
3029
|
+
case 4:
|
|
3030
|
+
case "end":
|
|
3031
|
+
return _context2.stop();
|
|
3032
|
+
}
|
|
3033
|
+
}, _callee2);
|
|
3034
|
+
}))
|
|
3035
|
+
}, "Apply Filter")))));
|
|
3036
|
+
}
|
|
2743
3037
|
"use strict";
|
|
2744
3038
|
|
|
2745
3039
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2746
3040
|
Object.defineProperty(exports, "__esModule", {
|
|
2747
3041
|
value: true
|
|
2748
3042
|
});
|
|
2749
|
-
exports.
|
|
2750
|
-
var _react =
|
|
2751
|
-
var _system = require("@mui/system");
|
|
2752
|
-
var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
|
|
3043
|
+
exports.Datasources = Datasources;
|
|
3044
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
2753
3045
|
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
2754
|
-
var
|
|
2755
|
-
var
|
|
3046
|
+
var _system = require("@mui/system");
|
|
3047
|
+
var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
|
|
3048
|
+
var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions"));
|
|
3049
|
+
var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
|
|
3050
|
+
var _DialogContentText = _interopRequireDefault(require("@mui/material/DialogContentText"));
|
|
3051
|
+
var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
|
|
3052
|
+
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
2756
3053
|
var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
|
|
2757
3054
|
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
2758
3055
|
var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
|
|
2759
3056
|
var _Select = _interopRequireDefault(require("@mui/material/Select"));
|
|
2760
|
-
var
|
|
3057
|
+
var _Radio = _interopRequireDefault(require("@mui/material/Radio"));
|
|
3058
|
+
var _RadioGroup = _interopRequireDefault(require("@mui/material/RadioGroup"));
|
|
3059
|
+
var _FormControlLabel = _interopRequireDefault(require("@mui/material/FormControlLabel"));
|
|
3060
|
+
var _FormLabel = _interopRequireDefault(require("@mui/material/FormLabel"));
|
|
2761
3061
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
3062
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
3063
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
2762
3064
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
2763
3065
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
2764
3066
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
2765
|
-
function
|
|
2766
|
-
function
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
_ref$
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
3067
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3068
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3069
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
3070
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
3071
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
3072
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import {apiService, authService, StripeConnect, ReactDraft, EditableDatagrid, FileUploader} from 'authscape';
|
|
3073
|
+
function Datasources(_ref) {
|
|
3074
|
+
var _ref$disableTraining = _ref.disableTraining,
|
|
3075
|
+
disableTraining = _ref$disableTraining === void 0 ? false : _ref$disableTraining;
|
|
3076
|
+
var documentColumns = [{
|
|
3077
|
+
field: 'name',
|
|
3078
|
+
headerName: 'Name',
|
|
3079
|
+
width: 150,
|
|
3080
|
+
editable: false
|
|
3081
|
+
}, {
|
|
3082
|
+
field: "type",
|
|
3083
|
+
type: "actions",
|
|
3084
|
+
width: 200,
|
|
3085
|
+
flex: 1,
|
|
3086
|
+
headerName: "Data Source",
|
|
3087
|
+
getActions: function getActions(_ref2) {
|
|
3088
|
+
var id = _ref2.id,
|
|
3089
|
+
row = _ref2.row;
|
|
3090
|
+
return [/*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
3091
|
+
sx: {
|
|
3092
|
+
textAlign: "left"
|
|
3093
|
+
}
|
|
3094
|
+
}, row.type == 0 ? "Database" : "", row.type == 1 ? "Dynamic Mapping" : "", row.type == 2 ? "Custom Model" : "")];
|
|
2789
3095
|
}
|
|
2790
|
-
|
|
2791
|
-
|
|
3096
|
+
}, {
|
|
3097
|
+
field: "Detail",
|
|
3098
|
+
type: "actions",
|
|
3099
|
+
width: 200,
|
|
3100
|
+
flex: 1,
|
|
3101
|
+
headerName: "Mapping To",
|
|
3102
|
+
getActions: function getActions(_ref3) {
|
|
3103
|
+
var id = _ref3.id,
|
|
3104
|
+
row = _ref3.row;
|
|
3105
|
+
return [/*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
3106
|
+
sx: {
|
|
3107
|
+
textAlign: "left"
|
|
3108
|
+
}
|
|
3109
|
+
}, row.type == 0 ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, "Table: ", row.tableName) : "", row.type == 1 ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, "Database driven mapping") : "", row.type == 2 ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, "Type Name: ", row.typeName, /*#__PURE__*/_react["default"].createElement("br", null), " Assembly Fullname: ", row.assemblyFullName) : "")];
|
|
3110
|
+
}
|
|
3111
|
+
}
|
|
3112
|
+
// {
|
|
3113
|
+
// field: "actions",
|
|
3114
|
+
// type: "actions",
|
|
3115
|
+
// width: 200,
|
|
3116
|
+
// headerName: "Archive",
|
|
3117
|
+
// cellClassName: "actions",
|
|
3118
|
+
// getActions: ({ id, row }) => {
|
|
3119
|
+
// return [
|
|
3120
|
+
// <GridActionsCellItem key={id}
|
|
3121
|
+
// icon={<DeleteRoundedIcon />}
|
|
3122
|
+
// label="Archive"
|
|
3123
|
+
// className="textPrimary"
|
|
3124
|
+
// onClick={async () => {
|
|
3125
|
+
|
|
3126
|
+
// let documentMappingId = "";
|
|
3127
|
+
// let documentComponentId = "";
|
|
3128
|
+
|
|
3129
|
+
// // archive the column
|
|
3130
|
+
// await apiService().delete("/DocumentMapping/RemoveColumnFromDocumentComponent?documentMappingId=" + documentMappingId + "&documentComponentId=" + documentComponentId)
|
|
3131
|
+
|
|
3132
|
+
// }}
|
|
3133
|
+
// />,
|
|
3134
|
+
// ];
|
|
3135
|
+
// },
|
|
3136
|
+
// }
|
|
3137
|
+
];
|
|
3138
|
+
|
|
3139
|
+
var refDatabaseTableSelect = (0, _react.useRef)(null);
|
|
3140
|
+
var refNewDocTypeName = (0, _react.useRef)(null);
|
|
3141
|
+
var _useState = (0, _react.useState)(0),
|
|
3142
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
3143
|
+
dataGridRefreshKey = _useState2[0],
|
|
3144
|
+
setDataGridRefreshKey = _useState2[1];
|
|
3145
|
+
var _useState3 = (0, _react.useState)(null),
|
|
3146
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
3147
|
+
document = _useState4[0],
|
|
3148
|
+
setDocument = _useState4[1];
|
|
3149
|
+
var _useState5 = (0, _react.useState)(false),
|
|
3150
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
3151
|
+
showDatasource = _useState6[0],
|
|
3152
|
+
setShowDatasource = _useState6[1];
|
|
3153
|
+
var _useState7 = (0, _react.useState)(null),
|
|
3154
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
3155
|
+
databaseTables = _useState8[0],
|
|
3156
|
+
setDatabaseTables = _useState8[1];
|
|
3157
|
+
var _useState9 = (0, _react.useState)("database"),
|
|
3158
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
3159
|
+
mappingType = _useState10[0],
|
|
3160
|
+
setMappingType = _useState10[1];
|
|
3161
|
+
var refTypeName = (0, _react.useRef)(null);
|
|
3162
|
+
var refAssemblyFullName = (0, _react.useRef)(null);
|
|
3163
|
+
(0, _react.useEffect)(function () {
|
|
3164
|
+
var fetchData = /*#__PURE__*/function () {
|
|
3165
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
3166
|
+
var response;
|
|
3167
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3168
|
+
while (1) switch (_context.prev = _context.next) {
|
|
3169
|
+
case 0:
|
|
3170
|
+
_context.next = 2;
|
|
3171
|
+
return apiService().get("/DocumentMapping/GetTablesFromDatabase");
|
|
3172
|
+
case 2:
|
|
3173
|
+
response = _context.sent;
|
|
3174
|
+
if (response != null && response.status == 200) {
|
|
3175
|
+
setDatabaseTables(response.data);
|
|
3176
|
+
}
|
|
3177
|
+
case 4:
|
|
3178
|
+
case "end":
|
|
3179
|
+
return _context.stop();
|
|
3180
|
+
}
|
|
3181
|
+
}, _callee);
|
|
3182
|
+
}));
|
|
3183
|
+
return function fetchData() {
|
|
3184
|
+
return _ref4.apply(this, arguments);
|
|
3185
|
+
};
|
|
3186
|
+
}();
|
|
3187
|
+
fetchData();
|
|
3188
|
+
}, []);
|
|
2792
3189
|
return /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
2793
3190
|
sx: {
|
|
2794
|
-
|
|
3191
|
+
marginTop: 6
|
|
2795
3192
|
}
|
|
2796
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
key:
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
}
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
}
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
3193
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, null, !disableTraining && /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
3194
|
+
sx: {
|
|
3195
|
+
textAlign: "right",
|
|
3196
|
+
marginBottom: 2
|
|
3197
|
+
}
|
|
3198
|
+
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
3199
|
+
variant: "contained",
|
|
3200
|
+
onClick: function onClick() {
|
|
3201
|
+
setShowDatasource(true);
|
|
3202
|
+
}
|
|
3203
|
+
}, "Add Data Source")), /*#__PURE__*/_react["default"].createElement(EditableDatagrid, {
|
|
3204
|
+
key: dataGridRefreshKey,
|
|
3205
|
+
loadedUser: true,
|
|
3206
|
+
url: "/DocumentMapping/GetDocumentTypes",
|
|
3207
|
+
columns: documentColumns
|
|
3208
|
+
})), /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
3209
|
+
open: showDatasource,
|
|
3210
|
+
onClose: function onClose() {
|
|
3211
|
+
setShowDatasource(false);
|
|
3212
|
+
},
|
|
3213
|
+
"aria-labelledby": "alert-dialog-title",
|
|
3214
|
+
"aria-describedby": "alert-dialog-description"
|
|
3215
|
+
}, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
|
|
3216
|
+
id: "alert-dialog-title"
|
|
3217
|
+
}, "Data Source"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], {
|
|
3218
|
+
id: "alert-dialog-description"
|
|
3219
|
+
}, "A data source is a place or system where data is stored and collected. It can be a database, file, web service, or sensor. Data is extracted, transformed, and used for analysis and other purposes. Managing data sources is crucial for data-driven decision-making."), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
3220
|
+
sx: {
|
|
3221
|
+
marginTop: 3
|
|
3222
|
+
}
|
|
3223
|
+
}, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
3224
|
+
inputRef: refNewDocTypeName,
|
|
3225
|
+
label: "Name for data source",
|
|
3226
|
+
variant: "outlined",
|
|
3227
|
+
fullWidth: true
|
|
3228
|
+
})), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
3229
|
+
sx: {
|
|
3230
|
+
marginTop: 2
|
|
3231
|
+
}
|
|
3232
|
+
}, /*#__PURE__*/_react["default"].createElement(_FormControl["default"], null, /*#__PURE__*/_react["default"].createElement(_FormLabel["default"], {
|
|
3233
|
+
id: "demo-row-radio-buttons-group-label"
|
|
3234
|
+
}, "How the data will connect:"), /*#__PURE__*/_react["default"].createElement(_RadioGroup["default"], {
|
|
3235
|
+
value: mappingType,
|
|
3236
|
+
row: true,
|
|
3237
|
+
"aria-labelledby": "demo-row-radio-buttons-group-label",
|
|
3238
|
+
name: "row-radio-buttons-group",
|
|
3239
|
+
onChange: function onChange(env) {
|
|
3240
|
+
setMappingType(env.currentTarget.value);
|
|
3241
|
+
}
|
|
3242
|
+
}, /*#__PURE__*/_react["default"].createElement(_FormControlLabel["default"], {
|
|
3243
|
+
value: "database",
|
|
3244
|
+
control: /*#__PURE__*/_react["default"].createElement(_Radio["default"], null),
|
|
3245
|
+
label: "Database"
|
|
3246
|
+
}), /*#__PURE__*/_react["default"].createElement(_FormControlLabel["default"], {
|
|
3247
|
+
value: "mappingTable",
|
|
3248
|
+
control: /*#__PURE__*/_react["default"].createElement(_Radio["default"], null),
|
|
3249
|
+
label: "Dynamic Mapping Table"
|
|
3250
|
+
}), /*#__PURE__*/_react["default"].createElement(_FormControlLabel["default"], {
|
|
3251
|
+
value: "customModelMapping",
|
|
3252
|
+
control: /*#__PURE__*/_react["default"].createElement(_Radio["default"], null),
|
|
3253
|
+
label: "Custom Model"
|
|
3254
|
+
})))), mappingType == "database" && /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
3255
|
+
sx: {
|
|
3256
|
+
marginTop: 2
|
|
3257
|
+
}
|
|
3258
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
3259
|
+
sx: {
|
|
3260
|
+
minWidth: 120
|
|
3261
|
+
}
|
|
3262
|
+
}, /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
|
|
3263
|
+
fullWidth: true
|
|
3264
|
+
}, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
|
|
3265
|
+
id: "demo-simple-select-label"
|
|
3266
|
+
}, "Database Tables"), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
3267
|
+
inputRef: refDatabaseTableSelect,
|
|
3268
|
+
labelId: "demo-simple-select-label",
|
|
3269
|
+
label: "Age"
|
|
3270
|
+
}, databaseTables != null && databaseTables.map(function (table, index) {
|
|
3271
|
+
return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
3272
|
+
value: table.tableName
|
|
3273
|
+
}, table.tableName);
|
|
3274
|
+
}))))), mappingType == "customModelMapping" && /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
3275
|
+
sx: {
|
|
3276
|
+
marginTop: 2
|
|
3277
|
+
}
|
|
3278
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
3279
|
+
sx: {
|
|
3280
|
+
minWidth: 120
|
|
3281
|
+
}
|
|
3282
|
+
}, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
3283
|
+
inputRef: refTypeName,
|
|
3284
|
+
label: "Type Name (Example: API.Controllers.InvoiceUpload)",
|
|
3285
|
+
variant: "outlined",
|
|
3286
|
+
fullWidth: true,
|
|
3287
|
+
sx: {
|
|
3288
|
+
marginTop: 1
|
|
3289
|
+
}
|
|
3290
|
+
}), /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
3291
|
+
inputRef: refAssemblyFullName,
|
|
3292
|
+
label: "Assembly Full Name (Example: API)",
|
|
3293
|
+
variant: "outlined",
|
|
3294
|
+
fullWidth: true,
|
|
3295
|
+
sx: {
|
|
3296
|
+
marginTop: 1
|
|
3297
|
+
}
|
|
3298
|
+
})))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
3299
|
+
onClick: function onClick() {
|
|
3300
|
+
setShowDatasource(false);
|
|
3301
|
+
}
|
|
3302
|
+
}, "Cancel"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
3303
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
3304
|
+
var response, _response;
|
|
3305
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
3306
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
3307
|
+
case 0:
|
|
3308
|
+
if (!(mappingType == "customModelMapping")) {
|
|
3309
|
+
_context2.next = 7;
|
|
3310
|
+
break;
|
|
3311
|
+
}
|
|
3312
|
+
_context2.next = 3;
|
|
3313
|
+
return apiService().post("/DocumentMapping/AddDataSource", {
|
|
3314
|
+
name: refNewDocTypeName.current.value,
|
|
3315
|
+
dataTable: refNewDocTypeName.current.value,
|
|
3316
|
+
documentType: 2,
|
|
3317
|
+
typeName: refTypeName.current.value,
|
|
3318
|
+
assemblyFullName: refAssemblyFullName.current.value
|
|
3319
|
+
});
|
|
3320
|
+
case 3:
|
|
3321
|
+
response = _context2.sent;
|
|
3322
|
+
if (response != null && response.data.error != null) {
|
|
3323
|
+
alert(response.data.error);
|
|
3324
|
+
} else {
|
|
3325
|
+
if (response != null && (response.status == 204 || response.status == 200)) {
|
|
3326
|
+
setDataGridRefreshKey(dataGridRefreshKey + 1);
|
|
3327
|
+
setShowDatasource(false);
|
|
3328
|
+
}
|
|
3329
|
+
}
|
|
3330
|
+
_context2.next = 11;
|
|
3331
|
+
break;
|
|
3332
|
+
case 7:
|
|
3333
|
+
_context2.next = 9;
|
|
3334
|
+
return apiService().post("/DocumentMapping/AddDataSource", {
|
|
3335
|
+
name: refNewDocTypeName.current.value,
|
|
3336
|
+
dataTable: refDatabaseTableSelect.current != null ? refDatabaseTableSelect.current.value : "",
|
|
3337
|
+
documentType: mappingType == "database" ? 0 : 1
|
|
3338
|
+
});
|
|
3339
|
+
case 9:
|
|
3340
|
+
_response = _context2.sent;
|
|
3341
|
+
if (_response != null && (_response.status == 204 || _response.status == 200)) {
|
|
3342
|
+
setDataGridRefreshKey(dataGridRefreshKey + 1);
|
|
3343
|
+
setShowDatasource(false);
|
|
3344
|
+
}
|
|
3345
|
+
case 11:
|
|
3346
|
+
case "end":
|
|
3347
|
+
return _context2.stop();
|
|
3348
|
+
}
|
|
3349
|
+
}, _callee2);
|
|
3350
|
+
}))
|
|
3351
|
+
}, "Add Data Source"))));
|
|
3352
|
+
}
|
|
3353
|
+
"use strict";
|
|
3354
|
+
|
|
3355
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3356
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3357
|
+
value: true
|
|
3358
|
+
});
|
|
3359
|
+
exports.FileMapping = FileMapping;
|
|
3360
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
3361
|
+
var _system = require("@mui/system");
|
|
3362
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
3363
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
3364
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3365
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3366
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
3367
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
3368
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
3369
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
3370
|
+
// import ManageMappingDocuments from './manageMappingDocuments';
|
|
3371
|
+
// import AssignMapping from './AssignMapping';
|
|
3372
|
+
|
|
3373
|
+
function FileMapping(_ref) {
|
|
3374
|
+
var currentUser = _ref.currentUser,
|
|
3375
|
+
_ref$fileUploadName = _ref.fileUploadName,
|
|
3376
|
+
fileUploadName = _ref$fileUploadName === void 0 ? "Upload Document" : _ref$fileUploadName,
|
|
3377
|
+
_ref$hideDocumentMana = _ref.hideDocumentManager,
|
|
3378
|
+
hideDocumentManager = _ref$hideDocumentMana === void 0 ? false : _ref$hideDocumentMana,
|
|
3379
|
+
_ref$setIsLoading = _ref.setIsLoading,
|
|
3380
|
+
setIsLoading = _ref$setIsLoading === void 0 ? null : _ref$setIsLoading,
|
|
3381
|
+
_ref$documentTypeId = _ref.documentTypeId,
|
|
3382
|
+
documentTypeId = _ref$documentTypeId === void 0 ? null : _ref$documentTypeId,
|
|
3383
|
+
_ref$onOpened = _ref.onOpened,
|
|
3384
|
+
onOpened = _ref$onOpened === void 0 ? null : _ref$onOpened,
|
|
3385
|
+
_ref$onPublished = _ref.onPublished,
|
|
3386
|
+
_onPublished = _ref$onPublished === void 0 ? null : _ref$onPublished,
|
|
3387
|
+
_ref$onCanceled = _ref.onCanceled,
|
|
3388
|
+
onCanceled = _ref$onCanceled === void 0 ? null : _ref$onCanceled,
|
|
3389
|
+
_ref$onArchived = _ref.onArchived,
|
|
3390
|
+
onArchived = _ref$onArchived === void 0 ? null : _ref$onArchived;
|
|
3391
|
+
var _useState = (0, _react.useState)(null),
|
|
3392
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
3393
|
+
documentComponentId = _useState2[0],
|
|
3394
|
+
setDocumentComponentId = _useState2[1];
|
|
3395
|
+
(0, _react.useEffect)(function () {
|
|
3396
|
+
if (documentComponentId != null) {
|
|
3397
|
+
if (onOpened != null) {
|
|
3398
|
+
onOpened(documentComponentId);
|
|
2892
3399
|
}
|
|
2893
|
-
}
|
|
2894
|
-
|
|
2895
|
-
|
|
3400
|
+
}
|
|
3401
|
+
}, [documentComponentId]);
|
|
3402
|
+
return /*#__PURE__*/_react["default"].createElement(_system.Box, null, documentComponentId == null && /*#__PURE__*/_react["default"].createElement(ManageMappingDocuments, {
|
|
3403
|
+
fileUploadName: fileUploadName,
|
|
3404
|
+
documentTypeId: documentTypeId,
|
|
3405
|
+
hideDocumentManager: hideDocumentManager,
|
|
3406
|
+
companyId: currentUser != null ? currentUser.companyId : null,
|
|
3407
|
+
onManageField: function onManageField(documentComponentId) {
|
|
3408
|
+
setDocumentComponentId(documentComponentId);
|
|
3409
|
+
},
|
|
3410
|
+
onArchive: function onArchive(documentComponentId) {
|
|
3411
|
+
//alert(documentComponentId);
|
|
3412
|
+
if (onArchived != null) {
|
|
3413
|
+
onArchived(documentComponentId);
|
|
2896
3414
|
}
|
|
2897
|
-
}
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
3415
|
+
}
|
|
3416
|
+
}), documentComponentId != null && /*#__PURE__*/_react["default"].createElement(AssignMapping, {
|
|
3417
|
+
currentUser: currentUser,
|
|
3418
|
+
setIsLoading: setIsLoading,
|
|
3419
|
+
documentComponentId: documentComponentId,
|
|
3420
|
+
onCancel: function onCancel() {
|
|
3421
|
+
setDocumentComponentId(null);
|
|
3422
|
+
if (onCanceled != null) {
|
|
3423
|
+
onCanceled(documentComponentId);
|
|
3424
|
+
}
|
|
3425
|
+
},
|
|
3426
|
+
onPublished: function onPublished() {
|
|
3427
|
+
setDocumentComponentId(null);
|
|
3428
|
+
if (_onPublished != null) {
|
|
3429
|
+
_onPublished(documentComponentId);
|
|
3430
|
+
}
|
|
3431
|
+
}
|
|
3432
|
+
}));
|
|
3433
|
+
}
|
|
3434
|
+
"use strict";
|
|
3435
|
+
|
|
3436
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3437
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3438
|
+
value: true
|
|
3439
|
+
});
|
|
3440
|
+
exports.ManageMappingDocuments = ManageMappingDocuments;
|
|
3441
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
3442
|
+
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
3443
|
+
var _system = require("@mui/system");
|
|
3444
|
+
var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
|
|
3445
|
+
var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions"));
|
|
3446
|
+
var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
|
|
3447
|
+
var _DialogContentText = _interopRequireDefault(require("@mui/material/DialogContentText"));
|
|
3448
|
+
var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
|
|
3449
|
+
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
3450
|
+
var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
|
|
3451
|
+
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
3452
|
+
var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
|
|
3453
|
+
var _Select = _interopRequireDefault(require("@mui/material/Select"));
|
|
3454
|
+
var _xDataGrid = require("@mui/x-data-grid");
|
|
3455
|
+
var _DeleteRounded = _interopRequireDefault(require("@mui/icons-material/DeleteRounded"));
|
|
3456
|
+
var _ListRounded = _interopRequireDefault(require("@mui/icons-material/ListRounded"));
|
|
3457
|
+
var _PublishRounded = _interopRequireDefault(require("@mui/icons-material/PublishRounded"));
|
|
3458
|
+
var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
|
|
3459
|
+
var _DownloadRounded = _interopRequireDefault(require("@mui/icons-material/DownloadRounded"));
|
|
3460
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
3461
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
3462
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
3463
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
3464
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
3465
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
3466
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3467
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3468
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
3469
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
3470
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
3471
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import {apiService, authService, StripeConnect, ReactDraft, EditableDatagrid, FileUploader} from 'authscape';
|
|
3472
|
+
function ManageMappingDocuments(_ref) {
|
|
3473
|
+
var fileUploadName = _ref.fileUploadName,
|
|
3474
|
+
_ref$hideDocumentMana = _ref.hideDocumentManager,
|
|
3475
|
+
hideDocumentManager = _ref$hideDocumentMana === void 0 ? false : _ref$hideDocumentMana,
|
|
3476
|
+
_ref$documentTypeId = _ref.documentTypeId,
|
|
3477
|
+
documentTypeId = _ref$documentTypeId === void 0 ? null : _ref$documentTypeId,
|
|
3478
|
+
_ref$companyId = _ref.companyId,
|
|
3479
|
+
companyId = _ref$companyId === void 0 ? null : _ref$companyId,
|
|
3480
|
+
_ref$locationId = _ref.locationId,
|
|
3481
|
+
locationId = _ref$locationId === void 0 ? null : _ref$locationId,
|
|
3482
|
+
_ref$userId = _ref.userId,
|
|
3483
|
+
userId = _ref$userId === void 0 ? null : _ref$userId,
|
|
3484
|
+
_ref$onManageField = _ref.onManageField,
|
|
3485
|
+
onManageField = _ref$onManageField === void 0 ? null : _ref$onManageField,
|
|
3486
|
+
_ref$onArchive = _ref.onArchive,
|
|
3487
|
+
onArchive = _ref$onArchive === void 0 ? null : _ref$onArchive;
|
|
3488
|
+
var _useState = (0, _react.useState)(null),
|
|
3489
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
3490
|
+
document = _useState2[0],
|
|
3491
|
+
setDocument = _useState2[1];
|
|
3492
|
+
var _useState3 = (0, _react.useState)(false),
|
|
3493
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
3494
|
+
addColumnDialog = _useState4[0],
|
|
3495
|
+
setAddColumnDialog = _useState4[1];
|
|
3496
|
+
var _useState5 = (0, _react.useState)(false),
|
|
3497
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
3498
|
+
showAddNewDocument = _useState6[0],
|
|
3499
|
+
setShowAddNewDocument = _useState6[1];
|
|
3500
|
+
var _useState7 = (0, _react.useState)(false),
|
|
3501
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
3502
|
+
showTrainingDocument = _useState8[0],
|
|
3503
|
+
setShowTrainingDocument = _useState8[1];
|
|
3504
|
+
var _useState9 = (0, _react.useState)(''),
|
|
3505
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
3506
|
+
columnName = _useState10[0],
|
|
3507
|
+
setColumnName = _useState10[1];
|
|
3508
|
+
var _useState11 = (0, _react.useState)(null),
|
|
3509
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
3510
|
+
selectedAddedColumn = _useState12[0],
|
|
3511
|
+
setSelectedAddedColumn = _useState12[1];
|
|
3512
|
+
var _useState13 = (0, _react.useState)(null),
|
|
3513
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
3514
|
+
documentMappingColumns = _useState14[0],
|
|
3515
|
+
setDocumentMappingColumns = _useState14[1];
|
|
3516
|
+
var _useState15 = (0, _react.useState)(null),
|
|
3517
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
3518
|
+
toColumnOptions = _useState16[0],
|
|
3519
|
+
setToColumnOptions = _useState16[1];
|
|
3520
|
+
var _useState17 = (0, _react.useState)(null),
|
|
3521
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
3522
|
+
removeDocument = _useState18[0],
|
|
3523
|
+
setRemoveDocument = _useState18[1];
|
|
3524
|
+
var _useState19 = (0, _react.useState)(null),
|
|
3525
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
3526
|
+
selectedDocumentComponentId = _useState20[0],
|
|
3527
|
+
setSelectedDocumentComponentId = _useState20[1];
|
|
3528
|
+
var _useState21 = (0, _react.useState)(0),
|
|
3529
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
3530
|
+
dataGridRefreshKey = _useState22[0],
|
|
3531
|
+
setDataGridRefreshKey = _useState22[1];
|
|
3532
|
+
var _useState23 = (0, _react.useState)(0),
|
|
3533
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
3534
|
+
dataGridMappingRefreshKey = _useState24[0],
|
|
3535
|
+
setDataGridMappingRefreshKey = _useState24[1];
|
|
3536
|
+
var _useState25 = (0, _react.useState)(null),
|
|
3537
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
3538
|
+
selectedDocument = _useState26[0],
|
|
3539
|
+
setSelectedDocument = _useState26[1];
|
|
3540
|
+
var _useState27 = (0, _react.useState)(0),
|
|
3541
|
+
_useState28 = _slicedToArray(_useState27, 2),
|
|
3542
|
+
status = _useState28[0],
|
|
3543
|
+
setStatus = _useState28[1];
|
|
3544
|
+
var _useState29 = (0, _react.useState)([]),
|
|
3545
|
+
_useState30 = _slicedToArray(_useState29, 2),
|
|
3546
|
+
componentTypes = _useState30[0],
|
|
3547
|
+
setComponentTypes = _useState30[1];
|
|
3548
|
+
var refHeaderRowInput = (0, _react.useRef)(null);
|
|
3549
|
+
var fileUploaderRef = (0, _react.useRef)(null);
|
|
3550
|
+
var refNewDocumentName = (0, _react.useRef)(null);
|
|
3551
|
+
var refSelectDocumentType = (0, _react.useRef)(null);
|
|
3552
|
+
var refNewColumnFileColumn = (0, _react.useRef)(null);
|
|
3553
|
+
var documentColumns = [{
|
|
3554
|
+
field: 'name',
|
|
3555
|
+
flex: 1,
|
|
3556
|
+
headerName: 'Document Name',
|
|
3557
|
+
width: 150,
|
|
3558
|
+
editable: false
|
|
3559
|
+
}, {
|
|
3560
|
+
field: 'documentTypeName',
|
|
3561
|
+
flex: 1,
|
|
3562
|
+
headerName: 'Document Type',
|
|
3563
|
+
width: 150,
|
|
3564
|
+
editable: false
|
|
3565
|
+
}, {
|
|
3566
|
+
field: "actions",
|
|
3567
|
+
type: "actions",
|
|
3568
|
+
width: 200,
|
|
3569
|
+
flex: 1,
|
|
3570
|
+
headerName: "",
|
|
3571
|
+
cellClassName: "actions",
|
|
3572
|
+
getActions: function getActions(_ref2) {
|
|
3573
|
+
var id = _ref2.id,
|
|
3574
|
+
row = _ref2.row;
|
|
3575
|
+
return [/*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
3576
|
+
variant: "text",
|
|
3577
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_ListRounded["default"], null),
|
|
3578
|
+
onClick: function onClick() {
|
|
3579
|
+
if (onManageField != null) {
|
|
3580
|
+
onManageField(row.id);
|
|
3581
|
+
}
|
|
2927
3582
|
}
|
|
2928
|
-
})
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
var
|
|
3583
|
+
}, "Manage Fields"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
3584
|
+
variant: "text",
|
|
3585
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_DownloadRounded["default"], null),
|
|
3586
|
+
onClick: function onClick() {
|
|
3587
|
+
window.open("https://view.officeapps.live.com/op/view.aspx?src=" + row.fileUri + "&wdOrigin=BROWSELINK");
|
|
3588
|
+
}
|
|
3589
|
+
}, "Download File"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
3590
|
+
variant: "text",
|
|
3591
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_DeleteRounded["default"], null),
|
|
3592
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
3593
|
+
var documentMappingId;
|
|
2939
3594
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2940
3595
|
while (1) switch (_context.prev = _context.next) {
|
|
2941
3596
|
case 0:
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
}
|
|
2949
|
-
}
|
|
2950
|
-
if (tier.qty != null) {
|
|
2951
|
-
qty = parseInt(data["qty-" + tier.id]);
|
|
2952
|
-
}
|
|
2953
|
-
if (onButtonClicked != null) {
|
|
2954
|
-
onButtonClicked({
|
|
2955
|
-
id: tier.id,
|
|
2956
|
-
modifiers: modifiers,
|
|
2957
|
-
qty: qty
|
|
2958
|
-
});
|
|
2959
|
-
}
|
|
2960
|
-
case 5:
|
|
3597
|
+
documentMappingId = row.id;
|
|
3598
|
+
setRemoveDocument({
|
|
3599
|
+
companyId: companyId,
|
|
3600
|
+
documentMappingId: documentMappingId
|
|
3601
|
+
});
|
|
3602
|
+
case 2:
|
|
2961
3603
|
case "end":
|
|
2962
3604
|
return _context.stop();
|
|
2963
3605
|
}
|
|
2964
3606
|
}, _callee);
|
|
3607
|
+
}))
|
|
3608
|
+
}, "Remove")];
|
|
3609
|
+
}
|
|
3610
|
+
}];
|
|
3611
|
+
(0, _react.useEffect)(function () {
|
|
3612
|
+
if (document != null) {
|
|
3613
|
+
var fetchData = /*#__PURE__*/function () {
|
|
3614
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
3615
|
+
var response;
|
|
3616
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
3617
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
3618
|
+
case 0:
|
|
3619
|
+
_context3.next = 2;
|
|
3620
|
+
return apiService().get("/DocumentMapping/GetMappingFieldsForDocument?documentId=" + document.id);
|
|
3621
|
+
case 2:
|
|
3622
|
+
response = _context3.sent;
|
|
3623
|
+
if (response != null) {
|
|
3624
|
+
setToColumnOptions(response.data);
|
|
3625
|
+
setDocumentMappingColumns([{
|
|
3626
|
+
field: 'name',
|
|
3627
|
+
flex: 1,
|
|
3628
|
+
headerName: 'File Column',
|
|
3629
|
+
width: 150,
|
|
3630
|
+
editable: true
|
|
3631
|
+
}, {
|
|
3632
|
+
field: 'toName',
|
|
3633
|
+
headerName: 'Upload To',
|
|
3634
|
+
flex: 1,
|
|
3635
|
+
width: 150,
|
|
3636
|
+
editable: true,
|
|
3637
|
+
type: 'singleSelect',
|
|
3638
|
+
valueOptions: response.data
|
|
3639
|
+
}, {
|
|
3640
|
+
field: "actions",
|
|
3641
|
+
type: "actions",
|
|
3642
|
+
width: 200,
|
|
3643
|
+
headerName: "Archive Fields",
|
|
3644
|
+
cellClassName: "actions",
|
|
3645
|
+
getActions: function getActions(_ref5) {
|
|
3646
|
+
var id = _ref5.id,
|
|
3647
|
+
row = _ref5.row;
|
|
3648
|
+
return [/*#__PURE__*/_react["default"].createElement(_xDataGrid.GridActionsCellItem, {
|
|
3649
|
+
key: id,
|
|
3650
|
+
icon: /*#__PURE__*/_react["default"].createElement(_DeleteRounded["default"], null),
|
|
3651
|
+
label: "Archive",
|
|
3652
|
+
className: "textPrimary",
|
|
3653
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
3654
|
+
var documentMappingId, documentComponentId, response;
|
|
3655
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
3656
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
3657
|
+
case 0:
|
|
3658
|
+
documentMappingId = row.id;
|
|
3659
|
+
documentComponentId = row.documentComponentId; // archive the column
|
|
3660
|
+
_context2.next = 4;
|
|
3661
|
+
return apiService()["delete"]("/DocumentMapping/RemoveColumnFromDocumentComponent?documentMappingId=" + documentMappingId + "&documentComponentId=" + documentComponentId);
|
|
3662
|
+
case 4:
|
|
3663
|
+
response = _context2.sent;
|
|
3664
|
+
if (response != null && response.status == 200) {
|
|
3665
|
+
setDataGridMappingRefreshKey(dataGridMappingRefreshKey + 1);
|
|
3666
|
+
}
|
|
3667
|
+
case 6:
|
|
3668
|
+
case "end":
|
|
3669
|
+
return _context2.stop();
|
|
3670
|
+
}
|
|
3671
|
+
}, _callee2);
|
|
3672
|
+
}))
|
|
3673
|
+
})];
|
|
3674
|
+
}
|
|
3675
|
+
}]);
|
|
3676
|
+
}
|
|
3677
|
+
case 4:
|
|
3678
|
+
case "end":
|
|
3679
|
+
return _context3.stop();
|
|
3680
|
+
}
|
|
3681
|
+
}, _callee3);
|
|
2965
3682
|
}));
|
|
2966
|
-
return function (
|
|
3683
|
+
return function fetchData() {
|
|
2967
3684
|
return _ref4.apply(this, arguments);
|
|
2968
3685
|
};
|
|
2969
|
-
}()
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
3686
|
+
}();
|
|
3687
|
+
fetchData();
|
|
3688
|
+
}
|
|
3689
|
+
}, [document]);
|
|
3690
|
+
(0, _react.useEffect)(function () {
|
|
3691
|
+
if (showAddNewDocument && documentTypeId == null) {
|
|
3692
|
+
// get all document types
|
|
3693
|
+
var fetchData = /*#__PURE__*/function () {
|
|
3694
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
3695
|
+
var response;
|
|
3696
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
3697
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
3698
|
+
case 0:
|
|
3699
|
+
_context4.next = 2;
|
|
3700
|
+
return apiService().post("/DocumentMapping/GetDocumentTypes");
|
|
3701
|
+
case 2:
|
|
3702
|
+
response = _context4.sent;
|
|
3703
|
+
if (response != null && response.status == 200) {
|
|
3704
|
+
setComponentTypes(response.data.data);
|
|
3705
|
+
}
|
|
3706
|
+
case 4:
|
|
3707
|
+
case "end":
|
|
3708
|
+
return _context4.stop();
|
|
3709
|
+
}
|
|
3710
|
+
}, _callee4);
|
|
3711
|
+
}));
|
|
3712
|
+
return function fetchData() {
|
|
3713
|
+
return _ref7.apply(this, arguments);
|
|
3714
|
+
};
|
|
3715
|
+
}();
|
|
3716
|
+
fetchData();
|
|
3717
|
+
}
|
|
3718
|
+
}, [showAddNewDocument, documentTypeId]);
|
|
3719
|
+
var GetHeaderRowData = /*#__PURE__*/function () {
|
|
3720
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(documentComponentId) {
|
|
3721
|
+
var response;
|
|
3722
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
3723
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
3724
|
+
case 0:
|
|
3725
|
+
_context5.next = 2;
|
|
3726
|
+
return apiService().get("/DocumentMapping/GetHeaderRow?documentComponentId=" + documentComponentId);
|
|
3727
|
+
case 2:
|
|
3728
|
+
response = _context5.sent;
|
|
3729
|
+
if (response != null && response.status == 200) {
|
|
3730
|
+
refHeaderRowInput.current.value = response.data;
|
|
3731
|
+
}
|
|
3732
|
+
case 4:
|
|
3733
|
+
case "end":
|
|
3734
|
+
return _context5.stop();
|
|
3735
|
+
}
|
|
3736
|
+
}, _callee5);
|
|
3737
|
+
}));
|
|
3738
|
+
return function GetHeaderRowData(_x2) {
|
|
3739
|
+
return _ref8.apply(this, arguments);
|
|
3740
|
+
};
|
|
3741
|
+
}();
|
|
3742
|
+
(0, _react.useEffect)(function () {
|
|
3743
|
+
if (status != null) {
|
|
3744
|
+
setDataGridRefreshKey(dataGridRefreshKey + 1);
|
|
3745
|
+
}
|
|
3746
|
+
}, [status]);
|
|
3747
|
+
return /*#__PURE__*/_react["default"].createElement(_system.Box, null, !hideDocumentManager && /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
3748
|
+
container: true,
|
|
3749
|
+
spacing: 2,
|
|
3750
|
+
sx: {
|
|
3751
|
+
paddingBottom: 2
|
|
3752
|
+
}
|
|
3753
|
+
}, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
3754
|
+
item: true,
|
|
3755
|
+
xs: 3
|
|
3756
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
3757
|
+
sx: {
|
|
3758
|
+
minWidth: 120
|
|
3759
|
+
}
|
|
3760
|
+
}, /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
|
|
3761
|
+
fullWidth: true
|
|
3762
|
+
}, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
|
|
3763
|
+
id: "demo-simple-select-label"
|
|
3764
|
+
}, "Status"), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
3765
|
+
labelId: "demo-simple-select-label",
|
|
3766
|
+
id: "demo-simple-select",
|
|
3767
|
+
value: status,
|
|
3768
|
+
label: "Status",
|
|
3769
|
+
onChange: function onChange(event) {
|
|
3770
|
+
setStatus(event.target.value);
|
|
3771
|
+
}
|
|
3772
|
+
}, /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
3773
|
+
value: 0
|
|
3774
|
+
}, "Open"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
3775
|
+
value: 2
|
|
3776
|
+
}, "Published"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
3777
|
+
value: 1
|
|
3778
|
+
}, "Archived"))))), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
3779
|
+
item: true,
|
|
3780
|
+
xs: 9
|
|
3781
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
3782
|
+
sx: {
|
|
3783
|
+
textAlign: "right",
|
|
3784
|
+
marginBottom: 2
|
|
3785
|
+
}
|
|
3786
|
+
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
3787
|
+
variant: "contained",
|
|
3788
|
+
onClick: function onClick() {
|
|
3789
|
+
setShowAddNewDocument(true);
|
|
3790
|
+
}
|
|
3791
|
+
}, fileUploadName)))), /*#__PURE__*/_react["default"].createElement(EditableDatagrid, {
|
|
3792
|
+
key: dataGridRefreshKey,
|
|
3793
|
+
loadedUser: true,
|
|
3794
|
+
params: {
|
|
3795
|
+
companyId: companyId,
|
|
3796
|
+
userId: userId,
|
|
3797
|
+
locationId: locationId,
|
|
3798
|
+
status: status
|
|
3799
|
+
},
|
|
3800
|
+
url: "/DocumentMapping/GetDocumentComponents",
|
|
3801
|
+
columns: documentColumns
|
|
3802
|
+
})), hideDocumentManager && /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
3803
|
+
variant: "contained",
|
|
3804
|
+
onClick: function onClick() {
|
|
3805
|
+
setShowAddNewDocument(true);
|
|
3806
|
+
}
|
|
3807
|
+
}, fileUploadName), /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
3808
|
+
open: showAddNewDocument,
|
|
3809
|
+
onClose: function onClose() {
|
|
3810
|
+
setShowAddNewDocument(false);
|
|
3811
|
+
},
|
|
3812
|
+
fullWidth: true,
|
|
3813
|
+
"aria-labelledby": "alert-dialog-title",
|
|
3814
|
+
"aria-describedby": "alert-dialog-description"
|
|
3815
|
+
}, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
|
|
3816
|
+
id: "alert-dialog-title"
|
|
3817
|
+
}, "Upload Document"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, documentTypeId == null && /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], {
|
|
3818
|
+
id: "alert-dialog-description",
|
|
3819
|
+
sx: {
|
|
3820
|
+
paddingBottom: 2
|
|
3821
|
+
}
|
|
3822
|
+
}, "Please select the type of document, then click \"Choose a file\""), documentTypeId == null && /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
3823
|
+
sx: {
|
|
3824
|
+
marginTop: 2
|
|
3825
|
+
}
|
|
3826
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
3827
|
+
sx: {
|
|
3828
|
+
minWidth: 120
|
|
3829
|
+
}
|
|
3830
|
+
}, /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
|
|
3831
|
+
fullWidth: true
|
|
3832
|
+
}, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
|
|
3833
|
+
id: "demo-simple-select-label"
|
|
3834
|
+
}, "Document Type"), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
3835
|
+
labelId: "demo-simple-select-label",
|
|
3836
|
+
id: "demo-simple-select",
|
|
3837
|
+
inputRef: refSelectDocumentType,
|
|
3838
|
+
onChange: function onChange(val) {
|
|
3839
|
+
var _selectedDocument = componentTypes.find(function (s) {
|
|
3840
|
+
return s.id == val.target.value;
|
|
3841
|
+
});
|
|
3842
|
+
setSelectedDocument(_selectedDocument);
|
|
3843
|
+
},
|
|
3844
|
+
label: "DocumentType"
|
|
3845
|
+
}, componentTypes != null && componentTypes.map(function (componentType) {
|
|
3846
|
+
return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
3847
|
+
value: componentType.id
|
|
3848
|
+
}, componentType.name);
|
|
3849
|
+
}))))), (selectedDocument != null || selectedDocument == null && documentTypeId != null) && /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
3850
|
+
sx: {
|
|
3851
|
+
textAlign: "center",
|
|
3852
|
+
width: "100%",
|
|
3853
|
+
display: "flex",
|
|
3854
|
+
alignItems: "center",
|
|
3855
|
+
paddingTop: 2
|
|
3856
|
+
}
|
|
3857
|
+
}, /*#__PURE__*/_react["default"].createElement(FileUploader, {
|
|
3858
|
+
refOveride: fileUploaderRef,
|
|
3859
|
+
params: {
|
|
3860
|
+
documentTypeId: documentTypeId == null ? selectedDocument.id : documentTypeId,
|
|
3861
|
+
companyId: companyId
|
|
3862
|
+
},
|
|
3863
|
+
url: "/DocumentMapping/SyncDocument",
|
|
3864
|
+
multiple: true,
|
|
3865
|
+
variant: "custom",
|
|
3866
|
+
onUploadCompleted: function onUploadCompleted(responses) {
|
|
3867
|
+
if (responses.length > 0) {
|
|
3868
|
+
var row = responses[0].data;
|
|
3869
|
+
if (onManageField != null) {
|
|
3870
|
+
onManageField(row.id);
|
|
3871
|
+
}
|
|
3872
|
+
}
|
|
3873
|
+
setShowAddNewDocument(false);
|
|
3874
|
+
}
|
|
3875
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
3876
|
+
sx: {
|
|
3877
|
+
display: "flex",
|
|
3878
|
+
alignItems: "center"
|
|
3879
|
+
}
|
|
3880
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
3881
|
+
htmlFor: "file-upload",
|
|
3882
|
+
sx: {
|
|
3883
|
+
border: "2px dashed #aaa",
|
|
3884
|
+
padding: 20,
|
|
3885
|
+
textAlign: "center",
|
|
3886
|
+
cursor: "pointer"
|
|
3887
|
+
}
|
|
3888
|
+
}, 'Choose a file'))))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
3889
|
+
onClick: function onClick() {
|
|
3890
|
+
setShowAddNewDocument(false);
|
|
3891
|
+
}
|
|
3892
|
+
}, "Cancel"))), /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
3893
|
+
open: showTrainingDocument,
|
|
3894
|
+
onClose: function onClose() {
|
|
3895
|
+
setShowTrainingDocument(false);
|
|
3896
|
+
},
|
|
3897
|
+
fullWidth: true,
|
|
3898
|
+
"aria-labelledby": "alert-dialog-title",
|
|
3899
|
+
"aria-describedby": "alert-dialog-description"
|
|
3900
|
+
}, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
|
|
3901
|
+
id: "alert-dialog-title"
|
|
3902
|
+
}, "Setup Mapping"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], {
|
|
3903
|
+
id: "alert-dialog-description"
|
|
3904
|
+
}, "If you'd like to submit a file, we can assist in configuring the fields to match the formatting of your document."), document != null && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(FileUploader, {
|
|
3905
|
+
refOveride: fileUploaderRef,
|
|
3906
|
+
url: "/DocumentMapping/TrainDocument",
|
|
3907
|
+
params: {
|
|
3908
|
+
documentComponentId: document.id,
|
|
3909
|
+
companyId: companyId,
|
|
3910
|
+
locationId: locationId,
|
|
3911
|
+
userId: userId
|
|
3912
|
+
},
|
|
3913
|
+
multiple: false,
|
|
3914
|
+
variant: "custom",
|
|
3915
|
+
onUploadCompleted: function onUploadCompleted() {
|
|
3916
|
+
setDataGridMappingRefreshKey(dataGridMappingRefreshKey + 1);
|
|
3917
|
+
|
|
3918
|
+
// setUpdate(!update);
|
|
3919
|
+
// handleClose();
|
|
3920
|
+
}
|
|
3921
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
3922
|
+
sx: {
|
|
3923
|
+
marginTop: 2,
|
|
3924
|
+
borderRadius: 2,
|
|
3925
|
+
backgroundColor: "#f5f5f5",
|
|
3926
|
+
border: "1px solid lightgray",
|
|
3927
|
+
cursor: "pointer",
|
|
3928
|
+
padding: 2
|
|
3929
|
+
}
|
|
3930
|
+
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
3931
|
+
id: "FileUploader",
|
|
3932
|
+
"aria-controls": open ? 'demo-customized-menu' : undefined,
|
|
3933
|
+
"aria-haspopup": "true",
|
|
3934
|
+
"aria-expanded": open ? 'true' : undefined,
|
|
3935
|
+
variant: "text",
|
|
3936
|
+
disableElevation: true,
|
|
3937
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_PublishRounded["default"], null),
|
|
3938
|
+
sx: {
|
|
3939
|
+
marginLeft: 1
|
|
3940
|
+
}
|
|
3941
|
+
}, "Upload Sample File"))))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
3942
|
+
onClick: function onClick() {
|
|
3943
|
+
setShowTrainingDocument(false);
|
|
3944
|
+
}
|
|
3945
|
+
}, "No, thank you"))), /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
3946
|
+
open: addColumnDialog,
|
|
3947
|
+
onClose: function onClose() {
|
|
3948
|
+
setAddColumnDialog(false);
|
|
3949
|
+
},
|
|
3950
|
+
fullWidth: true,
|
|
3951
|
+
"aria-labelledby": "alert-dialog-title",
|
|
3952
|
+
"aria-describedby": "alert-dialog-description"
|
|
3953
|
+
}, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
|
|
3954
|
+
id: "alert-dialog-title"
|
|
3955
|
+
}, "Add Column"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], {
|
|
3956
|
+
id: "alert-dialog-description"
|
|
3957
|
+
}, "Include a column for document mapping"), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
3958
|
+
sx: {
|
|
3959
|
+
marginTop: 2
|
|
3960
|
+
}
|
|
3961
|
+
}, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
3962
|
+
inputRef: refNewColumnFileColumn,
|
|
3963
|
+
id: "outlined-basic",
|
|
3964
|
+
label: "File Column",
|
|
3965
|
+
fullWidth: true,
|
|
3966
|
+
variant: "outlined"
|
|
3967
|
+
})), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
3968
|
+
sx: {
|
|
3969
|
+
marginTop: 4
|
|
3970
|
+
}
|
|
3971
|
+
}, /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
|
|
3972
|
+
fullWidth: true
|
|
3973
|
+
}, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
|
|
3974
|
+
id: "demo-simple-select-label"
|
|
3975
|
+
}, "Column Name"), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
3976
|
+
labelId: "demo-simple-select-label",
|
|
3977
|
+
id: "demo-simple-select",
|
|
3978
|
+
value: selectedAddedColumn,
|
|
3979
|
+
label: "Column Name",
|
|
3980
|
+
onChange: function onChange(data) {
|
|
3981
|
+
setSelectedAddedColumn(data.target.value);
|
|
3982
|
+
}
|
|
3983
|
+
})))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
3984
|
+
onClick: function onClick() {
|
|
3985
|
+
setAddColumnDialog(false);
|
|
3986
|
+
}
|
|
3987
|
+
}, "Cancel"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
3988
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
3989
|
+
var response;
|
|
3990
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
3991
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
3992
|
+
case 0:
|
|
3993
|
+
_context6.next = 2;
|
|
3994
|
+
return apiService().post("/DocumentMapping/AddNewField", {
|
|
3995
|
+
tableName: document.name,
|
|
3996
|
+
fieldName: refNewColumnFileColumn.current.value,
|
|
3997
|
+
fileColumn: selectedAddedColumn,
|
|
3998
|
+
companyId: companyId,
|
|
3999
|
+
locationId: locationId,
|
|
4000
|
+
userId: userId
|
|
4001
|
+
});
|
|
4002
|
+
case 2:
|
|
4003
|
+
response = _context6.sent;
|
|
4004
|
+
if (response != null && response.status == 200) {
|
|
4005
|
+
setDataGridMappingRefreshKey(dataGridMappingRefreshKey + 1);
|
|
4006
|
+
setAddColumnDialog(false);
|
|
4007
|
+
}
|
|
4008
|
+
case 4:
|
|
4009
|
+
case "end":
|
|
4010
|
+
return _context6.stop();
|
|
4011
|
+
}
|
|
4012
|
+
}, _callee6);
|
|
4013
|
+
})),
|
|
4014
|
+
autoFocus: true
|
|
4015
|
+
}, "Add Column"))), /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
4016
|
+
open: removeDocument != null ? true : false,
|
|
4017
|
+
onClose: function onClose() {
|
|
4018
|
+
setRemoveDocument(null);
|
|
4019
|
+
},
|
|
4020
|
+
fullWidth: true,
|
|
4021
|
+
"aria-labelledby": "alert-dialog-title",
|
|
4022
|
+
"aria-describedby": "alert-dialog-description"
|
|
4023
|
+
}, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
|
|
4024
|
+
id: "alert-dialog-title"
|
|
4025
|
+
}, "Remove the document"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], {
|
|
4026
|
+
id: "alert-dialog-description"
|
|
4027
|
+
}, "Are you sure you want to remove this document?")), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4028
|
+
onClick: function onClick() {
|
|
4029
|
+
setRemoveDocument(null);
|
|
4030
|
+
}
|
|
4031
|
+
}, "Cancel"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4032
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
4033
|
+
var response;
|
|
4034
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
4035
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
4036
|
+
case 0:
|
|
4037
|
+
response = null;
|
|
4038
|
+
if (!(companyId != null)) {
|
|
4039
|
+
_context7.next = 7;
|
|
4040
|
+
break;
|
|
4041
|
+
}
|
|
4042
|
+
_context7.next = 4;
|
|
4043
|
+
return apiService()["delete"]("/DocumentMapping/RemoveDocument?companyId=" + removeDocument.companyId + "&documentId=" + removeDocument.documentMappingId);
|
|
4044
|
+
case 4:
|
|
4045
|
+
response = _context7.sent;
|
|
4046
|
+
_context7.next = 10;
|
|
4047
|
+
break;
|
|
4048
|
+
case 7:
|
|
4049
|
+
_context7.next = 9;
|
|
4050
|
+
return apiService()["delete"]("/DocumentMapping/RemoveDocument?documentId=" + removeDocument.documentMappingId);
|
|
4051
|
+
case 9:
|
|
4052
|
+
response = _context7.sent;
|
|
4053
|
+
case 10:
|
|
4054
|
+
if (response != null && response.status == 200) {
|
|
4055
|
+
setDataGridRefreshKey(dataGridRefreshKey + 1);
|
|
4056
|
+
setRemoveDocument(null);
|
|
4057
|
+
if (onArchive != null) {
|
|
4058
|
+
onArchive(removeDocument.documentMappingId);
|
|
4059
|
+
}
|
|
4060
|
+
}
|
|
4061
|
+
case 11:
|
|
4062
|
+
case "end":
|
|
4063
|
+
return _context7.stop();
|
|
4064
|
+
}
|
|
4065
|
+
}, _callee7);
|
|
4066
|
+
}))
|
|
4067
|
+
}, "Remove Document"))));
|
|
4068
|
+
}
|
|
4069
|
+
"use strict";
|
|
4070
|
+
|
|
4071
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4072
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4073
|
+
value: true
|
|
4074
|
+
});
|
|
4075
|
+
exports.MappedColumn = MappedColumn;
|
|
4076
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
4077
|
+
var _Card = _interopRequireDefault(require("@mui/material/Card"));
|
|
4078
|
+
var _CardActions = _interopRequireDefault(require("@mui/material/CardActions"));
|
|
4079
|
+
var _CardContent = _interopRequireDefault(require("@mui/material/CardContent"));
|
|
4080
|
+
var _system = require("@mui/system");
|
|
4081
|
+
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
4082
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
4083
|
+
var _Link = _interopRequireDefault(require("@mui/icons-material/Link"));
|
|
4084
|
+
var _LinkOff = _interopRequireDefault(require("@mui/icons-material/LinkOff"));
|
|
4085
|
+
var _Stack = _interopRequireDefault(require("@mui/material/Stack"));
|
|
4086
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
4087
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
4088
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
4089
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
4090
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4091
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } // import NewMappingColumn from './newMappingColumn';
|
|
4092
|
+
// import MatchExistingMappedColumn from './matchExisting';
|
|
4093
|
+
// import { apiService } from 'authscape';
|
|
4094
|
+
|
|
4095
|
+
function MappedColumn(_ref) {
|
|
4096
|
+
var companyId = _ref.companyId,
|
|
4097
|
+
documentId = _ref.documentId,
|
|
4098
|
+
documentType = _ref.documentType,
|
|
4099
|
+
documentMappingId = _ref.documentMappingId,
|
|
4100
|
+
name = _ref.name,
|
|
4101
|
+
toName = _ref.toName,
|
|
4102
|
+
isMapped = _ref.isMapped,
|
|
4103
|
+
toOptions = _ref.toOptions,
|
|
4104
|
+
onResponse = _ref.onResponse;
|
|
4105
|
+
var notMatchedColor = "#ffe5e5";
|
|
4106
|
+
var matchedColor = "#fff";
|
|
4107
|
+
return /*#__PURE__*/_react["default"].createElement(_Card["default"], {
|
|
4108
|
+
sx: {
|
|
4109
|
+
marginTop: 1
|
|
4110
|
+
}
|
|
4111
|
+
}, /*#__PURE__*/_react["default"].createElement(_CardContent["default"], {
|
|
4112
|
+
sx: {
|
|
4113
|
+
position: "relative",
|
|
4114
|
+
backgroundColor: isMapped ? notMatchedColor : matchedColor
|
|
4115
|
+
}
|
|
4116
|
+
}, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
4117
|
+
gutterBottom: true,
|
|
4118
|
+
variant: "h5",
|
|
4119
|
+
component: "div"
|
|
4120
|
+
}, name), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4121
|
+
sx: {
|
|
4122
|
+
position: "absolute",
|
|
4123
|
+
top: "10px",
|
|
4124
|
+
right: "10px"
|
|
4125
|
+
}
|
|
4126
|
+
}, isMapped ? /*#__PURE__*/_react["default"].createElement(_Stack["default"], {
|
|
4127
|
+
direction: "row",
|
|
4128
|
+
spacing: 1
|
|
4129
|
+
}, /*#__PURE__*/_react["default"].createElement(_LinkOff["default"], null), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
4130
|
+
variant: "body2",
|
|
4131
|
+
sx: {
|
|
4132
|
+
paddingTop: 0.5
|
|
4133
|
+
}
|
|
4134
|
+
}, "Not Matched")) : /*#__PURE__*/_react["default"].createElement(_Stack["default"], {
|
|
4135
|
+
direction: "row",
|
|
4136
|
+
spacing: 1
|
|
4137
|
+
}, /*#__PURE__*/_react["default"].createElement(_Link["default"], null), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
4138
|
+
variant: "body2",
|
|
4139
|
+
sx: {
|
|
4140
|
+
paddingTop: 0.5
|
|
4141
|
+
}
|
|
4142
|
+
}, "Matched"))), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
4143
|
+
variant: "body2",
|
|
4144
|
+
color: "text.secondary"
|
|
4145
|
+
}, !isMapped && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, "This column is matched with ", toName), isMapped && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, "This column is not matched. If not matched it will not import"))), /*#__PURE__*/_react["default"].createElement(_CardActions["default"], {
|
|
4146
|
+
sx: {
|
|
4147
|
+
backgroundColor: isMapped ? notMatchedColor : matchedColor
|
|
4148
|
+
}
|
|
4149
|
+
}, !isMapped ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4150
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_LinkOff["default"], null),
|
|
4151
|
+
size: "small",
|
|
4152
|
+
sx: {
|
|
4153
|
+
paddingLeft: 3
|
|
4154
|
+
},
|
|
4155
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
4156
|
+
var response;
|
|
4157
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
4158
|
+
while (1) switch (_context.prev = _context.next) {
|
|
4159
|
+
case 0:
|
|
4160
|
+
_context.next = 2;
|
|
4161
|
+
return apiService()["delete"]("/DocumentMapping/RemoveMatch?companyId=" + companyId + "&documentId=" + documentId + "&documentMappingId=" + documentMappingId);
|
|
4162
|
+
case 2:
|
|
4163
|
+
response = _context.sent;
|
|
4164
|
+
if (response != null && response.status == 200) {
|
|
4165
|
+
onResponse();
|
|
4166
|
+
}
|
|
4167
|
+
case 4:
|
|
4168
|
+
case "end":
|
|
4169
|
+
return _context.stop();
|
|
4170
|
+
}
|
|
4171
|
+
}, _callee);
|
|
4172
|
+
}))
|
|
4173
|
+
}, "Remove Match")) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(MatchExistingMappedColumn, {
|
|
4174
|
+
companyId: companyId,
|
|
4175
|
+
documentId: documentId,
|
|
4176
|
+
documentMappingId: documentMappingId,
|
|
4177
|
+
fromName: name,
|
|
4178
|
+
toOptions: toOptions,
|
|
4179
|
+
onResponse: onResponse
|
|
4180
|
+
}), /*#__PURE__*/_react["default"].createElement(NewMappingColumn, {
|
|
4181
|
+
name: name,
|
|
4182
|
+
companyId: companyId,
|
|
4183
|
+
documentType: documentType,
|
|
4184
|
+
documentId: documentId,
|
|
4185
|
+
documentMappingId: documentMappingId,
|
|
4186
|
+
onResponse: onResponse
|
|
4187
|
+
}))));
|
|
4188
|
+
}
|
|
4189
|
+
"use strict";
|
|
4190
|
+
|
|
4191
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4192
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4193
|
+
value: true
|
|
4194
|
+
});
|
|
4195
|
+
exports.MatchExistingMappedColumn = MatchExistingMappedColumn;
|
|
4196
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
4197
|
+
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
4198
|
+
var _system = require("@mui/system");
|
|
4199
|
+
var _LinkRounded = _interopRequireDefault(require("@mui/icons-material/LinkRounded"));
|
|
4200
|
+
var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
|
|
4201
|
+
var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions"));
|
|
4202
|
+
var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
|
|
4203
|
+
var _DialogContentText = _interopRequireDefault(require("@mui/material/DialogContentText"));
|
|
4204
|
+
var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
|
|
4205
|
+
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
4206
|
+
var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
|
|
4207
|
+
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
4208
|
+
var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
|
|
4209
|
+
var _Select = _interopRequireDefault(require("@mui/material/Select"));
|
|
4210
|
+
var _Checkbox = _interopRequireDefault(require("@mui/material/Checkbox"));
|
|
4211
|
+
var _FormControlLabel = _interopRequireDefault(require("@mui/material/FormControlLabel"));
|
|
4212
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
4213
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
4214
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
4215
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
4216
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4217
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
4218
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4219
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4220
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4221
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4222
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
4223
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
4224
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import {apiService, authService, StripeConnect, ReactDraft, EditableDatagrid, FileUploader} from 'authscape';
|
|
4225
|
+
function MatchExistingMappedColumn(_ref) {
|
|
4226
|
+
var companyId = _ref.companyId,
|
|
4227
|
+
documentId = _ref.documentId,
|
|
4228
|
+
documentMappingId = _ref.documentMappingId,
|
|
4229
|
+
fromName = _ref.fromName,
|
|
4230
|
+
toOptions = _ref.toOptions,
|
|
4231
|
+
onResponse = _ref.onResponse;
|
|
4232
|
+
var _useState = (0, _react.useState)(false),
|
|
4233
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
4234
|
+
createNewOpen = _useState2[0],
|
|
4235
|
+
setCreateNewOpen = _useState2[1];
|
|
4236
|
+
var _useState3 = (0, _react.useState)(false),
|
|
4237
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
4238
|
+
onlyAddRowIfFound = _useState4[0],
|
|
4239
|
+
setOnlyAddRowIfFound = _useState4[1];
|
|
4240
|
+
var _useState5 = (0, _react.useState)(true),
|
|
4241
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
4242
|
+
rememberForNextTime = _useState6[0],
|
|
4243
|
+
setRememberForNextTime = _useState6[1];
|
|
4244
|
+
var _useState7 = (0, _react.useState)(null),
|
|
4245
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
4246
|
+
selectedToColumn = _useState8[0],
|
|
4247
|
+
setSelectedToColumn = _useState8[1];
|
|
4248
|
+
var handleClose = function handleClose() {
|
|
4249
|
+
setCreateNewOpen(false);
|
|
4250
|
+
};
|
|
4251
|
+
var checkboxRememberLabel = {
|
|
4252
|
+
inputProps: {
|
|
4253
|
+
'aria-label': 'Checkbox Remember'
|
|
4254
|
+
}
|
|
4255
|
+
};
|
|
4256
|
+
var SelectedExistingColumns = function SelectedExistingColumns(_ref2) {
|
|
4257
|
+
var toOptions = _ref2.toOptions;
|
|
4258
|
+
return /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4259
|
+
sx: {
|
|
4260
|
+
minWidth: 120
|
|
4261
|
+
}
|
|
4262
|
+
}, /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
|
|
4263
|
+
fullWidth: true
|
|
4264
|
+
}, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
|
|
4265
|
+
id: "demo-simple-select-label"
|
|
4266
|
+
}, "Match to column"), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
4267
|
+
labelId: "demo-simple-select-label",
|
|
4268
|
+
id: "demo-simple-select",
|
|
4269
|
+
value: selectedToColumn,
|
|
4270
|
+
label: "Age",
|
|
4271
|
+
onChange: function onChange(event) {
|
|
4272
|
+
setSelectedToColumn(event.target.value);
|
|
4273
|
+
}
|
|
4274
|
+
}, toOptions != null && toOptions.map(function (toOption) {
|
|
4275
|
+
var isRequiredMessage = "";
|
|
4276
|
+
if (toOption.isRequired) {
|
|
4277
|
+
isRequiredMessage = " (Required)";
|
|
4278
|
+
}
|
|
4279
|
+
return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
4280
|
+
value: toOption.name
|
|
4281
|
+
}, toOption.visibleName, " ", isRequiredMessage);
|
|
4282
|
+
}))));
|
|
4283
|
+
};
|
|
4284
|
+
return /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
4285
|
+
open: createNewOpen,
|
|
4286
|
+
onClose: handleClose,
|
|
4287
|
+
fullWidth: true,
|
|
4288
|
+
"aria-labelledby": "alert-dialog-title",
|
|
4289
|
+
"aria-describedby": "alert-dialog-description"
|
|
4290
|
+
}, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
|
|
4291
|
+
id: "alert-dialog-title"
|
|
4292
|
+
}, "Match existing column"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], {
|
|
4293
|
+
id: "alert-dialog-description"
|
|
4294
|
+
}, "***Inform the user about what it means to match existing columns***"), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4295
|
+
sx: {
|
|
4296
|
+
paddingTop: 2
|
|
4297
|
+
}
|
|
4298
|
+
}, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
4299
|
+
id: "outlined-basic",
|
|
4300
|
+
label: "File Column Name",
|
|
4301
|
+
defaultValue: fromName,
|
|
4302
|
+
variant: "outlined",
|
|
4303
|
+
disabled: true,
|
|
4304
|
+
fullWidth: true
|
|
4305
|
+
})), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4306
|
+
sx: {
|
|
4307
|
+
paddingTop: 2
|
|
4308
|
+
}
|
|
4309
|
+
}, /*#__PURE__*/_react["default"].createElement(SelectedExistingColumns, {
|
|
4310
|
+
toOptions: toOptions
|
|
4311
|
+
})), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4312
|
+
sx: {
|
|
4313
|
+
paddingTop: 2
|
|
4314
|
+
}
|
|
4315
|
+
}, /*#__PURE__*/_react["default"].createElement(_FormControlLabel["default"], {
|
|
4316
|
+
value: "end",
|
|
4317
|
+
control: /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], _extends({}, checkboxRememberLabel, {
|
|
4318
|
+
defaultChecked: true,
|
|
4319
|
+
onChange: function onChange(event) {
|
|
4320
|
+
setRememberForNextTime(event.target.checked);
|
|
4321
|
+
}
|
|
4322
|
+
})),
|
|
4323
|
+
label: "Remember match for next time",
|
|
4324
|
+
labelPlacement: "end"
|
|
4325
|
+
}))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4326
|
+
onClick: handleClose
|
|
4327
|
+
}, "Cancel"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4328
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
4329
|
+
var response;
|
|
4330
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
4331
|
+
while (1) switch (_context.prev = _context.next) {
|
|
4332
|
+
case 0:
|
|
4333
|
+
_context.next = 2;
|
|
4334
|
+
return apiService().put("/DocumentMapping/AssignMapping", {
|
|
4335
|
+
companyId: companyId,
|
|
4336
|
+
documentId: documentId,
|
|
4337
|
+
fileColumnName: fromName,
|
|
4338
|
+
documentMappingId: documentMappingId,
|
|
4339
|
+
matchedColumn: selectedToColumn,
|
|
4340
|
+
onlyAddRowIfColumnFound: onlyAddRowIfFound,
|
|
4341
|
+
rememberForNextTime: rememberForNextTime
|
|
4342
|
+
});
|
|
4343
|
+
case 2:
|
|
4344
|
+
response = _context.sent;
|
|
4345
|
+
if (response != null && response.status == 200) {
|
|
4346
|
+
onResponse();
|
|
4347
|
+
handleClose();
|
|
4348
|
+
}
|
|
4349
|
+
case 4:
|
|
4350
|
+
case "end":
|
|
4351
|
+
return _context.stop();
|
|
4352
|
+
}
|
|
4353
|
+
}, _callee);
|
|
4354
|
+
})),
|
|
4355
|
+
autoFocus: true
|
|
4356
|
+
}, "Match Existing"))), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4357
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_LinkRounded["default"], null),
|
|
4358
|
+
size: "small",
|
|
4359
|
+
sx: {
|
|
4360
|
+
paddingLeft: 3
|
|
4361
|
+
},
|
|
4362
|
+
onClick: function onClick() {
|
|
4363
|
+
setCreateNewOpen(true);
|
|
4364
|
+
}
|
|
4365
|
+
}, "Match Existing"));
|
|
4366
|
+
}
|
|
4367
|
+
"use strict";
|
|
4368
|
+
|
|
4369
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4370
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4371
|
+
value: true
|
|
4372
|
+
});
|
|
4373
|
+
exports.NewMappingColumn = NewMappingColumn;
|
|
4374
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
4375
|
+
var _Card = _interopRequireDefault(require("@mui/material/Card"));
|
|
4376
|
+
var _CardContent = _interopRequireDefault(require("@mui/material/CardContent"));
|
|
4377
|
+
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
4378
|
+
var _system = require("@mui/system");
|
|
4379
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
4380
|
+
var _AddRounded = _interopRequireDefault(require("@mui/icons-material/AddRounded"));
|
|
4381
|
+
var _LinkRounded = _interopRequireDefault(require("@mui/icons-material/LinkRounded"));
|
|
4382
|
+
var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
|
|
4383
|
+
var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions"));
|
|
4384
|
+
var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
|
|
4385
|
+
var _DialogContentText = _interopRequireDefault(require("@mui/material/DialogContentText"));
|
|
4386
|
+
var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
|
|
4387
|
+
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
4388
|
+
var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
|
|
4389
|
+
var _LocalParkingRounded = _interopRequireDefault(require("@mui/icons-material/LocalParkingRounded"));
|
|
4390
|
+
var _TextFieldsRounded = _interopRequireDefault(require("@mui/icons-material/TextFieldsRounded"));
|
|
4391
|
+
var _IntegrationInstructionsRounded = _interopRequireDefault(require("@mui/icons-material/IntegrationInstructionsRounded"));
|
|
4392
|
+
var _ListAltRounded = _interopRequireDefault(require("@mui/icons-material/ListAltRounded"));
|
|
4393
|
+
var _CalendarMonthRounded = _interopRequireDefault(require("@mui/icons-material/CalendarMonthRounded"));
|
|
4394
|
+
var _CheckBoxRounded = _interopRequireDefault(require("@mui/icons-material/CheckBoxRounded"));
|
|
4395
|
+
var _InsertPhotoRounded = _interopRequireDefault(require("@mui/icons-material/InsertPhotoRounded"));
|
|
4396
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
4397
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
4398
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
4399
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
4400
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4401
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
4402
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4403
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4404
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4405
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
4406
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
4407
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
4408
|
+
// import { apiService } from 'authscape';
|
|
4409
|
+
|
|
4410
|
+
function NewMappingColumn(_ref) {
|
|
4411
|
+
var name = _ref.name,
|
|
4412
|
+
companyId = _ref.companyId,
|
|
4413
|
+
documentType = _ref.documentType,
|
|
4414
|
+
documentId = _ref.documentId,
|
|
4415
|
+
documentMappingId = _ref.documentMappingId,
|
|
4416
|
+
onResponse = _ref.onResponse;
|
|
4417
|
+
var newColumnNameRef = (0, _react.useRef)(null);
|
|
4418
|
+
var newColumnDescriptionRef = (0, _react.useRef)(null);
|
|
4419
|
+
var _useState = (0, _react.useState)(false),
|
|
4420
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
4421
|
+
createNewOpen = _useState2[0],
|
|
4422
|
+
setCreateNewOpen = _useState2[1];
|
|
4423
|
+
var _useState3 = (0, _react.useState)(null),
|
|
4424
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
4425
|
+
selectedAttributeId = _useState4[0],
|
|
4426
|
+
setSelectedAttributeId = _useState4[1];
|
|
4427
|
+
var handleClose = function handleClose() {
|
|
4428
|
+
setCreateNewOpen(false);
|
|
4429
|
+
};
|
|
4430
|
+
var AttributeTypeComponent = function AttributeTypeComponent(_ref2) {
|
|
4431
|
+
var id = _ref2.id,
|
|
4432
|
+
icon = _ref2.icon,
|
|
4433
|
+
text = _ref2.text;
|
|
4434
|
+
return /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
4435
|
+
item: true,
|
|
4436
|
+
xs: 3
|
|
4437
|
+
}, /*#__PURE__*/_react["default"].createElement(_Card["default"], {
|
|
4438
|
+
sx: {
|
|
4439
|
+
textAlign: "center",
|
|
4440
|
+
cursor: "pointer",
|
|
4441
|
+
backgroundColor: selectedAttributeId == id ? "#e5e5e5" : "none"
|
|
4442
|
+
},
|
|
4443
|
+
onClick: function onClick() {
|
|
4444
|
+
setSelectedAttributeId(id);
|
|
4445
|
+
}
|
|
4446
|
+
}, /*#__PURE__*/_react["default"].createElement(_CardContent["default"], null, icon, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
4447
|
+
variant: "body2",
|
|
4448
|
+
color: "text.secondary",
|
|
4449
|
+
sx: {
|
|
4450
|
+
paddingTop: 1
|
|
4451
|
+
}
|
|
4452
|
+
}, text))));
|
|
4453
|
+
};
|
|
4454
|
+
return /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
4455
|
+
open: createNewOpen,
|
|
4456
|
+
onClose: handleClose,
|
|
4457
|
+
fullWidth: true,
|
|
4458
|
+
"aria-labelledby": "alert-dialog-title",
|
|
4459
|
+
"aria-describedby": "alert-dialog-description"
|
|
4460
|
+
}, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
|
|
4461
|
+
id: "alert-dialog-title"
|
|
4462
|
+
}, "Match to new column"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], {
|
|
4463
|
+
id: "alert-dialog-description"
|
|
4464
|
+
}, "inform the user about adding a new columna and what that means here..."), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4465
|
+
sx: {
|
|
4466
|
+
paddingTop: 2
|
|
4467
|
+
}
|
|
4468
|
+
}, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
4469
|
+
inputRef: newColumnNameRef,
|
|
4470
|
+
defaultValue: name,
|
|
4471
|
+
id: "outlined-basic",
|
|
4472
|
+
label: "Name",
|
|
4473
|
+
variant: "outlined",
|
|
4474
|
+
fullWidth: true
|
|
4475
|
+
})), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4476
|
+
sx: {
|
|
4477
|
+
paddingTop: 2
|
|
4478
|
+
}
|
|
4479
|
+
}, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
4480
|
+
inputRef: newColumnDescriptionRef,
|
|
4481
|
+
id: "outlined-basic",
|
|
4482
|
+
label: "Description (optional)",
|
|
4483
|
+
variant: "outlined",
|
|
4484
|
+
fullWidth: true
|
|
4485
|
+
})), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4486
|
+
sx: {
|
|
4487
|
+
paddingTop: 2
|
|
4488
|
+
}
|
|
4489
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
4490
|
+
variant: "body1",
|
|
4491
|
+
gutterBottom: true
|
|
4492
|
+
}, "Select how this column will be formatted")), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
4493
|
+
container: true,
|
|
4494
|
+
spacing: 2,
|
|
4495
|
+
sx: {
|
|
4496
|
+
paddingTop: 2
|
|
4497
|
+
}
|
|
4498
|
+
}, /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
|
|
4499
|
+
id: 0,
|
|
4500
|
+
icon: /*#__PURE__*/_react["default"].createElement(_TextFieldsRounded["default"], null),
|
|
4501
|
+
text: "text"
|
|
4502
|
+
}), /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
|
|
4503
|
+
id: 1,
|
|
4504
|
+
icon: /*#__PURE__*/_react["default"].createElement(_LocalParkingRounded["default"], null),
|
|
4505
|
+
text: "Paragraph"
|
|
4506
|
+
}), /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
|
|
4507
|
+
id: 2,
|
|
4508
|
+
icon: /*#__PURE__*/_react["default"].createElement(_IntegrationInstructionsRounded["default"], null),
|
|
4509
|
+
text: "HTML"
|
|
4510
|
+
}), /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
|
|
4511
|
+
id: 3,
|
|
4512
|
+
icon: /*#__PURE__*/_react["default"].createElement(_system.Box, null, 123),
|
|
4513
|
+
text: "Integer"
|
|
4514
|
+
}), /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
|
|
4515
|
+
id: 4,
|
|
4516
|
+
icon: /*#__PURE__*/_react["default"].createElement(_system.Box, null, 10.23),
|
|
4517
|
+
text: "Decimal"
|
|
4518
|
+
}), /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
|
|
4519
|
+
id: 5,
|
|
4520
|
+
icon: /*#__PURE__*/_react["default"].createElement(_ListAltRounded["default"], null),
|
|
4521
|
+
text: "Dropdown"
|
|
4522
|
+
}), /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
|
|
4523
|
+
id: 6,
|
|
4524
|
+
icon: /*#__PURE__*/_react["default"].createElement(_CalendarMonthRounded["default"], null),
|
|
4525
|
+
text: "Date"
|
|
4526
|
+
}), /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
|
|
4527
|
+
id: 7,
|
|
4528
|
+
icon: /*#__PURE__*/_react["default"].createElement(_LinkRounded["default"], null),
|
|
4529
|
+
text: "URL"
|
|
4530
|
+
}), /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
|
|
4531
|
+
id: 8,
|
|
4532
|
+
icon: /*#__PURE__*/_react["default"].createElement(_CheckBoxRounded["default"], null),
|
|
4533
|
+
text: "Boolean"
|
|
4534
|
+
}), /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
|
|
4535
|
+
id: 9,
|
|
4536
|
+
icon: /*#__PURE__*/_react["default"].createElement(_InsertPhotoRounded["default"], null),
|
|
4537
|
+
text: "Photo"
|
|
4538
|
+
})))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4539
|
+
onClick: handleClose
|
|
4540
|
+
}, "Cancel"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4541
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
4542
|
+
var response;
|
|
4543
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
4544
|
+
while (1) switch (_context.prev = _context.next) {
|
|
4545
|
+
case 0:
|
|
4546
|
+
_context.next = 2;
|
|
4547
|
+
return apiService().post("/DocumentMapping/AddNewColumnAndMapping", {
|
|
4548
|
+
companyId: companyId,
|
|
4549
|
+
documentId: documentId,
|
|
4550
|
+
documentMappingId: documentMappingId,
|
|
4551
|
+
newColumn: newColumnNameRef.current.value,
|
|
4552
|
+
description: newColumnDescriptionRef.current.value,
|
|
4553
|
+
attributeFieldType: selectedAttributeId
|
|
4554
|
+
});
|
|
4555
|
+
case 2:
|
|
4556
|
+
response = _context.sent;
|
|
4557
|
+
if (response != null && response.status == 200) {
|
|
4558
|
+
handleClose();
|
|
4559
|
+
onResponse();
|
|
4560
|
+
}
|
|
4561
|
+
case 4:
|
|
4562
|
+
case "end":
|
|
4563
|
+
return _context.stop();
|
|
4564
|
+
}
|
|
4565
|
+
}, _callee);
|
|
4566
|
+
})),
|
|
4567
|
+
autoFocus: true
|
|
4568
|
+
}, "Create"))), documentType != null && documentType == 1 && /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4569
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_AddRounded["default"], null),
|
|
4570
|
+
size: "small",
|
|
4571
|
+
sx: {
|
|
4572
|
+
paddingLeft: 3
|
|
4573
|
+
},
|
|
4574
|
+
onClick: function onClick() {
|
|
4575
|
+
setCreateNewOpen(true);
|
|
4576
|
+
}
|
|
4577
|
+
}, "Create New Column"));
|
|
4578
|
+
}
|
|
4579
|
+
"use strict";
|
|
4580
|
+
|
|
4581
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4582
|
+
value: true
|
|
4583
|
+
});
|
|
4584
|
+
exports.SortableColumn = SortableColumn;
|
|
4585
|
+
var _react = _interopRequireDefault(require("react"));
|
|
4586
|
+
var _sortable = require("@dnd-kit/sortable");
|
|
4587
|
+
var _utilities = require("@dnd-kit/utilities");
|
|
4588
|
+
var _material = require("@mui/material");
|
|
4589
|
+
var _Menu = _interopRequireDefault(require("@mui/icons-material/Menu"));
|
|
4590
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
4591
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4592
|
+
function SortableColumn(props) {
|
|
4593
|
+
var _useSortable = (0, _sortable.useSortable)({
|
|
4594
|
+
id: props.id
|
|
4595
|
+
}),
|
|
4596
|
+
attributes = _useSortable.attributes,
|
|
4597
|
+
listeners = _useSortable.listeners,
|
|
4598
|
+
setNodeRef = _useSortable.setNodeRef,
|
|
4599
|
+
transform = _useSortable.transform,
|
|
4600
|
+
transition = _useSortable.transition;
|
|
4601
|
+
var style = {
|
|
4602
|
+
transform: _utilities.CSS.Transform.toString(transform),
|
|
4603
|
+
transition: transition
|
|
4604
|
+
};
|
|
4605
|
+
return /*#__PURE__*/_react["default"].createElement("div", _extends({
|
|
4606
|
+
ref: setNodeRef,
|
|
4607
|
+
style: style
|
|
4608
|
+
}, attributes, listeners), /*#__PURE__*/_react["default"].createElement(_material.ListItem, {
|
|
4609
|
+
disablePadding: true
|
|
4610
|
+
}, /*#__PURE__*/_react["default"].createElement(_material.ListItemButton, null, /*#__PURE__*/_react["default"].createElement(_material.ListItemIcon, null, /*#__PURE__*/_react["default"].createElement(_Menu["default"], null)), /*#__PURE__*/_react["default"].createElement(_material.ListItemText, {
|
|
4611
|
+
primary: props.id
|
|
4612
|
+
}))));
|
|
4613
|
+
}
|
|
4614
|
+
"use strict";
|
|
4615
|
+
|
|
4616
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4617
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4618
|
+
value: true
|
|
4619
|
+
});
|
|
4620
|
+
exports.UploadMappedFile = UploadMappedFile;
|
|
4621
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
4622
|
+
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
4623
|
+
var _system = require("@mui/system");
|
|
4624
|
+
var _PublishRounded = _interopRequireDefault(require("@mui/icons-material/PublishRounded"));
|
|
4625
|
+
var _Menu = _interopRequireDefault(require("@mui/material/Menu"));
|
|
4626
|
+
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
4627
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
4628
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
4629
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
4630
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
4631
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4632
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
4633
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4634
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4635
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4636
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
4637
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
4638
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import { apiService, FileUploader} from 'authscape';
|
|
4639
|
+
function UploadMappedFile(_ref) {
|
|
4640
|
+
var loadedUser = _ref.loadedUser,
|
|
4641
|
+
_ref$url = _ref.url,
|
|
4642
|
+
url = _ref$url === void 0 ? null : _ref$url,
|
|
4643
|
+
_ref$companyId = _ref.companyId,
|
|
4644
|
+
companyId = _ref$companyId === void 0 ? null : _ref$companyId,
|
|
4645
|
+
_ref$locationId = _ref.locationId,
|
|
4646
|
+
locationId = _ref$locationId === void 0 ? null : _ref$locationId,
|
|
4647
|
+
_ref$userId = _ref.userId,
|
|
4648
|
+
userId = _ref$userId === void 0 ? null : _ref$userId;
|
|
4649
|
+
var _useState = (0, _react.useState)(null),
|
|
4650
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
4651
|
+
documentComponentOptions = _useState2[0],
|
|
4652
|
+
setDocumentComponentOptions = _useState2[1];
|
|
4653
|
+
var _useState3 = (0, _react.useState)(null),
|
|
4654
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
4655
|
+
selectedDocumentComponentId = _useState4[0],
|
|
4656
|
+
setSelectedDocumentComponentId = _useState4[1];
|
|
4657
|
+
var _useState5 = (0, _react.useState)(null),
|
|
4658
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
4659
|
+
anchorEl = _useState6[0],
|
|
4660
|
+
setAnchorEl = _useState6[1];
|
|
4661
|
+
var open = Boolean(anchorEl);
|
|
4662
|
+
var handleClose = function handleClose() {
|
|
4663
|
+
setAnchorEl(null);
|
|
4664
|
+
};
|
|
4665
|
+
var fileUploaderRef = (0, _react.useRef)(null);
|
|
4666
|
+
(0, _react.useEffect)(function () {
|
|
4667
|
+
if (selectedDocumentComponentId != null) {
|
|
4668
|
+
// trigger the file uploader, make sure param is filled in
|
|
4669
|
+
fileUploaderRef.current.click();
|
|
4670
|
+
}
|
|
4671
|
+
}, [selectedDocumentComponentId]);
|
|
4672
|
+
(0, _react.useEffect)(function () {
|
|
4673
|
+
if (loadedUser) {
|
|
4674
|
+
var fetchData = /*#__PURE__*/function () {
|
|
4675
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
4676
|
+
var _params, response;
|
|
4677
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
4678
|
+
while (1) switch (_context.prev = _context.next) {
|
|
4679
|
+
case 0:
|
|
4680
|
+
_params = {};
|
|
4681
|
+
if (companyId != null) {
|
|
4682
|
+
_params.companyId = companyId;
|
|
4683
|
+
}
|
|
4684
|
+
if (userId != null) {
|
|
4685
|
+
_params.userId = userId;
|
|
4686
|
+
}
|
|
4687
|
+
if (locationId != null) {
|
|
4688
|
+
_params.locationId = locationId;
|
|
4689
|
+
}
|
|
4690
|
+
_context.next = 6;
|
|
4691
|
+
return apiService().post("/DocumentMapping/GetDocumentComponents", _params);
|
|
4692
|
+
case 6:
|
|
4693
|
+
response = _context.sent;
|
|
4694
|
+
if (response != null && response.status == 200) {
|
|
4695
|
+
setDocumentComponentOptions(response.data.data);
|
|
4696
|
+
}
|
|
4697
|
+
case 8:
|
|
4698
|
+
case "end":
|
|
4699
|
+
return _context.stop();
|
|
4700
|
+
}
|
|
4701
|
+
}, _callee);
|
|
4702
|
+
}));
|
|
4703
|
+
return function fetchData() {
|
|
4704
|
+
return _ref2.apply(this, arguments);
|
|
4705
|
+
};
|
|
4706
|
+
}();
|
|
4707
|
+
fetchData();
|
|
4708
|
+
}
|
|
4709
|
+
}, [loadedUser]);
|
|
4710
|
+
return /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(FileUploader, {
|
|
4711
|
+
refOveride: fileUploaderRef,
|
|
4712
|
+
params: {
|
|
4713
|
+
documentComponentId: selectedDocumentComponentId,
|
|
4714
|
+
companyId: companyId,
|
|
4715
|
+
locationId: locationId,
|
|
4716
|
+
userId: userId
|
|
4717
|
+
},
|
|
4718
|
+
url: url,
|
|
4719
|
+
multiple: false,
|
|
4720
|
+
variant: "custom",
|
|
4721
|
+
onUploadCompleted: function onUploadCompleted() {
|
|
4722
|
+
setSelectedDocumentComponentId(null); // we need an onUploadCancelled
|
|
4723
|
+
}
|
|
4724
|
+
}), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4725
|
+
id: "demo-positioned-button",
|
|
4726
|
+
"aria-controls": open ? 'demo-positioned-menu' : undefined,
|
|
4727
|
+
"aria-haspopup": "true",
|
|
4728
|
+
"aria-expanded": open ? 'true' : undefined,
|
|
4729
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_PublishRounded["default"], null),
|
|
4730
|
+
sx: {
|
|
4731
|
+
marginLeft: 1
|
|
4732
|
+
},
|
|
4733
|
+
onClick: function onClick(event) {
|
|
4734
|
+
setAnchorEl(event.currentTarget);
|
|
4735
|
+
}
|
|
4736
|
+
}, "Upload File(s)"), /*#__PURE__*/_react["default"].createElement(_Menu["default"], {
|
|
4737
|
+
id: "basic-menu",
|
|
4738
|
+
anchorEl: anchorEl,
|
|
4739
|
+
open: open,
|
|
4740
|
+
onClose: handleClose,
|
|
4741
|
+
MenuListProps: {
|
|
4742
|
+
'aria-labelledby': 'basic-button'
|
|
4743
|
+
}
|
|
4744
|
+
}, documentComponentOptions != null && documentComponentOptions.map(function (documentComponent) {
|
|
4745
|
+
return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
4746
|
+
onClick: function onClick() {
|
|
4747
|
+
// assigns the param document component id
|
|
4748
|
+
setSelectedDocumentComponentId(documentComponent.id);
|
|
4749
|
+
|
|
4750
|
+
// close the menu
|
|
4751
|
+
handleClose();
|
|
4752
|
+
}
|
|
4753
|
+
}, documentComponent.name + " (" + documentComponent.documentTypeName + ")");
|
|
4754
|
+
})));
|
|
4755
|
+
}
|
|
4756
|
+
"use strict";
|
|
4757
|
+
|
|
4758
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4759
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4760
|
+
value: true
|
|
4761
|
+
});
|
|
4762
|
+
exports.NextImage = void 0;
|
|
4763
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
4764
|
+
var _image = _interopRequireDefault(require("next/image"));
|
|
4765
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
4766
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
4767
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
4768
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
4769
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4770
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
4771
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4772
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4773
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4774
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
4775
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
4776
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
4777
|
+
var NextImage = function NextImage(_ref) {
|
|
4778
|
+
var src = _ref.src,
|
|
4779
|
+
alt = _ref.alt,
|
|
4780
|
+
_ref$width = _ref.width,
|
|
4781
|
+
width = _ref$width === void 0 ? 200 : _ref$width,
|
|
4782
|
+
_ref$height = _ref.height,
|
|
4783
|
+
height = _ref$height === void 0 ? 200 : _ref$height,
|
|
4784
|
+
_ref$objectFit = _ref.objectFit,
|
|
4785
|
+
objectFit = _ref$objectFit === void 0 ? "contain" : _ref$objectFit,
|
|
4786
|
+
_ref$enableAuth = _ref.enableAuth,
|
|
4787
|
+
enableAuth = _ref$enableAuth === void 0 ? false : _ref$enableAuth;
|
|
4788
|
+
var _useState = (0, _react.useState)(false),
|
|
4789
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
4790
|
+
imageError = _useState2[0],
|
|
4791
|
+
setImageError = _useState2[1];
|
|
4792
|
+
var _useState3 = (0, _react.useState)(null),
|
|
4793
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
4794
|
+
imageSrc = _useState4[0],
|
|
4795
|
+
setImageSrc = _useState4[1];
|
|
4796
|
+
(0, _react.useEffect)(function () {
|
|
4797
|
+
if (enableAuth) {
|
|
4798
|
+
var fetchData = /*#__PURE__*/function () {
|
|
4799
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
4800
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
4801
|
+
while (1) switch (_context.prev = _context.next) {
|
|
4802
|
+
case 0:
|
|
4803
|
+
_context.next = 2;
|
|
4804
|
+
return apiService().DownloadFile(src, "", function (data) {
|
|
4805
|
+
setImageSrc(data);
|
|
4806
|
+
}, true);
|
|
4807
|
+
case 2:
|
|
4808
|
+
case "end":
|
|
4809
|
+
return _context.stop();
|
|
4810
|
+
}
|
|
4811
|
+
}, _callee);
|
|
4812
|
+
}));
|
|
4813
|
+
return function fetchData() {
|
|
4814
|
+
return _ref2.apply(this, arguments);
|
|
4815
|
+
};
|
|
4816
|
+
}();
|
|
4817
|
+
fetchData();
|
|
4818
|
+
}
|
|
4819
|
+
}, [enableAuth]);
|
|
4820
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, enableAuth && imageSrc != null && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_image["default"], {
|
|
4821
|
+
src: imageError ? process.env.fallbackImageSrc : imageSrc,
|
|
4822
|
+
alt: alt,
|
|
4823
|
+
width: width,
|
|
4824
|
+
height: height,
|
|
4825
|
+
style: {
|
|
4826
|
+
objectFit: objectFit
|
|
4827
|
+
},
|
|
4828
|
+
onError: function onError() {
|
|
4829
|
+
return setImageError(true);
|
|
4830
|
+
}
|
|
4831
|
+
})), !enableAuth && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_image["default"], {
|
|
4832
|
+
src: imageError ? process.env.fallbackImageSrc : src,
|
|
4833
|
+
alt: alt,
|
|
4834
|
+
width: width,
|
|
4835
|
+
height: height,
|
|
4836
|
+
style: {
|
|
4837
|
+
objectFit: objectFit
|
|
4838
|
+
},
|
|
4839
|
+
onError: function onError() {
|
|
4840
|
+
return setImageError(true);
|
|
4841
|
+
}
|
|
4842
|
+
})));
|
|
4843
|
+
};
|
|
4844
|
+
exports.NextImage = NextImage;
|
|
4845
|
+
"use strict";
|
|
4846
|
+
|
|
4847
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4848
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4849
|
+
value: true
|
|
4850
|
+
});
|
|
4851
|
+
exports.PageToPDF = void 0;
|
|
4852
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
4853
|
+
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
4854
|
+
var _html2canvas = _interopRequireDefault(require("html2canvas"));
|
|
4855
|
+
var _jspdf = require("jspdf");
|
|
4856
|
+
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
4857
|
+
var _DownloadRounded = _interopRequireDefault(require("@mui/icons-material/DownloadRounded"));
|
|
4858
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
4859
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
4860
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
4861
|
+
var PageToPDF = function PageToPDF(_ref) {
|
|
4862
|
+
var _ref$buttonText = _ref.buttonText,
|
|
4863
|
+
buttonText = _ref$buttonText === void 0 ? "Download" : _ref$buttonText,
|
|
4864
|
+
_ref$startIcon = _ref.startIcon,
|
|
4865
|
+
startIcon = _ref$startIcon === void 0 ? /*#__PURE__*/_react["default"].createElement(_DownloadRounded["default"], null) : _ref$startIcon,
|
|
4866
|
+
_ref$variant = _ref.variant,
|
|
4867
|
+
variant = _ref$variant === void 0 ? "contained" : _ref$variant,
|
|
4868
|
+
elementById = _ref.elementById,
|
|
4869
|
+
_ref$scale = _ref.scale,
|
|
4870
|
+
scale = _ref$scale === void 0 ? 2 : _ref$scale,
|
|
4871
|
+
_ref$showHideClassEle = _ref.showHideClassElements,
|
|
4872
|
+
showHideClassElements = _ref$showHideClassEle === void 0 ? [] : _ref$showHideClassEle,
|
|
4873
|
+
_ref$fileName = _ref.fileName,
|
|
4874
|
+
fileName = _ref$fileName === void 0 ? "download" : _ref$fileName;
|
|
4875
|
+
var onHideElements = function onHideElements() {
|
|
4876
|
+
for (var index = 0; index < showHideClassElements.length; index++) {
|
|
4877
|
+
var element = showHideClassElements[index];
|
|
4878
|
+
var elements = document.getElementsByClassName(element);
|
|
4879
|
+
for (var i = 0; i < elements.length; i++) {
|
|
4880
|
+
elements[i].style.display = "none";
|
|
4881
|
+
}
|
|
4882
|
+
}
|
|
4883
|
+
};
|
|
4884
|
+
var onShowElements = function onShowElements() {
|
|
4885
|
+
for (var index = 0; index < showHideClassElements.length; index++) {
|
|
4886
|
+
var element = showHideClassElements[index];
|
|
4887
|
+
var elements = document.getElementsByClassName(element);
|
|
4888
|
+
for (var i = 0; i < elements.length; i++) {
|
|
4889
|
+
elements[i].style.display = "block";
|
|
4890
|
+
}
|
|
4891
|
+
}
|
|
4892
|
+
};
|
|
4893
|
+
var printElement = function printElement() {
|
|
4894
|
+
onHideElements();
|
|
4895
|
+
var input = document.getElementById(elementById);
|
|
4896
|
+
(0, _html2canvas["default"])(input, {
|
|
4897
|
+
backgroundColor: null,
|
|
4898
|
+
scale: scale
|
|
4899
|
+
}).then(function (canvas) {
|
|
4900
|
+
var imgData = canvas.toDataURL("image/png", 1.0);
|
|
4901
|
+
var pdf = new _jspdf.jsPDF();
|
|
4902
|
+
var pdfWidth = pdf.internal.pageSize.getWidth();
|
|
4903
|
+
var pdfHeight = pdf.internal.pageSize.getHeight();
|
|
4904
|
+
var imgWidth = canvas.width;
|
|
4905
|
+
var imgHeight = canvas.height;
|
|
4906
|
+
var scaleFactor = Math.min(pdfWidth / imgWidth, pdfHeight / imgHeight);
|
|
4907
|
+
var scaledWidth = imgWidth * scaleFactor;
|
|
4908
|
+
var scaledHeight = imgHeight * scaleFactor;
|
|
4909
|
+
var x = (pdfWidth - scaledWidth) / 2;
|
|
4910
|
+
var y = 0; // Set y coordinate to 0 to align to the top
|
|
4911
|
+
pdf.addImage(imgData, "PNG", x, y, scaledWidth, scaledHeight);
|
|
4912
|
+
pdf.save(fileName + ".pdf");
|
|
4913
|
+
});
|
|
4914
|
+
onShowElements();
|
|
4915
|
+
};
|
|
4916
|
+
return /*#__PURE__*/_react["default"].createElement(_Box["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4917
|
+
startIcon: startIcon,
|
|
4918
|
+
variant: variant,
|
|
4919
|
+
onClick: function onClick() {
|
|
4920
|
+
printElement();
|
|
4921
|
+
}
|
|
4922
|
+
}, buttonText));
|
|
4923
|
+
};
|
|
4924
|
+
exports.PageToPDF = PageToPDF;
|
|
4925
|
+
"use strict";
|
|
4926
|
+
|
|
4927
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4928
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4929
|
+
value: true
|
|
4930
|
+
});
|
|
4931
|
+
exports.Pricing = Pricing;
|
|
4932
|
+
var _react = _interopRequireDefault(require("react"));
|
|
4933
|
+
var _system = require("@mui/system");
|
|
4934
|
+
var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
|
|
4935
|
+
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
4936
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
4937
|
+
var _ChevronRightRounded = _interopRequireDefault(require("@mui/icons-material/ChevronRightRounded"));
|
|
4938
|
+
var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
|
|
4939
|
+
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
4940
|
+
var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
|
|
4941
|
+
var _Select = _interopRequireDefault(require("@mui/material/Select"));
|
|
4942
|
+
var _reactHookForm = require("react-hook-form");
|
|
4943
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
4944
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
4945
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4946
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
4947
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4948
|
+
function Pricing(_ref) {
|
|
4949
|
+
var _ref$title = _ref.title,
|
|
4950
|
+
title = _ref$title === void 0 ? null : _ref$title,
|
|
4951
|
+
_ref$tiers = _ref.tiers,
|
|
4952
|
+
tiers = _ref$tiers === void 0 ? [] : _ref$tiers,
|
|
4953
|
+
_ref$features = _ref.features,
|
|
4954
|
+
features = _ref$features === void 0 ? null : _ref$features,
|
|
4955
|
+
_ref$onButtonClicked = _ref.onButtonClicked,
|
|
4956
|
+
onButtonClicked = _ref$onButtonClicked === void 0 ? null : _ref$onButtonClicked;
|
|
4957
|
+
var _useForm = (0, _reactHookForm.useForm)(),
|
|
4958
|
+
control = _useForm.control,
|
|
4959
|
+
register = _useForm.register,
|
|
4960
|
+
handleSubmit = _useForm.handleSubmit,
|
|
4961
|
+
errors = _useForm.formState.errors,
|
|
4962
|
+
watch = _useForm.watch,
|
|
4963
|
+
setValue = _useForm.setValue;
|
|
4964
|
+
var calculateQty = function calculateQty(qty) {
|
|
4965
|
+
var newMax = qty.minQty + qty.maxQty;
|
|
4966
|
+
var menuItemArray = [];
|
|
4967
|
+
var newIndex = 1;
|
|
4968
|
+
for (var index = qty.minQty; index < newMax; index++) {
|
|
4969
|
+
menuItemArray[newIndex] = newIndex;
|
|
4970
|
+
newIndex++;
|
|
4971
|
+
}
|
|
4972
|
+
return menuItemArray;
|
|
4973
|
+
};
|
|
4974
|
+
return /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4975
|
+
sx: {
|
|
4976
|
+
paddingTop: 2
|
|
4977
|
+
}
|
|
4978
|
+
}, /*#__PURE__*/_react["default"].createElement("form", null, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
4979
|
+
container: true,
|
|
4980
|
+
spacing: 0,
|
|
4981
|
+
justifyContent: "center",
|
|
4982
|
+
alignItems: "stretch",
|
|
4983
|
+
direction: "row"
|
|
4984
|
+
}, title != null && /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
4985
|
+
item: true,
|
|
4986
|
+
xs: 12,
|
|
4987
|
+
sm: 6,
|
|
4988
|
+
md: 3,
|
|
4989
|
+
key: "plans"
|
|
4990
|
+
}, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
4991
|
+
variant: "h4",
|
|
4992
|
+
gutterBottom: true
|
|
4993
|
+
}, title)), tiers.map(function (tier) {
|
|
4994
|
+
return /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
4995
|
+
item: true,
|
|
4996
|
+
xs: 12,
|
|
4997
|
+
sm: 6,
|
|
4998
|
+
md: 3,
|
|
4999
|
+
key: tier.title
|
|
5000
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
5001
|
+
sx: {
|
|
5002
|
+
paddingBottom: 2,
|
|
5003
|
+
padding: 2
|
|
5004
|
+
}
|
|
5005
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
5006
|
+
sx: {
|
|
5007
|
+
textAlign: "center",
|
|
5008
|
+
paddingTop: 2
|
|
5009
|
+
}
|
|
5010
|
+
}, tier.image != null && /*#__PURE__*/_react["default"].createElement("img", {
|
|
5011
|
+
src: tier.image,
|
|
5012
|
+
width: 200,
|
|
5013
|
+
height: 200
|
|
5014
|
+
}), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
5015
|
+
variant: "h3",
|
|
5016
|
+
component: "h2",
|
|
5017
|
+
sx: {
|
|
5018
|
+
paddingTop: 3
|
|
5019
|
+
}
|
|
5020
|
+
}, tier.title), tier.subTitle && /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
5021
|
+
variant: "h6",
|
|
5022
|
+
component: "h2",
|
|
5023
|
+
sx: {
|
|
5024
|
+
paddingTop: 2
|
|
5025
|
+
}
|
|
5026
|
+
}, tier.subTitle), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
5027
|
+
container: true,
|
|
5028
|
+
spacing: 0
|
|
5029
|
+
}, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
5030
|
+
item: true,
|
|
5031
|
+
xs: tier.qty != null ? 6 : 12,
|
|
5032
|
+
sx: {
|
|
5033
|
+
padding: 4
|
|
5034
|
+
}
|
|
5035
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
5036
|
+
component: "span",
|
|
5037
|
+
sx: {
|
|
5038
|
+
fontSize: 30,
|
|
5039
|
+
fontWeight: "bold"
|
|
5040
|
+
}
|
|
5041
|
+
}, "$", tier.price), tier.duration != null && /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
5042
|
+
component: "span"
|
|
5043
|
+
}, "/ ", tier.duration)), tier.qty != null && /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
5044
|
+
item: true,
|
|
5045
|
+
xs: 6,
|
|
5046
|
+
sx: {
|
|
5047
|
+
padding: 4
|
|
5048
|
+
}
|
|
5049
|
+
}, /*#__PURE__*/_react["default"].createElement(_reactHookForm.Controller, {
|
|
5050
|
+
name: "qty-" + tier.id,
|
|
5051
|
+
control: control,
|
|
5052
|
+
rules: {
|
|
5053
|
+
required: false
|
|
5054
|
+
},
|
|
5055
|
+
render: function render(_ref2) {
|
|
5056
|
+
var renderField = _ref2.renderField;
|
|
5057
|
+
return /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
|
|
5058
|
+
fullWidth: true
|
|
5059
|
+
}, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
|
|
5060
|
+
id: "demo-simple-select-label"
|
|
5061
|
+
}, "Quantity"), /*#__PURE__*/_react["default"].createElement(_Select["default"], _extends({}, register("qty-" + tier.id, {
|
|
5062
|
+
required: false
|
|
5063
|
+
}), renderField, {
|
|
5064
|
+
labelId: "demo-simple-select-label",
|
|
5065
|
+
id: "demo-simple-select",
|
|
5066
|
+
defaultValue: 1,
|
|
5067
|
+
label: "Quantity"
|
|
5068
|
+
}), calculateQty(tier.qty).map(function (menuItem, index) {
|
|
5069
|
+
return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
5070
|
+
key: index,
|
|
5071
|
+
value: menuItem
|
|
5072
|
+
}, menuItem);
|
|
5073
|
+
})));
|
|
5074
|
+
}
|
|
5075
|
+
}))), tier.modifiers != null && /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
5076
|
+
sx: {
|
|
5077
|
+
paddingBottom: 2
|
|
5078
|
+
}
|
|
5079
|
+
}, tier.modifiers.map(function (modifier, index) {
|
|
5080
|
+
return /*#__PURE__*/_react["default"].createElement(_reactHookForm.Controller, {
|
|
5081
|
+
name: "modifier-" + tier.id + modifier.name,
|
|
5082
|
+
control: control,
|
|
5083
|
+
rules: {
|
|
5084
|
+
required: false
|
|
5085
|
+
},
|
|
5086
|
+
render: function render(_ref3) {
|
|
5087
|
+
var renderField = _ref3.renderField;
|
|
5088
|
+
return /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
|
|
5089
|
+
fullWidth: true,
|
|
5090
|
+
key: index,
|
|
5091
|
+
sx: {
|
|
5092
|
+
marginTop: 2
|
|
5093
|
+
}
|
|
5094
|
+
}, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
|
|
5095
|
+
id: "demo-simple-select-label"
|
|
5096
|
+
}, modifier.name), /*#__PURE__*/_react["default"].createElement(_Select["default"], _extends({}, register("modifier-" + tier.id + "-" + modifier.name, {
|
|
5097
|
+
required: false
|
|
5098
|
+
}), renderField, {
|
|
5099
|
+
labelId: "demo-simple-select-label",
|
|
5100
|
+
id: "demo-simple-select",
|
|
5101
|
+
defaultValue: 0,
|
|
5102
|
+
label: modifier.name
|
|
5103
|
+
}), modifier.options.map(function (mod, index) {
|
|
5104
|
+
return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
5105
|
+
key: index,
|
|
5106
|
+
value: index
|
|
5107
|
+
}, mod);
|
|
5108
|
+
})));
|
|
5109
|
+
}
|
|
5110
|
+
});
|
|
5111
|
+
})), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
5112
|
+
fullWidth: true,
|
|
5113
|
+
variant: tier.buttonVariant,
|
|
5114
|
+
endIcon: /*#__PURE__*/_react["default"].createElement(_ChevronRightRounded["default"], null),
|
|
5115
|
+
sx: {
|
|
5116
|
+
height: 50
|
|
5117
|
+
},
|
|
5118
|
+
onClick: handleSubmit( /*#__PURE__*/function () {
|
|
5119
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
|
|
5120
|
+
var modifiers, qty, index, modifier;
|
|
5121
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
5122
|
+
while (1) switch (_context.prev = _context.next) {
|
|
5123
|
+
case 0:
|
|
5124
|
+
modifiers = {};
|
|
5125
|
+
qty = null;
|
|
5126
|
+
if (tier.modifiers != null) {
|
|
5127
|
+
for (index = 0; index < tier.modifiers.length; index++) {
|
|
5128
|
+
modifier = tier.modifiers[index]; // assign the modifier as a property
|
|
5129
|
+
modifiers[modifier.name] = data["modifier-" + tier.id + "-" + modifier.name];
|
|
5130
|
+
}
|
|
5131
|
+
}
|
|
5132
|
+
if (tier.qty != null) {
|
|
5133
|
+
qty = parseInt(data["qty-" + tier.id]);
|
|
5134
|
+
}
|
|
5135
|
+
if (onButtonClicked != null) {
|
|
5136
|
+
onButtonClicked({
|
|
5137
|
+
id: tier.id,
|
|
5138
|
+
modifiers: modifiers,
|
|
5139
|
+
qty: qty
|
|
5140
|
+
});
|
|
5141
|
+
}
|
|
5142
|
+
case 5:
|
|
5143
|
+
case "end":
|
|
5144
|
+
return _context.stop();
|
|
5145
|
+
}
|
|
5146
|
+
}, _callee);
|
|
5147
|
+
}));
|
|
5148
|
+
return function (_x) {
|
|
5149
|
+
return _ref4.apply(this, arguments);
|
|
5150
|
+
};
|
|
5151
|
+
}())
|
|
5152
|
+
}, tier.buttonText), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
5153
|
+
variant: "body2",
|
|
5154
|
+
sx: {
|
|
5155
|
+
paddingTop: 2,
|
|
5156
|
+
fontSize: 16,
|
|
5157
|
+
textAlign: "left",
|
|
5158
|
+
lineHeight: "1.5rem"
|
|
5159
|
+
}
|
|
5160
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
5161
|
+
dangerouslySetInnerHTML: {
|
|
5162
|
+
__html: tier.description
|
|
5163
|
+
}
|
|
5164
|
+
})))));
|
|
5165
|
+
})), features != null && /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
5166
|
+
sx: {
|
|
5167
|
+
paddingTop: 1
|
|
5168
|
+
}
|
|
5169
|
+
}, features.map(function (feature) {
|
|
5170
|
+
return /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
5171
|
+
sx: {
|
|
5172
|
+
backgroundColor: "lightgray",
|
|
5173
|
+
padding: 1,
|
|
5174
|
+
borderRadius: 2
|
|
5175
|
+
}
|
|
5176
|
+
}, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
5177
|
+
variant: "h5",
|
|
5178
|
+
gutterBottom: true
|
|
5179
|
+
}, feature.name)), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
5180
|
+
container: true,
|
|
5181
|
+
spacing: 0,
|
|
5182
|
+
justifyContent: "center"
|
|
5183
|
+
}, feature.subfeatures.map(function (subfeature, subFeatureIndex) {
|
|
5184
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, subfeature.map(function (item, index) {
|
|
5185
|
+
return /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
5186
|
+
item: true,
|
|
5187
|
+
xs: 3,
|
|
5188
|
+
key: subfeature
|
|
5189
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
5190
|
+
sx: {
|
|
5191
|
+
padding: 2,
|
|
5192
|
+
height: 60,
|
|
5193
|
+
paddingTop: subFeatureIndex == 0 ? 3 : 2,
|
|
5194
|
+
textAlign: index == 0 ? "left" : "center"
|
|
5195
|
+
}
|
|
5196
|
+
}, item), feature.subfeatures.length - 1 != subFeatureIndex ? /*#__PURE__*/_react["default"].createElement("hr", null) : "");
|
|
5197
|
+
}));
|
|
5198
|
+
})));
|
|
5199
|
+
}))));
|
|
5200
|
+
}
|
|
5201
|
+
"use strict";
|
|
5202
|
+
|
|
5203
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
5204
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5205
|
+
value: true
|
|
5206
|
+
});
|
|
5207
|
+
exports.AddDomain = AddDomain;
|
|
5208
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
5209
|
+
var _system = require("@mui/system");
|
|
5210
|
+
var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
|
|
5211
|
+
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
5212
|
+
var _styles = require("@mui/material/styles");
|
|
5213
|
+
var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
|
|
5214
|
+
var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
|
|
5215
|
+
var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
|
|
5216
|
+
var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions"));
|
|
5217
|
+
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
5218
|
+
var _Close = _interopRequireDefault(require("@mui/icons-material/Close"));
|
|
5219
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
5220
|
+
var _Stepper = _interopRequireDefault(require("@mui/material/Stepper"));
|
|
5221
|
+
var _Step = _interopRequireDefault(require("@mui/material/Step"));
|
|
5222
|
+
var _StepLabel = _interopRequireDefault(require("@mui/material/StepLabel"));
|
|
5223
|
+
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
5224
|
+
var _FmdBadRounded = _interopRequireDefault(require("@mui/icons-material/FmdBadRounded"));
|
|
5225
|
+
var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
|
|
5226
|
+
var _Select = _interopRequireDefault(require("@mui/material/Select"));
|
|
5227
|
+
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
5228
|
+
var _ContentCopyRounded = _interopRequireDefault(require("@mui/icons-material/ContentCopyRounded"));
|
|
5229
|
+
var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
|
|
5230
|
+
var _material = require("@mui/material");
|
|
5231
|
+
var _excluded = ["children", "onClose"];
|
|
5232
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
5233
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
5234
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
5235
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5236
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
5237
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5238
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
5239
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
5240
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5241
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5242
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5243
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5244
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5245
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
5246
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import { apiService } from 'authscape';
|
|
5247
|
+
function AddDomain(_ref) {
|
|
5248
|
+
var open = _ref.open,
|
|
5249
|
+
azureWebsite = _ref.azureWebsite,
|
|
5250
|
+
azureTxtValue = _ref.azureTxtValue,
|
|
5251
|
+
handleClose = _ref.handleClose;
|
|
5252
|
+
var steps = ['Enter a domain', 'Setup DNS Record', 'Go Live'];
|
|
5253
|
+
var _useState = (0, _react.useState)(0),
|
|
5254
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
5255
|
+
activeStep = _useState2[0],
|
|
5256
|
+
setActiveStep = _useState2[1];
|
|
5257
|
+
var _useState3 = (0, _react.useState)({}),
|
|
5258
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
5259
|
+
completed = _useState4[0],
|
|
5260
|
+
setCompleted = _useState4[1];
|
|
5261
|
+
|
|
5262
|
+
// const [domain, setDomain] = useState(null);
|
|
5263
|
+
var _useState5 = (0, _react.useState)(null),
|
|
5264
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
5265
|
+
subDomains = _useState6[0],
|
|
5266
|
+
setSubDomains = _useState6[1];
|
|
5267
|
+
// const [topLevelDomains , setTopLevelDomains ] = useState(null);
|
|
5268
|
+
|
|
5269
|
+
var _useState7 = (0, _react.useState)(null),
|
|
5270
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
5271
|
+
fullDomain = _useState8[0],
|
|
5272
|
+
setFullDomain = _useState8[1];
|
|
5273
|
+
var _useState9 = (0, _react.useState)(null),
|
|
5274
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
5275
|
+
errorMessage = _useState10[0],
|
|
5276
|
+
setErrorMessage = _useState10[1];
|
|
5277
|
+
var refDomain = (0, _react.useRef)(null);
|
|
5278
|
+
var refCNameTarget = (0, _react.useRef)(null);
|
|
5279
|
+
var reftxtTarget = (0, _react.useRef)(null);
|
|
5280
|
+
var refCNameName = (0, _react.useRef)(null);
|
|
5281
|
+
var reftxtName = (0, _react.useRef)(null);
|
|
5282
|
+
var totalSteps = function totalSteps() {
|
|
5283
|
+
return steps.length;
|
|
5284
|
+
};
|
|
5285
|
+
var completedSteps = function completedSteps() {
|
|
5286
|
+
return Object.keys(completed).length;
|
|
5287
|
+
};
|
|
5288
|
+
var isLastStep = function isLastStep() {
|
|
5289
|
+
return activeStep === totalSteps() - 1;
|
|
5290
|
+
};
|
|
5291
|
+
var allStepsCompleted = function allStepsCompleted() {
|
|
5292
|
+
return completedSteps() === totalSteps();
|
|
5293
|
+
};
|
|
5294
|
+
var handleNext = function handleNext() {
|
|
5295
|
+
var newActiveStep = isLastStep() && !allStepsCompleted() ?
|
|
5296
|
+
// It's the last step, but not all steps have been completed,
|
|
5297
|
+
// find the first step that has been completed
|
|
5298
|
+
steps.findIndex(function (step, i) {
|
|
5299
|
+
return !(i in completed);
|
|
5300
|
+
}) : activeStep + 1;
|
|
5301
|
+
setActiveStep(newActiveStep);
|
|
5302
|
+
};
|
|
5303
|
+
var handleBack = function handleBack() {
|
|
5304
|
+
setActiveStep(function (prevActiveStep) {
|
|
5305
|
+
return prevActiveStep - 1;
|
|
5306
|
+
});
|
|
5307
|
+
};
|
|
5308
|
+
var getSubdomain = function getSubdomain(hostName) {
|
|
5309
|
+
var host = hostName; // e.g., subdomain.example.com
|
|
5310
|
+
var parts = host.split('.');
|
|
5311
|
+
if (parts.length > 2) {
|
|
5312
|
+
return parts[0]; // This will be 'subdomain'
|
|
5313
|
+
}
|
|
5314
|
+
|
|
5315
|
+
return null; // No subdomain found
|
|
5316
|
+
};
|
|
5317
|
+
|
|
5318
|
+
var handleStep = function handleStep(step) {
|
|
5319
|
+
return function () {
|
|
5320
|
+
setActiveStep(step);
|
|
5321
|
+
};
|
|
5322
|
+
};
|
|
5323
|
+
var handleComplete = function handleComplete() {
|
|
5324
|
+
var newCompleted = completed;
|
|
5325
|
+
newCompleted[activeStep] = true;
|
|
5326
|
+
setCompleted(newCompleted);
|
|
5327
|
+
handleNext();
|
|
5328
|
+
};
|
|
5329
|
+
var BootstrapDialog = (0, _styles.styled)(_Dialog["default"])(function (_ref2) {
|
|
5330
|
+
var theme = _ref2.theme;
|
|
5331
|
+
return {
|
|
5332
|
+
'& .MuiDialogContent-root': {
|
|
5333
|
+
padding: theme.spacing(2)
|
|
5334
|
+
},
|
|
5335
|
+
'& .MuiDialogActions-root': {
|
|
5336
|
+
padding: theme.spacing(1)
|
|
5337
|
+
}
|
|
5338
|
+
};
|
|
5339
|
+
});
|
|
5340
|
+
var handleReset = function handleReset() {
|
|
5341
|
+
setActiveStep(0);
|
|
5342
|
+
setCompleted({});
|
|
5343
|
+
};
|
|
5344
|
+
var createTheDomainRequest = /*#__PURE__*/function () {
|
|
5345
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
5346
|
+
var response, aStep;
|
|
5347
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
5348
|
+
while (1) switch (_context.prev = _context.next) {
|
|
5349
|
+
case 0:
|
|
5350
|
+
if (!(fullDomain == null || fullDomain == "")) {
|
|
5351
|
+
_context.next = 2;
|
|
5352
|
+
break;
|
|
5353
|
+
}
|
|
5354
|
+
return _context.abrupt("return");
|
|
5355
|
+
case 2:
|
|
5356
|
+
_context.next = 4;
|
|
5357
|
+
return apiService().post("/PrivateLabel/GenerateDomain", {
|
|
5358
|
+
hostName: fullDomain
|
|
5359
|
+
});
|
|
5360
|
+
case 4:
|
|
5361
|
+
response = _context.sent;
|
|
5362
|
+
if (response != null && response.status == 200) {
|
|
5363
|
+
if (handleClose != null) {
|
|
5364
|
+
handleClose();
|
|
5365
|
+
}
|
|
5366
|
+
} else {
|
|
5367
|
+
aStep = activeStep - 1;
|
|
5368
|
+
setActiveStep(aStep);
|
|
5369
|
+
setErrorMessage(response.data);
|
|
5370
|
+
}
|
|
5371
|
+
case 6:
|
|
5372
|
+
case "end":
|
|
5373
|
+
return _context.stop();
|
|
5374
|
+
}
|
|
5375
|
+
}, _callee);
|
|
5376
|
+
}));
|
|
5377
|
+
return function createTheDomainRequest() {
|
|
5378
|
+
return _ref3.apply(this, arguments);
|
|
5379
|
+
};
|
|
5380
|
+
}();
|
|
5381
|
+
(0, _react.useEffect)(function () {
|
|
5382
|
+
if (activeStep == 2) {
|
|
5383
|
+
createTheDomainRequest();
|
|
5384
|
+
}
|
|
5385
|
+
}, [activeStep]);
|
|
5386
|
+
var copyToClipboard = /*#__PURE__*/function () {
|
|
5387
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(text) {
|
|
5388
|
+
var permissions;
|
|
5389
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
5390
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
5391
|
+
case 0:
|
|
5392
|
+
_context2.prev = 0;
|
|
5393
|
+
_context2.next = 3;
|
|
5394
|
+
return navigator.permissions.query({
|
|
5395
|
+
name: "clipboard-write"
|
|
5396
|
+
});
|
|
5397
|
+
case 3:
|
|
5398
|
+
permissions = _context2.sent;
|
|
5399
|
+
if (!(permissions.state === "granted" || permissions.state === "prompt")) {
|
|
5400
|
+
_context2.next = 9;
|
|
5401
|
+
break;
|
|
5402
|
+
}
|
|
5403
|
+
_context2.next = 7;
|
|
5404
|
+
return navigator.clipboard.writeText(text);
|
|
5405
|
+
case 7:
|
|
5406
|
+
_context2.next = 10;
|
|
5407
|
+
break;
|
|
5408
|
+
case 9:
|
|
5409
|
+
throw new Error("Can't access the clipboard. Check your browser permissions.");
|
|
5410
|
+
case 10:
|
|
5411
|
+
_context2.next = 15;
|
|
5412
|
+
break;
|
|
5413
|
+
case 12:
|
|
5414
|
+
_context2.prev = 12;
|
|
5415
|
+
_context2.t0 = _context2["catch"](0);
|
|
5416
|
+
alert('Error copying to clipboard:', _context2.t0);
|
|
5417
|
+
case 15:
|
|
5418
|
+
case "end":
|
|
5419
|
+
return _context2.stop();
|
|
5420
|
+
}
|
|
5421
|
+
}, _callee2, null, [[0, 12]]);
|
|
5422
|
+
}));
|
|
5423
|
+
return function copyToClipboard(_x2) {
|
|
5424
|
+
return _ref4.apply(this, arguments);
|
|
5425
|
+
};
|
|
5426
|
+
}();
|
|
5427
|
+
function BootstrapDialogTitle(props) {
|
|
5428
|
+
var children = props.children,
|
|
5429
|
+
onClose = props.onClose,
|
|
5430
|
+
other = _objectWithoutProperties(props, _excluded);
|
|
5431
|
+
return /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], _extends({
|
|
5432
|
+
sx: {
|
|
5433
|
+
m: 0,
|
|
5434
|
+
p: 2
|
|
2977
5435
|
}
|
|
2978
|
-
}, /*#__PURE__*/_react["default"].createElement("
|
|
2979
|
-
|
|
2980
|
-
|
|
5436
|
+
}, other), children, onClose ? /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
|
|
5437
|
+
"aria-label": "close",
|
|
5438
|
+
onClick: onClose,
|
|
5439
|
+
sx: {
|
|
5440
|
+
position: 'absolute',
|
|
5441
|
+
right: 8,
|
|
5442
|
+
top: 8,
|
|
5443
|
+
color: function color(theme) {
|
|
5444
|
+
return theme.palette.grey[500];
|
|
5445
|
+
}
|
|
2981
5446
|
}
|
|
2982
|
-
})))
|
|
2983
|
-
}
|
|
5447
|
+
}, /*#__PURE__*/_react["default"].createElement(_Close["default"], null)) : null);
|
|
5448
|
+
}
|
|
5449
|
+
return /*#__PURE__*/_react["default"].createElement(BootstrapDialog, {
|
|
5450
|
+
onClose: handleClose,
|
|
5451
|
+
"aria-labelledby": "customized-dialog-title",
|
|
5452
|
+
sx: {
|
|
5453
|
+
backgroundColor: "rgba(0, 0, 0, 0.6)"
|
|
5454
|
+
},
|
|
5455
|
+
fullWidth: true,
|
|
5456
|
+
maxWidth: "md",
|
|
5457
|
+
open: open
|
|
5458
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
5459
|
+
sx: {
|
|
5460
|
+
padding: 4
|
|
5461
|
+
}
|
|
5462
|
+
}, /*#__PURE__*/_react["default"].createElement(_Stepper["default"], {
|
|
5463
|
+
activeStep: activeStep,
|
|
5464
|
+
alternativeLabel: true
|
|
5465
|
+
}, steps.map(function (label) {
|
|
5466
|
+
return /*#__PURE__*/_react["default"].createElement(_Step["default"], {
|
|
5467
|
+
key: label
|
|
5468
|
+
}, /*#__PURE__*/_react["default"].createElement(_StepLabel["default"], {
|
|
5469
|
+
sx: {
|
|
5470
|
+
color: "#fff"
|
|
5471
|
+
}
|
|
5472
|
+
}, label));
|
|
5473
|
+
})), activeStep == 0 && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(BootstrapDialogTitle, {
|
|
5474
|
+
id: "customized-dialog-title",
|
|
5475
|
+
onClose: handleClose,
|
|
5476
|
+
sx: {
|
|
5477
|
+
textAlign: "center",
|
|
5478
|
+
fontSize: 30,
|
|
5479
|
+
marginTop: 2,
|
|
5480
|
+
lineHeight: 1
|
|
5481
|
+
}
|
|
5482
|
+
}, "What domain would you like to connect to ", process.env.companyName, "?"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
5483
|
+
inputRef: refDomain,
|
|
5484
|
+
id: "domainTxt",
|
|
5485
|
+
label: "Enter subdomain URL e.g catalog.mydomain.com",
|
|
5486
|
+
fullWidth: true,
|
|
5487
|
+
variant: "outlined",
|
|
5488
|
+
sx: {
|
|
5489
|
+
color: "white",
|
|
5490
|
+
marginTop: 2
|
|
5491
|
+
}
|
|
5492
|
+
})), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
5493
|
+
sx: {
|
|
5494
|
+
marginTop: 2
|
|
5495
|
+
}
|
|
5496
|
+
}, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
5497
|
+
gutterBottom: true,
|
|
5498
|
+
sx: {
|
|
5499
|
+
textAlign: "center",
|
|
5500
|
+
fontSize: 14
|
|
5501
|
+
}
|
|
5502
|
+
}, /*#__PURE__*/_react["default"].createElement(_FmdBadRounded["default"], {
|
|
5503
|
+
sx: {
|
|
5504
|
+
color: "#1976d2",
|
|
5505
|
+
position: "relative",
|
|
5506
|
+
top: 8
|
|
5507
|
+
}
|
|
5508
|
+
}), " You must own the domain and have the ability to add records"))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
5509
|
+
variant: "contained",
|
|
5510
|
+
onClick: function onClick() {
|
|
5511
|
+
if (refDomain.current.value == "") {
|
|
5512
|
+
return;
|
|
5513
|
+
}
|
|
5514
|
+
setFullDomain(refDomain.current.value);
|
|
5515
|
+
var _subDomain = getSubdomain(refDomain.current.value);
|
|
5516
|
+
setSubDomains(_subDomain);
|
|
5517
|
+
|
|
5518
|
+
// var domainLand = parseDomain(refDomain.current.value);
|
|
5519
|
+
// setDomain(domainLand.domain);
|
|
5520
|
+
// setSubDomains(domainLand.subDomains);
|
|
5521
|
+
// setTopLevelDomains(domainLand.topLevelDomains);
|
|
5522
|
+
|
|
5523
|
+
handleNext();
|
|
5524
|
+
}
|
|
5525
|
+
}, "Next: Setup DNS"))), activeStep == 1 && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(BootstrapDialogTitle, {
|
|
5526
|
+
id: "customized-dialog-title",
|
|
5527
|
+
onClose: handleClose,
|
|
5528
|
+
sx: {
|
|
5529
|
+
textAlign: "center",
|
|
5530
|
+
fontSize: 30,
|
|
5531
|
+
marginTop: 2
|
|
5532
|
+
}
|
|
5533
|
+
}, "Configure your DNS"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
5534
|
+
gutterBottom: true,
|
|
5535
|
+
sx: {
|
|
5536
|
+
textAlign: "center",
|
|
5537
|
+
fontSize: 14
|
|
5538
|
+
}
|
|
5539
|
+
}, "Add a CNAME and TXT Record to your domain by visiting your DNS provider.")), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
5540
|
+
sx: {
|
|
5541
|
+
backgroundColor: "#f7f7f7",
|
|
5542
|
+
marginTop: 5,
|
|
5543
|
+
paddingLeft: 4,
|
|
5544
|
+
paddingRight: 4
|
|
5545
|
+
}
|
|
5546
|
+
}, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
5547
|
+
container: true,
|
|
5548
|
+
spacing: 2,
|
|
5549
|
+
fullWidth: true
|
|
5550
|
+
}, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
5551
|
+
item: true,
|
|
5552
|
+
xs: 2
|
|
5553
|
+
}, "Type", /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
|
|
5554
|
+
fullWidth: true,
|
|
5555
|
+
sx: {
|
|
5556
|
+
paddingTop: 2
|
|
5557
|
+
}
|
|
5558
|
+
}, /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
5559
|
+
value: 1,
|
|
5560
|
+
readOnly: true
|
|
5561
|
+
}, /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
5562
|
+
value: 1
|
|
5563
|
+
}, "CNAME")))), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
5564
|
+
item: true,
|
|
5565
|
+
xs: 5
|
|
5566
|
+
}, "Name", /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
5567
|
+
inputRef: refCNameName,
|
|
5568
|
+
id: "NameDomainTxt",
|
|
5569
|
+
label: "",
|
|
5570
|
+
fullWidth: true,
|
|
5571
|
+
value: subDomains,
|
|
5572
|
+
variant: "outlined",
|
|
5573
|
+
sx: {
|
|
5574
|
+
color: "white",
|
|
5575
|
+
paddingTop: 2
|
|
5576
|
+
}
|
|
5577
|
+
}), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
5578
|
+
sx: {
|
|
5579
|
+
textAlign: "center",
|
|
5580
|
+
paddingTop: 1
|
|
5581
|
+
}
|
|
5582
|
+
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
5583
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_ContentCopyRounded["default"], null),
|
|
5584
|
+
sx: {
|
|
5585
|
+
width: "100%"
|
|
5586
|
+
},
|
|
5587
|
+
variant: "contained",
|
|
5588
|
+
onClick: function onClick() {
|
|
5589
|
+
copyToClipboard(refCNameName.current.value);
|
|
5590
|
+
}
|
|
5591
|
+
}, "Copy"))), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
5592
|
+
item: true,
|
|
5593
|
+
xs: 5
|
|
5594
|
+
}, "Target", /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
5595
|
+
inputRef: refCNameTarget,
|
|
5596
|
+
id: "targetDomainTxt",
|
|
5597
|
+
label: "",
|
|
5598
|
+
fullWidth: true,
|
|
5599
|
+
value: azureWebsite,
|
|
5600
|
+
variant: "outlined",
|
|
5601
|
+
sx: {
|
|
5602
|
+
color: "white",
|
|
5603
|
+
paddingTop: 2
|
|
5604
|
+
}
|
|
5605
|
+
}), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
5606
|
+
sx: {
|
|
5607
|
+
textAlign: "center",
|
|
5608
|
+
paddingTop: 1
|
|
5609
|
+
}
|
|
5610
|
+
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
5611
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_ContentCopyRounded["default"], null),
|
|
5612
|
+
sx: {
|
|
5613
|
+
width: "100%"
|
|
5614
|
+
},
|
|
5615
|
+
variant: "contained",
|
|
5616
|
+
onClick: function onClick() {
|
|
5617
|
+
copyToClipboard(refCNameTarget.current.value);
|
|
5618
|
+
}
|
|
5619
|
+
}, "Copy"))))), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
5620
|
+
sx: {
|
|
5621
|
+
backgroundColor: "#f7f7f7",
|
|
5622
|
+
paddingLeft: 4,
|
|
5623
|
+
paddingRight: 4,
|
|
5624
|
+
marginTop: 2,
|
|
5625
|
+
paddingBottom: 4
|
|
5626
|
+
}
|
|
5627
|
+
}, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
5628
|
+
container: true,
|
|
5629
|
+
spacing: 2,
|
|
5630
|
+
fullWidth: true
|
|
5631
|
+
}, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
5632
|
+
item: true,
|
|
5633
|
+
xs: 2
|
|
5634
|
+
}, "Type", /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
|
|
5635
|
+
fullWidth: true,
|
|
5636
|
+
sx: {
|
|
5637
|
+
paddingTop: 2
|
|
5638
|
+
}
|
|
5639
|
+
}, /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
5640
|
+
value: 1,
|
|
5641
|
+
readOnly: true
|
|
5642
|
+
}, /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
5643
|
+
value: 1
|
|
5644
|
+
}, "TXT")))), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
5645
|
+
item: true,
|
|
5646
|
+
xs: 5
|
|
5647
|
+
}, "Name", /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
5648
|
+
inputRef: reftxtName,
|
|
5649
|
+
id: "NameDomain2Txt",
|
|
5650
|
+
label: "",
|
|
5651
|
+
fullWidth: true,
|
|
5652
|
+
value: "asuid." + subDomains,
|
|
5653
|
+
variant: "outlined",
|
|
5654
|
+
sx: {
|
|
5655
|
+
color: "white",
|
|
5656
|
+
marginTop: 2
|
|
5657
|
+
}
|
|
5658
|
+
}), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
5659
|
+
sx: {
|
|
5660
|
+
textAlign: "center",
|
|
5661
|
+
paddingTop: 1
|
|
5662
|
+
}
|
|
5663
|
+
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
5664
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_ContentCopyRounded["default"], null),
|
|
5665
|
+
sx: {
|
|
5666
|
+
width: "100%"
|
|
5667
|
+
},
|
|
5668
|
+
variant: "contained",
|
|
5669
|
+
onClick: function onClick() {
|
|
5670
|
+
copyToClipboard(reftxtName.current.value);
|
|
5671
|
+
}
|
|
5672
|
+
}, "Copy"))), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
5673
|
+
item: true,
|
|
5674
|
+
xs: 5
|
|
5675
|
+
}, "Target", /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
5676
|
+
inputRef: reftxtTarget,
|
|
5677
|
+
id: "targetDomain2Txt",
|
|
5678
|
+
label: "",
|
|
5679
|
+
fullWidth: true,
|
|
5680
|
+
value: azureTxtValue,
|
|
5681
|
+
variant: "outlined",
|
|
5682
|
+
sx: {
|
|
5683
|
+
color: "white",
|
|
5684
|
+
marginTop: 2
|
|
5685
|
+
}
|
|
5686
|
+
}), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
5687
|
+
sx: {
|
|
5688
|
+
textAlign: "center",
|
|
5689
|
+
paddingTop: 1
|
|
5690
|
+
}
|
|
5691
|
+
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
5692
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_ContentCopyRounded["default"], null),
|
|
5693
|
+
sx: {
|
|
5694
|
+
width: "100%"
|
|
5695
|
+
},
|
|
5696
|
+
variant: "contained",
|
|
5697
|
+
onClick: function onClick() {
|
|
5698
|
+
copyToClipboard(reftxtTarget.current.value);
|
|
5699
|
+
}
|
|
5700
|
+
}, "Copy")))))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
5701
|
+
variant: "contained",
|
|
5702
|
+
onClick: function onClick() {
|
|
5703
|
+
handleNext();
|
|
5704
|
+
}
|
|
5705
|
+
}, "Go Live"))), activeStep == 2 && /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(BootstrapDialogTitle, {
|
|
5706
|
+
id: "customized-dialog-title",
|
|
5707
|
+
onClose: handleClose,
|
|
5708
|
+
sx: {
|
|
5709
|
+
textAlign: "center",
|
|
5710
|
+
fontSize: 30,
|
|
5711
|
+
marginTop: 4
|
|
5712
|
+
}
|
|
5713
|
+
}, "Creating your private label experience"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
5714
|
+
sx: {
|
|
5715
|
+
paddingTop: 2,
|
|
5716
|
+
textAlign: "center"
|
|
5717
|
+
}
|
|
5718
|
+
}, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
5719
|
+
gutterBottom: true,
|
|
5720
|
+
sx: {
|
|
5721
|
+
textAlign: "center",
|
|
5722
|
+
fontSize: 18
|
|
5723
|
+
}
|
|
5724
|
+
}, "Please wait while we complete a few things on our side."), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
5725
|
+
sx: {
|
|
5726
|
+
paddingTop: 2
|
|
5727
|
+
}
|
|
5728
|
+
}, /*#__PURE__*/_react["default"].createElement(_CircularProgress["default"], {
|
|
5729
|
+
color: "inherit"
|
|
5730
|
+
})))))), /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
5731
|
+
open: errorMessage != null ? true : false,
|
|
5732
|
+
onClose: function onClose() {
|
|
5733
|
+
setErrorMessage(null);
|
|
5734
|
+
},
|
|
5735
|
+
"aria-labelledby": "alert-dialog-title",
|
|
5736
|
+
"aria-describedby": "alert-dialog-description"
|
|
5737
|
+
}, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
|
|
5738
|
+
id: "alert-dialog-title"
|
|
5739
|
+
}, "Issue Detected"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_material.DialogContentText, {
|
|
5740
|
+
id: "alert-dialog-description"
|
|
5741
|
+
}, errorMessage)), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
5742
|
+
onClick: function onClick() {
|
|
5743
|
+
setErrorMessage(null);
|
|
5744
|
+
},
|
|
5745
|
+
autoFocus: true
|
|
5746
|
+
}, "OK"))));
|
|
5747
|
+
}
|
|
5748
|
+
"use strict";
|
|
5749
|
+
|
|
5750
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
5751
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5752
|
+
value: true
|
|
5753
|
+
});
|
|
5754
|
+
exports.PrivateLabelEditor = PrivateLabelEditor;
|
|
5755
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
5756
|
+
var _react2 = _interopRequireWildcard(require("@monaco-editor/react"));
|
|
5757
|
+
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
5758
|
+
var _Check = _interopRequireDefault(require("@mui/icons-material/Check"));
|
|
5759
|
+
var _Tabs = _interopRequireDefault(require("@mui/material/Tabs"));
|
|
5760
|
+
var _Tab = _interopRequireDefault(require("@mui/material/Tab"));
|
|
5761
|
+
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
5762
|
+
var _material = require("@mui/material");
|
|
5763
|
+
var _xDataGrid = require("@mui/x-data-grid");
|
|
5764
|
+
var _PublishRounded = _interopRequireDefault(require("@mui/icons-material/PublishRounded"));
|
|
5765
|
+
var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
|
|
5766
|
+
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
5767
|
+
var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
|
|
5768
|
+
var _Select = _interopRequireDefault(require("@mui/material/Select"));
|
|
5769
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
5770
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
5771
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
5772
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
5773
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
5774
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5775
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5776
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5777
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5778
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5779
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
5780
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
5781
|
+
// remove after NPM
|
|
5782
|
+
// import {FileUploader, apiService, ColorPicker, Dropzone} from 'authscape';
|
|
5783
|
+
// import AddDomain from "./AddDomainModal";
|
|
5784
|
+
|
|
5785
|
+
function PrivateLabelEditor(_ref) {
|
|
5786
|
+
var loadedUser = _ref.loadedUser,
|
|
5787
|
+
notification = _ref.notification,
|
|
5788
|
+
_ref$showAllDomains = _ref.showAllDomains,
|
|
5789
|
+
showAllDomains = _ref$showAllDomains === void 0 ? false : _ref$showAllDomains,
|
|
5790
|
+
_ref$companyId = _ref.companyId,
|
|
5791
|
+
companyId = _ref$companyId === void 0 ? null : _ref$companyId,
|
|
5792
|
+
_ref$azureWebsite = _ref.azureWebsite,
|
|
5793
|
+
azureWebsite = _ref$azureWebsite === void 0 ? "" : _ref$azureWebsite,
|
|
5794
|
+
_ref$azureTxtValue = _ref.azureTxtValue,
|
|
5795
|
+
azureTxtValue = _ref$azureTxtValue === void 0 ? "" : _ref$azureTxtValue;
|
|
5796
|
+
var monaco = (0, _react2.useMonaco)();
|
|
5797
|
+
var cssEditorRef = (0, _react.useRef)(null);
|
|
5798
|
+
var htmlEditorRef = (0, _react.useRef)(null);
|
|
5799
|
+
var _useState = (0, _react.useState)(null),
|
|
5800
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
5801
|
+
data = _useState2[0],
|
|
5802
|
+
setData = _useState2[1];
|
|
5803
|
+
var _useState3 = (0, _react.useState)(0),
|
|
5804
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
5805
|
+
value = _useState4[0],
|
|
5806
|
+
setValue = _useState4[1];
|
|
5807
|
+
var _useState5 = (0, _react.useState)([]),
|
|
5808
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
5809
|
+
fonts = _useState6[0],
|
|
5810
|
+
setFonts = _useState6[1];
|
|
5811
|
+
var _useState7 = (0, _react.useState)([]),
|
|
5812
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
5813
|
+
oEMDomainList = _useState8[0],
|
|
5814
|
+
setOEMDomainList = _useState8[1];
|
|
5815
|
+
var _useState9 = (0, _react.useState)([]),
|
|
5816
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
5817
|
+
dnsFields = _useState10[0],
|
|
5818
|
+
setDnsFields = _useState10[1];
|
|
5819
|
+
var _useState11 = (0, _react.useState)(null),
|
|
5820
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
5821
|
+
selectedFont = _useState12[0],
|
|
5822
|
+
setSelectedFont = _useState12[1];
|
|
5823
|
+
var _useState13 = (0, _react.useState)(null),
|
|
5824
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
5825
|
+
fontUri = _useState14[0],
|
|
5826
|
+
setFontUri = _useState14[1];
|
|
5827
|
+
var _useState15 = (0, _react.useState)(null),
|
|
5828
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
5829
|
+
oEMDomain = _useState16[0],
|
|
5830
|
+
setOEMDomain = _useState16[1];
|
|
5831
|
+
var _useState17 = (0, _react.useState)(''),
|
|
5832
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
5833
|
+
stateBaseUri = _useState18[0],
|
|
5834
|
+
setBaseUri = _useState18[1];
|
|
5835
|
+
var _useState19 = (0, _react.useState)(false),
|
|
5836
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
5837
|
+
isNewAccount = _useState20[0],
|
|
5838
|
+
setIsNewAccount = _useState20[1];
|
|
5839
|
+
var handleChange = function handleChange(event, newValue) {
|
|
5840
|
+
setValue(newValue);
|
|
5841
|
+
};
|
|
5842
|
+
var GetBaseUrl = function GetBaseUrl() {
|
|
5843
|
+
return window.location.protocol + "//" + window.location.host;
|
|
5844
|
+
};
|
|
5845
|
+
var loadDNSFields = /*#__PURE__*/function () {
|
|
5846
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
5847
|
+
var _domain,
|
|
5848
|
+
domain,
|
|
5849
|
+
responseFields,
|
|
5850
|
+
_args = arguments;
|
|
5851
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
5852
|
+
while (1) switch (_context.prev = _context.next) {
|
|
5853
|
+
case 0:
|
|
5854
|
+
_domain = _args.length > 0 && _args[0] !== undefined ? _args[0] : null;
|
|
5855
|
+
domain = null;
|
|
5856
|
+
if (_domain != null) {
|
|
5857
|
+
domain = _domain;
|
|
5858
|
+
} else {
|
|
5859
|
+
domain = GetBaseUrl();
|
|
5860
|
+
}
|
|
5861
|
+
_context.next = 5;
|
|
5862
|
+
return apiService().get("/PrivateLabel/GetFields?domain=" + domain + (companyId != null ? "&companyId=" + companyId : ""));
|
|
5863
|
+
case 5:
|
|
5864
|
+
responseFields = _context.sent;
|
|
5865
|
+
if (responseFields != null && responseFields.status == 200) {
|
|
5866
|
+
setDnsFields(responseFields.data);
|
|
5867
|
+
}
|
|
5868
|
+
case 7:
|
|
5869
|
+
case "end":
|
|
5870
|
+
return _context.stop();
|
|
5871
|
+
}
|
|
5872
|
+
}, _callee);
|
|
5873
|
+
}));
|
|
5874
|
+
return function loadDNSFields() {
|
|
5875
|
+
return _ref2.apply(this, arguments);
|
|
5876
|
+
};
|
|
5877
|
+
}();
|
|
5878
|
+
(0, _react.useEffect)(function () {
|
|
5879
|
+
if (oEMDomain != null) {
|
|
5880
|
+
loadDNSFields(oEMDomain);
|
|
5881
|
+
}
|
|
5882
|
+
}, [oEMDomain]);
|
|
5883
|
+
var FetchOEMData = /*#__PURE__*/function () {
|
|
5884
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
5885
|
+
var response, _response, _response2;
|
|
5886
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
5887
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
5888
|
+
case 0:
|
|
5889
|
+
_context2.next = 2;
|
|
5890
|
+
return apiService().get("/PrivateLabel/GetFonts");
|
|
5891
|
+
case 2:
|
|
5892
|
+
response = _context2.sent;
|
|
5893
|
+
if (response != null && response.status == 200) {
|
|
5894
|
+
setFonts(response.data);
|
|
5895
|
+
}
|
|
5896
|
+
if (!showAllDomains) {
|
|
5897
|
+
_context2.next = 11;
|
|
5898
|
+
break;
|
|
5899
|
+
}
|
|
5900
|
+
_context2.next = 7;
|
|
5901
|
+
return apiService().get("/PrivateLabel/GetAllDomains");
|
|
5902
|
+
case 7:
|
|
5903
|
+
_response = _context2.sent;
|
|
5904
|
+
if (_response != null && _response.status == 200) {
|
|
5905
|
+
setOEMDomainList(_response.data);
|
|
5906
|
+
if (_response.data.length > 0) {
|
|
5907
|
+
setOEMDomain(_response.data[0].name);
|
|
5908
|
+
} else {
|
|
5909
|
+
setIsNewAccount(true);
|
|
5910
|
+
}
|
|
5911
|
+
}
|
|
5912
|
+
_context2.next = 15;
|
|
5913
|
+
break;
|
|
5914
|
+
case 11:
|
|
5915
|
+
_context2.next = 13;
|
|
5916
|
+
return apiService().get("/PrivateLabel/GetAllDomainsUser");
|
|
5917
|
+
case 13:
|
|
5918
|
+
_response2 = _context2.sent;
|
|
5919
|
+
if (_response2 != null && _response2.status == 200) {
|
|
5920
|
+
setOEMDomainList(_response2.data);
|
|
5921
|
+
if (_response2.data.length > 0) {
|
|
5922
|
+
setOEMDomain(_response2.data[0].name);
|
|
5923
|
+
} else {
|
|
5924
|
+
setIsNewAccount(true);
|
|
5925
|
+
}
|
|
5926
|
+
}
|
|
5927
|
+
case 15:
|
|
5928
|
+
case "end":
|
|
5929
|
+
return _context2.stop();
|
|
5930
|
+
}
|
|
5931
|
+
}, _callee2);
|
|
5932
|
+
}));
|
|
5933
|
+
return function FetchOEMData() {
|
|
5934
|
+
return _ref3.apply(this, arguments);
|
|
5935
|
+
};
|
|
5936
|
+
}();
|
|
5937
|
+
(0, _react.useEffect)(function () {
|
|
5938
|
+
if (loadedUser) {
|
|
5939
|
+
FetchOEMData();
|
|
5940
|
+
}
|
|
5941
|
+
}, [loadedUser]);
|
|
5942
|
+
var _React$useState = _react["default"].useState({
|
|
5943
|
+
page: 0,
|
|
5944
|
+
pageSize: 12
|
|
5945
|
+
}),
|
|
5946
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
5947
|
+
paginationModel = _React$useState2[0],
|
|
5948
|
+
setPaginationModel = _React$useState2[1];
|
|
5949
|
+
function handleCSSEditorDidMount(editor, monaco) {
|
|
5950
|
+
cssEditorRef.current = editor;
|
|
5951
|
+
}
|
|
5952
|
+
function handleHtmlEditorDidMount(editor, monaco) {
|
|
5953
|
+
htmlEditorRef.current = editor;
|
|
5954
|
+
}
|
|
5955
|
+
var columns = [{
|
|
5956
|
+
field: "label",
|
|
5957
|
+
headerName: "Fonts",
|
|
5958
|
+
editable: false,
|
|
5959
|
+
width: 300,
|
|
5960
|
+
renderCell: function renderCell(params) {
|
|
5961
|
+
var RenderData = function RenderData(row) {
|
|
5962
|
+
// const { id, value, field } = params;
|
|
5963
|
+
// const apiRef = useGridApiContext();
|
|
5964
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
5965
|
+
sx: {
|
|
5966
|
+
fontFamily: row.value,
|
|
5967
|
+
fontSize: 20,
|
|
5968
|
+
cursor: "pointer"
|
|
5969
|
+
}
|
|
5970
|
+
}, row.value), /*#__PURE__*/_react["default"].createElement("link", {
|
|
5971
|
+
href: "https://fonts.googleapis.com/css2?family=" + row.value,
|
|
5972
|
+
rel: "stylesheet"
|
|
5973
|
+
}));
|
|
5974
|
+
};
|
|
5975
|
+
return RenderData(params);
|
|
5976
|
+
}
|
|
5977
|
+
}];
|
|
5978
|
+
(0, _react.useEffect)(function () {
|
|
5979
|
+
var fetchData = /*#__PURE__*/function () {
|
|
5980
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
5981
|
+
var response;
|
|
5982
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
5983
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
5984
|
+
case 0:
|
|
5985
|
+
// if (monaco) {
|
|
5986
|
+
// //console.log("here is the monaco instance:", monaco);
|
|
5987
|
+
// }
|
|
5988
|
+
|
|
5989
|
+
setData(null);
|
|
5990
|
+
_context3.next = 3;
|
|
5991
|
+
return apiService().get("/PrivateLabel/GetEditorData?domain=" + oEMDomain + (companyId != null ? "&companyId=" + companyId : ""));
|
|
5992
|
+
case 3:
|
|
5993
|
+
response = _context3.sent;
|
|
5994
|
+
if (response.status == 200) {
|
|
5995
|
+
setData(response.data);
|
|
5996
|
+
setSelectedFont(response.data.fontFamily);
|
|
5997
|
+
setFontUri(response.data.fontUrl);
|
|
5998
|
+
}
|
|
5999
|
+
case 5:
|
|
6000
|
+
case "end":
|
|
6001
|
+
return _context3.stop();
|
|
6002
|
+
}
|
|
6003
|
+
}, _callee3);
|
|
6004
|
+
}));
|
|
6005
|
+
return function fetchData() {
|
|
6006
|
+
return _ref4.apply(this, arguments);
|
|
6007
|
+
};
|
|
6008
|
+
}();
|
|
6009
|
+
fetchData();
|
|
6010
|
+
}, [monaco, oEMDomain]);
|
|
6011
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
2984
6012
|
sx: {
|
|
2985
|
-
|
|
6013
|
+
width: '100%'
|
|
2986
6014
|
}
|
|
2987
|
-
},
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
6015
|
+
}, selectedFont != null && fontUri == null && /*#__PURE__*/_react["default"].createElement("link", {
|
|
6016
|
+
href: "https://fonts.googleapis.com/css2?family=" + selectedFont,
|
|
6017
|
+
rel: "stylesheet"
|
|
6018
|
+
}), /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
6019
|
+
sx: {
|
|
6020
|
+
paddingTop: 6
|
|
6021
|
+
}
|
|
6022
|
+
}, oEMDomain != null && /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
|
|
6023
|
+
fullWidth: true
|
|
6024
|
+
}, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
|
|
6025
|
+
id: "demo-simple-select-label"
|
|
6026
|
+
}, "Website Domain"), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
6027
|
+
labelId: "demo-simple-select-label",
|
|
6028
|
+
id: "demo-simple-select",
|
|
6029
|
+
defaultValue: oEMDomain,
|
|
6030
|
+
label: "Website Domain",
|
|
6031
|
+
onChange: function onChange(val) {
|
|
6032
|
+
setOEMDomain(val.target.value);
|
|
6033
|
+
}
|
|
6034
|
+
}, oEMDomainList.map(function (dns) {
|
|
6035
|
+
return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
6036
|
+
value: dns.name
|
|
6037
|
+
}, dns.name);
|
|
6038
|
+
})))), /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
6039
|
+
sx: {
|
|
6040
|
+
borderBottom: 1,
|
|
6041
|
+
borderColor: 'divider',
|
|
6042
|
+
paddingTop: 2
|
|
6043
|
+
}
|
|
6044
|
+
}, /*#__PURE__*/_react["default"].createElement(_Tabs["default"], {
|
|
6045
|
+
value: value,
|
|
6046
|
+
onChange: handleChange,
|
|
6047
|
+
"aria-label": "basic tabs example"
|
|
6048
|
+
}, /*#__PURE__*/_react["default"].createElement(_Tab["default"], {
|
|
6049
|
+
label: "App Icon / Colors"
|
|
6050
|
+
}), /*#__PURE__*/_react["default"].createElement(_Tab["default"], {
|
|
6051
|
+
label: "Fonts"
|
|
6052
|
+
}), /*#__PURE__*/_react["default"].createElement(_Tab["default"], {
|
|
6053
|
+
label: "Style Sheet Editor"
|
|
6054
|
+
}), /*#__PURE__*/_react["default"].createElement(_Tab["default"], {
|
|
6055
|
+
label: "HTML Import Editor"
|
|
6056
|
+
}))), /*#__PURE__*/_react["default"].createElement(_Box["default"], null, /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
6057
|
+
sx: {
|
|
6058
|
+
padding: 2
|
|
6059
|
+
}
|
|
6060
|
+
}, value == 0 && /*#__PURE__*/_react["default"].createElement(_Box["default"], null, data != null && /*#__PURE__*/_react["default"].createElement(_Box["default"], null, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
6061
|
+
container: true,
|
|
6062
|
+
spacing: 2
|
|
6063
|
+
}, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
6064
|
+
item: true,
|
|
6065
|
+
xs: 4
|
|
6066
|
+
}, /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
6067
|
+
sx: {
|
|
6068
|
+
paddingBottom: 4
|
|
6069
|
+
}
|
|
6070
|
+
}, /*#__PURE__*/_react["default"].createElement(Dropzone, {
|
|
6071
|
+
image: "/DefaultNoImage.svg",
|
|
6072
|
+
text: "Drag 'n' drop your app icon here",
|
|
6073
|
+
onDrop: /*#__PURE__*/function () {
|
|
6074
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(file) {
|
|
6075
|
+
var data, response;
|
|
6076
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
6077
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
6078
|
+
case 0:
|
|
6079
|
+
data = new FormData();
|
|
6080
|
+
data.append("file", file);
|
|
6081
|
+
data.append("domain", stateBaseUri);
|
|
6082
|
+
_context4.next = 5;
|
|
6083
|
+
return apiService().post("/PrivateLabel/UploadAppIcon", data);
|
|
6084
|
+
case 5:
|
|
6085
|
+
response = _context4.sent;
|
|
6086
|
+
if (response != null && response.status == 200) {
|
|
6087
|
+
window.location.reload();
|
|
6088
|
+
}
|
|
6089
|
+
case 7:
|
|
6090
|
+
case "end":
|
|
6091
|
+
return _context4.stop();
|
|
6092
|
+
}
|
|
6093
|
+
}, _callee4);
|
|
6094
|
+
}));
|
|
6095
|
+
return function (_x2) {
|
|
6096
|
+
return _ref5.apply(this, arguments);
|
|
6097
|
+
};
|
|
6098
|
+
}()
|
|
6099
|
+
}))), /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
6100
|
+
item: true,
|
|
6101
|
+
xs: 8
|
|
6102
|
+
}, /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
6103
|
+
sx: {
|
|
6104
|
+
paddingBottom: 2,
|
|
6105
|
+
fontWeight: "bold",
|
|
6106
|
+
fontSize: 16
|
|
6107
|
+
}
|
|
6108
|
+
}, "Adjust the colors for your site"), /*#__PURE__*/_react["default"].createElement(_Box["default"], null, dnsFields != null && dnsFields.map(function (dnsField, index) {
|
|
6109
|
+
return /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
6110
|
+
key: index
|
|
6111
|
+
}, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
2998
6112
|
container: true,
|
|
2999
|
-
spacing:
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
6113
|
+
spacing: 2
|
|
6114
|
+
}, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
6115
|
+
item: true,
|
|
6116
|
+
xs: 3
|
|
6117
|
+
}, dnsField.name), /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
6118
|
+
item: true,
|
|
6119
|
+
xs: 9
|
|
6120
|
+
}, /*#__PURE__*/_react["default"].createElement(ColorPicker, {
|
|
6121
|
+
name: dnsField.name,
|
|
6122
|
+
defaultColor: dnsField.value,
|
|
6123
|
+
onColorChanged: /*#__PURE__*/function () {
|
|
6124
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(name, hex) {
|
|
6125
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
6126
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
6127
|
+
case 0:
|
|
6128
|
+
_context5.next = 2;
|
|
6129
|
+
return apiService().post("/PrivateLabel/SetFieldValue", {
|
|
6130
|
+
id: dnsField.id,
|
|
6131
|
+
fieldId: dnsField.fieldId,
|
|
6132
|
+
value: hex
|
|
6133
|
+
});
|
|
6134
|
+
case 2:
|
|
6135
|
+
notification(dnsField.name + " Saved");
|
|
6136
|
+
case 3:
|
|
6137
|
+
case "end":
|
|
6138
|
+
return _context5.stop();
|
|
6139
|
+
}
|
|
6140
|
+
}, _callee5);
|
|
6141
|
+
}));
|
|
6142
|
+
return function (_x3, _x4) {
|
|
6143
|
+
return _ref6.apply(this, arguments);
|
|
6144
|
+
};
|
|
6145
|
+
}()
|
|
6146
|
+
}))));
|
|
6147
|
+
})))))), value == 1 && /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
6148
|
+
value: value,
|
|
6149
|
+
index: 1
|
|
6150
|
+
}, data != null && /*#__PURE__*/_react["default"].createElement(_Box["default"], null, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
6151
|
+
container: true,
|
|
6152
|
+
spacing: 2
|
|
6153
|
+
}, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
6154
|
+
item: true,
|
|
6155
|
+
xs: 6
|
|
6156
|
+
}, loadedUser == true && /*#__PURE__*/_react["default"].createElement(_Box["default"], null, /*#__PURE__*/_react["default"].createElement(_xDataGrid.DataGrid, {
|
|
6157
|
+
rows: fonts,
|
|
6158
|
+
columns: columns,
|
|
6159
|
+
sx: {
|
|
6160
|
+
height: "80vh",
|
|
6161
|
+
width: "100%"
|
|
6162
|
+
},
|
|
6163
|
+
pagination: true,
|
|
6164
|
+
disableSelectionOnClick: true,
|
|
6165
|
+
onPaginationModelChange: setPaginationModel,
|
|
6166
|
+
paginationModel: paginationModel
|
|
6167
|
+
//pageSizeOptions={[5]}
|
|
6168
|
+
// rowCount={100}
|
|
6169
|
+
// rowSelectionModel={selectedFont}
|
|
6170
|
+
,
|
|
6171
|
+
onRowClick: /*#__PURE__*/function () {
|
|
6172
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(params) {
|
|
6173
|
+
var response;
|
|
6174
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
6175
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
6176
|
+
case 0:
|
|
6177
|
+
_context6.next = 2;
|
|
6178
|
+
return apiService().post("/PrivateLabel/SetFont", {
|
|
6179
|
+
companyId: companyId,
|
|
6180
|
+
domain: oEMDomain,
|
|
6181
|
+
value: params.row.label
|
|
6182
|
+
});
|
|
6183
|
+
case 2:
|
|
6184
|
+
response = _context6.sent;
|
|
6185
|
+
if (response != null && response.status == 200) {
|
|
6186
|
+
setSelectedFont(params.row.label);
|
|
6187
|
+
setFontUri(null);
|
|
6188
|
+
notification("Font saved!");
|
|
6189
|
+
}
|
|
6190
|
+
case 4:
|
|
6191
|
+
case "end":
|
|
6192
|
+
return _context6.stop();
|
|
3013
6193
|
}
|
|
3014
|
-
},
|
|
6194
|
+
}, _callee6);
|
|
3015
6195
|
}));
|
|
3016
|
-
|
|
3017
|
-
|
|
6196
|
+
return function (_x5) {
|
|
6197
|
+
return _ref7.apply(this, arguments);
|
|
6198
|
+
};
|
|
6199
|
+
}()
|
|
6200
|
+
}))), /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
6201
|
+
item: true,
|
|
6202
|
+
xs: 6
|
|
6203
|
+
}, /*#__PURE__*/_react["default"].createElement(FileUploader, {
|
|
6204
|
+
url: "/PrivateLabel/UploadCustomFont",
|
|
6205
|
+
accept: ".otf,.ttf,.woff",
|
|
6206
|
+
params: {
|
|
6207
|
+
domain: stateBaseUri
|
|
6208
|
+
},
|
|
6209
|
+
multiple: true,
|
|
6210
|
+
variant: "custom",
|
|
6211
|
+
onUploadCompleted: function onUploadCompleted() {
|
|
6212
|
+
window.location.reload();
|
|
6213
|
+
}
|
|
6214
|
+
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
6215
|
+
color: "primary",
|
|
6216
|
+
variant: "contained",
|
|
6217
|
+
fullWidth: true,
|
|
6218
|
+
sx: {
|
|
6219
|
+
height: 50
|
|
6220
|
+
},
|
|
6221
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_PublishRounded["default"], null)
|
|
6222
|
+
}, /*#__PURE__*/_react["default"].createElement(_Box["default"], null, "Upload Font"), "\xA0", /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
6223
|
+
sx: {
|
|
6224
|
+
textAlign: "center"
|
|
6225
|
+
}
|
|
6226
|
+
}, /*#__PURE__*/_react["default"].createElement("small", null, "(.OTF, .TTF, OR .WOFF)")))), /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
6227
|
+
sx: {
|
|
6228
|
+
marginTop: 4
|
|
6229
|
+
}
|
|
6230
|
+
}, "Font Selected:"), /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
6231
|
+
sx: {
|
|
6232
|
+
marginBottom: 2,
|
|
6233
|
+
fontWeight: "bold",
|
|
6234
|
+
fontSize: 20
|
|
6235
|
+
}
|
|
6236
|
+
}, " ", selectedFont), /*#__PURE__*/_react["default"].createElement("hr", null), /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
6237
|
+
sx: {
|
|
6238
|
+
fontFamily: selectedFont
|
|
6239
|
+
}
|
|
6240
|
+
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ut ultricies odio. Nunc ut quam turpis. In hac habitasse platea dictumst. Suspendisse potenti. Nullam malesuada, purus id sagittis vestibulum, massa tellus gravida elit, vitae ultrices tortor nulla ac nunc. Aenean tempus semper est vel convallis. Sed feugiat, risus eu tincidunt eleifend, purus metus vulputate nulla, et condimentum sapien erat in nisi. Nunc non malesuada libero. Donec tempus tincidunt mi at vulputate. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse potenti. Etiam nec eleifend orci. Suspendisse in est vel nunc rhoncus bibendum vitae id felis. Integer bibendum dolor elit, at tincidunt lacus tempor ac. Maecenas lobortis, mauris at condimentum feugiat, nulla orci condimentum massa, sed facilisis tellus ligula vitae metus. Aliquam erat volutpat. Quisque dignissim felis augue, at semper nisl posuere ut. Proin fringilla diam vitae faucibus finibus.", /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement("br", null), "Aenean tempus semper est vel convallis. Sed feugiat, risus eu tincidunt eleifend, purus metus vulputate nulla, et condimentum sapien erat in nisi. Nunc non malesuada libero. Donec tempus tincidunt mi at vulputate. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse potenti"))))), value == 2 && /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
6241
|
+
value: value,
|
|
6242
|
+
index: 3
|
|
6243
|
+
}, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
6244
|
+
container: true,
|
|
6245
|
+
spacing: 2
|
|
6246
|
+
}, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
6247
|
+
item: true,
|
|
6248
|
+
xs: 6
|
|
6249
|
+
}, /*#__PURE__*/_react["default"].createElement("h4", {
|
|
6250
|
+
style: {
|
|
6251
|
+
marginBottom: "0px"
|
|
6252
|
+
}
|
|
6253
|
+
}, "Global CSS edits"), /*#__PURE__*/_react["default"].createElement("small", null, "You can make edits to your stylesheet")), /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
6254
|
+
item: true,
|
|
6255
|
+
xs: 6,
|
|
6256
|
+
sx: {
|
|
6257
|
+
textAlign: "right"
|
|
6258
|
+
}
|
|
6259
|
+
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
6260
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_Check["default"], null),
|
|
6261
|
+
sx: {
|
|
6262
|
+
marginTop: 4
|
|
6263
|
+
},
|
|
6264
|
+
variant: "contained",
|
|
6265
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
6266
|
+
var response;
|
|
6267
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
6268
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
6269
|
+
case 0:
|
|
6270
|
+
_context7.next = 2;
|
|
6271
|
+
return apiService().post("/PrivateLabel/SetGlobalCSS", {
|
|
6272
|
+
companyId: companyId,
|
|
6273
|
+
domain: oEMDomain,
|
|
6274
|
+
value: cssEditorRef.current.getValue()
|
|
6275
|
+
});
|
|
6276
|
+
case 2:
|
|
6277
|
+
response = _context7.sent;
|
|
6278
|
+
if (response != null && response.status == 200) {
|
|
6279
|
+
notification("CSS Saved!");
|
|
6280
|
+
}
|
|
6281
|
+
case 4:
|
|
6282
|
+
case "end":
|
|
6283
|
+
return _context7.stop();
|
|
6284
|
+
}
|
|
6285
|
+
}, _callee7);
|
|
6286
|
+
}))
|
|
6287
|
+
}, "Save Changes"))), /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
6288
|
+
sx: {
|
|
6289
|
+
paddingTop: 1
|
|
6290
|
+
}
|
|
6291
|
+
}, data != null && /*#__PURE__*/_react["default"].createElement(_react2["default"], {
|
|
6292
|
+
height: "70vh",
|
|
6293
|
+
onMount: handleCSSEditorDidMount,
|
|
6294
|
+
defaultLanguage: "css",
|
|
6295
|
+
theme: "vs-dark",
|
|
6296
|
+
defaultValue: data == null || data.prettyCSS == null ? "" : data.prettyCSS
|
|
6297
|
+
}))), value == 3 && /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
6298
|
+
value: value,
|
|
6299
|
+
index: 4
|
|
6300
|
+
}, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
6301
|
+
container: true,
|
|
6302
|
+
spacing: 2
|
|
6303
|
+
}, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
6304
|
+
item: true,
|
|
6305
|
+
xs: 6
|
|
6306
|
+
}, /*#__PURE__*/_react["default"].createElement("h4", {
|
|
6307
|
+
style: {
|
|
6308
|
+
marginBottom: "0px"
|
|
6309
|
+
}
|
|
6310
|
+
}, "HTML import Edits"), /*#__PURE__*/_react["default"].createElement("small", null, "You can add imports such as google analytics or clarity")), /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
6311
|
+
item: true,
|
|
6312
|
+
xs: 6,
|
|
6313
|
+
sx: {
|
|
6314
|
+
textAlign: "right"
|
|
6315
|
+
}
|
|
6316
|
+
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
6317
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_Check["default"], null),
|
|
6318
|
+
sx: {
|
|
6319
|
+
marginTop: 4
|
|
6320
|
+
},
|
|
6321
|
+
variant: "contained",
|
|
6322
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
6323
|
+
var response;
|
|
6324
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
6325
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
6326
|
+
case 0:
|
|
6327
|
+
_context8.next = 2;
|
|
6328
|
+
return apiService().post("/PrivateLabel/SetGlobalHTML", {
|
|
6329
|
+
companyId: companyId,
|
|
6330
|
+
domain: oEMDomain,
|
|
6331
|
+
value: htmlEditorRef.current.getValue()
|
|
6332
|
+
});
|
|
6333
|
+
case 2:
|
|
6334
|
+
response = _context8.sent;
|
|
6335
|
+
if (response != null && response.status == 200) {
|
|
6336
|
+
notification("HTML saved!");
|
|
6337
|
+
}
|
|
6338
|
+
case 4:
|
|
6339
|
+
case "end":
|
|
6340
|
+
return _context8.stop();
|
|
6341
|
+
}
|
|
6342
|
+
}, _callee8);
|
|
6343
|
+
}))
|
|
6344
|
+
}, "Save Changes"))), /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
6345
|
+
sx: {
|
|
6346
|
+
paddingTop: 1
|
|
6347
|
+
}
|
|
6348
|
+
}, data != null && /*#__PURE__*/_react["default"].createElement(_react2["default"], {
|
|
6349
|
+
height: "70vh",
|
|
6350
|
+
onMount: handleHtmlEditorDidMount,
|
|
6351
|
+
defaultLanguage: "html",
|
|
6352
|
+
theme: "vs-dark",
|
|
6353
|
+
defaultValue: data == null || data.prettyHTML == null ? "" : data.prettyHTML
|
|
6354
|
+
}))))), /*#__PURE__*/_react["default"].createElement(AddDomain, {
|
|
6355
|
+
open: isNewAccount,
|
|
6356
|
+
azureWebsite: azureWebsite,
|
|
6357
|
+
azureTxtValue: azureTxtValue,
|
|
6358
|
+
handleClose: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
6359
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
6360
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
6361
|
+
case 0:
|
|
6362
|
+
setIsNewAccount(false);
|
|
6363
|
+
_context9.next = 3;
|
|
6364
|
+
return FetchOEMData();
|
|
6365
|
+
case 3:
|
|
6366
|
+
case "end":
|
|
6367
|
+
return _context9.stop();
|
|
6368
|
+
}
|
|
6369
|
+
}, _callee9);
|
|
6370
|
+
}))
|
|
6371
|
+
})));
|
|
3018
6372
|
}
|
|
3019
6373
|
"use strict";
|
|
3020
6374
|
|