Skip to content

Commit

Permalink
bugfix(technical integration): error message fix (#344)
Browse files Browse the repository at this point in the history
  • Loading branch information
lavanya-bmw authored Nov 13, 2023
1 parent 1dcf558 commit aeebf3c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## 1.7.0-RC3

- App release process
- error message fix in technical integration
- IDP User Migration
- Extended error handling of the api response message implemented
- Included csv file upload validation of csv header row content
Expand Down
2 changes: 1 addition & 1 deletion src/assets/locales/de/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,7 @@
"getHelp": "Get Help",
"deleteOverlayContent": "Deletion will not be reversable, do you still want to delete?",
"roleUploadIsMandatory": "Role upload is mandatory",
"technicalUserSetupMandatory": "Please select atleast one technical user setup",
"technicalUserSetupMandatory": "Bitte wählen Sie mindestens ein technisches Benutzer-Setup aus",
"roleDeleteSuccessMessage": "Role deleted successfully",
"technicalUserProfileError": "Error while updating technical user profiles",
"roleUpdateError": "Error while updating roles"
Expand Down
2 changes: 1 addition & 1 deletion src/assets/locales/de/servicerelease.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"technicalIntegration": {
"headerTitle": "Technical Integration",
"headerDescription": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard .Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard .",
"technicalUserSetupMandatory": "Please select atleast one technical user setup",
"technicalUserSetupMandatory": "Bitte wählen Sie mindestens ein technisches Benutzer-Setup aus",
"technicalUserProfileError": "Error while updating technical user profiles"
},
"step4": {
Expand Down
4 changes: 2 additions & 2 deletions src/assets/locales/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"idp_status_change_info": "{{status}} identity provider",
"idp_status_change_intro2": "Are you sure you want to enable this idp?",
"idp_status_change_intro1": "Disable the idp will always result into the deactivation, but not deletion. You can always enable it again",
"idp_status_tooltip_info": "Atleast one company service needs to enabled",
"idp_status_tooltip_info": "At least one company service needs to enabled",
"idp_test_intro1": "Identity Provider was successfully created.",
"idp_test_intro2": "The IdP is disabled for now and get enabled below.",
"idp_test_description": "Please note, before enabling the Idp and trying to login, you need to setup the Idp connection on you side as well and connect your CX user to the IdP connection. To enable the same, please fillout the fields below.",
Expand Down Expand Up @@ -1068,7 +1068,7 @@
"getHelp": "Get Help",
"deleteOverlayContent": "Deletion will not be reversable, do you still want to delete?",
"roleUploadIsMandatory": "Role upload is mandatory",
"technicalUserSetupMandatory": "Please select atleast one technical user setup",
"technicalUserSetupMandatory": "Please select at least one technical user setup",
"roleDeleteSuccessMessage": "Role deleted successfully",
"technicalUserProfileError": "Error while updating technical user profiles",
"roleUpdateError": "Error while updating roles"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,16 @@ export default function TechnicalIntegration() {

const handleCheckedUserProfiles = (checked: boolean, item: userRolesType) => {
const isSelected = techUserProfiles?.includes(item.roleId)
let selectedProfiles: string[] = []
if (!isSelected && checked) {
setTechUserProfiles([...techUserProfiles, item.roleId])
selectedProfiles = [...techUserProfiles, item.roleId]
} else if (isSelected && !checked) {
const oldTechUserProfiles = [...techUserProfiles]
oldTechUserProfiles.splice(oldTechUserProfiles.indexOf(item.roleId), 1)
setTechUserProfiles([...oldTechUserProfiles])
selectedProfiles = [...oldTechUserProfiles]
}
setEnableUserProfilesErrorMessage(selectedProfiles?.length === 0)
setTechUserProfiles(selectedProfiles)
}

const handleSaveSuccess = (buttonLabel: string) => {
Expand All @@ -155,7 +158,10 @@ export default function TechnicalIntegration() {
submitData: unknown,
buttonLabel: string
) => {
if (buttonLabel === ButtonLabelTypes.SAVE) {
if (
buttonLabel === ButtonLabelTypes.SAVE &&
(data?.length === 0 || techUserProfiles.length === 0)
) {
data?.length === 0 && setEnableErrorMessage(true)
techUserProfiles.length === 0 && setEnableUserProfilesErrorMessage(true)
} else if (
Expand Down

0 comments on commit aeebf3c

Please sign in to comment.