Skip to content

Commit 6c7561b

Browse files
committed
new: introduced new field of customer contact in service
1 parent ba24b9e commit 6c7561b

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
@@ -1308,7 +1308,11 @@
13081308
"providerPhoneContact": "Provider Phone Contact",
13091309
"pleaseEnterValidHomePageURL": "Please enter a valid url - eg: https://catena-x.net",
13101310
"pleaseEnterValidEmail": "Please enter a valid Customer Contact E-Mail",
1311+
<<<<<<< HEAD
13111312
"pleaseEnterValidPhone": "Bitte geben Sie eine gültige Kundenkontakt Telefonnummer ein",
1313+
=======
1314+
"pleaseEnterValidPhone": "Please enter a valid Customer Contact Number",
1315+
>>>>>>> e39c0f9e (new: introduced new field of customer contact in service)
13121316
"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.",
13131317
"privacyInformation": "Privacy Information",
13141318
"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
@@ -271,8 +271,12 @@ export default function ServiceDetails() {
271271
body: [
272272
[fetchServiceStatus?.providerUri],
273273
[fetchServiceStatus?.contactEmail],
274+
<<<<<<< HEAD
274275
// TODO: contactNumber is null atm and causing build failure. Once BE resolve the issue then will un-comment this line
275276
// [fetchServiceStatus?.contactNumber],
277+
=======
278+
[fetchServiceStatus?.contactNumber],
279+
>>>>>>> e39c0f9e (new: introduced new field of customer contact in service)
276280
],
277281
}}
278282
horizontal={true}

src/types/Patterns.test.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,14 @@ const TESTDATA = {
7171
],
7272
},
7373
PHONE: {
74-
valid: ['+1 1234567890', '015208561328', '00491522345678'],
75-
invalid: ['12345', '12345123aa'],
74+
valid: [
75+
'+1 123-456-7890',
76+
'+49 152 08561111',
77+
'+1 (123) 456-7890',
78+
'0152 08561111',
79+
'015208561111',
80+
],
81+
invalid: ['+49 1520856', '+1 (12345) 7890', '+49 1234 567890123', '12345'],
7682
},
7783
DOMAIN: {
7884
valid: [
@@ -379,4 +385,12 @@ describe('Input Pattern Tests', () => {
379385
expect(isValidAppOverviewSearch(expr)).toBe(false)
380386
})
381387
})
388+
it('validate phone number', () => {
389+
TESTDATA.PHONE.valid.forEach((expr) => {
390+
expect(isValidPhone(expr)).toBe(true)
391+
})
392+
TESTDATA.CLIENTID.invalid.forEach((expr) => {
393+
expect(isValidPhone(expr)).toBe(false)
394+
})
395+
})
382396
})

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)