Skip to content

Commit a4ccd60

Browse files
show auth providers for selected workspace
1 parent 7e199bd commit a4ccd60

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

client/packages/lowcoder/src/i18n/locales/en.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3008,7 +3008,10 @@ export const en = {
30083008
"resetSuccessDesc": "Password Reset Succeeded. The New Password is: {password}",
30093009
"resetLostPasswordSuccess": "Password Reset Succeeded. Please login again.",
30103010
"copyPassword": "Copy Password",
3011-
"poweredByLowcoder": "Powered by: Lowcoder.cloud"
3011+
"poweredByLowcoder": "Powered by: Lowcoder.cloud",
3012+
"continue": "Continue",
3013+
"enterPassword": "Enter your password",
3014+
"selectWorkspace": "Select your workspace",
30123015
},
30133016
"preLoad": {
30143017
"jsLibraryHelpText": "Add JavaScript Libraries to Your Current Application via URL Addresses. lodash, day.js, uuid, numbro are Built into the System for Immediate Use. JavaScript Libraries are Loaded Before the Application is Initialized, Which Can Have an Impact on Application Performance.",

client/packages/lowcoder/src/pages/userAuth/formLoginSteps.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ import Card from "antd/es/card/Card";
2525
import { AccountLoginWrapper } from "./formLogin";
2626
import { default as Button } from "antd/es/button";
2727
import LeftOutlined from "@ant-design/icons/LeftOutlined";
28+
import { fetchConfigAction } from "@lowcoder-ee/redux/reduxActions/configActions";
29+
import { useDispatch } from "react-redux";
2830

2931
const StyledCard = styled.div<{$selected: boolean}>`
3032
display: flex;
@@ -83,6 +85,7 @@ const StepBackButton = (props : {
8385
</Button>
8486
)
8587
export default function FormLoginSteps() {
88+
const dispatch = useDispatch();
8689
const [account, setAccount] = useState("");
8790
const [password, setPassword] = useState("");
8891
const redirectUrl = useRedirectUrl();
@@ -117,7 +120,7 @@ export default function FormLoginSteps() {
117120
.then((resp) => {
118121
if (validateResponse(resp)) {
119122
setOrgList(resp.data.data);
120-
if (!resp.data.data.lenght) {
123+
if (!resp.data.data.length) {
121124
throw new Error('Error: no workspaces found');
122125
}
123126
else if (resp.data.data.length === 1) {
@@ -145,7 +148,6 @@ export default function FormLoginSteps() {
145148
<StepHeader title={trans("userAuth.inputEmail")} />
146149
<FormInput
147150
className="form-input"
148-
// label={trans("userAuth.email")}
149151
label={''}
150152
defaultValue={account}
151153
onChange={(value, valid) => setAccount(valid ? value : "")}
@@ -156,7 +158,7 @@ export default function FormLoginSteps() {
156158
}}
157159
/>
158160
<ConfirmButton loading={orgLoading} disabled={!account} onClick={fetchOrgsByEmail}>
159-
Continue
161+
{trans("userAuth.continue")}
160162
</ConfirmButton>
161163
</AccountLoginWrapper>
162164
<Divider/>
@@ -177,13 +179,14 @@ export default function FormLoginSteps() {
177179
<>
178180
<AccountLoginWrapper>
179181
<StepBackButton onClick={() => setCurrentStep(CurrentStepEnum.EMAIL)} />
180-
<StepHeader title={"Select your workspace"} />
182+
<StepHeader title={trans("userAuth.selectWorkspace")} />
181183
{orgList.map(org => (
182184
<StyledCard
183185
key={org.orgId}
184186
$selected={organizationId === org.orgId}
185187
onClick={() => {
186188
setOrganizationId(org.orgId);
189+
dispatch(fetchConfigAction(org.orgId));
187190
setCurrentStep(CurrentStepEnum.AUTH_PROVIDERS);
188191
}}
189192
>
@@ -199,7 +202,7 @@ export default function FormLoginSteps() {
199202
<>
200203
<AccountLoginWrapper>
201204
<StepBackButton onClick={() => setCurrentStep(CurrentStepEnum.WORKSPACES)} />
202-
<StepHeader title={"Enter your password"} />
205+
<StepHeader title={trans("userAuth.enterPassword")} />
203206
<PasswordInput
204207
className="form-input password-input"
205208
passInputConf={{

client/packages/lowcoder/src/pages/userAuth/thirdParty/thirdPartyAuth.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ import styled from "styled-components";
1414
import { trans } from "i18n";
1515
import { geneAuthStateAndSaveParam, getAuthUrl, getRedirectUrl } from "pages/userAuth/authUtils";
1616
import { default as Divider } from "antd/es/divider";
17+
import { default as Typography } from "antd/es/typography";
1718
import { useRedirectUrl } from "util/hooks";
1819
import { MultiIconDisplay } from "../../../comps/comps/multiIconDisplay";
1920

21+
const { Text } = Typography;
22+
2023
const ThirdPartyLoginButtonWrapper = styled.div`
2124
button{
2225
width: 100%;
@@ -128,7 +131,11 @@ export function ThirdPartyAuth(props: {
128131
});
129132
return (
130133
<ThirdPartyLoginButtonWrapper>
131-
{ Boolean(socialLoginButtons.length) && <Divider /> }
134+
{ Boolean(socialLoginButtons.length) && (
135+
<Divider plain>
136+
<Text type="secondary">or</Text>
137+
</Divider>
138+
)}
132139
{socialLoginButtons}
133140
</ThirdPartyLoginButtonWrapper>
134141
);

0 commit comments

Comments
 (0)