Skip to content

Commit

Permalink
fix: error messages issue from create organization and create ecosyst…
Browse files Browse the repository at this point in the history
…em modals. (#698)

* fix:css issues

Signed-off-by: pranalidhanavade <[email protected]>

* fix:sonarcloud issues

Signed-off-by: pranalidhanavade <[email protected]>

* fix:clear error on pop-up close

Signed-off-by: pranalidhanavade <[email protected]>

---------

Signed-off-by: pranalidhanavade <[email protected]>
  • Loading branch information
pranalidhanavade authored Jun 17, 2024
1 parent 252b504 commit 2d8875c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/components/CreateEcosystemOrgModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ const CreateEcosystemOrgModal = (props: IProps) => {
});
props.setOpenModal(false);
setImgError(' ')
setErrMsg(null);
}}
>
<Modal.Header>Create {popupName}</Modal.Header>
Expand All @@ -270,6 +271,7 @@ const CreateEcosystemOrgModal = (props: IProps) => {
type={'failure'}
onAlertClose={() => {
setErrMsg(null);

}}
/>
<Formik
Expand Down
6 changes: 4 additions & 2 deletions src/components/RoleViewButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ interface RoleViewButtonProps {
feature: string,
isOutline?: boolean,
isPadding?: boolean,
disabled?:boolean
}


const RoleViewButton = ({ title, buttonTitle, svgComponent, onClickEvent, feature, isOutline, isPadding }: RoleViewButtonProps) => {
const RoleViewButton = ({ title, buttonTitle, svgComponent, onClickEvent, feature, isOutline, isPadding, disabled }: RoleViewButtonProps) => {

const [userRoles, setUserRoles] = useState<string[]>([])

Expand Down Expand Up @@ -75,10 +76,11 @@ const RoleViewButton = ({ title, buttonTitle, svgComponent, onClickEvent, featur
? "!p-0 role-btn group flex h-min items-center justify-center text-center focus:z-10 focus:ring-2 ring-primary-700 bg-white-700 hover:bg-secondary-700 ring-2 text-black font-medium rounded-md text-sm dark:text-white dark:hover:text-primary-700"
: `${isPadding ? "!p-0" : ""} text-base font-medium text-center text-white bg-primary-700 hover:!bg-primary-800 rounded-md hover:bg-primary-800 focus:ring-4 focus:ring-primary-300 sm:w-auto dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800`
}`}
disabled={!(isRoleAccess())}
disabled={disabled || !isRoleAccess()}
>
{svgComponent}
{buttonTitle}

</Button>
)

Expand Down
6 changes: 4 additions & 2 deletions src/components/organization/OrganizationsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const initialPageState = {
pageNumber: 1,
pageSize: 9,
total: 100,
totalCount: 0
};

const OrganizationsList = () => {
Expand Down Expand Up @@ -59,10 +60,9 @@ const OrganizationsList = () => {
searchText,
);
const { data } = response as AxiosResponse;

if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) {
const totalPages = data?.data?.totalPages;

const totalCount =data?.data?.totalCount;
const orgList = data?.data?.organizations.map((userOrg: Organisation) => {
const roles: string[] = userOrg.userOrgRoles.map(
(role) => role.orgRole.name,
Expand All @@ -75,6 +75,7 @@ const OrganizationsList = () => {
setCurrentPage({
...currentPage,
total: totalPages,
totalCount: totalCount,
});
} else {
setError(response as string);
Expand Down Expand Up @@ -267,6 +268,7 @@ const OrganizationsList = () => {
</div>
}
onClickEvent={createOrganizationModel}
disabled={currentPage.totalCount >= 10}
/>
</div>
<div>
Expand Down

0 comments on commit 2d8875c

Please sign in to comment.