@shipengine/elements 2.26.3 → 2.26.5
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/dist/cjs/components/cc-provider-logo/cc-provider-logo.cjs +2 -1
- package/dist/cjs/components/forms/wallet-form/wallet-schema.cjs +1 -1
- package/dist/cjs/package.json.cjs +1 -1
- package/dist/cjs/workflows/connect-external-carrier/components/custom-external-carrier-form/custom-form-fedex.cjs +11 -11
- package/dist/cjs/workflows/connect-external-carrier/connect-external-carrier.cjs +3 -63
- package/dist/esm/components/cc-provider-logo/cc-provider-logo.js +2 -1
- package/dist/esm/components/forms/wallet-form/wallet-schema.js +1 -1
- package/dist/esm/package.json.js +1 -1
- package/dist/esm/workflows/connect-external-carrier/components/custom-external-carrier-form/custom-form-fedex.js +11 -11
- package/dist/esm/workflows/connect-external-carrier/connect-external-carrier.js +3 -44
- package/dist/types/components/cc-provider-logo/cc-provider-logo.d.ts.map +1 -1
- package/dist/types/components/forms/wallet-form/wallet-schema.d.ts.map +1 -1
- package/dist/types/workflows/connect-external-carrier/connect-external-carrier.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -14,7 +14,7 @@ const CcProviderLogo = ({
|
|
|
14
14
|
height = 36
|
|
15
15
|
}) => {
|
|
16
16
|
const providerLogos = {
|
|
17
|
-
|
|
17
|
+
american_express: amex,
|
|
18
18
|
discover,
|
|
19
19
|
mastercard,
|
|
20
20
|
visa
|
|
@@ -25,6 +25,7 @@ const CcProviderLogo = ({
|
|
|
25
25
|
size: giger.IconSize.SIZE_LARGE
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
+
// TODO: LMNT-1810 - Add missing provider logos
|
|
28
29
|
const Logo = providerLogos[provider];
|
|
29
30
|
return jsxRuntime.jsx(Logo, {
|
|
30
31
|
height: height,
|
|
@@ -77,7 +77,7 @@ const creditCardSchema = zod.z.object({
|
|
|
77
77
|
expirationMonth: expirationMonth,
|
|
78
78
|
expirationYear: expirationYear,
|
|
79
79
|
name: creditCard.name,
|
|
80
|
-
provider: creditCardVendor === "american-express" ? "
|
|
80
|
+
provider: creditCardVendor === "american-express" ? "american_express" : creditCardVendor
|
|
81
81
|
};
|
|
82
82
|
});
|
|
83
83
|
const getWalletSchema = (emailRequirement, blackboxRequirement) => {
|
|
@@ -112,7 +112,7 @@ const supportedCountriesUK = [{
|
|
|
112
112
|
const fedexJsonSchema = isUK => ({
|
|
113
113
|
description: `You'll need an existing FedEx account to complete this form. If you don't have a FedEx account, please <a href="${newAccountHref}" target="_blank" rel="noopener noreferrer">click here to open one now!</a>`,
|
|
114
114
|
properties: {
|
|
115
|
-
|
|
115
|
+
account_number: {
|
|
116
116
|
maxLength: 50,
|
|
117
117
|
title: "FedEx Account No",
|
|
118
118
|
type: "string"
|
|
@@ -129,7 +129,7 @@ const fedexJsonSchema = isUK => ({
|
|
|
129
129
|
title: "Address Line 2",
|
|
130
130
|
type: "string"
|
|
131
131
|
},
|
|
132
|
-
|
|
132
|
+
agree_to_eula: {
|
|
133
133
|
title: "I agree to the End-User License Agreement",
|
|
134
134
|
type: "boolean"
|
|
135
135
|
},
|
|
@@ -143,7 +143,7 @@ const fedexJsonSchema = isUK => ({
|
|
|
143
143
|
title: "Company Name",
|
|
144
144
|
type: "string"
|
|
145
145
|
},
|
|
146
|
-
|
|
146
|
+
country_code: {
|
|
147
147
|
oneOf: isUK ? supportedCountriesUK : supportedCountries,
|
|
148
148
|
title: "Country",
|
|
149
149
|
type: "string"
|
|
@@ -153,13 +153,13 @@ const fedexJsonSchema = isUK => ({
|
|
|
153
153
|
title: "Email",
|
|
154
154
|
type: "string"
|
|
155
155
|
},
|
|
156
|
-
|
|
156
|
+
first_name: {
|
|
157
157
|
// TODO: Can we make firstname/lastname in the same row?
|
|
158
158
|
maxLength: 50,
|
|
159
159
|
title: "Contact First Name",
|
|
160
160
|
type: "string"
|
|
161
161
|
},
|
|
162
|
-
|
|
162
|
+
last_name: {
|
|
163
163
|
// TODO: Can we make firstname/lastname in the same row?
|
|
164
164
|
maxLength: 50,
|
|
165
165
|
title: "Contact Last Name",
|
|
@@ -174,7 +174,7 @@ const fedexJsonSchema = isUK => ({
|
|
|
174
174
|
title: "Phone #",
|
|
175
175
|
type: "string"
|
|
176
176
|
},
|
|
177
|
-
|
|
177
|
+
postal_code: {
|
|
178
178
|
// TODO: Can we make this reactive to country selection? Can we group State/Zip?
|
|
179
179
|
maxLength: 8,
|
|
180
180
|
title: "Zip/Postal Code",
|
|
@@ -187,16 +187,16 @@ const fedexJsonSchema = isUK => ({
|
|
|
187
187
|
type: "string"
|
|
188
188
|
}
|
|
189
189
|
},
|
|
190
|
-
required: ["
|
|
190
|
+
required: ["account_number", "first_name", "last_name", "email", "country_code", "address1", "city", "state", "postal_code", "phone", "nickname"],
|
|
191
191
|
title: "Connect Your FedEx Account",
|
|
192
192
|
type: "object"
|
|
193
193
|
});
|
|
194
194
|
const fedexUiSchema = {
|
|
195
|
-
|
|
195
|
+
account_number: {
|
|
196
196
|
"ui:autofocus": true,
|
|
197
197
|
"ui:emptyValue": ""
|
|
198
198
|
},
|
|
199
|
-
|
|
199
|
+
agree_to_eula: {
|
|
200
200
|
"ui:widget": "hidden"
|
|
201
201
|
},
|
|
202
202
|
email: {
|
|
@@ -209,7 +209,7 @@ const fedexUiSchema = {
|
|
|
209
209
|
inputType: "tel"
|
|
210
210
|
}
|
|
211
211
|
},
|
|
212
|
-
"ui:order": ["
|
|
212
|
+
"ui:order": ["account_number", "first_name", "last_name", "company", "email", "country_code", "address1", "address2", "city", "state", "postal_code", "phone", "agree_to_eula", "nickname"]
|
|
213
213
|
};
|
|
214
214
|
const CustomExternalCarrierFormFedex = ({
|
|
215
215
|
carrierName,
|
|
@@ -232,7 +232,7 @@ const CustomExternalCarrierFormFedex = ({
|
|
|
232
232
|
displayName: displayName,
|
|
233
233
|
iconUrl: iconUrl,
|
|
234
234
|
initialFormData: {
|
|
235
|
-
agreeToEula,
|
|
235
|
+
agree_to_eula: agreeToEula,
|
|
236
236
|
nickname: ""
|
|
237
237
|
},
|
|
238
238
|
isBeta: isBeta,
|
|
@@ -4,7 +4,6 @@ var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
|
4
4
|
var giger = require('@shipengine/giger');
|
|
5
5
|
var reactApi = require('@shipengine/react-api');
|
|
6
6
|
var reactQuery = require('@tanstack/react-query');
|
|
7
|
-
var humps = require('humps');
|
|
8
7
|
var React = require('react');
|
|
9
8
|
var reactI18next = require('react-i18next');
|
|
10
9
|
var customExternalCarrierForm = require('./components/custom-external-carrier-form/custom-external-carrier-form.cjs');
|
|
@@ -18,25 +17,6 @@ var spacer = require('../../components/spacer/spacer.cjs');
|
|
|
18
17
|
var buttonGroup = require('../../components/button-group/button-group.cjs');
|
|
19
18
|
var errorFallback = require('../../components/error-fallback/error-fallback.cjs');
|
|
20
19
|
|
|
21
|
-
function _interopNamespaceDefault(e) {
|
|
22
|
-
var n = Object.create(null);
|
|
23
|
-
if (e) {
|
|
24
|
-
Object.keys(e).forEach(function (k) {
|
|
25
|
-
if (k !== 'default') {
|
|
26
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
27
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
28
|
-
enumerable: true,
|
|
29
|
-
get: function () { return e[k]; }
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
n.default = e;
|
|
35
|
-
return Object.freeze(n);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
var humps__namespace = /*#__PURE__*/_interopNamespaceDefault(humps);
|
|
39
|
-
|
|
40
20
|
/**
|
|
41
21
|
* # ConnectExternalCarrier Component
|
|
42
22
|
*
|
|
@@ -113,24 +93,6 @@ const Component = ({
|
|
|
113
93
|
const formattedJsonSchema = React.useMemo(() => {
|
|
114
94
|
if (!jsonSchema) return {};
|
|
115
95
|
const jsonSchemaClone = JSON.parse(JSON.stringify(jsonSchema));
|
|
116
|
-
// if property has a ref key, map the property value to the value of the path
|
|
117
|
-
const mapRefPath = schema => {
|
|
118
|
-
const {
|
|
119
|
-
properties
|
|
120
|
-
} = schema;
|
|
121
|
-
if (!properties) return schema;
|
|
122
|
-
for (const key in properties) {
|
|
123
|
-
const property = properties[key];
|
|
124
|
-
if (property.$ref) {
|
|
125
|
-
const propKey = `${property.$ref}`.replace("#/", "");
|
|
126
|
-
const refPath = humps__namespace.camelize(propKey).split("/");
|
|
127
|
-
properties[key] = refPath.reduce((acc, path) => {
|
|
128
|
-
return acc === null || acc === void 0 ? void 0 : acc[path];
|
|
129
|
-
}, schema);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
return schema;
|
|
133
|
-
};
|
|
134
96
|
// add nickname to properties if it doesn't exist
|
|
135
97
|
const addNicknameProperty = schema => {
|
|
136
98
|
if (!(schema === null || schema === void 0 ? void 0 : schema.properties)) return schema;
|
|
@@ -147,27 +109,7 @@ const Component = ({
|
|
|
147
109
|
updatedSchema.properties = updatedProperties;
|
|
148
110
|
return updatedSchema;
|
|
149
111
|
};
|
|
150
|
-
const
|
|
151
|
-
if (!schema) return schema;
|
|
152
|
-
const updatedSchema = Object.assign({}, schema);
|
|
153
|
-
// camelize required fields, as casing varies between carriers
|
|
154
|
-
if (updatedSchema.required && Array.isArray(updatedSchema.required)) {
|
|
155
|
-
updatedSchema.required = updatedSchema.required.map(item => {
|
|
156
|
-
return typeof item === "string" ? humps__namespace.camelize(item) : item;
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
// camelize property keys
|
|
160
|
-
// fail safe to ensure schema properties and required array match in the event the camelizeKeys from shipengine/js-api isn't consistent
|
|
161
|
-
// TODO: Fix edge cases with camelizeKeys in js-api and remove this
|
|
162
|
-
if (updatedSchema.properties && typeof updatedSchema.properties === "object") {
|
|
163
|
-
updatedSchema.properties = Object.entries(updatedSchema.properties).reduce((acc, [key, value]) => {
|
|
164
|
-
acc[humps__namespace.camelize(key)] = value;
|
|
165
|
-
return acc;
|
|
166
|
-
}, {});
|
|
167
|
-
}
|
|
168
|
-
return updatedSchema;
|
|
169
|
-
};
|
|
170
|
-
const newJsonSchema = standardizeCasing(addNicknameProperty(mapRefPath(jsonSchemaClone)));
|
|
112
|
+
const newJsonSchema = addNicknameProperty(jsonSchemaClone);
|
|
171
113
|
return newJsonSchema;
|
|
172
114
|
}, [jsonSchema, hasNicknameProperty]);
|
|
173
115
|
const formattedUiSchema = React.useMemo(() => {
|
|
@@ -176,9 +118,7 @@ const Component = ({
|
|
|
176
118
|
const updatedUiSchema = Object.assign({}, uiSchemaClone);
|
|
177
119
|
// add nickname to ui:order and camelize the values to ensure consistency with jsonSchema properties and required array
|
|
178
120
|
if (!hasNicknameProperty && updatedUiSchema["ui:order"]) {
|
|
179
|
-
|
|
180
|
-
const camelizeUIOrderItem = item => typeof item === "string" ? humps__namespace.camelize(item) : item.map(i => humps__namespace.camelize(i));
|
|
181
|
-
updatedUiSchema["ui:order"] = [...updatedUiSchema["ui:order"], "nickname"].map(camelizeUIOrderItem);
|
|
121
|
+
updatedUiSchema["ui:order"] = [...updatedUiSchema["ui:order"], "nickname"];
|
|
182
122
|
}
|
|
183
123
|
return updatedUiSchema;
|
|
184
124
|
}, [uiSchema, hasNicknameProperty]);
|
|
@@ -196,7 +136,7 @@ const Component = ({
|
|
|
196
136
|
if (schemaLoading || carriersLoading || needsRefetch) return jsxRuntime.jsx(loader.Loader, {
|
|
197
137
|
message: t(selectedCarrier ? "loading.connectCarrierForm" : "loading.carriers")
|
|
198
138
|
});
|
|
199
|
-
if (schemaError) {
|
|
139
|
+
if (schemaError && selectedCarrier && !customExternalCarrierForm.hasCustomExternalCarrierConnectionForm(selectedCarrier)) {
|
|
200
140
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
201
141
|
children: [jsxRuntime.jsx(giger.InlineNotification, {
|
|
202
142
|
type: giger.NotificationType.ERROR,
|
|
@@ -12,7 +12,7 @@ const CcProviderLogo = ({
|
|
|
12
12
|
height = 36
|
|
13
13
|
}) => {
|
|
14
14
|
const providerLogos = {
|
|
15
|
-
|
|
15
|
+
american_express: SvgAmex,
|
|
16
16
|
discover: SvgDiscover,
|
|
17
17
|
mastercard: SvgMastercard,
|
|
18
18
|
visa: SvgVisa
|
|
@@ -23,6 +23,7 @@ const CcProviderLogo = ({
|
|
|
23
23
|
size: IconSize.SIZE_LARGE
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
+
// TODO: LMNT-1810 - Add missing provider logos
|
|
26
27
|
const Logo = providerLogos[provider];
|
|
27
28
|
return jsx(Logo, {
|
|
28
29
|
height: height,
|
|
@@ -75,7 +75,7 @@ const creditCardSchema = z.object({
|
|
|
75
75
|
expirationMonth: expirationMonth,
|
|
76
76
|
expirationYear: expirationYear,
|
|
77
77
|
name: creditCard.name,
|
|
78
|
-
provider: creditCardVendor === "american-express" ? "
|
|
78
|
+
provider: creditCardVendor === "american-express" ? "american_express" : creditCardVendor
|
|
79
79
|
};
|
|
80
80
|
});
|
|
81
81
|
const getWalletSchema = (emailRequirement, blackboxRequirement) => {
|
package/dist/esm/package.json.js
CHANGED
|
@@ -110,7 +110,7 @@ const supportedCountriesUK = [{
|
|
|
110
110
|
const fedexJsonSchema = isUK => ({
|
|
111
111
|
description: `You'll need an existing FedEx account to complete this form. If you don't have a FedEx account, please <a href="${newAccountHref}" target="_blank" rel="noopener noreferrer">click here to open one now!</a>`,
|
|
112
112
|
properties: {
|
|
113
|
-
|
|
113
|
+
account_number: {
|
|
114
114
|
maxLength: 50,
|
|
115
115
|
title: "FedEx Account No",
|
|
116
116
|
type: "string"
|
|
@@ -127,7 +127,7 @@ const fedexJsonSchema = isUK => ({
|
|
|
127
127
|
title: "Address Line 2",
|
|
128
128
|
type: "string"
|
|
129
129
|
},
|
|
130
|
-
|
|
130
|
+
agree_to_eula: {
|
|
131
131
|
title: "I agree to the End-User License Agreement",
|
|
132
132
|
type: "boolean"
|
|
133
133
|
},
|
|
@@ -141,7 +141,7 @@ const fedexJsonSchema = isUK => ({
|
|
|
141
141
|
title: "Company Name",
|
|
142
142
|
type: "string"
|
|
143
143
|
},
|
|
144
|
-
|
|
144
|
+
country_code: {
|
|
145
145
|
oneOf: isUK ? supportedCountriesUK : supportedCountries,
|
|
146
146
|
title: "Country",
|
|
147
147
|
type: "string"
|
|
@@ -151,13 +151,13 @@ const fedexJsonSchema = isUK => ({
|
|
|
151
151
|
title: "Email",
|
|
152
152
|
type: "string"
|
|
153
153
|
},
|
|
154
|
-
|
|
154
|
+
first_name: {
|
|
155
155
|
// TODO: Can we make firstname/lastname in the same row?
|
|
156
156
|
maxLength: 50,
|
|
157
157
|
title: "Contact First Name",
|
|
158
158
|
type: "string"
|
|
159
159
|
},
|
|
160
|
-
|
|
160
|
+
last_name: {
|
|
161
161
|
// TODO: Can we make firstname/lastname in the same row?
|
|
162
162
|
maxLength: 50,
|
|
163
163
|
title: "Contact Last Name",
|
|
@@ -172,7 +172,7 @@ const fedexJsonSchema = isUK => ({
|
|
|
172
172
|
title: "Phone #",
|
|
173
173
|
type: "string"
|
|
174
174
|
},
|
|
175
|
-
|
|
175
|
+
postal_code: {
|
|
176
176
|
// TODO: Can we make this reactive to country selection? Can we group State/Zip?
|
|
177
177
|
maxLength: 8,
|
|
178
178
|
title: "Zip/Postal Code",
|
|
@@ -185,16 +185,16 @@ const fedexJsonSchema = isUK => ({
|
|
|
185
185
|
type: "string"
|
|
186
186
|
}
|
|
187
187
|
},
|
|
188
|
-
required: ["
|
|
188
|
+
required: ["account_number", "first_name", "last_name", "email", "country_code", "address1", "city", "state", "postal_code", "phone", "nickname"],
|
|
189
189
|
title: "Connect Your FedEx Account",
|
|
190
190
|
type: "object"
|
|
191
191
|
});
|
|
192
192
|
const fedexUiSchema = {
|
|
193
|
-
|
|
193
|
+
account_number: {
|
|
194
194
|
"ui:autofocus": true,
|
|
195
195
|
"ui:emptyValue": ""
|
|
196
196
|
},
|
|
197
|
-
|
|
197
|
+
agree_to_eula: {
|
|
198
198
|
"ui:widget": "hidden"
|
|
199
199
|
},
|
|
200
200
|
email: {
|
|
@@ -207,7 +207,7 @@ const fedexUiSchema = {
|
|
|
207
207
|
inputType: "tel"
|
|
208
208
|
}
|
|
209
209
|
},
|
|
210
|
-
"ui:order": ["
|
|
210
|
+
"ui:order": ["account_number", "first_name", "last_name", "company", "email", "country_code", "address1", "address2", "city", "state", "postal_code", "phone", "agree_to_eula", "nickname"]
|
|
211
211
|
};
|
|
212
212
|
const CustomExternalCarrierFormFedex = ({
|
|
213
213
|
carrierName,
|
|
@@ -230,7 +230,7 @@ const CustomExternalCarrierFormFedex = ({
|
|
|
230
230
|
displayName: displayName,
|
|
231
231
|
iconUrl: iconUrl,
|
|
232
232
|
initialFormData: {
|
|
233
|
-
agreeToEula,
|
|
233
|
+
agree_to_eula: agreeToEula,
|
|
234
234
|
nickname: ""
|
|
235
235
|
},
|
|
236
236
|
isBeta: isBeta,
|
|
@@ -2,7 +2,6 @@ import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
|
2
2
|
import { InlineNotification, NotificationType, Button, ButtonVariant } from '@shipengine/giger';
|
|
3
3
|
import { useGetCarrierConnectionForm, useListCarrierConnections } from '@shipengine/react-api';
|
|
4
4
|
import { useQueryClient } from '@tanstack/react-query';
|
|
5
|
-
import * as humps from 'humps';
|
|
6
5
|
import { useState, useEffect, useMemo, useCallback } from 'react';
|
|
7
6
|
import { useTranslation } from 'react-i18next';
|
|
8
7
|
import { hasCustomExternalCarrierConnectionForm, CustomExternalCarrierForm } from './components/custom-external-carrier-form/custom-external-carrier-form.js';
|
|
@@ -92,24 +91,6 @@ const Component = ({
|
|
|
92
91
|
const formattedJsonSchema = useMemo(() => {
|
|
93
92
|
if (!jsonSchema) return {};
|
|
94
93
|
const jsonSchemaClone = JSON.parse(JSON.stringify(jsonSchema));
|
|
95
|
-
// if property has a ref key, map the property value to the value of the path
|
|
96
|
-
const mapRefPath = schema => {
|
|
97
|
-
const {
|
|
98
|
-
properties
|
|
99
|
-
} = schema;
|
|
100
|
-
if (!properties) return schema;
|
|
101
|
-
for (const key in properties) {
|
|
102
|
-
const property = properties[key];
|
|
103
|
-
if (property.$ref) {
|
|
104
|
-
const propKey = `${property.$ref}`.replace("#/", "");
|
|
105
|
-
const refPath = humps.camelize(propKey).split("/");
|
|
106
|
-
properties[key] = refPath.reduce((acc, path) => {
|
|
107
|
-
return acc === null || acc === void 0 ? void 0 : acc[path];
|
|
108
|
-
}, schema);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
return schema;
|
|
112
|
-
};
|
|
113
94
|
// add nickname to properties if it doesn't exist
|
|
114
95
|
const addNicknameProperty = schema => {
|
|
115
96
|
if (!(schema === null || schema === void 0 ? void 0 : schema.properties)) return schema;
|
|
@@ -126,27 +107,7 @@ const Component = ({
|
|
|
126
107
|
updatedSchema.properties = updatedProperties;
|
|
127
108
|
return updatedSchema;
|
|
128
109
|
};
|
|
129
|
-
const
|
|
130
|
-
if (!schema) return schema;
|
|
131
|
-
const updatedSchema = Object.assign({}, schema);
|
|
132
|
-
// camelize required fields, as casing varies between carriers
|
|
133
|
-
if (updatedSchema.required && Array.isArray(updatedSchema.required)) {
|
|
134
|
-
updatedSchema.required = updatedSchema.required.map(item => {
|
|
135
|
-
return typeof item === "string" ? humps.camelize(item) : item;
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
// camelize property keys
|
|
139
|
-
// fail safe to ensure schema properties and required array match in the event the camelizeKeys from shipengine/js-api isn't consistent
|
|
140
|
-
// TODO: Fix edge cases with camelizeKeys in js-api and remove this
|
|
141
|
-
if (updatedSchema.properties && typeof updatedSchema.properties === "object") {
|
|
142
|
-
updatedSchema.properties = Object.entries(updatedSchema.properties).reduce((acc, [key, value]) => {
|
|
143
|
-
acc[humps.camelize(key)] = value;
|
|
144
|
-
return acc;
|
|
145
|
-
}, {});
|
|
146
|
-
}
|
|
147
|
-
return updatedSchema;
|
|
148
|
-
};
|
|
149
|
-
const newJsonSchema = standardizeCasing(addNicknameProperty(mapRefPath(jsonSchemaClone)));
|
|
110
|
+
const newJsonSchema = addNicknameProperty(jsonSchemaClone);
|
|
150
111
|
return newJsonSchema;
|
|
151
112
|
}, [jsonSchema, hasNicknameProperty]);
|
|
152
113
|
const formattedUiSchema = useMemo(() => {
|
|
@@ -155,9 +116,7 @@ const Component = ({
|
|
|
155
116
|
const updatedUiSchema = Object.assign({}, uiSchemaClone);
|
|
156
117
|
// add nickname to ui:order and camelize the values to ensure consistency with jsonSchema properties and required array
|
|
157
118
|
if (!hasNicknameProperty && updatedUiSchema["ui:order"]) {
|
|
158
|
-
|
|
159
|
-
const camelizeUIOrderItem = item => typeof item === "string" ? humps.camelize(item) : item.map(i => humps.camelize(i));
|
|
160
|
-
updatedUiSchema["ui:order"] = [...updatedUiSchema["ui:order"], "nickname"].map(camelizeUIOrderItem);
|
|
119
|
+
updatedUiSchema["ui:order"] = [...updatedUiSchema["ui:order"], "nickname"];
|
|
161
120
|
}
|
|
162
121
|
return updatedUiSchema;
|
|
163
122
|
}, [uiSchema, hasNicknameProperty]);
|
|
@@ -175,7 +134,7 @@ const Component = ({
|
|
|
175
134
|
if (schemaLoading || carriersLoading || needsRefetch) return jsx(Loader, {
|
|
176
135
|
message: t(selectedCarrier ? "loading.connectCarrierForm" : "loading.carriers")
|
|
177
136
|
});
|
|
178
|
-
if (schemaError) {
|
|
137
|
+
if (schemaError && selectedCarrier && !hasCustomExternalCarrierConnectionForm(selectedCarrier)) {
|
|
179
138
|
return jsxs(Fragment, {
|
|
180
139
|
children: [jsx(InlineNotification, {
|
|
181
140
|
type: NotificationType.ERROR,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cc-provider-logo.d.ts","sourceRoot":"","sources":["../../../../src/components/cc-provider-logo/cc-provider-logo.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAOnD,KAAK,mBAAmB,GAAG;IACzB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,6BAAuC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"cc-provider-logo.d.ts","sourceRoot":"","sources":["../../../../src/components/cc-provider-logo/cc-provider-logo.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAOnD,KAAK,mBAAmB,GAAG;IACzB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,6BAAuC,mBAAmB,qDAkBxF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet-schema.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/wallet-form/wallet-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAMtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"wallet-schema.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/wallet-form/wallet-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAMtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwBxB,eAAO,MAAM,kBAAkB;;;CAG9B,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;CAGjC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,MAAM,OAAO,kBAAkB,CAAC;AACrE,MAAM,MAAM,yBAAyB,GAAG,MAAM,OAAO,qBAAqB,CAAC;AAE3E,eAAO,MAAM,uBAAuB,GAAI,kBAAkB,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4C/E,CAAC;AAEF,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEvE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;AACjE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAmDnE,eAAO,MAAM,eAAe,GAC1B,kBAAkB,sBAAsB,EACxC,qBAAqB,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBANjB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAR,QAAQ;;;;;;;;;;;;;;;;;;;;;;;EAetC,CAAC;AAEF,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAEvD,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AACrD,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect-external-carrier.d.ts","sourceRoot":"","sources":["../../../../src/workflows/connect-external-carrier/connect-external-carrier.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"connect-external-carrier.d.ts","sourceRoot":"","sources":["../../../../src/workflows/connect-external-carrier/connect-external-carrier.tsx"],"names":[],"mappings":"AAuBA;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,kBAAkB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAClD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,SAAS,GAAI,+CAA+C,cAAc,qDAuLtF,CAAC;AAEF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sDAElB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shipengine/elements",
|
|
3
|
-
"version": "2.26.
|
|
3
|
+
"version": "2.26.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/cjs/index.cjs",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"@rjsf/utils": "^5.16.1",
|
|
20
20
|
"@rjsf/validator-ajv8": "^5.16.1",
|
|
21
21
|
"@shipengine/giger": "^1.20.18",
|
|
22
|
-
"@shipengine/js-api": "^4.
|
|
23
|
-
"@shipengine/react-api": "^4.
|
|
22
|
+
"@shipengine/js-api": "^4.5.1",
|
|
23
|
+
"@shipengine/react-api": "^4.4.1",
|
|
24
24
|
"@tanstack/react-query": "^4.0.0",
|
|
25
25
|
"axios": "^1.8.4",
|
|
26
26
|
"card-validator": "^8.1.1",
|