authscape 1.0.468 → 1.0.469
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 +2491 -50
- package/package.json +1 -1
- package/src/components/mapping/assignMapping.js +232 -0
- package/src/components/mapping/conditionBasedTool.js +99 -0
- package/src/components/mapping/datasources.js +259 -0
- package/src/components/mapping/fileMapping.js +44 -0
- package/src/components/mapping/manageMappingDocuments.js +521 -0
- package/src/components/mapping/mappedColumn.js +70 -0
- package/src/components/mapping/matchExisting.js +116 -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/spreadsheet/spreadsheetViewer.js +399 -44
package/index.js
CHANGED
|
@@ -3612,6 +3612,2114 @@ function Remove(props) {
|
|
|
3612
3612
|
}
|
|
3613
3613
|
"use strict";
|
|
3614
3614
|
|
|
3615
|
+
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); }
|
|
3616
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3617
|
+
value: true
|
|
3618
|
+
});
|
|
3619
|
+
exports["default"] = AssignMapping;
|
|
3620
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
3621
|
+
var _system = require("@mui/system");
|
|
3622
|
+
var _Container = _interopRequireDefault(require("@mui/material/Container"));
|
|
3623
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
3624
|
+
var _material = require("@mui/material");
|
|
3625
|
+
var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
|
|
3626
|
+
var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions"));
|
|
3627
|
+
var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
|
|
3628
|
+
var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
|
|
3629
|
+
var _Close = _interopRequireDefault(require("@mui/icons-material/Close"));
|
|
3630
|
+
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
3631
|
+
var _ArrowRightAltRounded = _interopRequireDefault(require("@mui/icons-material/ArrowRightAltRounded"));
|
|
3632
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
3633
|
+
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); }
|
|
3634
|
+
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; }
|
|
3635
|
+
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; }
|
|
3636
|
+
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); } }
|
|
3637
|
+
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); }); }; }
|
|
3638
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3639
|
+
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."); }
|
|
3640
|
+
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); }
|
|
3641
|
+
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; }
|
|
3642
|
+
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; } }
|
|
3643
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import { apiService } from 'authscape';
|
|
3644
|
+
// import MappedColumn from './MappedColumn';
|
|
3645
|
+
// import ConditionBasedTool from './conditionBasedTool';
|
|
3646
|
+
// import SpreadsheetViewer from '../spreadsheetViewer';
|
|
3647
|
+
function AssignMapping(_ref) {
|
|
3648
|
+
var currentUser = _ref.currentUser,
|
|
3649
|
+
documentComponentId = _ref.documentComponentId,
|
|
3650
|
+
_ref$onCancel = _ref.onCancel,
|
|
3651
|
+
onCancel = _ref$onCancel === void 0 ? null : _ref$onCancel,
|
|
3652
|
+
_ref$onPublished = _ref.onPublished,
|
|
3653
|
+
onPublished = _ref$onPublished === void 0 ? null : _ref$onPublished;
|
|
3654
|
+
var _useState = (0, _react.useState)(documentComponentId),
|
|
3655
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
3656
|
+
documentId = _useState2[0],
|
|
3657
|
+
setDocumentId = _useState2[1];
|
|
3658
|
+
var _useState3 = (0, _react.useState)(null),
|
|
3659
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
3660
|
+
fromColumnOptions = _useState4[0],
|
|
3661
|
+
setFromColumnOptions = _useState4[1];
|
|
3662
|
+
var _useState5 = (0, _react.useState)(null),
|
|
3663
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
3664
|
+
toColumnOptions = _useState6[0],
|
|
3665
|
+
setToColumnOptions = _useState6[1];
|
|
3666
|
+
var _useState7 = (0, _react.useState)(null),
|
|
3667
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
3668
|
+
documentType = _useState8[0],
|
|
3669
|
+
setDocumentType = _useState8[1];
|
|
3670
|
+
var _useState9 = (0, _react.useState)(null),
|
|
3671
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
3672
|
+
documentName = _useState10[0],
|
|
3673
|
+
setDocumentName = _useState10[1];
|
|
3674
|
+
var _useState11 = (0, _react.useState)(1),
|
|
3675
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
3676
|
+
urlTick = _useState12[0],
|
|
3677
|
+
setURLTick = _useState12[1];
|
|
3678
|
+
var _useState13 = (0, _react.useState)(null),
|
|
3679
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
3680
|
+
spreadSheetAddress = _useState14[0],
|
|
3681
|
+
setSpreadSheetAddress = _useState14[1];
|
|
3682
|
+
var _useState15 = (0, _react.useState)(false),
|
|
3683
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
3684
|
+
showPreviewDialog = _useState16[0],
|
|
3685
|
+
setShowPreviewDialog = _useState16[1];
|
|
3686
|
+
var _useState17 = (0, _react.useState)(null),
|
|
3687
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
3688
|
+
advanceQuery = _useState18[0],
|
|
3689
|
+
setAdvanceQuery = _useState18[1];
|
|
3690
|
+
var spreadSheetRef = (0, _react.useRef)(null);
|
|
3691
|
+
var fetchMappingTo = /*#__PURE__*/function () {
|
|
3692
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
3693
|
+
var response;
|
|
3694
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3695
|
+
while (1) switch (_context.prev = _context.next) {
|
|
3696
|
+
case 0:
|
|
3697
|
+
_context.next = 2;
|
|
3698
|
+
return apiService().get("/DocumentMapping/GetMappedDynamicFieldsForCompany?companyId=" + currentUser.companyId + "&documentId=" + documentComponentId);
|
|
3699
|
+
case 2:
|
|
3700
|
+
response = _context.sent;
|
|
3701
|
+
if (response != null) {
|
|
3702
|
+
setToColumnOptions(response.data);
|
|
3703
|
+
}
|
|
3704
|
+
case 4:
|
|
3705
|
+
case "end":
|
|
3706
|
+
return _context.stop();
|
|
3707
|
+
}
|
|
3708
|
+
}, _callee);
|
|
3709
|
+
}));
|
|
3710
|
+
return function fetchMappingTo() {
|
|
3711
|
+
return _ref2.apply(this, arguments);
|
|
3712
|
+
};
|
|
3713
|
+
}();
|
|
3714
|
+
var fetchMappingFrom = /*#__PURE__*/function () {
|
|
3715
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
3716
|
+
var response;
|
|
3717
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
3718
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
3719
|
+
case 0:
|
|
3720
|
+
_context2.next = 2;
|
|
3721
|
+
return apiService().post("/DocumentMapping/GetMapping", {
|
|
3722
|
+
documentComponentId: documentComponentId,
|
|
3723
|
+
companyId: currentUser.companyId
|
|
3724
|
+
});
|
|
3725
|
+
case 2:
|
|
3726
|
+
response = _context2.sent;
|
|
3727
|
+
if (response != null) {
|
|
3728
|
+
setFromColumnOptions(response.data.documentMappings);
|
|
3729
|
+
setDocumentName(response.data.name);
|
|
3730
|
+
setDocumentType(response.data.documentType);
|
|
3731
|
+
}
|
|
3732
|
+
case 4:
|
|
3733
|
+
case "end":
|
|
3734
|
+
return _context2.stop();
|
|
3735
|
+
}
|
|
3736
|
+
}, _callee2);
|
|
3737
|
+
}));
|
|
3738
|
+
return function fetchMappingFrom() {
|
|
3739
|
+
return _ref3.apply(this, arguments);
|
|
3740
|
+
};
|
|
3741
|
+
}();
|
|
3742
|
+
(0, _react.useEffect)(function () {
|
|
3743
|
+
if (documentComponentId != null) {
|
|
3744
|
+
setSpreadSheetAddress("/DocumentMappingPreview/PreviewMappedData?companyId=" + currentUser.companyId + "&documentComponentId=" + documentComponentId);
|
|
3745
|
+
fetchMappingFrom();
|
|
3746
|
+
fetchMappingTo();
|
|
3747
|
+
}
|
|
3748
|
+
}, [documentComponentId]);
|
|
3749
|
+
return /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_Container["default"], {
|
|
3750
|
+
maxWidth: "xl",
|
|
3751
|
+
sx: {
|
|
3752
|
+
marginTop: 2
|
|
3753
|
+
}
|
|
3754
|
+
}, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
3755
|
+
container: true,
|
|
3756
|
+
spacing: 2
|
|
3757
|
+
}, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
3758
|
+
item: true,
|
|
3759
|
+
xs: 6
|
|
3760
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
3761
|
+
sx: {
|
|
3762
|
+
position: "sticky",
|
|
3763
|
+
top: 20
|
|
3764
|
+
}
|
|
3765
|
+
}, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
3766
|
+
variant: "h4",
|
|
3767
|
+
gutterBottom: true,
|
|
3768
|
+
sx: {
|
|
3769
|
+
paddingBottom: 2
|
|
3770
|
+
}
|
|
3771
|
+
}, "File Uploaded: ", /*#__PURE__*/_react["default"].createElement("br", null), " ", documentName), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
3772
|
+
variant: "subtitle1",
|
|
3773
|
+
gutterBottom: true,
|
|
3774
|
+
sx: {
|
|
3775
|
+
paddingBottom: 2
|
|
3776
|
+
}
|
|
3777
|
+
}, "You have ", fromColumnOptions != null && fromColumnOptions.length, " columns that can be created or mapped"), /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
3778
|
+
variant: "outlined",
|
|
3779
|
+
sx: {
|
|
3780
|
+
marginRight: 2
|
|
3781
|
+
},
|
|
3782
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
3783
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
3784
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
3785
|
+
case 0:
|
|
3786
|
+
if (onCancel != null) {
|
|
3787
|
+
onCancel();
|
|
3788
|
+
}
|
|
3789
|
+
case 1:
|
|
3790
|
+
case "end":
|
|
3791
|
+
return _context3.stop();
|
|
3792
|
+
}
|
|
3793
|
+
}, _callee3);
|
|
3794
|
+
}))
|
|
3795
|
+
}, "Cancel"), /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
3796
|
+
variant: "contained",
|
|
3797
|
+
endIcon: /*#__PURE__*/_react["default"].createElement(_ArrowRightAltRounded["default"], null),
|
|
3798
|
+
sx: {
|
|
3799
|
+
marginRight: 2
|
|
3800
|
+
},
|
|
3801
|
+
onClick: function onClick() {
|
|
3802
|
+
setShowPreviewDialog(true);
|
|
3803
|
+
}
|
|
3804
|
+
}, "Next, Preview your mapping"))), /*#__PURE__*/_react["default"].createElement(_material.Grid, {
|
|
3805
|
+
item: true,
|
|
3806
|
+
xs: 5
|
|
3807
|
+
}, fromColumnOptions != null && fromColumnOptions.map(function (column) {
|
|
3808
|
+
return /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(MappedColumn, {
|
|
3809
|
+
companyId: currentUser.companyId,
|
|
3810
|
+
documentId: documentId,
|
|
3811
|
+
documentType: documentType,
|
|
3812
|
+
documentMappingId: column.id,
|
|
3813
|
+
name: column.name,
|
|
3814
|
+
toName: column.toName,
|
|
3815
|
+
isMapped: column.toName == null || column.toName == "" ? true : false,
|
|
3816
|
+
toOptions: toColumnOptions,
|
|
3817
|
+
onResponse: function onResponse() {
|
|
3818
|
+
fetchMappingFrom();
|
|
3819
|
+
fetchMappingTo();
|
|
3820
|
+
}
|
|
3821
|
+
}));
|
|
3822
|
+
})))), /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
3823
|
+
open: showPreviewDialog,
|
|
3824
|
+
onClose: function onClose() {
|
|
3825
|
+
setShowPreviewDialog(false);
|
|
3826
|
+
},
|
|
3827
|
+
fullWidth: true,
|
|
3828
|
+
maxWidth: "xl",
|
|
3829
|
+
"aria-labelledby": "alert-dialog-title",
|
|
3830
|
+
"aria-describedby": "alert-dialog-description"
|
|
3831
|
+
}, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
|
|
3832
|
+
id: "alert-dialog-title",
|
|
3833
|
+
sx: {
|
|
3834
|
+
fontSize: "25px",
|
|
3835
|
+
paddingTop: 4
|
|
3836
|
+
}
|
|
3837
|
+
}, "Preview your mapping"), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
3838
|
+
sx: {
|
|
3839
|
+
paddingLeft: 3
|
|
3840
|
+
}
|
|
3841
|
+
}, "Ensure that the data uploaded is accurately mapped and all (Required) fields are completed."), /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
|
|
3842
|
+
"aria-label": "close",
|
|
3843
|
+
onClick: function onClick() {
|
|
3844
|
+
setShowPreviewDialog(false);
|
|
3845
|
+
},
|
|
3846
|
+
sx: {
|
|
3847
|
+
position: 'absolute',
|
|
3848
|
+
right: 8,
|
|
3849
|
+
top: 8,
|
|
3850
|
+
color: function color(theme) {
|
|
3851
|
+
return theme.palette.grey[500];
|
|
3852
|
+
}
|
|
3853
|
+
}
|
|
3854
|
+
}, /*#__PURE__*/_react["default"].createElement(_Close["default"], null)), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
3855
|
+
sx: {
|
|
3856
|
+
paddingBottom: 1
|
|
3857
|
+
}
|
|
3858
|
+
}, /*#__PURE__*/_react["default"].createElement(ConditionBasedTool, {
|
|
3859
|
+
toColumnOptions: toColumnOptions,
|
|
3860
|
+
documentId: documentId,
|
|
3861
|
+
onConditionApplied: function onConditionApplied(currentQuery) {
|
|
3862
|
+
var incrementNum = urlTick + 1;
|
|
3863
|
+
setURLTick(incrementNum);
|
|
3864
|
+
setAdvanceQuery(currentQuery);
|
|
3865
|
+
|
|
3866
|
+
// setSpreadSheetAddress("/DocumentMappingPreview/PreviewMappedData?companyId=" + currentUser.companyId + "&documentComponentId=" + documentComponentId + "&tick=" + incrementNum);
|
|
3867
|
+
}
|
|
3868
|
+
})), spreadSheetAddress != null && /*#__PURE__*/_react["default"].createElement(SpreadsheetViewer, {
|
|
3869
|
+
ref: spreadSheetRef,
|
|
3870
|
+
url: spreadSheetAddress,
|
|
3871
|
+
advanceQuery: advanceQuery,
|
|
3872
|
+
currentUser: currentUser,
|
|
3873
|
+
hideToolbar: true,
|
|
3874
|
+
loadedUser: true,
|
|
3875
|
+
onFocusLocationChanged: function onFocusLocationChanged(rowId, columnId) {
|
|
3876
|
+
|
|
3877
|
+
// apiService().post("/SpreadSheet/FocusLocationChanged", {
|
|
3878
|
+
// userId: currentUser.id,
|
|
3879
|
+
// rowId: rowId,
|
|
3880
|
+
// column: columnId
|
|
3881
|
+
// });
|
|
3882
|
+
},
|
|
3883
|
+
onChange: function onChange(row, rowId, fieldName, value) {
|
|
3884
|
+
|
|
3885
|
+
// apiService().put("/SpreadSheet/CellChanged", {
|
|
3886
|
+
// id: row.Id,
|
|
3887
|
+
// rowId: rowId,
|
|
3888
|
+
// fieldName: fieldName,
|
|
3889
|
+
// value: value.toString()
|
|
3890
|
+
// });
|
|
3891
|
+
}
|
|
3892
|
+
})), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
3893
|
+
onClick: function onClick() {
|
|
3894
|
+
setShowPreviewDialog(false);
|
|
3895
|
+
}
|
|
3896
|
+
}, "Cancel"), /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
3897
|
+
variant: "contained",
|
|
3898
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
3899
|
+
var publishedRows, response;
|
|
3900
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
3901
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
3902
|
+
case 0:
|
|
3903
|
+
publishedRows = spreadSheetRef.current.getRows(); // publishedRows.forEach(element => {
|
|
3904
|
+
// alert(JSON.stringify(element));
|
|
3905
|
+
// });
|
|
3906
|
+
_context4.next = 3;
|
|
3907
|
+
return apiService().post("/DocumentMapping/Publish", {
|
|
3908
|
+
companyId: currentUser.companyId,
|
|
3909
|
+
documentId: documentId,
|
|
3910
|
+
publishedRows: publishedRows
|
|
3911
|
+
});
|
|
3912
|
+
case 3:
|
|
3913
|
+
response = _context4.sent;
|
|
3914
|
+
if (response != null && response.status == 200) {
|
|
3915
|
+
setShowPreviewDialog(false);
|
|
3916
|
+
if (onPublished != null) {
|
|
3917
|
+
onPublished();
|
|
3918
|
+
}
|
|
3919
|
+
} else {
|
|
3920
|
+
alert(JSON.stringify(response.data));
|
|
3921
|
+
}
|
|
3922
|
+
case 5:
|
|
3923
|
+
case "end":
|
|
3924
|
+
return _context4.stop();
|
|
3925
|
+
}
|
|
3926
|
+
}, _callee4);
|
|
3927
|
+
}))
|
|
3928
|
+
}, "Publish"))));
|
|
3929
|
+
}
|
|
3930
|
+
"use strict";
|
|
3931
|
+
|
|
3932
|
+
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); }
|
|
3933
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3934
|
+
value: true
|
|
3935
|
+
});
|
|
3936
|
+
exports["default"] = ConditionBasedTool;
|
|
3937
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
3938
|
+
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
3939
|
+
var _system = require("@mui/system");
|
|
3940
|
+
var _Accordion = _interopRequireDefault(require("@mui/material/Accordion"));
|
|
3941
|
+
var _AccordionSummary = _interopRequireDefault(require("@mui/material/AccordionSummary"));
|
|
3942
|
+
var _AccordionDetails = _interopRequireDefault(require("@mui/material/AccordionDetails"));
|
|
3943
|
+
var _ExpandMore = _interopRequireDefault(require("@mui/icons-material/ExpandMore"));
|
|
3944
|
+
var _reactQuerybuilder = require("react-querybuilder");
|
|
3945
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
3946
|
+
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); }
|
|
3947
|
+
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; }
|
|
3948
|
+
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; }
|
|
3949
|
+
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); } }
|
|
3950
|
+
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); }); }; }
|
|
3951
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3952
|
+
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."); }
|
|
3953
|
+
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); }
|
|
3954
|
+
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; }
|
|
3955
|
+
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; } }
|
|
3956
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import { apiService, FileUploader} from 'authscape';
|
|
3957
|
+
function ConditionBasedTool(_ref) {
|
|
3958
|
+
var toColumnOptions = _ref.toColumnOptions,
|
|
3959
|
+
documentId = _ref.documentId,
|
|
3960
|
+
onConditionApplied = _ref.onConditionApplied;
|
|
3961
|
+
var _useState = (0, _react.useState)(null),
|
|
3962
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
3963
|
+
currentQuery = _useState2[0],
|
|
3964
|
+
setCurrentQuery = _useState2[1];
|
|
3965
|
+
|
|
3966
|
+
// const fields = [
|
|
3967
|
+
// { name: 'firstName', label: 'First Name' },
|
|
3968
|
+
// { name: 'lastName', label: 'Last Name' }
|
|
3969
|
+
// ];
|
|
3970
|
+
|
|
3971
|
+
(0, _react.useEffect)(function () {
|
|
3972
|
+
if (documentId != null) {
|
|
3973
|
+
var fetchData = /*#__PURE__*/function () {
|
|
3974
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
3975
|
+
var response;
|
|
3976
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3977
|
+
while (1) switch (_context.prev = _context.next) {
|
|
3978
|
+
case 0:
|
|
3979
|
+
_context.next = 2;
|
|
3980
|
+
return apiService().get("/DocumentMapping/GetRules?documentComponentId=" + documentId);
|
|
3981
|
+
case 2:
|
|
3982
|
+
response = _context.sent;
|
|
3983
|
+
if (response != null && response.status == 200) {
|
|
3984
|
+
if (response.data != null && response.data != "") {
|
|
3985
|
+
setCurrentQuery(response.data);
|
|
3986
|
+
} else {
|
|
3987
|
+
setCurrentQuery(null);
|
|
3988
|
+
}
|
|
3989
|
+
}
|
|
3990
|
+
case 4:
|
|
3991
|
+
case "end":
|
|
3992
|
+
return _context.stop();
|
|
3993
|
+
}
|
|
3994
|
+
}, _callee);
|
|
3995
|
+
}));
|
|
3996
|
+
return function fetchData() {
|
|
3997
|
+
return _ref2.apply(this, arguments);
|
|
3998
|
+
};
|
|
3999
|
+
}();
|
|
4000
|
+
fetchData();
|
|
4001
|
+
}
|
|
4002
|
+
}, [documentId]);
|
|
4003
|
+
var getFields = function getFields() {
|
|
4004
|
+
var fields = [];
|
|
4005
|
+
for (var index = 0; index < toColumnOptions.length; index++) {
|
|
4006
|
+
var toColumn = toColumnOptions[index];
|
|
4007
|
+
if (toColumn.isMapped)
|
|
4008
|
+
// only show filters that are mapped
|
|
4009
|
+
{
|
|
4010
|
+
fields.push({
|
|
4011
|
+
name: toColumn.name,
|
|
4012
|
+
label: toColumn.visibleName
|
|
4013
|
+
});
|
|
4014
|
+
}
|
|
4015
|
+
}
|
|
4016
|
+
return fields;
|
|
4017
|
+
};
|
|
4018
|
+
var customOperators = [{
|
|
4019
|
+
name: 'contains',
|
|
4020
|
+
label: 'Contains'
|
|
4021
|
+
}, {
|
|
4022
|
+
name: 'notContains',
|
|
4023
|
+
label: 'Does not contain'
|
|
4024
|
+
}];
|
|
4025
|
+
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"], {
|
|
4026
|
+
expandIcon: /*#__PURE__*/_react["default"].createElement(_ExpandMore["default"], null),
|
|
4027
|
+
"aria-controls": "panel1-content",
|
|
4028
|
+
id: "panel1-header"
|
|
4029
|
+
}, "Advance filtering"), /*#__PURE__*/_react["default"].createElement(_AccordionDetails["default"], null, /*#__PURE__*/_react["default"].createElement(_reactQuerybuilder.QueryBuilder, {
|
|
4030
|
+
fields: getFields(),
|
|
4031
|
+
operators: customOperators,
|
|
4032
|
+
query: currentQuery,
|
|
4033
|
+
onQueryChange: setCurrentQuery
|
|
4034
|
+
}), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4035
|
+
variant: "contained",
|
|
4036
|
+
sx: {
|
|
4037
|
+
marginTop: 1
|
|
4038
|
+
},
|
|
4039
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
4040
|
+
var response;
|
|
4041
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
4042
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
4043
|
+
case 0:
|
|
4044
|
+
_context2.next = 2;
|
|
4045
|
+
return apiService().put("/DocumentMapping/ApplyFilterForViewer", {
|
|
4046
|
+
documentComponentId: documentId,
|
|
4047
|
+
rules: JSON.stringify(currentQuery)
|
|
4048
|
+
});
|
|
4049
|
+
case 2:
|
|
4050
|
+
response = _context2.sent;
|
|
4051
|
+
if (response != null && response.status == 200) {
|
|
4052
|
+
onConditionApplied(currentQuery);
|
|
4053
|
+
}
|
|
4054
|
+
case 4:
|
|
4055
|
+
case "end":
|
|
4056
|
+
return _context2.stop();
|
|
4057
|
+
}
|
|
4058
|
+
}, _callee2);
|
|
4059
|
+
}))
|
|
4060
|
+
}, "Apply Filter")))));
|
|
4061
|
+
}
|
|
4062
|
+
"use strict";
|
|
4063
|
+
|
|
4064
|
+
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); }
|
|
4065
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4066
|
+
value: true
|
|
4067
|
+
});
|
|
4068
|
+
exports["default"] = Datasources;
|
|
4069
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
4070
|
+
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
4071
|
+
var _system = require("@mui/system");
|
|
4072
|
+
var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
|
|
4073
|
+
var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions"));
|
|
4074
|
+
var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
|
|
4075
|
+
var _DialogContentText = _interopRequireDefault(require("@mui/material/DialogContentText"));
|
|
4076
|
+
var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
|
|
4077
|
+
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
4078
|
+
var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
|
|
4079
|
+
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
4080
|
+
var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
|
|
4081
|
+
var _Select = _interopRequireDefault(require("@mui/material/Select"));
|
|
4082
|
+
var _Radio = _interopRequireDefault(require("@mui/material/Radio"));
|
|
4083
|
+
var _RadioGroup = _interopRequireDefault(require("@mui/material/RadioGroup"));
|
|
4084
|
+
var _FormControlLabel = _interopRequireDefault(require("@mui/material/FormControlLabel"));
|
|
4085
|
+
var _FormLabel = _interopRequireDefault(require("@mui/material/FormLabel"));
|
|
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); }); }; }
|
|
4092
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4093
|
+
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."); }
|
|
4094
|
+
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); }
|
|
4095
|
+
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; }
|
|
4096
|
+
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; } }
|
|
4097
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import {apiService, authService, StripeConnect, ReactDraft, EditableDatagrid, FileUploader} from 'authscape';
|
|
4098
|
+
function Datasources(_ref) {
|
|
4099
|
+
var _ref$disableTraining = _ref.disableTraining,
|
|
4100
|
+
disableTraining = _ref$disableTraining === void 0 ? false : _ref$disableTraining;
|
|
4101
|
+
var documentColumns = [{
|
|
4102
|
+
field: 'name',
|
|
4103
|
+
headerName: 'Name',
|
|
4104
|
+
width: 150,
|
|
4105
|
+
editable: false
|
|
4106
|
+
}, {
|
|
4107
|
+
field: "type",
|
|
4108
|
+
type: "actions",
|
|
4109
|
+
width: 200,
|
|
4110
|
+
flex: 1,
|
|
4111
|
+
headerName: "Data Source",
|
|
4112
|
+
getActions: function getActions(_ref2) {
|
|
4113
|
+
var id = _ref2.id,
|
|
4114
|
+
row = _ref2.row;
|
|
4115
|
+
return [/*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4116
|
+
sx: {
|
|
4117
|
+
textAlign: "left"
|
|
4118
|
+
}
|
|
4119
|
+
}, row.type == 0 ? "Database" : "", row.type == 1 ? "Dynamic Mapping" : "", row.type == 2 ? "Custom Model" : "")];
|
|
4120
|
+
}
|
|
4121
|
+
}, {
|
|
4122
|
+
field: "Detail",
|
|
4123
|
+
type: "actions",
|
|
4124
|
+
width: 200,
|
|
4125
|
+
flex: 1,
|
|
4126
|
+
headerName: "Mapping To",
|
|
4127
|
+
getActions: function getActions(_ref3) {
|
|
4128
|
+
var id = _ref3.id,
|
|
4129
|
+
row = _ref3.row;
|
|
4130
|
+
return [/*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4131
|
+
sx: {
|
|
4132
|
+
textAlign: "left"
|
|
4133
|
+
}
|
|
4134
|
+
}, 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) : "")];
|
|
4135
|
+
}
|
|
4136
|
+
}
|
|
4137
|
+
// {
|
|
4138
|
+
// field: "actions",
|
|
4139
|
+
// type: "actions",
|
|
4140
|
+
// width: 200,
|
|
4141
|
+
// headerName: "Archive",
|
|
4142
|
+
// cellClassName: "actions",
|
|
4143
|
+
// getActions: ({ id, row }) => {
|
|
4144
|
+
// return [
|
|
4145
|
+
// <GridActionsCellItem key={id}
|
|
4146
|
+
// icon={<DeleteRoundedIcon />}
|
|
4147
|
+
// label="Archive"
|
|
4148
|
+
// className="textPrimary"
|
|
4149
|
+
// onClick={async () => {
|
|
4150
|
+
|
|
4151
|
+
// let documentMappingId = "";
|
|
4152
|
+
// let documentComponentId = "";
|
|
4153
|
+
|
|
4154
|
+
// // archive the column
|
|
4155
|
+
// await apiService().delete("/DocumentMapping/RemoveColumnFromDocumentComponent?documentMappingId=" + documentMappingId + "&documentComponentId=" + documentComponentId)
|
|
4156
|
+
|
|
4157
|
+
// }}
|
|
4158
|
+
// />,
|
|
4159
|
+
// ];
|
|
4160
|
+
// },
|
|
4161
|
+
// }
|
|
4162
|
+
];
|
|
4163
|
+
|
|
4164
|
+
var refDatabaseTableSelect = (0, _react.useRef)(null);
|
|
4165
|
+
var refNewDocTypeName = (0, _react.useRef)(null);
|
|
4166
|
+
var _useState = (0, _react.useState)(0),
|
|
4167
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
4168
|
+
dataGridRefreshKey = _useState2[0],
|
|
4169
|
+
setDataGridRefreshKey = _useState2[1];
|
|
4170
|
+
var _useState3 = (0, _react.useState)(null),
|
|
4171
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
4172
|
+
document = _useState4[0],
|
|
4173
|
+
setDocument = _useState4[1];
|
|
4174
|
+
var _useState5 = (0, _react.useState)(false),
|
|
4175
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
4176
|
+
showDatasource = _useState6[0],
|
|
4177
|
+
setShowDatasource = _useState6[1];
|
|
4178
|
+
var _useState7 = (0, _react.useState)(null),
|
|
4179
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
4180
|
+
databaseTables = _useState8[0],
|
|
4181
|
+
setDatabaseTables = _useState8[1];
|
|
4182
|
+
var _useState9 = (0, _react.useState)("database"),
|
|
4183
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
4184
|
+
mappingType = _useState10[0],
|
|
4185
|
+
setMappingType = _useState10[1];
|
|
4186
|
+
var refTypeName = (0, _react.useRef)(null);
|
|
4187
|
+
var refAssemblyFullName = (0, _react.useRef)(null);
|
|
4188
|
+
(0, _react.useEffect)(function () {
|
|
4189
|
+
var fetchData = /*#__PURE__*/function () {
|
|
4190
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
4191
|
+
var response;
|
|
4192
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
4193
|
+
while (1) switch (_context.prev = _context.next) {
|
|
4194
|
+
case 0:
|
|
4195
|
+
_context.next = 2;
|
|
4196
|
+
return apiService().get("/DocumentMapping/GetTablesFromDatabase");
|
|
4197
|
+
case 2:
|
|
4198
|
+
response = _context.sent;
|
|
4199
|
+
if (response != null && response.status == 200) {
|
|
4200
|
+
setDatabaseTables(response.data);
|
|
4201
|
+
}
|
|
4202
|
+
case 4:
|
|
4203
|
+
case "end":
|
|
4204
|
+
return _context.stop();
|
|
4205
|
+
}
|
|
4206
|
+
}, _callee);
|
|
4207
|
+
}));
|
|
4208
|
+
return function fetchData() {
|
|
4209
|
+
return _ref4.apply(this, arguments);
|
|
4210
|
+
};
|
|
4211
|
+
}();
|
|
4212
|
+
fetchData();
|
|
4213
|
+
}, []);
|
|
4214
|
+
return /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4215
|
+
sx: {
|
|
4216
|
+
marginTop: 6
|
|
4217
|
+
}
|
|
4218
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, null, !disableTraining && /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4219
|
+
sx: {
|
|
4220
|
+
textAlign: "right",
|
|
4221
|
+
marginBottom: 2
|
|
4222
|
+
}
|
|
4223
|
+
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4224
|
+
variant: "contained",
|
|
4225
|
+
onClick: function onClick() {
|
|
4226
|
+
setShowDatasource(true);
|
|
4227
|
+
}
|
|
4228
|
+
}, "Add Data Source")), /*#__PURE__*/_react["default"].createElement(EditableDatagrid, {
|
|
4229
|
+
key: dataGridRefreshKey,
|
|
4230
|
+
loadedUser: true,
|
|
4231
|
+
url: "/DocumentMapping/GetDocumentTypes",
|
|
4232
|
+
columns: documentColumns
|
|
4233
|
+
})), /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
4234
|
+
open: showDatasource,
|
|
4235
|
+
onClose: function onClose() {
|
|
4236
|
+
setShowDatasource(false);
|
|
4237
|
+
},
|
|
4238
|
+
"aria-labelledby": "alert-dialog-title",
|
|
4239
|
+
"aria-describedby": "alert-dialog-description"
|
|
4240
|
+
}, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
|
|
4241
|
+
id: "alert-dialog-title"
|
|
4242
|
+
}, "Data Source"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], {
|
|
4243
|
+
id: "alert-dialog-description"
|
|
4244
|
+
}, "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, {
|
|
4245
|
+
sx: {
|
|
4246
|
+
marginTop: 3
|
|
4247
|
+
}
|
|
4248
|
+
}, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
4249
|
+
inputRef: refNewDocTypeName,
|
|
4250
|
+
label: "Name for data source",
|
|
4251
|
+
variant: "outlined",
|
|
4252
|
+
fullWidth: true
|
|
4253
|
+
})), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4254
|
+
sx: {
|
|
4255
|
+
marginTop: 2
|
|
4256
|
+
}
|
|
4257
|
+
}, /*#__PURE__*/_react["default"].createElement(_FormControl["default"], null, /*#__PURE__*/_react["default"].createElement(_FormLabel["default"], {
|
|
4258
|
+
id: "demo-row-radio-buttons-group-label"
|
|
4259
|
+
}, "How the data will connect:"), /*#__PURE__*/_react["default"].createElement(_RadioGroup["default"], {
|
|
4260
|
+
value: mappingType,
|
|
4261
|
+
row: true,
|
|
4262
|
+
"aria-labelledby": "demo-row-radio-buttons-group-label",
|
|
4263
|
+
name: "row-radio-buttons-group",
|
|
4264
|
+
onChange: function onChange(env) {
|
|
4265
|
+
setMappingType(env.currentTarget.value);
|
|
4266
|
+
}
|
|
4267
|
+
}, /*#__PURE__*/_react["default"].createElement(_FormControlLabel["default"], {
|
|
4268
|
+
value: "database",
|
|
4269
|
+
control: /*#__PURE__*/_react["default"].createElement(_Radio["default"], null),
|
|
4270
|
+
label: "Database"
|
|
4271
|
+
}), /*#__PURE__*/_react["default"].createElement(_FormControlLabel["default"], {
|
|
4272
|
+
value: "mappingTable",
|
|
4273
|
+
control: /*#__PURE__*/_react["default"].createElement(_Radio["default"], null),
|
|
4274
|
+
label: "Dynamic Mapping Table"
|
|
4275
|
+
}), /*#__PURE__*/_react["default"].createElement(_FormControlLabel["default"], {
|
|
4276
|
+
value: "customModelMapping",
|
|
4277
|
+
control: /*#__PURE__*/_react["default"].createElement(_Radio["default"], null),
|
|
4278
|
+
label: "Custom Model"
|
|
4279
|
+
})))), mappingType == "database" && /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4280
|
+
sx: {
|
|
4281
|
+
marginTop: 2
|
|
4282
|
+
}
|
|
4283
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4284
|
+
sx: {
|
|
4285
|
+
minWidth: 120
|
|
4286
|
+
}
|
|
4287
|
+
}, /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
|
|
4288
|
+
fullWidth: true
|
|
4289
|
+
}, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
|
|
4290
|
+
id: "demo-simple-select-label"
|
|
4291
|
+
}, "Database Tables"), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
4292
|
+
inputRef: refDatabaseTableSelect,
|
|
4293
|
+
labelId: "demo-simple-select-label",
|
|
4294
|
+
label: "Age"
|
|
4295
|
+
}, databaseTables != null && databaseTables.map(function (table, index) {
|
|
4296
|
+
return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
4297
|
+
value: table.tableName
|
|
4298
|
+
}, table.tableName);
|
|
4299
|
+
}))))), mappingType == "customModelMapping" && /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4300
|
+
sx: {
|
|
4301
|
+
marginTop: 2
|
|
4302
|
+
}
|
|
4303
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4304
|
+
sx: {
|
|
4305
|
+
minWidth: 120
|
|
4306
|
+
}
|
|
4307
|
+
}, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
4308
|
+
inputRef: refTypeName,
|
|
4309
|
+
label: "Type Name (Example: API.Controllers.InvoiceUpload)",
|
|
4310
|
+
variant: "outlined",
|
|
4311
|
+
fullWidth: true,
|
|
4312
|
+
sx: {
|
|
4313
|
+
marginTop: 1
|
|
4314
|
+
}
|
|
4315
|
+
}), /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
4316
|
+
inputRef: refAssemblyFullName,
|
|
4317
|
+
label: "Assembly Full Name (Example: API)",
|
|
4318
|
+
variant: "outlined",
|
|
4319
|
+
fullWidth: true,
|
|
4320
|
+
sx: {
|
|
4321
|
+
marginTop: 1
|
|
4322
|
+
}
|
|
4323
|
+
})))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4324
|
+
onClick: function onClick() {
|
|
4325
|
+
setShowDatasource(false);
|
|
4326
|
+
}
|
|
4327
|
+
}, "Cancel"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4328
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
4329
|
+
var response, _response;
|
|
4330
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
4331
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
4332
|
+
case 0:
|
|
4333
|
+
if (!(mappingType == "customModelMapping")) {
|
|
4334
|
+
_context2.next = 7;
|
|
4335
|
+
break;
|
|
4336
|
+
}
|
|
4337
|
+
_context2.next = 3;
|
|
4338
|
+
return apiService().post("/DocumentMapping/AddDataSource", {
|
|
4339
|
+
name: refNewDocTypeName.current.value,
|
|
4340
|
+
dataTable: refNewDocTypeName.current.value,
|
|
4341
|
+
documentType: 2,
|
|
4342
|
+
typeName: refTypeName.current.value,
|
|
4343
|
+
assemblyFullName: refAssemblyFullName.current.value
|
|
4344
|
+
});
|
|
4345
|
+
case 3:
|
|
4346
|
+
response = _context2.sent;
|
|
4347
|
+
if (response != null && response.data.error != null) {
|
|
4348
|
+
alert(response.data.error);
|
|
4349
|
+
} else {
|
|
4350
|
+
if (response != null && (response.status == 204 || response.status == 200)) {
|
|
4351
|
+
setDataGridRefreshKey(dataGridRefreshKey + 1);
|
|
4352
|
+
setShowDatasource(false);
|
|
4353
|
+
}
|
|
4354
|
+
}
|
|
4355
|
+
_context2.next = 11;
|
|
4356
|
+
break;
|
|
4357
|
+
case 7:
|
|
4358
|
+
_context2.next = 9;
|
|
4359
|
+
return apiService().post("/DocumentMapping/AddDataSource", {
|
|
4360
|
+
name: refNewDocTypeName.current.value,
|
|
4361
|
+
dataTable: refDatabaseTableSelect.current != null ? refDatabaseTableSelect.current.value : "",
|
|
4362
|
+
documentType: mappingType == "database" ? 0 : 1
|
|
4363
|
+
});
|
|
4364
|
+
case 9:
|
|
4365
|
+
_response = _context2.sent;
|
|
4366
|
+
if (_response != null && (_response.status == 204 || _response.status == 200)) {
|
|
4367
|
+
setDataGridRefreshKey(dataGridRefreshKey + 1);
|
|
4368
|
+
setShowDatasource(false);
|
|
4369
|
+
}
|
|
4370
|
+
case 11:
|
|
4371
|
+
case "end":
|
|
4372
|
+
return _context2.stop();
|
|
4373
|
+
}
|
|
4374
|
+
}, _callee2);
|
|
4375
|
+
}))
|
|
4376
|
+
}, "Add Data Source"))));
|
|
4377
|
+
}
|
|
4378
|
+
"use strict";
|
|
4379
|
+
|
|
4380
|
+
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); }
|
|
4381
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4382
|
+
value: true
|
|
4383
|
+
});
|
|
4384
|
+
exports["default"] = FileMapping;
|
|
4385
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
4386
|
+
var _system = require("@mui/system");
|
|
4387
|
+
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); }
|
|
4388
|
+
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; }
|
|
4389
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4390
|
+
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."); }
|
|
4391
|
+
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); }
|
|
4392
|
+
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; }
|
|
4393
|
+
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; } }
|
|
4394
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
4395
|
+
// import ManageMappingDocuments from './manageMappingDocuments';
|
|
4396
|
+
// import AssignMapping from './AssignMapping';
|
|
4397
|
+
function FileMapping(_ref) {
|
|
4398
|
+
var currentUser = _ref.currentUser,
|
|
4399
|
+
hideDocumentManager = _ref.hideDocumentManager;
|
|
4400
|
+
var _useState = (0, _react.useState)(null),
|
|
4401
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
4402
|
+
documentComponentId = _useState2[0],
|
|
4403
|
+
setDocumentComponentId = _useState2[1];
|
|
4404
|
+
return /*#__PURE__*/_react["default"].createElement(_system.Box, null, documentComponentId == null && /*#__PURE__*/_react["default"].createElement(ManageMappingDocuments, {
|
|
4405
|
+
hideDocumentManager: hideDocumentManager,
|
|
4406
|
+
companyId: currentUser != null ? currentUser.companyId : null,
|
|
4407
|
+
onManageField: function onManageField(documentComponentId) {
|
|
4408
|
+
setDocumentComponentId(documentComponentId);
|
|
4409
|
+
},
|
|
4410
|
+
onArchive: function onArchive(documentComponentId) {
|
|
4411
|
+
|
|
4412
|
+
//alert(documentComponentId);
|
|
4413
|
+
}
|
|
4414
|
+
}), documentComponentId != null && /*#__PURE__*/_react["default"].createElement(AssignMapping, {
|
|
4415
|
+
currentUser: currentUser,
|
|
4416
|
+
documentComponentId: documentComponentId,
|
|
4417
|
+
onCancel: function onCancel() {
|
|
4418
|
+
setDocumentComponentId(null);
|
|
4419
|
+
},
|
|
4420
|
+
onPublished: function onPublished() {
|
|
4421
|
+
setDocumentComponentId(null);
|
|
4422
|
+
}
|
|
4423
|
+
}));
|
|
4424
|
+
}
|
|
4425
|
+
"use strict";
|
|
4426
|
+
|
|
4427
|
+
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); }
|
|
4428
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4429
|
+
value: true
|
|
4430
|
+
});
|
|
4431
|
+
exports["default"] = ManageMappingDocuments;
|
|
4432
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
4433
|
+
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
4434
|
+
var _system = require("@mui/system");
|
|
4435
|
+
var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
|
|
4436
|
+
var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions"));
|
|
4437
|
+
var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
|
|
4438
|
+
var _DialogContentText = _interopRequireDefault(require("@mui/material/DialogContentText"));
|
|
4439
|
+
var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
|
|
4440
|
+
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
4441
|
+
var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
|
|
4442
|
+
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
4443
|
+
var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
|
|
4444
|
+
var _Select = _interopRequireDefault(require("@mui/material/Select"));
|
|
4445
|
+
var _xDataGrid = require("@mui/x-data-grid");
|
|
4446
|
+
var _DeleteRounded = _interopRequireDefault(require("@mui/icons-material/DeleteRounded"));
|
|
4447
|
+
var _ListRounded = _interopRequireDefault(require("@mui/icons-material/ListRounded"));
|
|
4448
|
+
var _PublishRounded = _interopRequireDefault(require("@mui/icons-material/PublishRounded"));
|
|
4449
|
+
var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
|
|
4450
|
+
var _DownloadRounded = _interopRequireDefault(require("@mui/icons-material/DownloadRounded"));
|
|
4451
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
4452
|
+
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); }
|
|
4453
|
+
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; }
|
|
4454
|
+
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; }
|
|
4455
|
+
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); } }
|
|
4456
|
+
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); }); }; }
|
|
4457
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4458
|
+
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."); }
|
|
4459
|
+
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); }
|
|
4460
|
+
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; }
|
|
4461
|
+
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; } }
|
|
4462
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import {apiService, authService, StripeConnect, ReactDraft, EditableDatagrid, FileUploader} from 'authscape';
|
|
4463
|
+
function ManageMappingDocuments(_ref) {
|
|
4464
|
+
var _ref$hideDocumentMana = _ref.hideDocumentManager,
|
|
4465
|
+
hideDocumentManager = _ref$hideDocumentMana === void 0 ? false : _ref$hideDocumentMana,
|
|
4466
|
+
_ref$companyId = _ref.companyId,
|
|
4467
|
+
companyId = _ref$companyId === void 0 ? null : _ref$companyId,
|
|
4468
|
+
_ref$locationId = _ref.locationId,
|
|
4469
|
+
locationId = _ref$locationId === void 0 ? null : _ref$locationId,
|
|
4470
|
+
_ref$userId = _ref.userId,
|
|
4471
|
+
userId = _ref$userId === void 0 ? null : _ref$userId,
|
|
4472
|
+
_ref$onManageField = _ref.onManageField,
|
|
4473
|
+
onManageField = _ref$onManageField === void 0 ? null : _ref$onManageField,
|
|
4474
|
+
_ref$onArchive = _ref.onArchive,
|
|
4475
|
+
onArchive = _ref$onArchive === void 0 ? null : _ref$onArchive;
|
|
4476
|
+
var _useState = (0, _react.useState)(null),
|
|
4477
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
4478
|
+
document = _useState2[0],
|
|
4479
|
+
setDocument = _useState2[1];
|
|
4480
|
+
var _useState3 = (0, _react.useState)(false),
|
|
4481
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
4482
|
+
addColumnDialog = _useState4[0],
|
|
4483
|
+
setAddColumnDialog = _useState4[1];
|
|
4484
|
+
var _useState5 = (0, _react.useState)(false),
|
|
4485
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
4486
|
+
showAddNewDocument = _useState6[0],
|
|
4487
|
+
setShowAddNewDocument = _useState6[1];
|
|
4488
|
+
var _useState7 = (0, _react.useState)(false),
|
|
4489
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
4490
|
+
showTrainingDocument = _useState8[0],
|
|
4491
|
+
setShowTrainingDocument = _useState8[1];
|
|
4492
|
+
var _useState9 = (0, _react.useState)(''),
|
|
4493
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
4494
|
+
columnName = _useState10[0],
|
|
4495
|
+
setColumnName = _useState10[1];
|
|
4496
|
+
var _useState11 = (0, _react.useState)(null),
|
|
4497
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
4498
|
+
selectedAddedColumn = _useState12[0],
|
|
4499
|
+
setSelectedAddedColumn = _useState12[1];
|
|
4500
|
+
var _useState13 = (0, _react.useState)(null),
|
|
4501
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
4502
|
+
documentMappingColumns = _useState14[0],
|
|
4503
|
+
setDocumentMappingColumns = _useState14[1];
|
|
4504
|
+
var _useState15 = (0, _react.useState)(null),
|
|
4505
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
4506
|
+
toColumnOptions = _useState16[0],
|
|
4507
|
+
setToColumnOptions = _useState16[1];
|
|
4508
|
+
var _useState17 = (0, _react.useState)(null),
|
|
4509
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
4510
|
+
removeDocument = _useState18[0],
|
|
4511
|
+
setRemoveDocument = _useState18[1];
|
|
4512
|
+
var _useState19 = (0, _react.useState)(null),
|
|
4513
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
4514
|
+
selectedDocumentComponentId = _useState20[0],
|
|
4515
|
+
setSelectedDocumentComponentId = _useState20[1];
|
|
4516
|
+
var _useState21 = (0, _react.useState)(0),
|
|
4517
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
4518
|
+
dataGridRefreshKey = _useState22[0],
|
|
4519
|
+
setDataGridRefreshKey = _useState22[1];
|
|
4520
|
+
var _useState23 = (0, _react.useState)(0),
|
|
4521
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
4522
|
+
dataGridMappingRefreshKey = _useState24[0],
|
|
4523
|
+
setDataGridMappingRefreshKey = _useState24[1];
|
|
4524
|
+
var _useState25 = (0, _react.useState)(null),
|
|
4525
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
4526
|
+
selectedDocument = _useState26[0],
|
|
4527
|
+
setSelectedDocument = _useState26[1];
|
|
4528
|
+
var _useState27 = (0, _react.useState)(0),
|
|
4529
|
+
_useState28 = _slicedToArray(_useState27, 2),
|
|
4530
|
+
status = _useState28[0],
|
|
4531
|
+
setStatus = _useState28[1];
|
|
4532
|
+
var _useState29 = (0, _react.useState)([]),
|
|
4533
|
+
_useState30 = _slicedToArray(_useState29, 2),
|
|
4534
|
+
componentTypes = _useState30[0],
|
|
4535
|
+
setComponentTypes = _useState30[1];
|
|
4536
|
+
var refHeaderRowInput = (0, _react.useRef)(null);
|
|
4537
|
+
var fileUploaderRef = (0, _react.useRef)(null);
|
|
4538
|
+
var refNewDocumentName = (0, _react.useRef)(null);
|
|
4539
|
+
var refSelectDocumentType = (0, _react.useRef)(null);
|
|
4540
|
+
var refNewColumnFileColumn = (0, _react.useRef)(null);
|
|
4541
|
+
var documentColumns = [{
|
|
4542
|
+
field: 'name',
|
|
4543
|
+
flex: 1,
|
|
4544
|
+
headerName: 'Document Name',
|
|
4545
|
+
width: 150,
|
|
4546
|
+
editable: false
|
|
4547
|
+
}, {
|
|
4548
|
+
field: 'documentTypeName',
|
|
4549
|
+
flex: 1,
|
|
4550
|
+
headerName: 'Document Type',
|
|
4551
|
+
width: 150,
|
|
4552
|
+
editable: false
|
|
4553
|
+
}, {
|
|
4554
|
+
field: "actions",
|
|
4555
|
+
type: "actions",
|
|
4556
|
+
width: 200,
|
|
4557
|
+
flex: 1,
|
|
4558
|
+
headerName: "",
|
|
4559
|
+
cellClassName: "actions",
|
|
4560
|
+
getActions: function getActions(_ref2) {
|
|
4561
|
+
var id = _ref2.id,
|
|
4562
|
+
row = _ref2.row;
|
|
4563
|
+
return [/*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4564
|
+
variant: "text",
|
|
4565
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_ListRounded["default"], null),
|
|
4566
|
+
onClick: function onClick() {
|
|
4567
|
+
if (onManageField != null) {
|
|
4568
|
+
onManageField(row.id);
|
|
4569
|
+
}
|
|
4570
|
+
}
|
|
4571
|
+
}, "Manage Fields"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4572
|
+
variant: "text",
|
|
4573
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_DownloadRounded["default"], null),
|
|
4574
|
+
onClick: function onClick() {
|
|
4575
|
+
window.open("https://view.officeapps.live.com/op/view.aspx?src=" + row.fileUri + "&wdOrigin=BROWSELINK");
|
|
4576
|
+
}
|
|
4577
|
+
}, "Download File"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4578
|
+
variant: "text",
|
|
4579
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_DeleteRounded["default"], null),
|
|
4580
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
4581
|
+
var documentMappingId;
|
|
4582
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
4583
|
+
while (1) switch (_context.prev = _context.next) {
|
|
4584
|
+
case 0:
|
|
4585
|
+
documentMappingId = row.id;
|
|
4586
|
+
setRemoveDocument({
|
|
4587
|
+
companyId: companyId,
|
|
4588
|
+
documentMappingId: documentMappingId
|
|
4589
|
+
});
|
|
4590
|
+
case 2:
|
|
4591
|
+
case "end":
|
|
4592
|
+
return _context.stop();
|
|
4593
|
+
}
|
|
4594
|
+
}, _callee);
|
|
4595
|
+
}))
|
|
4596
|
+
}, "Remove")];
|
|
4597
|
+
}
|
|
4598
|
+
}];
|
|
4599
|
+
(0, _react.useEffect)(function () {
|
|
4600
|
+
if (document != null) {
|
|
4601
|
+
var fetchData = /*#__PURE__*/function () {
|
|
4602
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
4603
|
+
var response;
|
|
4604
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
4605
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
4606
|
+
case 0:
|
|
4607
|
+
_context3.next = 2;
|
|
4608
|
+
return apiService().get("/DocumentMapping/GetMappingFieldsForDocument?documentId=" + document.id);
|
|
4609
|
+
case 2:
|
|
4610
|
+
response = _context3.sent;
|
|
4611
|
+
if (response != null) {
|
|
4612
|
+
setToColumnOptions(response.data);
|
|
4613
|
+
setDocumentMappingColumns([{
|
|
4614
|
+
field: 'name',
|
|
4615
|
+
flex: 1,
|
|
4616
|
+
headerName: 'File Column',
|
|
4617
|
+
width: 150,
|
|
4618
|
+
editable: true
|
|
4619
|
+
}, {
|
|
4620
|
+
field: 'toName',
|
|
4621
|
+
headerName: 'Upload To',
|
|
4622
|
+
flex: 1,
|
|
4623
|
+
width: 150,
|
|
4624
|
+
editable: true,
|
|
4625
|
+
type: 'singleSelect',
|
|
4626
|
+
valueOptions: response.data
|
|
4627
|
+
}, {
|
|
4628
|
+
field: "actions",
|
|
4629
|
+
type: "actions",
|
|
4630
|
+
width: 200,
|
|
4631
|
+
headerName: "Archive Fields",
|
|
4632
|
+
cellClassName: "actions",
|
|
4633
|
+
getActions: function getActions(_ref5) {
|
|
4634
|
+
var id = _ref5.id,
|
|
4635
|
+
row = _ref5.row;
|
|
4636
|
+
return [/*#__PURE__*/_react["default"].createElement(_xDataGrid.GridActionsCellItem, {
|
|
4637
|
+
key: id,
|
|
4638
|
+
icon: /*#__PURE__*/_react["default"].createElement(_DeleteRounded["default"], null),
|
|
4639
|
+
label: "Archive",
|
|
4640
|
+
className: "textPrimary",
|
|
4641
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
4642
|
+
var documentMappingId, documentComponentId, response;
|
|
4643
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
4644
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
4645
|
+
case 0:
|
|
4646
|
+
documentMappingId = row.id;
|
|
4647
|
+
documentComponentId = row.documentComponentId; // archive the column
|
|
4648
|
+
_context2.next = 4;
|
|
4649
|
+
return apiService()["delete"]("/DocumentMapping/RemoveColumnFromDocumentComponent?documentMappingId=" + documentMappingId + "&documentComponentId=" + documentComponentId);
|
|
4650
|
+
case 4:
|
|
4651
|
+
response = _context2.sent;
|
|
4652
|
+
if (response != null && response.status == 200) {
|
|
4653
|
+
setDataGridMappingRefreshKey(dataGridMappingRefreshKey + 1);
|
|
4654
|
+
}
|
|
4655
|
+
case 6:
|
|
4656
|
+
case "end":
|
|
4657
|
+
return _context2.stop();
|
|
4658
|
+
}
|
|
4659
|
+
}, _callee2);
|
|
4660
|
+
}))
|
|
4661
|
+
})];
|
|
4662
|
+
}
|
|
4663
|
+
}]);
|
|
4664
|
+
}
|
|
4665
|
+
case 4:
|
|
4666
|
+
case "end":
|
|
4667
|
+
return _context3.stop();
|
|
4668
|
+
}
|
|
4669
|
+
}, _callee3);
|
|
4670
|
+
}));
|
|
4671
|
+
return function fetchData() {
|
|
4672
|
+
return _ref4.apply(this, arguments);
|
|
4673
|
+
};
|
|
4674
|
+
}();
|
|
4675
|
+
fetchData();
|
|
4676
|
+
}
|
|
4677
|
+
}, [document]);
|
|
4678
|
+
(0, _react.useEffect)(function () {
|
|
4679
|
+
if (showAddNewDocument) {
|
|
4680
|
+
// get all document types
|
|
4681
|
+
var fetchData = /*#__PURE__*/function () {
|
|
4682
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
4683
|
+
var response;
|
|
4684
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
4685
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
4686
|
+
case 0:
|
|
4687
|
+
_context4.next = 2;
|
|
4688
|
+
return apiService().post("/DocumentMapping/GetDocumentTypes");
|
|
4689
|
+
case 2:
|
|
4690
|
+
response = _context4.sent;
|
|
4691
|
+
if (response != null && response.status == 200) {
|
|
4692
|
+
setComponentTypes(response.data.data);
|
|
4693
|
+
}
|
|
4694
|
+
case 4:
|
|
4695
|
+
case "end":
|
|
4696
|
+
return _context4.stop();
|
|
4697
|
+
}
|
|
4698
|
+
}, _callee4);
|
|
4699
|
+
}));
|
|
4700
|
+
return function fetchData() {
|
|
4701
|
+
return _ref7.apply(this, arguments);
|
|
4702
|
+
};
|
|
4703
|
+
}();
|
|
4704
|
+
fetchData();
|
|
4705
|
+
}
|
|
4706
|
+
}, [showAddNewDocument]);
|
|
4707
|
+
var GetHeaderRowData = /*#__PURE__*/function () {
|
|
4708
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(documentComponentId) {
|
|
4709
|
+
var response;
|
|
4710
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
4711
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
4712
|
+
case 0:
|
|
4713
|
+
_context5.next = 2;
|
|
4714
|
+
return apiService().get("/DocumentMapping/GetHeaderRow?documentComponentId=" + documentComponentId);
|
|
4715
|
+
case 2:
|
|
4716
|
+
response = _context5.sent;
|
|
4717
|
+
if (response != null && response.status == 200) {
|
|
4718
|
+
refHeaderRowInput.current.value = response.data;
|
|
4719
|
+
}
|
|
4720
|
+
case 4:
|
|
4721
|
+
case "end":
|
|
4722
|
+
return _context5.stop();
|
|
4723
|
+
}
|
|
4724
|
+
}, _callee5);
|
|
4725
|
+
}));
|
|
4726
|
+
return function GetHeaderRowData(_x2) {
|
|
4727
|
+
return _ref8.apply(this, arguments);
|
|
4728
|
+
};
|
|
4729
|
+
}();
|
|
4730
|
+
(0, _react.useEffect)(function () {
|
|
4731
|
+
if (status != null) {
|
|
4732
|
+
setDataGridRefreshKey(dataGridRefreshKey + 1);
|
|
4733
|
+
}
|
|
4734
|
+
}, [status]);
|
|
4735
|
+
return /*#__PURE__*/_react["default"].createElement(_system.Box, null, !hideDocumentManager && /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
4736
|
+
container: true,
|
|
4737
|
+
spacing: 2,
|
|
4738
|
+
sx: {
|
|
4739
|
+
paddingBottom: 2
|
|
4740
|
+
}
|
|
4741
|
+
}, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
4742
|
+
item: true,
|
|
4743
|
+
xs: 3
|
|
4744
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4745
|
+
sx: {
|
|
4746
|
+
minWidth: 120
|
|
4747
|
+
}
|
|
4748
|
+
}, /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
|
|
4749
|
+
fullWidth: true
|
|
4750
|
+
}, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
|
|
4751
|
+
id: "demo-simple-select-label"
|
|
4752
|
+
}, "Status"), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
4753
|
+
labelId: "demo-simple-select-label",
|
|
4754
|
+
id: "demo-simple-select",
|
|
4755
|
+
value: status,
|
|
4756
|
+
label: "Status",
|
|
4757
|
+
onChange: function onChange(event) {
|
|
4758
|
+
setStatus(event.target.value);
|
|
4759
|
+
}
|
|
4760
|
+
}, /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
4761
|
+
value: 0
|
|
4762
|
+
}, "Open"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
4763
|
+
value: 2
|
|
4764
|
+
}, "Published"), /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
4765
|
+
value: 1
|
|
4766
|
+
}, "Archived"))))), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
4767
|
+
item: true,
|
|
4768
|
+
xs: 9
|
|
4769
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4770
|
+
sx: {
|
|
4771
|
+
textAlign: "right",
|
|
4772
|
+
marginBottom: 2
|
|
4773
|
+
}
|
|
4774
|
+
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4775
|
+
variant: "contained",
|
|
4776
|
+
onClick: function onClick() {
|
|
4777
|
+
setShowAddNewDocument(true);
|
|
4778
|
+
}
|
|
4779
|
+
}, "Upload Document")))), /*#__PURE__*/_react["default"].createElement(EditableDatagrid, {
|
|
4780
|
+
key: dataGridRefreshKey,
|
|
4781
|
+
loadedUser: true,
|
|
4782
|
+
params: {
|
|
4783
|
+
companyId: companyId,
|
|
4784
|
+
userId: userId,
|
|
4785
|
+
locationId: locationId,
|
|
4786
|
+
status: status
|
|
4787
|
+
},
|
|
4788
|
+
url: "/DocumentMapping/GetDocumentComponents",
|
|
4789
|
+
columns: documentColumns
|
|
4790
|
+
})), hideDocumentManager && /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4791
|
+
variant: "contained",
|
|
4792
|
+
onClick: function onClick() {
|
|
4793
|
+
setShowAddNewDocument(true);
|
|
4794
|
+
}
|
|
4795
|
+
}, "Upload Document"), /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
4796
|
+
open: showAddNewDocument,
|
|
4797
|
+
onClose: function onClose() {
|
|
4798
|
+
setShowAddNewDocument(false);
|
|
4799
|
+
},
|
|
4800
|
+
fullWidth: true,
|
|
4801
|
+
"aria-labelledby": "alert-dialog-title",
|
|
4802
|
+
"aria-describedby": "alert-dialog-description"
|
|
4803
|
+
}, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
|
|
4804
|
+
id: "alert-dialog-title"
|
|
4805
|
+
}, "Upload Document"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], {
|
|
4806
|
+
id: "alert-dialog-description",
|
|
4807
|
+
sx: {
|
|
4808
|
+
paddingBottom: 2
|
|
4809
|
+
}
|
|
4810
|
+
}, "Please select the type of document, then click \"Choose a file\""), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4811
|
+
sx: {
|
|
4812
|
+
marginTop: 2
|
|
4813
|
+
}
|
|
4814
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4815
|
+
sx: {
|
|
4816
|
+
minWidth: 120
|
|
4817
|
+
}
|
|
4818
|
+
}, /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
|
|
4819
|
+
fullWidth: true
|
|
4820
|
+
}, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
|
|
4821
|
+
id: "demo-simple-select-label"
|
|
4822
|
+
}, "Document Type"), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
4823
|
+
labelId: "demo-simple-select-label",
|
|
4824
|
+
id: "demo-simple-select",
|
|
4825
|
+
inputRef: refSelectDocumentType,
|
|
4826
|
+
onChange: function onChange(val) {
|
|
4827
|
+
var _selectedDocument = componentTypes.find(function (s) {
|
|
4828
|
+
return s.id == val.target.value;
|
|
4829
|
+
});
|
|
4830
|
+
setSelectedDocument(_selectedDocument);
|
|
4831
|
+
},
|
|
4832
|
+
label: "DocumentType"
|
|
4833
|
+
}, componentTypes != null && componentTypes.map(function (componentType) {
|
|
4834
|
+
return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
4835
|
+
value: componentType.id
|
|
4836
|
+
}, componentType.name);
|
|
4837
|
+
}))))), selectedDocument != null && /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4838
|
+
sx: {
|
|
4839
|
+
textAlign: "center",
|
|
4840
|
+
width: "100%",
|
|
4841
|
+
display: "flex",
|
|
4842
|
+
alignItems: "center",
|
|
4843
|
+
paddingTop: 2
|
|
4844
|
+
}
|
|
4845
|
+
}, /*#__PURE__*/_react["default"].createElement(FileUploader, {
|
|
4846
|
+
refOveride: fileUploaderRef,
|
|
4847
|
+
params: {
|
|
4848
|
+
documentTypeId: selectedDocument.id,
|
|
4849
|
+
companyId: companyId
|
|
4850
|
+
},
|
|
4851
|
+
url: "/DocumentMapping/SyncDocument",
|
|
4852
|
+
multiple: true,
|
|
4853
|
+
variant: "custom",
|
|
4854
|
+
onUploadCompleted: function onUploadCompleted(responses) {
|
|
4855
|
+
if (responses.length > 0) {
|
|
4856
|
+
var row = responses[0].data;
|
|
4857
|
+
if (onManageField != null) {
|
|
4858
|
+
onManageField(row.id);
|
|
4859
|
+
}
|
|
4860
|
+
}
|
|
4861
|
+
setShowAddNewDocument(false);
|
|
4862
|
+
}
|
|
4863
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4864
|
+
sx: {
|
|
4865
|
+
display: "flex",
|
|
4866
|
+
alignItems: "center"
|
|
4867
|
+
}
|
|
4868
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4869
|
+
htmlFor: "file-upload",
|
|
4870
|
+
sx: {
|
|
4871
|
+
border: "2px dashed #aaa",
|
|
4872
|
+
padding: 20,
|
|
4873
|
+
textAlign: "center",
|
|
4874
|
+
cursor: "pointer"
|
|
4875
|
+
}
|
|
4876
|
+
}, 'Choose a file'))))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4877
|
+
onClick: function onClick() {
|
|
4878
|
+
setShowAddNewDocument(false);
|
|
4879
|
+
}
|
|
4880
|
+
}, "Cancel"))), /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
4881
|
+
open: showTrainingDocument,
|
|
4882
|
+
onClose: function onClose() {
|
|
4883
|
+
setShowTrainingDocument(false);
|
|
4884
|
+
},
|
|
4885
|
+
fullWidth: true,
|
|
4886
|
+
"aria-labelledby": "alert-dialog-title",
|
|
4887
|
+
"aria-describedby": "alert-dialog-description"
|
|
4888
|
+
}, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
|
|
4889
|
+
id: "alert-dialog-title"
|
|
4890
|
+
}, "Setup Mapping"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], {
|
|
4891
|
+
id: "alert-dialog-description"
|
|
4892
|
+
}, "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, {
|
|
4893
|
+
refOveride: fileUploaderRef,
|
|
4894
|
+
url: "/DocumentMapping/TrainDocument",
|
|
4895
|
+
params: {
|
|
4896
|
+
documentComponentId: document.id,
|
|
4897
|
+
companyId: companyId,
|
|
4898
|
+
locationId: locationId,
|
|
4899
|
+
userId: userId
|
|
4900
|
+
},
|
|
4901
|
+
multiple: false,
|
|
4902
|
+
variant: "custom",
|
|
4903
|
+
onUploadCompleted: function onUploadCompleted() {
|
|
4904
|
+
setDataGridMappingRefreshKey(dataGridMappingRefreshKey + 1);
|
|
4905
|
+
|
|
4906
|
+
// setUpdate(!update);
|
|
4907
|
+
// handleClose();
|
|
4908
|
+
}
|
|
4909
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4910
|
+
sx: {
|
|
4911
|
+
marginTop: 2,
|
|
4912
|
+
borderRadius: 2,
|
|
4913
|
+
backgroundColor: "#f5f5f5",
|
|
4914
|
+
border: "1px solid lightgray",
|
|
4915
|
+
cursor: "pointer",
|
|
4916
|
+
padding: 2
|
|
4917
|
+
}
|
|
4918
|
+
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4919
|
+
id: "FileUploader",
|
|
4920
|
+
"aria-controls": open ? 'demo-customized-menu' : undefined,
|
|
4921
|
+
"aria-haspopup": "true",
|
|
4922
|
+
"aria-expanded": open ? 'true' : undefined,
|
|
4923
|
+
variant: "text",
|
|
4924
|
+
disableElevation: true,
|
|
4925
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_PublishRounded["default"], null),
|
|
4926
|
+
sx: {
|
|
4927
|
+
marginLeft: 1
|
|
4928
|
+
}
|
|
4929
|
+
}, "Upload Sample File"))))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4930
|
+
onClick: function onClick() {
|
|
4931
|
+
setShowTrainingDocument(false);
|
|
4932
|
+
}
|
|
4933
|
+
}, "No, thank you"))), /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
4934
|
+
open: addColumnDialog,
|
|
4935
|
+
onClose: function onClose() {
|
|
4936
|
+
setAddColumnDialog(false);
|
|
4937
|
+
},
|
|
4938
|
+
fullWidth: true,
|
|
4939
|
+
"aria-labelledby": "alert-dialog-title",
|
|
4940
|
+
"aria-describedby": "alert-dialog-description"
|
|
4941
|
+
}, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
|
|
4942
|
+
id: "alert-dialog-title"
|
|
4943
|
+
}, "Add Column"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], {
|
|
4944
|
+
id: "alert-dialog-description"
|
|
4945
|
+
}, "Include a column for document mapping"), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4946
|
+
sx: {
|
|
4947
|
+
marginTop: 2
|
|
4948
|
+
}
|
|
4949
|
+
}, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
4950
|
+
inputRef: refNewColumnFileColumn,
|
|
4951
|
+
id: "outlined-basic",
|
|
4952
|
+
label: "File Column",
|
|
4953
|
+
fullWidth: true,
|
|
4954
|
+
variant: "outlined"
|
|
4955
|
+
})), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
4956
|
+
sx: {
|
|
4957
|
+
marginTop: 4
|
|
4958
|
+
}
|
|
4959
|
+
}, /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
|
|
4960
|
+
fullWidth: true
|
|
4961
|
+
}, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
|
|
4962
|
+
id: "demo-simple-select-label"
|
|
4963
|
+
}, "Column Name"), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
4964
|
+
labelId: "demo-simple-select-label",
|
|
4965
|
+
id: "demo-simple-select",
|
|
4966
|
+
value: selectedAddedColumn,
|
|
4967
|
+
label: "Column Name",
|
|
4968
|
+
onChange: function onChange(data) {
|
|
4969
|
+
setSelectedAddedColumn(data.target.value);
|
|
4970
|
+
}
|
|
4971
|
+
})))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4972
|
+
onClick: function onClick() {
|
|
4973
|
+
setAddColumnDialog(false);
|
|
4974
|
+
}
|
|
4975
|
+
}, "Cancel"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
4976
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
4977
|
+
var response;
|
|
4978
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
4979
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
4980
|
+
case 0:
|
|
4981
|
+
_context6.next = 2;
|
|
4982
|
+
return apiService().post("/DocumentMapping/AddNewField", {
|
|
4983
|
+
tableName: document.name,
|
|
4984
|
+
fieldName: refNewColumnFileColumn.current.value,
|
|
4985
|
+
fileColumn: selectedAddedColumn,
|
|
4986
|
+
companyId: companyId,
|
|
4987
|
+
locationId: locationId,
|
|
4988
|
+
userId: userId
|
|
4989
|
+
});
|
|
4990
|
+
case 2:
|
|
4991
|
+
response = _context6.sent;
|
|
4992
|
+
if (response != null && response.status == 200) {
|
|
4993
|
+
setDataGridMappingRefreshKey(dataGridMappingRefreshKey + 1);
|
|
4994
|
+
setAddColumnDialog(false);
|
|
4995
|
+
}
|
|
4996
|
+
case 4:
|
|
4997
|
+
case "end":
|
|
4998
|
+
return _context6.stop();
|
|
4999
|
+
}
|
|
5000
|
+
}, _callee6);
|
|
5001
|
+
})),
|
|
5002
|
+
autoFocus: true
|
|
5003
|
+
}, "Add Column"))), /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
5004
|
+
open: removeDocument != null ? true : false,
|
|
5005
|
+
onClose: function onClose() {
|
|
5006
|
+
setRemoveDocument(null);
|
|
5007
|
+
},
|
|
5008
|
+
fullWidth: true,
|
|
5009
|
+
"aria-labelledby": "alert-dialog-title",
|
|
5010
|
+
"aria-describedby": "alert-dialog-description"
|
|
5011
|
+
}, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
|
|
5012
|
+
id: "alert-dialog-title"
|
|
5013
|
+
}, "Remove the document"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], {
|
|
5014
|
+
id: "alert-dialog-description"
|
|
5015
|
+
}, "Are you sure you want to remove this document?")), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
5016
|
+
onClick: function onClick() {
|
|
5017
|
+
setRemoveDocument(null);
|
|
5018
|
+
}
|
|
5019
|
+
}, "Cancel"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
5020
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
5021
|
+
var response;
|
|
5022
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
5023
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
5024
|
+
case 0:
|
|
5025
|
+
response = null;
|
|
5026
|
+
if (!(companyId != null)) {
|
|
5027
|
+
_context7.next = 7;
|
|
5028
|
+
break;
|
|
5029
|
+
}
|
|
5030
|
+
_context7.next = 4;
|
|
5031
|
+
return apiService()["delete"]("/DocumentMapping/RemoveDocument?companyId=" + removeDocument.companyId + "&documentId=" + removeDocument.documentMappingId);
|
|
5032
|
+
case 4:
|
|
5033
|
+
response = _context7.sent;
|
|
5034
|
+
_context7.next = 10;
|
|
5035
|
+
break;
|
|
5036
|
+
case 7:
|
|
5037
|
+
_context7.next = 9;
|
|
5038
|
+
return apiService()["delete"]("/DocumentMapping/RemoveDocument?documentId=" + removeDocument.documentMappingId);
|
|
5039
|
+
case 9:
|
|
5040
|
+
response = _context7.sent;
|
|
5041
|
+
case 10:
|
|
5042
|
+
if (response != null && response.status == 200) {
|
|
5043
|
+
setDataGridRefreshKey(dataGridRefreshKey + 1);
|
|
5044
|
+
setRemoveDocument(null);
|
|
5045
|
+
if (onArchive != null) {
|
|
5046
|
+
onArchive(removeDocument.documentMappingId);
|
|
5047
|
+
}
|
|
5048
|
+
}
|
|
5049
|
+
case 11:
|
|
5050
|
+
case "end":
|
|
5051
|
+
return _context7.stop();
|
|
5052
|
+
}
|
|
5053
|
+
}, _callee7);
|
|
5054
|
+
}))
|
|
5055
|
+
}, "Remove Document"))));
|
|
5056
|
+
}
|
|
5057
|
+
"use strict";
|
|
5058
|
+
|
|
5059
|
+
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); }
|
|
5060
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5061
|
+
value: true
|
|
5062
|
+
});
|
|
5063
|
+
exports["default"] = MappedColumn;
|
|
5064
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
5065
|
+
var _Card = _interopRequireDefault(require("@mui/material/Card"));
|
|
5066
|
+
var _CardActions = _interopRequireDefault(require("@mui/material/CardActions"));
|
|
5067
|
+
var _CardContent = _interopRequireDefault(require("@mui/material/CardContent"));
|
|
5068
|
+
var _system = require("@mui/system");
|
|
5069
|
+
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
5070
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
5071
|
+
var _Link = _interopRequireDefault(require("@mui/icons-material/Link"));
|
|
5072
|
+
var _LinkOff = _interopRequireDefault(require("@mui/icons-material/LinkOff"));
|
|
5073
|
+
var _Stack = _interopRequireDefault(require("@mui/material/Stack"));
|
|
5074
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
5075
|
+
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); }
|
|
5076
|
+
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; }
|
|
5077
|
+
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; }
|
|
5078
|
+
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); } }
|
|
5079
|
+
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';
|
|
5080
|
+
// import MatchExistingMappedColumn from './matchExisting';
|
|
5081
|
+
// import { apiService } from 'authscape';
|
|
5082
|
+
function MappedColumn(_ref) {
|
|
5083
|
+
var companyId = _ref.companyId,
|
|
5084
|
+
documentId = _ref.documentId,
|
|
5085
|
+
documentType = _ref.documentType,
|
|
5086
|
+
documentMappingId = _ref.documentMappingId,
|
|
5087
|
+
name = _ref.name,
|
|
5088
|
+
toName = _ref.toName,
|
|
5089
|
+
isMapped = _ref.isMapped,
|
|
5090
|
+
toOptions = _ref.toOptions,
|
|
5091
|
+
onResponse = _ref.onResponse;
|
|
5092
|
+
var notMatchedColor = "#ffe5e5";
|
|
5093
|
+
var matchedColor = "#fff";
|
|
5094
|
+
return /*#__PURE__*/_react["default"].createElement(_Card["default"], {
|
|
5095
|
+
sx: {
|
|
5096
|
+
marginTop: 1
|
|
5097
|
+
}
|
|
5098
|
+
}, /*#__PURE__*/_react["default"].createElement(_CardContent["default"], {
|
|
5099
|
+
sx: {
|
|
5100
|
+
position: "relative",
|
|
5101
|
+
backgroundColor: isMapped ? notMatchedColor : matchedColor
|
|
5102
|
+
}
|
|
5103
|
+
}, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
5104
|
+
gutterBottom: true,
|
|
5105
|
+
variant: "h5",
|
|
5106
|
+
component: "div"
|
|
5107
|
+
}, name), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
5108
|
+
sx: {
|
|
5109
|
+
position: "absolute",
|
|
5110
|
+
top: "10px",
|
|
5111
|
+
right: "10px"
|
|
5112
|
+
}
|
|
5113
|
+
}, isMapped ? /*#__PURE__*/_react["default"].createElement(_Stack["default"], {
|
|
5114
|
+
direction: "row",
|
|
5115
|
+
spacing: 1
|
|
5116
|
+
}, /*#__PURE__*/_react["default"].createElement(_LinkOff["default"], null), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
5117
|
+
variant: "body2",
|
|
5118
|
+
sx: {
|
|
5119
|
+
paddingTop: 0.5
|
|
5120
|
+
}
|
|
5121
|
+
}, "Not Matched")) : /*#__PURE__*/_react["default"].createElement(_Stack["default"], {
|
|
5122
|
+
direction: "row",
|
|
5123
|
+
spacing: 1
|
|
5124
|
+
}, /*#__PURE__*/_react["default"].createElement(_Link["default"], null), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
5125
|
+
variant: "body2",
|
|
5126
|
+
sx: {
|
|
5127
|
+
paddingTop: 0.5
|
|
5128
|
+
}
|
|
5129
|
+
}, "Matched"))), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
5130
|
+
variant: "body2",
|
|
5131
|
+
color: "text.secondary"
|
|
5132
|
+
}, !isMapped && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, "This column is matched"), 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"], {
|
|
5133
|
+
sx: {
|
|
5134
|
+
backgroundColor: isMapped ? notMatchedColor : matchedColor
|
|
5135
|
+
}
|
|
5136
|
+
}, !isMapped ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
5137
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_LinkOff["default"], null),
|
|
5138
|
+
size: "small",
|
|
5139
|
+
sx: {
|
|
5140
|
+
paddingLeft: 3
|
|
5141
|
+
},
|
|
5142
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
5143
|
+
var response;
|
|
5144
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
5145
|
+
while (1) switch (_context.prev = _context.next) {
|
|
5146
|
+
case 0:
|
|
5147
|
+
_context.next = 2;
|
|
5148
|
+
return apiService()["delete"]("/DocumentMapping/RemoveMatch?companyId=" + companyId + "&documentId=" + documentId + "&documentMappingId=" + documentMappingId);
|
|
5149
|
+
case 2:
|
|
5150
|
+
response = _context.sent;
|
|
5151
|
+
if (response != null && response.status == 200) {
|
|
5152
|
+
onResponse();
|
|
5153
|
+
}
|
|
5154
|
+
case 4:
|
|
5155
|
+
case "end":
|
|
5156
|
+
return _context.stop();
|
|
5157
|
+
}
|
|
5158
|
+
}, _callee);
|
|
5159
|
+
}))
|
|
5160
|
+
}, "Remove Match")) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(MatchExistingMappedColumn, {
|
|
5161
|
+
companyId: companyId,
|
|
5162
|
+
documentId: documentId,
|
|
5163
|
+
documentMappingId: documentMappingId,
|
|
5164
|
+
fromName: name,
|
|
5165
|
+
toOptions: toOptions,
|
|
5166
|
+
onResponse: onResponse
|
|
5167
|
+
}), /*#__PURE__*/_react["default"].createElement(NewMappingColumn, {
|
|
5168
|
+
name: name,
|
|
5169
|
+
companyId: companyId,
|
|
5170
|
+
documentType: documentType,
|
|
5171
|
+
documentId: documentId,
|
|
5172
|
+
documentMappingId: documentMappingId,
|
|
5173
|
+
onResponse: onResponse
|
|
5174
|
+
}))));
|
|
5175
|
+
}
|
|
5176
|
+
"use strict";
|
|
5177
|
+
|
|
5178
|
+
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); }
|
|
5179
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5180
|
+
value: true
|
|
5181
|
+
});
|
|
5182
|
+
exports["default"] = MatchExistingMappedColumn;
|
|
5183
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
5184
|
+
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
5185
|
+
var _system = require("@mui/system");
|
|
5186
|
+
var _LinkRounded = _interopRequireDefault(require("@mui/icons-material/LinkRounded"));
|
|
5187
|
+
var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
|
|
5188
|
+
var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions"));
|
|
5189
|
+
var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
|
|
5190
|
+
var _DialogContentText = _interopRequireDefault(require("@mui/material/DialogContentText"));
|
|
5191
|
+
var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
|
|
5192
|
+
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
5193
|
+
var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
|
|
5194
|
+
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
5195
|
+
var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
|
|
5196
|
+
var _Select = _interopRequireDefault(require("@mui/material/Select"));
|
|
5197
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
5198
|
+
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); }
|
|
5199
|
+
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; }
|
|
5200
|
+
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; }
|
|
5201
|
+
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); } }
|
|
5202
|
+
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); }); }; }
|
|
5203
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5204
|
+
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."); }
|
|
5205
|
+
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); }
|
|
5206
|
+
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; }
|
|
5207
|
+
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; } }
|
|
5208
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import {apiService, authService, StripeConnect, ReactDraft, EditableDatagrid, FileUploader} from 'authscape';
|
|
5209
|
+
function MatchExistingMappedColumn(_ref) {
|
|
5210
|
+
var companyId = _ref.companyId,
|
|
5211
|
+
documentId = _ref.documentId,
|
|
5212
|
+
documentMappingId = _ref.documentMappingId,
|
|
5213
|
+
fromName = _ref.fromName,
|
|
5214
|
+
toOptions = _ref.toOptions,
|
|
5215
|
+
onResponse = _ref.onResponse;
|
|
5216
|
+
var _useState = (0, _react.useState)(false),
|
|
5217
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
5218
|
+
createNewOpen = _useState2[0],
|
|
5219
|
+
setCreateNewOpen = _useState2[1];
|
|
5220
|
+
var _useState3 = (0, _react.useState)(false),
|
|
5221
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
5222
|
+
onlyAddRowIfFound = _useState4[0],
|
|
5223
|
+
setOnlyAddRowIfFound = _useState4[1];
|
|
5224
|
+
var _useState5 = (0, _react.useState)(false),
|
|
5225
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
5226
|
+
rememberForNextTime = _useState6[0],
|
|
5227
|
+
setRememberForNextTime = _useState6[1];
|
|
5228
|
+
var _useState7 = (0, _react.useState)(null),
|
|
5229
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
5230
|
+
selectedToColumn = _useState8[0],
|
|
5231
|
+
setSelectedToColumn = _useState8[1];
|
|
5232
|
+
var handleClose = function handleClose() {
|
|
5233
|
+
setCreateNewOpen(false);
|
|
5234
|
+
};
|
|
5235
|
+
var SelectedExistingColumns = function SelectedExistingColumns(_ref2) {
|
|
5236
|
+
var toOptions = _ref2.toOptions;
|
|
5237
|
+
return /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
5238
|
+
sx: {
|
|
5239
|
+
minWidth: 120
|
|
5240
|
+
}
|
|
5241
|
+
}, /*#__PURE__*/_react["default"].createElement(_FormControl["default"], {
|
|
5242
|
+
fullWidth: true
|
|
5243
|
+
}, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
|
|
5244
|
+
id: "demo-simple-select-label"
|
|
5245
|
+
}, "Match to column"), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
5246
|
+
labelId: "demo-simple-select-label",
|
|
5247
|
+
id: "demo-simple-select",
|
|
5248
|
+
value: selectedToColumn,
|
|
5249
|
+
label: "Age",
|
|
5250
|
+
onChange: function onChange(event) {
|
|
5251
|
+
setSelectedToColumn(event.target.value);
|
|
5252
|
+
}
|
|
5253
|
+
}, toOptions != null && toOptions.map(function (toOption) {
|
|
5254
|
+
var isRequiredMessage = "";
|
|
5255
|
+
if (toOption.isRequired) {
|
|
5256
|
+
isRequiredMessage = " (Required)";
|
|
5257
|
+
}
|
|
5258
|
+
return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
5259
|
+
value: toOption.name
|
|
5260
|
+
}, toOption.visibleName, " ", isRequiredMessage);
|
|
5261
|
+
}))));
|
|
5262
|
+
};
|
|
5263
|
+
return /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
5264
|
+
open: createNewOpen,
|
|
5265
|
+
onClose: handleClose,
|
|
5266
|
+
fullWidth: true,
|
|
5267
|
+
"aria-labelledby": "alert-dialog-title",
|
|
5268
|
+
"aria-describedby": "alert-dialog-description"
|
|
5269
|
+
}, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
|
|
5270
|
+
id: "alert-dialog-title"
|
|
5271
|
+
}, "Match existing column"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], {
|
|
5272
|
+
id: "alert-dialog-description"
|
|
5273
|
+
}, "***Inform the user about what it means to match existing columns***"), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
5274
|
+
sx: {
|
|
5275
|
+
paddingTop: 2
|
|
5276
|
+
}
|
|
5277
|
+
}, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
5278
|
+
id: "outlined-basic",
|
|
5279
|
+
label: "File Column Name",
|
|
5280
|
+
defaultValue: fromName,
|
|
5281
|
+
variant: "outlined",
|
|
5282
|
+
disabled: true,
|
|
5283
|
+
fullWidth: true
|
|
5284
|
+
})), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
5285
|
+
sx: {
|
|
5286
|
+
paddingTop: 2
|
|
5287
|
+
}
|
|
5288
|
+
}, /*#__PURE__*/_react["default"].createElement(SelectedExistingColumns, {
|
|
5289
|
+
toOptions: toOptions
|
|
5290
|
+
}))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
5291
|
+
onClick: handleClose
|
|
5292
|
+
}, "Cancel"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
5293
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
5294
|
+
var response;
|
|
5295
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
5296
|
+
while (1) switch (_context.prev = _context.next) {
|
|
5297
|
+
case 0:
|
|
5298
|
+
_context.next = 2;
|
|
5299
|
+
return apiService().put("/DocumentMapping/AssignMapping", {
|
|
5300
|
+
companyId: companyId,
|
|
5301
|
+
documentId: documentId,
|
|
5302
|
+
fileColumnName: fromName,
|
|
5303
|
+
documentMappingId: documentMappingId,
|
|
5304
|
+
matchedColumn: selectedToColumn,
|
|
5305
|
+
onlyAddRowIfColumnFound: onlyAddRowIfFound,
|
|
5306
|
+
rememberForNextTime: rememberForNextTime
|
|
5307
|
+
});
|
|
5308
|
+
case 2:
|
|
5309
|
+
response = _context.sent;
|
|
5310
|
+
if (response != null && response.status == 200) {
|
|
5311
|
+
onResponse();
|
|
5312
|
+
handleClose();
|
|
5313
|
+
}
|
|
5314
|
+
case 4:
|
|
5315
|
+
case "end":
|
|
5316
|
+
return _context.stop();
|
|
5317
|
+
}
|
|
5318
|
+
}, _callee);
|
|
5319
|
+
})),
|
|
5320
|
+
autoFocus: true
|
|
5321
|
+
}, "Match Existing"))), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
5322
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_LinkRounded["default"], null),
|
|
5323
|
+
size: "small",
|
|
5324
|
+
sx: {
|
|
5325
|
+
paddingLeft: 3
|
|
5326
|
+
},
|
|
5327
|
+
onClick: function onClick() {
|
|
5328
|
+
setCreateNewOpen(true);
|
|
5329
|
+
}
|
|
5330
|
+
}, "Match Existing"));
|
|
5331
|
+
}
|
|
5332
|
+
"use strict";
|
|
5333
|
+
|
|
5334
|
+
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); }
|
|
5335
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5336
|
+
value: true
|
|
5337
|
+
});
|
|
5338
|
+
exports["default"] = NewMappingColumn;
|
|
5339
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
5340
|
+
var _Card = _interopRequireDefault(require("@mui/material/Card"));
|
|
5341
|
+
var _CardContent = _interopRequireDefault(require("@mui/material/CardContent"));
|
|
5342
|
+
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
5343
|
+
var _system = require("@mui/system");
|
|
5344
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
5345
|
+
var _AddRounded = _interopRequireDefault(require("@mui/icons-material/AddRounded"));
|
|
5346
|
+
var _LinkRounded = _interopRequireDefault(require("@mui/icons-material/LinkRounded"));
|
|
5347
|
+
var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
|
|
5348
|
+
var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions"));
|
|
5349
|
+
var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
|
|
5350
|
+
var _DialogContentText = _interopRequireDefault(require("@mui/material/DialogContentText"));
|
|
5351
|
+
var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
|
|
5352
|
+
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
5353
|
+
var _Grid = _interopRequireDefault(require("@mui/material/Grid"));
|
|
5354
|
+
var _LocalParkingRounded = _interopRequireDefault(require("@mui/icons-material/LocalParkingRounded"));
|
|
5355
|
+
var _TextFieldsRounded = _interopRequireDefault(require("@mui/icons-material/TextFieldsRounded"));
|
|
5356
|
+
var _IntegrationInstructionsRounded = _interopRequireDefault(require("@mui/icons-material/IntegrationInstructionsRounded"));
|
|
5357
|
+
var _ListAltRounded = _interopRequireDefault(require("@mui/icons-material/ListAltRounded"));
|
|
5358
|
+
var _CalendarMonthRounded = _interopRequireDefault(require("@mui/icons-material/CalendarMonthRounded"));
|
|
5359
|
+
var _CheckBoxRounded = _interopRequireDefault(require("@mui/icons-material/CheckBoxRounded"));
|
|
5360
|
+
var _InsertPhotoRounded = _interopRequireDefault(require("@mui/icons-material/InsertPhotoRounded"));
|
|
5361
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
5362
|
+
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); }
|
|
5363
|
+
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; }
|
|
5364
|
+
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; }
|
|
5365
|
+
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); } }
|
|
5366
|
+
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); }); }; }
|
|
5367
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5368
|
+
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."); }
|
|
5369
|
+
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); }
|
|
5370
|
+
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; }
|
|
5371
|
+
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; } }
|
|
5372
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
5373
|
+
// import { apiService } from 'authscape';
|
|
5374
|
+
|
|
5375
|
+
function NewMappingColumn(_ref) {
|
|
5376
|
+
var name = _ref.name,
|
|
5377
|
+
companyId = _ref.companyId,
|
|
5378
|
+
documentType = _ref.documentType,
|
|
5379
|
+
documentId = _ref.documentId,
|
|
5380
|
+
documentMappingId = _ref.documentMappingId,
|
|
5381
|
+
onResponse = _ref.onResponse;
|
|
5382
|
+
var newColumnNameRef = (0, _react.useRef)(null);
|
|
5383
|
+
var newColumnDescriptionRef = (0, _react.useRef)(null);
|
|
5384
|
+
var _useState = (0, _react.useState)(false),
|
|
5385
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
5386
|
+
createNewOpen = _useState2[0],
|
|
5387
|
+
setCreateNewOpen = _useState2[1];
|
|
5388
|
+
var _useState3 = (0, _react.useState)(null),
|
|
5389
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
5390
|
+
selectedAttributeId = _useState4[0],
|
|
5391
|
+
setSelectedAttributeId = _useState4[1];
|
|
5392
|
+
var handleClose = function handleClose() {
|
|
5393
|
+
setCreateNewOpen(false);
|
|
5394
|
+
};
|
|
5395
|
+
var AttributeTypeComponent = function AttributeTypeComponent(_ref2) {
|
|
5396
|
+
var id = _ref2.id,
|
|
5397
|
+
icon = _ref2.icon,
|
|
5398
|
+
text = _ref2.text;
|
|
5399
|
+
return /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
5400
|
+
item: true,
|
|
5401
|
+
xs: 3
|
|
5402
|
+
}, /*#__PURE__*/_react["default"].createElement(_Card["default"], {
|
|
5403
|
+
sx: {
|
|
5404
|
+
textAlign: "center",
|
|
5405
|
+
cursor: "pointer",
|
|
5406
|
+
backgroundColor: selectedAttributeId == id ? "#e5e5e5" : "none"
|
|
5407
|
+
},
|
|
5408
|
+
onClick: function onClick() {
|
|
5409
|
+
setSelectedAttributeId(id);
|
|
5410
|
+
}
|
|
5411
|
+
}, /*#__PURE__*/_react["default"].createElement(_CardContent["default"], null, icon, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
5412
|
+
variant: "body2",
|
|
5413
|
+
color: "text.secondary",
|
|
5414
|
+
sx: {
|
|
5415
|
+
paddingTop: 1
|
|
5416
|
+
}
|
|
5417
|
+
}, text))));
|
|
5418
|
+
};
|
|
5419
|
+
return /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
5420
|
+
open: createNewOpen,
|
|
5421
|
+
onClose: handleClose,
|
|
5422
|
+
fullWidth: true,
|
|
5423
|
+
"aria-labelledby": "alert-dialog-title",
|
|
5424
|
+
"aria-describedby": "alert-dialog-description"
|
|
5425
|
+
}, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
|
|
5426
|
+
id: "alert-dialog-title"
|
|
5427
|
+
}, "Match to new column"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], {
|
|
5428
|
+
id: "alert-dialog-description"
|
|
5429
|
+
}, "inform the user about adding a new columna and what that means here..."), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
5430
|
+
sx: {
|
|
5431
|
+
paddingTop: 2
|
|
5432
|
+
}
|
|
5433
|
+
}, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
5434
|
+
inputRef: newColumnNameRef,
|
|
5435
|
+
defaultValue: name,
|
|
5436
|
+
id: "outlined-basic",
|
|
5437
|
+
label: "Name",
|
|
5438
|
+
variant: "outlined",
|
|
5439
|
+
fullWidth: true
|
|
5440
|
+
})), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
5441
|
+
sx: {
|
|
5442
|
+
paddingTop: 2
|
|
5443
|
+
}
|
|
5444
|
+
}, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
5445
|
+
inputRef: newColumnDescriptionRef,
|
|
5446
|
+
id: "outlined-basic",
|
|
5447
|
+
label: "Description (optional)",
|
|
5448
|
+
variant: "outlined",
|
|
5449
|
+
fullWidth: true
|
|
5450
|
+
})), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
5451
|
+
sx: {
|
|
5452
|
+
paddingTop: 2
|
|
5453
|
+
}
|
|
5454
|
+
}, /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
5455
|
+
variant: "body1",
|
|
5456
|
+
gutterBottom: true
|
|
5457
|
+
}, "Select how this column will be formatted")), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
|
|
5458
|
+
container: true,
|
|
5459
|
+
spacing: 2,
|
|
5460
|
+
sx: {
|
|
5461
|
+
paddingTop: 2
|
|
5462
|
+
}
|
|
5463
|
+
}, /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
|
|
5464
|
+
id: 0,
|
|
5465
|
+
icon: /*#__PURE__*/_react["default"].createElement(_TextFieldsRounded["default"], null),
|
|
5466
|
+
text: "text"
|
|
5467
|
+
}), /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
|
|
5468
|
+
id: 1,
|
|
5469
|
+
icon: /*#__PURE__*/_react["default"].createElement(_LocalParkingRounded["default"], null),
|
|
5470
|
+
text: "Paragraph"
|
|
5471
|
+
}), /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
|
|
5472
|
+
id: 2,
|
|
5473
|
+
icon: /*#__PURE__*/_react["default"].createElement(_IntegrationInstructionsRounded["default"], null),
|
|
5474
|
+
text: "HTML"
|
|
5475
|
+
}), /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
|
|
5476
|
+
id: 3,
|
|
5477
|
+
icon: /*#__PURE__*/_react["default"].createElement(_system.Box, null, 123),
|
|
5478
|
+
text: "Integer"
|
|
5479
|
+
}), /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
|
|
5480
|
+
id: 4,
|
|
5481
|
+
icon: /*#__PURE__*/_react["default"].createElement(_system.Box, null, 10.23),
|
|
5482
|
+
text: "Decimal"
|
|
5483
|
+
}), /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
|
|
5484
|
+
id: 5,
|
|
5485
|
+
icon: /*#__PURE__*/_react["default"].createElement(_ListAltRounded["default"], null),
|
|
5486
|
+
text: "Dropdown"
|
|
5487
|
+
}), /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
|
|
5488
|
+
id: 6,
|
|
5489
|
+
icon: /*#__PURE__*/_react["default"].createElement(_CalendarMonthRounded["default"], null),
|
|
5490
|
+
text: "Date"
|
|
5491
|
+
}), /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
|
|
5492
|
+
id: 7,
|
|
5493
|
+
icon: /*#__PURE__*/_react["default"].createElement(_LinkRounded["default"], null),
|
|
5494
|
+
text: "URL"
|
|
5495
|
+
}), /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
|
|
5496
|
+
id: 8,
|
|
5497
|
+
icon: /*#__PURE__*/_react["default"].createElement(_CheckBoxRounded["default"], null),
|
|
5498
|
+
text: "Boolean"
|
|
5499
|
+
}), /*#__PURE__*/_react["default"].createElement(AttributeTypeComponent, {
|
|
5500
|
+
id: 9,
|
|
5501
|
+
icon: /*#__PURE__*/_react["default"].createElement(_InsertPhotoRounded["default"], null),
|
|
5502
|
+
text: "Photo"
|
|
5503
|
+
})))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
5504
|
+
onClick: handleClose
|
|
5505
|
+
}, "Cancel"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
5506
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
5507
|
+
var response;
|
|
5508
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
5509
|
+
while (1) switch (_context.prev = _context.next) {
|
|
5510
|
+
case 0:
|
|
5511
|
+
_context.next = 2;
|
|
5512
|
+
return apiService().post("/DocumentMapping/AddNewColumnAndMapping", {
|
|
5513
|
+
companyId: companyId,
|
|
5514
|
+
documentId: documentId,
|
|
5515
|
+
documentMappingId: documentMappingId,
|
|
5516
|
+
newColumn: newColumnNameRef.current.value,
|
|
5517
|
+
description: newColumnDescriptionRef.current.value,
|
|
5518
|
+
attributeFieldType: selectedAttributeId
|
|
5519
|
+
});
|
|
5520
|
+
case 2:
|
|
5521
|
+
response = _context.sent;
|
|
5522
|
+
if (response != null && response.status == 200) {
|
|
5523
|
+
handleClose();
|
|
5524
|
+
onResponse();
|
|
5525
|
+
}
|
|
5526
|
+
case 4:
|
|
5527
|
+
case "end":
|
|
5528
|
+
return _context.stop();
|
|
5529
|
+
}
|
|
5530
|
+
}, _callee);
|
|
5531
|
+
})),
|
|
5532
|
+
autoFocus: true
|
|
5533
|
+
}, "Create"))), documentType != null && documentType == 1 && /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
5534
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_AddRounded["default"], null),
|
|
5535
|
+
size: "small",
|
|
5536
|
+
sx: {
|
|
5537
|
+
paddingLeft: 3
|
|
5538
|
+
},
|
|
5539
|
+
onClick: function onClick() {
|
|
5540
|
+
setCreateNewOpen(true);
|
|
5541
|
+
}
|
|
5542
|
+
}, "Create New Column"));
|
|
5543
|
+
}
|
|
5544
|
+
"use strict";
|
|
5545
|
+
|
|
5546
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5547
|
+
value: true
|
|
5548
|
+
});
|
|
5549
|
+
exports.SortableColumn = SortableColumn;
|
|
5550
|
+
var _react = _interopRequireDefault(require("react"));
|
|
5551
|
+
var _sortable = require("@dnd-kit/sortable");
|
|
5552
|
+
var _utilities = require("@dnd-kit/utilities");
|
|
5553
|
+
var _material = require("@mui/material");
|
|
5554
|
+
var _Menu = _interopRequireDefault(require("@mui/icons-material/Menu"));
|
|
5555
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
5556
|
+
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); }
|
|
5557
|
+
function SortableColumn(props) {
|
|
5558
|
+
var _useSortable = (0, _sortable.useSortable)({
|
|
5559
|
+
id: props.id
|
|
5560
|
+
}),
|
|
5561
|
+
attributes = _useSortable.attributes,
|
|
5562
|
+
listeners = _useSortable.listeners,
|
|
5563
|
+
setNodeRef = _useSortable.setNodeRef,
|
|
5564
|
+
transform = _useSortable.transform,
|
|
5565
|
+
transition = _useSortable.transition;
|
|
5566
|
+
var style = {
|
|
5567
|
+
transform: _utilities.CSS.Transform.toString(transform),
|
|
5568
|
+
transition: transition
|
|
5569
|
+
};
|
|
5570
|
+
return /*#__PURE__*/_react["default"].createElement("div", _extends({
|
|
5571
|
+
ref: setNodeRef,
|
|
5572
|
+
style: style
|
|
5573
|
+
}, attributes, listeners), /*#__PURE__*/_react["default"].createElement(_material.ListItem, {
|
|
5574
|
+
disablePadding: true
|
|
5575
|
+
}, /*#__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, {
|
|
5576
|
+
primary: props.id
|
|
5577
|
+
}))));
|
|
5578
|
+
}
|
|
5579
|
+
"use strict";
|
|
5580
|
+
|
|
5581
|
+
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); }
|
|
5582
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5583
|
+
value: true
|
|
5584
|
+
});
|
|
5585
|
+
exports["default"] = UploadMappedFile;
|
|
5586
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
5587
|
+
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
5588
|
+
var _system = require("@mui/system");
|
|
5589
|
+
var _PublishRounded = _interopRequireDefault(require("@mui/icons-material/PublishRounded"));
|
|
5590
|
+
var _Menu = _interopRequireDefault(require("@mui/material/Menu"));
|
|
5591
|
+
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
5592
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
5593
|
+
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); }
|
|
5594
|
+
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; }
|
|
5595
|
+
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; }
|
|
5596
|
+
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); } }
|
|
5597
|
+
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); }); }; }
|
|
5598
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5599
|
+
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."); }
|
|
5600
|
+
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); }
|
|
5601
|
+
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; }
|
|
5602
|
+
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; } }
|
|
5603
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import { apiService, FileUploader} from 'authscape';
|
|
5604
|
+
function UploadMappedFile(_ref) {
|
|
5605
|
+
var loadedUser = _ref.loadedUser,
|
|
5606
|
+
_ref$url = _ref.url,
|
|
5607
|
+
url = _ref$url === void 0 ? null : _ref$url,
|
|
5608
|
+
_ref$companyId = _ref.companyId,
|
|
5609
|
+
companyId = _ref$companyId === void 0 ? null : _ref$companyId,
|
|
5610
|
+
_ref$locationId = _ref.locationId,
|
|
5611
|
+
locationId = _ref$locationId === void 0 ? null : _ref$locationId,
|
|
5612
|
+
_ref$userId = _ref.userId,
|
|
5613
|
+
userId = _ref$userId === void 0 ? null : _ref$userId;
|
|
5614
|
+
var _useState = (0, _react.useState)(null),
|
|
5615
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
5616
|
+
documentComponentOptions = _useState2[0],
|
|
5617
|
+
setDocumentComponentOptions = _useState2[1];
|
|
5618
|
+
var _useState3 = (0, _react.useState)(null),
|
|
5619
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
5620
|
+
selectedDocumentComponentId = _useState4[0],
|
|
5621
|
+
setSelectedDocumentComponentId = _useState4[1];
|
|
5622
|
+
var _useState5 = (0, _react.useState)(null),
|
|
5623
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
5624
|
+
anchorEl = _useState6[0],
|
|
5625
|
+
setAnchorEl = _useState6[1];
|
|
5626
|
+
var open = Boolean(anchorEl);
|
|
5627
|
+
var handleClose = function handleClose() {
|
|
5628
|
+
setAnchorEl(null);
|
|
5629
|
+
};
|
|
5630
|
+
var fileUploaderRef = (0, _react.useRef)(null);
|
|
5631
|
+
(0, _react.useEffect)(function () {
|
|
5632
|
+
if (selectedDocumentComponentId != null) {
|
|
5633
|
+
// trigger the file uploader, make sure param is filled in
|
|
5634
|
+
fileUploaderRef.current.click();
|
|
5635
|
+
}
|
|
5636
|
+
}, [selectedDocumentComponentId]);
|
|
5637
|
+
(0, _react.useEffect)(function () {
|
|
5638
|
+
if (loadedUser) {
|
|
5639
|
+
var fetchData = /*#__PURE__*/function () {
|
|
5640
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
5641
|
+
var _params, response;
|
|
5642
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
5643
|
+
while (1) switch (_context.prev = _context.next) {
|
|
5644
|
+
case 0:
|
|
5645
|
+
_params = {};
|
|
5646
|
+
if (companyId != null) {
|
|
5647
|
+
_params.companyId = companyId;
|
|
5648
|
+
}
|
|
5649
|
+
if (userId != null) {
|
|
5650
|
+
_params.userId = userId;
|
|
5651
|
+
}
|
|
5652
|
+
if (locationId != null) {
|
|
5653
|
+
_params.locationId = locationId;
|
|
5654
|
+
}
|
|
5655
|
+
_context.next = 6;
|
|
5656
|
+
return apiService().post("/DocumentMapping/GetDocumentComponents", _params);
|
|
5657
|
+
case 6:
|
|
5658
|
+
response = _context.sent;
|
|
5659
|
+
if (response != null && response.status == 200) {
|
|
5660
|
+
setDocumentComponentOptions(response.data.data);
|
|
5661
|
+
}
|
|
5662
|
+
case 8:
|
|
5663
|
+
case "end":
|
|
5664
|
+
return _context.stop();
|
|
5665
|
+
}
|
|
5666
|
+
}, _callee);
|
|
5667
|
+
}));
|
|
5668
|
+
return function fetchData() {
|
|
5669
|
+
return _ref2.apply(this, arguments);
|
|
5670
|
+
};
|
|
5671
|
+
}();
|
|
5672
|
+
fetchData();
|
|
5673
|
+
}
|
|
5674
|
+
}, [loadedUser]);
|
|
5675
|
+
return /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(FileUploader, {
|
|
5676
|
+
refOveride: fileUploaderRef,
|
|
5677
|
+
params: {
|
|
5678
|
+
documentComponentId: selectedDocumentComponentId,
|
|
5679
|
+
companyId: companyId,
|
|
5680
|
+
locationId: locationId,
|
|
5681
|
+
userId: userId
|
|
5682
|
+
},
|
|
5683
|
+
url: url,
|
|
5684
|
+
multiple: false,
|
|
5685
|
+
variant: "custom",
|
|
5686
|
+
onUploadCompleted: function onUploadCompleted() {
|
|
5687
|
+
setSelectedDocumentComponentId(null); // we need an onUploadCancelled
|
|
5688
|
+
}
|
|
5689
|
+
}), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
5690
|
+
id: "demo-positioned-button",
|
|
5691
|
+
"aria-controls": open ? 'demo-positioned-menu' : undefined,
|
|
5692
|
+
"aria-haspopup": "true",
|
|
5693
|
+
"aria-expanded": open ? 'true' : undefined,
|
|
5694
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_PublishRounded["default"], null),
|
|
5695
|
+
sx: {
|
|
5696
|
+
marginLeft: 1
|
|
5697
|
+
},
|
|
5698
|
+
onClick: function onClick(event) {
|
|
5699
|
+
setAnchorEl(event.currentTarget);
|
|
5700
|
+
}
|
|
5701
|
+
}, "Upload File(s)"), /*#__PURE__*/_react["default"].createElement(_Menu["default"], {
|
|
5702
|
+
id: "basic-menu",
|
|
5703
|
+
anchorEl: anchorEl,
|
|
5704
|
+
open: open,
|
|
5705
|
+
onClose: handleClose,
|
|
5706
|
+
MenuListProps: {
|
|
5707
|
+
'aria-labelledby': 'basic-button'
|
|
5708
|
+
}
|
|
5709
|
+
}, documentComponentOptions != null && documentComponentOptions.map(function (documentComponent) {
|
|
5710
|
+
return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
5711
|
+
onClick: function onClick() {
|
|
5712
|
+
// assigns the param document component id
|
|
5713
|
+
setSelectedDocumentComponentId(documentComponent.id);
|
|
5714
|
+
|
|
5715
|
+
// close the menu
|
|
5716
|
+
handleClose();
|
|
5717
|
+
}
|
|
5718
|
+
}, documentComponent.name + " (" + documentComponent.documentTypeName + ")");
|
|
5719
|
+
})));
|
|
5720
|
+
}
|
|
5721
|
+
"use strict";
|
|
5722
|
+
|
|
3615
5723
|
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); }
|
|
3616
5724
|
Object.defineProperty(exports, "__esModule", {
|
|
3617
5725
|
value: true
|
|
@@ -4457,7 +6565,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4457
6565
|
Object.defineProperty(exports, "__esModule", {
|
|
4458
6566
|
value: true
|
|
4459
6567
|
});
|
|
4460
|
-
exports
|
|
6568
|
+
exports["default"] = void 0;
|
|
4461
6569
|
var _material = require("@mui/material");
|
|
4462
6570
|
var _react = _interopRequireWildcard(require("react"));
|
|
4463
6571
|
var _reactgrid = require("@silevis/reactgrid");
|
|
@@ -4466,6 +6574,22 @@ var signalR = _interopRequireWildcard(require("@microsoft/signalr"));
|
|
|
4466
6574
|
var _Avatar = _interopRequireDefault(require("@mui/material/Avatar"));
|
|
4467
6575
|
var _Stack = _interopRequireDefault(require("@mui/material/Stack"));
|
|
4468
6576
|
var _Tooltip = _interopRequireDefault(require("@mui/material/Tooltip"));
|
|
6577
|
+
var _AppBar = _interopRequireDefault(require("@mui/material/AppBar"));
|
|
6578
|
+
var _Toolbar = _interopRequireDefault(require("@mui/material/Toolbar"));
|
|
6579
|
+
var _VisibilityOffRounded = _interopRequireDefault(require("@mui/icons-material/VisibilityOffRounded"));
|
|
6580
|
+
var _FilterListRounded = _interopRequireDefault(require("@mui/icons-material/FilterListRounded"));
|
|
6581
|
+
var _SwapVertRounded = _interopRequireDefault(require("@mui/icons-material/SwapVertRounded"));
|
|
6582
|
+
var _LineWeightRounded = _interopRequireDefault(require("@mui/icons-material/LineWeightRounded"));
|
|
6583
|
+
var _PivotTableChartRounded = _interopRequireDefault(require("@mui/icons-material/PivotTableChartRounded"));
|
|
6584
|
+
var _ViewWeekRounded = _interopRequireDefault(require("@mui/icons-material/ViewWeekRounded"));
|
|
6585
|
+
var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
|
|
6586
|
+
var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions"));
|
|
6587
|
+
var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
|
|
6588
|
+
var _DialogContentText = _interopRequireDefault(require("@mui/material/DialogContentText"));
|
|
6589
|
+
var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
|
|
6590
|
+
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
6591
|
+
var _core = require("@dnd-kit/core");
|
|
6592
|
+
var _sortable = require("@dnd-kit/sortable");
|
|
4469
6593
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
4470
6594
|
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); }
|
|
4471
6595
|
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; }
|
|
@@ -4487,15 +6611,21 @@ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructur
|
|
|
4487
6611
|
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); }
|
|
4488
6612
|
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; }
|
|
4489
6613
|
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; } }
|
|
4490
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
4491
|
-
|
|
6614
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import { apiService } from 'authscape';
|
|
6615
|
+
// import { SortableColumn } from './Mapping/sortableColumn';
|
|
6616
|
+
|
|
6617
|
+
var SpreadsheetViewer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
4492
6618
|
var loadedUser = _ref.loadedUser,
|
|
4493
6619
|
currentUser = _ref.currentUser,
|
|
4494
6620
|
documentId = _ref.documentId,
|
|
4495
6621
|
url = _ref.url,
|
|
4496
6622
|
sx = _ref.sx,
|
|
6623
|
+
_ref$hideToolbar = _ref.hideToolbar,
|
|
6624
|
+
hideToolbar = _ref$hideToolbar === void 0 ? false : _ref$hideToolbar,
|
|
4497
6625
|
_ref$onFocusLocationC = _ref.onFocusLocationChanged,
|
|
4498
6626
|
_onFocusLocationChanged = _ref$onFocusLocationC === void 0 ? null : _ref$onFocusLocationC,
|
|
6627
|
+
_ref$advanceQuery = _ref.advanceQuery,
|
|
6628
|
+
advanceQuery = _ref$advanceQuery === void 0 ? null : _ref$advanceQuery,
|
|
4499
6629
|
_ref$onChange = _ref.onChange,
|
|
4500
6630
|
onChange = _ref$onChange === void 0 ? null : _ref$onChange,
|
|
4501
6631
|
_ref$hubUrl = _ref.hubUrl,
|
|
@@ -4526,22 +6656,55 @@ function SpreadsheetViewer(_ref) {
|
|
|
4526
6656
|
setCellChanges = _useState10[1];
|
|
4527
6657
|
var highlightsRef = (0, _react.useRef)([]);
|
|
4528
6658
|
var userIdRef = (0, _react.useRef)(0);
|
|
4529
|
-
var
|
|
6659
|
+
var returnedRef = (0, _react.useRef)([]);
|
|
6660
|
+
var _useState11 = (0, _react.useState)(false),
|
|
4530
6661
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
var
|
|
6662
|
+
showStickyDialog = _useState12[0],
|
|
6663
|
+
setShowStickyDialog = _useState12[1];
|
|
6664
|
+
var leftColumnRef = (0, _react.useRef)(null);
|
|
6665
|
+
var rightColumnRef = (0, _react.useRef)(null);
|
|
6666
|
+
var topRowRef = (0, _react.useRef)(null);
|
|
6667
|
+
var bottomRowRef = (0, _react.useRef)(null);
|
|
6668
|
+
var _useState13 = (0, _react.useState)(null),
|
|
4534
6669
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
var _useState15 = (0, _react.useState)(
|
|
6670
|
+
leftColumnSticky = _useState14[0],
|
|
6671
|
+
setLeftColumnSticky = _useState14[1];
|
|
6672
|
+
var _useState15 = (0, _react.useState)(null),
|
|
4538
6673
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
4539
|
-
|
|
4540
|
-
|
|
6674
|
+
rightColumnSticky = _useState16[0],
|
|
6675
|
+
setRightColumnSticky = _useState16[1];
|
|
4541
6676
|
var _useState17 = (0, _react.useState)(null),
|
|
4542
6677
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
4543
|
-
|
|
4544
|
-
|
|
6678
|
+
topRowSticky = _useState18[0],
|
|
6679
|
+
setTopRowSticky = _useState18[1];
|
|
6680
|
+
var _useState19 = (0, _react.useState)(null),
|
|
6681
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
6682
|
+
bottomRowSticky = _useState20[0],
|
|
6683
|
+
setBottomRowSticky = _useState20[1];
|
|
6684
|
+
var _useState21 = (0, _react.useState)([]),
|
|
6685
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
6686
|
+
highlights = _useState22[0],
|
|
6687
|
+
setHighlights = _useState22[1];
|
|
6688
|
+
var _useState23 = (0, _react.useState)([]),
|
|
6689
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
6690
|
+
sessions = _useState24[0],
|
|
6691
|
+
setSessions = _useState24[1];
|
|
6692
|
+
var _useState25 = (0, _react.useState)([]),
|
|
6693
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
6694
|
+
requestedChanges = _useState26[0],
|
|
6695
|
+
setRequestedChanges = _useState26[1];
|
|
6696
|
+
var _useState27 = (0, _react.useState)(null),
|
|
6697
|
+
_useState28 = _slicedToArray(_useState27, 2),
|
|
6698
|
+
hubConnection = _useState28[0],
|
|
6699
|
+
setHubConnection = _useState28[1];
|
|
6700
|
+
var getRows = function getRows() {
|
|
6701
|
+
return returnedRef.current;
|
|
6702
|
+
};
|
|
6703
|
+
(0, _react.useImperativeHandle)(ref, function () {
|
|
6704
|
+
return {
|
|
6705
|
+
getRows: getRows
|
|
6706
|
+
};
|
|
6707
|
+
});
|
|
4545
6708
|
(0, _react.useEffect)(function () {
|
|
4546
6709
|
if (requestedChanges != null && requestedChanges.length > 0) {
|
|
4547
6710
|
// go into each request
|
|
@@ -4599,17 +6762,64 @@ function SpreadsheetViewer(_ref) {
|
|
|
4599
6762
|
setRequestedChanges([]);
|
|
4600
6763
|
}
|
|
4601
6764
|
}, [requestedChanges]);
|
|
6765
|
+
var validateAllCells = function validateAllCells(cells) {
|
|
6766
|
+
var hasData = false;
|
|
6767
|
+
cells.forEach(function (element) {
|
|
6768
|
+
if (element.text != "" && element.text != null) {
|
|
6769
|
+
hasData = true;
|
|
6770
|
+
}
|
|
6771
|
+
});
|
|
6772
|
+
return hasData;
|
|
6773
|
+
};
|
|
4602
6774
|
var getSpreadSheetRows = function getSpreadSheetRows(headerCell, rows) {
|
|
6775
|
+
// returnedRef
|
|
6776
|
+
returnedRef.current = [];
|
|
4603
6777
|
var dataRows = [{
|
|
4604
6778
|
rowId: "header",
|
|
4605
6779
|
cells: headerCell
|
|
4606
6780
|
}];
|
|
4607
|
-
|
|
6781
|
+
var _loop = function _loop() {
|
|
4608
6782
|
var row = rows[index];
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
6783
|
+
if (rows != null && row.cells.length > 0 && advanceQuery != null && advanceQuery.rules.length > 0) {
|
|
6784
|
+
row.cells.forEach(function (element) {
|
|
6785
|
+
advanceQuery.rules.forEach(function (rule) {
|
|
6786
|
+
if (rule.field == element.columnId) {
|
|
6787
|
+
if (rule.operator == "contains") {
|
|
6788
|
+
if (element.text.toLowerCase().includes(rule.value.toLowerCase())) {
|
|
6789
|
+
if (validateAllCells(row.cells)) {
|
|
6790
|
+
dataRows.push({
|
|
6791
|
+
rowId: row.rowId,
|
|
6792
|
+
cells: row.cells
|
|
6793
|
+
});
|
|
6794
|
+
returnedRef.current.push(row);
|
|
6795
|
+
}
|
|
6796
|
+
}
|
|
6797
|
+
} else if (rule.operator == "notContains") {
|
|
6798
|
+
if (!element.text.toLowerCase().includes(rule.value.toLowerCase())) {
|
|
6799
|
+
if (validateAllCells(row.cells)) {
|
|
6800
|
+
dataRows.push({
|
|
6801
|
+
rowId: row.rowId,
|
|
6802
|
+
cells: row.cells
|
|
6803
|
+
});
|
|
6804
|
+
returnedRef.current.push(row);
|
|
6805
|
+
}
|
|
6806
|
+
}
|
|
6807
|
+
}
|
|
6808
|
+
}
|
|
6809
|
+
});
|
|
6810
|
+
});
|
|
6811
|
+
} else {
|
|
6812
|
+
if (validateAllCells(row.cells)) {
|
|
6813
|
+
dataRows.push({
|
|
6814
|
+
rowId: row.rowId,
|
|
6815
|
+
cells: row.cells
|
|
6816
|
+
});
|
|
6817
|
+
returnedRef.current.push(row);
|
|
6818
|
+
}
|
|
6819
|
+
}
|
|
6820
|
+
};
|
|
6821
|
+
for (var index = 0; index < rows.length; index++) {
|
|
6822
|
+
_loop();
|
|
4613
6823
|
}
|
|
4614
6824
|
return dataRows;
|
|
4615
6825
|
};
|
|
@@ -4628,7 +6838,11 @@ function SpreadsheetViewer(_ref) {
|
|
|
4628
6838
|
}
|
|
4629
6839
|
};
|
|
4630
6840
|
(0, _react.useEffect)(function () {
|
|
4631
|
-
if (
|
|
6841
|
+
if (url) {
|
|
6842
|
+
setLeftColumnSticky(parseInt(localStorage.getItem("leftColumn")));
|
|
6843
|
+
setRightColumnSticky(parseInt(localStorage.getItem("rightColumn")));
|
|
6844
|
+
setTopRowSticky(parseInt(localStorage.getItem("topRow")));
|
|
6845
|
+
setBottomRowSticky(parseInt(localStorage.getItem("bottomRow")));
|
|
4632
6846
|
var fetchData = /*#__PURE__*/function () {
|
|
4633
6847
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
4634
6848
|
var response;
|
|
@@ -4656,7 +6870,48 @@ function SpreadsheetViewer(_ref) {
|
|
|
4656
6870
|
}();
|
|
4657
6871
|
fetchData();
|
|
4658
6872
|
}
|
|
4659
|
-
}, [
|
|
6873
|
+
}, [url]);
|
|
6874
|
+
|
|
6875
|
+
// useEffect(() => {
|
|
6876
|
+
|
|
6877
|
+
// if (rows != null && advanceQuery != null)
|
|
6878
|
+
// {
|
|
6879
|
+
// let newRows = [...rows];
|
|
6880
|
+
|
|
6881
|
+
// let index = 0;
|
|
6882
|
+
// rows.forEach(row => {
|
|
6883
|
+
|
|
6884
|
+
// row.cells.forEach(element => {
|
|
6885
|
+
|
|
6886
|
+
// advanceQuery.rules.forEach(rule => {
|
|
6887
|
+
|
|
6888
|
+
// if (rule.field == element.columnId)
|
|
6889
|
+
// {
|
|
6890
|
+
|
|
6891
|
+
// if (element.text.toLowerCase().includes(rule.value))
|
|
6892
|
+
// {
|
|
6893
|
+
// newRows.push(element);
|
|
6894
|
+
// index++;
|
|
6895
|
+
// }
|
|
6896
|
+
|
|
6897
|
+
// //alert(rule.field + " - " + rule.operator + " - " + rule.value);
|
|
6898
|
+
// }
|
|
6899
|
+
// });
|
|
6900
|
+
|
|
6901
|
+
// });
|
|
6902
|
+
// });
|
|
6903
|
+
|
|
6904
|
+
// setRows(newRows);
|
|
6905
|
+
|
|
6906
|
+
// // newRows.forEach(row => {
|
|
6907
|
+
// // alert(JSON.stringify(row));
|
|
6908
|
+
// // });
|
|
6909
|
+
|
|
6910
|
+
// // alert("found " + index + " empty fields")
|
|
6911
|
+
// }
|
|
6912
|
+
|
|
6913
|
+
// }, [advanceQuery]);
|
|
6914
|
+
|
|
4660
6915
|
var getSessions = /*#__PURE__*/function () {
|
|
4661
6916
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
4662
6917
|
var response, sessionData, _sessions;
|
|
@@ -4669,25 +6924,27 @@ function SpreadsheetViewer(_ref) {
|
|
|
4669
6924
|
response = _context2.sent;
|
|
4670
6925
|
sessionData = response.data;
|
|
4671
6926
|
_sessions = [];
|
|
4672
|
-
sessionData.
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
6927
|
+
if (sessionData != null && sessionData.length > 0) {
|
|
6928
|
+
sessionData.forEach(function (element) {
|
|
6929
|
+
if (_sessions.find(function (s) {
|
|
6930
|
+
return s.userId == element.userId;
|
|
6931
|
+
}) == null) {
|
|
6932
|
+
if (element.userId == userIdRef.current) {
|
|
6933
|
+
_sessions.push({
|
|
6934
|
+
userId: element.userId,
|
|
6935
|
+
name: element.name,
|
|
6936
|
+
borderColor: "#3579f8"
|
|
6937
|
+
});
|
|
6938
|
+
} else {
|
|
6939
|
+
_sessions.push({
|
|
6940
|
+
userId: element.userId,
|
|
6941
|
+
name: element.name,
|
|
6942
|
+
borderColor: element.borderColor
|
|
6943
|
+
});
|
|
6944
|
+
}
|
|
4688
6945
|
}
|
|
4689
|
-
}
|
|
4690
|
-
}
|
|
6946
|
+
});
|
|
6947
|
+
}
|
|
4691
6948
|
assignHighlights(highlightsRef.current);
|
|
4692
6949
|
setSessions(_sessions);
|
|
4693
6950
|
case 8:
|
|
@@ -4746,6 +7003,9 @@ function SpreadsheetViewer(_ref) {
|
|
|
4746
7003
|
(0, _react.useEffect)(function () {
|
|
4747
7004
|
if (loadedUser) {
|
|
4748
7005
|
userIdRef.current = currentUser.id;
|
|
7006
|
+
if (hubUrl == null) {
|
|
7007
|
+
return;
|
|
7008
|
+
}
|
|
4749
7009
|
var connection = new signalR.HubConnectionBuilder().withUrl(hubUrl).build();
|
|
4750
7010
|
connection.on("onUpdateUserSession", function () {
|
|
4751
7011
|
getSessions();
|
|
@@ -4900,15 +7160,78 @@ function SpreadsheetViewer(_ref) {
|
|
|
4900
7160
|
children: "".concat(name.split(' ')[0][0]).concat(name.split(' ')[1][0])
|
|
4901
7161
|
};
|
|
4902
7162
|
};
|
|
4903
|
-
|
|
7163
|
+
var getaListOfColumns = function getaListOfColumns() {
|
|
7164
|
+
var arrayItem = [];
|
|
7165
|
+
for (var index = 0; index < columns.length; index++) {
|
|
7166
|
+
var column = columns[index];
|
|
7167
|
+
arrayItem.push(column.columnId);
|
|
7168
|
+
}
|
|
7169
|
+
return arrayItem;
|
|
7170
|
+
};
|
|
7171
|
+
return /*#__PURE__*/_react["default"].createElement(_material.Box, null, !hideToolbar && /*#__PURE__*/_react["default"].createElement(_AppBar["default"], {
|
|
7172
|
+
position: "static",
|
|
7173
|
+
elevation: 0,
|
|
4904
7174
|
sx: {
|
|
4905
|
-
|
|
7175
|
+
backgroundColor: "white"
|
|
7176
|
+
}
|
|
7177
|
+
}, /*#__PURE__*/_react["default"].createElement(_Toolbar["default"], {
|
|
7178
|
+
disableGutters: true,
|
|
7179
|
+
sx: {
|
|
7180
|
+
color: "black"
|
|
4906
7181
|
}
|
|
4907
7182
|
}, /*#__PURE__*/_react["default"].createElement(_material.Box, {
|
|
4908
7183
|
sx: {
|
|
4909
|
-
|
|
7184
|
+
flexGrow: 1
|
|
7185
|
+
}
|
|
7186
|
+
}, /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
7187
|
+
variant: "text",
|
|
7188
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_VisibilityOffRounded["default"], null),
|
|
7189
|
+
sx: {
|
|
7190
|
+
color: "black"
|
|
7191
|
+
}
|
|
7192
|
+
}, "Hide Fields"), /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
7193
|
+
variant: "text",
|
|
7194
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_PivotTableChartRounded["default"], null),
|
|
7195
|
+
sx: {
|
|
7196
|
+
color: "black",
|
|
7197
|
+
paddingLeft: 4
|
|
7198
|
+
},
|
|
7199
|
+
onClick: function onClick() {
|
|
7200
|
+
setShowStickyDialog(true);
|
|
7201
|
+
}
|
|
7202
|
+
}, "Sticky"), /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
7203
|
+
variant: "text",
|
|
7204
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_FilterListRounded["default"], null),
|
|
7205
|
+
sx: {
|
|
7206
|
+
color: "black",
|
|
7207
|
+
paddingLeft: 4
|
|
7208
|
+
}
|
|
7209
|
+
}, "Filter"), /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
7210
|
+
variant: "text",
|
|
7211
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_SwapVertRounded["default"], null),
|
|
7212
|
+
sx: {
|
|
7213
|
+
color: "black",
|
|
7214
|
+
paddingLeft: 4
|
|
7215
|
+
}
|
|
7216
|
+
}, "Sort"), /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
7217
|
+
variant: "text",
|
|
7218
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_LineWeightRounded["default"], null),
|
|
7219
|
+
sx: {
|
|
7220
|
+
color: "black",
|
|
7221
|
+
paddingLeft: 4
|
|
7222
|
+
}
|
|
7223
|
+
}, "Row Height"), /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
7224
|
+
variant: "text",
|
|
7225
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_ViewWeekRounded["default"], null),
|
|
7226
|
+
sx: {
|
|
7227
|
+
color: "black",
|
|
7228
|
+
paddingLeft: 4
|
|
7229
|
+
}
|
|
7230
|
+
}, "Reorder Columns")), /*#__PURE__*/_react["default"].createElement(_material.Box, {
|
|
7231
|
+
sx: {
|
|
7232
|
+
flexGrow: 0
|
|
4910
7233
|
}
|
|
4911
|
-
},
|
|
7234
|
+
}, /*#__PURE__*/_react["default"].createElement(_Stack["default"], {
|
|
4912
7235
|
direction: "row",
|
|
4913
7236
|
spacing: 2
|
|
4914
7237
|
}, sessions.map(function (user) {
|
|
@@ -4917,11 +7240,10 @@ function SpreadsheetViewer(_ref) {
|
|
|
4917
7240
|
}, /*#__PURE__*/_react["default"].createElement(_Avatar["default"], _extends({}, stringAvatar(user.name, user.borderColor), {
|
|
4918
7241
|
alt: user.name
|
|
4919
7242
|
})));
|
|
4920
|
-
}))), /*#__PURE__*/_react["default"].createElement(_material.Box, {
|
|
4921
|
-
sx: _objectSpread(
|
|
4922
|
-
overflow: "scroll"
|
|
4923
|
-
})
|
|
7243
|
+
}))))), leftColumnSticky != null && rightColumnSticky != null && topRowSticky != null && bottomRowSticky != null && data != null && columns != null && /*#__PURE__*/_react["default"].createElement(_material.Box, {
|
|
7244
|
+
sx: _objectSpread({}, sx)
|
|
4924
7245
|
}, data != null && rows != null && /*#__PURE__*/_react["default"].createElement(_material.Box, {
|
|
7246
|
+
className: "reactgrid-gold",
|
|
4925
7247
|
onKeyDown: function onKeyDown(e) {
|
|
4926
7248
|
var isMac = /Mac|iPod|iPhone|iPad/.test(navigator.platform);
|
|
4927
7249
|
if (!_reactDeviceDetect.isMacOs && e.ctrlKey || e.metaKey) {
|
|
@@ -4939,6 +7261,7 @@ function SpreadsheetViewer(_ref) {
|
|
|
4939
7261
|
rows: getSpreadSheetRows(data.headerCell, rows),
|
|
4940
7262
|
highlights: highlights,
|
|
4941
7263
|
columns: columns,
|
|
7264
|
+
enableFillHandle: true,
|
|
4942
7265
|
onFocusLocationChanged: function onFocusLocationChanged(location) {
|
|
4943
7266
|
try {
|
|
4944
7267
|
hubConnection.invoke("FocusLocationChanged", documentId, userIdRef.current, location.rowId, location.columnId);
|
|
@@ -4954,9 +7277,127 @@ function SpreadsheetViewer(_ref) {
|
|
|
4954
7277
|
//onContextMenu={simpleHandleContextMenu}
|
|
4955
7278
|
,
|
|
4956
7279
|
onColumnResized: handleColumnResize,
|
|
4957
|
-
stickyTopRows:
|
|
4958
|
-
|
|
4959
|
-
|
|
7280
|
+
stickyTopRows: topRowSticky,
|
|
7281
|
+
stickyBottomRows: bottomRowSticky,
|
|
7282
|
+
stickyLeftColumns: leftColumnSticky,
|
|
7283
|
+
stickyRightColumns: rightColumnSticky
|
|
7284
|
+
}))), /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
7285
|
+
open: showStickyDialog,
|
|
7286
|
+
onClose: function onClose() {
|
|
7287
|
+
setShowStickyDialog(false);
|
|
7288
|
+
},
|
|
7289
|
+
"aria-labelledby": "alert-dialog-title",
|
|
7290
|
+
"aria-describedby": "alert-dialog-description"
|
|
7291
|
+
}, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
|
|
7292
|
+
id: "alert-dialog-title"
|
|
7293
|
+
}, "Sticky"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], {
|
|
7294
|
+
id: "alert-dialog-description"
|
|
7295
|
+
}, "Stick chosen rows and columns at the top or bottom rows or left and right columns. Sticky rows or columns will remain visible at all times."), /*#__PURE__*/_react["default"].createElement(_material.TableContainer, {
|
|
7296
|
+
sx: {
|
|
7297
|
+
paddingTop: 4
|
|
7298
|
+
}
|
|
7299
|
+
}, /*#__PURE__*/_react["default"].createElement(_material.Table, {
|
|
7300
|
+
"aria-label": "customized table"
|
|
7301
|
+
}, /*#__PURE__*/_react["default"].createElement(_material.TableHead, null, /*#__PURE__*/_react["default"].createElement(_material.TableRow, null, /*#__PURE__*/_react["default"].createElement(_material.TableCell, {
|
|
7302
|
+
align: "left"
|
|
7303
|
+
}, "Left Column"), /*#__PURE__*/_react["default"].createElement(_material.TableCell, {
|
|
7304
|
+
align: "left"
|
|
7305
|
+
}, "Right Column"), /*#__PURE__*/_react["default"].createElement(_material.TableCell, {
|
|
7306
|
+
align: "left"
|
|
7307
|
+
}, "Top Row"), /*#__PURE__*/_react["default"].createElement(_material.TableCell, {
|
|
7308
|
+
align: "left"
|
|
7309
|
+
}, "Bottom Row"))), /*#__PURE__*/_react["default"].createElement(_material.TableBody, null, /*#__PURE__*/_react["default"].createElement(_material.TableCell, {
|
|
7310
|
+
sx: {
|
|
7311
|
+
paddingTop: 0
|
|
7312
|
+
}
|
|
7313
|
+
}, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
7314
|
+
inputRef: leftColumnRef,
|
|
7315
|
+
type: "number",
|
|
7316
|
+
defaultValue: "0",
|
|
7317
|
+
variant: "outlined"
|
|
7318
|
+
})), /*#__PURE__*/_react["default"].createElement(_material.TableCell, {
|
|
7319
|
+
sx: {
|
|
7320
|
+
paddingTop: 0
|
|
7321
|
+
}
|
|
7322
|
+
}, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
7323
|
+
inputRef: rightColumnRef,
|
|
7324
|
+
type: "number",
|
|
7325
|
+
defaultValue: "0",
|
|
7326
|
+
variant: "outlined"
|
|
7327
|
+
})), /*#__PURE__*/_react["default"].createElement(_material.TableCell, {
|
|
7328
|
+
sx: {
|
|
7329
|
+
paddingTop: 0
|
|
7330
|
+
}
|
|
7331
|
+
}, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
7332
|
+
inputRef: topRowRef,
|
|
7333
|
+
type: "number",
|
|
7334
|
+
defaultValue: "0",
|
|
7335
|
+
variant: "outlined"
|
|
7336
|
+
})), /*#__PURE__*/_react["default"].createElement(_material.TableCell, {
|
|
7337
|
+
sx: {
|
|
7338
|
+
paddingTop: 0
|
|
7339
|
+
}
|
|
7340
|
+
}, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
7341
|
+
inputRef: bottomRowRef,
|
|
7342
|
+
type: "number",
|
|
7343
|
+
defaultValue: "0",
|
|
7344
|
+
variant: "outlined"
|
|
7345
|
+
})))))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
7346
|
+
onClick: function onClick() {
|
|
7347
|
+
setShowStickyDialog(false);
|
|
7348
|
+
}
|
|
7349
|
+
}, "Cancel"), /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
7350
|
+
onClick: function onClick() {
|
|
7351
|
+
localStorage.setItem("leftColumn", leftColumnRef.current.value);
|
|
7352
|
+
localStorage.setItem("rightColumn", rightColumnRef.current.value);
|
|
7353
|
+
localStorage.setItem("topRow", topRowRef.current.value);
|
|
7354
|
+
localStorage.setItem("bottomRow", bottomRowRef.current.value);
|
|
7355
|
+
window.location.reload();
|
|
7356
|
+
// setLeftColumnSticky(leftColumnRef.current.value);
|
|
7357
|
+
// setRightColumnSticky(rightColumnRef.current.value);
|
|
7358
|
+
// setTopRowSticky(topRowRef.current.value);
|
|
7359
|
+
// setBottomRowSticky(bottomRowRef.current.value);
|
|
7360
|
+
|
|
7361
|
+
setShowStickyDialog(false);
|
|
7362
|
+
},
|
|
7363
|
+
autoFocus: true
|
|
7364
|
+
}, "Apply"))), /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
7365
|
+
open: false,
|
|
7366
|
+
onClose: function onClose() {
|
|
7367
|
+
setShowStickyDialog(false);
|
|
7368
|
+
},
|
|
7369
|
+
"aria-labelledby": "alert-dialog-title",
|
|
7370
|
+
"aria-describedby": "alert-dialog-description"
|
|
7371
|
+
}, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
|
|
7372
|
+
id: "alert-dialog-title"
|
|
7373
|
+
}, "Reorder Columns"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], {
|
|
7374
|
+
id: "alert-dialog-description"
|
|
7375
|
+
}, "Assign the column order from left to right."), columns != null && /*#__PURE__*/_react["default"].createElement(_material.List, null, /*#__PURE__*/_react["default"].createElement(_core.DndContext, {
|
|
7376
|
+
onDragEnd: function onDragEnd(event) {
|
|
7377
|
+
var over = event.over;
|
|
7378
|
+
alert(over.id);
|
|
7379
|
+
// If the item is dropped over a container, set it as the parent
|
|
7380
|
+
// otherwise reset the parent to `null`
|
|
7381
|
+
//setParent(over ? over.id : null);
|
|
7382
|
+
}
|
|
7383
|
+
}, /*#__PURE__*/_react["default"].createElement(_sortable.SortableContext, {
|
|
7384
|
+
items: getaListOfColumns()
|
|
7385
|
+
}, columns.map(function (item) {
|
|
7386
|
+
return /*#__PURE__*/_react["default"].createElement(SortableColumn, {
|
|
7387
|
+
key: item.columnId,
|
|
7388
|
+
id: item.columnId
|
|
7389
|
+
});
|
|
7390
|
+
}))))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
7391
|
+
onClick: function onClick() {
|
|
7392
|
+
setShowStickyDialog(false);
|
|
7393
|
+
}
|
|
7394
|
+
}, "Cancel"), /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
7395
|
+
onClick: function onClick() {},
|
|
7396
|
+
autoFocus: true
|
|
7397
|
+
}, "Apply"))));
|
|
7398
|
+
});
|
|
7399
|
+
var _default = SpreadsheetViewer;
|
|
7400
|
+
exports["default"] = _default;
|
|
4960
7401
|
"use strict";
|
|
4961
7402
|
|
|
4962
7403
|
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); }
|