ux and text update

pull/5563/head
aniket-engg 2 months 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. 21
      libs/remix-ui/run-tab/src/lib/components/environment.tsx

@ -51,10 +51,10 @@
"udapp.signature": "signature", "udapp.signature": "signature",
"udapp.saveVmStateTitle": "Save VM state", "udapp.saveVmStateTitle": "Save VM state",
"udapp.saveVmStateLabel": "State Name", "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.resetVmStateTitle": "Reset VM state",
"udapp.resetVmStateDesc1": "Resetting state of selected environment will delete all your previously saved transaction details for selected workspace.", "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 data for deployed and pinned contracts.", "udapp.resetVmStateDesc2": "It will also delete the data for contracts deployed and pinned for this workspace.",
"udapp.resetVmStateDesc3": "Do you want to continue?", "udapp.resetVmStateDesc3": "Do you want to continue?",
"udapp.reset": "Reset", "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).", "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.signature": "signature",
"udapp.saveVmStateTitle": "Save VM state", "udapp.saveVmStateTitle": "Save VM state",
"udapp.saveVmStateLabel": "State Name", "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.resetVmStateTitle": "Reset VM state",
"udapp.resetVmStateDesc1": "Resetting state of selected environment will delete all your previously saved transaction details for selected workspace.", "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 data for deployed and pinned contracts.", "udapp.resetVmStateDesc2": "It will also delete the data for contracts deployed and pinned for this workspace.",
"udapp.resetVmStateDesc3": "Do you want to continue?", "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.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", "udapp.createNewAccount": "Create new account",

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

Loading…
Cancel
Save