pull/4791/head
Your Name 5 months ago
parent 870c260a40
commit c290436216
  1. 2
      libs/remix-ui/git/src/components/panels/sourcecontrol/sourcecontrolitem.tsx
  2. 16
      libs/remix-ui/git/src/components/panels/sourcecontrol/sourcontrolitembuttons.tsx
  3. 2
      libs/remix-ui/git/src/lib/gitactions.ts

@ -48,7 +48,7 @@ export const SourceControlItem = (props: SourceControlItemProps) => {
</>) </>)
} }
if(!file.statusNames || file.statusNames.length === 0) return null if (!file.statusNames || file.statusNames.length === 0) return null
return (<> return (<>
<div data-status={file.statusNames.join('-')} data-file={file.filename} className="d-flex w-100 d-flex flex-row align-items-center"> <div data-status={file.statusNames.join('-')} data-file={file.filename} className="d-flex w-100 d-flex flex-row align-items-center">

@ -22,23 +22,23 @@ export const SourceControlItemButtons = (props: SourceControlItemButtonsProps) =
return <> return <>
{status && status.indexOf("modified") === -1 ? <></> : {status && status.indexOf("modified") === -1 ? <></> :
<button <button
data-id={`unDo${group.name}${path.basename(file.filename)}`} data-id={`unDo${group.name}${path.basename(file.filename)}`}
onClick={async () => await actions.checkoutfile(file.filename)} className='btn btn-sm btn-secondary mr-1 '> onClick={async () => await actions.checkoutfile(file.filename)} className='btn btn-sm btn-secondary mr-1 '>
<FontAwesomeIcon icon={faUndo} className="" /></button> <FontAwesomeIcon icon={faUndo} className="" /></button>
} }
{status && status.indexOf("deleted") === -1 ? <></> : {status && status.indexOf("deleted") === -1 ? <></> :
<button <button
data-id={`unDo${group.name}${path.basename(file.filename)}`} data-id={`unDo${group.name}${path.basename(file.filename)}`}
onClick={async () => { onClick={async () => {
await actions.checkoutfile(file.filename) await actions.checkoutfile(file.filename)
await actions.add({ filepath: file.filename }) await actions.add({ filepath: file.filename })
}} className='btn btn-sm btn-secondary mr-1 '> }} className='btn btn-sm btn-secondary mr-1 '>
<FontAwesomeIcon icon={faUndo} className="" /></button> <FontAwesomeIcon icon={faUndo} className="" /></button>
} }
{status && status.indexOf("deleted") !== -1 ? <></> : {status && status.indexOf("deleted") !== -1 ? <></> :
<button data-id={`unStage${group.name}${path.basename(file.filename)}`} <button data-id={`unStage${group.name}${path.basename(file.filename)}`}
onClick={async () => await actions.rm({ filepath: file.filename })} className='btn btn-sm btn-secondary mr-1 '> onClick={async () => await actions.rm({ filepath: file.filename })} className='btn btn-sm btn-secondary mr-1 '>
<FontAwesomeIcon icon={faMinus} className="" /></button> <FontAwesomeIcon icon={faMinus} className="" /></button>
} }
@ -51,7 +51,7 @@ export const SourceControlItemButtons = (props: SourceControlItemButtonsProps) =
<><button onClick={async () => await actions.checkoutfile(file.filename)} data-id={`undo${group.name}${path.basename(file.filename)}`} className='btn btn-sm btn-secondary mr-1 '> <><button onClick={async () => await actions.checkoutfile(file.filename)} data-id={`undo${group.name}${path.basename(file.filename)}`} className='btn btn-sm btn-secondary mr-1 '>
<FontAwesomeIcon icon={faUndo} className="" /> <FontAwesomeIcon icon={faUndo} className="" />
</button><button data-id={`addToGit${group.name}${path.basename(file.filename)}`} onClick={async () => await actions.rm({ filepath: file.filename })} className='btn btn-sm btn-secondary mr-1 '> </button><button data-id={`addToGit${group.name}${path.basename(file.filename)}`} onClick={async () => await actions.rm({ filepath: file.filename })} className='btn btn-sm btn-secondary mr-1 '>
<FontAwesomeIcon icon={faPlus} className="" /></button></> <FontAwesomeIcon icon={faPlus} className="" /></button></>
} }
{status && status.indexOf("modified") === -1 ? <></> : {status && status.indexOf("modified") === -1 ? <></> :
<button onClick={async () => await actions.checkoutfile(file.filename)} data-id={`undo${group.name}${path.basename(file.filename)}`} className='btn btn-sm btn-secondary mr-1 '> <button onClick={async () => await actions.checkoutfile(file.filename)} data-id={`undo${group.name}${path.basename(file.filename)}`} className='btn btn-sm btn-secondary mr-1 '>

@ -642,7 +642,7 @@ export const loadGitHubUserFromToken = async () => {
} }
export const statusMatrix = async (filepaths: string[]) => { export const statusMatrix = async (filepaths: string[]) => {
const matrix = await plugin.call('dgitApi', 'status', { ref: "HEAD", filepaths: filepaths || ['.'] }); const matrix = await plugin.call('dgitApi', 'status', { ref: "HEAD", filepaths: filepaths || ['.']});
const result = (matrix || []).map((x) => { const result = (matrix || []).map((x) => {
return { return {
filename: `/${x.shift()}`, filename: `/${x.shift()}`,

Loading…
Cancel
Save