From 62747b5fbebf6d162b865ac49d3dea3f56e06927 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Wed, 8 Sep 2021 19:24:44 +0530 Subject: [PATCH 1/3] hardhat compilation with error and result fixed --- libs/remixd/src/services/hardhatClient.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/remixd/src/services/hardhatClient.ts b/libs/remixd/src/services/hardhatClient.ts index 217a934e2d..b62258251a 100644 --- a/libs/remixd/src/services/hardhatClient.ts +++ b/libs/remixd/src/services/hardhatClient.ts @@ -37,10 +37,11 @@ export class HardhatClient extends PluginClient { result += msg + '\n' }) child.stderr.on('data', (err) => { - error += `[Hardhat Compilation]: ${err.toString()}` + error += `[Hardhat Compilation]: ${err.toString()} \n` }) child.on('close', () => { - if (error) reject(error) + if (error && result) resolve(error + result) + else if (error) reject(error) else resolve(result) }) }) From 3b3ad46383959e7e921b0679a368556866a8cecc Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Wed, 8 Sep 2021 19:37:32 +0530 Subject: [PATCH 2/3] linting fix --- libs/remixd/src/services/hardhatClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remixd/src/services/hardhatClient.ts b/libs/remixd/src/services/hardhatClient.ts index b62258251a..62400debda 100644 --- a/libs/remixd/src/services/hardhatClient.ts +++ b/libs/remixd/src/services/hardhatClient.ts @@ -40,7 +40,7 @@ export class HardhatClient extends PluginClient { error += `[Hardhat Compilation]: ${err.toString()} \n` }) child.on('close', () => { - if (error && result) resolve(error + result) + if (error && result) resolve(error + result) else if (error) reject(error) else resolve(result) }) From 09a2645066858c5dba00ae4cb148ad50e2179097 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Thu, 9 Sep 2021 11:27:59 +0200 Subject: [PATCH 3/3] Update LocalPluginForm.tsx --- .../src/lib/components/LocalPluginForm.tsx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/libs/remix-ui/plugin-manager/src/lib/components/LocalPluginForm.tsx b/libs/remix-ui/plugin-manager/src/lib/components/LocalPluginForm.tsx index 71ddb5b7ff..6e768a935e 100644 --- a/libs/remix-ui/plugin-manager/src/lib/components/LocalPluginForm.tsx +++ b/libs/remix-ui/plugin-manager/src/lib/components/LocalPluginForm.tsx @@ -41,6 +41,7 @@ function LocalPluginForm ({ closeModal, visible, pluginManager }: LocalPluginFor const [type, setType] = useState<'iframe' | 'ws'>('iframe') const [location, setLocation] = useState<'sidePanel' | 'mainPanel' | 'none'>('sidePanel') const [methods, setMethods] = useState('') + const [canactivate, setCanactivate] = useState('') useEffect(() => { const storagePlugin:FormStateProps = localStorage.getItem('plugins/local') ? JSON.parse(localStorage.getItem('plugins/local')) : defaultProfile @@ -73,7 +74,8 @@ function LocalPluginForm ({ closeModal, visible, pluginManager }: LocalPluginFor url: url, type: type, location: location, - icon: 'assets/img/localPlugin.webp' + icon: 'assets/img/localPlugin.webp', + canActivate: typeof canactivate === 'string' ? canactivate.split(',').filter(val => val) : [] } const localPlugin = type === 'iframe' ? new IframePlugin(initialState) : new WebsocketPlugin(initialState) localPlugin.profile.hash = `local-${name}` @@ -122,14 +124,24 @@ function LocalPluginForm ({ closeModal, visible, pluginManager }: LocalPluginFor placeholder="Name in the header" />
- + setMethods(e.target.value)} value={ methods } id="plugin-methods" data-id="localPluginMethods" - placeholder="Name in the header" /> + placeholder="Methods" /> +
+
+ + setCanactivate(e.target.value)} + value={ canactivate } + id="plugin-canactivate" + data-id="localPluginCanActivate" + placeholder="Plugin names" />