Skip to content

Commit 4f07bbd

Browse files
author
FalkWolsky
committed
Small fix about InviteButton - And WIP app Redirect
1 parent ad27f9b commit 4f07bbd

File tree

3 files changed

+36
-19
lines changed

3 files changed

+36
-19
lines changed

client/packages/lowcoder/src/app.tsx

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ import { initApp } from "util/commonUtils";
4949
import { favicon } from "assets/images";
5050
import { hasQueryParam } from "util/urlUtils";
5151
import { isFetchUserFinished } from "redux/selectors/usersSelectors"; // getCurrentUser,
52+
import { getIsCommonSettingFetched } from "redux/selectors/commonSettingSelectors";
5253
import { SystemWarning } from "./components/SystemWarning";
5354
import { getBrandingConfig } from "./redux/selectors/configSelectors";
5455
import { buildMaterialPreviewURL } from "./util/materialUtils";
@@ -79,6 +80,7 @@ const Wrapper = (props: { children: React.ReactNode, language: string }) => (
7980

8081
type AppIndexProps = {
8182
isFetchUserFinished: boolean;
83+
getIsCommonSettingFetched: boolean;
8284
currentOrgId?: string;
8385
orgDev: boolean;
8486
defaultHomePage: string | null | undefined;
@@ -121,7 +123,7 @@ class AppIndex extends React.Component<AppIndexProps, any> {
121123
// persisting the language in local storage
122124
localStorage.setItem('lowcoder_uiLanguage', this.props.uiLanguage);
123125

124-
// console.log("this.props.defaultHomePage: ", this.props.defaultHomePage)
126+
console.log('Props: ', this.props);
125127

126128
return (
127129
<Wrapper language={this.props.uiLanguage}>
@@ -272,21 +274,12 @@ class AppIndex extends React.Component<AppIndexProps, any> {
272274
<SystemWarning />
273275
<Router history={history}>
274276
<Switch>
275-
{/*
276-
// we decided to show the org homepage in a own navigation page
277-
{!this.props.orgDev && !!this.props.defaultHomePage ? (
278-
<Redirect exact from={BASE_URL} to={APPLICATION_VIEW_URL(this.props.defaultHomePage, "view")}
279-
/>
280-
) : (
281-
<Redirect exact from={BASE_URL} to={USER_PROFILE_URL} />
282-
)}
283-
{!this.props.orgDev && !!this.props.defaultHomePage && (
284-
<Redirect exact from={ALL_APPLICATIONS_URL} to={APPLICATION_VIEW_URL(this.props.defaultHomePage, "view")}
285-
/>
286-
)} */}
287-
288-
{!this.props.orgDev ? (
289-
<Redirect exact from={BASE_URL} to={ORG_HOME_URL} />
277+
{this.props.isFetchUserFinished && !this.props.orgDev ? (
278+
this.props.getIsCommonSettingFetched && this.props.defaultHomePage !== undefined ? (
279+
<Redirect exact from={BASE_URL} to={APPLICATION_VIEW_URL(this.props.defaultHomePage || "", "view")}/>
280+
) : (
281+
<Redirect exact from={BASE_URL} to={ORG_HOME_URL} />
282+
)
290283
) : (
291284
<Redirect exact from={BASE_URL} to={ALL_APPLICATIONS_URL} />
292285
)}
@@ -377,6 +370,7 @@ class AppIndex extends React.Component<AppIndexProps, any> {
377370

378371
const mapStateToProps = (state: AppState) => ({
379372
isFetchUserFinished: isFetchUserFinished(state),
373+
getIsCommonSettingFetched: getIsCommonSettingFetched(state),
380374
orgDev: state.ui.users.user.orgDev,
381375
currentOrgId: state.ui.users.user.currentOrgId,
382376
defaultHomePage: state.ui.application.homeOrg?.commonSettings.defaultHomePage,

client/packages/lowcoder/src/pages/ApplicationV2/index.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,10 @@ export default function ApplicationHome() {
494494

495495
]}
496496
/>
497-
{user.orgDev && (
497+
498+
{/*
499+
// we have the invite dialog in the Admin Area, so we don't need it here
500+
{user.orgDev && (
498501
<InviteDialog
499502
trigger={
500503
<InviteUser>
@@ -504,7 +507,7 @@ export default function ApplicationHome() {
504507
}
505508
style={{ marginLeft: "auto" }}
506509
/>
507-
)}
510+
)} */}
508511
</DivStyled>
509512
);
510513
}

client/packages/lowcoder/src/pages/setting/permission/permissionList.tsx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,17 @@ import { getUser } from "redux/selectors/usersSelectors";
99
import { getNextEntityName } from "util/stringUtils";
1010
import { validateResponse } from "api/apiUtils";
1111
import {
12+
AddMemberButton,
1213
GroupNameView,
1314
OperationWrapper,
1415
EditBtn,
1516
PopoverIcon,
1617
CreateButton,
1718
} from "./styledComponents";
19+
import {
20+
MembersIcon,
21+
} from "lowcoder-design";
22+
import styled from "styled-components";
1823
import { trans } from "i18n";
1924
import { getOrgGroups } from "redux/selectors/orgSelectors";
2025
import { Table } from "components/Table";
@@ -25,9 +30,17 @@ import { timestampToHumanReadable } from "../../../util/dateTimeUtils";
2530
import { usePermissionMenuItems } from "@lowcoder-ee/pages/setting/permission/permissionMenuItems";
2631
import { OrgGroup } from "constants/orgConstants";
2732
import { messageInstance } from "lowcoder-design/src/components/GlobalInstances";
33+
import InviteDialog from "pages/common/inviteDialog";
34+
import { Flex } from "antd";
2835

2936
const NEW_GROUP_PREFIX = trans("memberSettings.newGroupPrefix");
3037

38+
const StyledMembersIcon = styled(MembersIcon)`
39+
g g {
40+
stroke: #ffffff;
41+
}
42+
`;
43+
3144
type DataItemInfo = {
3245
key: string;
3346
label: string;
@@ -120,14 +133,21 @@ export default function PermissionSetting() {
120133
<Level1SettingPageTitleWithBtn>
121134
{trans("settings.userGroups")}
122135
{currentOrgAdmin(user) && (
123-
<CreateButton
136+
<Flex gap="middle">
137+
<CreateButton
124138
loading={groupCreating}
125139
buttonType={"primary"}
126140
icon={<AddIcon />}
127141
onClick={() => handleGroupCreate()}
128142
>
129143
{trans("memberSettings.createGroup")}
130144
</CreateButton>
145+
<InviteDialog
146+
trigger={<AddMemberButton buttonType="primary" icon={<StyledMembersIcon />}>
147+
{trans("memberSettings.inviteUser")}
148+
</AddMemberButton>}
149+
style={{ marginLeft: "auto" }} />
150+
</Flex>
131151
)}
132152
</Level1SettingPageTitleWithBtn>
133153
<div>

0 commit comments

Comments
 (0)