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,209 +0,0 @@
1
- // @flow
2
- /* eslint-disable no-magic-numbers, max-classes-per-file */
3
-
4
- import type { Dispatch, State } from "src\\types";
5
-
6
- type FormPropTypes = {
7
- +error?: string;
8
- +pristine: boolean;
9
- +submitting: boolean;
10
- +handleSubmit: (formData : any) => Promise<*>;
11
- };
12
-
13
- type DoneFormPropTypes = {
14
- +details: string;
15
- +showUserResponse: () => void;
16
- };
17
-
18
- import { connect } from "react-redux";
19
- import { SubmissionError, Field, reduxForm, formValueSelector } from "redux-form/immutable";
20
-
21
- import React from "react";
22
-
23
- import { showTransferWasDone } from "../actions";
24
-
25
- import { confirmBankTransfer as confirmBankTransferRequest } from "../request";
26
-
27
- import {
28
- extractErrorsFromCheckers,
29
- validateString,
30
- delay,
31
- ReduxFormSubmissionError,
32
- } from "../../utility";
33
-
34
- import { hideModal } from "../../actions";
35
- import { LoadingMessage } from "../../Messages";
36
- import { FocusTemplate } from "../../Inputs";
37
-
38
- const
39
- TransferNumber = validateString({
40
- min: 4,
41
- });
42
-
43
- const validate = extractErrorsFromCheckers({
44
- TransferNumber,
45
- });
46
-
47
- const selector = formValueSelector("ADD_CAR_FORM");
48
-
49
- const
50
- mapStateToProps = (state : State) => ({
51
- ExpiryDate: selector(state, "ExpiryDate"),
52
- }),
53
- mapDispatchToProps = (dispatch : Dispatch) => ({
54
- showUserResponse () {
55
- delay().
56
- then(() => {
57
- dispatch(hideModal());
58
- }).
59
- then(() => {
60
- dispatch(hideModal());
61
- }).
62
- // then(() => {
63
- // dispatch(notify("Operațiune îndeplinită cu succes"));
64
- // }).
65
- then(() => {
66
- dispatch(showTransferWasDone());
67
- });
68
- },
69
- });
70
-
71
-
72
- class TheForm extends React.Component<FormPropTypes> {
73
-
74
- props: FormPropTypes;
75
-
76
- field: any;
77
-
78
- handleSubmitForm: (data : any) => void;
79
- handleRegisterRef: (node : any) => void;
80
- focusNameInput: () => void;
81
-
82
- constructor (props : FormPropTypes) {
83
- super(props);
84
-
85
- this.handleSubmitForm = (data : any) => {
86
- const { handleSubmit } = this.props;
87
-
88
- const result = handleSubmit(data);
89
-
90
- if (typeof result.then !== "undefined") {
91
- result.then(() => {
92
- this.focusNameInput();
93
- });
94
- }
95
- };
96
-
97
- this.focusNameInput = () => {
98
- setTimeout(() => {
99
- const { field } = this;
100
-
101
- if (field && field !== null) {
102
- field.focus();
103
- }
104
- });
105
- };
106
-
107
- this.handleRegisterRef = (node : any) => {
108
- this.field = node;
109
- };
110
- }
111
-
112
- componentDidMount () {
113
- this.focusNameInput();
114
- }
115
-
116
- render () {
117
- const { error, pristine, submitting } = this.props;
118
-
119
- return (
120
- <form autoComplete="off" className="mt-4" onSubmit={this.handleSubmitForm}>
121
- {error ? (
122
- <div className="alert alert-danger">
123
- {error}
124
- </div>
125
- ) : null}
126
- <div className="alert alert-primary">
127
- {"Te rugăm să completezi numărul tranzacției bancare:"}
128
- </div>
129
- <div className="container">
130
- <div className="row">
131
- <div className="col-md">
132
- <Field
133
- autoFocus
134
- component={FocusTemplate}
135
- forwardRef
136
- label="Număr tranzacție"
137
- name="TransferNumber"
138
- onRegisterRef={this.handleRegisterRef}
139
- placeholder="ex. 238747324"
140
- />
141
- </div>
142
- </div>
143
- </div>
144
- <div className="text-center mb-4">
145
- {
146
- submitting ? (
147
- <LoadingMessage sm />
148
- ) : (
149
- <button
150
- aria-label="Trimite"
151
- className="btn btn-primary"
152
- disabled={pristine || submitting}
153
- type="submit">
154
- {"Trimite"}
155
- </button>
156
- )
157
- }
158
- </div>
159
- </form>
160
- );
161
- }
162
- }
163
-
164
- const
165
- Form = reduxForm({
166
- form: "PAYMENT_BANK_TRANSFER_NUMBER",
167
- validate,
168
- })(TheForm);
169
-
170
- class DoneForm extends React.Component<DoneFormPropTypes> {
171
-
172
- props: DoneFormPropTypes;
173
-
174
- handleSubmit: (formData : any) => Promise<*>;
175
-
176
- constructor () {
177
- super();
178
-
179
- this.handleSubmit = (formData : any) => {
180
-
181
- const
182
- { showUserResponse } = this.props,
183
- data = {
184
- ...formData.toJS(),
185
- Details: this.props.details,
186
- };
187
-
188
- return confirmBankTransferRequest(data).
189
- then((response : any) => {
190
- if (response.Error === "") {
191
- showUserResponse();
192
- } else {
193
- throw new SubmissionError({
194
- _error: response.Error,
195
- });
196
- }
197
- }).
198
- catch(ReduxFormSubmissionError);
199
- };
200
- }
201
-
202
- render () {
203
- return (
204
- <Form onSubmit={this.handleSubmit} />
205
- );
206
- }
207
- }
208
-
209
- export default connect(mapStateToProps, mapDispatchToProps)(DoneForm);
@@ -1,27 +0,0 @@
1
- // @flow
2
-
3
- import React from "react";
4
- import { SimpleModal } from "../../Modal";
5
-
6
- const ModalBankTransfer = () => (
7
- <SimpleModal title="Confirmare">
8
- <div className="mt-2">
9
- <h3 className="text-success">
10
- <i className="fa fa-check text-success" /> {"Am înregistrat cererea ta"}
11
- </h3>
12
- <div className="mt-4">
13
- <h5 className="mt-2">{"Ce se întâmplă acum?"}</h5>
14
- {"Rămâne să primim confirmarea din partea băncii tale și vom efectua operațiunile"}
15
- </div>
16
- <h5 className="mt-3">{"Cât timp va dura?"}</h5>
17
- <div>
18
- {`Durează între 1 și 3 zile lucrătoare pentru operațiunea bancară să
19
- se desfășoare. În momentul în care am primit banii în cont, te rugăm să acorzi
20
- 1-2 zile lucrătoare să operăm modificările pe platforma Sidework și să
21
- te bucuri de beneficii.`}
22
- </div>
23
- </div>
24
- </SimpleModal>
25
- );
26
-
27
- export default ModalBankTransfer;
@@ -1,13 +0,0 @@
1
- // @flow
2
-
3
- import BankTransfer from "./BankTransfer";
4
- import PaymentDone from "./PaymentDone";
5
- import CompanyValability from "./CompanyValability";
6
-
7
- const modals = {
8
- "PAYMENT_BANK_TRANSFER" : BankTransfer,
9
- "PAYMENT_WAS_DONE" : PaymentDone,
10
- "ESTIMATE_COMPANY_PRICE" : CompanyValability,
11
- };
12
-
13
- export default modals;
@@ -1,22 +0,0 @@
1
- // @flow
2
-
3
- import { createModal } from "../utility";
4
-
5
- import type { BankTransferArgsTypes } from "./types";
6
-
7
- export const payUsingBankTransferModal = (
8
- (application : string, options : BankTransferArgsTypes) : any => (
9
- createModal("PAYMENT_BANK_TRANSFER", {
10
- application,
11
- options,
12
- })
13
- )
14
- );
15
-
16
- export const showTransferWasDone = () : any => (
17
- createModal("PAYMENT_WAS_DONE")
18
- );
19
-
20
- export const estimateCompanyPriceModal = (id : number) : any => (
21
- createModal("ESTIMATE_COMPANY_PRICE", { id })
22
- );
@@ -1,124 +0,0 @@
1
- // @flow
2
- /* eslint-disable no-magic-numbers */
3
-
4
- import type { BankTransferArgsTypes, PayUsingBankTransferType } from "./types";
5
-
6
- type PaymentWrapPropTypes = {
7
- +url: string;
8
- +application: string;
9
- +companyID: number;
10
- +children: any;
11
- +payUsingBankTransfer: PayUsingBankTransferType;
12
- };
13
-
14
- type PaymentWrapStateTypes = {
15
- envKey: string;
16
- data: string;
17
- show3rdServiceForm: bool;
18
- };
19
-
20
- import { SubmissionError } from "redux-form/immutable";
21
-
22
- import React from "react";
23
-
24
- import { addPayment as addPaymentRequest } from "./request";
25
-
26
- import { ReduxFormSubmissionError } from "../utility";
27
-
28
- import MobilpayForm from "./MobilpayForm";
29
-
30
- import { connect } from "react-redux";
31
-
32
- import { payUsingBankTransferModal } from "./actions";
33
-
34
- import { getDetails } from "./util";
35
-
36
- const
37
- mapDispatchToProps = (dispatch : any) => ({
38
- payUsingBankTransfer: (application : string, options : BankTransferArgsTypes) => () => {
39
- dispatch(payUsingBankTransferModal(application, options));
40
- },
41
- });
42
-
43
-
44
- /*
45
- Injects a createPayment method ready for dealing with adding the payment.
46
- After that, it submits the payment
47
- */
48
- class PaymentWrap extends React.Component<PaymentWrapPropTypes, PaymentWrapStateTypes> {
49
-
50
- props: PaymentWrapPropTypes;
51
- state: PaymentWrapStateTypes;
52
-
53
- createPayment: (formData : any) => Promise<*>;
54
-
55
- constructor (props : PaymentWrapPropTypes) {
56
- super(props);
57
-
58
- this.state = {
59
- envKey : "",
60
- data : "",
61
- show3rdServiceForm : false,
62
- };
63
-
64
- this.createPayment = (formData : any) => {
65
- const
66
- { companyID } = this.props,
67
- data : any = formData.toJS(),
68
- Details = getDetails(this.props.application, {
69
- ...data,
70
- companyID,
71
- }),
72
- toSend = {
73
- CompanyID: companyID,
74
- Details,
75
- };
76
-
77
- return addPaymentRequest(toSend).
78
- then((response : any) => {
79
- if (response.Error === "") {
80
- this.setState({
81
- envKey : response.EnvKey,
82
- data : response.Data,
83
- show3rdServiceForm : true,
84
- });
85
- } else {
86
- throw new SubmissionError({
87
- _error: response.Error,
88
- });
89
- }
90
- }).
91
- catch(ReduxFormSubmissionError);
92
- };
93
- }
94
-
95
- render () {
96
- const { children, companyID } = this.props;
97
-
98
- if (this.state.show3rdServiceForm) {
99
- return (
100
- <MobilpayForm
101
- data={this.state.data}
102
- envKey={this.state.envKey}
103
- url={this.props.url}
104
- />
105
- );
106
- }
107
-
108
- if (children === null) {
109
- return null;
110
- }
111
-
112
- return (
113
- React.cloneElement(children, {
114
- companyID,
115
- createPayment : this.createPayment,
116
- payUsingBankTransfer : this.props.payUsingBankTransfer,
117
- })
118
- );
119
- }
120
- }
121
-
122
- export * from "./codes";
123
-
124
- export default connect(null, mapDispatchToProps)(PaymentWrap);
@@ -1,50 +0,0 @@
1
- // @flow
2
-
3
- import agent from "superagent";
4
-
5
- const normalizePayment = (resolve, reject) => (
6
- (error, response) => {
7
-
8
- if (error) {
9
- reject({ error });
10
- } else {
11
- const { body } = response,
12
- { Error } = body;
13
-
14
- if (typeof Error !== "undefined" && Error !== "") {
15
- reject({
16
- error: Error,
17
- });
18
- } else {
19
- resolve({
20
- ...body,
21
- Error,
22
- });
23
- }
24
- }
25
- }
26
- );
27
-
28
- export const addPayment = (data : any) => (
29
- new Promise((resolve, reject) => (
30
- agent.
31
- put("/api/settings/payments").
32
- set("Accept",
33
- "application/json").
34
- send(data).
35
- end(normalizePayment(resolve,
36
- reject))
37
- )) : Promise<any>
38
- );
39
-
40
- export const confirmBankTransfer = (data : any) => (
41
- new Promise((resolve, reject) => (
42
- agent.
43
- put("/api/settings/payments/confirm-bank-transfer").
44
- set("Accept",
45
- "application/json").
46
- send(data).
47
- end(normalizePayment(resolve,
48
- reject))
49
- )) : Promise<any>
50
- );
@@ -1,14 +0,0 @@
1
- // @flow
2
-
3
- export type PaymentOptions = {
4
- reference: string;
5
- }
6
-
7
- export type BankTransferArgsTypes = any;
8
- // Immutable.Map({
9
- // Credits,
10
- // companyID,
11
- // amount,
12
- // }),
13
-
14
- export type PayUsingBankTransferType = (application: string, options: BankTransferArgsTypes) => void;
@@ -1,52 +0,0 @@
1
- // @flow
2
-
3
- type DataType = {
4
- Credits: number;
5
- Months: number;
6
- companyID: number;
7
- };
8
-
9
- import * as codes from "./codes";
10
-
11
- const getDetails = (application : string, data : DataType) => {
12
-
13
- const getParams = () => {
14
- const { Credits, Months, companyID } = data;
15
-
16
- switch (application) {
17
- case codes.ApplicationCodeSMSAlert:
18
-
19
- return [
20
- Credits,
21
- companyID,
22
- ];
23
-
24
- case codes.ApplicationCodeAutoService:
25
- case codes.ApplicationCodeInvoiceService:
26
- return [
27
- Months,
28
- companyID,
29
- ];
30
-
31
- default:
32
- return [];
33
- }
34
- };
35
-
36
- return `${application}-${getParams().join("-")}`;
37
- };
38
-
39
- const info = {
40
- to : "S.C. SIDEWORK S.R.L.",
41
- cif : "40375263",
42
- regCom : "J52/21/2019",
43
- address : "B-dul Republicii, Bl. B3, Ap. 19, Et. 2, Camera 1 & Camera 2, Bolintin Vale, Giurgiu",
44
-
45
- bankName : "Banca Transilvania S.A.",
46
- bankAccount : "RO27 BTRL RONC RT04 8269 9301",
47
- };
48
-
49
- export {
50
- info,
51
- getDetails,
52
- };
@@ -1,25 +0,0 @@
1
- // @flow
2
-
3
- import {
4
- extractErrorsFromCheckers,
5
- } from "../utility";
6
-
7
- const validateTrue = (value : string) => {
8
- const
9
- notValid = (
10
- typeof value !== "boolean" ||
11
- value !== true
12
- );
13
-
14
- return {
15
- notValid,
16
- error: "Trebuie să fii de acord",
17
- };
18
- };
19
-
20
- const
21
- checkers = {
22
- AcceptPolicy: validateTrue,
23
- };
24
-
25
- export const validate = extractErrorsFromCheckers(checkers);
package/src/Sidebar.jsx DELETED
@@ -1,158 +0,0 @@
1
- // @flow
2
-
3
- import * as React from "react";
4
-
5
- export type SidebarPropTypes = {
6
- +brand: string;
7
- +Menu: any;
8
- +children: React.Node;
9
- +data: any;
10
-
11
- +hasError: boolean;
12
- +board: any;
13
-
14
- +toggleSidebar: () => void;
15
- +closeSidebar: () => void;
16
- +fixSidebar: () => void;
17
- };
18
-
19
- export type SidebarPropTypesContent = {
20
- Menu: any;
21
- id?: string;
22
- ui: {
23
- sidebarDocked: boolean;
24
- };
25
- data: any;
26
- closeSidebar: () => void;
27
- fixSidebar: () => void;
28
- };
29
-
30
- export type SidebarStateTypes = {
31
- showNavbar: boolean;
32
- sidebarDocked: boolean;
33
- sidebarOpen: boolean;
34
- sidebarDocked: boolean;
35
- };
36
-
37
- import ReactSidebar from "react-sidebar";
38
-
39
- import { mql } from "./utility";
40
-
41
- import { Header } from "./Header";
42
-
43
- const styles = {
44
- sidebar: {
45
- zIndex : 2,
46
- position : "absolute",
47
- top : 0,
48
- bottom : 0,
49
- transition : "transform .3s ease-out",
50
- WebkitTransition : "-webkit-transform .3s ease-out",
51
- willChange : "transform",
52
- overflowY : "auto",
53
- },
54
- overlay: {
55
- zIndex : 3,
56
- left : 240,
57
- },
58
- };
59
-
60
- class Sidebar extends React.PureComponent<SidebarPropTypes, SidebarStateTypes> {
61
-
62
- props: SidebarPropTypes;
63
- state: SidebarStateTypes;
64
-
65
- updateSidebar: () => void;
66
- toggleNavbar: () => void;
67
- toggleSidebarOpen: (value : boolean) => void;
68
- showSidebar: () => void;
69
- closeSidebar: () => void;
70
-
71
- constructor (props : SidebarPropTypes) {
72
- super(props);
73
-
74
- this.state = {
75
- showNavbar : false,
76
- sidebarDocked : mql.matches,
77
- sidebarOpen : false,
78
- };
79
-
80
- this.updateSidebar = () => {
81
- this.setState((current : any) => ({
82
- sidebarOpen : !mql.matches && current.sidebarOpen,
83
- sidebarDocked : mql.matches,
84
- }));
85
- };
86
-
87
- this.toggleNavbar = () => {
88
- this.setState((current : any) => ({
89
- showNavbar: !current.showNavbar,
90
- }));
91
- };
92
-
93
- this.toggleSidebarOpen = (value : boolean) => {
94
- this.setState({
95
- sidebarOpen: value,
96
- });
97
- };
98
-
99
- this.showSidebar = () => {
100
- const theMetch = mql.matches;
101
-
102
- this.setState({
103
- sidebarOpen : !theMetch,
104
- sidebarDocked : theMetch,
105
- });
106
- };
107
-
108
- this.closeSidebar = () => {
109
- this.setState({
110
- sidebarOpen : false,
111
- sidebarDocked : false,
112
- });
113
- };
114
- }
115
-
116
- componentDidMount () {
117
- mql.addListener(this.updateSidebar);
118
- }
119
-
120
- componentWillUnmount () {
121
- mql.removeListener(this.updateSidebar);
122
- }
123
-
124
- render () {
125
- const { data, children } = this.props;
126
-
127
- const sidebarprops = {
128
- closeSidebar: this.closeSidebar,
129
- };
130
-
131
- return (
132
- <ReactSidebar
133
- {...this.props}
134
- contentClassName="wrapper"
135
- docked={this.state.sidebarDocked}
136
- onSetOpen={this.toggleSidebarOpen}
137
- open={this.state.sidebarOpen}
138
- rootClassName="page-wrapper dark-theme toggled"
139
- sidebar={React.cloneElement(this.props.Menu, sidebarprops)}
140
- sidebarClassName="sidebar-wrapper"
141
- styles={styles}
142
- touch={false}
143
- transitions={false}>
144
- <Header
145
- brand={this.props.brand}
146
- company={data}
147
- showNavbar={this.state.showNavbar}
148
- showSidebar={this.showSidebar}
149
- sidebarDocked={this.state.sidebarDocked}
150
- toggleNavbar={this.toggleNavbar}
151
- />
152
- { children }
153
- </ReactSidebar>
154
- );
155
- }
156
- }
157
-
158
- export default Sidebar;