Skip to content

Commit f39de47

Browse files
authored
Merge branch 'master' into runtestsonmasteronly
2 parents 3bcf4da + 50efbdf commit f39de47

File tree

5 files changed

+117
-95
lines changed

5 files changed

+117
-95
lines changed

apps/remix-ide/src/app/tabs/locales/en/filePanel.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,5 +141,6 @@
141141
"filePanel.movingFolderFailed": "Moving Folder Failed",
142142
"filePanel.movingFolderFailedMsg": "Unexpected error while moving folder: {src}",
143143
"filePanel.workspaceActions": "Workspace actions",
144-
"filePanel.saveCodeSample": "This code-sample workspace will not be persisted. Click here to save it."
144+
"filePanel.saveCodeSample": "This code-sample workspace will not be persisted. Click here to save it.",
145+
"filePanel.updateSubmodules": "Update all submodules of repository. Click to pull dependencies."
145146
}

libs/remix-ui/helper/src/lib/components/custom-dropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const CustomToggle = React.forwardRef(
2929
className={className.replace('dropdown-toggle', '')}
3030
>
3131
<div className="d-flex">
32-
<div className="mr-auto text-nowrap overflow-hidden">{children}</div>
32+
<div className="mr-auto text-nowrap text-truncate overflow-hidden">{children}</div>
3333
{icon && (
3434
<div className="pr-1">
3535
<i className={`${icon} pr-1`}></i>

libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function HomeTabFeatured() {
1212
const themeFilter = useContext(ThemeContext)
1313

1414
return (
15-
<div className="pt-1 pl-2 h-100" id="hTFeaturedeSection">
15+
<div className="pt-1 pl-2" id="hTFeaturedeSection">
1616
<div className="mb-2 remix_ui-carousel-container">
1717
<div className="w-100 d-flex flex-column rounded-3 remix_ui-carouselbox">
1818
<ThemeContext.Provider value={themeFilter}>

libs/remix-ui/workspace/src/lib/css/remix-ui-workspace.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@
7777
background: var(--custom-select);
7878
}
7979

80+
.branches-dropdown {
81+
max-width: 16rem;
82+
}
83+
8084
.custom-dropdown-items a {
8185
border-radius: .25rem;
8286
text-transform: none;

libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx

Lines changed: 109 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
&#10003; <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+
&#10003; <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

Comments
 (0)