From 4e88280f24144b0de000fe3390d3926dbf6b44b3 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Fri, 12 Nov 2021 11:21:34 +0530 Subject: [PATCH] generate and how to use buttons UI --- .../src/lib/solidity-unit-testing.tsx | 79 ++++++++++++++++--- 1 file changed, 68 insertions(+), 11 deletions(-) diff --git a/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx b/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx index 8e3d04adf8..f5827d8d52 100644 --- a/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx +++ b/libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx @@ -79,6 +79,61 @@ export const SolidityUnitTesting = (props: SolidityUnitTestingProps) => { // this.uiPathList.appendChild(yo``) } + const updateGenerateFileAction = () => { + console.log('updateGenerateFileAction') + return ( + ) + // const el = yo` + // + // ` + // if (!this.generateFileActionElement) { + // this.generateFileActionElement = el + // } else { + // yo.update(this.generateFileActionElement, el) + // } + // return this.generateFileActionElement + } + + const updateRunAction = (currentFile: any) => { + + console.log('updateRunAction --currentFile-->', currentFile) + + // const el = yo` + // + // ` + // const isSolidityActive = this.appManager.isActive('solidity') + // if (!isSolidityActive || !this.listTests().length) { + // el.setAttribute('disabled', 'disabled') + // if (!currentFile || (currentFile && currentFile.split('.').pop().toLowerCase() !== 'sol')) { + // el.setAttribute('title', 'No solidity file selected') + // } else { + // el.setAttribute('title', 'The "Solidity Plugin" should be activated') + // } + // } + // if (!this.runActionElement) { + // this.runActionElement = el + // } else { + // yo.update(this.runActionElement, el) + // } + // return this.runActionElement + } + console.log('props---->', props) return (
@@ -113,24 +168,26 @@ export const SolidityUnitTesting = (props: SolidityUnitTestingProps) => {
- {/*
+
- ${this.updateGenerateFileAction()} - ${this.infoButton()} + {updateGenerateFileAction()} + + +
- ${this.updateRunAction()} - ${this.updateStopAction()} + {/* updateRunAction() */} + {/* ${this.updateStopAction()} */}
- ${this.selectAll()} - ${this.updateTestFileList()} + {/* ${this.selectAll()} + ${this.updateTestFileList()} */}
- ${this.resultStatistics} + {/* ${this.resultStatistics} ${this.testsExecutionStopped} - ${this.testsExecutionStoppedError} + ${this.testsExecutionStoppedError} */}
- ${this.testsOutput} -
*/} + {/* ${this.testsOutput} */} +
) }