ux and text update

pull/5563/head
aniket-engg 1 month ago committed by Aniket
parent 76a9d18aa5
commit bdaef856f5
  1. 6
      apps/remix-dapp/src/locales/en/udapp.json
  2. 6
      apps/remix-ide/src/app/tabs/locales/en/udapp.json
  3. 23
      libs/remix-ui/run-tab/src/lib/components/environment.tsx

@ -51,10 +51,10 @@
"udapp.signature": "signature",
"udapp.saveVmStateTitle": "Save VM state",
"udapp.saveVmStateLabel": "State Name",
"udapp.saveVmStateTip": "Saved VM states can be pinned as environment using Environment Explorer",
"udapp.saveVmStateTip": "VM state, saved for current workspace, can be pinned as an environment using Environment Explorer",
"udapp.resetVmStateTitle": "Reset VM state",
"udapp.resetVmStateDesc1": "Resetting state of selected environment will delete all your previously saved transaction details for selected workspace.",
"udapp.resetVmStateDesc2": "It will also delete data for deployed and pinned contracts.",
"udapp.resetVmStateDesc1": "Resetting state of the selected environment will delete all your previously saved transaction details for current workspace.",
"udapp.resetVmStateDesc2": "It will also delete the data for contracts deployed and pinned for this workspace.",
"udapp.resetVmStateDesc3": "Do you want to continue?",
"udapp.reset": "Reset",
"udapp.injectedTitle": "Unfortunately it's not possible to create an account using injected provider. Please create the account directly from your provider (i.e metamask or other of the same type).",

@ -51,10 +51,10 @@
"udapp.signature": "signature",
"udapp.saveVmStateTitle": "Save VM state",
"udapp.saveVmStateLabel": "State Name",
"udapp.saveVmStateTip": "Saved VM states can be pinned as environment using Environment Explorer",
"udapp.saveVmStateTip": "VM state, saved for current workspace, can be pinned as an environment using Environment Explorer",
"udapp.resetVmStateTitle": "Reset VM state",
"udapp.resetVmStateDesc1": "Resetting state of selected environment will delete all your previously saved transaction details for selected workspace.",
"udapp.resetVmStateDesc2": "It will also delete data for deployed and pinned contracts.",
"udapp.resetVmStateDesc1": "Resetting state of the selected environment will delete all your previously saved transaction details for current workspace.",
"udapp.resetVmStateDesc2": "It will also delete the data for contracts deployed and pinned for this workspace.",
"udapp.resetVmStateDesc3": "Do you want to continue?",
"udapp.injectedTitle": "Unfortunately it's not possible to create an account using injected provider. Please create the account directly from your provider (i.e metamask or other of the same type).",
"udapp.createNewAccount": "Create new account",

@ -48,14 +48,14 @@ export function EnvironmentUI(props: EnvironmentProps) {
)
}
const resetVmStatePrompt = (context: string) => {
const resetVmStatePrompt = () => {
return (
<div>
<div>
<FormattedMessage id="udapp.resetVmStateDesc1"/><br/>
<FormattedMessage id="udapp.resetVmStateDesc2"/><br/><br/>
<FormattedMessage id="udapp.resetVmStateDesc3"/>
</div>
<ul className='ml-3'>
<li><FormattedMessage id="udapp.resetVmStateDesc1"/></li>
<li><FormattedMessage id="udapp.resetVmStateDesc2"/></li>
</ul>
<FormattedMessage id="udapp.resetVmStateDesc3"/>
</div>
)
}
@ -91,19 +91,20 @@ export function EnvironmentUI(props: EnvironmentProps) {
if (contextExists) {
props.modal(
intl.formatMessage({ id: 'udapp.resetVmStateTitle' }),
resetVmStatePrompt(context),
resetVmStatePrompt(),
intl.formatMessage({ id: 'udapp.reset' }),
async () => {
const currentProvider = await props.runTabPlugin.call('blockchain', 'getCurrentProvider')
// Reset environment blocks and account data
currentProvider.resetEnvironment()
await currentProvider.resetEnvironment()
// Remove deployed and pinned contracts from UI
props.runTabPlugin.REACT_API.instances.instanceList = {}
// Delete environment state file
await props.runTabPlugin.call('fileManager', 'remove', `.states/${context}/state.json`)
// Delete pinned contracts folder
await props.runTabPlugin.call('fileManager', 'remove', `.deploys/pinned-contracts/${context}`)
props.runTabPlugin.call('notification', 'toast', `VM state reset successfully`)
// If there are pinned contracts, delete pinned contracts folder
const isPinnedContracts = await props.runTabPlugin.call('fileManager', 'exists', `.deploys/pinned-contracts/${context}`)
if(isPinnedContracts) await props.runTabPlugin.call('fileManager', 'remove', `.deploys/pinned-contracts/${context}`)
props.runTabPlugin.call('notification', 'toast', `VM state reset successfully.`)
},
intl.formatMessage({ id: 'udapp.cancel' }),
null

Loading…
Cancel
Save