Skip to content

Commit

Permalink
new: introduced new field of customer contact in service
Browse files Browse the repository at this point in the history
  • Loading branch information
Usmanfee committed Nov 12, 2024
1 parent ba24b9e commit 6c7561b
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/assets/locales/de/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,11 @@
"providerPhoneContact": "Provider Phone Contact",
"pleaseEnterValidHomePageURL": "Please enter a valid url - eg: https://catena-x.net",
"pleaseEnterValidEmail": "Please enter a valid Customer Contact E-Mail",
<<<<<<< HEAD
"pleaseEnterValidPhone": "Bitte geben Sie eine gültige Kundenkontakt Telefonnummer ein",
=======
"pleaseEnterValidPhone": "Please enter a valid Customer Contact Number",
>>>>>>> e39c0f9e (new: introduced new field of customer contact in service)
"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.",
"privacyInformation": "Privacy Information",
"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”.",
Expand Down
4 changes: 4 additions & 0 deletions src/assets/locales/en/servicerelease.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@
"providerContactPhone": "Customer Contact Phone",
"pleaseEnterValidHomePageURL": "Please enter a valid url - eg: https://catena-x.net",
"pleaseEnterValidEmail": "Please enter a valid Customer Contact E-Mail",
<<<<<<< HEAD
"pleaseEnterValidPhone": "Please enter a valid Customer Contact Phone Number"
=======
"pleaseEnterValidPhone": "Please enter a valid Customer Contact Phonenumber"
>>>>>>> e39c0f9e (new: introduced new field of customer contact in service)
},
"step3": {
"headerTitle": "Agreements and Consent",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,12 @@ export default function ServiceDetails() {
body: [
[fetchServiceStatus?.providerUri],
[fetchServiceStatus?.contactEmail],
<<<<<<< HEAD
// TODO: contactNumber is null atm and causing build failure. Once BE resolve the issue then will un-comment this line
// [fetchServiceStatus?.contactNumber],
=======
[fetchServiceStatus?.contactNumber],
>>>>>>> e39c0f9e (new: introduced new field of customer contact in service)
],
}}
horizontal={true}
Expand Down
18 changes: 16 additions & 2 deletions src/types/Patterns.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,14 @@ const TESTDATA = {
],
},
PHONE: {
valid: ['+1 1234567890', '015208561328', '00491522345678'],
invalid: ['12345', '12345123aa'],
valid: [
'+1 123-456-7890',
'+49 152 08561111',
'+1 (123) 456-7890',
'0152 08561111',
'015208561111',
],
invalid: ['+49 1520856', '+1 (12345) 7890', '+49 1234 567890123', '12345'],
},
DOMAIN: {
valid: [
Expand Down Expand Up @@ -379,4 +385,12 @@ describe('Input Pattern Tests', () => {
expect(isValidAppOverviewSearch(expr)).toBe(false)
})
})
it('validate phone number', () => {
TESTDATA.PHONE.valid.forEach((expr) => {
expect(isValidPhone(expr)).toBe(true)
})
TESTDATA.CLIENTID.invalid.forEach((expr) => {
expect(isValidPhone(expr)).toBe(false)
})
})
})
2 changes: 1 addition & 1 deletion src/types/Patterns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const Patterns = {
LABEL: /^[a-z0-9-_ ]{1,80}$/i,
BPN: /^BPNL[0-9A-Z]{12}$/i,
MAIL: /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*))@(([a-z0-9-]+\.)+[a-z]{2,})$/,
PHONE: /^(\+|00)?(?:\d\s?){6,14}\d$/,
PHONE: /^(\+?\d{1,3}\s?)?(\(?\d{3}\)?[-.\s]?)?\d{3}[-.\s]?\d{4,7}$/,
DOMAIN: new RegExp(`^${DOMAIN.source}$`, 'i'),
PATH: new RegExp(`^${URLPATH.source}$`, 'i'),
URL: urlPattern,
Expand Down

0 comments on commit 6c7561b

Please sign in to comment.