diff --git a/server/constants.js b/server/constants.js index 6bab8c07e4..ca57a8500e 100644 --- a/server/constants.js +++ b/server/constants.js @@ -223,7 +223,8 @@ exports.KIT_CONFIG_KEYS = [ 'referral_history_config', 'chain_trade_config', 'selectable_native_currencies', - 'auto_trade_config' + 'auto_trade_config', + 'apps' ]; exports.KIT_SECRETS_KEYS = [ diff --git a/server/tools/dbs/checkConfig.js b/server/tools/dbs/checkConfig.js index a31bf2a56b..8d418d3e51 100644 --- a/server/tools/dbs/checkConfig.js +++ b/server/tools/dbs/checkConfig.js @@ -70,6 +70,7 @@ Status.findOne() balance_history_config: existingKitConfigurations.balance_history_config || {}, selectable_native_currencies: existingKitConfigurations?.selectable_native_currencies || [existingKitConfigurations.native_currency || process.env.NATIVE_CURRENCY || 'usdt'], auto_trade_config: existingKitConfigurations.auto_trade_config || {}, + apps: existingKitConfigurations.apps || {}, }; const secrets = { diff --git a/web/src/containers/Admin/General/General.js b/web/src/containers/Admin/General/General.js index f70ad29ff2..d4e3519382 100644 --- a/web/src/containers/Admin/General/General.js +++ b/web/src/containers/Admin/General/General.js @@ -35,7 +35,11 @@ import { COUNTRIES_OPTIONS } from '../../../utils/countries'; import _get from 'lodash/get'; import './index.css'; -import { handleFiatUpgrade, handleUpgrade } from 'utils/utils'; +import { + handleFiatUpgrade, + handleUpgrade, + handleEnterpriseUpgrade, +} from 'utils/utils'; import { checkFileSize, fileSizeError } from 'utils/icon'; import PublishSection from './PublishSection'; import { CloseCircleOutlined } from '@ant-design/icons'; @@ -516,7 +520,8 @@ class GeneralContent extends Component { features, balance_history_config = null, referral_history_config = null, - chain_trade_config = null + chain_trade_config = null, + auto_trade_config = null ) => { this.handleSubmitGeneral({ kit: { @@ -524,6 +529,7 @@ class GeneralContent extends Component { balance_history_config, referral_history_config, chain_trade_config, + auto_trade_config, }, }); }; @@ -649,6 +655,32 @@ class GeneralContent extends Component { } }; + handleInputChange = (key, value) => { + this.setState((prevState) => ({ + constants: { + ...prevState.constants, + kit: { + ...prevState.constants.kit, + apps: { + ...prevState.constants.kit.apps, + [key]: value, + }, + }, + }, + })); + }; + + handleSave = async () => { + try { + this.handleSubmitGeneral({ + kit: { + apps: this.state.constants.kit.apps, + }, + }); + } catch (error) { + message.error(error.message); + } + }; renderModalContent = () => { const { screen, removeCountryLabel, selectedCountry } = this.state; switch (screen) { @@ -791,6 +823,7 @@ class GeneralContent extends Component { } const isUpgrade = handleUpgrade(kit.info); const isFiatUpgrade = handleFiatUpgrade(kit.info); + const isEnterpriseUpgrade = handleEnterpriseUpgrade(kit.info); return (
+ You can configure below fields for you mobile application. Those + are publicly available for the users. +
+ +