Skip to content

Commit

Permalink
fix(Service Release): prevent only spaces in short & long description (
Browse files Browse the repository at this point in the history
  • Loading branch information
charmi-v authored Sep 17, 2024
1 parent 531f6fb commit 6c4a0f9
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Bugfixes

- **Service Release Process**
- Updated description regex & validation error message to prevent only spaces in short & long description
- **OSP Consent form**
- Display invited company name in OSP consent form (Previously hard coded with 'BMW') [#1083](https://github.com/eclipse-tractusx/portal-frontend/pull/1083)
- Fixed missing street number in form [#1081](https://github.com/eclipse-tractusx/portal-frontend/issues/1081)
Expand Down
1 change: 1 addition & 0 deletions src/assets/locales/de/servicerelease.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"maximum": "Maximum",
"charactersAllowed": " characters allowed",
"validCharactersIncludes": "Valid characters includes: ",
"spaceAloneNotAllowed": " and spaces alone are not allowed",
"isMandatory": " is mandatory",
"fileUploadIsMandatory": "File upload is mandatory",
"error": {
Expand Down
1 change: 1 addition & 0 deletions src/assets/locales/en/servicerelease.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"maximum": "Maximum",
"charactersAllowed": " characters allowed",
"validCharactersIncludes": "Valid characters includes: ",
"spaceAloneNotAllowed": " and spaces alone are not allowed",
"isMandatory": " is mandatory",
"fileUploadIsMandatory": "File upload is mandatory",
"error": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,8 @@ export default function OfferCard() {
)}`,
pattern: `${t(
'serviceReleaseForm.validCharactersIncludes'
)} ${'a-zA-ZÀ-ÿ0-9 !?@&#\'"()_-=/*.,;:'}`,
)} ${'a-zA-ZÀ-ÿ0-9 !?@&#\'"()_-=/*.,;:'}
${t('serviceReleaseForm.spaceAloneNotAllowed')}`,
maxLength: `${t('serviceReleaseForm.maximum')} 120 ${t(
'serviceReleaseForm.charactersAllowed'
)}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,8 @@ export default function OfferPage({
)}`,
pattern: `${t(
'serviceReleaseForm.validCharactersIncludes'
)} ${'a-zA-ZÀ-ÿ0-9 !?@&#\'"()[]_-+=<>/*.,;:'}`,
)} ${'a-zA-ZÀ-ÿ0-9 !?@&#\'"()[]_-+=<>/*.,;:'}
${t('serviceReleaseForm.spaceAloneNotAllowed')}`,
}}
maxLength={longDescriptionMaxLength}
/>
Expand Down
4 changes: 2 additions & 2 deletions src/types/Patterns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ export const Patterns = {
offerCard: {
serviceName: /^[^-\s()'"#@.&](?!.*[%&?,';:!\s-]{2}).{2,200}$/,
serviceType: /^([A-Za-z])$/,
shortDescription: /^.{10,120}$/,
shortDescription: /^(?! *$).{10,120}$/,
},
offerPage: {
longDescription: /^.{10,1999}$/,
longDescription: /^(?! *$).{10,1999}$/,
},
appPage: {
longDescriptionEN:
Expand Down

0 comments on commit 6c4a0f9

Please sign in to comment.