Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 23fcbf9

Browse files
committed
add the ability to switch workspaces from workspaces page
1 parent b3abc61 commit 23fcbf9

File tree

1 file changed

+16
-1
lines changed
  • client/packages/lowcoder/src/pages/setting/organization

1 file changed

+16
-1
lines changed

‎client/packages/lowcoder/src/pages/setting/organization/orgList.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ADMIN_ROLE, SUPER_ADMIN_ROLE } from "constants/orgConstants";
22
import { AddIcon, CustomModal, DangerIcon, EditPopover, SearchIcon, CheckoutIcon } from "lowcoder-design";
33
import { useDispatch, useSelector } from "react-redux";
4-
import { createOrgAction, deleteOrgAction } from "redux/reduxActions/orgActions";
4+
import { createOrgAction, deleteOrgAction, switchOrg } from "redux/reduxActions/orgActions";
55
import styled from "styled-components";
66
import { trans, transToNode } from "i18n";
77
import { buildOrgId } from "constants/routesURL";
@@ -58,6 +58,12 @@ const ActiveOrgIcon = styled(CheckoutIcon)`
5858
margin-left: 6px;
5959
`;
6060

61+
// Button to switch to this organization
62+
const SwitchBtn = styled(EditBtn)`
63+
min-width: 64px;
64+
margin-right: 8px;
65+
`;
66+
6167
const TableStyled = styled(Table)`
6268
.ant-table-tbody > tr > td {
6369
padding: 11px 12px;
@@ -264,6 +270,15 @@ function OrganizationSetting() {
264270
key: i,
265271
operation: (
266272
<OperationWrapper>
273+
{item.id !== user.currentOrgId && (
274+
<SwitchBtn
275+
className={"home-datasource-edit-button"}
276+
buttonType={"blue"}
277+
onClick={() => dispatch(switchOrg(item.id))}
278+
>
279+
{trans("profile.switchOrg")}
280+
</SwitchBtn>
281+
)}
267282
<EditBtn
268283
className={"home-datasource-edit-button"}
269284
buttonType={"primary"}

0 commit comments

Comments
 (0)