|
|
@ -1,6 +1,6 @@ |
|
|
|
import React, { useState, useEffect, useRef, useContext, SyntheticEvent, ChangeEvent, KeyboardEvent } from 'react' // eslint-disable-line
|
|
|
|
import React, { useState, useEffect, useRef, useContext, SyntheticEvent, ChangeEvent, KeyboardEvent } from 'react' // eslint-disable-line
|
|
|
|
import { Dropdown, OverlayTrigger, Tooltip } from 'react-bootstrap' |
|
|
|
import { Dropdown } from 'react-bootstrap' |
|
|
|
import { CustomIconsToggle, CustomMenu, CustomToggle } from '@remix-ui/helper' |
|
|
|
import { CustomIconsToggle, CustomMenu, CustomToggle, CustomTooltip } from '@remix-ui/helper' |
|
|
|
import { FileExplorer } from './components/file-explorer' // eslint-disable-line
|
|
|
|
import { FileExplorer } from './components/file-explorer' // eslint-disable-line
|
|
|
|
import { FileSystemContext } from './contexts' |
|
|
|
import { FileSystemContext } from './contexts' |
|
|
|
import './css/remix-ui-workspace.css' |
|
|
|
import './css/remix-ui-workspace.css' |
|
|
@ -336,13 +336,11 @@ export function Workspace () { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const workspaceMenuIcons = [ |
|
|
|
const workspaceMenuIcons = [ |
|
|
|
<OverlayTrigger |
|
|
|
<CustomTooltip |
|
|
|
placement="right" |
|
|
|
placement="right" |
|
|
|
overlay={ |
|
|
|
tooltipId="createWorkspaceTooltip" |
|
|
|
<Tooltip id="createWorkspaceTooltip" className="text-nowrap"> |
|
|
|
tooltipClasses="text-nowrap" |
|
|
|
<span>Create</span> |
|
|
|
tooltipText="Create" |
|
|
|
</Tooltip> |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
> |
|
|
|
> |
|
|
|
<div |
|
|
|
<div |
|
|
|
data-id='workspaceCreate' |
|
|
|
data-id='workspaceCreate' |
|
|
@ -366,14 +364,12 @@ export function Workspace () { |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
<span className="pl-3">Create</span> |
|
|
|
<span className="pl-3">Create</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</OverlayTrigger>, |
|
|
|
</CustomTooltip>, |
|
|
|
<OverlayTrigger |
|
|
|
<CustomTooltip |
|
|
|
placement="right-start" |
|
|
|
placement="right-start" |
|
|
|
overlay={ |
|
|
|
tooltipId="createWorkspaceTooltip" |
|
|
|
<Tooltip id="createWorkspaceTooltip" className="text-nowrap"> |
|
|
|
tooltipClasses="text-nowrap" |
|
|
|
<span>Delete Workspace</span> |
|
|
|
tooltipText="Delete Workspace" |
|
|
|
</Tooltip> |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
> |
|
|
|
> |
|
|
|
<div |
|
|
|
<div |
|
|
|
data-id='workspaceDelete' |
|
|
|
data-id='workspaceDelete' |
|
|
@ -397,14 +393,12 @@ export function Workspace () { |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
<span className="pl-3">{'Delete'}</span> |
|
|
|
<span className="pl-3">{'Delete'}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</OverlayTrigger>, |
|
|
|
</CustomTooltip>, |
|
|
|
<OverlayTrigger |
|
|
|
<CustomTooltip |
|
|
|
placement='right-start' |
|
|
|
placement='right-start' |
|
|
|
overlay={ |
|
|
|
tooltipClasses="text-nowrap" |
|
|
|
<Tooltip id="workspaceRenametooltip"> |
|
|
|
tooltipId="workspaceRenametooltip" |
|
|
|
<span>Rename Workspace</span> |
|
|
|
tooltipText="Rename Workspace" |
|
|
|
</Tooltip> |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
> |
|
|
|
> |
|
|
|
<div onClick={() => { |
|
|
|
<div onClick={() => { |
|
|
|
renameCurrentWorkspace() |
|
|
|
renameCurrentWorkspace() |
|
|
@ -426,15 +420,13 @@ export function Workspace () { |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
<span className="pl-3">{'Rename'}</span> |
|
|
|
<span className="pl-3">{'Rename'}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</OverlayTrigger>, |
|
|
|
</CustomTooltip>, |
|
|
|
<Dropdown.Divider className="border mb-0 mt-0" />, |
|
|
|
<Dropdown.Divider className="border mb-0 mt-0" />, |
|
|
|
<OverlayTrigger |
|
|
|
<CustomTooltip |
|
|
|
placement="right-start" |
|
|
|
placement="right-start" |
|
|
|
overlay={ |
|
|
|
tooltipId="cloneWorkspaceTooltip" |
|
|
|
<Tooltip id="cloneWorkspaceTooltip" className="text-nowrap"> |
|
|
|
tooltipClasses="text-nowrap" |
|
|
|
<span>Clone Git Repository</span> |
|
|
|
tooltipText="Clone Git Repository" |
|
|
|
</Tooltip> |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
> |
|
|
|
> |
|
|
|
<div |
|
|
|
<div |
|
|
|
data-id='cloneGitRepository' |
|
|
|
data-id='cloneGitRepository' |
|
|
@ -458,15 +450,13 @@ export function Workspace () { |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
<span className="pl-3">{'Clone'}</span> |
|
|
|
<span className="pl-3">{'Clone'}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</OverlayTrigger>, |
|
|
|
</CustomTooltip>, |
|
|
|
<Dropdown.Divider className="border mt-0 mb-0 remixui_menuhr" style={{ pointerEvents: 'none' }}/>, |
|
|
|
<Dropdown.Divider className="border mt-0 mb-0 remixui_menuhr" style={{ pointerEvents: 'none' }}/>, |
|
|
|
<OverlayTrigger |
|
|
|
<CustomTooltip |
|
|
|
placement="right-start" |
|
|
|
placement="right-start" |
|
|
|
overlay={ |
|
|
|
tooltipId="createWorkspaceTooltip" |
|
|
|
<Tooltip id="createWorkspaceTooltip" className="text-nowrap"> |
|
|
|
tooltipClasses="text-nowrap" |
|
|
|
<span>Download Workspace</span> |
|
|
|
tooltipText="Download Workspace" |
|
|
|
</Tooltip> |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
> |
|
|
|
> |
|
|
|
<div |
|
|
|
<div |
|
|
|
data-id='workspacesDownload' |
|
|
|
data-id='workspacesDownload' |
|
|
@ -490,14 +480,12 @@ export function Workspace () { |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
<span className="pl-3">{'Download'}</span> |
|
|
|
<span className="pl-3">{'Download'}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</OverlayTrigger>, |
|
|
|
</CustomTooltip>, |
|
|
|
<OverlayTrigger |
|
|
|
<CustomTooltip |
|
|
|
placement="right-start" |
|
|
|
placement="right-start" |
|
|
|
overlay={ |
|
|
|
tooltipId="createWorkspaceTooltip" |
|
|
|
<Tooltip id="createWorkspaceTooltip" className="text-nowrap"> |
|
|
|
tooltipClasses="text-nowrap" |
|
|
|
<span>Restore Workspace Backup</span> |
|
|
|
tooltipText="Restore Workspace Backup" |
|
|
|
</Tooltip> |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
> |
|
|
|
> |
|
|
|
<div |
|
|
|
<div |
|
|
|
data-id='workspacesRestore' |
|
|
|
data-id='workspacesRestore' |
|
|
@ -521,7 +509,7 @@ export function Workspace () { |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
<span className="pl-3">{'Restore'}</span> |
|
|
|
<span className="pl-3">{'Restore'}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</OverlayTrigger>, |
|
|
|
</CustomTooltip>, |
|
|
|
] |
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
@ -540,11 +528,9 @@ export function Workspace () { |
|
|
|
{currentWorkspace !== LOCALHOST ? (<span className="remixui_menu remixui_topmenu d-flex justify-content-between align-items-end w-75"> |
|
|
|
{currentWorkspace !== LOCALHOST ? (<span className="remixui_menu remixui_topmenu d-flex justify-content-between align-items-end w-75"> |
|
|
|
<OverlayTrigger |
|
|
|
<OverlayTrigger |
|
|
|
placement="top-end" |
|
|
|
placement="top-end" |
|
|
|
overlay={ |
|
|
|
tooltipId="createWorkspaceTooltip" |
|
|
|
<Tooltip id="createWorkspaceTooltip" className="text-nowrap"> |
|
|
|
tooltipClasses="text-nowrap" |
|
|
|
<span>Create</span> |
|
|
|
tooltipText="Create" |
|
|
|
</Tooltip> |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
> |
|
|
|
> |
|
|
|
<span |
|
|
|
<span |
|
|
|
hidden={currentWorkspace === LOCALHOST} |
|
|
|
hidden={currentWorkspace === LOCALHOST} |
|
|
@ -559,7 +545,7 @@ export function Workspace () { |
|
|
|
className='far fa-plus remixui_menuicon d-flex align-self-end' |
|
|
|
className='far fa-plus remixui_menuicon d-flex align-self-end' |
|
|
|
> |
|
|
|
> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</OverlayTrigger> |
|
|
|
</CustomTooltip> |
|
|
|
<Dropdown id="workspacesMenuDropdown" data-id="workspacesMenuDropdown" onToggle={() => hideIconsMenu(!showIconsMenu)} show={showIconsMenu}> |
|
|
|
<Dropdown id="workspacesMenuDropdown" data-id="workspacesMenuDropdown" onToggle={() => hideIconsMenu(!showIconsMenu)} show={showIconsMenu}> |
|
|
|
<Dropdown.Toggle |
|
|
|
<Dropdown.Toggle |
|
|
|
as={CustomIconsToggle} |
|
|
|
as={CustomIconsToggle} |
|
|
|