diff --git a/react/src/components/FolderCreateModal.tsx b/react/src/components/FolderCreateModal.tsx index bb1069f141..516fbaed3f 100644 --- a/react/src/components/FolderCreateModal.tsx +++ b/react/src/components/FolderCreateModal.tsx @@ -4,7 +4,7 @@ import { useTanMutation } from '../hooks/reactQueryAlias'; import { useCurrentProjectValue } from '../hooks/useCurrentProject'; import BAIModal, { BAIModalProps } from './BAIModal'; import Flex from './Flex'; -import ProjectSelector from './ProjectSelect'; +import ProjectSelect from './ProjectSelect'; import StorageSelect from './StorageSelect'; import { App, Button, Divider, Form, Input, Radio, Switch, theme } from 'antd'; import { createStyles } from 'antd-style'; @@ -221,7 +221,7 @@ const FolderCreateModal: React.FC = ({ getFieldValue('type') === 'project' && ( <> - + diff --git a/react/src/components/ProjectSelect.tsx b/react/src/components/ProjectSelect.tsx index 0c45f88fe1..e61eca1c85 100644 --- a/react/src/components/ProjectSelect.tsx +++ b/react/src/components/ProjectSelect.tsx @@ -16,16 +16,18 @@ type ProjectInfo = { projectResourcePolicy: any; // Replace 'any' with the actual type projectName: string; }; -interface Props extends SelectProps { +export interface ProjectSelectProps extends SelectProps { onSelectProject?: (projectInfo: ProjectInfo) => void; domain: string; autoSelectDefault?: boolean; + disableDefaultFilter?: boolean; } -const ProjectSelector: React.FC = ({ +const ProjectSelect: React.FC = ({ onSelectProject, domain, autoClearSearchValue, + disableDefaultFilter, ...selectProps }) => { const { t } = useTranslation(); @@ -86,9 +88,11 @@ const ProjectSelector: React.FC = ({ const projects = projectsSince2403 || projectsBefore2403; // temporary filtering groups by accessible groups according to user query - const accessibleProjects = projects?.filter((project) => - user?.groups?.map((group) => group?.id).includes(project?.id), - ); + const accessibleProjects = disableDefaultFilter + ? projects + : projects?.filter((project) => + user?.groups?.map((group) => group?.id).includes(project?.id), + ); const getLabel = (key: string) => ({ @@ -135,4 +139,4 @@ const ProjectSelector: React.FC = ({ ); }; -export default ProjectSelector; +export default ProjectSelect; diff --git a/react/src/components/ProjectSelectForAdminPage.tsx b/react/src/components/ProjectSelectForAdminPage.tsx new file mode 100644 index 0000000000..f363dbe043 --- /dev/null +++ b/react/src/components/ProjectSelectForAdminPage.tsx @@ -0,0 +1,13 @@ +import ProjectSelect, { ProjectSelectProps } from './ProjectSelect'; +import React from 'react'; + +interface ProjectSelectForAdminPageProps + extends Omit {} + +const ProjectSelectForAdminPage: React.FC = ({ + ...projectSelectProps +}) => { + return ; +}; + +export default ProjectSelectForAdminPage; diff --git a/react/src/components/StorageHostSettingsPanel.tsx b/react/src/components/StorageHostSettingsPanel.tsx index 6a70584e99..453f5af582 100644 --- a/react/src/components/StorageHostSettingsPanel.tsx +++ b/react/src/components/StorageHostSettingsPanel.tsx @@ -2,7 +2,7 @@ import { QuotaScopeType, addQuotaScopeTypePrefix } from '../helper/index'; import { useCurrentDomainValue, useUpdatableState } from '../hooks'; import DomainSelector from './DomainSelector'; import Flex from './Flex'; -import ProjectSelector from './ProjectSelect'; +import ProjectSelectForAdminPage from './ProjectSelectForAdminPage'; import QuotaScopeCard from './QuotaScopeCard'; import QuotaSettingModal from './QuotaSettingModal'; import UserSelector from './UserSelector'; @@ -124,7 +124,7 @@ const StorageHostSettingsPanel: React.FC = ({ /> -