@@ -25,6 +25,8 @@ import Card from "antd/es/card/Card";
25
25
import { AccountLoginWrapper } from "./formLogin" ;
26
26
import { default as Button } from "antd/es/button" ;
27
27
import LeftOutlined from "@ant-design/icons/LeftOutlined" ;
28
+ import { fetchConfigAction } from "@lowcoder-ee/redux/reduxActions/configActions" ;
29
+ import { useDispatch } from "react-redux" ;
28
30
29
31
const StyledCard = styled . div < { $selected : boolean } > `
30
32
display: flex;
@@ -83,6 +85,7 @@ const StepBackButton = (props : {
83
85
</ Button >
84
86
)
85
87
export default function FormLoginSteps ( ) {
88
+ const dispatch = useDispatch ( ) ;
86
89
const [ account , setAccount ] = useState ( "" ) ;
87
90
const [ password , setPassword ] = useState ( "" ) ;
88
91
const redirectUrl = useRedirectUrl ( ) ;
@@ -117,7 +120,7 @@ export default function FormLoginSteps() {
117
120
. then ( ( resp ) => {
118
121
if ( validateResponse ( resp ) ) {
119
122
setOrgList ( resp . data . data ) ;
120
- if ( ! resp . data . data . lenght ) {
123
+ if ( ! resp . data . data . length ) {
121
124
throw new Error ( 'Error: no workspaces found' ) ;
122
125
}
123
126
else if ( resp . data . data . length === 1 ) {
@@ -145,7 +148,6 @@ export default function FormLoginSteps() {
145
148
< StepHeader title = { trans ( "userAuth.inputEmail" ) } />
146
149
< FormInput
147
150
className = "form-input"
148
- // label={trans("userAuth.email")}
149
151
label = { '' }
150
152
defaultValue = { account }
151
153
onChange = { ( value , valid ) => setAccount ( valid ? value : "" ) }
@@ -156,7 +158,7 @@ export default function FormLoginSteps() {
156
158
} }
157
159
/>
158
160
< ConfirmButton loading = { orgLoading } disabled = { ! account } onClick = { fetchOrgsByEmail } >
159
- Continue
161
+ { trans ( "userAuth.continue" ) }
160
162
</ ConfirmButton >
161
163
</ AccountLoginWrapper >
162
164
< Divider />
@@ -177,13 +179,14 @@ export default function FormLoginSteps() {
177
179
< >
178
180
< AccountLoginWrapper >
179
181
< StepBackButton onClick = { ( ) => setCurrentStep ( CurrentStepEnum . EMAIL ) } />
180
- < StepHeader title = { "Select your workspace" } />
182
+ < StepHeader title = { trans ( "userAuth.selectWorkspace" ) } />
181
183
{ orgList . map ( org => (
182
184
< StyledCard
183
185
key = { org . orgId }
184
186
$selected = { organizationId === org . orgId }
185
187
onClick = { ( ) => {
186
188
setOrganizationId ( org . orgId ) ;
189
+ dispatch ( fetchConfigAction ( org . orgId ) ) ;
187
190
setCurrentStep ( CurrentStepEnum . AUTH_PROVIDERS ) ;
188
191
} }
189
192
>
@@ -199,7 +202,7 @@ export default function FormLoginSteps() {
199
202
< >
200
203
< AccountLoginWrapper >
201
204
< StepBackButton onClick = { ( ) => setCurrentStep ( CurrentStepEnum . WORKSPACES ) } />
202
- < StepHeader title = { "Enter your password" } />
205
+ < StepHeader title = { trans ( "userAuth.enterPassword" ) } />
203
206
< PasswordInput
204
207
className = "form-input password-input"
205
208
passInputConf = { {
0 commit comments