authscape 1.0.490 → 1.0.492
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
CHANGED
|
@@ -3665,6 +3665,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import
|
|
|
3665
3665
|
function AssignMapping(_ref) {
|
|
3666
3666
|
var currentUser = _ref.currentUser,
|
|
3667
3667
|
documentComponentId = _ref.documentComponentId,
|
|
3668
|
+
_ref$onOpen = _ref.onOpen,
|
|
3669
|
+
onOpen = _ref$onOpen === void 0 ? null : _ref$onOpen,
|
|
3668
3670
|
_ref$onCancel = _ref.onCancel,
|
|
3669
3671
|
onCancel = _ref$onCancel === void 0 ? null : _ref$onCancel,
|
|
3670
3672
|
_ref$onPublished = _ref.onPublished,
|
|
@@ -4416,8 +4418,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
4416
4418
|
function FileMapping(_ref) {
|
|
4417
4419
|
var currentUser = _ref.currentUser,
|
|
4418
4420
|
hideDocumentManager = _ref.hideDocumentManager,
|
|
4419
|
-
_ref$
|
|
4420
|
-
|
|
4421
|
+
_ref$onOpened = _ref.onOpened,
|
|
4422
|
+
onOpened = _ref$onOpened === void 0 ? null : _ref$onOpened,
|
|
4421
4423
|
_ref$onPublished = _ref.onPublished,
|
|
4422
4424
|
_onPublished = _ref$onPublished === void 0 ? null : _ref$onPublished,
|
|
4423
4425
|
_ref$onCanceled = _ref.onCanceled,
|
|
@@ -4443,6 +4445,11 @@ function FileMapping(_ref) {
|
|
|
4443
4445
|
}), documentComponentId != null && /*#__PURE__*/_react["default"].createElement(AssignMapping, {
|
|
4444
4446
|
currentUser: currentUser,
|
|
4445
4447
|
documentComponentId: documentComponentId,
|
|
4448
|
+
onOpen: function onOpen() {
|
|
4449
|
+
if (onOpened != null) {
|
|
4450
|
+
onOpened(documentComponentId);
|
|
4451
|
+
}
|
|
4452
|
+
},
|
|
4446
4453
|
onCancel: function onCancel() {
|
|
4447
4454
|
setDocumentComponentId(null);
|
|
4448
4455
|
if (onCanceled != null) {
|
|
@@ -9234,6 +9241,200 @@ function Tickets(_ref) {
|
|
|
9234
9241
|
}
|
|
9235
9242
|
"use strict";
|
|
9236
9243
|
|
|
9244
|
+
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); }
|
|
9245
|
+
Object.defineProperty(exports, "__esModule", {
|
|
9246
|
+
value: true
|
|
9247
|
+
});
|
|
9248
|
+
exports.UserManagement = UserManagement;
|
|
9249
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9250
|
+
var _system = require("@mui/system");
|
|
9251
|
+
var _material = require("@mui/material");
|
|
9252
|
+
var _Stack = _interopRequireDefault(require("@mui/material/Stack"));
|
|
9253
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
9254
|
+
var _Table = _interopRequireDefault(require("@mui/material/Table"));
|
|
9255
|
+
var _TableBody = _interopRequireDefault(require("@mui/material/TableBody"));
|
|
9256
|
+
var _TableCell = _interopRequireDefault(require("@mui/material/TableCell"));
|
|
9257
|
+
var _TableContainer = _interopRequireDefault(require("@mui/material/TableContainer"));
|
|
9258
|
+
var _TableHead = _interopRequireDefault(require("@mui/material/TableHead"));
|
|
9259
|
+
var _TableRow = _interopRequireDefault(require("@mui/material/TableRow"));
|
|
9260
|
+
var _Paper = _interopRequireDefault(require("@mui/material/Paper"));
|
|
9261
|
+
var _EditRounded = _interopRequireDefault(require("@mui/icons-material/EditRounded"));
|
|
9262
|
+
var _DeleteForeverRounded = _interopRequireDefault(require("@mui/icons-material/DeleteForeverRounded"));
|
|
9263
|
+
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
9264
|
+
var _UploadRounded = _interopRequireDefault(require("@mui/icons-material/UploadRounded"));
|
|
9265
|
+
var _Dialog = _interopRequireDefault(require("@mui/material/Dialog"));
|
|
9266
|
+
var _DialogActions = _interopRequireDefault(require("@mui/material/DialogActions"));
|
|
9267
|
+
var _DialogContent = _interopRequireDefault(require("@mui/material/DialogContent"));
|
|
9268
|
+
var _DialogContentText = _interopRequireDefault(require("@mui/material/DialogContentText"));
|
|
9269
|
+
var _DialogTitle = _interopRequireDefault(require("@mui/material/DialogTitle"));
|
|
9270
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
9271
|
+
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); }
|
|
9272
|
+
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; }
|
|
9273
|
+
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; }
|
|
9274
|
+
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); } }
|
|
9275
|
+
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); }); }; }
|
|
9276
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9277
|
+
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."); }
|
|
9278
|
+
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); }
|
|
9279
|
+
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; }
|
|
9280
|
+
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; } }
|
|
9281
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
9282
|
+
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); } // import { FileUploader, apiService } from 'authscape';
|
|
9283
|
+
function UserManagement(_ref) {
|
|
9284
|
+
_objectDestructuringEmpty(_ref);
|
|
9285
|
+
// const [comments, setComments] = useState([]);
|
|
9286
|
+
// const [message, setMessage] = useState("");
|
|
9287
|
+
|
|
9288
|
+
var _useState = (0, _react.useState)(false),
|
|
9289
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9290
|
+
newUserDialog = _useState2[0],
|
|
9291
|
+
setNewUserDialog = _useState2[1];
|
|
9292
|
+
var _useState3 = (0, _react.useState)([]),
|
|
9293
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
9294
|
+
users = _useState4[0],
|
|
9295
|
+
setUsers = _useState4[1];
|
|
9296
|
+
var _useState5 = (0, _react.useState)(false),
|
|
9297
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
9298
|
+
uploadUsersShowDialog = _useState6[0],
|
|
9299
|
+
setUploadUsersShowDialog = _useState6[1];
|
|
9300
|
+
(0, _react.useEffect)(function () {
|
|
9301
|
+
var fetchData = /*#__PURE__*/function () {
|
|
9302
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
9303
|
+
var response;
|
|
9304
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9305
|
+
while (1) switch (_context.prev = _context.next) {
|
|
9306
|
+
case 0:
|
|
9307
|
+
_context.next = 2;
|
|
9308
|
+
return apiService().get("/UserManagement/GetUsers");
|
|
9309
|
+
case 2:
|
|
9310
|
+
response = _context.sent;
|
|
9311
|
+
if (response != null && response.status == 200) {
|
|
9312
|
+
setUsers(response.data);
|
|
9313
|
+
}
|
|
9314
|
+
case 4:
|
|
9315
|
+
case "end":
|
|
9316
|
+
return _context.stop();
|
|
9317
|
+
}
|
|
9318
|
+
}, _callee);
|
|
9319
|
+
}));
|
|
9320
|
+
return function fetchData() {
|
|
9321
|
+
return _ref2.apply(this, arguments);
|
|
9322
|
+
};
|
|
9323
|
+
}();
|
|
9324
|
+
fetchData();
|
|
9325
|
+
}, []);
|
|
9326
|
+
return /*#__PURE__*/_react["default"].createElement(_system.Box, null, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
9327
|
+
variant: "h3",
|
|
9328
|
+
gutterBottom: true
|
|
9329
|
+
}, "User Management"), /*#__PURE__*/_react["default"].createElement(_Stack["default"], {
|
|
9330
|
+
direction: "row",
|
|
9331
|
+
spacing: 1,
|
|
9332
|
+
sx: {
|
|
9333
|
+
paddingTop: 2
|
|
9334
|
+
}
|
|
9335
|
+
}, /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
9336
|
+
variant: "contained",
|
|
9337
|
+
sx: {
|
|
9338
|
+
width: 200
|
|
9339
|
+
},
|
|
9340
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
9341
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
9342
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
9343
|
+
case 0:
|
|
9344
|
+
setNewUserDialog(true);
|
|
9345
|
+
case 1:
|
|
9346
|
+
case "end":
|
|
9347
|
+
return _context2.stop();
|
|
9348
|
+
}
|
|
9349
|
+
}, _callee2);
|
|
9350
|
+
}))
|
|
9351
|
+
}, "Add User"), /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
9352
|
+
startIcon: /*#__PURE__*/_react["default"].createElement(_UploadRounded["default"], null),
|
|
9353
|
+
variant: "contained",
|
|
9354
|
+
sx: {
|
|
9355
|
+
width: 200
|
|
9356
|
+
},
|
|
9357
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
9358
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
9359
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
9360
|
+
case 0:
|
|
9361
|
+
setUploadUsersShowDialog(true);
|
|
9362
|
+
case 1:
|
|
9363
|
+
case "end":
|
|
9364
|
+
return _context3.stop();
|
|
9365
|
+
}
|
|
9366
|
+
}, _callee3);
|
|
9367
|
+
}))
|
|
9368
|
+
}, "Upload Users")), /*#__PURE__*/_react["default"].createElement(_TableContainer["default"], {
|
|
9369
|
+
component: _Paper["default"],
|
|
9370
|
+
sx: {
|
|
9371
|
+
marginTop: 2
|
|
9372
|
+
}
|
|
9373
|
+
}, /*#__PURE__*/_react["default"].createElement(_Table["default"], {
|
|
9374
|
+
sx: {
|
|
9375
|
+
minWidth: 650
|
|
9376
|
+
},
|
|
9377
|
+
"aria-label": "simple table"
|
|
9378
|
+
}, /*#__PURE__*/_react["default"].createElement(_TableHead["default"], null, /*#__PURE__*/_react["default"].createElement(_TableRow["default"], null, /*#__PURE__*/_react["default"].createElement(_TableCell["default"], null, "Full Name"), /*#__PURE__*/_react["default"].createElement(_TableCell["default"], null, "Email"), /*#__PURE__*/_react["default"].createElement(_TableCell["default"], null, "Company Name"), /*#__PURE__*/_react["default"].createElement(_TableCell["default"], null, "Business Phone"), /*#__PURE__*/_react["default"].createElement(_TableCell["default"], null, "Actions"))), /*#__PURE__*/_react["default"].createElement(_TableBody["default"], null, users.map(function (row) {
|
|
9379
|
+
return /*#__PURE__*/_react["default"].createElement(_TableRow["default"], {
|
|
9380
|
+
key: row.id,
|
|
9381
|
+
sx: {
|
|
9382
|
+
'&:last-child td, &:last-child th': {
|
|
9383
|
+
border: 0
|
|
9384
|
+
}
|
|
9385
|
+
}
|
|
9386
|
+
}, /*#__PURE__*/_react["default"].createElement(_TableCell["default"], {
|
|
9387
|
+
component: "th",
|
|
9388
|
+
scope: "row"
|
|
9389
|
+
}, row.firstName, " ", row.lastName), /*#__PURE__*/_react["default"].createElement(_TableCell["default"], {
|
|
9390
|
+
component: "th",
|
|
9391
|
+
scope: "row"
|
|
9392
|
+
}, row.userName), /*#__PURE__*/_react["default"].createElement(_TableCell["default"], {
|
|
9393
|
+
component: "th",
|
|
9394
|
+
scope: "row"
|
|
9395
|
+
}, row.company.title), /*#__PURE__*/_react["default"].createElement(_TableCell["default"], {
|
|
9396
|
+
component: "th",
|
|
9397
|
+
scope: "row"
|
|
9398
|
+
}, row.phoneNumber), /*#__PURE__*/_react["default"].createElement(_TableCell["default"], {
|
|
9399
|
+
component: "th",
|
|
9400
|
+
scope: "row"
|
|
9401
|
+
}, /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
|
|
9402
|
+
"aria-label": "delete",
|
|
9403
|
+
size: "large",
|
|
9404
|
+
onClick: function onClick() {
|
|
9405
|
+
window.location.href = "/users/" + row.id;
|
|
9406
|
+
}
|
|
9407
|
+
}, /*#__PURE__*/_react["default"].createElement(_EditRounded["default"], {
|
|
9408
|
+
fontSize: "inherit"
|
|
9409
|
+
})), /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
|
|
9410
|
+
"aria-label": "delete",
|
|
9411
|
+
size: "large"
|
|
9412
|
+
}, /*#__PURE__*/_react["default"].createElement(_DeleteForeverRounded["default"], {
|
|
9413
|
+
fontSize: "inherit"
|
|
9414
|
+
}))));
|
|
9415
|
+
})))), /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
9416
|
+
open: uploadUsersShowDialog,
|
|
9417
|
+
onClose: function onClose() {
|
|
9418
|
+
setUploadUsersShowDialog(false);
|
|
9419
|
+
},
|
|
9420
|
+
fullWidth: true
|
|
9421
|
+
}, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], null, "Upload users"), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], null, "Upload multiple users using a CSV sheet"), /*#__PURE__*/_react["default"].createElement(_system.Box, {
|
|
9422
|
+
sx: {
|
|
9423
|
+
height: 200
|
|
9424
|
+
}
|
|
9425
|
+
}, /*#__PURE__*/_react["default"].createElement(FileUploader, {
|
|
9426
|
+
url: "/UserManagement/UploadUsers",
|
|
9427
|
+
onUploadCompleted: function onUploadCompleted() {
|
|
9428
|
+
alert("Uploaded");
|
|
9429
|
+
}
|
|
9430
|
+
}))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_material.Button, {
|
|
9431
|
+
onClick: function onClick() {
|
|
9432
|
+
setUploadUsersShowDialog(false);
|
|
9433
|
+
}
|
|
9434
|
+
}, "Cancel"))));
|
|
9435
|
+
}
|
|
9436
|
+
"use strict";
|
|
9437
|
+
|
|
9237
9438
|
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); }
|
|
9238
9439
|
Object.defineProperty(exports, "__esModule", {
|
|
9239
9440
|
value: true
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@ import CloseIcon from '@mui/icons-material/Close';
|
|
|
15
15
|
import IconButton from '@mui/material/IconButton';
|
|
16
16
|
import ArrowRightAltRoundedIcon from '@mui/icons-material/ArrowRightAltRounded';
|
|
17
17
|
|
|
18
|
-
export function AssignMapping({currentUser, documentComponentId, onCancel = null, onPublished = null}) {
|
|
18
|
+
export function AssignMapping({currentUser, documentComponentId, onOpen = null, onCancel = null, onPublished = null}) {
|
|
19
19
|
|
|
20
20
|
const [documentId, setDocumentId] = useState(documentComponentId);
|
|
21
21
|
|
|
@@ -3,7 +3,7 @@ import { Box } from '@mui/system';
|
|
|
3
3
|
// import ManageMappingDocuments from './manageMappingDocuments';
|
|
4
4
|
// import AssignMapping from './AssignMapping';
|
|
5
5
|
|
|
6
|
-
export function FileMapping({currentUser, hideDocumentManager,
|
|
6
|
+
export function FileMapping({currentUser, hideDocumentManager, onOpened = null, onPublished = null, onCanceled = null, onArchived = null}) {
|
|
7
7
|
|
|
8
8
|
const [documentComponentId, setDocumentComponentId] = useState(null);
|
|
9
9
|
|
|
@@ -31,25 +31,31 @@ export function FileMapping({currentUser, hideDocumentManager, hideStatus = fals
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
{documentComponentId != null &&
|
|
34
|
-
<AssignMapping currentUser={currentUser} documentComponentId={documentComponentId}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
34
|
+
<AssignMapping currentUser={currentUser} documentComponentId={documentComponentId}
|
|
35
|
+
onOpen={() => {
|
|
36
|
+
if (onOpened != null)
|
|
37
|
+
{
|
|
38
|
+
onOpened(documentComponentId);
|
|
39
|
+
}
|
|
40
|
+
}}
|
|
41
|
+
onCancel={() => {
|
|
42
|
+
|
|
43
|
+
setDocumentComponentId(null);
|
|
44
|
+
|
|
45
|
+
if (onCanceled != null)
|
|
46
|
+
{
|
|
47
|
+
onCanceled(documentComponentId);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
}}
|
|
51
|
+
onPublished={() => {
|
|
52
|
+
setDocumentComponentId(null);
|
|
53
|
+
|
|
54
|
+
if (onPublished != null)
|
|
55
|
+
{
|
|
56
|
+
onPublished(documentComponentId);
|
|
57
|
+
}
|
|
58
|
+
}} />
|
|
53
59
|
}
|
|
54
60
|
|
|
55
61
|
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import React, {useEffect, useState, useRef} from 'react';
|
|
2
|
+
import { Box } from '@mui/system';
|
|
3
|
+
import { Button, Grid } from '@mui/material';
|
|
4
|
+
import Stack from '@mui/material/Stack';
|
|
5
|
+
import Typography from '@mui/material/Typography';
|
|
6
|
+
import Table from '@mui/material/Table';
|
|
7
|
+
import TableBody from '@mui/material/TableBody';
|
|
8
|
+
import TableCell from '@mui/material/TableCell';
|
|
9
|
+
import TableContainer from '@mui/material/TableContainer';
|
|
10
|
+
import TableHead from '@mui/material/TableHead';
|
|
11
|
+
import TableRow from '@mui/material/TableRow';
|
|
12
|
+
import Paper from '@mui/material/Paper';
|
|
13
|
+
// import { FileUploader, apiService } from 'authscape';
|
|
14
|
+
import EditRoundedIcon from '@mui/icons-material/EditRounded';
|
|
15
|
+
import DeleteForeverRoundedIcon from '@mui/icons-material/DeleteForeverRounded';
|
|
16
|
+
import IconButton from '@mui/material/IconButton';
|
|
17
|
+
import UploadRoundedIcon from '@mui/icons-material/UploadRounded';
|
|
18
|
+
|
|
19
|
+
import Dialog from '@mui/material/Dialog';
|
|
20
|
+
import DialogActions from '@mui/material/DialogActions';
|
|
21
|
+
import DialogContent from '@mui/material/DialogContent';
|
|
22
|
+
import DialogContentText from '@mui/material/DialogContentText';
|
|
23
|
+
import DialogTitle from '@mui/material/DialogTitle';
|
|
24
|
+
|
|
25
|
+
export function UserManagement({}) {
|
|
26
|
+
|
|
27
|
+
// const [comments, setComments] = useState([]);
|
|
28
|
+
// const [message, setMessage] = useState("");
|
|
29
|
+
|
|
30
|
+
const [newUserDialog, setNewUserDialog] = useState(false);
|
|
31
|
+
const [users, setUsers] = useState([]);
|
|
32
|
+
|
|
33
|
+
const [uploadUsersShowDialog, setUploadUsersShowDialog] = useState(false);
|
|
34
|
+
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
|
|
37
|
+
const fetchData = async () => {
|
|
38
|
+
let response = await apiService().get("/UserManagement/GetUsers");
|
|
39
|
+
if (response != null && response.status == 200)
|
|
40
|
+
{
|
|
41
|
+
setUsers(response.data);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
fetchData();
|
|
45
|
+
|
|
46
|
+
}, []);
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<Box>
|
|
50
|
+
<Typography variant="h3" gutterBottom>
|
|
51
|
+
User Management
|
|
52
|
+
</Typography>
|
|
53
|
+
<Stack direction="row" spacing={1} sx={{paddingTop:2}}>
|
|
54
|
+
<Button variant="contained" sx={{width:200}} onClick={async () => {
|
|
55
|
+
|
|
56
|
+
setNewUserDialog(true);
|
|
57
|
+
|
|
58
|
+
}}>Add User</Button>
|
|
59
|
+
|
|
60
|
+
<Button startIcon={<UploadRoundedIcon/>} variant="contained" sx={{width:200}} onClick={async () => {
|
|
61
|
+
setUploadUsersShowDialog(true);
|
|
62
|
+
}}>Upload Users</Button>
|
|
63
|
+
|
|
64
|
+
</Stack>
|
|
65
|
+
|
|
66
|
+
<TableContainer component={Paper} sx={{marginTop:2}}>
|
|
67
|
+
<Table sx={{ minWidth: 650 }} aria-label="simple table">
|
|
68
|
+
<TableHead>
|
|
69
|
+
<TableRow>
|
|
70
|
+
<TableCell>Full Name</TableCell>
|
|
71
|
+
<TableCell>Email</TableCell>
|
|
72
|
+
<TableCell>Company Name</TableCell>
|
|
73
|
+
<TableCell>Business Phone</TableCell>
|
|
74
|
+
<TableCell>Actions</TableCell>
|
|
75
|
+
</TableRow>
|
|
76
|
+
</TableHead>
|
|
77
|
+
<TableBody>
|
|
78
|
+
{users.map((row) => (
|
|
79
|
+
<TableRow key={row.id} sx={{ '&:last-child td, &:last-child th': { border: 0 } }}>
|
|
80
|
+
<TableCell component="th" scope="row">
|
|
81
|
+
{row.firstName} {row.lastName}
|
|
82
|
+
</TableCell>
|
|
83
|
+
<TableCell component="th" scope="row">
|
|
84
|
+
{row.userName}
|
|
85
|
+
</TableCell>
|
|
86
|
+
<TableCell component="th" scope="row">
|
|
87
|
+
{row.company.title}
|
|
88
|
+
</TableCell>
|
|
89
|
+
<TableCell component="th" scope="row">
|
|
90
|
+
{row.phoneNumber}
|
|
91
|
+
</TableCell>
|
|
92
|
+
<TableCell component="th" scope="row">
|
|
93
|
+
|
|
94
|
+
<IconButton aria-label="delete" size="large" onClick={() => {
|
|
95
|
+
window.location.href = "/users/" + row.id
|
|
96
|
+
}}>
|
|
97
|
+
<EditRoundedIcon fontSize="inherit" />
|
|
98
|
+
</IconButton>
|
|
99
|
+
|
|
100
|
+
<IconButton aria-label="delete" size="large">
|
|
101
|
+
<DeleteForeverRoundedIcon fontSize="inherit" />
|
|
102
|
+
</IconButton>
|
|
103
|
+
|
|
104
|
+
</TableCell>
|
|
105
|
+
</TableRow>
|
|
106
|
+
))}
|
|
107
|
+
</TableBody>
|
|
108
|
+
</Table>
|
|
109
|
+
</TableContainer>
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
<Dialog
|
|
114
|
+
open={uploadUsersShowDialog}
|
|
115
|
+
onClose={() => {
|
|
116
|
+
setUploadUsersShowDialog(false);
|
|
117
|
+
}}
|
|
118
|
+
fullWidth={true}>
|
|
119
|
+
<DialogTitle>
|
|
120
|
+
{"Upload users"}
|
|
121
|
+
</DialogTitle>
|
|
122
|
+
<DialogContent>
|
|
123
|
+
<DialogContentText>
|
|
124
|
+
Upload multiple users using a CSV sheet
|
|
125
|
+
</DialogContentText>
|
|
126
|
+
|
|
127
|
+
<Box sx={{height:200}}>
|
|
128
|
+
<FileUploader url={"/UserManagement/UploadUsers"} onUploadCompleted={() => {
|
|
129
|
+
alert("Uploaded");
|
|
130
|
+
}} />
|
|
131
|
+
</Box>
|
|
132
|
+
|
|
133
|
+
</DialogContent>
|
|
134
|
+
<DialogActions>
|
|
135
|
+
<Button onClick={() => {
|
|
136
|
+
setUploadUsersShowDialog(false);
|
|
137
|
+
}}>Cancel</Button>
|
|
138
|
+
</DialogActions>
|
|
139
|
+
</Dialog>
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
</Box>
|
|
143
|
+
);
|
|
144
|
+
}
|