authscape 1.0.239 → 1.0.242

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
@@ -1441,16 +1441,14 @@ var _Tab = _interopRequireDefault(require("@mui/material/Tab"));
1441
1441
  var _Box = _interopRequireDefault(require("@mui/material/Box"));
1442
1442
  var _material = require("@mui/material");
1443
1443
  var _xDataGrid = require("@mui/x-data-grid");
1444
- var _excluded = ["children", "value", "index"];
1444
+ var _PublishRounded = _interopRequireDefault(require("@mui/icons-material/PublishRounded"));
1445
+ var _image = _interopRequireDefault(require("next/image"));
1445
1446
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
1446
1447
  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); }
1447
1448
  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; }
1448
1449
  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; }
1449
1450
  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); } }
1450
1451
  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); }); }; }
1451
- 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); }
1452
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
1453
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
1454
1452
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1455
1453
  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."); }
1456
1454
  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); }
@@ -1462,53 +1460,39 @@ function OEMEditor(_ref) {
1462
1460
  notification = _ref.notification,
1463
1461
  _ref$companyId = _ref.companyId,
1464
1462
  companyId = _ref$companyId === void 0 ? null : _ref$companyId;
1463
+ var monaco = (0, _react2.useMonaco)();
1465
1464
  var cssEditorRef = (0, _react.useRef)(null);
1466
1465
  var htmlEditorRef = (0, _react.useRef)(null);
1467
1466
  var _useState = (0, _react.useState)(''),
1468
1467
  _useState2 = _slicedToArray(_useState, 2),
1469
1468
  data = _useState2[0],
1470
1469
  setData = _useState2[1];
1471
- var _React$useState = _react["default"].useState(0),
1472
- _React$useState2 = _slicedToArray(_React$useState, 2),
1473
- value = _React$useState2[0],
1474
- setValue = _React$useState2[1];
1475
- var _useState3 = (0, _react.useState)([]),
1470
+ var _useState3 = (0, _react.useState)(0),
1476
1471
  _useState4 = _slicedToArray(_useState3, 2),
1477
- fonts = _useState4[0],
1478
- setFonts = _useState4[1];
1472
+ value = _useState4[0],
1473
+ setValue = _useState4[1];
1479
1474
  var _useState5 = (0, _react.useState)([]),
1480
1475
  _useState6 = _slicedToArray(_useState5, 2),
1481
- dnsFields = _useState6[0],
1482
- setDnsFields = _useState6[1];
1483
- var _useState7 = (0, _react.useState)(null),
1476
+ fonts = _useState6[0],
1477
+ setFonts = _useState6[1];
1478
+ var _useState7 = (0, _react.useState)([]),
1484
1479
  _useState8 = _slicedToArray(_useState7, 2),
1485
- selectedFont = _useState8[0],
1486
- setSelectedFont = _useState8[1];
1487
- function TabPanel(props) {
1488
- var children = props.children,
1489
- value = props.value,
1490
- index = props.index,
1491
- other = _objectWithoutProperties(props, _excluded);
1492
- return /*#__PURE__*/_react["default"].createElement("div", _extends({
1493
- role: "tabpanel",
1494
- hidden: value !== index,
1495
- id: "simple-tabpanel-".concat(index),
1496
- "aria-labelledby": "simple-tab-".concat(index)
1497
- }, other), value === index && /*#__PURE__*/_react["default"].createElement(_Box["default"], {
1498
- sx: {
1499
- p: 3
1500
- }
1501
- }, children));
1502
- }
1503
- function a11yProps(index) {
1504
- return {
1505
- id: "simple-tab-".concat(index),
1506
- 'aria-controls': "simple-tabpanel-".concat(index)
1507
- };
1508
- }
1480
+ dnsFields = _useState8[0],
1481
+ setDnsFields = _useState8[1];
1482
+ var _useState9 = (0, _react.useState)(null),
1483
+ _useState10 = _slicedToArray(_useState9, 2),
1484
+ selectedFont = _useState10[0],
1485
+ setSelectedFont = _useState10[1];
1486
+ var _useState11 = (0, _react.useState)(''),
1487
+ _useState12 = _slicedToArray(_useState11, 2),
1488
+ stateBaseUri = _useState12[0],
1489
+ setBaseUri = _useState12[1];
1509
1490
  var handleChange = function handleChange(event, newValue) {
1510
1491
  setValue(newValue);
1511
1492
  };
1493
+ var GetBaseUrl = function GetBaseUrl() {
1494
+ return window.location.protocol + "//" + window.location.host;
1495
+ };
1512
1496
  (0, _react.useEffect)(function () {
1513
1497
  if (loadedUser) {
1514
1498
  var fetchData = /*#__PURE__*/function () {
@@ -1526,7 +1510,7 @@ function OEMEditor(_ref) {
1526
1510
  }
1527
1511
  domain = GetBaseUrl();
1528
1512
  _context.next = 7;
1529
- return apiService().get("/OEM/GetFields?domain=" + domain + "&companyId=" + companyId);
1513
+ return apiService().get("/OEM/GetFields?domain=" + domain + (companyId != null ? "&companyId=" + companyId : ""));
1530
1514
  case 7:
1531
1515
  responseFields = _context.sent;
1532
1516
  if (responseFields != null && responseFields.status == 200) {
@@ -1545,13 +1529,19 @@ function OEMEditor(_ref) {
1545
1529
  fetchData();
1546
1530
  }
1547
1531
  }, [loadedUser]);
1532
+ var _React$useState = _react["default"].useState({
1533
+ page: 0,
1534
+ pageSize: 5
1535
+ }),
1536
+ _React$useState2 = _slicedToArray(_React$useState, 2),
1537
+ paginationModel = _React$useState2[0],
1538
+ setPaginationModel = _React$useState2[1];
1548
1539
  function handleCSSEditorDidMount(editor, monaco) {
1549
1540
  cssEditorRef.current = editor;
1550
1541
  }
1551
1542
  function handleHtmlEditorDidMount(editor, monaco) {
1552
1543
  htmlEditorRef.current = editor;
1553
1544
  }
1554
- var monaco = (0, _react2.useMonaco)();
1555
1545
  var columns = [{
1556
1546
  field: "label",
1557
1547
  headerName: "Fonts",
@@ -1585,15 +1575,16 @@ function OEMEditor(_ref) {
1585
1575
  // //console.log("here is the monaco instance:", monaco);
1586
1576
  // }
1587
1577
  baseUri = GetBaseUrl();
1588
- _context2.next = 3;
1589
- return apiService().get("/oem/GetEditorData?domain=" + baseUri + "&companyId=" + companyId);
1590
- case 3:
1578
+ setBaseUri(baseUri);
1579
+ _context2.next = 4;
1580
+ return apiService().get("/oem/GetEditorData?domain=" + baseUri + (companyId != null ? "&companyId=" + companyId : ""));
1581
+ case 4:
1591
1582
  response = _context2.sent;
1592
1583
  if (response.status == 200) {
1593
1584
  setData(response.data);
1594
1585
  setSelectedFont(response.data.fontFamily);
1595
1586
  }
1596
- case 5:
1587
+ case 6:
1597
1588
  case "end":
1598
1589
  return _context2.stop();
1599
1590
  }
@@ -1621,19 +1612,48 @@ function OEMEditor(_ref) {
1621
1612
  value: value,
1622
1613
  onChange: handleChange,
1623
1614
  "aria-label": "basic tabs example"
1624
- }, /*#__PURE__*/_react["default"].createElement(_Tab["default"], _extends({
1615
+ }, /*#__PURE__*/_react["default"].createElement(_Tab["default"], {
1625
1616
  label: "General"
1626
- }, a11yProps(0))), /*#__PURE__*/_react["default"].createElement(_Tab["default"], _extends({
1617
+ }), /*#__PURE__*/_react["default"].createElement(_Tab["default"], {
1627
1618
  label: "Fonts"
1628
- }, a11yProps(1))), /*#__PURE__*/_react["default"].createElement(_Tab["default"], _extends({
1619
+ }), /*#__PURE__*/_react["default"].createElement(_Tab["default"], {
1629
1620
  label: "Style Sheet Editor"
1630
- }, a11yProps(2))), /*#__PURE__*/_react["default"].createElement(_Tab["default"], _extends({
1621
+ }), /*#__PURE__*/_react["default"].createElement(_Tab["default"], {
1631
1622
  label: "HTML Import Editor"
1632
- }, a11yProps(3))))), /*#__PURE__*/_react["default"].createElement(TabPanel, {
1633
- value: value,
1634
- index: 0
1635
- }, dnsFields != null && dnsFields.map(function (dnsField) {
1636
- return /*#__PURE__*/_react["default"].createElement(_Box["default"], null, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
1623
+ }))), /*#__PURE__*/_react["default"].createElement(_Box["default"], null, /*#__PURE__*/_react["default"].createElement(_Box["default"], {
1624
+ sx: {
1625
+ padding: 2
1626
+ }
1627
+ }, value == 0 && /*#__PURE__*/_react["default"].createElement(_Box["default"], null, /*#__PURE__*/_react["default"].createElement(_Box["default"], {
1628
+ sx: {
1629
+ paddingBottom: 4
1630
+ }
1631
+ }, data.appIconUrl == null && /*#__PURE__*/_react["default"].createElement(_image["default"], {
1632
+ src: "/DefaultNoImage.svg",
1633
+ width: 200,
1634
+ height: 200
1635
+ }), data.appIconUrl != null && /*#__PURE__*/_react["default"].createElement(_image["default"], {
1636
+ src: data.appIconUrl,
1637
+ width: 200,
1638
+ height: 200
1639
+ }), /*#__PURE__*/_react["default"].createElement(FileUploader, {
1640
+ url: "/oem/UploadAppIcon",
1641
+ params: {
1642
+ domain: stateBaseUri
1643
+ },
1644
+ multiple: true,
1645
+ variant: "custom",
1646
+ onUploadCompleted: function onUploadCompleted() {
1647
+ window.location.reload();
1648
+ }
1649
+ }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
1650
+ color: "primary",
1651
+ variant: "contained",
1652
+ startIcon: /*#__PURE__*/_react["default"].createElement(_PublishRounded["default"], null)
1653
+ }, "Upload App Icon"))), dnsFields != null && dnsFields.map(function (dnsField, index) {
1654
+ return /*#__PURE__*/_react["default"].createElement(_Box["default"], {
1655
+ key: index
1656
+ }, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
1637
1657
  container: true,
1638
1658
  spacing: 2
1639
1659
  }, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
@@ -1669,7 +1689,7 @@ function OEMEditor(_ref) {
1669
1689
  };
1670
1690
  }()
1671
1691
  }))));
1672
- })), /*#__PURE__*/_react["default"].createElement(TabPanel, {
1692
+ })), value == 1 && /*#__PURE__*/_react["default"].createElement(_Box["default"], {
1673
1693
  value: value,
1674
1694
  index: 1
1675
1695
  }, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
@@ -1678,14 +1698,22 @@ function OEMEditor(_ref) {
1678
1698
  }, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
1679
1699
  item: true,
1680
1700
  xs: 6
1681
- }, loadedUser && /*#__PURE__*/_react["default"].createElement(_xDataGrid.DataGrid, {
1701
+ }, loadedUser == true && /*#__PURE__*/_react["default"].createElement(_Box["default"], null, /*#__PURE__*/_react["default"].createElement(_xDataGrid.DataGrid, {
1682
1702
  rows: fonts,
1683
1703
  columns: columns,
1684
1704
  sx: {
1685
1705
  height: "80vh"
1686
1706
  },
1707
+ pagination: true,
1708
+ disableSelectionOnClick: true,
1709
+ onPaginationModelChange: setPaginationModel,
1710
+ paginationModel: paginationModel
1711
+ //pageSizeOptions={[5]}
1712
+ // rowCount={100}
1713
+ // rowSelectionModel={selectedFont}
1714
+ ,
1687
1715
  onRowClick: /*#__PURE__*/function () {
1688
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(row) {
1716
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(params) {
1689
1717
  var baseUri, response;
1690
1718
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
1691
1719
  while (1) switch (_context4.prev = _context4.next) {
@@ -1695,12 +1723,12 @@ function OEMEditor(_ref) {
1695
1723
  return apiService().post("/OEM/SetFont", {
1696
1724
  companyId: companyId,
1697
1725
  domain: baseUri,
1698
- value: row.row.label
1726
+ value: params.row.label
1699
1727
  });
1700
1728
  case 3:
1701
1729
  response = _context4.sent;
1702
1730
  if (response != null && response.status == 200) {
1703
- setSelectedFont(row.row.label);
1731
+ setSelectedFont(params.row.label);
1704
1732
  notification("Font saved!");
1705
1733
  }
1706
1734
  case 5:
@@ -1713,7 +1741,7 @@ function OEMEditor(_ref) {
1713
1741
  return _ref5.apply(this, arguments);
1714
1742
  };
1715
1743
  }()
1716
- })), /*#__PURE__*/_react["default"].createElement(_material.Grid, {
1744
+ }))), /*#__PURE__*/_react["default"].createElement(_material.Grid, {
1717
1745
  item: true,
1718
1746
  xs: 6,
1719
1747
  sx: {
@@ -1729,7 +1757,7 @@ function OEMEditor(_ref) {
1729
1757
  sx: {
1730
1758
  fontFamily: selectedFont
1731
1759
  }
1732
- }, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ut ultricies odio. Nunc ut quam turpis. In hac habitasse platea dictumst. Suspendisse potenti. Nullam malesuada, purus id sagittis vestibulum, massa tellus gravida elit, vitae ultrices tortor nulla ac nunc. Aenean tempus semper est vel convallis. Sed feugiat, risus eu tincidunt eleifend, purus metus vulputate nulla, et condimentum sapien erat in nisi. Nunc non malesuada libero. Donec tempus tincidunt mi at vulputate. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse potenti. Etiam nec eleifend orci. Suspendisse in est vel nunc rhoncus bibendum vitae id felis. Integer bibendum dolor elit, at tincidunt lacus tempor ac. Maecenas lobortis, mauris at condimentum feugiat, nulla orci condimentum massa, sed facilisis tellus ligula vitae metus. Aliquam erat volutpat. Quisque dignissim felis augue, at semper nisl posuere ut. Proin fringilla diam vitae faucibus finibus.", /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement("br", null), "Aenean tempus semper est vel convallis. Sed feugiat, risus eu tincidunt eleifend, purus metus vulputate nulla, et condimentum sapien erat in nisi. Nunc non malesuada libero. Donec tempus tincidunt mi at vulputate. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse potenti")))), /*#__PURE__*/_react["default"].createElement(TabPanel, {
1760
+ }, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ut ultricies odio. Nunc ut quam turpis. In hac habitasse platea dictumst. Suspendisse potenti. Nullam malesuada, purus id sagittis vestibulum, massa tellus gravida elit, vitae ultrices tortor nulla ac nunc. Aenean tempus semper est vel convallis. Sed feugiat, risus eu tincidunt eleifend, purus metus vulputate nulla, et condimentum sapien erat in nisi. Nunc non malesuada libero. Donec tempus tincidunt mi at vulputate. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse potenti. Etiam nec eleifend orci. Suspendisse in est vel nunc rhoncus bibendum vitae id felis. Integer bibendum dolor elit, at tincidunt lacus tempor ac. Maecenas lobortis, mauris at condimentum feugiat, nulla orci condimentum massa, sed facilisis tellus ligula vitae metus. Aliquam erat volutpat. Quisque dignissim felis augue, at semper nisl posuere ut. Proin fringilla diam vitae faucibus finibus.", /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement("br", null), "Aenean tempus semper est vel convallis. Sed feugiat, risus eu tincidunt eleifend, purus metus vulputate nulla, et condimentum sapien erat in nisi. Nunc non malesuada libero. Donec tempus tincidunt mi at vulputate. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse potenti")))), value == 2 && /*#__PURE__*/_react["default"].createElement(_Box["default"], {
1733
1761
  value: value,
1734
1762
  index: 2
1735
1763
  }, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
@@ -1781,13 +1809,13 @@ function OEMEditor(_ref) {
1781
1809
  sx: {
1782
1810
  paddingTop: 1
1783
1811
  }
1784
- }, /*#__PURE__*/_react["default"].createElement(_react2["default"], {
1812
+ }, data != null && /*#__PURE__*/_react["default"].createElement(_react2["default"], {
1785
1813
  height: "70vh",
1786
1814
  onMount: handleCSSEditorDidMount,
1787
1815
  defaultLanguage: "css",
1788
1816
  theme: "vs-dark",
1789
1817
  defaultValue: data.prettyCSS == null ? "" : data.prettyCSS
1790
- }))), /*#__PURE__*/_react["default"].createElement(TabPanel, {
1818
+ }), data.prettyCSS)), value == 3 && /*#__PURE__*/_react["default"].createElement(_Box["default"], {
1791
1819
  value: value,
1792
1820
  index: 3
1793
1821
  }, /*#__PURE__*/_react["default"].createElement(_material.Grid, {
@@ -1845,7 +1873,7 @@ function OEMEditor(_ref) {
1845
1873
  defaultLanguage: "html",
1846
1874
  theme: "vs-dark",
1847
1875
  defaultValue: data.prettyHTML == null ? "" : data.prettyHTML
1848
- })))));
1876
+ })))))));
1849
1877
  }
1850
1878
  "use strict";
1851
1879
 
@@ -3094,8 +3122,54 @@ var authService = function authService() {
3094
3122
  }
3095
3123
  return challenge_from_verifier;
3096
3124
  }(),
3125
+ inviteUsers: function () {
3126
+ var _inviteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(inviteRequests) {
3127
+ var response;
3128
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3129
+ while (1) switch (_context2.prev = _context2.next) {
3130
+ case 0:
3131
+ _context2.next = 2;
3132
+ return apiService().post(process.env.authorityUri + "/Invite/InviteUsers", inviteRequests);
3133
+ case 2:
3134
+ response = _context2.sent;
3135
+ return _context2.abrupt("return", response);
3136
+ case 4:
3137
+ case "end":
3138
+ return _context2.stop();
3139
+ }
3140
+ }, _callee2);
3141
+ }));
3142
+ function inviteUsers(_x2) {
3143
+ return _inviteUsers.apply(this, arguments);
3144
+ }
3145
+ return inviteUsers;
3146
+ }(),
3147
+ inviteUser: function () {
3148
+ var _inviteUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(inviteRequest) {
3149
+ var inviteRequests, response;
3150
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3151
+ while (1) switch (_context3.prev = _context3.next) {
3152
+ case 0:
3153
+ inviteRequests = [];
3154
+ inviteRequests.push(inviteRequest);
3155
+ _context3.next = 4;
3156
+ return apiService().post(process.env.authorityUri + "/Invite/InviteUsers", inviteRequests);
3157
+ case 4:
3158
+ response = _context3.sent;
3159
+ return _context3.abrupt("return", response);
3160
+ case 6:
3161
+ case "end":
3162
+ return _context3.stop();
3163
+ }
3164
+ }, _callee3);
3165
+ }));
3166
+ function inviteUser(_x3) {
3167
+ return _inviteUser.apply(this, arguments);
3168
+ }
3169
+ return inviteUser;
3170
+ }(),
3097
3171
  login: function () {
3098
- var _login = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
3172
+ var _login = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
3099
3173
  var redirectUserUri,
3100
3174
  dnsRecord,
3101
3175
  deviceId,
@@ -3104,22 +3178,22 @@ var authService = function authService() {
3104
3178
  challenge,
3105
3179
  redirectUri,
3106
3180
  loginUri,
3107
- _args2 = arguments;
3108
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3109
- while (1) switch (_context2.prev = _context2.next) {
3181
+ _args4 = arguments;
3182
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
3183
+ while (1) switch (_context4.prev = _context4.next) {
3110
3184
  case 0:
3111
- redirectUserUri = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : null;
3112
- dnsRecord = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : null;
3113
- deviceId = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : null;
3185
+ redirectUserUri = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : null;
3186
+ dnsRecord = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : null;
3187
+ deviceId = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : null;
3114
3188
  state = "1234";
3115
3189
  if (redirectUserUri != null) {
3116
3190
  localStorage.setItem("redirectUri", redirectUserUri);
3117
3191
  }
3118
3192
  verifier = authService().generateRandomString();
3119
- _context2.next = 8;
3193
+ _context4.next = 8;
3120
3194
  return authService().challenge_from_verifier(verifier);
3121
3195
  case 8:
3122
- challenge = _context2.sent;
3196
+ challenge = _context4.sent;
3123
3197
  window.localStorage.setItem("verifier", verifier);
3124
3198
  redirectUri = window.location.origin + "/signin-oidc";
3125
3199
  loginUri = process.env.authorityUri + "/connect/authorize?response_type=code&state=" + state + "&client_id=" + process.env.client_id + "&scope=email%20openid%20offline_access%20profile%20api1&redirect_uri=" + redirectUri + "&code_challenge=" + challenge + "&code_challenge_method=S256";
@@ -3130,9 +3204,9 @@ var authService = function authService() {
3130
3204
  window.location.href = loginUri;
3131
3205
  case 14:
3132
3206
  case "end":
3133
- return _context2.stop();
3207
+ return _context4.stop();
3134
3208
  }
3135
- }, _callee2);
3209
+ }, _callee4);
3136
3210
  }));
3137
3211
  function login() {
3138
3212
  return _login.apply(this, arguments);
@@ -3153,16 +3227,16 @@ var authService = function authService() {
3153
3227
  window.location.href = url;
3154
3228
  },
3155
3229
  manageAccount: function () {
3156
- var _manageAccount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
3157
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3158
- while (1) switch (_context3.prev = _context3.next) {
3230
+ var _manageAccount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
3231
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
3232
+ while (1) switch (_context5.prev = _context5.next) {
3159
3233
  case 0:
3160
3234
  window.location.href = process.env.authorityUri + "/Identity/Account/Manage";
3161
3235
  case 1:
3162
3236
  case "end":
3163
- return _context3.stop();
3237
+ return _context5.stop();
3164
3238
  }
3165
- }, _callee3);
3239
+ }, _callee5);
3166
3240
  }));
3167
3241
  function manageAccount() {
3168
3242
  return _manageAccount.apply(this, arguments);
@@ -3170,15 +3244,15 @@ var authService = function authService() {
3170
3244
  return manageAccount;
3171
3245
  }(),
3172
3246
  logout: function () {
3173
- var _logout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
3247
+ var _logout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
3174
3248
  var redirectUri,
3175
3249
  domainHost,
3176
3250
  AuthUri,
3177
- _args4 = arguments;
3178
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
3179
- while (1) switch (_context4.prev = _context4.next) {
3251
+ _args6 = arguments;
3252
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
3253
+ while (1) switch (_context6.prev = _context6.next) {
3180
3254
  case 0:
3181
- redirectUri = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : null;
3255
+ redirectUri = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : null;
3182
3256
  domainHost = window.location.hostname.split('.').slice(-2).join('.');
3183
3257
  AuthUri = process.env.authorityUri;
3184
3258
  (0, _nookies.destroyCookie)({}, "access_token", {
@@ -3205,9 +3279,9 @@ var authService = function authService() {
3205
3279
  }, 500);
3206
3280
  case 7:
3207
3281
  case "end":
3208
- return _context4.stop();
3282
+ return _context6.stop();
3209
3283
  }
3210
- }, _callee4);
3284
+ }, _callee6);
3211
3285
  }));
3212
3286
  function logout() {
3213
3287
  return _logout.apply(this, arguments);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "authscape",
3
- "version": "1.0.239",
3
+ "version": "1.0.242",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -7,49 +7,32 @@ import Tab from '@mui/material/Tab';
7
7
  import Box from '@mui/material/Box';
8
8
  import { Grid } from "@mui/material";
9
9
  import { DataGrid } from "@mui/x-data-grid";
10
+ import PublishRoundedIcon from '@mui/icons-material/PublishRounded';
11
+ import Image from "next/image";
10
12
 
11
13
  export function OEMEditor({loadedUser, notification, companyId = null}) {
12
14
 
15
+ const monaco = useMonaco();
16
+
13
17
  const cssEditorRef = useRef(null);
14
18
  const htmlEditorRef = useRef(null);
15
19
 
16
20
  const [data, setData] = useState('');
17
- const [value, setValue] = React.useState(0);
21
+ const [value, setValue] = useState(0);
18
22
  const [fonts, setFonts] = useState([]);
19
23
  const [dnsFields, setDnsFields] = useState([]);
20
24
  const [selectedFont, setSelectedFont] = useState(null);
21
25
 
22
- function TabPanel(props) {
23
- const { children, value, index, ...other } = props;
24
-
25
- return (
26
- <div
27
- role="tabpanel"
28
- hidden={value !== index}
29
- id={`simple-tabpanel-${index}`}
30
- aria-labelledby={`simple-tab-${index}`}
31
- {...other}
32
- >
33
- {value === index && (
34
- <Box sx={{ p: 3 }}>
35
- {children}
36
- </Box>
37
- )}
38
- </div>
39
- );
40
- }
41
-
42
- function a11yProps(index) {
43
- return {
44
- id: `simple-tab-${index}`,
45
- 'aria-controls': `simple-tabpanel-${index}`,
46
- };
47
- }
26
+ const [stateBaseUri, setBaseUri] = useState('');
48
27
 
49
28
  const handleChange = (event, newValue) => {
50
29
  setValue(newValue);
51
30
  };
52
31
 
32
+ const GetBaseUrl = () => {
33
+ return window.location.protocol + "//" + window.location.host;
34
+ }
35
+
53
36
  useEffect(() => {
54
37
 
55
38
  if (loadedUser)
@@ -63,7 +46,7 @@ export function OEMEditor({loadedUser, notification, companyId = null}) {
63
46
  }
64
47
 
65
48
  var domain = GetBaseUrl();
66
- let responseFields = await apiService().get("/OEM/GetFields?domain=" + domain + "&companyId=" + companyId);
49
+ let responseFields = await apiService().get("/OEM/GetFields?domain=" + domain + (companyId != null ? ("&companyId=" + companyId) : ""));
67
50
  if (responseFields != null && responseFields.status == 200)
68
51
  {
69
52
  setDnsFields(responseFields.data);
@@ -74,6 +57,12 @@ export function OEMEditor({loadedUser, notification, companyId = null}) {
74
57
  }
75
58
 
76
59
  }, [loadedUser]);
60
+
61
+
62
+ const [paginationModel, setPaginationModel] = React.useState({
63
+ page: 0,
64
+ pageSize: 5,
65
+ });
77
66
 
78
67
 
79
68
  function handleCSSEditorDidMount(editor, monaco) {
@@ -84,7 +73,7 @@ export function OEMEditor({loadedUser, notification, companyId = null}) {
84
73
  htmlEditorRef.current = editor;
85
74
  }
86
75
 
87
- const monaco = useMonaco();
76
+
88
77
 
89
78
  const columns = [
90
79
  {
@@ -117,7 +106,9 @@ export function OEMEditor({loadedUser, notification, companyId = null}) {
117
106
  // }
118
107
 
119
108
  var baseUri = GetBaseUrl();
120
- let response = await apiService().get("/oem/GetEditorData?domain=" + baseUri + "&companyId=" + companyId);
109
+ setBaseUri(baseUri);
110
+
111
+ let response = await apiService().get("/oem/GetEditorData?domain=" + baseUri + (companyId != null ? ("&companyId=" + companyId) : ""));
121
112
  if (response.status == 200)
122
113
  {
123
114
  setData(response.data);
@@ -130,191 +121,231 @@ export function OEMEditor({loadedUser, notification, companyId = null}) {
130
121
 
131
122
  return (
132
123
  <>
133
- <Box sx={{ width: '100%' }}>
134
-
135
- {selectedFont != null &&
136
- <link href={"https://fonts.googleapis.com/css2?family=" + selectedFont} rel="stylesheet"></link>
137
- }
138
-
139
- <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
140
- <Tabs value={value} onChange={handleChange} aria-label="basic tabs example">
141
- <Tab label="General" {...a11yProps(0)} />
142
- <Tab label="Fonts" {...a11yProps(1)} />
143
- <Tab label="Style Sheet Editor" {...a11yProps(2)} />
144
- <Tab label="HTML Import Editor" {...a11yProps(3)} />
145
- </Tabs>
146
- </Box>
147
- <TabPanel value={value} index={0}>
148
-
149
- {dnsFields != null && dnsFields.map((dnsField) => {
150
-
151
- return (
152
- <Box>
153
- <Grid container spacing={2}>
154
- <Grid item xs={3}>
155
- {dnsField.name}
156
- </Grid>
157
- <Grid item xs={9}>
124
+ <Box sx={{ width: '100%' }}>
158
125
 
159
- <ColorPicker name={dnsField.name} defaultColor={dnsField.value} onColorChanged={async (name, hex) => {
126
+ {selectedFont != null &&
127
+ <link href={"https://fonts.googleapis.com/css2?family=" + selectedFont} rel="stylesheet"></link>
128
+ }
129
+
130
+ <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
131
+ <Tabs value={value} onChange={handleChange} aria-label="basic tabs example">
132
+ <Tab label="General" />
133
+ <Tab label="Fonts" />
134
+ <Tab label="Style Sheet Editor" />
135
+ <Tab label="HTML Import Editor" />
136
+ </Tabs>
137
+ </Box>
138
+ <Box>
139
+
140
+ <Box sx={{padding:2}}>
141
+ {value == 0 &&
142
+ <Box>
160
143
 
161
- await apiService().post("/OEM/SetFieldValue", {
162
- id: dnsField.id,
163
- fieldId: dnsField.fieldId,
164
- value: hex
165
- });
144
+ <Box sx={{paddingBottom:4}}>
166
145
 
167
- notification(dnsField.name + " Saved");
146
+ {data.appIconUrl == null &&
147
+ <Image src={"/DefaultNoImage.svg"} width={200} height={200} />
148
+ }
149
+
150
+ {data.appIconUrl != null &&
151
+ <Image src={data.appIconUrl} width={200} height={200} />
152
+ }
153
+
154
+ <FileUploader url={"/oem/UploadAppIcon"} params={{
155
+ domain: stateBaseUri
156
+ }} multiple={true} variant='custom' onUploadCompleted={() => {
157
+ window.location.reload();
158
+ }}>
159
+
160
+ <Button color="primary" variant="contained" startIcon={<PublishRoundedIcon/>}>Upload App Icon</Button>
161
+
162
+ </FileUploader>
168
163
 
169
- }} />
170
- </Grid>
171
- </Grid>
172
164
  </Box>
173
- )
174
-
175
-
176
-
177
- })}
178
-
179
- {/* {dnsFields != null &&
180
- <Box sx={{marginTop:2}}>
181
- <Button startIcon={<SaveRoundedIcon/>} variant="contained" onClick={async () => {
182
-
183
- await apiService().post("/oem/SetFieldValue", {
184
- id: dnsField.id,
185
- name: dnsField.name,
186
- value: JSON.stringify(rgb)
187
- });
188
-
189
- }}>Save Changes</Button>
190
- </Box>
191
- } */}
192
-
193
- </TabPanel>
194
- <TabPanel value={value} index={1}>
195
-
196
- <Grid container spacing={2}>
197
- <Grid item xs={6}>
198
-
199
- {(loadedUser) &&
200
-
201
- <DataGrid
202
- rows={fonts}
203
- columns={columns}
204
- sx={{height:"80vh"}}
205
- onRowClick={async (row) => {
206
-
207
- var baseUri = GetBaseUrl();
208
- let response = await apiService().post("/OEM/SetFont", {
209
- companyId: companyId,
210
- domain: baseUri,
211
- value: row.row.label
212
- });
213
- if (response != null && response.status == 200)
214
- {
215
- setSelectedFont(row.row.label);
216
- notification("Font saved!");
217
- }
218
- }}
219
- />
220
- }
221
165
 
166
+
167
+
168
+ {dnsFields != null && dnsFields.map((dnsField, index) => {
169
+
170
+ return (
171
+ <Box key={index}>
172
+ <Grid container spacing={2}>
173
+ <Grid item xs={3}>
174
+ {dnsField.name}
175
+ </Grid>
176
+ <Grid item xs={9}>
177
+
178
+ <ColorPicker name={dnsField.name} defaultColor={dnsField.value} onColorChanged={async (name, hex) => {
179
+
180
+ await apiService().post("/OEM/SetFieldValue", {
181
+ id: dnsField.id,
182
+ fieldId: dnsField.fieldId,
183
+ value: hex
184
+ });
185
+
186
+ notification(dnsField.name + " Saved");
187
+
188
+ }} />
189
+ </Grid>
190
+ </Grid>
191
+ </Box>
192
+ )
193
+
194
+
195
+
196
+ })}
197
+ </Box>
198
+ }
199
+
200
+ {value == 1 &&
201
+ <Box value={value} index={1}>
202
+
203
+ <Grid container spacing={2}>
204
+ <Grid item xs={6}>
205
+
206
+ {loadedUser == true &&
207
+
208
+ <Box>
209
+ <DataGrid
210
+ rows={fonts}
211
+ columns={columns}
212
+ sx={{height:"80vh"}}
213
+ pagination
214
+ disableSelectionOnClick={true}
215
+ onPaginationModelChange={setPaginationModel}
216
+ paginationModel={paginationModel}
217
+ //pageSizeOptions={[5]}
218
+ // rowCount={100}
219
+ // rowSelectionModel={selectedFont}
220
+ onRowClick={async (params) => {
221
+
222
+ var baseUri = GetBaseUrl();
223
+ let response = await apiService().post("/OEM/SetFont", {
224
+ companyId: companyId,
225
+ domain: baseUri,
226
+ value: params.row.label
227
+ });
228
+ if (response != null && response.status == 200)
229
+ {
230
+ setSelectedFont(params.row.label);
231
+ notification("Font saved!");
232
+ }
233
+ }}
234
+ />
235
+ </Box>
236
+ }
237
+
238
+
239
+ </Grid>
240
+ <Grid item xs={6} sx={{marginTop:4}}>
241
+ <Box>Font Selected:</Box>
242
+ <Box sx={{marginBottom:2, fontWeight:"bold", fontSize:20}}> {selectedFont}</Box>
243
+ <hr />
244
+ <Box sx={{fontFamily: selectedFont}}>
245
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ut ultricies odio. Nunc ut quam turpis. In hac habitasse platea dictumst.
246
+ Suspendisse potenti. Nullam malesuada, purus id sagittis vestibulum, massa tellus gravida elit, vitae ultrices tortor nulla ac nunc.
247
+ Aenean tempus semper est vel convallis. Sed feugiat, risus eu tincidunt eleifend, purus metus vulputate nulla, et condimentum sapien erat in nisi.
248
+ Nunc non malesuada libero. Donec tempus tincidunt mi at vulputate. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;
249
+ Suspendisse potenti. Etiam nec eleifend orci. Suspendisse in est vel nunc rhoncus bibendum vitae id felis.
250
+ Integer bibendum dolor elit, at tincidunt lacus tempor ac. Maecenas lobortis, mauris at condimentum feugiat, nulla orci condimentum massa, sed facilisis tellus ligula vitae metus.
251
+ Aliquam erat volutpat. Quisque dignissim felis augue, at semper nisl posuere ut. Proin fringilla diam vitae faucibus finibus.
252
+ <br/><br/>
253
+ Aenean tempus semper est vel convallis. Sed feugiat, risus eu tincidunt eleifend, purus metus vulputate nulla, et condimentum sapien erat in nisi. Nunc non malesuada libero. Donec tempus tincidunt mi at vulputate. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse potenti
254
+ </Box>
255
+ </Grid>
222
256
  </Grid>
223
- <Grid item xs={6} sx={{marginTop:4}}>
224
- <Box>Font Selected:</Box>
225
- <Box sx={{marginBottom:2, fontWeight:"bold", fontSize:20}}> {selectedFont}</Box>
226
- <hr />
227
- <Box sx={{fontFamily: selectedFont}}>
228
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ut ultricies odio. Nunc ut quam turpis. In hac habitasse platea dictumst.
229
- Suspendisse potenti. Nullam malesuada, purus id sagittis vestibulum, massa tellus gravida elit, vitae ultrices tortor nulla ac nunc.
230
- Aenean tempus semper est vel convallis. Sed feugiat, risus eu tincidunt eleifend, purus metus vulputate nulla, et condimentum sapien erat in nisi.
231
- Nunc non malesuada libero. Donec tempus tincidunt mi at vulputate. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;
232
- Suspendisse potenti. Etiam nec eleifend orci. Suspendisse in est vel nunc rhoncus bibendum vitae id felis.
233
- Integer bibendum dolor elit, at tincidunt lacus tempor ac. Maecenas lobortis, mauris at condimentum feugiat, nulla orci condimentum massa, sed facilisis tellus ligula vitae metus.
234
- Aliquam erat volutpat. Quisque dignissim felis augue, at semper nisl posuere ut. Proin fringilla diam vitae faucibus finibus.
235
- <br/><br/>
236
- Aenean tempus semper est vel convallis. Sed feugiat, risus eu tincidunt eleifend, purus metus vulputate nulla, et condimentum sapien erat in nisi. Nunc non malesuada libero. Donec tempus tincidunt mi at vulputate. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse potenti
237
- </Box>
238
- </Grid>
239
- </Grid>
240
-
241
- </TabPanel>
242
- <TabPanel value={value} index={2}>
243
-
244
- <Grid container spacing={2}>
245
- <Grid item xs={6}>
246
- <h4 style={{marginBottom:"0px"}}>Global CSS edits</h4>
247
- <small>You can make edits to your stylesheet</small>
248
- </Grid>
249
- <Grid item xs={6} sx={{textAlign:"right"}}>
250
- <Button startIcon={<CheckIcon/>} sx={{marginTop:4}} variant="contained" onClick={async () => {
251
-
252
- var baseUri = GetBaseUrl();
253
- let response = await apiService().post("/OEM/SetGlobalCSS", {
254
- companyId: companyId,
255
- domain: baseUri,
256
- value: cssEditorRef.current.getValue()
257
- });
258
- if (response != null && response.status == 200)
259
- {
260
- notification("CSS Saved!")
261
- }
262
257
 
263
- }}>Save Changes</Button>
264
- </Grid>
265
- </Grid>
266
-
267
- <Box sx={{paddingTop:1}}>
268
-
269
- <Editor
270
- height="70vh"
271
- onMount={handleCSSEditorDidMount}
272
- defaultLanguage="css"
273
- theme="vs-dark"
274
- defaultValue={data.prettyCSS == null ? "" : data.prettyCSS}
275
- />
276
- </Box>
277
-
278
- </TabPanel>
279
- <TabPanel value={value} index={3}>
280
-
281
-
282
- <Grid container spacing={2}>
283
- <Grid item xs={6}>
284
- <h4 style={{marginBottom:"0px"}}>HTML import Edits</h4>
285
- <small>You can add imports such as google analytics or clarity</small>
286
- </Grid>
287
- <Grid item xs={6} sx={{textAlign:"right"}}>
288
- <Button startIcon={<CheckIcon/>} sx={{marginTop:4}} variant="contained" onClick={async () => {
258
+ </Box>
259
+ }
260
+
261
+ {value == 2 &&
262
+ <Box value={value} index={2}>
263
+
264
+ <Grid container spacing={2}>
265
+ <Grid item xs={6}>
266
+ <h4 style={{marginBottom:"0px"}}>Global CSS edits</h4>
267
+ <small>You can make edits to your stylesheet</small>
268
+ </Grid>
269
+ <Grid item xs={6} sx={{textAlign:"right"}}>
270
+ <Button startIcon={<CheckIcon/>} sx={{marginTop:4}} variant="contained" onClick={async () => {
289
271
 
290
272
  var baseUri = GetBaseUrl();
291
- let response = await apiService().post("/OEM/SetGlobalHTML", {
292
- companyId: companyId,
293
- domain: baseUri,
294
- value: htmlEditorRef.current.getValue()
273
+ let response = await apiService().post("/OEM/SetGlobalCSS", {
274
+ companyId: companyId,
275
+ domain: baseUri,
276
+ value: cssEditorRef.current.getValue()
295
277
  });
296
278
  if (response != null && response.status == 200)
297
279
  {
298
- notification("HTML saved!")
299
- }
300
-
301
- }}>Save Changes</Button>
302
- </Grid>
303
- </Grid>
304
-
305
- <Box sx={{paddingTop:1}}>
306
- <Editor
307
- height="70vh"
308
- onMount={handleHtmlEditorDidMount}
309
- defaultLanguage="html"
310
- theme="vs-dark"
311
- defaultValue={data.prettyHTML == null ? "" : data.prettyHTML}
312
- />
313
- </Box>
314
-
315
-
316
- </TabPanel>
280
+ notification("CSS Saved!")
281
+ }
282
+
283
+ }}>Save Changes</Button>
284
+ </Grid>
285
+ </Grid>
286
+
287
+ <Box sx={{paddingTop:1}}>
288
+
289
+ {data != null &&
290
+ <Editor
291
+ height="70vh"
292
+ onMount={handleCSSEditorDidMount}
293
+ defaultLanguage="css"
294
+ theme="vs-dark"
295
+ defaultValue={data.prettyCSS == null ? "" : data.prettyCSS}
296
+ />
297
+ }
298
+ {data.prettyCSS}
299
+ </Box>
300
+
301
+ </Box>
302
+ }
303
+
304
+ {value == 3 &&
305
+ <Box value={value} index={3}>
306
+
307
+
308
+ <Grid container spacing={2}>
309
+ <Grid item xs={6}>
310
+ <h4 style={{marginBottom:"0px"}}>HTML import Edits</h4>
311
+ <small>You can add imports such as google analytics or clarity</small>
312
+ </Grid>
313
+ <Grid item xs={6} sx={{textAlign:"right"}}>
314
+ <Button startIcon={<CheckIcon/>} sx={{marginTop:4}} variant="contained" onClick={async () => {
315
+
316
+ var baseUri = GetBaseUrl();
317
+ let response = await apiService().post("/OEM/SetGlobalHTML", {
318
+ companyId: companyId,
319
+ domain: baseUri,
320
+ value: htmlEditorRef.current.getValue()
321
+ });
322
+
323
+ if (response != null && response.status == 200)
324
+ {
325
+ notification("HTML saved!")
326
+ }
327
+
328
+ }}>Save Changes</Button>
329
+ </Grid>
330
+ </Grid>
331
+
332
+ <Box sx={{paddingTop:1}}>
333
+ <Editor
334
+ height="70vh"
335
+ onMount={handleHtmlEditorDidMount}
336
+ defaultLanguage="html"
337
+ theme="vs-dark"
338
+ defaultValue={data.prettyHTML == null ? "" : data.prettyHTML}
339
+ />
340
+ </Box>
341
+
342
+
343
+ </Box>
344
+ }
345
+ </Box>
346
+
317
347
  </Box>
348
+ </Box>
318
349
  </>
319
350
  )
320
351
  }
@@ -35,6 +35,27 @@ export const authService = () => {
35
35
  let base64encoded = authService().base64urlencode(hashed);
36
36
  return base64encoded;
37
37
  },
38
+ inviteUsers: async (inviteRequests) => {
39
+
40
+ let response = await apiService().post(
41
+ process.env.authorityUri + "/Invite/InviteUsers",
42
+ inviteRequests
43
+ );
44
+
45
+ return response;
46
+ },
47
+ inviteUser: async (inviteRequest) => {
48
+
49
+ let inviteRequests = [];
50
+ inviteRequests.push(inviteRequest);
51
+
52
+ let response = await apiService().post(
53
+ process.env.authorityUri + "/Invite/InviteUsers",
54
+ inviteRequests
55
+ );
56
+
57
+ return response;
58
+ },
38
59
  login: async (redirectUserUri = null, dnsRecord = null, deviceId = null) => {
39
60
 
40
61
  let state = "1234";