mirror of
https://github.com/casdoor/casdoor.git
synced 2025-09-09 23:42:55 +08:00
feat: fix empty value of countryCode for signup (#1620)
This commit is contained in:
@@ -24,7 +24,7 @@ import * as ProviderEditTestSms from "./TestSmsWidget";
|
|||||||
import copy from "copy-to-clipboard";
|
import copy from "copy-to-clipboard";
|
||||||
import {CaptchaPreview} from "./common/CaptchaPreview";
|
import {CaptchaPreview} from "./common/CaptchaPreview";
|
||||||
import * as OrganizationBackend from "./backend/OrganizationBackend";
|
import * as OrganizationBackend from "./backend/OrganizationBackend";
|
||||||
import {PhoneNumberInput} from "./common/PhoneNumberInput";
|
import {CountryCodeSelect} from "./common/CountryCodeSelect";
|
||||||
|
|
||||||
const {Option} = Select;
|
const {Option} = Select;
|
||||||
const {TextArea} = Input;
|
const {TextArea} = Input;
|
||||||
@@ -667,7 +667,7 @@ class ProviderEditPage extends React.Component {
|
|||||||
</Col>
|
</Col>
|
||||||
<Col span={4} >
|
<Col span={4} >
|
||||||
<Input.Group compact>
|
<Input.Group compact>
|
||||||
<PhoneNumberInput
|
<CountryCodeSelect
|
||||||
style={{width: "30%"}}
|
style={{width: "30%"}}
|
||||||
value={this.state.provider.content}
|
value={this.state.provider.content}
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
|
@@ -29,7 +29,7 @@ import SelectRegionBox from "./SelectRegionBox";
|
|||||||
import WebAuthnCredentialTable from "./WebauthnCredentialTable";
|
import WebAuthnCredentialTable from "./WebauthnCredentialTable";
|
||||||
import ManagedAccountTable from "./ManagedAccountTable";
|
import ManagedAccountTable from "./ManagedAccountTable";
|
||||||
import PropertyTable from "./propertyTable";
|
import PropertyTable from "./propertyTable";
|
||||||
import {PhoneNumberInput} from "./common/PhoneNumberInput";
|
import {CountryCodeSelect} from "./common/CountryCodeSelect";
|
||||||
|
|
||||||
const {Option} = Select;
|
const {Option} = Select;
|
||||||
|
|
||||||
@@ -312,7 +312,7 @@ class UserEditPage extends React.Component {
|
|||||||
</Col>
|
</Col>
|
||||||
<Col style={{paddingRight: "20px"}} span={11} >
|
<Col style={{paddingRight: "20px"}} span={11} >
|
||||||
<Input.Group compact style={{width: "280Px"}}>
|
<Input.Group compact style={{width: "280Px"}}>
|
||||||
<PhoneNumberInput
|
<CountryCodeSelect
|
||||||
style={{width: "30%"}}
|
style={{width: "30%"}}
|
||||||
// disabled={!Setting.isLocalAdminUser(this.props.account) ? true : disabled}
|
// disabled={!Setting.isLocalAdminUser(this.props.account) ? true : disabled}
|
||||||
value={this.state.user.countryCode}
|
value={this.state.user.countryCode}
|
||||||
|
@@ -26,7 +26,7 @@ import SelectRegionBox from "../SelectRegionBox";
|
|||||||
import CustomGithubCorner from "../CustomGithubCorner";
|
import CustomGithubCorner from "../CustomGithubCorner";
|
||||||
import SelectLanguageBox from "../SelectLanguageBox";
|
import SelectLanguageBox from "../SelectLanguageBox";
|
||||||
import {withRouter} from "react-router-dom";
|
import {withRouter} from "react-router-dom";
|
||||||
import {PhoneNumberInput} from "../common/PhoneNumberInput";
|
import {CountryCodeSelect} from "../common/CountryCodeSelect";
|
||||||
|
|
||||||
const formItemLayout = {
|
const formItemLayout = {
|
||||||
labelCol: {
|
labelCol: {
|
||||||
@@ -208,7 +208,6 @@ class SignupPage extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="username"
|
name="username"
|
||||||
key="username"
|
|
||||||
label={i18next.t("signup:Username")}
|
label={i18next.t("signup:Username")}
|
||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
@@ -227,7 +226,6 @@ class SignupPage extends React.Component {
|
|||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="firstName"
|
name="firstName"
|
||||||
key="firstName"
|
|
||||||
label={i18next.t("general:First name")}
|
label={i18next.t("general:First name")}
|
||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
@@ -241,7 +239,6 @@ class SignupPage extends React.Component {
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="lastName"
|
name="lastName"
|
||||||
key="lastName"
|
|
||||||
label={i18next.t("general:Last name")}
|
label={i18next.t("general:Last name")}
|
||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
@@ -260,7 +257,6 @@ class SignupPage extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="name"
|
name="name"
|
||||||
key="name"
|
|
||||||
label={(signupItem.rule === "Real name" || signupItem.rule === "First, last") ? i18next.t("general:Real name") : i18next.t("general:Display name")}
|
label={(signupItem.rule === "Real name" || signupItem.rule === "First, last") ? i18next.t("general:Real name") : i18next.t("general:Display name")}
|
||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
@@ -277,7 +273,6 @@ class SignupPage extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="affiliation"
|
name="affiliation"
|
||||||
key="affiliation"
|
|
||||||
label={i18next.t("user:Affiliation")}
|
label={i18next.t("user:Affiliation")}
|
||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
@@ -294,7 +289,6 @@ class SignupPage extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="idCard"
|
name="idCard"
|
||||||
key="idCard"
|
|
||||||
label={i18next.t("user:ID card")}
|
label={i18next.t("user:ID card")}
|
||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
@@ -316,7 +310,6 @@ class SignupPage extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="country_region"
|
name="country_region"
|
||||||
key="region"
|
|
||||||
label={i18next.t("user:Country/Region")}
|
label={i18next.t("user:Country/Region")}
|
||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
@@ -333,7 +326,6 @@ class SignupPage extends React.Component {
|
|||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="email"
|
name="email"
|
||||||
key="email"
|
|
||||||
label={i18next.t("general:Email")}
|
label={i18next.t("general:Email")}
|
||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
@@ -359,7 +351,6 @@ class SignupPage extends React.Component {
|
|||||||
signupItem.rule !== "No verification" &&
|
signupItem.rule !== "No verification" &&
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="emailCode"
|
name="emailCode"
|
||||||
key="emailCode"
|
|
||||||
label={i18next.t("code:Email code")}
|
label={i18next.t("code:Email code")}
|
||||||
rules={[{
|
rules={[{
|
||||||
required: required,
|
required: required,
|
||||||
@@ -383,7 +374,6 @@ class SignupPage extends React.Component {
|
|||||||
<Input.Group compact>
|
<Input.Group compact>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="countryCode"
|
name="countryCode"
|
||||||
key="countryCode"
|
|
||||||
noStyle
|
noStyle
|
||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
@@ -392,14 +382,13 @@ class SignupPage extends React.Component {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<PhoneNumberInput
|
<CountryCodeSelect
|
||||||
style={{width: "35%"}}
|
style={{width: "35%"}}
|
||||||
countryCodes={this.getApplicationObj().organizationObj.countryCodes}
|
countryCodes={this.getApplicationObj().organizationObj.countryCodes}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="phone"
|
name="phone"
|
||||||
key="phone"
|
|
||||||
dependencies={["countryCode"]}
|
dependencies={["countryCode"]}
|
||||||
noStyle
|
noStyle
|
||||||
rules={[
|
rules={[
|
||||||
@@ -429,7 +418,6 @@ class SignupPage extends React.Component {
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="phoneCode"
|
name="phoneCode"
|
||||||
key="phoneCode"
|
|
||||||
label={i18next.t("code:Phone code")}
|
label={i18next.t("code:Phone code")}
|
||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
@@ -443,7 +431,7 @@ class SignupPage extends React.Component {
|
|||||||
method={"signup"}
|
method={"signup"}
|
||||||
onButtonClickArgs={[this.state.phone, "phone", Setting.getApplicationName(application)]}
|
onButtonClickArgs={[this.state.phone, "phone", Setting.getApplicationName(application)]}
|
||||||
application={application}
|
application={application}
|
||||||
countryCode={this.state.countryCode}
|
countryCode={this.form.current?.getFieldValue("countryCode")}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
@@ -452,7 +440,6 @@ class SignupPage extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="password"
|
name="password"
|
||||||
key="password"
|
|
||||||
label={i18next.t("general:Password")}
|
label={i18next.t("general:Password")}
|
||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
@@ -470,7 +457,6 @@ class SignupPage extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="confirm"
|
name="confirm"
|
||||||
key="confirm"
|
|
||||||
label={i18next.t("signup:Confirm")}
|
label={i18next.t("signup:Confirm")}
|
||||||
dependencies={["password"]}
|
dependencies={["password"]}
|
||||||
hasFeedback
|
hasFeedback
|
||||||
|
@@ -16,7 +16,7 @@ import {Select} from "antd";
|
|||||||
import * as Setting from "../Setting";
|
import * as Setting from "../Setting";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
export const PhoneNumberInput = (props) => {
|
export const CountryCodeSelect = (props) => {
|
||||||
const {onChange, style, disabled, value} = props;
|
const {onChange, style, disabled, value} = props;
|
||||||
const countryCodes = props.countryCodes ?? [];
|
const countryCodes = props.countryCodes ?? [];
|
||||||
|
|
Reference in New Issue
Block a user