tenjin-ui-kit 0.2.22 → 0.2.24

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.
Files changed (61) hide show
  1. package/.dockerignore +6 -0
  2. package/.storybook/main.js +16 -0
  3. package/.storybook/preview.js +9 -0
  4. package/Dockerfile +17 -0
  5. package/Jenkinsfile +62 -0
  6. package/dist/README.md +13 -0
  7. package/{common → dist/common}/utils/security/index.js +0 -0
  8. package/{common → dist/common}/utils/security/securityConfig.js +0 -0
  9. package/{components → dist/components}/alert/Style.js +0 -0
  10. package/{components → dist/components}/alert/index.js +0 -0
  11. package/{components → dist/components}/authenticationProvider/AuthError.js +0 -0
  12. package/{components → dist/components}/authenticationProvider/AuthLoader.js +0 -0
  13. package/{components → dist/components}/authenticationProvider/index.js +7 -6
  14. package/{components → dist/components}/breadCrumbs/index.js +0 -0
  15. package/{components → dist/components}/breadCrumbs/style.js +0 -0
  16. package/{components → dist/components}/button/index.js +0 -0
  17. package/{components → dist/components}/checkBox/index.js +0 -0
  18. package/{components → dist/components}/divider/index.js +0 -0
  19. package/{components → dist/components}/editableField/index.js +0 -0
  20. package/{components → dist/components}/iconButton/index.js +0 -0
  21. package/{components → dist/components}/iconButton/style.js +0 -0
  22. package/{components → dist/components}/input/index.js +0 -0
  23. package/{components → dist/components}/modal/index.js +0 -0
  24. package/{components → dist/components}/modal/style.js +0 -0
  25. package/{components → dist/components}/pagination/index.js +0 -0
  26. package/{components → dist/components}/pagination/style.js +0 -0
  27. package/{components → dist/components}/richTextEditor/index.js +0 -0
  28. package/{components → dist/components}/richTextEditor/style.js +0 -0
  29. package/{components → dist/components}/select/index.js +0 -0
  30. package/{components → dist/components}/switch/index.js +0 -0
  31. package/{components → dist/components}/switch/style.js +0 -0
  32. package/{components → dist/components}/table/index.js +0 -0
  33. package/{components → dist/components}/timeStamp/index.js +0 -0
  34. package/{components → dist/components}/timeStamp/style.js +0 -0
  35. package/{components → dist/components}/topBar/index.js +0 -0
  36. package/{components → dist/components}/valuePicker/ValueSelector.js +0 -0
  37. package/{components → dist/components}/valuePicker/index.js +0 -0
  38. package/{components → dist/components}/wrapperLayout/layout/doc.stories.mdx +0 -0
  39. package/{components → dist/components}/wrapperLayout/layout/index.js +0 -0
  40. package/{components → dist/components}/wrapperLayout/layout/style.js +0 -0
  41. package/{components → dist/components}/wrapperLayout/main/index.js +0 -0
  42. package/{components → dist/components}/wrapperLayout/main/pageContainer/index.js +0 -0
  43. package/{components → dist/components}/wrapperLayout/main/sideBar/index.js +0 -0
  44. package/{components → dist/components}/wrapperLayout/main/sideBar/style.js +0 -0
  45. package/{components → dist/components}/wrapperLayout/topBar/avatar.js +0 -0
  46. package/{components → dist/components}/wrapperLayout/topBar/index.js +0 -0
  47. package/{components → dist/components}/wrapperLayout/topBar/menuIcon.js +0 -0
  48. package/{components → dist/components}/wrapperLayout/topBar/style.js +0 -0
  49. package/dist/http/index.js +163 -0
  50. package/{index.js → dist/index.js} +37 -0
  51. package/dist/package.json +100 -0
  52. package/{templates → dist/templates}/listPage/index.js +0 -0
  53. package/{themes → dist/themes}/default.js +0 -0
  54. package/package.json +1 -2
  55. package/public/favicon.ico +0 -0
  56. package/public/index.html +43 -0
  57. package/public/logo192.png +0 -0
  58. package/public/logo512.png +0 -0
  59. package/public/manifest.json +25 -0
  60. package/public/robots.txt +3 -0
  61. package/public/tenjinLogo.png +0 -0
package/.dockerignore ADDED
@@ -0,0 +1,6 @@
1
+ node_modules
2
+ build
3
+ .dockerignore
4
+ Dockerfile
5
+ Dockerfile.prod
6
+ storybook-static
@@ -0,0 +1,16 @@
1
+ module.exports = {
2
+ "stories": [
3
+ "../src/**/*.stories.mdx",
4
+ "../src/**/*.stories.@(js|jsx|ts|tsx)"
5
+ ],
6
+ "addons": [
7
+ "@storybook/addon-links",
8
+ "@storybook/addon-essentials",
9
+ "@storybook/addon-interactions",
10
+ "@storybook/preset-create-react-app"
11
+ ],
12
+ "framework": "@storybook/react",
13
+ "core": {
14
+ "builder": "@storybook/builder-webpack5"
15
+ }
16
+ }
@@ -0,0 +1,9 @@
1
+ export const parameters = {
2
+ actions: { argTypesRegex: "^on[A-Z].*" },
3
+ controls: {
4
+ matchers: {
5
+ color: /(background|color)$/i,
6
+ date: /Date$/,
7
+ },
8
+ },
9
+ }
package/Dockerfile ADDED
@@ -0,0 +1,17 @@
1
+ # build environment
2
+ FROM node:16-alpine as build
3
+ WORKDIR /app
4
+ ENV PATH /app/node_modules/.bin:$PATH
5
+ COPY package.json ./
6
+ COPY package-lock.json ./
7
+ COPY . ./
8
+ RUN npm install
9
+ RUN npm run build-storybook
10
+ RUN npm run compile
11
+ RUN npm version patch -m "CI patch version bump"
12
+ RUN cp ./package.json ./dist
13
+ RUN cp ./README.md ./dist
14
+ RUN cd dist
15
+ RUN npm publish
16
+ # TEST COMMIT 2
17
+
package/Jenkinsfile ADDED
@@ -0,0 +1,62 @@
1
+ pipeline {
2
+ agent {label 'ylib-dev'}
3
+
4
+
5
+ stages {
6
+ stage ("Build") {
7
+ steps {
8
+ dir("./") {
9
+ sh 'npm install'
10
+ sh 'npm run compile'
11
+ }
12
+ }
13
+ }
14
+
15
+ stage ("Version Update") {
16
+ steps {
17
+ dir("./") {
18
+ sh 'npm version patch -m "CI Version upgrade" '
19
+ sh 'git restore package-lock.json'
20
+ sh 'git remote set-url origin https://vybhavkadam:glpat-YdTosTAjEiosPFpqd-7j@gitlab.com/yethi/react/tenjin-ui-kit.git'
21
+ sh 'git push origin HEAD:main --tags'
22
+ //sh 'git push --tags'
23
+ }
24
+ }
25
+ }
26
+
27
+ stage ("Publish library") {
28
+ steps {
29
+ dir("./") {
30
+ sh 'cp ./package.json ./dist'
31
+ sh 'cp ./README.md ./dist'
32
+ }
33
+
34
+ dir("./dist") {
35
+ sh 'npm publish'
36
+ }
37
+ }
38
+ }
39
+
40
+ stage ("Build Storybook") {
41
+ steps {
42
+ dir("./") {
43
+ sh 'npm run build-storybook'
44
+ }
45
+ }
46
+ }
47
+
48
+ stage ("Deploy Storybook") {
49
+ steps {
50
+ dir("./") {
51
+ sh 'npx netlify deploy --auth xZ5gRrdcq6pPShzAcOtxCqD3e5MzwWxwBevsrQdyIl0 --site 9a55e91f-3c3e-4492-8d50-7f17ca87adeb --dir storybook-static --prod'
52
+ }
53
+ }
54
+ }
55
+ stage('CleanWorkspace') {
56
+ steps {
57
+ cleanWs()
58
+ }
59
+ }
60
+ }
61
+
62
+ }
package/dist/README.md ADDED
@@ -0,0 +1,13 @@
1
+ # Tenjin UI Kit
2
+
3
+ The Tenjin UI kit ships a set of pre-built components that can be used while building user interfaces for Tenjin.
4
+
5
+ ## Installation
6
+
7
+ In the project directory, you can run:
8
+
9
+ npm install tenjin-ui-kit
10
+
11
+ ## Usage
12
+
13
+ The [Tenjin UI Kit](https://tenjin-ui-kit.netlify.app) storybook gives clear documentation on how to use the Tenjin UI Kit.
File without changes
File without changes
File without changes
@@ -57,7 +57,7 @@ var AuthenticationProvider = function AuthenticationProvider(_ref) {
57
57
  token = resolveToken();
58
58
  console.log("Resolved Token: ", token);
59
59
  if (!token) {
60
- _context.next = 19;
60
+ _context.next = 20;
61
61
  break;
62
62
  }
63
63
  _context.prev = 3;
@@ -73,20 +73,21 @@ var AuthenticationProvider = function AuthenticationProvider(_ref) {
73
73
  console.log("Profile validation successful");
74
74
  setLoggedInUser(profileValidationResponse.data);
75
75
  setAuthLoading(false);
76
- _context.next = 17;
76
+ _context.next = 18;
77
77
  break;
78
78
  case 13:
79
79
  _context.prev = 13;
80
80
  _context.t0 = _context["catch"](3);
81
81
  console.error("Profile validation error");
82
+ console.error("Error: ", _context.t0);
82
83
  setLoggedInUser(null);
83
84
  // redirectToLogin();
84
- case 17:
85
- _context.next = 20;
85
+ case 18:
86
+ _context.next = 21;
86
87
  break;
87
- case 19:
88
- redirectToLogin();
89
88
  case 20:
89
+ redirectToLogin();
90
+ case 21:
90
91
  case "end":
91
92
  return _context.stop();
92
93
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,163 @@
1
+ "use strict";
2
+
3
+ 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); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.put = exports.post = exports.parseAxiosError = exports.getSecureClient = exports.getClient = exports.get = exports.doDelete = void 0;
8
+ var _axios = _interopRequireDefault(require("axios"));
9
+ var _authenticationProvider = _interopRequireDefault(require("../components/authenticationProvider"));
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
12
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
13
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
14
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
15
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
16
+ 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; }
17
+ 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); } }
18
+ 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); }); }; }
19
+ var getApiAccessToken = _authenticationProvider.default.getApiAccessToken;
20
+ var getClient = function getClient() {
21
+ return _axios.default.create({
22
+ headers: {
23
+ "Content-Type": "application/json"
24
+ }
25
+ });
26
+ };
27
+ exports.getClient = getClient;
28
+ var getSecureClient = function getSecureClient() {
29
+ return _axios.default.create({
30
+ headers: {
31
+ "Content-Type": "application/json",
32
+ Authorization: "Bearer ".concat(getApiAccessToken())
33
+ }
34
+ });
35
+ };
36
+ exports.getSecureClient = getSecureClient;
37
+ var get = /*#__PURE__*/function () {
38
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(url) {
39
+ var response;
40
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
41
+ while (1) switch (_context.prev = _context.next) {
42
+ case 0:
43
+ _context.prev = 0;
44
+ _context.next = 3;
45
+ return getSecureClient().get(url);
46
+ case 3:
47
+ response = _context.sent;
48
+ return _context.abrupt("return", response.data);
49
+ case 7:
50
+ _context.prev = 7;
51
+ _context.t0 = _context["catch"](0);
52
+ console.warn("Get ".concat(url, " failed"));
53
+ return _context.abrupt("return", false);
54
+ case 11:
55
+ case "end":
56
+ return _context.stop();
57
+ }
58
+ }, _callee, null, [[0, 7]]);
59
+ }));
60
+ return function get(_x) {
61
+ return _ref.apply(this, arguments);
62
+ };
63
+ }();
64
+ exports.get = get;
65
+ var post = /*#__PURE__*/function () {
66
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(url, data) {
67
+ var response;
68
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
69
+ while (1) switch (_context2.prev = _context2.next) {
70
+ case 0:
71
+ _context2.prev = 0;
72
+ _context2.next = 3;
73
+ return getSecureClient().post(url, data);
74
+ case 3:
75
+ response = _context2.sent;
76
+ return _context2.abrupt("return", response.data);
77
+ case 7:
78
+ _context2.prev = 7;
79
+ _context2.t0 = _context2["catch"](0);
80
+ console.warn("Post ".concat(url, " failed"));
81
+ return _context2.abrupt("return", false);
82
+ case 11:
83
+ case "end":
84
+ return _context2.stop();
85
+ }
86
+ }, _callee2, null, [[0, 7]]);
87
+ }));
88
+ return function post(_x2, _x3) {
89
+ return _ref2.apply(this, arguments);
90
+ };
91
+ }();
92
+ exports.post = post;
93
+ var put = /*#__PURE__*/function () {
94
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(url, data) {
95
+ var response;
96
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
97
+ while (1) switch (_context3.prev = _context3.next) {
98
+ case 0:
99
+ _context3.prev = 0;
100
+ _context3.next = 3;
101
+ return getSecureClient().put(url, data);
102
+ case 3:
103
+ response = _context3.sent;
104
+ return _context3.abrupt("return", response.data);
105
+ case 7:
106
+ _context3.prev = 7;
107
+ _context3.t0 = _context3["catch"](0);
108
+ console.warn("Put ".concat(url, " failed"));
109
+ return _context3.abrupt("return", false);
110
+ case 11:
111
+ case "end":
112
+ return _context3.stop();
113
+ }
114
+ }, _callee3, null, [[0, 7]]);
115
+ }));
116
+ return function put(_x4, _x5) {
117
+ return _ref3.apply(this, arguments);
118
+ };
119
+ }();
120
+ exports.put = put;
121
+ var doDelete = /*#__PURE__*/function () {
122
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(url) {
123
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
124
+ while (1) switch (_context4.prev = _context4.next) {
125
+ case 0:
126
+ _context4.prev = 0;
127
+ _context4.next = 3;
128
+ return getSecureClient().delete(url);
129
+ case 3:
130
+ _context4.next = 9;
131
+ break;
132
+ case 5:
133
+ _context4.prev = 5;
134
+ _context4.t0 = _context4["catch"](0);
135
+ console.warn("Delete ".concat(url, " failed"));
136
+ return _context4.abrupt("return", false);
137
+ case 9:
138
+ case "end":
139
+ return _context4.stop();
140
+ }
141
+ }, _callee4, null, [[0, 5]]);
142
+ }));
143
+ return function doDelete(_x6) {
144
+ return _ref4.apply(this, arguments);
145
+ };
146
+ }();
147
+ exports.doDelete = doDelete;
148
+ var parseAxiosError = function parseAxiosError(error) {
149
+ var parsedError = {
150
+ status: 500,
151
+ statusText: "Internal Server Error",
152
+ message: "An unexpected error occurred while processing your request. Please try again. If problem persists, please contact Tenjin support"
153
+ };
154
+ if (error && error.response) {
155
+ parsedError = _objectSpread(_objectSpread({}, parsedError), {}, {
156
+ status: error.response.status,
157
+ statusText: error.response.statusText,
158
+ message: error.response.status === 503 ? "A network error occurred. Please try again" : error.response.status === 401 ? "Authentication Failed" : error.response.data ? error.response.data.message ? error.response.data.message : "An unexpected error occurred while processing your request. Please try again. If problem persists, please contact Tenjin support" : "An unexpected error occurred while processing your request. Please try again. If problem persists, please contact Tenjin support"
159
+ });
160
+ }
161
+ return parsedError;
162
+ };
163
+ exports.parseAxiosError = parseAxiosError;
@@ -52,6 +52,42 @@ Object.defineProperty(exports, "defaultTheme", {
52
52
  return _default.default;
53
53
  }
54
54
  });
55
+ Object.defineProperty(exports, "doDelete", {
56
+ enumerable: true,
57
+ get: function get() {
58
+ return _http.doDelete;
59
+ }
60
+ });
61
+ Object.defineProperty(exports, "get", {
62
+ enumerable: true,
63
+ get: function get() {
64
+ return _http.get;
65
+ }
66
+ });
67
+ Object.defineProperty(exports, "getClient", {
68
+ enumerable: true,
69
+ get: function get() {
70
+ return _http.getClient;
71
+ }
72
+ });
73
+ Object.defineProperty(exports, "getSecureClient", {
74
+ enumerable: true,
75
+ get: function get() {
76
+ return _http.getSecureClient;
77
+ }
78
+ });
79
+ Object.defineProperty(exports, "post", {
80
+ enumerable: true,
81
+ get: function get() {
82
+ return _http.post;
83
+ }
84
+ });
85
+ Object.defineProperty(exports, "put", {
86
+ enumerable: true,
87
+ get: function get() {
88
+ return _http.put;
89
+ }
90
+ });
55
91
  var _button = _interopRequireDefault(require("./components/button"));
56
92
  var _input = _interopRequireDefault(require("./components/input"));
57
93
  var _table = _interopRequireDefault(require("./components/table"));
@@ -59,6 +95,7 @@ var _valuePicker = _interopRequireDefault(require("./components/valuePicker"));
59
95
  var _layout = _interopRequireDefault(require("./components/wrapperLayout/layout"));
60
96
  var _default = _interopRequireDefault(require("./themes/default"));
61
97
  var _authenticationProvider = _interopRequireWildcard(require("./components/authenticationProvider"));
98
+ var _http = require("./http");
62
99
  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); }
63
100
  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; }
64
101
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -0,0 +1,100 @@
1
+ {
2
+ "name": "tenjin-ui-kit",
3
+ "version": "0.2.24",
4
+ "repository": {
5
+ "url": "https://gitlab.com/yethi/react/tenjin-ui-kit.git"
6
+ },
7
+ "dependencies": {
8
+ "@mantine/core": "^5.10.1",
9
+ "@mantine/hooks": "^5.10.1",
10
+ "@mantine/rte": "^5.10.1",
11
+ "@mui/icons-material": "^5.11.0",
12
+ "@mui/lab": "^5.0.0-alpha.116",
13
+ "@mui/styles": "^5.11.2",
14
+ "@testing-library/jest-dom": "^5.16.5",
15
+ "@testing-library/react": "^13.4.0",
16
+ "@testing-library/user-event": "^13.5.0",
17
+ "axios": "^1.2.2",
18
+ "clsx": "^1.2.1",
19
+ "moment": "^2.29.4",
20
+ "react-icons": "^4.7.1",
21
+ "react-moment": "^1.1.3",
22
+ "react-scripts": "5.0.1",
23
+ "web-vitals": "^2.1.4"
24
+ },
25
+ "scripts": {
26
+ "start": "react-scripts start",
27
+ "build": "react-scripts build",
28
+ "test": "react-scripts test",
29
+ "eject": "react-scripts eject",
30
+ "storybook": "start-storybook -p 6006 -s public",
31
+ "build-storybook": "build-storybook -s public",
32
+ "clean": "rimraf dist",
33
+ "compile": "npm run clean && cross-env NODE_ENV=production babel src/package --out-dir dist --copy-files --ignore __tests__,spec.js,test.js,stories.js,__snapshots__"
34
+ },
35
+ "eslintConfig": {
36
+ "extends": [
37
+ "react-app",
38
+ "react-app/jest"
39
+ ],
40
+ "overrides": [
41
+ {
42
+ "files": [
43
+ "**/*.stories.*"
44
+ ],
45
+ "rules": {
46
+ "import/no-anonymous-default-export": "off"
47
+ }
48
+ }
49
+ ]
50
+ },
51
+ "browserslist": {
52
+ "production": [
53
+ ">0.2%",
54
+ "not dead",
55
+ "not op_mini all"
56
+ ],
57
+ "development": [
58
+ "last 1 chrome version",
59
+ "last 1 firefox version",
60
+ "last 1 safari version"
61
+ ]
62
+ },
63
+ "devDependencies": {
64
+ "@babel/cli": "^7.20.7",
65
+ "@babel/preset-env": "^7.20.2",
66
+ "@babel/preset-react": "^7.18.6",
67
+ "@emotion/react": "^11.10.5",
68
+ "@emotion/styled": "^11.10.5",
69
+ "@mui/material": "^5.11.3",
70
+ "@storybook/addon-actions": "^6.5.15",
71
+ "@storybook/addon-essentials": "^6.5.15",
72
+ "@storybook/addon-interactions": "^6.5.15",
73
+ "@storybook/addon-links": "^6.5.15",
74
+ "@storybook/builder-webpack5": "^6.5.15",
75
+ "@storybook/manager-webpack5": "^6.5.15",
76
+ "@storybook/node-logger": "^6.5.15",
77
+ "@storybook/preset-create-react-app": "^4.1.2",
78
+ "@storybook/react": "^6.5.15",
79
+ "@storybook/testing-library": "^0.0.13",
80
+ "babel-plugin-named-exports-order": "^0.0.2",
81
+ "cross-env": "^7.0.3",
82
+ "prop-types": "^15.8.1",
83
+ "react": "^18.2.0",
84
+ "react-dom": "^18.2.0",
85
+ "react-router-dom": "^6.6.1",
86
+ "rimraf": "^3.0.2",
87
+ "webpack": "^5.75.0"
88
+ },
89
+ "peerDependencies": {
90
+ "@emotion/react": "^11.10.5",
91
+ "@emotion/styled": "^11.10.5",
92
+ "@mui/material": "^5.11.3",
93
+ "@testing-library/jest-dom": "^5.16.5",
94
+ "@testing-library/react": "^13.4.0",
95
+ "@testing-library/user-event": "^13.5.0",
96
+ "react": "^18.2.0",
97
+ "react-dom": "^18.2.0",
98
+ "react-router-dom": "^6.6.1"
99
+ }
100
+ }
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tenjin-ui-kit",
3
- "version": "0.2.22",
3
+ "version": "0.2.24",
4
4
  "repository": {
5
5
  "url": "https://gitlab.com/yethi/react/tenjin-ui-kit.git"
6
6
  },
@@ -93,7 +93,6 @@
93
93
  "@testing-library/jest-dom": "^5.16.5",
94
94
  "@testing-library/react": "^13.4.0",
95
95
  "@testing-library/user-event": "^13.5.0",
96
- "axios": "^1.2.2",
97
96
  "react": "^18.2.0",
98
97
  "react-dom": "^18.2.0",
99
98
  "react-router-dom": "^6.6.1"
Binary file
@@ -0,0 +1,43 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
7
+ <meta name="theme-color" content="#000000" />
8
+ <meta
9
+ name="description"
10
+ content="Web site created using create-react-app"
11
+ />
12
+ <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13
+ <!--
14
+ manifest.json provides metadata used when your web app is installed on a
15
+ user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
16
+ -->
17
+ <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
18
+ <!--
19
+ Notice the use of %PUBLIC_URL% in the tags above.
20
+ It will be replaced with the URL of the `public` folder during the build.
21
+ Only files inside the `public` folder can be referenced from the HTML.
22
+
23
+ Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
24
+ work correctly both with client-side routing and a non-root public URL.
25
+ Learn how to configure a non-root public URL by running `npm run build`.
26
+ -->
27
+ <title>React App</title>
28
+ </head>
29
+ <body>
30
+ <noscript>You need to enable JavaScript to run this app.</noscript>
31
+ <div id="root"></div>
32
+ <!--
33
+ This HTML file is a template.
34
+ If you open it directly in the browser, you will see an empty page.
35
+
36
+ You can add webfonts, meta tags, or analytics to this file.
37
+ The build step will place the bundled scripts into the <body> tag.
38
+
39
+ To begin the development, run `npm start` or `yarn start`.
40
+ To create a production bundle, use `npm run build` or `yarn build`.
41
+ -->
42
+ </body>
43
+ </html>
Binary file
Binary file
@@ -0,0 +1,25 @@
1
+ {
2
+ "short_name": "React App",
3
+ "name": "Create React App Sample",
4
+ "icons": [
5
+ {
6
+ "src": "favicon.ico",
7
+ "sizes": "64x64 32x32 24x24 16x16",
8
+ "type": "image/x-icon"
9
+ },
10
+ {
11
+ "src": "logo192.png",
12
+ "type": "image/png",
13
+ "sizes": "192x192"
14
+ },
15
+ {
16
+ "src": "logo512.png",
17
+ "type": "image/png",
18
+ "sizes": "512x512"
19
+ }
20
+ ],
21
+ "start_url": ".",
22
+ "display": "standalone",
23
+ "theme_color": "#000000",
24
+ "background_color": "#ffffff"
25
+ }
@@ -0,0 +1,3 @@
1
+ # https://www.robotstxt.org/robotstxt.html
2
+ User-agent: *
3
+ Disallow:
Binary file