template option on UI

pull/4226/head
aniket-engg 1 year ago committed by Aniket
parent 033dc94992
commit 78d8d75f1f
  1. 1
      apps/remix-ide/src/app/tabs/locales/en/filePanel.json
  2. 2
      libs/remix-ui/workspace/src/lib/actions/workspace.ts
  3. 3
      libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx
  4. 2
      libs/remix-ui/workspace/src/lib/types/index.ts
  5. 3
      libs/remix-ui/workspace/src/lib/utils/constants.ts
  6. 1
      libs/remix-ws-templates/src/index.ts

@ -104,6 +104,7 @@
"filePanel.burnable": "Burnable", "filePanel.burnable": "Burnable",
"filePanel.pausable": "Pausable", "filePanel.pausable": "Pausable",
"filePanel.semaphore": "Semaphore", "filePanel.semaphore": "Semaphore",
"filePanel.hashchecker": "Hash Checker",
"filePanel.transparent": "Transparent", "filePanel.transparent": "Transparent",
"filePanel.initGitRepoTitle": "Check option to initialize workspace as a new git repository", "filePanel.initGitRepoTitle": "Check option to initialize workspace as a new git repository",
"filePanel.switchToBranchTitle1": "Checkout new branch from remote branch", "filePanel.switchToBranchTitle1": "Checkout new branch from remote branch",

@ -170,7 +170,7 @@ export const createWorkspace = async (
const isActive = await plugin.call('manager', 'isActive', 'dgit') const isActive = await plugin.call('manager', 'isActive', 'dgit')
if (!isActive) await plugin.call('manager', 'activatePlugin', 'dgit') if (!isActive) await plugin.call('manager', 'activatePlugin', 'dgit')
} }
if (workspaceTemplateName === 'semaphore') { if (workspaceTemplateName === 'semaphore' || workspaceTemplateName === 'hashchecker') {
const isCircomActive = await plugin.call('manager', 'isActive', 'circuit-compiler') const isCircomActive = await plugin.call('manager', 'isActive', 'circuit-compiler')
if (!isCircomActive) await plugin.call('manager', 'activatePlugin', 'circuit-compiler') if (!isCircomActive) await plugin.call('manager', 'activatePlugin', 'circuit-compiler')
} }

@ -742,6 +742,9 @@ export function Workspace() {
<option style={{fontSize: 'small'}} value="semaphore"> <option style={{fontSize: 'small'}} value="semaphore">
{intl.formatMessage({id: 'filePanel.semaphore'})} {intl.formatMessage({id: 'filePanel.semaphore'})}
</option> </option>
<option style={{fontSize: 'small'}} value="hashchecker">
{intl.formatMessage({id: 'filePanel.hashchecker'})}
</option>
</optgroup> </optgroup>
</select> </select>

@ -17,7 +17,7 @@ export interface JSONStandardInput {
} }
} }
export type MenuItems = action[] export type MenuItems = action[]
export type WorkspaceTemplate = 'gist-template' | 'code-template' | 'remixDefault' | 'blank' | 'ozerc20' | 'zeroxErc20' | 'ozerc721' | 'playground' | 'semaphore' export type WorkspaceTemplate = 'gist-template' | 'code-template' | 'remixDefault' | 'blank' | 'ozerc20' | 'zeroxErc20' | 'ozerc721' | 'playground' | 'semaphore' | 'hashchecker'
export interface WorkspaceProps { export interface WorkspaceProps {
plugin: FilePanelType plugin: FilePanelType
} }

@ -82,5 +82,6 @@ export const TEMPLATE_NAMES = {
'zeroxErc20': '0xProject ERC20', 'zeroxErc20': '0xProject ERC20',
'gnosisSafeMultisig': 'Gnosis Safe', 'gnosisSafeMultisig': 'Gnosis Safe',
'playground': 'Playground', 'playground': 'Playground',
'semaphore': 'Semaphore' 'semaphore': 'Semaphore',
'hashchecker': 'Hash Checker'
} }

@ -7,6 +7,7 @@ export { default as zeroxErc20 } from './templates/zeroxErc20'
export { default as gnosisSafeMultisig } from './templates/gnosisSafeMultisig' export { default as gnosisSafeMultisig } from './templates/gnosisSafeMultisig'
export { default as playground } from './templates/playground' export { default as playground } from './templates/playground'
export { default as semaphore } from './templates/semaphore' export { default as semaphore } from './templates/semaphore'
export { default as hashchecker } from './templates/hashchecker'
export { contractDeployerScripts } from './script-templates/contract-deployer' export { contractDeployerScripts } from './script-templates/contract-deployer'
export { etherscanScripts } from './script-templates/etherscan' export { etherscanScripts } from './script-templates/etherscan'

Loading…
Cancel
Save