add changes as @Aniket-Engg comments

pull/3321/head^2
Joseph Izang 2 years ago committed by Aniket
parent 4da0156537
commit d4b9b7eaa3
  1. 4
      apps/remix-ide/src/app/tabs/locales/en/solidity.json
  2. 7
      libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx
  3. 7
      libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx

@ -22,8 +22,8 @@
"solidity.noFileSelected": "no file selected",
"solidity.compileAndRunScript": "Compile and Run script",
"solidity.publishOn": "Publish on",
"solidity.flatten": "Flatten contracts with imports before UML generation.",
"solidity.generateUML": "Genrate a UML diagram of your contract.",
"solidity.flatten": "Flatten contracts before UML generation.",
"solidity.generateUML": "Generate a UML diagram of your contract.",
"solidity.flattenLabel": "Flatten",
"solidity.generateUMLLabel": "Generate UML Diagram",
"solidity.Assembly": "Assembly opcodes describing the contract including corresponding solidity source code",

@ -5,9 +5,6 @@ import { CompilerContainerProps } from './types'
import { ConfigurationSettings } from '@remix-project/remix-lib'
import { checkSpecialChars, CustomTooltip, extractNameFromKey } from '@remix-ui/helper'
import { canUseWorker, baseURLBin, baseURLWasm, urlFromVersion, pathToURL } from '@remix-project/remix-solidity'
import { compilerReducer, compilerInitialState } from './reducers/compiler'
import { resetEditorMode, listenToEvents } from './actions/compiler'
import { getValidLanguage } from '@remix-project/remix-solidity'
@ -17,7 +14,6 @@ import axios, { AxiosResponse } from 'axios'
import './css/style.css'
const defaultPath = "compiler_config.json"
declare global {
@ -27,9 +23,6 @@ declare global {
}
}
type AstNode = { id: number, literals: string[], nodeType: string, src: string }
const _paq = window._paq = window._paq || [] //eslint-disable-line
export const CompilerContainer = (props: CompilerContainerProps) => {

@ -16,14 +16,13 @@ import { concatSourceFiles, getDependencyGraph } from './logic/flattenerUtilitie
import Viewer from 'react-viewer'
import { jsPDF } from 'jspdf'
const pdfBuilder = new jsPDF('portrait')
export const ContractSelection = (props: ContractSelectionProps) => {
const { api, compiledFileName, contractsDetails, contractList, compilerInput, modal } = props
const [selectedContract, setSelectedContract] = useState('')
const [storage, setStorage] = useState(null)
const [svgPayload, setSVGPayload] = useState('')
const [showViewer, setShowViewer] = useState(false)
const [content4AST, setContent4AST] = useState('')
const [contentForAST, setContentForAST] = useState('')
const intl = useIntl()
@ -210,7 +209,7 @@ export const ContractSelection = (props: ContractSelectionProps) => {
const generateUML = () => {
try {
const currentFile = api.currentFile
const ast = content4AST.length > 1 ? parser.parse(content4AST) : parser.parse(api.getCompilationResult().source.sources[currentFile].content)
const ast = contentForAST.length > 1 ? parser.parse(contentForAST) : parser.parse(api.getCompilationResult().source.sources[currentFile].content)
const payload = vizRenderStringSync(convertUmlClasses2Dot(convertAST2UmlClasses(ast, currentFile)))
const fileName = `${api.currentFile.split('/')[0]}/resources/${api.currentFile.split('/')[1].split('.')[0]}.pdf`
@ -243,7 +242,7 @@ export const ContractSelection = (props: ContractSelectionProps) => {
const sources = api.getCompilationResult().source.sources
const result = concatSourceFiles(sorted, sources)
api.writeFile(`${api.currentFile}_flattened.sol`, result)
setContent4AST(result)
setContentForAST(result)
}
return (

Loading…
Cancel
Save