diff --git a/frontend/src/component/application/ApplicationEdit/ApplicationEdit.tsx b/frontend/src/component/application/ApplicationEdit/ApplicationEdit.tsx index 7abc3e4a64..cab7262337 100644 --- a/frontend/src/component/application/ApplicationEdit/ApplicationEdit.tsx +++ b/frontend/src/component/application/ApplicationEdit/ApplicationEdit.tsx @@ -16,7 +16,6 @@ import { ConditionallyRender } from 'component/common/ConditionallyRender/Condit import { UPDATE_APPLICATION } from 'component/providers/AccessProvider/permissions'; import { ApplicationView } from '../ApplicationView/ApplicationView'; import { ApplicationUpdate } from '../ApplicationUpdate/ApplicationUpdate'; -import { ConnectedInstances } from '../ConnectedInstances/ConnectedInstances'; import { Dialogue } from 'component/common/Dialogue/Dialogue'; import { PageContent } from 'component/common/PageContent/PageContent'; import { PageHeader } from 'component/common/PageHeader/PageHeader'; diff --git a/frontend/src/component/project/ProjectAccess/ProjectAccessAssign/ProjectAccessAssign.tsx b/frontend/src/component/project/ProjectAccess/ProjectAccessAssign/ProjectAccessAssign.tsx index 586ff82ee5..78303316de 100644 --- a/frontend/src/component/project/ProjectAccess/ProjectAccessAssign/ProjectAccessAssign.tsx +++ b/frontend/src/component/project/ProjectAccess/ProjectAccessAssign/ProjectAccessAssign.tsx @@ -321,13 +321,20 @@ export const ProjectAccessAssign = ({ }; const isValid = selectedOptions.length > 0 && selectedRoles.length > 0; - const filteredRoles = userRoles.some( - (userrole) => userrole.name === 'Admin' || userrole.name === 'Owner', - ) - ? roles - : roles.filter((role) => - userRoles.some((userrole) => role.id === userrole.id), - ); + const displayAllRoles = + userRoles.length === 0 || + userRoles.some( + (userRole) => + userRole.name === 'Admin' || userRole.name === 'Owner', + ); + let filteredRoles: IRole[]; + if (displayAllRoles) { + filteredRoles = roles; + } else { + filteredRoles = roles.filter((role) => + userRoles.some((userrole) => role.id === userrole.id), + ); + } return ( ): Promise {