Skip to content

Commit 4922ba5

Browse files
authored
Merge pull request #1060 from AppQuality/UN-527-deactivate-project-creation
chore: update ProjectDropdown to conditionally enable creatable optio…
2 parents e03608d + 5277e9f commit 4922ba5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/pages/ExpressWizard/projectDropdown.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ import { ReactComponent as FolderIcon } from 'src/assets/icons/folder-icon.svg';
1010
import { useGetWorkspacesByWidProjectsQuery } from 'src/features/api';
1111
import { setExpressProject } from 'src/features/express/expressSlice';
1212
import { useActiveWorkspace } from 'src/hooks/useActiveWorkspace';
13+
import { useCanAccessToActiveWorkspace } from 'src/hooks/useCanAccessToActiveWorkspace';
1314

1415
export const ProjectDropdown = () => {
1516
const { t } = useTranslation();
1617
const dispatch = useAppDispatch();
1718
const { activeWorkspace } = useActiveWorkspace();
18-
19+
const canAccessWorkspace = useCanAccessToActiveWorkspace();
1920
const { project, projectLocked } = useAppSelector((state) => state.express);
2021

2122
// Get workspaces projects from rtk query
@@ -32,7 +33,7 @@ export const ProjectDropdown = () => {
3233
) : (
3334
<Field>
3435
<Autocomplete
35-
isCreatable
36+
isCreatable={canAccessWorkspace}
3637
startIcon={<FolderIcon />}
3738
{...(projectLocked && project && { isDisabled: true })}
3839
onCreateNewOption={async (value) => {

0 commit comments

Comments
 (0)