largegittest2
bunsenstraat 3 months ago
parent 14af8f4b00
commit f3c0b80e3e
  1. 65
      libs/remix-ui/git/src/components/gitui.tsx

@ -5,7 +5,7 @@ import { openDiff, openFile, saveToken, sendToMatomo, setModifiedDecorator, setP
import { gitActionsContext, pluginActionsContext } from '../state/context' import { gitActionsContext, pluginActionsContext } from '../state/context'
import { gitReducer } from '../state/gitreducer' import { gitReducer } from '../state/gitreducer'
import { defaultGitState, defaultLoaderState, gitMatomoEventTypes, gitState, gitUIPanels, loaderState } from '../types' import { defaultGitState, defaultLoaderState, gitMatomoEventTypes, gitState, gitUIPanels, loaderState } from '../types'
import { Accordion } from "react-bootstrap"; import { Accordion, Button } from "react-bootstrap";
import { CommitMessage } from './buttons/commitmessage' import { CommitMessage } from './buttons/commitmessage'
import { Commits } from './panels/commits' import { Commits } from './panels/commits'
import { Branches } from './panels/branches' import { Branches } from './panels/branches'
@ -52,8 +52,8 @@ export const GitUI = (props: IGitUi) => {
type: 'info', type: 'info',
title: 'Loading Git Plugin' title: 'Loading Git Plugin'
}) })
setTimeout(() => { setTimeout(() => {
setAppLoaded(true) setAppLoaded(true)
}, 2000) }, 2000)
}, []) }, [])
@ -72,6 +72,7 @@ export const GitUI = (props: IGitUi) => {
const username = await plugin.call('settings', 'get', 'settings/github-user-name') const username = await plugin.call('settings', 'get', 'settings/github-user-name')
const email = await plugin.call('settings', 'get', 'settings/github-email') const email = await plugin.call('settings', 'get', 'settings/github-email')
const token = await plugin.call('settings', 'get', 'settings/gist-access-token') const token = await plugin.call('settings', 'get', 'settings/gist-access-token')
console.log('token', token, username, email)
setSetup(!(username && email)) setSetup(!(username && email))
} }
@ -174,12 +175,8 @@ export const GitUI = (props: IGitUi) => {
<gitActionsContext.Provider value={gitActionsProviderValue}> <gitActionsContext.Provider value={gitActionsProviderValue}>
<pluginActionsContext.Provider value={pluginActionsProviderValue}> <pluginActionsContext.Provider value={pluginActionsProviderValue}>
<BranchHeader /> <BranchHeader />
{setup ? <Setup></Setup> : null} <Accordion activeKey={activePanel} defaultActiveKey="0" className="">
{needsInit ? <Init></Init> : null} {!setup && !needsInit ? <>
{setup || needsInit ? <><hr></hr><h5>CLONE</h5>
<Clone hideLoadFromGitHub={setup}></Clone></> : null}
{!setup && !needsInit ?
<Accordion activeKey={activePanel} defaultActiveKey="0" className="">
<SourceControlNavigation eventKey={gitUIPanels.SOURCECONTROL} activePanel={activePanel} callback={setActivePanel} /> <SourceControlNavigation eventKey={gitUIPanels.SOURCECONTROL} activePanel={activePanel} callback={setActivePanel} />
<Accordion.Collapse className='bg-light' eventKey={gitUIPanels.SOURCECONTROL}> <Accordion.Collapse className='bg-light' eventKey={gitUIPanels.SOURCECONTROL}>
<div className="px-2 py-2"> <div className="px-2 py-2">
@ -216,30 +213,32 @@ export const GitUI = (props: IGitUi) => {
</div> </div>
</Accordion.Collapse> </Accordion.Collapse>
<hr></hr> <hr></hr>
<CloneNavigation eventKey={gitUIPanels.CLONE} activePanel={activePanel} callback={setActivePanel} /> </> : null}
<Accordion.Collapse className='bg-light' eventKey={gitUIPanels.CLONE}> {needsInit ? <>
<div className="px-2 py-2"> <Init /></> : null}
<Clone /></div> <CloneNavigation eventKey={gitUIPanels.CLONE} activePanel={activePanel} callback={setActivePanel} />
</Accordion.Collapse> <Accordion.Collapse className='bg-light' eventKey={gitUIPanels.CLONE}>
<hr></hr> <div className="px-2 py-2">
<GitHubNavigation eventKey={gitUIPanels.GITHUB} activePanel={activePanel} callback={setActivePanel} /> <Clone /></div>
<Accordion.Collapse className='bg-light' eventKey={gitUIPanels.GITHUB}> </Accordion.Collapse>
<div className="px-2 py-2"> <hr></hr>
<GetDeviceCode></GetDeviceCode>
<hr></hr> <GitHubNavigation eventKey={gitUIPanels.GITHUB} activePanel={activePanel} callback={setActivePanel} />
<GitHubCredentials></GitHubCredentials> <Accordion.Collapse className='bg-light' eventKey={gitUIPanels.GITHUB}>
</div> <div className="px-2 py-2">
</Accordion.Collapse> <GetDeviceCode></GetDeviceCode>
<hr></hr> <hr></hr>
<LogNavigation eventKey={gitUIPanels.LOG} activePanel={activePanel} callback={setActivePanel} /> <GitHubCredentials></GitHubCredentials>
<Accordion.Collapse className='bg-light' eventKey={gitUIPanels.LOG}> </div>
<div className="px-2 py-2"> </Accordion.Collapse>
<LogViewer /> <hr></hr>
</div> <LogNavigation eventKey={gitUIPanels.LOG} activePanel={activePanel} callback={setActivePanel} />
</Accordion.Collapse> <Accordion.Collapse className='bg-light' eventKey={gitUIPanels.LOG}>
<div className="px-2 py-2">
</Accordion> <LogViewer />
: null} </div>
</Accordion.Collapse>
</Accordion>
</pluginActionsContext.Provider> </pluginActionsContext.Provider>
</gitActionsContext.Provider> </gitActionsContext.Provider>
</loaderContext.Provider> </loaderContext.Provider>

Loading…
Cancel
Save