pull/4791/head
bunsenstraat 6 months ago
parent c0357ae03e
commit cbc2da066c
  1. 14
      libs/remix-ui/git/src/components/buttons/commitmessage.tsx
  2. 8
      libs/remix-ui/git/src/components/github/selectandclonerepositories.tsx
  3. 8
      libs/remix-ui/git/src/components/navigation/branchedetails.tsx
  4. 4
      libs/remix-ui/git/src/components/navigation/remotesdetails.tsx
  5. 10
      libs/remix-ui/git/src/components/panels/branches/remotebranchedetails.tsx
  6. 8
      libs/remix-ui/git/src/components/panels/clone.tsx
  7. 9
      libs/remix-ui/git/src/components/panels/commands/fetch.tsx
  8. 8
      libs/remix-ui/git/src/types/index.ts
  9. 2
      libs/remix-ui/workspace/src/lib/actions/workspace.ts

@ -42,13 +42,15 @@ export const CommitMessage = () => {
return context.upstream ? context.upstream : context.defaultRemote ? context.defaultRemote : null return context.upstream ? context.upstream : context.defaultRemote ? context.defaultRemote : null
} }
const getRemoteName = () => {
return getRemote() ? getRemote().name : ''
}
const sync = async() => { const sync = async() => {
await actions.pull(getRemoteName(), context.currentBranch.name) await actions.pull({
await actions.push(getRemoteName(), context.currentBranch.name) remote: getRemote(),
ref: context.currentBranch
})
await actions.push({
remote: getRemote(),
ref: context.currentBranch
})
} }
const commitNotAllowed = () => { const commitNotAllowed = () => {

@ -29,7 +29,13 @@ export const SelectAndCloneRepositories = (props: RepositoriesProps) => {
const clone = async () => { const clone = async () => {
try { try {
actions.clone(repo.html_url, branch.name, cloneDepth, !cloneAllBranches) await actions.clone({
url: repo.html_url,
branch: branch.name,
depth: cloneDepth,
singleBranch: !cloneAllBranches
})
//actions.clone(repo.html_url, branch.name, cloneDepth, !cloneAllBranches)
} catch (e) { } catch (e) {
// do nothing // do nothing
} }

@ -46,7 +46,13 @@ export const BrancheDetailsNavigation = (props: BrancheDetailsNavigationProps) =
} }
const fetchBranch = async () => { const fetchBranch = async () => {
actions.fetch(null, branch.name, null, null, false, true) await actions.fetch({
remote: null,
ref: branch,
singleBranch: true,
relative: true
})
//actions.fetch(null, branch.name, null, null, false, true)
} }
return ( return (

@ -56,7 +56,9 @@ export const RemotesDetailsNavigation = (props: RemotesDetailsNavigationProps) =
<GitUIButton className="btn btn-sm" onClick={setAsDefault}><FontAwesomeIcon icon={faToggleOn}></FontAwesomeIcon></GitUIButton> <GitUIButton className="btn btn-sm" onClick={setAsDefault}><FontAwesomeIcon icon={faToggleOn}></FontAwesomeIcon></GitUIButton>
} }
<GitUIButton className="btn btn-sm" onClick={async () => { <GitUIButton className="btn btn-sm" onClick={async () => {
await actions.fetch(remote.name) await actions.fetch({
remote
})
}}><FontAwesomeIcon icon={faSync} ></FontAwesomeIcon></GitUIButton> }}><FontAwesomeIcon icon={faSync} ></FontAwesomeIcon></GitUIButton>
<GitUIButton className="btn btn-sm" onClick={() => actions.removeRemote(remote)}><FontAwesomeIcon className='text-danger' icon={faTrash} ></FontAwesomeIcon></GitUIButton> <GitUIButton className="btn btn-sm" onClick={() => actions.removeRemote(remote)}><FontAwesomeIcon className='text-danger' icon={faTrash} ></FontAwesomeIcon></GitUIButton>
{remote?.url && <GitUIButton className="btn btn-sm pr-0" onClick={() => openRemote()}><FontAwesomeIcon icon={faGlobe} ></FontAwesomeIcon></GitUIButton>} {remote?.url && <GitUIButton className="btn btn-sm pr-0" onClick={() => openRemote()}><FontAwesomeIcon icon={faGlobe} ></FontAwesomeIcon></GitUIButton>}

@ -74,7 +74,15 @@ export const RemoteBranchDetails = (props: BrancheDetailsProps) => {
console.log('CHANGES', changes) console.log('CHANGES', changes)
if (!changes) { if (!changes) {
// try to fetch the data // try to fetch the data
await actions.fetch(branch.remote.name, branch.name,null,20, true, false, true) //await actions.fetch(branch.remote.name, branch.name,null,20, true, false, true)
await actions.fetch({
remote: branch.remote,
ref: branch,
depth: 20,
singleBranch: true,
relative: false,
quiet: true
})
} }
} }

@ -32,7 +32,13 @@ export const Clone = () => {
); );
const clone = async () => { const clone = async () => {
await actions.clone(cloneUrl, cloneBranch, cloneDepth, !cloneAllBranches) await actions.clone({
url: cloneUrl,
branch: cloneBranch,
depth: cloneDepth,
singleBranch: !cloneAllBranches
})
//await actions.clone(cloneUrl, cloneBranch, cloneDepth, !cloneAllBranches)
} }
const onCloneBranchChange = (value: string) => { const onCloneBranchChange = (value: string) => {

@ -13,8 +13,13 @@ export const Fetch = () => {
return ( return (
<> <>
<div className="btn-group w-100" role="group"> <div className="btn-group w-100" role="group">
<GitUIButton disabledCondition={fetchIsDisabled()} type="button" onClick={async () => actions.fetch()} className="btn btn-primary mr-1 w-50"><div>Fetch {context.upstream && context.upstream.name}</div></GitUIButton> <GitUIButton disabledCondition={fetchIsDisabled()} type="button" onClick={async () => actions.fetch({
<GitUIButton disabledCondition={fetchIsDisabled()} type="button" onClick={async () => actions.fetch(null, null, context.currentBranch.name, null, true )} className="btn btn-primary w-50 long-and-truncated">Fetch {context.currentBranch.name}</GitUIButton> remote: context.upstream,
})} className="btn btn-primary mr-1 w-50"><div>Fetch {context.upstream && context.upstream.name}</div></GitUIButton>
<GitUIButton disabledCondition={fetchIsDisabled()} type="button" onClick={async () => actions.fetch({
remote: context.upstream,
ref: context.currentBranch
})} className="btn btn-primary w-50 long-and-truncated">Fetch {context.currentBranch.name}</GitUIButton>
</div> </div>
</>) </>)
} }

@ -76,7 +76,13 @@ export type compareBranchesInput = {
} }
export type fetchInputType = { export type fetchInputType = {
remote: remote, ref: branch, remoteRef?: branch, depth: number, singleBranch: boolean, relative: boolean, quiet?: boolean remote: remote,
ref?: branch,
remoteRef?: branch,
depth?: number,
singleBranch?: boolean,
relative?: boolean,
quiet?: boolean
} }
export type pullInputType = { export type pullInputType = {

@ -746,7 +746,7 @@ export const getGitRepoBranches = async (workspacePath: string) => {
fs: window.remixFileSystemCallback, fs: window.remixFileSystemCallback,
dir: addSlash(workspacePath), dir: addSlash(workspacePath),
} }
const branches: { remote: any; name: string }[] = await dgitPlugin.call('dgitApi', 'branches', { ...gitConfig }) const branches: branch[] = await dgitPlugin.call('dgitApi', 'branches', { ...gitConfig })
return branches return branches
} }

Loading…
Cancel
Save