@@ -25,6 +25,8 @@ import Card from "antd/es/card/Card";
2525import { AccountLoginWrapper } from "./formLogin" ;
2626import { default as Button } from "antd/es/button" ;
2727import LeftOutlined from "@ant-design/icons/LeftOutlined" ;
28+ import { fetchConfigAction } from "@lowcoder-ee/redux/reduxActions/configActions" ;
29+ import { useDispatch } from "react-redux" ;
2830
2931const StyledCard = styled . div < { $selected : boolean } > `
3032 display: flex;
@@ -83,6 +85,7 @@ const StepBackButton = (props : {
8385 </ Button >
8486)
8587export 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 = { {
0 commit comments