@@ -1343,102 +1343,119 @@ export function Workspace() {
13431343 </ div >
13441344 </ div >
13451345 </ div >
1346- { selectedWorkspace && (
1346+ { selectedWorkspace && (
13471347 < div className = { `bg-light border-top ${ selectedWorkspace . isGitRepo && currentBranch ? 'd-block' : 'd-none' } ` } data-id = "workspaceGitPanel" >
1348- < div className = "d-flex justify-space-between p-1" >
1349- < div className = "mr-auto text-uppercase text-dark pt-2 px-1" > GIT</ div >
1350- { selectedWorkspace . hasGitSubmodules ?
1351- < div className = "pt-1 mr-1" >
1352- { global . fs . browser . isRequestingCloning ? < div style = { { height : 30 , minWidth : 165 } } className = 'btn btn-sm border text-muted small' > < i className = "fad fa-spinner fa-spin" > </ i > updating submodules</ div > :
1353- < div style = { { height : 30 , minWidth : 165 } } onClick = { updateSubModules } data-id = 'updatesubmodules' className = { `btn btn-sm border small ${ highlightUpdateSubmodules ? 'text-warning' : 'text-muted' } ` } > update submodules</ div > }
1354- </ div >
1355- : null }
1356- < div className = "pt-1 mr-1" data-id = "workspaceGitBranchesDropdown" >
1357- < Dropdown style = { { height : 30 , minWidth : 80 } } onToggle = { toggleBranches } show = { showBranches } drop = { 'up' } >
1358- < Dropdown . Toggle
1359- as = { CustomToggle }
1360- id = "dropdown-custom-components"
1361- className = "btn btn-light btn-block w-100 d-inline-block border border-dark form-control h-100 p-0 pl-2 pr-2 text-dark"
1362- icon = { null }
1363- >
1364- { global . fs . browser . isRequestingCloning ? < i className = "fad fa-spinner fa-spin" > </ i > : currentBranch || '-none-' }
1365- </ Dropdown . Toggle >
1366-
1367- < Dropdown . Menu as = { CustomMenu } className = "custom-dropdown-items branches-dropdown" >
1368- < div data-id = "custom-dropdown-menu" >
1369- < div className = "d-flex text-dark" style = { { fontSize : 14 , fontWeight : 'bold' } } >
1370- < span className = "mt-2 ml-2 mr-auto" >
1371- < FormattedMessage id = "filePanel.switchBranches" />
1372- </ span >
1373- < div
1374- className = "pt-2 pr-2"
1375- onClick = { ( ) => {
1376- toggleBranches ( false )
1377- } }
1378- >
1379- < i className = "fa fa-close" > </ i >
1348+ < div className = "d-flex justify-content-between p-1" >
1349+ < div className = "text-uppercase text-dark pt-1 px-1" > GIT</ div >
1350+ { selectedWorkspace . hasGitSubmodules ?
1351+ < CustomTooltip
1352+ placement = "top"
1353+ tooltipId = "updateSubmodules"
1354+ tooltipClasses = "text-nowrap"
1355+ tooltipText = { < FormattedMessage id = "filePanel.updateSubmodules" /> }
1356+ >
1357+ < div className = "pr-1" >
1358+ { global . fs . browser . isRequestingCloning ? < button style = { { height : 30 , minWidth : "9rem" } } className = 'btn btn-sm border text-dark' >
1359+ < i className = "fad fa-spinner fa-spin" > </ i >
1360+ Updating submodules
1361+ </ button > :
1362+ < button style = { { height : 30 , minWidth : "9rem" } } onClick = { updateSubModules } data-id = 'updatesubmodules' className = { `btn btn-sm border ${ highlightUpdateSubmodules ? 'text-warning' : 'text-dark' } ` } >
1363+ Update submodules
1364+ </ button > }
1365+ </ div >
1366+ </ CustomTooltip >
1367+ : null
1368+ }
1369+ < CustomTooltip
1370+ placement = "right"
1371+ tooltipId = "branchesDropdown"
1372+ tooltipClasses = "text-nowrap"
1373+ tooltipText = { 'Current branch: ' + currentBranch || 'Branches' }
1374+ >
1375+ < div className = "pt-0 mr-2" data-id = "workspaceGitBranchesDropdown" >
1376+ < Dropdown style = { { height : 30 , maxWidth : "6rem" , minWidth : "6rem" } } onToggle = { toggleBranches } show = { showBranches } drop = { 'up' } >
1377+ < Dropdown . Toggle
1378+ as = { CustomToggle }
1379+ id = "dropdown-custom-components"
1380+ className = "btn btn-sm btn-light d-inline-block border border-dark form-control h-100 p-0 pl-2 pr-2 text-dark"
1381+ icon = { null }
1382+ >
1383+ { global . fs . browser . isRequestingCloning ? < i className = "fad fa-spinner fa-spin" > </ i > : currentBranch || '-none-' }
1384+ </ Dropdown . Toggle >
1385+ < Dropdown . Menu as = { CustomMenu } className = "custom-dropdown-items branches-dropdown" >
1386+ < div data-id = "custom-dropdown-menu" >
1387+ < div className = "d-flex text-dark" style = { { fontSize : 14 , fontWeight : 'bold' } } >
1388+ < span className = "mt-2 ml-2 mr-auto" >
1389+ < FormattedMessage id = "filePanel.switchBranches" />
1390+ </ span >
1391+ < div
1392+ className = "pt-2 pr-2"
1393+ onClick = { ( ) => {
1394+ toggleBranches ( false )
1395+ } }
1396+ >
1397+ < i className = "fa fa-close" > </ i >
1398+ </ div >
13801399 </ div >
1381- </ div >
1382- < div className = "border-top py-2" >
1383- < input
1384- className = "form-control border checkout-input bg-light"
1385- placeholder = { intl . formatMessage ( {
1386- id : 'filePanel.findOrCreateABranch'
1387- } ) }
1388- style = { { minWidth : 225 } }
1389- onChange = { handleBranchFilterChange }
1390- data-id = "workspaceGitInput"
1391- />
1392- </ div >
1393- < div className = "border-top" style = { { maxHeight : 120 , overflowY : 'scroll' } } data-id = "custom-dropdown-items" >
1394- { filteredBranches . length > 0 ? (
1395- filteredBranches . map ( ( branch , index ) => {
1396- return (
1397- < Dropdown . Item
1398- key = { index }
1399- onClick = { ( ) => {
1400- switchToBranch ( branch )
1401- } }
1402- title = { intl . formatMessage ( { id : `filePanel.switchToBranch${ branch . remote ? 'Title1' : 'Title2' } ` } ) }
1403- >
1404- < div data-id = { `workspaceGit-${ branch . remote ? `${ branch . remote } /${ branch . name } ` : branch . name } ` } >
1405- { currentBranch === branch . name && ! branch . remote ? (
1406- < span >
1407- ✓ < i className = "far fa-code-branch" > </ i >
1408- < span className = "pl-1" > { branch . name } </ span >
1409- </ span >
1410- ) : (
1411- < span className = "pl-3" >
1412- < i className = { `far ${ branch . remote ? 'fa-cloud' : 'fa-code-branch' } ` } > </ i >
1413- < span className = "pl-1" > { branch . remote ? `${ branch . remote } /${ branch . name } ` : branch . name } </ span >
1414- </ span >
1415- ) }
1416- </ div >
1417- </ Dropdown . Item >
1418- )
1419- } )
1420- ) : (
1421- < Dropdown . Item onClick = { switchToNewBranch } >
1422- < div className = "pl-1 pr-1" data-id = "workspaceGitCreateNewBranch" >
1423- < i className = "fas fa-code-branch pr-2" > </ i >
1424- < span >
1425- < FormattedMessage id = "filePanel.createBranch" /> : { branchFilter } from '{ currentBranch } '
1426- </ span >
1427- </ div >
1428- </ Dropdown . Item >
1400+ < div className = "border-top py-2" >
1401+ < input
1402+ className = "form-control border checkout-input bg-light"
1403+ placeholder = { intl . formatMessage ( {
1404+ id : 'filePanel.findOrCreateABranch'
1405+ } ) }
1406+ style = { { minWidth : 225 } }
1407+ onChange = { handleBranchFilterChange }
1408+ data-id = "workspaceGitInput"
1409+ />
1410+ </ div >
1411+ < div className = "border-top" style = { { maxHeight : 120 , overflowY : 'scroll' } } data-id = "custom-dropdown-items" >
1412+ { filteredBranches . length > 0 ? (
1413+ filteredBranches . map ( ( branch , index ) => {
1414+ return (
1415+ < Dropdown . Item
1416+ key = { index }
1417+ onClick = { ( ) => {
1418+ switchToBranch ( branch )
1419+ } }
1420+ title = { intl . formatMessage ( { id : `filePanel.switchToBranch${ branch . remote ? 'Title1' : 'Title2' } ` } ) }
1421+ >
1422+ < div data-id = { `workspaceGit-${ branch . remote ? `${ branch . remote } /${ branch . name } ` : branch . name } ` } >
1423+ { currentBranch === branch . name && ! branch . remote ? (
1424+ < span >
1425+ ✓ < i className = "far fa-code-branch" > </ i >
1426+ < span className = "pl-1" > { branch . name } </ span >
1427+ </ span >
1428+ ) : (
1429+ < span className = "pl-3" >
1430+ < i className = { `far ${ branch . remote ? 'fa-cloud' : 'fa-code-branch' } ` } > </ i >
1431+ < span className = "pl-1" > { branch . remote ? `${ branch . remote } /${ branch . name } ` : branch . name } </ span >
1432+ </ span >
1433+ ) }
1434+ </ div >
1435+ </ Dropdown . Item >
1436+ )
1437+ } )
1438+ ) : (
1439+ < Dropdown . Item onClick = { switchToNewBranch } >
1440+ < div className = "pl-1 pr-1" data-id = "workspaceGitCreateNewBranch" >
1441+ < i className = "fas fa-code-branch pr-2" > </ i >
1442+ < span >
1443+ < FormattedMessage id = "filePanel.createBranch" /> : { branchFilter } from '{ currentBranch } '
1444+ </ span >
1445+ </ div >
1446+ </ Dropdown . Item >
1447+ ) }
1448+ </ div >
1449+ { ( selectedWorkspace . branches || [ ] ) . length > 4 && (
1450+ < button className = "btn btn-sm w-100" style = { { cursor : "pointer" } } onClick = { showAllBranches } >
1451+ < FormattedMessage id = "filePanel.viewAllBranches" />
1452+ </ button >
14291453 ) }
14301454 </ div >
1431- { ( selectedWorkspace . branches || [ ] ) . length > 4 && (
1432- < div className = "text-center border-top pt-2" >
1433- < label style = { { fontSize : 12 , cursor : 'pointer' } } onClick = { showAllBranches } >
1434- < FormattedMessage id = "filePanel.viewAllBranches" />
1435- </ label >
1436- </ div >
1437- ) }
1438- </ div >
1439- </ Dropdown . Menu >
1440- </ Dropdown >
1441- </ div >
1455+ </ Dropdown . Menu >
1456+ </ Dropdown >
1457+ </ div >
1458+ </ CustomTooltip >
14421459 </ div >
14431460 </ div >
14441461 ) }
0 commit comments