@payyo/ptp-js 0.2.1 → 0.3.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/README.doc.md +7 -3
- package/package.json +1 -1
- package/src/form/index.js +4 -1
package/README.doc.md
CHANGED
|
@@ -51,14 +51,16 @@ data (CHD). To have a fully functional application please make sure:
|
|
|
51
51
|
|
|
52
52
|
## CI/CD
|
|
53
53
|
|
|
54
|
-
CI
|
|
54
|
+
The project CI/DC is AWS Code Tools. See CI configuration in `buildspec.yml` and `buildspec-npm.yml`.
|
|
55
|
+
See details in [Deployment](#deployment) and [NPM package publishing](#npm-package-publishing) sections.
|
|
55
56
|
|
|
56
57
|
## Deployment
|
|
57
58
|
|
|
58
59
|
### Field component
|
|
59
60
|
|
|
60
|
-
Each push to the repository produces a build which can be deployed to
|
|
61
|
-
|
|
61
|
+
Each push to the repository produces a build which can be deployed to with AWS Code Tools. The `fielld` component is
|
|
62
|
+
deployed to AWS S3 and distributed with AWS CloudFront. The client part is published to npm registry.
|
|
63
|
+
See [NPM package publishing](#npm-package-publishing) section for more details.
|
|
62
64
|
|
|
63
65
|
### Form component
|
|
64
66
|
|
|
@@ -67,6 +69,8 @@ as well as other integrators.
|
|
|
67
69
|
|
|
68
70
|
## NPM package publishing
|
|
69
71
|
|
|
72
|
+
> ⚠ **Note**: Before publishing the package ensure that the package version is updated in `package.json`.
|
|
73
|
+
|
|
70
74
|
To make the library available to the public and used in other Payyo projects and other user you need to publish it to NPM.
|
|
71
75
|
We have the NPM account registered to `developers@payyo.ch` email and organization `payyo` defined there.
|
|
72
76
|
|
package/package.json
CHANGED
package/src/form/index.js
CHANGED
|
@@ -39,6 +39,7 @@ module.exports = function (config) {
|
|
|
39
39
|
fieldName: fieldName,
|
|
40
40
|
iFrameName: 'ptp-field-iframe-' + formId + '-' + fieldName,
|
|
41
41
|
container: fieldContainer,
|
|
42
|
+
title: field.title || '',
|
|
42
43
|
placeholder: field.placeholder || '',
|
|
43
44
|
inputType: field.inputType || 'text',
|
|
44
45
|
isReady: false
|
|
@@ -60,11 +61,13 @@ module.exports = function (config) {
|
|
|
60
61
|
attributes = {
|
|
61
62
|
id: iFrameName,
|
|
62
63
|
name: iFrameName,
|
|
64
|
+
title: field.title,
|
|
63
65
|
class: iFrameName,
|
|
64
66
|
src: config.iframeUri + '?' + (new URLSearchParams({
|
|
65
67
|
form_id: formId,
|
|
66
68
|
field_name: field.fieldName,
|
|
67
69
|
field_names: fieldNames,
|
|
70
|
+
title: field.title,
|
|
68
71
|
placeholder: field.placeholder,
|
|
69
72
|
input_type: field.inputType,
|
|
70
73
|
debug: config.debug ? '1' : '0',
|
|
@@ -220,7 +223,7 @@ module.exports = function (config) {
|
|
|
220
223
|
function checkFocus() {
|
|
221
224
|
for (let [, field] of Object.entries(fields)) {
|
|
222
225
|
const iframe = window.frames[field.iFrameName];
|
|
223
|
-
if (
|
|
226
|
+
if (iframe) {
|
|
224
227
|
iframe.postMessage({'type': 'checkFocus'}, '*');
|
|
225
228
|
}
|
|
226
229
|
}
|