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,261 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
/* eslint-disable no-magic-numbers, max-statements */
|
|
3
|
-
|
|
4
|
-
export const isValidCNP = (rawValue : string) : boolean => {
|
|
5
|
-
|
|
6
|
-
type CNP = Array<number>;
|
|
7
|
-
|
|
8
|
-
type PositionPropTypes = {
|
|
9
|
-
[key: string]: number;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const decimalSystem = 10,
|
|
13
|
-
position : PositionPropTypes = {
|
|
14
|
-
yearMillenium : 0,
|
|
15
|
-
sex : 0,
|
|
16
|
-
|
|
17
|
-
yearDecades : 1,
|
|
18
|
-
yearUnits : 2,
|
|
19
|
-
|
|
20
|
-
monthDecimals : 3,
|
|
21
|
-
monthUnits : 4,
|
|
22
|
-
|
|
23
|
-
dayDecimals : 5,
|
|
24
|
-
dayUnits : 6,
|
|
25
|
-
|
|
26
|
-
countyDecimals : 7,
|
|
27
|
-
countyUnits : 8,
|
|
28
|
-
|
|
29
|
-
numberHundreds : 9,
|
|
30
|
-
numberDecimals : 10,
|
|
31
|
-
numberUnits : 11,
|
|
32
|
-
|
|
33
|
-
controlDigit: 12,
|
|
34
|
-
},
|
|
35
|
-
getCNP = (raw : string) : CNP => {
|
|
36
|
-
|
|
37
|
-
let hashResult = 0;
|
|
38
|
-
|
|
39
|
-
const hashTable = [
|
|
40
|
-
2,
|
|
41
|
-
7,
|
|
42
|
-
9,
|
|
43
|
-
1,
|
|
44
|
-
4,
|
|
45
|
-
6,
|
|
46
|
-
3,
|
|
47
|
-
5,
|
|
48
|
-
8,
|
|
49
|
-
2,
|
|
50
|
-
7,
|
|
51
|
-
9,
|
|
52
|
-
],
|
|
53
|
-
normalLength = 13,
|
|
54
|
-
cnp = [];
|
|
55
|
-
|
|
56
|
-
const reduceHash = (rawHash : number) : number => {
|
|
57
|
-
const
|
|
58
|
-
nrOfDigits = 11,
|
|
59
|
-
reduced = parseInt(rawHash % nrOfDigits,
|
|
60
|
-
decimalSystem);
|
|
61
|
-
|
|
62
|
-
if (reduced === 10) {
|
|
63
|
-
return 1;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return reduced;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
if (raw.length !== normalLength) {
|
|
70
|
-
throw new Error(`The length [actual:${raw.length}]
|
|
71
|
-
should be ${normalLength} characters`);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (raw[0] === "0") {
|
|
75
|
-
throw new Error("The sex can not be 0");
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const controlDigit = parseInt(
|
|
79
|
-
raw.charAt(position.controlDigit),
|
|
80
|
-
decimalSystem,
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
if (isNaN(controlDigit)) {
|
|
84
|
-
throw new Error("The control digit should be number");
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
for (let index = 0; index < 12; index += 1) {
|
|
88
|
-
|
|
89
|
-
const rawChar = raw.charAt(index),
|
|
90
|
-
parsedValue = parseInt(rawChar,
|
|
91
|
-
decimalSystem),
|
|
92
|
-
correspondingHashNumber = hashTable[index];
|
|
93
|
-
|
|
94
|
-
if (isNaN(parsedValue)) {
|
|
95
|
-
throw new Error(`The char at position ${index} should be numeric`);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
cnp[index] = parsedValue;
|
|
99
|
-
hashResult += (parsedValue * correspondingHashNumber);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (controlDigit !== reduceHash(hashResult)) {
|
|
103
|
-
throw new Error(`
|
|
104
|
-
The control digit is not good
|
|
105
|
-
[${controlDigit} === ${reduceHash(hashResult)}]
|
|
106
|
-
`);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
return cnp;
|
|
110
|
-
},
|
|
111
|
-
validate = (cnp : CNP) => {
|
|
112
|
-
const getCNPDigit = (currentPosition : number) : number => cnp[currentPosition],
|
|
113
|
-
isValidDate = () => {
|
|
114
|
-
const getYear = () : number => {
|
|
115
|
-
const computeYear = () : number => {
|
|
116
|
-
const {
|
|
117
|
-
yearMillenium,
|
|
118
|
-
yearDecades,
|
|
119
|
-
yearUnits,
|
|
120
|
-
} = position;
|
|
121
|
-
|
|
122
|
-
let year = (
|
|
123
|
-
(getCNPDigit(yearDecades) * 10) +
|
|
124
|
-
getCNPDigit(yearUnits)
|
|
125
|
-
);
|
|
126
|
-
|
|
127
|
-
switch (getCNPDigit(yearMillenium)) {
|
|
128
|
-
case 1:
|
|
129
|
-
case 2:
|
|
130
|
-
year += 1900;
|
|
131
|
-
break;
|
|
132
|
-
case 3:
|
|
133
|
-
case 4:
|
|
134
|
-
year += 1800;
|
|
135
|
-
break;
|
|
136
|
-
case 5:
|
|
137
|
-
case 6:
|
|
138
|
-
year += 2000;
|
|
139
|
-
break;
|
|
140
|
-
|
|
141
|
-
// 7,8,9
|
|
142
|
-
default: {
|
|
143
|
-
year += 2000;
|
|
144
|
-
|
|
145
|
-
const today : any = new Date(),
|
|
146
|
-
tempYear = parseInt(today.getYear(),
|
|
147
|
-
10) - 14;
|
|
148
|
-
|
|
149
|
-
if (year > tempYear) {
|
|
150
|
-
year -= 100;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
break;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
return year;
|
|
157
|
-
},
|
|
158
|
-
year : number = computeYear();
|
|
159
|
-
|
|
160
|
-
if (year < 1800 || year > 2099) {
|
|
161
|
-
throw new Error(`
|
|
162
|
-
Year [actual: ${String(year)}] is not valid.
|
|
163
|
-
It should be between 1800 and 2099
|
|
164
|
-
`);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
return year;
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
const year : number = getYear();
|
|
171
|
-
|
|
172
|
-
const {
|
|
173
|
-
monthDecimals,
|
|
174
|
-
monthUnits,
|
|
175
|
-
dayDecimals,
|
|
176
|
-
dayUnits,
|
|
177
|
-
} = position,
|
|
178
|
-
month = (
|
|
179
|
-
(getCNPDigit(monthDecimals) * 10) +
|
|
180
|
-
getCNPDigit(monthUnits)
|
|
181
|
-
),
|
|
182
|
-
day = (
|
|
183
|
-
(getCNPDigit(dayDecimals) * 10) +
|
|
184
|
-
getCNPDigit(dayUnits)
|
|
185
|
-
),
|
|
186
|
-
// js months are starting from 0 -> 11
|
|
187
|
-
jsMonth = month - 1,
|
|
188
|
-
date = new Date(year,
|
|
189
|
-
jsMonth,
|
|
190
|
-
day,
|
|
191
|
-
0,
|
|
192
|
-
0,
|
|
193
|
-
0,
|
|
194
|
-
0);
|
|
195
|
-
|
|
196
|
-
if (
|
|
197
|
-
(date.getFullYear() !== year) ||
|
|
198
|
-
(date.getMonth() !== jsMonth) ||
|
|
199
|
-
(date.getDate() !== day)
|
|
200
|
-
) {
|
|
201
|
-
throw new Error(`
|
|
202
|
-
The given date
|
|
203
|
-
[
|
|
204
|
-
year -> ${String(year)}
|
|
205
|
-
month -> ${String(month)}
|
|
206
|
-
day -> ${String(day)}
|
|
207
|
-
]`);
|
|
208
|
-
}
|
|
209
|
-
},
|
|
210
|
-
isValidCounty = () => {
|
|
211
|
-
const {
|
|
212
|
-
countyDecimals,
|
|
213
|
-
countyUnits,
|
|
214
|
-
} = position,
|
|
215
|
-
lowerLimit = 1,
|
|
216
|
-
upperLimit = 52,
|
|
217
|
-
code = (
|
|
218
|
-
(getCNPDigit(countyDecimals) * 10) +
|
|
219
|
-
getCNPDigit(countyUnits)
|
|
220
|
-
);
|
|
221
|
-
|
|
222
|
-
if (
|
|
223
|
-
code < lowerLimit ||
|
|
224
|
-
code > upperLimit
|
|
225
|
-
) {
|
|
226
|
-
throw new Error(`
|
|
227
|
-
The country code is invalid [actual: ${code}],
|
|
228
|
-
should be between: ${lowerLimit} <= ${code} >= ${upperLimit}
|
|
229
|
-
`);
|
|
230
|
-
}
|
|
231
|
-
},
|
|
232
|
-
isValidNumber = () => {
|
|
233
|
-
const {
|
|
234
|
-
numberHundreds,
|
|
235
|
-
numberDecimals,
|
|
236
|
-
numberUnits,
|
|
237
|
-
} = position,
|
|
238
|
-
number = (
|
|
239
|
-
(getCNPDigit(numberHundreds) * 100) +
|
|
240
|
-
(getCNPDigit(numberDecimals) * 10) +
|
|
241
|
-
getCNPDigit(numberUnits)
|
|
242
|
-
);
|
|
243
|
-
|
|
244
|
-
if (number === 0) {
|
|
245
|
-
throw new Error("The number should not be 0");
|
|
246
|
-
}
|
|
247
|
-
};
|
|
248
|
-
|
|
249
|
-
isValidDate();
|
|
250
|
-
isValidCounty();
|
|
251
|
-
isValidNumber();
|
|
252
|
-
};
|
|
253
|
-
|
|
254
|
-
try {
|
|
255
|
-
validate(getCNP(rawValue));
|
|
256
|
-
|
|
257
|
-
return true;
|
|
258
|
-
} catch (error) {
|
|
259
|
-
return false;
|
|
260
|
-
}
|
|
261
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { isValidEmail } from "./email";
|
|
2
|
-
|
|
3
|
-
const valid = true,
|
|
4
|
-
notValid = false;
|
|
5
|
-
|
|
6
|
-
describe("given an email without @ [email]",
|
|
7
|
-
() => {
|
|
8
|
-
it("should not be valid",
|
|
9
|
-
() => {
|
|
10
|
-
expect(isValidEmail("email")).toBe(notValid);
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
describe("given an email without the user [email@]",
|
|
15
|
-
() => {
|
|
16
|
-
it("should not be valid",
|
|
17
|
-
() => {
|
|
18
|
-
expect(isValidEmail("email@")).toBe(notValid);
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
describe("given an email without domain [email@email]",
|
|
23
|
-
() => {
|
|
24
|
-
it("should not be valid",
|
|
25
|
-
() => {
|
|
26
|
-
expect(isValidEmail("email@email")).toBe(notValid);
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
describe("given a good email (email@email.ro)",
|
|
31
|
-
() => {
|
|
32
|
-
it("should be valid",
|
|
33
|
-
() => {
|
|
34
|
-
expect(isValidEmail("email@email.ro")).toBe(valid);
|
|
35
|
-
});
|
|
36
|
-
});
|
package/webpack.config.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
var webpack = require('webpack')
|
|
4
|
-
var env = process.env.NODE_ENV
|
|
5
|
-
|
|
6
|
-
var config = {
|
|
7
|
-
module: {
|
|
8
|
-
loaders: [
|
|
9
|
-
{
|
|
10
|
-
test : /\.jsx?$/u,
|
|
11
|
-
use : ["babel-loader"],
|
|
12
|
-
exclude: /node_modules/
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
test : /\.scss$/u,
|
|
16
|
-
use : [
|
|
17
|
-
"style-loader",
|
|
18
|
-
"css-loader",
|
|
19
|
-
"sass-loader",
|
|
20
|
-
],
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
test : /\.css$/u,
|
|
24
|
-
use : [
|
|
25
|
-
"style-loader",
|
|
26
|
-
"css-loader",
|
|
27
|
-
],
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
test : /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/u,
|
|
31
|
-
use : "url-loader?limit=10000&minetype=application/font-woff",
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
test : /\.jpe?g$|\.gif$|\.png$/u,
|
|
35
|
-
use : "url-loader",
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
test : /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/u,
|
|
39
|
-
use : "file-loader",
|
|
40
|
-
}
|
|
41
|
-
]
|
|
42
|
-
},
|
|
43
|
-
resolve: {
|
|
44
|
-
extensions: [
|
|
45
|
-
".js",
|
|
46
|
-
".jsx",
|
|
47
|
-
],
|
|
48
|
-
modules: [
|
|
49
|
-
"client",
|
|
50
|
-
"node_modules",
|
|
51
|
-
],
|
|
52
|
-
},
|
|
53
|
-
output: {
|
|
54
|
-
library: 'ReactPaginator',
|
|
55
|
-
libraryTarget: 'umd'
|
|
56
|
-
},
|
|
57
|
-
plugins: [
|
|
58
|
-
new webpack.DefinePlugin({
|
|
59
|
-
"process.env": {
|
|
60
|
-
"NODE_ENV": JSON.stringify("development"),
|
|
61
|
-
},
|
|
62
|
-
}),
|
|
63
|
-
new webpack.DefinePlugin({
|
|
64
|
-
"process.env": {
|
|
65
|
-
"BABEL_ENV": JSON.stringify("developmentTime"),
|
|
66
|
-
},
|
|
67
|
-
})
|
|
68
|
-
]
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (env === 'production') {
|
|
72
|
-
config.plugins.push(
|
|
73
|
-
new webpack.DefinePlugin({
|
|
74
|
-
"process.env": {
|
|
75
|
-
"NODE_ENV": JSON.stringify("production"),
|
|
76
|
-
},
|
|
77
|
-
}),
|
|
78
|
-
new webpack.DefinePlugin({
|
|
79
|
-
"process.env": {
|
|
80
|
-
"BABEL_ENV": JSON.stringify("production"),
|
|
81
|
-
},
|
|
82
|
-
}),
|
|
83
|
-
new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /ro/),
|
|
84
|
-
new webpack.optimize.UglifyJsPlugin({
|
|
85
|
-
mangle: false,
|
|
86
|
-
}),
|
|
87
|
-
)
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
module.exports = config
|
package/x25.wiki/Account.md
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
Contains all information about the current account.
|
|
2
|
-
|
|
3
|
-
The module `x25/Account` has:
|
|
4
|
-
- `<LoadAccount appName="auto" />`
|
|
5
|
-
- `accountSelectors`
|
|
6
|
-
- `accountReducer`
|
|
7
|
-
|
|
8
|
-
# LoadAccount
|
|
9
|
-
|
|
10
|
-
It loads the account. The `appName` is the application for which is done the init-session
|
|
11
|
-
|
|
12
|
-
Example:
|
|
13
|
-
```jsx
|
|
14
|
-
|
|
15
|
-
import { LoadAccount } from "x25/Account";
|
|
16
|
-
|
|
17
|
-
<LoadAccount appName="auto">
|
|
18
|
-
<div />
|
|
19
|
-
</LoadAccount>
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
It does not display `<div />` until the account is loaded
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
# accountSelectors
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
```jsx
|
|
29
|
-
export const selectors = {
|
|
30
|
-
getCurrentAccount,
|
|
31
|
-
getCurrentAccountIsFetching,
|
|
32
|
-
getCurrentAccountShouldFetch,
|
|
33
|
-
getCurrentAccountIsFetched,
|
|
34
|
-
getCurrentAccountHasError,
|
|
35
|
-
|
|
36
|
-
getIsCurrentAccountAdministrator,
|
|
37
|
-
|
|
38
|
-
getCurrentAccountCompanies,
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
```
|
package/x25.wiki/Company.md
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
Contains all information about the current company.
|
|
2
|
-
|
|
3
|
-
The module `x25/Company` has:
|
|
4
|
-
- `<LoadCompany />`
|
|
5
|
-
- `companySelectors`
|
|
6
|
-
- `companyReducer`
|
|
7
|
-
|
|
8
|
-
# LoadCompany
|
|
9
|
-
|
|
10
|
-
It loads the company
|
|
11
|
-
|
|
12
|
-
Example:
|
|
13
|
-
```jsx
|
|
14
|
-
|
|
15
|
-
import { LoadCompany } from "x25/Company";
|
|
16
|
-
|
|
17
|
-
<LoadCompany>
|
|
18
|
-
<div />
|
|
19
|
-
</LoadCompany>
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
It does not display `<div />` until the company is loaded
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
# companySelectors
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
```jsx
|
|
29
|
-
export const selectors = {
|
|
30
|
-
getCurrentCompany,
|
|
31
|
-
getCurrentCompanyIsFetched,
|
|
32
|
-
getCurrentCompanyIsFetching,
|
|
33
|
-
getCurrentCompanyHasError,
|
|
34
|
-
getCurrentCompanyShouldFetch,
|
|
35
|
-
getCompanyModules,
|
|
36
|
-
getCurrentCompanyID,
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
```
|
package/x25.wiki/Header.md
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The module `x25/Header` exports:
|
|
2
|
-
- `<SideworkLogo />`
|
|
3
|
-
- `<Header ...props />`
|
|
4
|
-
|
|
5
|
-
## `<Header ...props />`
|
|
6
|
-
|
|
7
|
-
```jsx
|
|
8
|
-
type HeaderPropTypes = {
|
|
9
|
-
brand : string;
|
|
10
|
-
accountName : string;
|
|
11
|
-
isAdmin: bool;
|
|
12
|
-
sidebarDocked: boolean;
|
|
13
|
-
ui: {
|
|
14
|
-
showNavbar: boolean;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
toggleNavbar: () => void;
|
|
18
|
-
|
|
19
|
-
showSidebar: () => void;
|
|
20
|
-
};
|
|
21
|
-
```
|
package/x25.wiki/Home.md
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Welcome to the x25 wiki!
|
package/x25.wiki/Inputs.md
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
The module `x25/Inputs` exports:
|
|
2
|
-
|
|
3
|
-
```jsx
|
|
4
|
-
export {
|
|
5
|
-
SimpleInput,
|
|
6
|
-
DelayInputChange,
|
|
7
|
-
FocusTemplate,
|
|
8
|
-
InputTemplate,
|
|
9
|
-
DateTemplate,
|
|
10
|
-
DateInput,
|
|
11
|
-
NumericInput,
|
|
12
|
-
NumericTemplate,
|
|
13
|
-
TextareaTemplate,
|
|
14
|
-
SimpleTextarea,
|
|
15
|
-
CaptchaBox,
|
|
16
|
-
LabelTemplate,
|
|
17
|
-
Tooltip,
|
|
18
|
-
|
|
19
|
-
// business
|
|
20
|
-
EmailInput,
|
|
21
|
-
PhoneInput,
|
|
22
|
-
BankAccountInput,
|
|
23
|
-
BankNameField,
|
|
24
|
-
CifFieldContainer,
|
|
25
|
-
|
|
26
|
-
// selects
|
|
27
|
-
SelectMonth,
|
|
28
|
-
SelectYear,
|
|
29
|
-
SelectCounty,
|
|
30
|
-
CustomSelect,
|
|
31
|
-
SimpleCustomSelect,
|
|
32
|
-
};
|
|
33
|
-
```
|
package/x25.wiki/Messages.md
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
The module `x25/Messages` has:
|
|
3
|
-
- `<LoadingMessage ...props />`
|
|
4
|
-
- `<ErrorMessage ...props />`
|
|
5
|
-
- `<LargeErrorMessage ...props />`
|
|
6
|
-
|
|
7
|
-
## `<LoadingMessage ...props />`
|
|
8
|
-
|
|
9
|
-
```jsx
|
|
10
|
-
type LoadingMessagePropTypes = {
|
|
11
|
-
className? : string;
|
|
12
|
-
message? : string;
|
|
13
|
-
sm?: bool;
|
|
14
|
-
};
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## `<LargeErrorMessage ...props />`, `<ErrorMessage ...props />`
|
|
18
|
-
|
|
19
|
-
```jsx
|
|
20
|
-
type ErrorMessageProps = {
|
|
21
|
-
message: string;
|
|
22
|
-
details?: string;
|
|
23
|
-
itemNotFound?: boolean;
|
|
24
|
-
|
|
25
|
-
onRetry?: () => void;
|
|
26
|
-
};
|
|
27
|
-
```
|
package/x25.wiki/Payment.md
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
Use to create payments
|
|
2
|
-
|
|
3
|
-
# Example
|
|
4
|
-
|
|
5
|
-
```jsx
|
|
6
|
-
<Payment application="smsalert">
|
|
7
|
-
<PayBoxForm
|
|
8
|
-
credits={creditsPerMonth}
|
|
9
|
-
current={formValues}
|
|
10
|
-
/>
|
|
11
|
-
</Payment>
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
Notes:
|
|
15
|
-
1. It accepts only one child
|
|
16
|
-
2. It inserts the following props into its children:
|
|
17
|
-
- `companyID` - number
|
|
18
|
-
- `createPayment` - function to call to create the payment request
|
|
19
|
-
- `payUsingBankTransfer`
|
|
20
|
-
|
|
21
|
-
```jsx
|
|
22
|
-
type Options = Immutable.Map({
|
|
23
|
-
...any other data
|
|
24
|
-
companyID: number;
|
|
25
|
-
amount: number;
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
type payUsingBankTransfer = (application: string, options : Options) => () => void;
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
# Full example
|
|
33
|
-
|
|
34
|
-
```jsx
|
|
35
|
-
|
|
36
|
-
<Payment application="smsalert">
|
|
37
|
-
<PayBoxForm
|
|
38
|
-
credits={creditsPerMonth}
|
|
39
|
-
current={formValues}
|
|
40
|
-
/>
|
|
41
|
-
</Payment>
|
|
42
|
-
```
|