Skip to content

Commit 8f45107

Browse files
authored
Merge pull request #92 from running-elephant/dev
Dev
2 parents c74d6aa + 105163b commit 8f45107

File tree

21 files changed

+514
-303
lines changed

21 files changed

+514
-303
lines changed

frontend/src/app/components/ChartGraph/PivotSheetChart/config.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -450,21 +450,21 @@ const config: ChartConfig = {
450450
theme: {
451451
title: '主题',
452452
themeType: '主题类型',
453-
headerFontColor: '表头字体颜色',
453+
colHeaderFontColor: '列表头字体颜色',
454454
evenBgColor: '偶数行背景颜色',
455455
oddBgColor: '奇数行背景颜色',
456-
hoverDataBgColor: '数据选中背景颜色',
457-
hoverHeaderBgColor: '选中列表头背景颜色',
458-
headerBgColor: '表头背景颜色',
459-
prepareSelectMaskBgColor: '刷选遮罩样式背景颜色',
456+
cellBgColorHover: '选中单元格背景颜色',
457+
colHeaderBgColorHover: '选中列表头背景颜色',
458+
colHeaderBgColor: '列表头背景颜色',
459+
prepareSelectMaskBgColor: '画刷层背景颜色',
460460
linkTextColor: '超链接字体颜色',
461-
hoverSplitLineColor: '划上分割线颜色',
462-
dataBorderColor: '数据单元格边框颜色',
463-
headerBorderColor: '表头单元格边框颜色',
461+
resizeAreaColor: '拖拽区域颜色',
462+
cellBorderColor: '单元格边框颜色',
463+
colHeaderBorderColor: '列表头边框颜色',
464464
verticalSplitLineColor: '垂直分割线颜色',
465465
horizontalSplitLineColor: '水平分割线颜色',
466-
dataColor: '数据单元格文字颜色',
467-
rowCellFontColor: '行标题颜色',
466+
cellFontColor: '单元格文字颜色',
467+
rowHeaderFontColor: '行表头文字颜色',
468468
type: {
469469
default: '默认',
470470
gray: '简约灰',
@@ -532,21 +532,21 @@ const config: ChartConfig = {
532532
theme: {
533533
title: 'Theme',
534534
themeType: 'Theme Type',
535-
headerFontColor: 'Header Font Color',
535+
colHeaderFontColor: 'Col Header Font Color',
536536
evenBgColor: 'Even Row Background Color',
537537
oddBgColor: 'Odd Row Background Color',
538-
hoverDataBgColor: 'Hover And Select Data Color',
539-
hoverHeaderBgColor: 'Hover And Select Header Color',
540-
headerBgColor: 'Header Background Color',
538+
cellBgColorHover: 'Selected Cell Background Color',
539+
colHeaderBgColorHover: 'Selected Col Header Background Color',
540+
colHeaderBgColor: 'Col Header Background Color',
541541
prepareSelectMaskBgColor: 'Prepare Select Mask Color',
542542
linkTextColor: 'Link Text Color',
543-
hoverSplitLineColor: 'Hover Split Line Color',
544-
dataBorderColor: 'Data Border Color',
545-
headerBorderColor: 'Header Border Color',
543+
resizeAreaColor: 'Resize Area Color',
544+
cellBorderColor: 'Cell Border Color',
545+
colHeaderBorderColor: 'Col Header Border Color',
546546
verticalSplitLineColor: 'Vertical Split Line Color',
547547
horizontalSplitLineColor: 'Horizontal Split Line Color',
548-
dataColor: 'Data Font Color',
549-
rowCellFontColor: 'Row Cell Font Color',
548+
cellFontColor: 'Cell Font Color',
549+
rowHeaderFontColor: 'Row Header Font Color',
550550
type: {
551551
default: 'Default',
552552
gray: 'Gray',

frontend/src/app/components/FormGenerator/Customize/PivotSheetTheme/PivotSheetTheme.tsx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,43 +28,43 @@ import { PIVOT_THEME_LIST, PIVOT_THEME_SELECT } from './theme';
2828

2929
const template = [
3030
{
31-
label: 'theme.headerFontColor',
32-
key: 'headerFontColor',
31+
label: 'theme.colHeaderFontColor',
32+
key: 'colHeaderFontColor',
3333
index: 0,
3434
},
3535
{
36-
label: 'theme.headerBgColor',
37-
key: 'headerBgColor',
36+
label: 'theme.colHeaderBgColor',
37+
key: 'colHeaderBgColor',
3838
index: 3,
3939
},
4040
{
41-
label: 'theme.hoverHeaderBgColor',
42-
key: 'hoverHeaderBgColor',
41+
label: 'theme.colHeaderBgColorHover',
42+
key: 'colHeaderBgColorHover',
4343
index: 4,
4444
},
4545
{
46-
label: 'theme.headerBorderColor',
47-
key: 'headerBorderColor',
46+
label: 'theme.colHeaderBorderColor',
47+
key: 'colHeaderBorderColor',
4848
index: 10,
4949
},
5050
{
51-
label: 'theme.rowCellFontColor',
52-
key: 'rowCellFontColor',
51+
label: 'theme.rowHeaderFontColor',
52+
key: 'rowHeaderFontColor',
5353
index: 14,
5454
},
5555
{
56-
label: 'theme.dataColor',
57-
key: 'dataColor',
56+
label: 'theme.cellFontColor',
57+
key: 'cellFontColor',
5858
index: 13,
5959
},
6060
{
61-
label: 'theme.hoverDataBgColor',
62-
key: 'hoverDataBgColor',
61+
label: 'theme.cellBgColorHover',
62+
key: 'cellBgColorHover',
6363
index: 2,
6464
},
6565
{
66-
label: 'theme.dataBorderColor',
67-
key: 'dataBorderColor',
66+
label: 'theme.cellBorderColor',
67+
key: 'cellBorderColor',
6868
index: 9,
6969
},
7070
{
@@ -88,8 +88,8 @@ const template = [
8888
index: 12,
8989
},
9090
{
91-
label: 'theme.hoverSplitLineColor',
92-
key: 'hoverSplitLineColor',
91+
label: 'theme.resizeAreaColor',
92+
key: 'resizeAreaColor',
9393
index: 7,
9494
},
9595
{

frontend/src/app/constants.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
* limitations under the License.
1717
*/
1818

19+
export enum TenantManagementMode {
20+
Team = 'TEAM',
21+
Platform = 'PLATFORM',
22+
}
23+
1924
export enum ControllerFacadeTypes {
2025
DropdownList = 'dropdownList',
2126
RadioGroup = 'radioGroup',

frontend/src/app/pages/LoginPage/LoginForm.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ import {
3737
import { getToken } from 'utils/auth';
3838

3939
export function LoginForm({
40+
registerEnable = true,
4041
modal = false,
4142
onLogin,
4243
}: {
44+
registerEnable?: boolean;
4345
modal?: boolean;
4446
onLogin?: (value) => void;
4547
}) {
@@ -139,7 +141,9 @@ export function LoginForm({
139141
<LinkButton to="/forgetPassword">
140142
{t('forgotPassword')}
141143
</LinkButton>
142-
<LinkButton to="/register">{t('register')}</LinkButton>
144+
{registerEnable && (
145+
<LinkButton to="/register">{t('register')}</LinkButton>
146+
)}
143147
</Links>
144148
)}
145149

@@ -168,7 +172,7 @@ const LinkButton = styled(Link)`
168172
flex: 1;
169173
line-height: ${LINE_HEIGHT_ICON_LG};
170174
171-
&:last-of-type {
175+
&:nth-child(2) {
172176
text-align: right;
173177
}
174178
`;

frontend/src/app/pages/LoginPage/index.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import { Brand } from 'app/components/Brand';
2020
import { Version } from 'app/components/Version';
21-
import { selectVersion } from 'app/slice/selectors';
21+
import { selectSystemInfo } from 'app/slice/selectors';
2222
import { login } from 'app/slice/thunks';
2323
import React, { useCallback } from 'react';
2424
import { useDispatch, useSelector } from 'react-redux';
@@ -27,9 +27,9 @@ import styled from 'styled-components/macro';
2727
import { LoginForm } from './LoginForm';
2828

2929
export function LoginPage() {
30-
const version = useSelector(selectVersion);
3130
const dispatch = useDispatch();
3231
const history = useHistory();
32+
const systemInfo = useSelector(selectSystemInfo);
3333

3434
const onLogin = useCallback(
3535
values => {
@@ -47,8 +47,11 @@ export function LoginPage() {
4747
return (
4848
<Wrapper>
4949
<Brand />
50-
<LoginForm onLogin={onLogin} />
51-
<Version version={version} />
50+
<LoginForm
51+
registerEnable={systemInfo?.registerEnable}
52+
onLogin={onLogin}
53+
/>
54+
<Version version={systemInfo?.version} />
5255
</Wrapper>
5356
);
5457
}

frontend/src/app/pages/MainPage/Navbar/index.tsx

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {
3232
import { List, Menu, Tooltip } from 'antd';
3333
import logo from 'app/assets/images/logo.svg';
3434
import { Avatar, MenuListItem, Popup } from 'app/components';
35+
import { TenantManagementMode } from 'app/constants';
3536
import useI18NPrefix from 'app/hooks/useI18NPrefix';
3637
import {
3738
selectCurrentOrganization,
@@ -40,7 +41,7 @@ import {
4041
selectOrgId,
4142
} from 'app/pages/MainPage/slice/selectors';
4243
import { getOrganizations } from 'app/pages/MainPage/slice/thunks';
43-
import { selectLoggedInUser } from 'app/slice/selectors';
44+
import { selectLoggedInUser, selectSystemInfo } from 'app/slice/selectors';
4445
import { logout } from 'app/slice/thunks';
4546
import { downloadFile } from 'app/utils/fetch';
4647
import { BASE_RESOURCE_URL } from 'globalConstants';
@@ -83,6 +84,7 @@ export function Navbar() {
8384
const [modifyPasswordVisible, setModifyPasswordVisible] = useState(false);
8485
const dispatch = useDispatch();
8586
const history = useHistory();
87+
const systemInfo = useSelector(selectSystemInfo);
8688
const orgId = useSelector(selectOrgId);
8789
const currentOrganization = useSelector(selectCurrentOrganization);
8890
const loggedInUser = useSelector(selectLoggedInUser);
@@ -289,22 +291,25 @@ export function Navbar() {
289291
}
290292
}}
291293
/>
292-
<Popup
293-
content={<OrganizationList />}
294-
trigger={['click']}
295-
placement="rightBottom"
296-
onVisibleChange={organizationListVisibleChange}
297-
>
298-
<li>
299-
<Tooltip title={t('nav.organization.title')} placement="right">
300-
<Avatar
301-
src={`${BASE_RESOURCE_URL}${currentOrganization?.avatar}`}
302-
>
303-
<BankFilled />
304-
</Avatar>
305-
</Tooltip>
306-
</li>
307-
</Popup>
294+
{systemInfo?.tenantManagementMode ===
295+
TenantManagementMode.Platform && (
296+
<Popup
297+
content={<OrganizationList />}
298+
trigger={['click']}
299+
placement="rightBottom"
300+
onVisibleChange={organizationListVisibleChange}
301+
>
302+
<li>
303+
<Tooltip title={t('nav.organization.title')} placement="right">
304+
<Avatar
305+
src={`${BASE_RESOURCE_URL}${currentOrganization?.avatar}`}
306+
>
307+
<BankFilled />
308+
</Avatar>
309+
</Tooltip>
310+
</li>
311+
</Popup>
312+
)}
308313
<Popup
309314
content={
310315
<Menu

frontend/src/app/pages/MainPage/pages/MemberPage/Sidebar/MemberList.tsx

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919
import { LoadingOutlined, UserAddOutlined } from '@ant-design/icons';
2020
import { List, Modal } from 'antd';
2121
import { Avatar, ListItem, ListTitle } from 'app/components';
22+
import { TenantManagementMode } from 'app/constants';
2223
import { useDebouncedSearch } from 'app/hooks/useDebouncedSearch';
2324
import useI18NPrefix from 'app/hooks/useI18NPrefix';
25+
import { selectSystemInfo } from 'app/slice/selectors';
2426
import {
2527
memo,
2628
ReactElement,
@@ -46,6 +48,7 @@ export const MemberList = memo(() => {
4648
const [inviteFormVisible, setInviteFormVisible] = useState(false);
4749
const dispatch = useDispatch();
4850
const history = useHistory();
51+
const systemInfo = useSelector(selectSystemInfo);
4952
const orgId = useSelector(selectOrgId);
5053
const list = useSelector(selectMembers);
5154
const listLoading = useSelector(selectMemberListLoading);
@@ -128,19 +131,30 @@ export const MemberList = memo(() => {
128131
[history, orgId],
129132
);
130133

134+
const toAdd = useCallback(() => {
135+
toDetail('add')();
136+
}, [toDetail]);
137+
131138
const titleProps = useMemo(
132139
() => ({
133140
key: 'list',
134141
subTitle: t('memberTitle'),
135142
search: true,
136-
add: {
137-
items: [{ key: 'invite', text: t('inviteMember') }],
138-
icon: <UserAddOutlined />,
139-
callback: showInviteForm,
140-
},
143+
add:
144+
systemInfo?.tenantManagementMode === TenantManagementMode.Platform
145+
? {
146+
items: [{ key: 'invite', text: t('inviteMember') }],
147+
icon: <UserAddOutlined />,
148+
callback: showInviteForm,
149+
}
150+
: {
151+
items: [{ key: 'add', text: t('addMember') }],
152+
icon: <UserAddOutlined />,
153+
callback: toAdd,
154+
},
141155
onSearch: debouncedSearch,
142156
}),
143-
[showInviteForm, debouncedSearch, t],
157+
[systemInfo, showInviteForm, toAdd, debouncedSearch, t],
144158
);
145159
return (
146160
<Wrapper>

0 commit comments

Comments
 (0)