x25 3.0.0 → 17.0.0

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 (274) hide show
  1. package/Account/Load.js +75 -0
  2. package/Account/actions.js +15 -0
  3. package/Account/index.js +20 -0
  4. package/Account/reducer.js +122 -0
  5. package/Account/request.js +44 -0
  6. package/Async/InitModule.js +190 -0
  7. package/Async/RouteLoading.js +64 -0
  8. package/Async/SimulatedException.js +44 -0
  9. package/Async/index.js +95 -0
  10. package/Async/types.js +1 -0
  11. package/Company/Load.js +82 -0
  12. package/Company/actions.js +15 -0
  13. package/Company/index.js +20 -0
  14. package/Company/reducer.js +165 -0
  15. package/Company/request.js +36 -0
  16. package/Company/util.js +10 -0
  17. package/Header/AccountOptionsContainer.js +144 -0
  18. package/Header/AdminSelectCompany.js +109 -0
  19. package/Header/ClientSelectCompany.js +104 -0
  20. package/Header/Header.js +127 -0
  21. package/Header/HeaderContainer.js +39 -0
  22. package/Header/Logo.js +30 -0
  23. package/Header/LogoutButton.js +39 -0
  24. package/Header/index.js +19 -0
  25. package/Header/request.js +26 -0
  26. package/Header/types.js +1 -0
  27. package/Header/util.js +58 -0
  28. package/Inputs/Business/BankAccount.js +48 -0
  29. package/Inputs/Business/BankName.js +49 -0
  30. package/Inputs/Business/CifField.js +112 -0
  31. package/Inputs/Business/CifFieldContainer.js +157 -0
  32. package/Inputs/Business/Email.js +37 -0
  33. package/Inputs/Business/NidField.js +91 -0
  34. package/Inputs/Business/Phone.js +37 -0
  35. package/Inputs/Business/index.js +34 -0
  36. package/Inputs/Business/request.js +39 -0
  37. package/Inputs/CaptchaBox.js +151 -0
  38. package/Inputs/DateInput.js +172 -0
  39. package/Inputs/DateTemplate.js +200 -0
  40. package/Inputs/DelayInputChange.js +135 -0
  41. package/Inputs/FocusTemplate.js +47 -0
  42. package/Inputs/InputTemplate.js +78 -0
  43. package/Inputs/LabelTemplate.js +59 -0
  44. package/Inputs/NumericInput.js +139 -0
  45. package/Inputs/NumericTemplate.js +148 -0
  46. package/Inputs/Selects/County.js +29 -0
  47. package/Inputs/Selects/Custom.js +56 -0
  48. package/Inputs/Selects/Simple.js +75 -0
  49. package/Inputs/Selects/index.js +52 -0
  50. package/Inputs/SimpleInput.js +42 -0
  51. package/Inputs/SimpleTextarea.js +47 -0
  52. package/Inputs/TextareaTemplate.js +55 -0
  53. package/Inputs/Tooltip.js +82 -0
  54. package/Inputs/index.js +185 -0
  55. package/Messages/Error.js +106 -0
  56. package/Messages/Loading.js +68 -0
  57. package/Messages/index.js +29 -0
  58. package/Modal/Delete.js +240 -0
  59. package/Modal/Root.js +81 -0
  60. package/Modal/SimpleModal.js +57 -0
  61. package/Modal/actions.js +10 -0
  62. package/Modal/getComponent.js +42 -0
  63. package/Modal/index.js +22 -0
  64. package/Modal/reducer.js +53 -0
  65. package/Modal/types.js +7 -0
  66. package/Modal/util.js +17 -0
  67. package/Payment/EstimatePrice/Description.js +92 -0
  68. package/Payment/EstimatePrice/PayBox.js +220 -0
  69. package/Payment/EstimatePrice/index.js +92 -0
  70. package/Payment/EstimatePrice/util.js +21 -0
  71. package/Payment/MobilpayForm.js +86 -0
  72. package/Payment/Modal/BankTransfer.js +233 -0
  73. package/Payment/Modal/CompanyValability.js +28 -0
  74. package/Payment/Modal/DoneForm.js +222 -0
  75. package/Payment/Modal/PaymentDone.js +53 -0
  76. package/Payment/Modal/index.js +27 -0
  77. package/Payment/actions.js +23 -0
  78. package/{src/Payment → Payment}/codes.js +19 -16
  79. package/Payment/index.js +141 -0
  80. package/Payment/request.js +49 -0
  81. package/Payment/types.js +1 -0
  82. package/Payment/util.js +50 -0
  83. package/Payment/validate.js +23 -0
  84. package/Sidebar.js +156 -0
  85. package/Things.js +53 -0
  86. package/actions.js +73 -0
  87. package/config.js +10 -0
  88. package/dev/ErrorBoundary.js +109 -0
  89. package/dev/TheError.js +113 -0
  90. package/dev/index.js +132 -0
  91. package/dev/types.js +1 -0
  92. package/package.json +13 -13
  93. package/prod/SentryErrorBoundary.js +150 -0
  94. package/reducer/captchas.js +51 -0
  95. package/reducer/counties.js +57 -0
  96. package/reducer/index.js +38 -0
  97. package/reducer/module.js +48 -0
  98. package/style/index.css +1 -0
  99. package/style/sidebar.css +1 -0
  100. package/types.js +1 -0
  101. package/utility/calendar.js +45 -0
  102. package/utility/date.js +111 -0
  103. package/utility/index.js +125 -0
  104. package/utility/language.js +20 -0
  105. package/utility/mql.js +6 -0
  106. package/utility/normalize-test.js +54 -0
  107. package/utility/normalize.js +108 -0
  108. package/utility/numbers.js +93 -0
  109. package/utility/numeric.js +103 -0
  110. package/utility/others.js +142 -0
  111. package/utility/strings-test.js +216 -0
  112. package/utility/strings.js +85 -0
  113. package/utility/validation/common.js +278 -0
  114. package/utility/validation/index.js +110 -0
  115. package/utility/validation/specific.js +14 -0
  116. package/utility/validation/validate/bank-test.js +41 -0
  117. package/utility/validation/validate/bank.js +176 -0
  118. package/utility/validation/validate/cif-test.js +37 -0
  119. package/utility/validation/validate/cif.js +44 -0
  120. package/utility/validation/validate/cnp-test.js +68 -0
  121. package/utility/validation/validate/cnp.js +193 -0
  122. package/{src/utility → utility}/validation/validate/date.js +61 -73
  123. package/utility/validation/validate/email-test.js +30 -0
  124. package/utility/validation/validate/email.js +11 -0
  125. package/utility/validation/validate/index.js +65 -0
  126. package/.eslintignore +0 -2
  127. package/.eslintrc.json +0 -275
  128. package/.flowconfig +0 -23
  129. package/conf/dev.js +0 -19
  130. package/conf/dist.js +0 -19
  131. package/conf/polyfills/tempPolyfills.js +0 -7
  132. package/src/Account/Load.jsx +0 -79
  133. package/src/Account/actions.js +0 -10
  134. package/src/Account/index.js +0 -11
  135. package/src/Account/reducer.js +0 -139
  136. package/src/Account/request.js +0 -36
  137. package/src/Async/InitModule.jsx +0 -114
  138. package/src/Async/RouteLoading.jsx +0 -52
  139. package/src/Async/SimulatedException.jsx +0 -19
  140. package/src/Async/index.jsx +0 -75
  141. package/src/Async/types.js +0 -39
  142. package/src/Company/Load.jsx +0 -84
  143. package/src/Company/actions.js +0 -10
  144. package/src/Company/index.js +0 -11
  145. package/src/Company/reducer.js +0 -201
  146. package/src/Company/request.js +0 -30
  147. package/src/Company/util.js +0 -7
  148. package/src/Header/AccountOptionsContainer.jsx +0 -124
  149. package/src/Header/AdminSelectCompany.jsx +0 -101
  150. package/src/Header/ClientSelectCompany.jsx +0 -90
  151. package/src/Header/Header.jsx +0 -120
  152. package/src/Header/HeaderContainer.jsx +0 -30
  153. package/src/Header/Logo.jsx +0 -16
  154. package/src/Header/LogoutButton.jsx +0 -34
  155. package/src/Header/index.jsx +0 -9
  156. package/src/Header/request.js +0 -28
  157. package/src/Header/types.js +0 -6
  158. package/src/Header/util.jsx +0 -61
  159. package/src/Inputs/Business/BankAccount.jsx +0 -39
  160. package/src/Inputs/Business/BankName.jsx +0 -40
  161. package/src/Inputs/Business/CifField.jsx +0 -93
  162. package/src/Inputs/Business/CifFieldContainer.jsx +0 -142
  163. package/src/Inputs/Business/Email.jsx +0 -23
  164. package/src/Inputs/Business/NidField.jsx +0 -77
  165. package/src/Inputs/Business/Phone.jsx +0 -23
  166. package/src/Inputs/Business/index.js +0 -16
  167. package/src/Inputs/Business/request.js +0 -39
  168. package/src/Inputs/CaptchaBox.jsx +0 -131
  169. package/src/Inputs/DateInput.jsx +0 -188
  170. package/src/Inputs/DateTemplate.jsx +0 -213
  171. package/src/Inputs/DelayInputChange.jsx +0 -130
  172. package/src/Inputs/FocusTemplate.jsx +0 -41
  173. package/src/Inputs/InputTemplate.jsx +0 -79
  174. package/src/Inputs/LabelTemplate.jsx +0 -47
  175. package/src/Inputs/NumericInput.jsx +0 -142
  176. package/src/Inputs/NumericTemplate.jsx +0 -155
  177. package/src/Inputs/Selects/County.jsx +0 -19
  178. package/src/Inputs/Selects/Custom.jsx +0 -55
  179. package/src/Inputs/Selects/Simple.jsx +0 -73
  180. package/src/Inputs/Selects/index.jsx +0 -37
  181. package/src/Inputs/SimpleInput.jsx +0 -40
  182. package/src/Inputs/SimpleTextarea.jsx +0 -55
  183. package/src/Inputs/TextareaTemplate.jsx +0 -57
  184. package/src/Inputs/Tooltip.jsx +0 -61
  185. package/src/Inputs/index.js +0 -22
  186. package/src/Messages/Error.jsx +0 -83
  187. package/src/Messages/Loading.jsx +0 -43
  188. package/src/Messages/index.jsx +0 -4
  189. package/src/Modal/Delete.jsx +0 -237
  190. package/src/Modal/Root.jsx +0 -57
  191. package/src/Modal/SimpleModal.jsx +0 -47
  192. package/src/Modal/actions.js +0 -7
  193. package/src/Modal/getComponent.jsx +0 -32
  194. package/src/Modal/index.jsx +0 -12
  195. package/src/Modal/reducer.js +0 -40
  196. package/src/Modal/types.js +0 -6
  197. package/src/Modal/util.js +0 -15
  198. package/src/Payment/EstimatePrice/Description.jsx +0 -101
  199. package/src/Payment/EstimatePrice/PayBox.jsx +0 -173
  200. package/src/Payment/EstimatePrice/index.jsx +0 -63
  201. package/src/Payment/EstimatePrice/util.js +0 -15
  202. package/src/Payment/MobilpayForm.jsx +0 -77
  203. package/src/Payment/Modal/BankTransfer.jsx +0 -129
  204. package/src/Payment/Modal/CompanyValability.jsx +0 -14
  205. package/src/Payment/Modal/DoneForm.jsx +0 -209
  206. package/src/Payment/Modal/PaymentDone.jsx +0 -27
  207. package/src/Payment/Modal/index.js +0 -13
  208. package/src/Payment/actions.jsx +0 -22
  209. package/src/Payment/index.jsx +0 -124
  210. package/src/Payment/request.js +0 -50
  211. package/src/Payment/types.js +0 -14
  212. package/src/Payment/util.jsx +0 -52
  213. package/src/Payment/validate.js +0 -25
  214. package/src/Sidebar.jsx +0 -158
  215. package/src/Things.jsx +0 -35
  216. package/src/actions.js +0 -36
  217. package/src/config.js +0 -7
  218. package/src/dev/ErrorBoundary.jsx +0 -98
  219. package/src/dev/TheError.jsx +0 -87
  220. package/src/dev/index.js +0 -127
  221. package/src/dev/types.js +0 -10
  222. package/src/prod/SentryErrorBoundary.jsx +0 -98
  223. package/src/reducer/captchas.js +0 -44
  224. package/src/reducer/counties.js +0 -46
  225. package/src/reducer/index.js +0 -25
  226. package/src/reducer/module.jsx +0 -43
  227. package/src/style/.sass-lint.yml +0 -84
  228. package/src/style/.stylelintrc.json +0 -161
  229. package/src/style/_fancy-text.scss +0 -37
  230. package/src/style/_fix_bootstrap_placeholder_color.scss +0 -14
  231. package/src/style/_header-company.scss +0 -69
  232. package/src/style/_inputs.scss +0 -12
  233. package/src/style/_minimal.scss +0 -31
  234. package/src/style/_navigation.scss +0 -24
  235. package/src/style/_others.scss +0 -79
  236. package/src/style/index.scss +0 -7
  237. package/src/style/sidebar/_animations.scss +0 -21
  238. package/src/style/sidebar/_dark-theme.scss +0 -77
  239. package/src/style/sidebar/_scroll.scss +0 -37
  240. package/src/style/sidebar/_structure.scss +0 -299
  241. package/src/style/sidebar.scss +0 -4
  242. package/src/types.js +0 -31
  243. package/src/utility/calendar.js +0 -39
  244. package/src/utility/date.js +0 -100
  245. package/src/utility/index.js +0 -12
  246. package/src/utility/language.js +0 -17
  247. package/src/utility/mql.js +0 -3
  248. package/src/utility/normalize-test.js +0 -58
  249. package/src/utility/normalize.js +0 -119
  250. package/src/utility/numbers.js +0 -87
  251. package/src/utility/numeric.js +0 -114
  252. package/src/utility/others.jsx +0 -160
  253. package/src/utility/strings-test.js +0 -136
  254. package/src/utility/strings.js +0 -80
  255. package/src/utility/validation/common.js +0 -360
  256. package/src/utility/validation/index.js +0 -70
  257. package/src/utility/validation/specific.js +0 -9
  258. package/src/utility/validation/validate/bank-test.js +0 -129
  259. package/src/utility/validation/validate/bank.js +0 -176
  260. package/src/utility/validation/validate/cif-test.js +0 -105
  261. package/src/utility/validation/validate/cif.js +0 -44
  262. package/src/utility/validation/validate/cnp-test.js +0 -216
  263. package/src/utility/validation/validate/cnp.js +0 -261
  264. package/src/utility/validation/validate/email-test.js +0 -36
  265. package/src/utility/validation/validate/email.js +0 -6
  266. package/src/utility/validation/validate/index.js +0 -7
  267. package/webpack.config.js +0 -90
  268. package/x25.wiki/Account.md +0 -41
  269. package/x25.wiki/Company.md +0 -39
  270. package/x25.wiki/Header.md +0 -21
  271. package/x25.wiki/Home.md +0 -1
  272. package/x25.wiki/Inputs.md +0 -33
  273. package/x25.wiki/Messages.md +0 -27
  274. package/x25.wiki/Payment.md +0 -42
@@ -1,73 +1,61 @@
1
- // @flow
2
- /* eslint-disable no-magic-numbers */
3
-
4
- const
5
- pattern = /^\d{1,2}\.\d{2}\.\d{4}$/u,
6
- monthLength = [
7
- 31,
8
- 28,
9
- 31,
10
- 30,
11
- 31,
12
- 30,
13
- 31,
14
- 31,
15
- 30,
16
- 31,
17
- 30,
18
- 31,
19
- ];
20
-
21
- // 2018-03-31T00:00:00.000Z
22
- // 2015-02-25T00:00:00Z
23
- export const isValidDateStamp = (raw: any) => {
24
-
25
- if (typeof raw !== "string" || raw.length < 20 || raw.length > 24) {
26
- return false;
27
- }
28
-
29
- const value = new Date(raw);
30
-
31
- if (Object.prototype.toString.call(value) === "[object Date]") {
32
- if (isNaN(value.getTime())) {
33
- return false;
34
- }
35
-
36
- return true;
37
- }
38
- return false;
39
- };
40
-
41
- // e.g. 25.08.2015
42
- export const isValidDate = (dateString : string) : boolean => {
43
-
44
- if (typeof dateString !== "string" || dateString.length !== 10) {
45
- return false;
46
- }
47
-
48
- if (!pattern.test(dateString)) {
49
- return false;
50
- }
51
-
52
- // Parse the date parts to integers
53
- const parts = dateString.split("."),
54
- day = parseInt(parts[0],
55
- 10),
56
- month = parseInt(parts[1],
57
- 10),
58
- year = parseInt(parts[2],
59
- 10);
60
-
61
- // Check the ranges of month and year
62
- if (year < 1000 || year > 3000 || month === 0 || month > 12) {
63
- return false;
64
- }
65
-
66
- // Adjust for leap years
67
- if ((year % 400 === 0) || (year % 100 !== 0) || (year % 4 !== 0)) {
68
- monthLength[1] = 29;
69
- }
70
-
71
- // Check the range of the day
72
- return day > 0 && day <= monthLength[month - 1];
73
- };
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ /* eslint-disable no-magic-numbers */
8
+
9
+ var pattern = /^[0-9]{1,2}\.[0-9]{2}\.[0-9]{4}$/,
10
+ monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
11
+
12
+ // 2018-03-31T00:00:00.000Z
13
+ // 2015-02-25T00:00:00Z
14
+ var isValidDateStamp = exports.isValidDateStamp = function isValidDateStamp(raw) {
15
+
16
+ if (typeof raw !== "string" || raw.length < 20 || raw.length > 24) {
17
+ return false;
18
+ }
19
+
20
+ var value = new Date(raw);
21
+
22
+ if (Object.prototype.toString.call(value) === "[object Date]") {
23
+ if (isNaN(value.getTime())) {
24
+ return false;
25
+ }
26
+
27
+ return true;
28
+ }
29
+ return false;
30
+ };
31
+
32
+ // e.g. 25.08.2015
33
+ var isValidDate = exports.isValidDate = function isValidDate(dateString) {
34
+
35
+ if (typeof dateString !== "string" || dateString.length !== 10) {
36
+ return false;
37
+ }
38
+
39
+ if (!pattern.test(dateString)) {
40
+ return false;
41
+ }
42
+
43
+ // Parse the date parts to integers
44
+ var parts = dateString.split("."),
45
+ day = parseInt(parts[0], 10),
46
+ month = parseInt(parts[1], 10),
47
+ year = parseInt(parts[2], 10);
48
+
49
+ // Check the ranges of month and year
50
+ if (year < 1000 || year > 3000 || month === 0 || month > 12) {
51
+ return false;
52
+ }
53
+
54
+ // Adjust for leap years
55
+ if (year % 400 === 0 || year % 100 !== 0 || year % 4 !== 0) {
56
+ monthLength[1] = 29;
57
+ }
58
+
59
+ // Check the range of the day
60
+ return day > 0 && day <= monthLength[month - 1];
61
+ };
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ var _email = require("./email");
4
+
5
+ var valid = true,
6
+ notValid = false;
7
+
8
+ describe("given an email without @ [email]", function () {
9
+ it("should not be valid", function () {
10
+ expect((0, _email.isValidEmail)("email")).toBe(notValid);
11
+ });
12
+ });
13
+
14
+ describe("given an email without the user [email@]", function () {
15
+ it("should not be valid", function () {
16
+ expect((0, _email.isValidEmail)("email@")).toBe(notValid);
17
+ });
18
+ });
19
+
20
+ describe("given an email without domain [email@email]", function () {
21
+ it("should not be valid", function () {
22
+ expect((0, _email.isValidEmail)("email@email")).toBe(notValid);
23
+ });
24
+ });
25
+
26
+ describe("given a good email (email@email.ro)", function () {
27
+ it("should be valid", function () {
28
+ expect((0, _email.isValidEmail)("email@email.ro")).toBe(valid);
29
+ });
30
+ });
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var isValidEmail = exports.isValidEmail = function isValidEmail(value) {
7
+ return (
8
+ /* eslint-disable-next-line */
9
+ new RegExp(/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/igm).test(value)
10
+ );
11
+ };
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _date = require("./date");
8
+
9
+ Object.keys(_date).forEach(function (key) {
10
+ if (key === "default" || key === "__esModule") return;
11
+ Object.defineProperty(exports, key, {
12
+ enumerable: true,
13
+ get: function get() {
14
+ return _date[key];
15
+ }
16
+ });
17
+ });
18
+
19
+ var _email = require("./email");
20
+
21
+ Object.keys(_email).forEach(function (key) {
22
+ if (key === "default" || key === "__esModule") return;
23
+ Object.defineProperty(exports, key, {
24
+ enumerable: true,
25
+ get: function get() {
26
+ return _email[key];
27
+ }
28
+ });
29
+ });
30
+
31
+ var _cif = require("./cif");
32
+
33
+ Object.keys(_cif).forEach(function (key) {
34
+ if (key === "default" || key === "__esModule") return;
35
+ Object.defineProperty(exports, key, {
36
+ enumerable: true,
37
+ get: function get() {
38
+ return _cif[key];
39
+ }
40
+ });
41
+ });
42
+
43
+ var _cnp = require("./cnp");
44
+
45
+ Object.keys(_cnp).forEach(function (key) {
46
+ if (key === "default" || key === "__esModule") return;
47
+ Object.defineProperty(exports, key, {
48
+ enumerable: true,
49
+ get: function get() {
50
+ return _cnp[key];
51
+ }
52
+ });
53
+ });
54
+
55
+ var _bank = require("./bank");
56
+
57
+ Object.keys(_bank).forEach(function (key) {
58
+ if (key === "default" || key === "__esModule") return;
59
+ Object.defineProperty(exports, key, {
60
+ enumerable: true,
61
+ get: function get() {
62
+ return _bank[key];
63
+ }
64
+ });
65
+ });
package/.eslintignore DELETED
@@ -1,2 +0,0 @@
1
- webpack.config.js
2
- node_modules
package/.eslintrc.json DELETED
@@ -1,275 +0,0 @@
1
- {
2
- "env":{
3
- "browser":true,
4
- "es6":true,
5
- "jest":true
6
- },
7
- "parser":"babel-eslint",
8
- "extends":[
9
- "eslint:all",
10
- "plugin:react/all",
11
- "plugin:react-hooks/recommended"
12
- ],
13
- "settings": {
14
- "react": {
15
- "pragma": "React",
16
- "version": "16.12.0",
17
- "flowVersion": "0.112.0"
18
- }
19
- },
20
- "parserOptions":{
21
- "ecmaVersion":2018,
22
- "ecmaFeatures":{
23
- "jsx":true,
24
- "modules":true
25
- },
26
- "sourceType":"module"
27
- },
28
- "plugins":[
29
- "react"
30
- ],
31
- "rules":{
32
- "react/require-optimization": 0,
33
- "default-param-last": 0,
34
- "react/jsx-props-no-spreading": 0,
35
- "function-call-argument-newline": ["error", "consistent"],
36
-
37
- "react/no-deprecated": 0,
38
- "max-lines-per-function": ["error", { "max": 300 }],
39
-
40
- "react/jsx-fragments": 0,
41
- "react/state-in-constructor": 0,
42
- "react/jsx-handler-names":0,
43
- "no-confusing-arrow":0,
44
- "max-statements":0,
45
- "react/destructuring-assignment":0,
46
- "react/no-unused-prop-types":0,
47
- "react/require-default-props":0,
48
- "react/jsx-sort-default-props":0,
49
- "react/jsx-max-depth":0,
50
- "prefer-promise-reject-errors":0,
51
- "react/no-unused-state": 0,
52
- "react/jsx-one-expression-per-line":0,
53
- "react/jsx-no-literals":0,
54
- "react/default-props-match-prop-types":0,
55
- "padding-line-between-statements":[
56
- "error",
57
- {
58
- "blankLine":"always",
59
- "prev":[
60
- "const",
61
- "let",
62
- "var"
63
- ],
64
- "next":"*"
65
- },
66
- {
67
- "blankLine":"any",
68
- "prev":[
69
- "const",
70
- "let",
71
- "var"
72
- ],
73
- "next":[
74
- "const",
75
- "let",
76
- "var"
77
- ]
78
- }
79
- ],
80
- "react/forbid-component-props":0,
81
- "react/no-multi-comp":0,
82
- "react/no-set-state":0,
83
- "react/jsx-closing-bracket-location":0,
84
- "react/jsx-max-props-per-line":0,
85
- "no-underscore-dangle":0,
86
- "function-paren-newline":0,
87
- "no-nested-ternary":0,
88
- "max-params":[
89
- "error",
90
- 5
91
- ],
92
- "multiline-comment-style":0,
93
- "lines-between-class-members":[
94
- "error",
95
- "always",
96
- {
97
- "exceptAfterSingleLine":true
98
- }
99
- ],
100
- "react/jsx-indent-props":0,
101
- "react/jsx-indent":0,
102
- "react/no-array-index-key":0,
103
- "react/jsx-curly-brace-presence":[
104
- 2,
105
- {
106
- "props":"never",
107
- "children":"ignore"
108
- }
109
- ],
110
- "react/sort-comp":[
111
- 2,
112
- {
113
- "order":[
114
- "static-methods",
115
- "lifecycle",
116
- "render"
117
- ],
118
- "groups":{
119
- "lifecycle":[
120
- "defaultProps",
121
- "props",
122
- "contextTypes",
123
- "childContextTypes",
124
- "statics",
125
- "state",
126
- "everything-else",
127
- "constructor",
128
- "getDefaultProps",
129
- "getInitialState",
130
- "getChildContext",
131
- "componentWillMount",
132
- "componentDidMount",
133
- "componentWillReceiveProps",
134
- "shouldComponentUpdate",
135
- "componentWillUpdate",
136
- "componentDidUpdate",
137
- "componentWillUnmount"
138
- ]
139
- }
140
- }
141
- ],
142
- "new-cap":[
143
- 2,
144
- {
145
- "capIsNewExceptions":[
146
- "List",
147
- "Map",
148
- "OrderedList",
149
- "OrderedMap",
150
- "OrderedSet",
151
- "Record",
152
- "Stack"
153
- ]
154
- }
155
- ],
156
- "comma-dangle":[
157
- "error",
158
- "always-multiline"
159
- ],
160
- "no-extra-parens":[
161
- "off"
162
- ],
163
- "no-magic-numbers":[
164
- "error",
165
- {
166
- "ignore":[
167
- 0,
168
- 1,
169
- 2,
170
- 10
171
- ],
172
- "ignoreArrayIndexes":true
173
- }
174
- ],
175
- "strict":[
176
- "error",
177
- "global"
178
- ],
179
- "max-lines":[
180
- 2,
181
- 450
182
- ],
183
- "max-len":[
184
- "error",
185
- 105
186
- ],
187
- "object-curly-spacing":[
188
- "error",
189
- "always"
190
- ],
191
- "indent":[
192
- "error",
193
- 2,
194
- {
195
- "SwitchCase":1
196
- }
197
- ],
198
- "linebreak-style":[
199
- "error",
200
- "windows"
201
- ],
202
- "padded-blocks":[
203
- "off"
204
- ],
205
- "one-var":[
206
- "off"
207
- ],
208
- "no-ternary":[
209
- "off"
210
- ],
211
- "multiline-ternary":[
212
- "off"
213
- ],
214
- "quote-props":[
215
- "error",
216
- "consistent"
217
- ],
218
- "object-curly-newline":[
219
- "off"
220
- ],
221
- "quotes":[
222
- "error",
223
- "double",
224
- "avoid-escape"
225
- ],
226
- "semi":[
227
- "error"
228
- ],
229
- "sort-vars":[
230
- "off"
231
- ],
232
- "sort-keys":[
233
- "off"
234
- ],
235
- "sort-imports":[
236
- "off"
237
- ],
238
- "capitalized-comments":[
239
- "off"
240
- ],
241
- "arrow-body-style":[
242
- "error",
243
- "as-needed"
244
- ],
245
- "arrow-parens":[
246
- "error",
247
- "always"
248
- ],
249
- "class-methods-use-this":[
250
- "error",
251
- {
252
- "exceptMethods":[
253
- "componentDidMount",
254
- "componentDidUpdate",
255
- "componentWillMount",
256
- "componentWillReceiveProps",
257
- "componentWillUnmount",
258
- "componentWillUpdate",
259
- "render",
260
- "shouldComponentUpdate"
261
- ]
262
- }
263
- ],
264
- "key-spacing":[
265
- "error",
266
- {
267
- "align":{
268
- "beforeColon":true,
269
- "afterColon":true,
270
- "on":"colon"
271
- }
272
- }
273
- ]
274
- }
275
- }
package/.flowconfig DELETED
@@ -1,23 +0,0 @@
1
- [ignore]
2
- .*/node_modules/fbjs/.*
3
- .*/node_modules/config-chain/test/broken.json
4
- .*/node_modules/npmconf/test/.*
5
- .*/node_modules/npm/test/.*
6
- [untyped]
7
- .*/node_modules/react-select/.*
8
- [include]
9
- [libs]
10
- src/types
11
- [options]
12
- emoji=true
13
- esproposal.class_static_fields=enable
14
- module.file_ext=.css
15
- module.file_ext=.js
16
- module.file_ext=.json
17
- module.file_ext=.jsx
18
- module.file_ext=.scss
19
- module.ignore_non_literal_requires=true
20
- suppress_type=$FlowIssue
21
- suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
22
- suppress_type=$Intl
23
- module.name_mapper='^src\(.*\)$' -> '<PROJECT_ROOT>/src/\1'
package/conf/dev.js DELETED
@@ -1,19 +0,0 @@
1
- // @flow
2
- /* eslint-disable no-console, no-undefined */
3
-
4
- const fileName = "config.json";
5
-
6
- const fs = require("fs");
7
-
8
- const file = require(`../${fileName}`);
9
-
10
- file.isProduction = false;
11
-
12
- fs.writeFile(fileName, JSON.stringify(file, null, 2), (err) => {
13
-
14
- if (err) {
15
- return console.log(err);
16
- }
17
-
18
- return undefined;
19
- });
package/conf/dist.js DELETED
@@ -1,19 +0,0 @@
1
- // @flow
2
- /* eslint-disable no-console, no-undefined */
3
-
4
- const fileName = "config.json";
5
-
6
- const fs = require("fs");
7
-
8
- const file = require(`../${fileName}`);
9
-
10
- file.isProduction = true;
11
-
12
- fs.writeFile(fileName, JSON.stringify(file, null, 2), (err) => {
13
-
14
- if (err) {
15
- return console.log(err);
16
- }
17
-
18
- return undefined;
19
- });
@@ -1,7 +0,0 @@
1
- /* eslint-disable */
2
-
3
- const raf = global.requestAnimationFrame = (cb) => {
4
- setTimeout(cb, 0);
5
- }
6
-
7
- export default raf;
@@ -1,79 +0,0 @@
1
- // @flow
2
- /* eslint-disable react/require-optimization */
3
-
4
- import type { Dispatch, State } from "src\\types";
5
-
6
- type PropTypes = {
7
- +appName: string;
8
- +isFetching: bool;
9
- +hasError: bool;
10
- +data: any;
11
- +children: any;
12
- +shouldFetch: any;
13
-
14
- +fetchInitialInformation: () => void;
15
- }
16
-
17
- import React from "react";
18
-
19
- import { connect } from "react-redux";
20
-
21
- import { selectors } from "./reducer";
22
-
23
- import { fetchInitialInformation as fetchInitialInformationAction } from "./actions";
24
-
25
- import { LargeErrorMessage, LoadingMessage } from "../Messages";
26
-
27
- const
28
- mapStateToProps = (state : State) => ({
29
- data : selectors.getCurrentAccount(state),
30
- hasError : selectors.getCurrentAccountHasError(state),
31
- fetched : selectors.getCurrentAccountIsFetched(state),
32
- isFetching : selectors.getCurrentAccountIsFetching(state),
33
- shouldFetch : selectors.getCurrentAccountShouldFetch(state),
34
- }),
35
- mapDispatchToProps = (dispatch : Dispatch, { appName }) => ({
36
- fetchInitialInformation () {
37
- setTimeout(() => {
38
- dispatch(fetchInitialInformationAction(appName));
39
- });
40
- },
41
- });
42
-
43
- const LoadAccount = (props : PropTypes) => {
44
- const { children, data, isFetching, shouldFetch, hasError, fetchInitialInformation } = props;
45
-
46
- React.useEffect(() => {
47
- if (shouldFetch) {
48
- fetchInitialInformation();
49
- }
50
- }, [
51
- shouldFetch,
52
- isFetching,
53
- hasError,
54
- ]);
55
-
56
- if (isFetching) {
57
- return (
58
- <LoadingMessage message="Așteaptă..." />
59
- );
60
- }
61
-
62
- if (hasError) {
63
- return (
64
- <LargeErrorMessage
65
- message="Nu am putut stabili conexiunea cu server-ul"
66
- onRetry={fetchInitialInformation}
67
- />
68
- );
69
- }
70
-
71
- if (data.size === 0) {
72
- return null;
73
- }
74
-
75
- return children;
76
- };
77
-
78
- export default connect(mapStateToProps,
79
- mapDispatchToProps)(LoadAccount);
@@ -1,10 +0,0 @@
1
- // @flow
2
-
3
- import type { Action } from "src\\types";
4
-
5
- import { fetchInitialInformation as fetchInitialInformationRequest } from "./request";
6
-
7
- export const fetchInitialInformation = (appName : string) : Action => ({
8
- type : "FETCH_INITIAL_INFORMATION",
9
- payload : fetchInitialInformationRequest(appName),
10
- });
@@ -1,11 +0,0 @@
1
- // @flow
2
-
3
- import accountReducer, { selectors as accountSelectors } from "./reducer";
4
-
5
- import LoadAccount from "./Load";
6
-
7
- export {
8
- accountSelectors,
9
- accountReducer,
10
- LoadAccount,
11
- };