diff --git a/.changeset/tame-donuts-itch.md b/.changeset/tame-donuts-itch.md new file mode 100644 index 00000000000..c8421bddf12 --- /dev/null +++ b/.changeset/tame-donuts-itch.md @@ -0,0 +1,5 @@ +--- +"@wso2is/console": patch +--- + +Fix issue with the application role edit tab diff --git a/apps/console/src/features/applications/components/edit-application.tsx b/apps/console/src/features/applications/components/edit-application.tsx index 6d8ccd3f499..ac6f194ff14 100644 --- a/apps/console/src/features/applications/components/edit-application.tsx +++ b/apps/console/src/features/applications/components/edit-application.tsx @@ -393,7 +393,7 @@ export const EditApplication: FunctionComponent = inboundProtocolConfig: inboundProtocolConfig, inboundProtocols: inboundProtocolList, onApplicationUpdate: () => { - onUpdate(application?.id); + handleApplicationUpdate(application?.id); }, onTriggerTabUpdate: (tabIndex: number) => { setActiveTabIndex(tabIndex); diff --git a/apps/console/src/features/applications/pages/application-edit.tsx b/apps/console/src/features/applications/pages/application-edit.tsx index b2830cacf83..72b1f3866ec 100755 --- a/apps/console/src/features/applications/pages/application-edit.tsx +++ b/apps/console/src/features/applications/pages/application-edit.tsx @@ -118,6 +118,7 @@ const ApplicationEditPage: FunctionComponent = ( data: application, mutate: mutateApplicationGetRequest, isLoading: isApplicationGetRequestLoading, + isValidating: isApplicationGetRequestValidating, error: applicationGetRequestError } = useGetApplication(applicationId, !!applicationId); @@ -553,7 +554,7 @@ const ApplicationEditPage: FunctionComponent = ( count: 5, imageType: "square" } } - isLoading={ isApplicationRequestLoading } + isLoading={ isApplicationRequestLoading || isApplicationGetRequestValidating } backButton={ { "data-componentid": `${componentId}-page-back-button`, onClick: handleBackButtonClick, diff --git a/apps/console/src/features/roles/components/application-roles.tsx b/apps/console/src/features/roles/components/application-roles.tsx index b6521e1a41a..583141b7c18 100755 --- a/apps/console/src/features/roles/components/application-roles.tsx +++ b/apps/console/src/features/roles/components/application-roles.tsx @@ -303,6 +303,8 @@ export const ApplicationRoles: FunctionComponent { t("extensions:develop.applications.edit.sections.rolesV2.roleAudience") } + + = (props: RoleBasicPr errors.roleName = t("console:manage.features.roles.addRoleWizard.forms.roleBasicDetails.roleName." + "validations.empty", { type: "Role" }); } else { - // TODO: Need to debounce the function. - setRoleNameSearchQuery(`displayName eq ${values.roleName} and audience.value eq ${audienceId}`); - - if (!isRolesListLoading || !isRolesListValidating) { - if (rolesList?.totalResults > 0) { - errors.roleName = t("console:manage.features.roles.addRoleWizard.forms.roleBasicDetails." + - "roleName.validations.duplicate", { type: "Role" }); + if (!FormValidation.isValidRoleName(values.roleName?.toString().trim())) { + errors.roleName = t("console:manage.features.roles.addRoleWizard.forms.roleBasicDetails." + + "roleName.validations.invalid", { type: "Role" }); + } else { + // TODO: Need to debounce the function. + setRoleNameSearchQuery(`displayName eq ${values.roleName} and audience.value eq ${audienceId}`); + + if (!isRolesListLoading || !isRolesListValidating) { + if (rolesList?.totalResults > 0) { + errors.roleName = t("console:manage.features.roles.addRoleWizard.forms.roleBasicDetails." + + "roleName.validations.duplicate", { type: "Role" }); + } } - } + } } if (errors.roleName || errors.assignedApplicationId) {