@financial-times/n-conversion-forms 32.9.0 → 32.10.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/.toolkitstate/ci.json
CHANGED
package/components/position.jsx
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import {
|
|
5
|
-
const B2CPositions = demographics.positions.positions;
|
|
6
|
-
const B2BPositions = b2b.demographics.positions.positions;
|
|
4
|
+
import { demographics } from 'n-common-static-data';
|
|
7
5
|
|
|
8
6
|
export function Position({
|
|
9
7
|
value,
|
|
@@ -12,8 +10,7 @@ export function Position({
|
|
|
12
10
|
fieldId = 'positionField',
|
|
13
11
|
selectId = 'position',
|
|
14
12
|
selectName = 'position',
|
|
15
|
-
|
|
16
|
-
options = isB2B ? B2BPositions : B2CPositions,
|
|
13
|
+
options = demographics.positions.positions,
|
|
17
14
|
isRequired = true,
|
|
18
15
|
fieldLabel = 'What’s your job position?',
|
|
19
16
|
}) {
|
|
@@ -74,7 +71,6 @@ Position.propTypes = {
|
|
|
74
71
|
fieldId: PropTypes.string,
|
|
75
72
|
selectId: PropTypes.string,
|
|
76
73
|
selectName: PropTypes.string,
|
|
77
|
-
isB2B: PropTypes.bool,
|
|
78
74
|
options: PropTypes.arrayOf(
|
|
79
75
|
PropTypes.shape({
|
|
80
76
|
code: PropTypes.string,
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import {
|
|
5
|
-
const B2CResponsibilities = demographics.responsibilities.responsibilities;
|
|
6
|
-
const B2BResponsibilities = b2b.demographics.responsibilities.responsibilities;
|
|
4
|
+
import { demographics } from 'n-common-static-data';
|
|
7
5
|
|
|
8
6
|
export function Responsibility({
|
|
9
7
|
value,
|
|
@@ -13,8 +11,7 @@ export function Responsibility({
|
|
|
13
11
|
fieldId = 'responsibilityField',
|
|
14
12
|
selectId = 'responsibility',
|
|
15
13
|
selectName = 'responsibility',
|
|
16
|
-
|
|
17
|
-
options = isB2B ? B2BResponsibilities : B2CResponsibilities,
|
|
14
|
+
options = demographics.responsibilities.responsibilities,
|
|
18
15
|
fieldLabel = 'Which best describes your job responsibility?',
|
|
19
16
|
}) {
|
|
20
17
|
const inputWrapperClassName = classNames([
|
|
@@ -76,7 +73,6 @@ Responsibility.propTypes = {
|
|
|
76
73
|
fieldId: PropTypes.string,
|
|
77
74
|
selectId: PropTypes.string,
|
|
78
75
|
selectName: PropTypes.string,
|
|
79
|
-
isB2B: PropTypes.bool,
|
|
80
76
|
options: PropTypes.arrayOf(
|
|
81
77
|
PropTypes.shape({
|
|
82
78
|
code: PropTypes.string,
|
|
@@ -74,14 +74,4 @@ describe('Responsibility', () => {
|
|
|
74
74
|
component.find('.o-forms-title.o-forms-field--optional').length
|
|
75
75
|
).toEqual(1);
|
|
76
76
|
});
|
|
77
|
-
|
|
78
|
-
it('defaults to B2B options if isB2B is true', () => {
|
|
79
|
-
const props = { isB2B: true };
|
|
80
|
-
const component = mount(Responsibility(props));
|
|
81
|
-
|
|
82
|
-
// Look for an option which is only present in the default B2B data set and not in the B2C one.
|
|
83
|
-
const optionValue = component.find('option').at(1).instance().value;
|
|
84
|
-
|
|
85
|
-
expect(optionValue).toBe('ACC');
|
|
86
|
-
});
|
|
87
77
|
});
|
package/dist/position.jsx
CHANGED
|
@@ -9,8 +9,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
var _nCommonStaticData = require("n-common-static-data");
|
|
12
|
-
var B2CPositions = _nCommonStaticData.demographics.positions.positions;
|
|
13
|
-
var B2BPositions = _nCommonStaticData.b2b.demographics.positions.positions;
|
|
14
12
|
function Position(_ref) {
|
|
15
13
|
var value = _ref.value,
|
|
16
14
|
_ref$isDisabled = _ref.isDisabled,
|
|
@@ -23,10 +21,8 @@ function Position(_ref) {
|
|
|
23
21
|
selectId = _ref$selectId === void 0 ? 'position' : _ref$selectId,
|
|
24
22
|
_ref$selectName = _ref.selectName,
|
|
25
23
|
selectName = _ref$selectName === void 0 ? 'position' : _ref$selectName,
|
|
26
|
-
_ref$isB2B = _ref.isB2B,
|
|
27
|
-
isB2B = _ref$isB2B === void 0 ? false : _ref$isB2B,
|
|
28
24
|
_ref$options = _ref.options,
|
|
29
|
-
options = _ref$options === void 0 ?
|
|
25
|
+
options = _ref$options === void 0 ? _nCommonStaticData.demographics.positions.positions : _ref$options,
|
|
30
26
|
_ref$isRequired = _ref.isRequired,
|
|
31
27
|
isRequired = _ref$isRequired === void 0 ? true : _ref$isRequired,
|
|
32
28
|
_ref$fieldLabel = _ref.fieldLabel,
|
|
@@ -79,7 +75,6 @@ Position.propTypes = {
|
|
|
79
75
|
fieldId: _propTypes["default"].string,
|
|
80
76
|
selectId: _propTypes["default"].string,
|
|
81
77
|
selectName: _propTypes["default"].string,
|
|
82
|
-
isB2B: _propTypes["default"].bool,
|
|
83
78
|
options: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
84
79
|
code: _propTypes["default"].string,
|
|
85
80
|
description: _propTypes["default"].string
|
package/dist/responsibility.jsx
CHANGED
|
@@ -9,8 +9,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
var _nCommonStaticData = require("n-common-static-data");
|
|
12
|
-
var B2CResponsibilities = _nCommonStaticData.demographics.responsibilities.responsibilities;
|
|
13
|
-
var B2BResponsibilities = _nCommonStaticData.b2b.demographics.responsibilities.responsibilities;
|
|
14
12
|
function Responsibility(_ref) {
|
|
15
13
|
var value = _ref.value,
|
|
16
14
|
_ref$isDisabled = _ref.isDisabled,
|
|
@@ -25,10 +23,8 @@ function Responsibility(_ref) {
|
|
|
25
23
|
selectId = _ref$selectId === void 0 ? 'responsibility' : _ref$selectId,
|
|
26
24
|
_ref$selectName = _ref.selectName,
|
|
27
25
|
selectName = _ref$selectName === void 0 ? 'responsibility' : _ref$selectName,
|
|
28
|
-
_ref$isB2B = _ref.isB2B,
|
|
29
|
-
isB2B = _ref$isB2B === void 0 ? false : _ref$isB2B,
|
|
30
26
|
_ref$options = _ref.options,
|
|
31
|
-
options = _ref$options === void 0 ?
|
|
27
|
+
options = _ref$options === void 0 ? _nCommonStaticData.demographics.responsibilities.responsibilities : _ref$options,
|
|
32
28
|
_ref$fieldLabel = _ref.fieldLabel,
|
|
33
29
|
fieldLabel = _ref$fieldLabel === void 0 ? 'Which best describes your job responsibility?' : _ref$fieldLabel;
|
|
34
30
|
var inputWrapperClassName = (0, _classnames["default"])(['o-forms-input', 'o-forms-input--select', {
|
|
@@ -79,7 +75,6 @@ Responsibility.propTypes = {
|
|
|
79
75
|
fieldId: _propTypes["default"].string,
|
|
80
76
|
selectId: _propTypes["default"].string,
|
|
81
77
|
selectName: _propTypes["default"].string,
|
|
82
|
-
isB2B: _propTypes["default"].bool,
|
|
83
78
|
options: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
84
79
|
code: _propTypes["default"].string,
|
|
85
80
|
description: _propTypes["default"].string
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@financial-times/n-conversion-forms",
|
|
3
|
-
"version": "32.
|
|
3
|
+
"version": "32.10.0",
|
|
4
4
|
"description": "Containing jsx components and styles for forms included on Accounts and Acqusition apps (next-signup, next-profile, next-retention, etc).",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"classnames": "2.3.2",
|
|
31
31
|
"fetchres": "1.7.2",
|
|
32
32
|
"lodash.get": "4.4.2",
|
|
33
|
-
"n-common-static-data": "github:Financial-Times/n-common-static-data#v2.
|
|
33
|
+
"n-common-static-data": "github:Financial-Times/n-common-static-data#v2.4.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@babel/core": "^7.22.15",
|