pull/4791/head
filip mertens 6 months ago
parent 5964cfd619
commit 91aaf32ab8
  1. 1
      libs/remix-ui/git/src/components/buttons/commitmessage.tsx
  2. 2
      libs/remix-ui/git/src/components/gitui.tsx
  3. 2
      libs/remix-ui/git/src/components/panels/branches.tsx
  4. 1
      libs/remix-ui/git/src/components/panels/commits.tsx
  5. 1
      libs/remix-ui/git/src/components/panels/githubcredentials.tsx
  6. 1
      libs/remix-ui/git/src/components/panels/setup.tsx
  7. 6
      libs/remix-ui/git/src/lib/gitactions.ts
  8. 45
      libs/remix-ui/git/src/lib/listeners.ts
  9. 1
      libs/remix-ui/git/src/state/gitreducer.tsx
  10. 1
      libs/remix-ui/git/src/types/index.ts
  11. 11
      libs/remix-ui/workspace/src/lib/actions/workspace.ts

@ -116,7 +116,6 @@ export const CommitMessage = () => {
setButtonStateValues()
},[context.canCommit, context.staged, context.allchangesnotstaged, context.currentBranch, syncState.commitsAhead, syncState.commitsBehind, message.value])
return (
<>
<div className="form-group">

@ -50,7 +50,6 @@ export const GitUI = (props: IGitUi) => {
const [needsInit, setNeedsInit] = useState<boolean>(true)
const [appLoaded, setAppLoaded] = useState<boolean>(false)
useEffect(() => {
plugin.emit('statusChanged', {
key:'loading',
@ -113,7 +112,6 @@ export const GitUI = (props: IGitUi) => {
}, [gitState.gitHubUser, gitState.currentBranch, gitState.remotes, gitState.gitHubAccessToken])
const gitActionsProviderValue = {
commit,
addall,

@ -24,12 +24,10 @@ export const Branches = () => {
}
};
useEffect(() => {
console.log("branches", context.branches)
}, [context.branches])
return (
<>
<div className="pt-1">

@ -40,7 +40,6 @@ export const Commits = () => {
return context.upstream ? context.upstream : context.defaultRemote ? context.defaultRemote : null
}
const getCommitChanges = async (commit: ReadCommitResult) => {
await actions.getCommitChanges(commit.oid, commit.commit.parent[0],null, getRemote())
}

@ -6,7 +6,6 @@ import { CustomTooltip } from "@remix-ui/helper";
import { useIntl, FormattedMessage } from "react-intl";
import { CopyToClipboard } from "@remix-ui/clipboard";
export const GitHubCredentials = () => {
const context = React.useContext(gitPluginContext)
const pluginactions = React.useContext(pluginActionsContext)

@ -6,7 +6,6 @@ export const Setup = () => {
const [screen, setScreen] = useState(0)
if (screen === 0) {
return (
<>

@ -128,7 +128,7 @@ export const showCurrentBranch = async () => {
}
export const currentBranch = async () => {
try {
const branch: branch =
(await plugin.call('dgitApi', "currentbranch")) || {
name: "",
@ -138,9 +138,7 @@ export const currentBranch = async () => {
},
};
return branch;
} catch (e) {
throw e;
}
}
export const createBranch = async (name: string = "") => {

@ -25,7 +25,7 @@ class AsyncDebouncedQueue {
clearTimeout(this.queues.get(callback)!.timer);
}
let timer = setTimeout(async () => {
const timer = setTimeout(async () => {
await callback();
this.queues.delete(callback);
}, customDelay || this.delay);
@ -34,8 +34,6 @@ class AsyncDebouncedQueue {
}
}
export const setCallBacks = (viewPlugin: Plugin, gitDispatcher: React.Dispatch<gitActionDispatch>, loaderDispatcher: React.Dispatch<any>) => {
plugin = viewPlugin
gitDispatch = gitDispatcher
@ -172,35 +170,6 @@ export const getGitConfig = async () => {
}
const syncFromWorkspace = async (callback: Function, isLocalhost = false) => {
//gitDispatch(setLoading(true));
await disableCallBacks();
if (isLocalhost) {
gitDispatch(setCanUseApp(false));
gitDispatch(setLoading(false));
await enableCallBacks();
return;
}
try {
const workspace = await plugin.call(
"filePanel",
"getCurrentWorkspace"
);
if (workspace.isLocalhost) {
gitDispatch(setCanUseApp(false));
await enableCallBacks();
return
}
gitDispatch(setRepoName(workspace.name));
gitDispatch(setCanUseApp(true));
} catch (e) {
gitDispatch(setCanUseApp(false));
}
await callback();
await enableCallBacks();
}
export const loadFiles = async (filepaths: string[] = null) => {
try {
const branch = await plugin.call('dgitApi', "currentbranch")
@ -217,18 +186,6 @@ export const loadFiles = async (filepaths: string[] = null) => {
}
}
const getStorageUsed = async () => {
try {
const storageUsed = await plugin.call("storage" as any, "getStorage" as any);
} catch (e) {
const storage: string = await plugin.call('dgitApi', "localStorageUsed" as any);
const storageUsed = {
usage: parseFloat(storage) * 1000,
quota: 10000000,
};
}
}
export const disableCallBacks = async () => {
callBackEnabled = false;
}

@ -182,7 +182,6 @@ export const gitReducer = (state: gitState = defaultGitState, action: Actions):
userEmails: action.payload
}
case 'SET_DEFAULT_REMOTE':
return {
...state,

@ -146,7 +146,6 @@ export const dGitProfile: LibraryProfile<IGitApi> = {
methods: ['clone', 'branches', 'remotes', 'getCommitChanges', 'log', 'remotecommits'],
}
export interface customGitApi extends IRemixApi {
dgit: IGitApi
}

@ -204,11 +204,7 @@ export const createWorkspace = async (
}, 5000)
} else if (!isEmpty && !(isGitRepo && createCommit)) await loadWorkspacePreset(workspaceTemplateName, opts)
cb && cb(null, workspaceName)
if (isGitRepo && false) {
await checkGit()
const isActive = await plugin.call('manager', 'isActive', 'dgit')
if (!isActive) await plugin.call('manager', 'activatePlugin', 'dgit')
}
if (workspaceTemplateName === 'semaphore' || workspaceTemplateName === 'hashchecker' || workspaceTemplateName === 'rln') {
const isCircomActive = await plugin.call('manager', 'isActive', 'circuit-compiler')
if (!isCircomActive) await plugin.call('manager', 'activatePlugin', 'circuit-compiler')
@ -513,10 +509,7 @@ export const switchToWorkspace = async (name: string) => {
await plugin.fileProviders.workspace.setWorkspace(name)
await plugin.setWorkspace({ name, isLocalhost: false })
const isGitRepo = await plugin.fileManager.isGitRepo()
if (isGitRepo && false) {
const isActive = await plugin.call('manager', 'isActive', 'dgit')
if (!isActive) await plugin.call('manager', 'activatePlugin', 'dgit')
}
dispatch(setMode('browser'))
dispatch(setCurrentWorkspace({ name, isGitRepo }))
dispatch(setReadOnlyMode(false))

Loading…
Cancel
Save