Merge branch 'master' into testethdoc

pull/5370/head
Aniket 2 years ago committed by GitHub
commit 07a0f747f1
  1. 3
      apps/remix-ide/src/app/components/plugin-manager-component.js
  2. 3
      apps/remix-ide/src/app/tabs/settings-tab.tsx
  3. 4
      apps/remix-ide/src/blockchain/blockchain.js
  4. 9
      libs/remix-ui/editor/src/lib/remix-ui-editor.tsx
  5. 2
      libs/remix-ui/plugin-manager/src/lib/components/ActivePluginCard.tsx
  6. 21
      libs/remix-ui/plugin-manager/src/lib/components/permissionsSettings.tsx

@ -15,7 +15,8 @@ const profile = {
kind: 'settings',
location: 'sidePanel',
documentation: 'https://remix-ide.readthedocs.io/en/latest/plugin_manager.html',
version: packageJson.version
version: packageJson.version,
maintainedBy: "Remix"
}
class PluginManagerComponent extends ViewPlugin {

@ -17,7 +17,8 @@ const profile = {
location: 'sidePanel',
documentation: 'https://remix-ide.readthedocs.io/en/latest/settings.html',
version: packageJson.version,
permission: true
permission: true,
maintainedBy: "Remix"
}
module.exports = class SettingsTab extends ViewPlugin {

@ -31,6 +31,7 @@ export class Blockchain extends Plugin {
// NOTE: the config object will need to be refactored out in remix-lib
constructor (config) {
super(profile)
this.active = false
this.event = new EventManager()
this.executionContext = new ExecutionContext()
@ -55,11 +56,13 @@ export class Blockchain extends Plugin {
}
_triggerEvent (name, args) {
if (!this.active) return
this.event.trigger(name, args)
this.emit(name, ...args)
}
onActivation () {
this.active = true
this.on('injected', 'chainChanged', () => {
this.detectNetwork((error, network) => {
this.networkStatus = { network, error }
@ -76,6 +79,7 @@ export class Blockchain extends Plugin {
}
onDeactivation () {
this.active = false
this.off('injected', 'chainChanged')
this.off('injected-trustwallet', 'chainChanged')
}

@ -665,7 +665,7 @@ export const EditorUI = (props: EditorUIProps) => {
editor.addAction(formatAction)
editor.addAction(zoomOutAction)
editor.addAction(zoominAction)
editor.addAction(executeFreeFunctionAction)
freeFunctionAction = editor.addAction(executeFreeFunctionAction)
// we have to add the command because the menu action isn't always available (see onContextMenuHandlerForFreeFunction)
editor.addCommand(monacoRef.current.KeyMod.Shift | monacoRef.current.KeyMod.Alt | monacoRef.current.KeyCode.KeyR, () => executeFreeFunctionAction.run())
@ -673,14 +673,17 @@ export const EditorUI = (props: EditorUIProps) => {
const contextmenu = editor.getContribution('editor.contrib.contextmenu')
const orgContextMenuMethod = contextmenu._onContextMenu;
const onContextMenuHandlerForFreeFunction = async () => {
if (freeFunctionAction) {
freeFunctionAction.dispose()
freeFunctionAction = null
}
const file = await props.plugin.call('fileManager', 'getCurrentFile')
if (!file.endsWith('.sol')) {
freeFunctionCondition.set(false)
return
}
const { nodesAtPosition } = await retrieveNodesAtPosition(props.editorAPI, props.plugin)
const freeFunctionNode = nodesAtPosition.find((node) => node.kind === 'freeFunction')
if (freeFunctionAction) freeFunctionAction.dispose()
const freeFunctionNode = nodesAtPosition.find((node) => node.kind === 'freeFunction')
if (freeFunctionNode) {
executeFreeFunctionAction.label = `Run the free function "${freeFunctionNode.name}" in the Remix VM`
freeFunctionAction = editor.addAction(executeFreeFunctionAction)

@ -68,7 +68,7 @@ function ActivePluginCard ({
placement="right"
tooltipId={`pluginManagerInactiveActiveBtn${profile.name}`}
tooltipClasses="text-nowrap"
tooltipText={`Dectivate ${profile.displayName || profile.name}`}
tooltipText={`Deactivate ${profile.displayName || profile.name}`}
>
<button
onClick={() => {

@ -5,6 +5,7 @@ import { FormattedMessage, useIntl } from 'react-intl'
import { ModalDialog } from '@remix-ui/modal-dialog'
import useLocalStorage from '../custom-hooks/useLocalStorage'
import { PluginPermissions } from '../../types'
import { CustomTooltip } from '@remix-ui/helper'
function PermisssionsSettings () {
const [modalVisibility, setModalVisibility] = useState<boolean>(true)
@ -130,12 +131,20 @@ function PermisssionsSettings () {
</form>
</ModalDialog>
<footer className="bg-light remixui_permissions remix-bg-opacity">
<button
onClick={openModal}
className="btn btn-primary settings-button"
data-id="pluginManagerPermissionsButton">
<FormattedMessage id="pluginManager.Permissions" />
</button>
<CustomTooltip
placement={"top"}
tooltipId="pmPermissions"
tooltipClasses="text-nowrap"
tooltipText={"Manage plugins Permissions"}
key={"keypmPermissions"}
>
<button
onClick={openModal}
className="btn btn-primary settings-button"
data-id="pluginManagerPermissionsButton">
<FormattedMessage id="pluginManager.Permissions" />
</button>
</CustomTooltip>
</footer>
</Fragment>
)

Loading…
Cancel
Save