Skip to content

Commit 2a1e3ef

Browse files
committed
new: introduced new field of customer contact in service
1 parent 63a18bc commit 2a1e3ef

File tree

5 files changed

+29
-3
lines changed

5 files changed

+29
-3
lines changed

src/assets/locales/de/main.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,7 +1315,11 @@
13151315
"providerPhoneContact": "Provider Phone Contact",
13161316
"pleaseEnterValidHomePageURL": "Please enter a valid url - eg: https://catena-x.net",
13171317
"pleaseEnterValidEmail": "Please enter a valid Customer Contact E-Mail",
1318+
<<<<<<< HEAD
13181319
"pleaseEnterValidPhone": "Bitte geben Sie eine gültige Kundenkontakt Telefonnummer ein",
1320+
=======
1321+
"pleaseEnterValidPhone": "Please enter a valid Customer Contact Number",
1322+
>>>>>>> e39c0f9e (new: introduced new field of customer contact in service)
13191323
"pleaseEnterValidContact": "Bitte fügen Sie eine gültige Telefonnummer im folgenden Format hinzu: „+ xx xxxx xxxxxx“, „+ xxx xxxx-xxxx“, „+xx xxxxxxxxxx“. Hinweis: Es sind weitere Formate zulässig. Die genannten Formate sind die am häufigsten verwendeten Formate.",
13201324
"privacyInformation": "Privacy Information",
13211325
"privacyInformationDescription": "The privacy information is used to display data types the app may collect on the app detail page. You may select several options OR select “none”.",

src/assets/locales/en/servicerelease.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@
5353
"providerContactPhone": "Customer Contact Phone",
5454
"pleaseEnterValidHomePageURL": "Please enter a valid url - eg: https://catena-x.net",
5555
"pleaseEnterValidEmail": "Please enter a valid Customer Contact E-Mail",
56+
<<<<<<< HEAD
5657
"pleaseEnterValidPhone": "Please enter a valid Customer Contact Phone Number"
58+
=======
59+
"pleaseEnterValidPhone": "Please enter a valid Customer Contact Phonenumber"
60+
>>>>>>> e39c0f9e (new: introduced new field of customer contact in service)
5761
},
5862
"step3": {
5963
"headerTitle": "Agreements and Consent",

src/components/pages/ServiceReleaseProcess/components/ServiceDetails.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,12 @@ export default function ServiceDetails() {
273273
body: [
274274
[fetchServiceStatus?.providerUri],
275275
[fetchServiceStatus?.contactEmail],
276+
<<<<<<< HEAD
276277
// TODO: contactNumber is null atm and causing build failure. Once BE resolve the issue then will un-comment this line
277278
// [fetchServiceStatus?.contactNumber],
279+
=======
280+
[fetchServiceStatus?.contactNumber],
281+
>>>>>>> e39c0f9e (new: introduced new field of customer contact in service)
278282
],
279283
}}
280284
horizontal={true}

src/types/Patterns.test.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,14 @@ const TESTDATA = {
7272
],
7373
},
7474
PHONE: {
75-
valid: ['+1 1234567890', '015208561328', '00491522345678'],
76-
invalid: ['12345', '12345123aa'],
75+
valid: [
76+
'+1 123-456-7890',
77+
'+49 152 08561111',
78+
'+1 (123) 456-7890',
79+
'0152 08561111',
80+
'015208561111',
81+
],
82+
invalid: ['+49 1520856', '+1 (12345) 7890', '+49 1234 567890123', '12345'],
7783
},
7884
DOMAIN: {
7985
valid: [
@@ -388,4 +394,12 @@ describe('Input Pattern Tests', () => {
388394
expect(isValidAppOverviewSearch(expr)).toBe(false)
389395
})
390396
})
397+
it('validate phone number', () => {
398+
TESTDATA.PHONE.valid.forEach((expr) => {
399+
expect(isValidPhone(expr)).toBe(true)
400+
})
401+
TESTDATA.CLIENTID.invalid.forEach((expr) => {
402+
expect(isValidPhone(expr)).toBe(false)
403+
})
404+
})
391405
})

src/types/Patterns.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const Patterns = {
4141
LABEL: /^[a-z0-9-_ ]{1,80}$/i,
4242
BPN: /^BPNL[0-9A-Z]{12}$/i,
4343
MAIL: /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*))@(([a-z0-9-]+\.)+[a-z]{2,})$/,
44-
PHONE: /^(\+|00)?(?:\d\s?){6,14}\d$/,
44+
PHONE: /^(\+?\d{1,3}\s?)?(\(?\d{3}\)?[-.\s]?)?\d{3}[-.\s]?\d{4,7}$/,
4545
DOMAIN: new RegExp(`^${DOMAIN.source}$`, 'i'),
4646
PATH: new RegExp(`^${URLPATH.source}$`, 'i'),
4747
URL: urlPattern,

0 commit comments

Comments
 (0)