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.
- package/Account/Load.js +75 -0
- package/Account/actions.js +15 -0
- package/Account/index.js +20 -0
- package/Account/reducer.js +122 -0
- package/Account/request.js +44 -0
- package/Async/InitModule.js +190 -0
- package/Async/RouteLoading.js +64 -0
- package/Async/SimulatedException.js +44 -0
- package/Async/index.js +95 -0
- package/Async/types.js +1 -0
- package/Company/Load.js +82 -0
- package/Company/actions.js +15 -0
- package/Company/index.js +20 -0
- package/Company/reducer.js +165 -0
- package/Company/request.js +36 -0
- package/Company/util.js +10 -0
- package/Header/AccountOptionsContainer.js +144 -0
- package/Header/AdminSelectCompany.js +109 -0
- package/Header/ClientSelectCompany.js +104 -0
- package/Header/Header.js +127 -0
- package/Header/HeaderContainer.js +39 -0
- package/Header/Logo.js +30 -0
- package/Header/LogoutButton.js +39 -0
- package/Header/index.js +19 -0
- package/Header/request.js +26 -0
- package/Header/types.js +1 -0
- package/Header/util.js +58 -0
- package/Inputs/Business/BankAccount.js +48 -0
- package/Inputs/Business/BankName.js +49 -0
- package/Inputs/Business/CifField.js +112 -0
- package/Inputs/Business/CifFieldContainer.js +157 -0
- package/Inputs/Business/Email.js +37 -0
- package/Inputs/Business/NidField.js +91 -0
- package/Inputs/Business/Phone.js +37 -0
- package/Inputs/Business/index.js +34 -0
- package/Inputs/Business/request.js +39 -0
- package/Inputs/CaptchaBox.js +151 -0
- package/Inputs/DateInput.js +172 -0
- package/Inputs/DateTemplate.js +200 -0
- package/Inputs/DelayInputChange.js +135 -0
- package/Inputs/FocusTemplate.js +47 -0
- package/Inputs/InputTemplate.js +78 -0
- package/Inputs/LabelTemplate.js +59 -0
- package/Inputs/NumericInput.js +139 -0
- package/Inputs/NumericTemplate.js +148 -0
- package/Inputs/Selects/County.js +29 -0
- package/Inputs/Selects/Custom.js +56 -0
- package/Inputs/Selects/Simple.js +75 -0
- package/Inputs/Selects/index.js +52 -0
- package/Inputs/SimpleInput.js +42 -0
- package/Inputs/SimpleTextarea.js +47 -0
- package/Inputs/TextareaTemplate.js +55 -0
- package/Inputs/Tooltip.js +82 -0
- package/Inputs/index.js +185 -0
- package/Messages/Error.js +106 -0
- package/Messages/Loading.js +68 -0
- package/Messages/index.js +29 -0
- package/Modal/Delete.js +240 -0
- package/Modal/Root.js +81 -0
- package/Modal/SimpleModal.js +57 -0
- package/Modal/actions.js +10 -0
- package/Modal/getComponent.js +42 -0
- package/Modal/index.js +22 -0
- package/Modal/reducer.js +53 -0
- package/Modal/types.js +7 -0
- package/Modal/util.js +17 -0
- package/Payment/EstimatePrice/Description.js +92 -0
- package/Payment/EstimatePrice/PayBox.js +220 -0
- package/Payment/EstimatePrice/index.js +92 -0
- package/Payment/EstimatePrice/util.js +21 -0
- package/Payment/MobilpayForm.js +86 -0
- package/Payment/Modal/BankTransfer.js +233 -0
- package/Payment/Modal/CompanyValability.js +28 -0
- package/Payment/Modal/DoneForm.js +222 -0
- package/Payment/Modal/PaymentDone.js +53 -0
- package/Payment/Modal/index.js +27 -0
- package/Payment/actions.js +23 -0
- package/{src/Payment → Payment}/codes.js +19 -16
- package/Payment/index.js +141 -0
- package/Payment/request.js +49 -0
- package/Payment/types.js +1 -0
- package/Payment/util.js +50 -0
- package/Payment/validate.js +23 -0
- package/Sidebar.js +156 -0
- package/Things.js +53 -0
- package/actions.js +73 -0
- package/config.js +10 -0
- package/dev/ErrorBoundary.js +109 -0
- package/dev/TheError.js +113 -0
- package/dev/index.js +132 -0
- package/dev/types.js +1 -0
- package/package.json +13 -13
- package/prod/SentryErrorBoundary.js +150 -0
- package/reducer/captchas.js +51 -0
- package/reducer/counties.js +57 -0
- package/reducer/index.js +38 -0
- package/reducer/module.js +48 -0
- package/style/index.css +1 -0
- package/style/sidebar.css +1 -0
- package/types.js +1 -0
- package/utility/calendar.js +45 -0
- package/utility/date.js +111 -0
- package/utility/index.js +125 -0
- package/utility/language.js +20 -0
- package/utility/mql.js +6 -0
- package/utility/normalize-test.js +54 -0
- package/utility/normalize.js +108 -0
- package/utility/numbers.js +93 -0
- package/utility/numeric.js +103 -0
- package/utility/others.js +142 -0
- package/utility/strings-test.js +216 -0
- package/utility/strings.js +85 -0
- package/utility/validation/common.js +278 -0
- package/utility/validation/index.js +110 -0
- package/utility/validation/specific.js +14 -0
- package/utility/validation/validate/bank-test.js +41 -0
- package/utility/validation/validate/bank.js +176 -0
- package/utility/validation/validate/cif-test.js +37 -0
- package/utility/validation/validate/cif.js +44 -0
- package/utility/validation/validate/cnp-test.js +68 -0
- package/utility/validation/validate/cnp.js +193 -0
- package/{src/utility → utility}/validation/validate/date.js +61 -73
- package/utility/validation/validate/email-test.js +30 -0
- package/utility/validation/validate/email.js +11 -0
- package/utility/validation/validate/index.js +65 -0
- package/.eslintignore +0 -2
- package/.eslintrc.json +0 -275
- package/.flowconfig +0 -23
- package/conf/dev.js +0 -19
- package/conf/dist.js +0 -19
- package/conf/polyfills/tempPolyfills.js +0 -7
- package/src/Account/Load.jsx +0 -79
- package/src/Account/actions.js +0 -10
- package/src/Account/index.js +0 -11
- package/src/Account/reducer.js +0 -139
- package/src/Account/request.js +0 -36
- package/src/Async/InitModule.jsx +0 -114
- package/src/Async/RouteLoading.jsx +0 -52
- package/src/Async/SimulatedException.jsx +0 -19
- package/src/Async/index.jsx +0 -75
- package/src/Async/types.js +0 -39
- package/src/Company/Load.jsx +0 -84
- package/src/Company/actions.js +0 -10
- package/src/Company/index.js +0 -11
- package/src/Company/reducer.js +0 -201
- package/src/Company/request.js +0 -30
- package/src/Company/util.js +0 -7
- package/src/Header/AccountOptionsContainer.jsx +0 -124
- package/src/Header/AdminSelectCompany.jsx +0 -101
- package/src/Header/ClientSelectCompany.jsx +0 -90
- package/src/Header/Header.jsx +0 -120
- package/src/Header/HeaderContainer.jsx +0 -30
- package/src/Header/Logo.jsx +0 -16
- package/src/Header/LogoutButton.jsx +0 -34
- package/src/Header/index.jsx +0 -9
- package/src/Header/request.js +0 -28
- package/src/Header/types.js +0 -6
- package/src/Header/util.jsx +0 -61
- package/src/Inputs/Business/BankAccount.jsx +0 -39
- package/src/Inputs/Business/BankName.jsx +0 -40
- package/src/Inputs/Business/CifField.jsx +0 -93
- package/src/Inputs/Business/CifFieldContainer.jsx +0 -142
- package/src/Inputs/Business/Email.jsx +0 -23
- package/src/Inputs/Business/NidField.jsx +0 -77
- package/src/Inputs/Business/Phone.jsx +0 -23
- package/src/Inputs/Business/index.js +0 -16
- package/src/Inputs/Business/request.js +0 -39
- package/src/Inputs/CaptchaBox.jsx +0 -131
- package/src/Inputs/DateInput.jsx +0 -188
- package/src/Inputs/DateTemplate.jsx +0 -213
- package/src/Inputs/DelayInputChange.jsx +0 -130
- package/src/Inputs/FocusTemplate.jsx +0 -41
- package/src/Inputs/InputTemplate.jsx +0 -79
- package/src/Inputs/LabelTemplate.jsx +0 -47
- package/src/Inputs/NumericInput.jsx +0 -142
- package/src/Inputs/NumericTemplate.jsx +0 -155
- package/src/Inputs/Selects/County.jsx +0 -19
- package/src/Inputs/Selects/Custom.jsx +0 -55
- package/src/Inputs/Selects/Simple.jsx +0 -73
- package/src/Inputs/Selects/index.jsx +0 -37
- package/src/Inputs/SimpleInput.jsx +0 -40
- package/src/Inputs/SimpleTextarea.jsx +0 -55
- package/src/Inputs/TextareaTemplate.jsx +0 -57
- package/src/Inputs/Tooltip.jsx +0 -61
- package/src/Inputs/index.js +0 -22
- package/src/Messages/Error.jsx +0 -83
- package/src/Messages/Loading.jsx +0 -43
- package/src/Messages/index.jsx +0 -4
- package/src/Modal/Delete.jsx +0 -237
- package/src/Modal/Root.jsx +0 -57
- package/src/Modal/SimpleModal.jsx +0 -47
- package/src/Modal/actions.js +0 -7
- package/src/Modal/getComponent.jsx +0 -32
- package/src/Modal/index.jsx +0 -12
- package/src/Modal/reducer.js +0 -40
- package/src/Modal/types.js +0 -6
- package/src/Modal/util.js +0 -15
- package/src/Payment/EstimatePrice/Description.jsx +0 -101
- package/src/Payment/EstimatePrice/PayBox.jsx +0 -173
- package/src/Payment/EstimatePrice/index.jsx +0 -63
- package/src/Payment/EstimatePrice/util.js +0 -15
- package/src/Payment/MobilpayForm.jsx +0 -77
- package/src/Payment/Modal/BankTransfer.jsx +0 -129
- package/src/Payment/Modal/CompanyValability.jsx +0 -14
- package/src/Payment/Modal/DoneForm.jsx +0 -209
- package/src/Payment/Modal/PaymentDone.jsx +0 -27
- package/src/Payment/Modal/index.js +0 -13
- package/src/Payment/actions.jsx +0 -22
- package/src/Payment/index.jsx +0 -124
- package/src/Payment/request.js +0 -50
- package/src/Payment/types.js +0 -14
- package/src/Payment/util.jsx +0 -52
- package/src/Payment/validate.js +0 -25
- package/src/Sidebar.jsx +0 -158
- package/src/Things.jsx +0 -35
- package/src/actions.js +0 -36
- package/src/config.js +0 -7
- package/src/dev/ErrorBoundary.jsx +0 -98
- package/src/dev/TheError.jsx +0 -87
- package/src/dev/index.js +0 -127
- package/src/dev/types.js +0 -10
- package/src/prod/SentryErrorBoundary.jsx +0 -98
- package/src/reducer/captchas.js +0 -44
- package/src/reducer/counties.js +0 -46
- package/src/reducer/index.js +0 -25
- package/src/reducer/module.jsx +0 -43
- package/src/style/.sass-lint.yml +0 -84
- package/src/style/.stylelintrc.json +0 -161
- package/src/style/_fancy-text.scss +0 -37
- package/src/style/_fix_bootstrap_placeholder_color.scss +0 -14
- package/src/style/_header-company.scss +0 -69
- package/src/style/_inputs.scss +0 -12
- package/src/style/_minimal.scss +0 -31
- package/src/style/_navigation.scss +0 -24
- package/src/style/_others.scss +0 -79
- package/src/style/index.scss +0 -7
- package/src/style/sidebar/_animations.scss +0 -21
- package/src/style/sidebar/_dark-theme.scss +0 -77
- package/src/style/sidebar/_scroll.scss +0 -37
- package/src/style/sidebar/_structure.scss +0 -299
- package/src/style/sidebar.scss +0 -4
- package/src/types.js +0 -31
- package/src/utility/calendar.js +0 -39
- package/src/utility/date.js +0 -100
- package/src/utility/index.js +0 -12
- package/src/utility/language.js +0 -17
- package/src/utility/mql.js +0 -3
- package/src/utility/normalize-test.js +0 -58
- package/src/utility/normalize.js +0 -119
- package/src/utility/numbers.js +0 -87
- package/src/utility/numeric.js +0 -114
- package/src/utility/others.jsx +0 -160
- package/src/utility/strings-test.js +0 -136
- package/src/utility/strings.js +0 -80
- package/src/utility/validation/common.js +0 -360
- package/src/utility/validation/index.js +0 -70
- package/src/utility/validation/specific.js +0 -9
- package/src/utility/validation/validate/bank-test.js +0 -129
- package/src/utility/validation/validate/bank.js +0 -176
- package/src/utility/validation/validate/cif-test.js +0 -105
- package/src/utility/validation/validate/cif.js +0 -44
- package/src/utility/validation/validate/cnp-test.js +0 -216
- package/src/utility/validation/validate/cnp.js +0 -261
- package/src/utility/validation/validate/email-test.js +0 -36
- package/src/utility/validation/validate/email.js +0 -6
- package/src/utility/validation/validate/index.js +0 -7
- package/webpack.config.js +0 -90
- package/x25.wiki/Account.md +0 -41
- package/x25.wiki/Company.md +0 -39
- package/x25.wiki/Header.md +0 -21
- package/x25.wiki/Home.md +0 -1
- package/x25.wiki/Inputs.md +0 -33
- package/x25.wiki/Messages.md +0 -27
- 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;
|
package/src/Payment/actions.jsx
DELETED
|
@@ -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
|
-
);
|
package/src/Payment/index.jsx
DELETED
|
@@ -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);
|
package/src/Payment/request.js
DELETED
|
@@ -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
|
-
);
|
package/src/Payment/types.js
DELETED
|
@@ -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;
|
package/src/Payment/util.jsx
DELETED
|
@@ -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
|
-
};
|
package/src/Payment/validate.js
DELETED
|
@@ -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;
|