diff --git a/object/user.go b/object/user.go index b3ce72b1..3ad28ed9 100644 --- a/object/user.go +++ b/object/user.go @@ -449,7 +449,7 @@ func UpdateUser(id string, user *User, columns []string, isGlobalAdmin bool) boo if len(columns) == 0 { columns = []string{ "owner", "display_name", "avatar", - "location", "address", "region", "language", "affiliation", "title", "homepage", "bio", "score", "tag", "signup_application", + "location", "address", "country_code", "region", "language", "affiliation", "title", "homepage", "bio", "score", "tag", "signup_application", "is_admin", "is_global_admin", "is_forbidden", "is_deleted", "hash", "is_default_avatar", "properties", "webauthnCredentials", "managedAccounts", "signin_wrong_times", "last_signin_wrong_time", } diff --git a/web/src/OrganizationEditPage.js b/web/src/OrganizationEditPage.js index 860e6668..f91ebc77 100644 --- a/web/src/OrganizationEditPage.js +++ b/web/src/OrganizationEditPage.js @@ -184,7 +184,7 @@ class OrganizationEditPage extends React.Component { - {Setting.getLabel(i18next.t("general:Supported country code"), i18next.t("general:Supported country code - Tooltip"))} : + {Setting.getLabel(i18next.t("general:Supported country codes"), i18next.t("general:Supported country codes - Tooltip"))} : : } + prefix={destType === "email" ?    : (  {`+${Setting.getCountryCode(account.countryCode)}`} )} placeholder={placeholder} onChange={e => setDest(e.target.value)} /> diff --git a/web/src/Setting.js b/web/src/Setting.js index 2a81f396..864546ac 100644 --- a/web/src/Setting.js +++ b/web/src/Setting.js @@ -208,6 +208,10 @@ export function initCountries() { return countries; } +export function getCountryCode(country) { + return phoneNumber.getCountryCallingCode(country); +} + export function getCountryCodeData(countryCodes = phoneNumber.getCountries()) { return countryCodes?.map((countryCode) => { if (phoneNumber.isSupportedCountry(countryCode)) { diff --git a/web/src/UserEditPage.js b/web/src/UserEditPage.js index d4f71258..fb2fd3f4 100644 --- a/web/src/UserEditPage.js +++ b/web/src/UserEditPage.js @@ -296,7 +296,7 @@ class UserEditPage extends React.Component { {/* backend auto get the current user, so admin can not edit. Just self can reset*/} - {this.isSelf() ? : null} + {this.isSelf() ? : null} ); @@ -310,7 +310,7 @@ class UserEditPage extends React.Component { { this.updateUserField("countryCode", value); @@ -326,7 +326,7 @@ class UserEditPage extends React.Component { - {this.isSelf() ? () : null} + {this.isSelf() ? () : null} ); diff --git a/web/src/locales/de/data.json b/web/src/locales/de/data.json index 817c765b..f79503d4 100644 --- a/web/src/locales/de/data.json +++ b/web/src/locales/de/data.json @@ -251,8 +251,8 @@ "Successfully added": "Successfully added", "Successfully deleted": "Successfully deleted", "Successfully saved": "Successfully saved", - "Supported country code": "Supported country code", - "Supported country code - Tooltip": "Supported country code - Tooltip", + "Supported country codes": "Supported country codes", + "Supported country codes - Tooltip": "Supported country codes - Tooltip", "Swagger": "Swagger", "Sync": "Sync", "Syncers": "Syncers", diff --git a/web/src/locales/en/data.json b/web/src/locales/en/data.json index 8d70d352..2c1913a9 100644 --- a/web/src/locales/en/data.json +++ b/web/src/locales/en/data.json @@ -251,8 +251,8 @@ "Successfully added": "Successfully added", "Successfully deleted": "Successfully deleted", "Successfully saved": "Successfully saved", - "Supported country code": "Supported country code", - "Supported country code - Tooltip": "Supported country code - Tooltip", + "Supported country codes": "Supported country codes", + "Supported country codes - Tooltip": "Supported country codes - Tooltip", "Swagger": "Swagger", "Sync": "Sync", "Syncers": "Syncers", diff --git a/web/src/locales/es/data.json b/web/src/locales/es/data.json index 4c305475..dee6ac5f 100644 --- a/web/src/locales/es/data.json +++ b/web/src/locales/es/data.json @@ -251,8 +251,8 @@ "Successfully added": "Successfully added", "Successfully deleted": "Successfully deleted", "Successfully saved": "Successfully saved", - "Supported country code": "Supported country code", - "Supported country code - Tooltip": "Supported country code - Tooltip", + "Supported country codes": "Supported country codes", + "Supported country codes - Tooltip": "Supported country codes - Tooltip", "Swagger": "Swagger", "Sync": "Sincronizador", "Syncers": "Sincronizadores", diff --git a/web/src/locales/fr/data.json b/web/src/locales/fr/data.json index aa26c787..2d5b3034 100644 --- a/web/src/locales/fr/data.json +++ b/web/src/locales/fr/data.json @@ -251,8 +251,8 @@ "Successfully added": "Successfully added", "Successfully deleted": "Successfully deleted", "Successfully saved": "Successfully saved", - "Supported country code": "Supported country code", - "Supported country code - Tooltip": "Supported country code - Tooltip", + "Supported country codes": "Supported country codes", + "Supported country codes - Tooltip": "Supported country codes - Tooltip", "Swagger": "Swagger", "Sync": "Sync", "Syncers": "Synchronisateurs", diff --git a/web/src/locales/ja/data.json b/web/src/locales/ja/data.json index 379433a7..e7fdf554 100644 --- a/web/src/locales/ja/data.json +++ b/web/src/locales/ja/data.json @@ -251,8 +251,8 @@ "Successfully added": "Successfully added", "Successfully deleted": "Successfully deleted", "Successfully saved": "Successfully saved", - "Supported country code": "Supported country code", - "Supported country code - Tooltip": "Supported country code - Tooltip", + "Supported country codes": "Supported country codes", + "Supported country codes - Tooltip": "Supported country codes - Tooltip", "Swagger": "Swagger", "Sync": "Sync", "Syncers": "Syncers", diff --git a/web/src/locales/ko/data.json b/web/src/locales/ko/data.json index 106a8b64..5f3e9c41 100644 --- a/web/src/locales/ko/data.json +++ b/web/src/locales/ko/data.json @@ -251,8 +251,8 @@ "Successfully added": "Successfully added", "Successfully deleted": "Successfully deleted", "Successfully saved": "Successfully saved", - "Supported country code": "Supported country code", - "Supported country code - Tooltip": "Supported country code - Tooltip", + "Supported country codes": "Supported country codes", + "Supported country codes - Tooltip": "Supported country codes - Tooltip", "Swagger": "Swagger", "Sync": "Sync", "Syncers": "Syncers", diff --git a/web/src/locales/ru/data.json b/web/src/locales/ru/data.json index 891c95fe..f91ec2d8 100644 --- a/web/src/locales/ru/data.json +++ b/web/src/locales/ru/data.json @@ -251,8 +251,8 @@ "Successfully added": "Successfully added", "Successfully deleted": "Successfully deleted", "Successfully saved": "Successfully saved", - "Supported country code": "Supported country code", - "Supported country code - Tooltip": "Supported country code - Tooltip", + "Supported country codes": "Supported country codes", + "Supported country codes - Tooltip": "Supported country codes - Tooltip", "Swagger": "Swagger", "Sync": "Sync", "Syncers": "Синхронизаторы", diff --git a/web/src/locales/vi/data.json b/web/src/locales/vi/data.json index 8d70d352..2c1913a9 100644 --- a/web/src/locales/vi/data.json +++ b/web/src/locales/vi/data.json @@ -251,8 +251,8 @@ "Successfully added": "Successfully added", "Successfully deleted": "Successfully deleted", "Successfully saved": "Successfully saved", - "Supported country code": "Supported country code", - "Supported country code - Tooltip": "Supported country code - Tooltip", + "Supported country codes": "Supported country codes", + "Supported country codes - Tooltip": "Supported country codes - Tooltip", "Swagger": "Swagger", "Sync": "Sync", "Syncers": "Syncers", diff --git a/web/src/locales/zh/data.json b/web/src/locales/zh/data.json index e3d9341d..422be4a7 100644 --- a/web/src/locales/zh/data.json +++ b/web/src/locales/zh/data.json @@ -251,8 +251,8 @@ "Successfully added": "添加成功", "Successfully deleted": "删除成功", "Successfully saved": "保存成功", - "Supported country code": "支持的国家代码", - "Supported country code - Tooltip": "支持发送短信的国家 - Tooltip", + "Supported country codes": "支持的国家代码", + "Supported country codes - Tooltip": "支持发送短信的国家 - Tooltip", "Swagger": "API文档", "Sync": "同步", "Syncers": "同步器",