lint remix-ui

git4refactor
filip mertens 6 months ago
parent 32d9abf089
commit c3db5384c9
  1. 4
      libs/remix-ui/editor/src/lib/providers/completion/completionGlobals.ts
  2. 4
      libs/remix-ui/editor/src/lib/providers/completionProvider.ts
  3. 2
      libs/remix-ui/editor/src/lib/providers/hoverProvider.ts
  4. 1
      libs/remix-ui/editor/src/lib/providers/inlineCompletionProvider.ts
  5. 2
      libs/remix-ui/editor/src/lib/remix-ui-editor.tsx
  6. 1
      libs/remix-ui/git/src/components/buttons/sourceControlBase.tsx
  7. 4
      libs/remix-ui/git/src/components/buttons/sourcecontrolbuttons.tsx
  8. 5
      libs/remix-ui/git/src/components/github/devicecode.tsx
  9. 2
      libs/remix-ui/git/src/components/github/selectandclonerepositories.tsx
  10. 5
      libs/remix-ui/git/src/components/gitui.tsx
  11. 1
      libs/remix-ui/git/src/components/navigation/commits.tsx
  12. 2
      libs/remix-ui/git/src/components/navigation/settings.tsx
  13. 1
      libs/remix-ui/git/src/components/navigation/sourcecontrol.tsx
  14. 1
      libs/remix-ui/git/src/components/navigation/sourcecontrolgroup.tsx
  15. 3
      libs/remix-ui/git/src/components/panels/branches/localbranchdetails.tsx
  16. 1
      libs/remix-ui/git/src/components/panels/branches/remotebranchedetails.tsx
  17. 3
      libs/remix-ui/git/src/components/panels/clone.tsx
  18. 1
      libs/remix-ui/git/src/components/panels/commands/fetch.tsx
  19. 9
      libs/remix-ui/git/src/components/panels/commands/merge.tsx
  20. 9
      libs/remix-ui/git/src/components/panels/commands/pushpull.tsx
  21. 1
      libs/remix-ui/git/src/components/panels/commits.tsx
  22. 1
      libs/remix-ui/git/src/components/panels/commits/commitdetailsitem.tsx
  23. 2
      libs/remix-ui/git/src/components/panels/commits/commitsummary.tsx
  24. 3
      libs/remix-ui/git/src/components/panels/github.tsx
  25. 2
      libs/remix-ui/git/src/components/panels/githubcredentials.tsx
  26. 2
      libs/remix-ui/git/src/components/panels/remotes.tsx
  27. 5
      libs/remix-ui/git/src/components/panels/remotesimport.tsx
  28. 4
      libs/remix-ui/git/src/components/panels/settings.tsx
  29. 1
      libs/remix-ui/git/src/components/panels/sourcontrol.tsx
  30. 3
      libs/remix-ui/git/src/lib/fileHelpers.ts
  31. 14
      libs/remix-ui/git/src/lib/gitactions.ts
  32. 3
      libs/remix-ui/git/src/lib/listeners.ts
  33. 4
      libs/remix-ui/git/src/lib/pluginActions.ts
  34. 1
      libs/remix-ui/git/src/state/gitpayload.ts
  35. 16
      libs/remix-ui/git/src/state/gitreducer.tsx
  36. 1
      libs/remix-ui/grid-view/src/lib/remix-ui-grid-cell.tsx
  37. 1
      libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx
  38. 2
      libs/remix-ui/home-tab/src/lib/components/homeTablangOptions.tsx
  39. 1
      libs/remix-ui/run-tab/src/lib/actions/account.ts
  40. 1
      libs/remix-ui/run-tab/src/lib/actions/events.ts
  41. 3
      libs/remix-ui/search/src/lib/components/results/SearchHelper.ts
  42. 2
      libs/remix-ui/search/src/lib/types/index.ts
  43. 1
      libs/remix-ui/solidity-compile-details/src/lib/components/solidityCompile.tsx
  44. 1
      libs/remix-ui/solidity-compiler/src/lib/api/compiler-api.ts
  45. 2
      libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx
  46. 1
      libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx
  47. 1
      libs/remix-ui/solidity-compiler/src/lib/types/index.ts
  48. 2
      libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx
  49. 1
      libs/remix-ui/static-analyser/src/staticanalyser.d.ts
  50. 1
      libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx
  51. 1
      libs/remix-ui/vyper-compile-details/src/lib/vyper-compile-details.tsx
  52. 2
      libs/remix-ui/workspace/src/lib/components/electron-menu.tsx
  53. 1
      libs/remix-ui/workspace/src/lib/components/electron-workspace-name.tsx
  54. 4
      libs/remix-ui/workspace/src/lib/components/file-explorer.tsx
  55. 2
      libs/remix-ui/workspace/src/lib/components/flat-tree-drop.tsx
  56. 1
      libs/remix-ui/workspace/src/lib/contexts/index.ts
  57. 1
      libs/remix-ui/workspace/src/lib/providers/FileSystemProvider.tsx
  58. 1
      libs/remix-ui/workspace/src/lib/reducers/workspace.ts
  59. 2
      libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx
  60. 2
      libs/remix-ui/xterm/src/lib/components/remix-ui-xterminals.tsx
  61. 2
      libs/remix-ui/xterm/src/lib/components/xterm-fit-addOn.ts

@ -33,7 +33,6 @@ export function getBytesCompletionItems(range: monacoTypes.IRange, monaco): mona
]
}
export function getBlockCompletionItems(range: monacoTypes.IRange, monaco): monacoTypes.languages.CompletionItem[] {
return [
{
@ -442,7 +441,6 @@ export function getAbiCompletionItems(range: monacoTypes.IRange, monaco): monaco
];
}
export function GetCompletionTypes(range: monacoTypes.IRange, monaco): monacoTypes.languages.CompletionItem[] {
const completionItems = [];
const types = ['address', 'string', 'bytes', 'byte', 'int', 'uint', 'bool', 'hash'];
@ -510,7 +508,6 @@ export function GetCompletionKeywords(range: monacoTypes.IRange, monaco): monaco
return completionItems;
}
export function GeCompletionUnits(range: monacoTypes.IRange, monaco): monacoTypes.languages.CompletionItem[] {
const completionItems = [];
const etherUnits = ['wei', 'gwei', 'finney', 'szabo', 'ether'];
@ -557,7 +554,6 @@ export function GetImports(range: monacoTypes.IRange
}
})]
list = [...list,
...data.files
.filter((item) => item.startsWith(word))

@ -158,7 +158,6 @@ export class RemixCompletionProvider implements monacoTypes.languages.Completion
return variableDeclaration
}
for (const node of Object.values(filteredNodes) as any[]) {
if (!node.name) continue
if (node.nodeType === 'VariableDeclaration') {
@ -348,7 +347,6 @@ export class RemixCompletionProvider implements monacoTypes.languages.Completion
})
}
for (const nodeOfScope of contractCompletions) {
if (nodeOfScope.name === nameOfLastTypedExpression) {
if (nodeOfScope.typeName && nodeOfScope.typeName.nodeType === 'UserDefinedTypeName') {
@ -373,8 +371,6 @@ export class RemixCompletionProvider implements monacoTypes.languages.Completion
}
return { nodes, suggestions }
}

@ -46,7 +46,6 @@ export class RemixHoverProvider implements monacoTypes.languages.HoverProvider {
return await this.props.plugin.call('codeParser', 'getVariableDeclaration', node)
}
const getParamaters = async (node: any) => {
return await this.props.plugin.call('codeParser', 'getFunctionParamaters', node)
}
@ -55,7 +54,6 @@ export class RemixHoverProvider implements monacoTypes.languages.HoverProvider {
return await this.props.plugin.call('codeParser', 'getFunctionReturnParameters', node)
}
const getOverrides = async (node: any) => {
if (node.overrides) {
const overrides = []

@ -20,7 +20,6 @@ export class RemixInLineCompletionProvider implements monacoTypes.languages.Inli
this.completionEnabled = true
}
async provideInlineCompletions(model: monacoTypes.editor.ITextModel, position: monacoTypes.Position, context: monacoTypes.languages.InlineCompletionContext, token: monacoTypes.CancellationToken): Promise<monacoTypes.languages.InlineCompletions<monacoTypes.languages.InlineCompletion>> {
if (context.selectedSuggestionInfo) {
return;

@ -781,7 +781,6 @@ export const EditorUI = (props: EditorUIProps) => {
},
}
const freeFunctionCondition = editor.createContextKey('freeFunctionCondition', false)
let freeFunctionAction
const executeFreeFunctionAction = {
@ -847,7 +846,6 @@ export const EditorUI = (props: EditorUIProps) => {
return
}
const { nodesAtPosition } = await retrieveNodesAtPosition(props.editorAPI, props.plugin)
const freeFunctionNode = nodesAtPosition.find((node) => node.kind === 'freeFunction')
if (freeFunctionNode) {

@ -38,7 +38,6 @@ export const SourceControlBase = (props: SourceControlButtonsProps) => {
}
}, [context.branchDifferences, context.currentBranch, branch, remote])
const setDefaultRemote = () => {
if (context.remotes.length > 0) {

@ -34,7 +34,6 @@ export const SourceControlButtons = (props: SourceControlButtonsProps) => {
}
}, [context.branchDifferences, context.currentBranch, branch, remote])
const setDefaultRemote = () => {
if (context.remotes.length > 0) {
@ -78,8 +77,6 @@ export const SourceControlButtons = (props: SourceControlButtonsProps) => {
console.log('SC BUTTONS', branch, remote)
}, [])
const pull = async () => {
await actions.pull(remote.remote, branch.name)
}
@ -97,7 +94,6 @@ export const SourceControlButtons = (props: SourceControlButtonsProps) => {
return (!context.upstream) || context.remotes.length === 0
}
return (
<span className='d-flex justify-content-end align-items-center'>
<CustomTooltip tooltipText={<FormattedMessage id="git.pull" />}>

@ -5,7 +5,6 @@ import axios from "axios";
import { CopyToClipboard } from "@remix-ui/clipboard";
import { Card } from "react-bootstrap";
export const GetDeviceCode = () => {
const context = React.useContext(gitPluginContext)
const actions = React.useContext(gitActionsContext)
@ -13,8 +12,6 @@ export const GetDeviceCode = () => {
const [gitHubResponse, setGitHubResponse] = React.useState<any>(null)
const [authorized, setAuthorized] = React.useState<boolean>(false)
const getDeviceCodeFromGitHub = async () => {
setAuthorized(false)
@ -90,7 +87,6 @@ export const GetDeviceCode = () => {
console.log('context.rateLimit', context.rateLimit)
}, [context.rateLimit])
return (
<>
{(context.gitHubUser && context.gitHubUser.login) ? null :
@ -142,6 +138,5 @@ export const GetDeviceCode = () => {
</div> : null
}
</>)
}

@ -35,7 +35,6 @@ export const SelectAndCloneRepositories = (props: RepositoriesProps) => {
}
};
return (
<>
<TokenWarning />
@ -52,4 +51,3 @@ export const SelectAndCloneRepositories = (props: RepositoriesProps) => {
)
}

@ -57,7 +57,6 @@ export const GitUI = (props: IGitUi) => {
useEffect(() => {
async function setDecorators(gitState: gitState) {
await plugin.call('fileDecorator', 'clearFileDecorators')
await setModifiedDecorator(gitState.modified)
@ -70,12 +69,10 @@ export const GitUI = (props: IGitUi) => {
setDecorators(gitState)
})
}, [gitState.fileStatusResult])
useEffect(() => {
async function updatestate() {
console.log('updatestate', gitState)
if (gitState.currentBranch && gitState.currentBranch.remote && gitState.currentBranch.remote.url) {
@ -88,7 +85,6 @@ export const GitUI = (props: IGitUi) => {
}, [gitState.gitHubUser, gitState.currentBranch, gitState.remotes, gitState.gitHubAccessToken])
const gitActionsProviderValue = {
commit,
addall,
@ -192,7 +188,6 @@ export const GitUI = (props: IGitUi) => {
</>
</Accordion.Collapse>
</Accordion>
</pluginActionsContext.Provider>
</gitActionsContext.Provider>

@ -49,7 +49,6 @@ export const CommitsNavigation = ({ eventKey, activePanel, callback, title, bran
<SourceControlButtons branch={branch} remote={remote}></SourceControlButtons>
</div>
</>
);

@ -26,7 +26,6 @@ export const SettingsNavigation = ({ eventKey, activePanel, callback }) => {
}
<label className="nav pl-1 form-check-label">SETTINGS</label>
</span>
<span className='d-flex justify-content-end align-items-center w-25'>
@ -36,7 +35,6 @@ export const SettingsNavigation = ({ eventKey, activePanel, callback }) => {
</span>
</div>
</>
);

@ -35,7 +35,6 @@ export const SourceControlNavigation = ({ eventKey, activePanel, callback }) =>
<SourceControlButtons/>
</div>
</>
);

@ -13,7 +13,6 @@ interface SourceControlGroupNavigationProps {
group: sourceControlGroup
}
export const SourceControlGroupNavigation = (props: SourceControlGroupNavigationProps) => {
const { eventKey, activePanel, callback, group } = props;
const actions = React.useContext(gitActionsContext)

@ -32,8 +32,6 @@ export const LocalBranchDetails = (props: BrancheDetailsProps) => {
}
}, [activePanel])
const checkout = (branch: branch) => {
actions.checkout({
ref: branch.name,
@ -74,7 +72,6 @@ export const LocalBranchDetails = (props: BrancheDetailsProps) => {
}
})}
</div>
{hasNextPage && <GitUIButton className="mb-1 ml-2 btn btn-sm" onClick={loadNextPage}>Load more</GitUIButton>}
</>

@ -92,7 +92,6 @@ export const RemoteBranchDetails = (props: BrancheDetailsProps) => {
}
})}
</div>
{hasNextPage && <GitUIButton className="mb-1 ml-2 btn btn-sm" onClick={loadNextPage}>Load more</GitUIButton>}
</>

@ -31,7 +31,6 @@ export const Clone = () => {
''
);
const clone = async () => {
await actions.clone(cloneUrl, cloneBranch, cloneDepth, !cloneAllBranches)
}
@ -63,7 +62,6 @@ export const Clone = () => {
<FormControl id="cloneulr" placeholder="url" name='cloneurl' value={cloneUrl} onChange={e => onGitHubCloneUrlChange(e.target.value)} aria-describedby="urlprepend" />
</InputGroup>
<input name='clonebranch' onChange={e => onCloneBranchChange(e.target.value)} value={cloneBranch} className="form-control mb-1 mt-2" placeholder="branch" type="text" id="clonebranch" />
<GitUIButton disabledCondition={!cloneUrl || !cloneBranch} data-id='clonebtn' className='btn btn-primary mt-1 w-100' onClick={async () => {
clone()
@ -91,7 +89,6 @@ export const Clone = () => {
onChange={() => { }}
/>
<hr></hr>
</>)
}

@ -3,7 +3,6 @@ import { gitActionsContext } from "../../../state/context";
import GitUIButton from "../../buttons/gituibutton";
import { gitPluginContext } from "../../gitui";
export const Fetch = () => {
const actions = React.useContext(gitActionsContext)
const context = React.useContext(gitPluginContext)

@ -15,8 +15,6 @@ export const Merge = () => {
setLocalBranch(context.currentBranch.name)
}, [context.currentBranch])
const onLocalBranchChange = (value: any) => {
console.log('onLocalBranchChange', value)
setLocalBranch(value)
@ -35,21 +33,15 @@ export const Merge = () => {
})
setLocalBranchOptions(localBranches)
}, [context.branches])
return (
<>
<div className="btn-group w-100" role="group" aria-label="Basic example">
<GitUIButton type="button" onClick={async () => merge()} className="btn btn-primary mr-1">Merge</GitUIButton>
</div>
<label>Merge from Branch</label>
<Select
options={localBranchOptions}
@ -62,6 +54,5 @@ export const Merge = () => {
placeholder="Type to search for a branch..."
/>
</>)
}

@ -24,8 +24,6 @@ export const PushPull = () => {
}
}, [context.currentBranch])
const onRemoteBranchChange = (value: string) => {
setRemoteBranch(value)
}
@ -56,7 +54,6 @@ export const PushPull = () => {
actions.pull(context.upstream.remote, localBranch, remoteBranch)
}
useEffect(() => {
console.log('context branches', context.branches)
// map context.repositories to options
@ -89,24 +86,19 @@ export const PushPull = () => {
}, [context.remotes])
const pushPullIsDisabled = () => {
return localBranch === '' || remoteBranch === '' || !context.upstream || context.remotes.length === 0
}
return (
<>
<div className="btn-group w-100" role="group">
<GitUIButton disabledCondition={pushPullIsDisabled()} type="button" onClick={async () => pull()} className="btn btn-primary mr-1">Pull</GitUIButton>
<GitUIButton disabledCondition={pushPullIsDisabled()} type="button" onClick={async () => push()} className="btn btn-primary">Push</GitUIButton>
</div>
<label>Local Branch</label>
<Select
options={localBranchOptions}
@ -143,7 +135,6 @@ export const PushPull = () => {
placeholder="Type to search for a branch..."
/>
<div className="mt-2 remixui_compilerConfig custom-control custom-checkbox">
<input checked={force} onChange={e => onForceChange(e)} className="remixui_autocompile custom-control-input" type="checkbox" data-id="compilerContainerAutoCompile" id="forcepush" title="Force Push" />
<label className="form-check-label custom-control-label" htmlFor="forcepush">Force push</label>

@ -8,7 +8,6 @@ import { BranchDifferences } from "./branches/branchdifferences";
import { CommitDetails } from "./commits/commitdetails";
import { CommitSummary } from "./commits/commitsummary";
export const Commits = () => {
const [hasNextPage, setHasNextPage] = React.useState(true)
const context = React.useContext(gitPluginContext)

@ -29,7 +29,6 @@ export const CommitDetailsItems = (props: CCommitDetailsItemsProps) => {
{status && status.indexOf("deleted") === -1 ? <></> : <span>D</span>}
{status && status.indexOf("added") === -1 ? <></> : <span>A</span>}
</>)
}
return (<>

@ -46,8 +46,6 @@ export const CommitSummary = (props: CommitSummaryProps) => {
{commit.commit.author.name || ""}
<span className="ml-1">{getDate(commit)}</span>
</>
)
}

@ -5,7 +5,6 @@ import axios from "axios";
import { CopyToClipboard } from "@remix-ui/clipboard";
import { Card } from "react-bootstrap";
export const GitHubAuth = () => {
const context = React.useContext(gitPluginContext)
const actions = React.useContext(gitActionsContext)
@ -27,7 +26,6 @@ export const GitHubAuth = () => {
console.log('context.rateLimit', context.rateLimit)
}, [context.rateLimit])
return (
<>
{(context.gitHubUser && context.gitHubUser.login) ? null :
@ -49,6 +47,5 @@ export const GitHubAuth = () => {
</div>: null
}
</>)
}

@ -8,7 +8,6 @@ import { useIntl, FormattedMessage } from "react-intl";
import { CopyToClipboard } from "@remix-ui/clipboard";
import { FormControl, InputGroup } from "react-bootstrap";
export const GitHubCredentials = () => {
const context = React.useContext(gitPluginContext)
const pluginactions = React.useContext(pluginActionsContext)
@ -62,7 +61,6 @@ export const GitHubCredentials = () => {
})
}
return (
<>
<div className="input-group text-secondary mb-1 h6">

@ -24,7 +24,6 @@ export const Remotes = () => {
})
}
useEffect(() => {
console.log('SHOW REMOTES', context.remotes)
}, [context.remotes])
@ -32,7 +31,6 @@ export const Remotes = () => {
return (
<>
{context.remotes && context.remotes.length ?
<>

@ -8,7 +8,6 @@ import { selectStyles, selectTheme } from "../../types/styles";
import { TokenWarning } from "./tokenWarning";
import RepositorySelect from "../github/repositoryselect";
export const RemotesImport = () => {
const context = React.useContext(gitPluginContext)
const actions = React.useContext(gitActionsContext)
@ -48,7 +47,6 @@ export const RemotesImport = () => {
setRepo(repo)
}
useEffect(() => {
console.log('OTIONS', repoOtions)
},[repoOtions])
@ -77,8 +75,6 @@ export const RemotesImport = () => {
<input placeholder="remote name" name='remotename' onChange={e => onRemoteNameChange(e.target.value)} value={remoteName} className="form-control mb-2" type="text" id="remotename" />
: null}
{repo && remoteName ?
<button data-id='clonebtn' className='btn btn-primary mt-1 w-100' onClick={async () => {
await addRemote()
@ -88,4 +84,3 @@ export const RemotesImport = () => {
)
}

@ -8,7 +8,6 @@ import { useIntl, FormattedMessage } from "react-intl";
import { CopyToClipboard } from "@remix-ui/clipboard";
import { FormControl, InputGroup } from "react-bootstrap";
export const Settings = () => {
const [githubToken, setGithubToken] = React.useState('')
@ -18,8 +17,6 @@ export const Settings = () => {
const gitAccessTokenLink = 'https://github.com/settings/tokens/new?scopes=gist,repo&description=Remix%20IDE%20Token'
function handleChangeTokenState(e: string): void {
throw new Error("Function not implemented.");
}
@ -40,7 +37,6 @@ export const Settings = () => {
throw new Error("Function not implemented.");
}
return (
<>
<input name='githubToken' onChange={e => handleChangeUserNameState(e.target.value)} value={githubToken} className="form-control mb-2" placeholder="GitHub token" type="text" id="githubToken" />

@ -10,7 +10,6 @@ export const SourceControl = () => {
const pluginactions = React.useContext(pluginActionsContext)
const [show, setShow] = useState(false)
useEffect(() => {
if (context.fileStatusResult) {
console.log(context)

@ -28,10 +28,8 @@ export const getFilesByStatus = (status: string, files: fileStatusResult[]): fil
export const getFilesWithNotModifiedStatus = (files: fileStatusResult[]): fileStatusResult[] => {
const result: fileStatusResult[] = []
files.map((m) => {
if (m.statusNames !== undefined) {
if (m.statusNames && m.statusNames.indexOf("unmodified") === -1) {
result.push(m)
@ -50,7 +48,6 @@ export const allChangedButNotStagedFiles = (files: fileStatusResult[]): fileStat
return allfiles;
}
export const getFileStatusForFile = (filename: string, files: fileStatusResult[]) => {
for (let i: number = 0; i < files.length; i++) {
if (files[i].filename === filename)

@ -147,7 +147,6 @@ export const showCurrentBranch = async () => {
const branch = await currentBranch();
const currentcommitoid = await getCommitFromRef("HEAD");
if (typeof branch === "undefined" || branch.name === "") {
//toast.warn(`You are in a detached state`);
plugin.call('notification', 'alert', {
@ -288,7 +287,6 @@ export const add = async (args: string | undefined) => {
}
}
const getLastCommmit = async () => {
try {
let currentcommitoid = "";
@ -299,7 +297,6 @@ const getLastCommmit = async () => {
}
}
export const rm = async (args: any) => {
const filename = args;
await plugin.call("dGitProvider", "rm", {
@ -308,7 +305,6 @@ export const rm = async (args: any) => {
plugin.call('notification', 'toast', `Removed ${filename} from git`)
}
export const checkoutfile = async (filename: string) => {
const oid = await getLastCommmit();
if (oid)
@ -426,7 +422,6 @@ const tokenWarning = async () => {
}
}
const parseError = async (e: any) => {
console.log(e)
// if message conttains 401 Unauthorized, show token warning
@ -462,7 +457,7 @@ const parseError = async (e: any) => {
} else if (e.toString().includes('NotFoundError') && !e.toString().includes('fetch')) {
await plugin.call('notification', 'modal', {
title: 'Remote branch not found',
message: 'The branch you are trying to fetch does not exist on the remote.\ If you have forked this branch from another branch, you may need to fetch the original branch first or publish this branch on the remote.',
message: 'The branch you are trying to fetch does not exist on the remote. If you have forked this branch from another branch, you may need to fetch the original branch first or publish this branch on the remote.',
okLabel: 'OK',
type: ModalTypes.alert
})
@ -484,7 +479,7 @@ export const repositories = async () => {
let hasMoreData = true
const per_page = 100
while (hasMoreData) {
let pagedResponse = await plugin.call('dGitProvider' as any, 'repositories', { token, page: page, per_page: per_page })
const pagedResponse = await plugin.call('dGitProvider' as any, 'repositories', { token, page: page, per_page: per_page })
if (pagedResponse.length < per_page) {
hasMoreData = false
}
@ -520,7 +515,7 @@ export const remoteBranches = async (owner: string, repo: string) => {
let hasMoreData = true
const per_page = 100
while (hasMoreData) {
let pagedResponse = await plugin.call('dGitProvider' as any, 'remotebranches', { token, owner, repo, page: page, per_page: per_page })
const pagedResponse = await plugin.call('dGitProvider' as any, 'remotebranches', { token, owner, repo, page: page, per_page: per_page })
if (pagedResponse.length < per_page) {
hasMoreData = false
}
@ -628,8 +623,6 @@ export const getGitHubUser = async () => {
}
}
export const statusMatrix = async (filepaths: string[]) => {
const matrix = await plugin.call("dGitProvider", "status", { ref: "HEAD", filepaths: filepaths || ['.']});
const result = (matrix || []).map((x) => {
@ -734,7 +727,6 @@ async function getRepoDetails(url: string) {
return { owner, repo };
}
export const fetchBranch = async (branch: branch, page: number) => {
if (!branch.remote || !branch.remote.url) return
const token = await tokenWarning();

@ -105,7 +105,6 @@ export const setCallBacks = (viewPlugin: ViewPlugin, gitDispatcher: React.Dispat
await getGitConfig()
})
callBackEnabled = true;
}
@ -186,8 +185,6 @@ const getStorageUsed = async () => {
}
}
export const disableCallBacks = async () => {
callBackEnabled = false;
}

@ -38,7 +38,6 @@ export const saveToken = async (token: string) => {
await plugin.call('config', 'setAppParameter', 'settings/gist-access-token', token)
}
export const setFileDecorators = async (files: fileStatusResult[]) => {
if (!plugin) return
@ -46,7 +45,6 @@ export const setFileDecorators = async (files: fileStatusResult[]) => {
const untracked = getFilesByStatus('untracked', files)
const unmodified = getFilesByStatus('unmodified', files)
await setModifiedDecorator(modified)
await setUntrackedDecorator(untracked)
unmodified.forEach((file) => {
@ -54,7 +52,6 @@ export const setFileDecorators = async (files: fileStatusResult[]) => {
})
}
export const setModifiedDecorator = async (files: fileStatusResult[]) => {
const decorators: fileDecoration[] = []
for (const file of files) {
@ -101,4 +98,3 @@ export const clearFileDecorator = async(path: string) => {
await plugin.call('fileDecorator', 'clearFileDecorators', path)
}

@ -72,7 +72,6 @@ export const setGitHubAccessToken = (token: string) => {
}
}
export const setLoading = (loading: boolean) => {
return {
type: 'SET_LOADING',

@ -23,8 +23,7 @@ export const gitReducer = (state: gitState = defaultGitState, action: Action): g
}
case 'FILE_STATUS_MERGE':
const filesStatusResults: fileStatusResult[] = action.payload
filesStatusResults.map((fileStatusResult: fileStatusResult) => {
action.payload.map((fileStatusResult: fileStatusResult) => {
const file = state.fileStatusResult.find(stateFile => {
return stateFile.filename === fileStatusResult.filename
})
@ -149,7 +148,6 @@ export const gitReducer = (state: gitState = defaultGitState, action: Action): g
case 'SET_BRANCH_DIFFERENCES':
state.branchDifferences[`${(action as setBranchDifferencesAction).payload.remote.remote}/${(action as setBranchDifferencesAction).payload.branch.name}`] = (action as setBranchDifferencesAction).payload.branchDifference
return {
@ -157,8 +155,6 @@ export const gitReducer = (state: gitState = defaultGitState, action: Action): g
branchDifferences: { ...state.branchDifferences }
}
case 'SET_GITHUB_ACCESS_TOKEN':
case 'SET_GITHUB_USER':
return {
...state,
@ -191,26 +187,22 @@ export const gitReducer = (state: gitState = defaultGitState, action: Action): g
}
case 'SET_LOG':
const previousLog = [...state.log]
// check if the new message is the same as the last
if (previousLog.length > 0 && previousLog[previousLog.length - 1].message === action.payload.message) {
if (state.log.length > 0 && state.log[[...state.log].length - 1].message === action.payload.message) {
return {
...state,
log: previousLog
log: [...state.log]
}
}
return {
...state,
log: [...previousLog, action.payload]
log: [...state.log, action.payload]
}
case 'CLEAR_LOG':
return {
...state,
log: []
}
}
}

@ -4,7 +4,6 @@ import './remix-ui-grid-cell.css'
import FiltersContext from "./filtersContext"
import { CustomTooltip } from '@remix-ui/helper'
declare global {
interface Window {
_paq: any

@ -9,7 +9,6 @@ import 'react-multi-carousel/lib/styles.css'
import CustomNavButtons from './customNavButtons'
import { appPlatformTypes, platformContext } from '@remix-ui/app'
declare global {
interface Window {
_paq: any

@ -3,8 +3,6 @@ import { Dropdown, DropdownButton } from 'react-bootstrap'
import DropdownItem from 'react-bootstrap/DropdownItem'
import { localeLang } from './types/carouselTypes'
export function LanguageOptions({ plugin }: { plugin: any }) {
const [langOptions, setLangOptions] = useState<string>()

@ -86,7 +86,6 @@ export const createNewBlockchainAccount = async (plugin: RunTab, dispatch: React
)
}
export const signMessageWithAddress = (plugin: RunTab, dispatch: React.Dispatch<any>, account: string, message: string, modalContent: (hash: string, data: string) => JSX.Element, passphrase?: string) => {
plugin.blockchain.signMessage(message, account, passphrase, (err, msgHash, signedData) => {
if (err) {

@ -170,7 +170,6 @@ export const setupEvents = (plugin: RunTab, dispatch: React.Dispatch<any>) => {
dispatch(clearRecorderCount())
})
setInterval(() => {
fillAccountsList(plugin, dispatch)
updateInstanceBalance(plugin, dispatch)

@ -2,7 +2,6 @@ import { EOL } from 'os'
import { SearchResultLineLine } from '../../types'
import { Registry } from '@remix-project/remix-lib'
export const getDirectory = async (dir: string, plugin: any) => {
let result = []
if (Registry.getInstance().get('platform').api.isDesktop()) {
@ -113,5 +112,3 @@ export const replaceTextInLine = (str: string, searchResultLine: SearchResultLin
}).join(getEOL(str))
}

@ -92,8 +92,6 @@ export const SearchingInitialState: SearchState = {
run: false,
}
export interface SearchInWorkspaceOptions {
pattern: string
path: string

@ -6,7 +6,6 @@ import { TreeView, TreeViewItem } from '@remix-ui/tree-view'
import { useIntl } from 'react-intl'
const _paq = (window._paq = window._paq || [])
export default function SolidityCompile({ contractProperties, selectedContract, help, insertValue, saveAs, plugin }: any) {
const intl = useIntl()
const downloadFn = () => {

@ -290,7 +290,6 @@ export const CompilerApiMixin = (Base) => class extends Base {
})
this.call('compilerloader', 'getJsonBinData')
this.data.eventHandlers.onCompilationFinished = async (success, data, source, input, version) => {
this.compileErrors = data
if (success) {

@ -17,7 +17,6 @@ import './css/style.css'
import { CompilerDropdown } from './components/compiler-dropdown'
const defaultPath = 'compiler_config.json'
declare global {
@ -160,7 +159,6 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
}
}, [solJsonBinData])
useEffect(() => {
const currentFileName = api.currentFile
currentFile(currentFileName)

@ -181,7 +181,6 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => {
})
}
const setConfigFilePath = (path: string) => {
setState((prevState) => {
return { ...prevState, configFilePath: path }

@ -24,7 +24,6 @@ export interface CompilerContainerProps {
solJsonBinData: iSolJsonBinData
}
export interface ContractSelectionProps {
api: ICompilerApi,
compiledFileName: string,

@ -11,8 +11,6 @@ import './css/style.css'
import { CustomTooltip } from '@remix-ui/helper'
import { appPlatformTypes, platformContext } from '@remix-ui/app'
const _paq = ((window as any)._paq = (window as any)._paq || []) // eslint-disable-line @typescript-eslint/no-explicit-any
interface TestObject {

@ -94,7 +94,6 @@ type ErrorRendererOptions = {
}
}
type SlitherAnalysisResultType = {
description: string,
title: string,

@ -84,7 +84,6 @@ const Icon = ({iconRecord, verticalIconPlugin, contextMenuAction, theme}: IconPr
}
}, [])
const stylePC = iconRecord.active ? 'flex-start' : 'center'
return (
<>

@ -2,7 +2,6 @@ import React from 'react'
import VyperCompile from './vyperCompile'
import { ThemeKeys, ThemeObject } from '@microlink/react-json-view'
interface RemixUiVyperCompileDetailsProps {
payload: any
theme?: ThemeKeys | ThemeObject

@ -5,8 +5,6 @@ import { FormattedMessage } from "react-intl"
import '../css/electron-menu.css'
import { CustomTooltip } from '@remix-ui/helper'
export const ElectronMenu = () => {
const platform = useContext(platformContext)
const global = useContext(FileSystemContext)

@ -2,7 +2,6 @@ import { CustomTooltip } from "@remix-ui/helper"
import React from "react"
import path from 'path'
interface ElectronWorkspaceNameProps {
path: string
plugin: any

@ -42,8 +42,6 @@ export const FileExplorer = (props: FileExplorerProps) => {
}
}, [contextMenuItems])
useEffect(() => {
if (removedContextMenuItems) {
removeMenuItems(removedContextMenuItems)
@ -358,8 +356,6 @@ export const FileExplorer = (props: FileExplorerProps) => {
}
return (
<div className="h-100 remixui_treeview" data-id="filePanelFileExplorerTree">
<div ref={treeRef} tabIndex={0} style={{

@ -19,7 +19,6 @@ export const FlatTreeDrop = (props: FlatTreeDropProps) => {
// folder to open
const [folderToOpen, setFolderToOpen] = useState<string>()
const onDragOver = async (e: SyntheticEvent) => {
e.preventDefault()
const target = await getEventTarget(e)
@ -77,7 +76,6 @@ export const FlatTreeDrop = (props: FlatTreeDropProps) => {
}
}
return (<div
onDrop={onDrop} onDragOver={onDragOver}
className="d-flex h-100"

@ -53,4 +53,3 @@ export const FileSystemContext = createContext<{
dispatchUpdateGitSubmodules: () => Promise<void>
}>(null)

@ -249,7 +249,6 @@ export const FileSystemProvider = (props: WorkspaceProps) => {
await removeRecentElectronFolder(path)
}
const dispatchUpdateGitSubmodules = async () => {
await updateGitSubmodules()
}

@ -862,7 +862,6 @@ export const browserReducer = (state = browserInitialState, action: Actions) =>
}
}
case 'SET_ELECTRON_RECENT_FOLDERS': {
const payload: string[] = action.payload
return {

@ -17,7 +17,6 @@ import { appPlatformTypes, platformContext } from '@remix-ui/app'
import { ElectronMenu } from './components/electron-menu'
import { ElectronWorkspaceName } from './components/electron-workspace-name'
const _paq = (window._paq = window._paq || [])
const canUpload = window.File || window.FileReader || window.FileList || window.Blob
@ -796,7 +795,6 @@ export function Workspace() {
{intl.formatMessage({ id: 'filePanel.uniswapV4HookBookMultiSigSwapHook' })}
</option>
</optgroup>
</select>
<div id="ozcustomization" data-id="ozCustomization" ref={displayOzCustomRef} style={{ display: 'none' }} className="mb-2">

@ -38,7 +38,6 @@ export const RemixUiXterminals = (props: RemixUiXterminalsProps) => {
dispatchXterm({ type: 'ADD_TERMINAL', payload: { pid, queue: '', timeStamp: Date.now(), ref: null, hidden: false } })
})
plugin.on('fs', 'workingDirChanged', (path: string) => {
dispatchXterm({ type: 'SET_WORKING_DIR', payload: path })
dispatchXterm({ type: 'ENABLE_TERMINALS', payload: null })
@ -87,7 +86,6 @@ export const RemixUiXterminals = (props: RemixUiXterminalsProps) => {
})
}
const writeToTerminal = (data: string, pid: number) => {
setTerminals(prevState => {
const terminal = prevState.find(xtermState => xtermState.pid === pid)

@ -5,7 +5,6 @@
import { Terminal, ITerminalAddon } from 'xterm';
interface ITerminalDimensions {
/**
* The number of rows in the terminal.
@ -68,7 +67,6 @@ export class FitAddon implements ITerminalAddon {
const scrollbarWidth = this._terminal.options.scrollback === 0 ?
0 : core.viewport.scrollBarWidth;
const parentElementStyle = window.getComputedStyle(this._terminal.element.parentElement.parentElement);
const parentElementHeight = parseInt(parentElementStyle.getPropertyValue('height'));
const parentElementWidth = Math.max(0, parseInt(parentElementStyle.getPropertyValue('width')));

Loading…
Cancel
Save