Skip to content

Commit 59e4b8a

Browse files
PullRequest: 459 fix: get statusMap when component init
Merge branch 'fix/dev-4.3.0-odc-2707 of [email protected]:oceanbase/oceanbase-developer-center.git into dev-4.3.0 https://code.alipay.com/oceanbase/oceanbase-developer-center/pull_requests/459 Signed-off-by: 晓康 <[email protected]> * Fixes oceanbase/odc#2707 * Fixes oceanbase/odc#2707 * fix: get statusMap when component init
1 parent 3a8a151 commit 59e4b8a

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

src/component/Task/MutipleAsyncTask/CreateModal/index.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -482,10 +482,6 @@ const CreateModal: React.FC<IProps> = (props) => {
482482
const projectOptions = response?.contents?.map(({ name, id, currentUserResourceRoles }) => ({
483483
label: name,
484484
value: id,
485-
disabled:
486-
currentUserResourceRoles?.filter((role) =>
487-
[ProjectRole.DBA, ProjectRole.OWNER, ProjectRole.DEVELOPER]?.includes(role),
488-
)?.length === 0,
489485
}));
490486
const rawProjectMap = response?.contents?.reduce((pre, cur) => {
491487
pre[cur?.id] = cur?.name;

src/page/Project/Database/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ interface IProps {
5656
}
5757

5858
const Database: React.FC<IProps> = ({ id, modalStore }) => {
59+
const statusMap = datasourceStatus.statusMap;
5960
const { project } = useContext(ProjectContext);
6061
const [total, setTotal] = useState(0);
6162
const [searchValue, setSearchValue] = useState('');
@@ -184,8 +185,6 @@ const Database: React.FC<IProps> = ({ id, modalStore }) => {
184185
);
185186
const disabled =
186187
!hasChangeAuth && !hasQueryAuth && !record?.authorizedPermissionTypes?.length;
187-
188-
const statusMap = datasourceStatus.statusMap;
189188
const status = statusMap.get(record?.dataSource?.id) || record?.dataSource?.status;
190189

191190
return {

0 commit comments

Comments
 (0)