diff --git a/package.json b/package.json index f18faf8f5..c89c55846 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "harperdb-studio", - "version": "4.8.14", + "version": "4.8.15", "description": "A UI for HarperDB", "deploymentUrl": "studio.harperdb.io", "private": true, diff --git a/src/assets/styles/components/_web-ide.scss b/src/assets/styles/components/_web-ide.scss index 352929431..9b280bf91 100644 --- a/src/assets/styles/components/_web-ide.scss +++ b/src/assets/styles/components/_web-ide.scss @@ -81,7 +81,7 @@ padding: 0 !important; padding-inline-start: 8px !important; - .folder-container { + .file-container { button::before, i::before { background: transparent !important; @@ -109,15 +109,6 @@ text-align: left; white-space: nowrap; - .project-icon, - .package-icon { - color: $color-success; - } - - .folder-icon { - color: $color-info; - } - .filetype-js { color: $color-warning; } @@ -130,6 +121,59 @@ color: $color-lightgrey; } + &.file-selected { + .filename-text { + color: $color-white !important; + + &::after { + content: '\f35a' !important; + font-family: 'Font Awesome 5 Free', sans-serif !important; + font-size: 16px; + position: absolute; + right: 8px; + } + } + } + } + } + + .folder-container { + button::before, + i::before { + background: transparent !important; + border: 0; + font-size: 16px !important; + margin: 0; + outline: none !important; + padding: 0; + } + + .package-text, + .filename-text { + color: $color-grey !important; + font-size: 14px !important; + padding-left: 8px; + } + + .file, + .package { + background: transparent; + border: 0; + margin: 1px 0; + outline: none !important; // TODO: fix this because it is not accessible; style differently + padding: 3px; + text-align: left; + white-space: nowrap; + + .project-icon, + .package-icon { + color: $color-success; + } + + .folder-icon { + color: $color-info; + } + &.folder-selected { .filename-text { color: $color-white !important; @@ -158,6 +202,12 @@ } } } + .folder-open ~ li { + display: block; + } + .folder-closed ~ li { + display: none; + } } } } diff --git a/src/components/auth/AuthLayout.jsx b/src/components/auth/AuthLayout.jsx index 5516514b2..038237ebf 100644 --- a/src/components/auth/AuthLayout.jsx +++ b/src/components/auth/AuthLayout.jsx @@ -1,7 +1,7 @@ import { Outlet } from 'react-router'; import { Col, Container, Row } from 'reactstrap'; -function AuthLayout({ children }) { +function AuthLayout() { return ( diff --git a/src/components/instance/functions/manage/applicationsEditor/FileBrowser.js b/src/components/instance/functions/manage/applicationsEditor/FileBrowser.js index 9c9094a44..a9fa1ed87 100644 --- a/src/components/instance/functions/manage/applicationsEditor/FileBrowser.js +++ b/src/components/instance/functions/manage/applicationsEditor/FileBrowser.js @@ -40,12 +40,34 @@ function directorySortComparator(a, b) { const isFolder = (entry) => Boolean(entry.entries); -function ProjectIcon() { - return ; +function ProjectIcon({ toggleClosed, isOpen }) { + return ( + + ); } -function FolderIcon({ toggleClosed }) { - // eslint-disable-next-line - return ; +function FolderIcon({ toggleClosed, isOpen }) { + return ( + // TODO: A11y on this is not good at all..... Need to refactor the file tree to make the file tree more accessible for ALL users. + + ); } function FiletypeIcon({ extension }) { @@ -99,7 +121,6 @@ function File({ directoryEntry, selectedFile, selectedFolder, onFileSelect, onFo const deployFileIconClass = 'deploy-project'; const isFileSelected = directoryEntry.path === selectedFile; const isFolderSelected = directoryEntry.path === selectedFolder?.path; - // file receives open/close toggle func from // parent. if it's a dir, calls toggle func on click // if it's a flat file, calls onFileSelect so @@ -119,7 +140,6 @@ function File({ directoryEntry, selectedFile, selectedFolder, onFileSelect, onFo // that we don't untoggle directory selection; leave selected if icon clicked. const iconWasClicked = e.target.classList.contains(renameFileIconClass) || e.target.classList.contains(deployFileIconClass); - // if icon's clicked, select, but don't unselect. // if (iconWasClicked) return; @@ -176,7 +196,7 @@ function Folder({ // top-level dir === package // FolderIcon/PackageIcon is func so we can give it open args now, but instantiate it later. if (directoryEntry.path.split('/').length === 2) { - Icon = () => ProjectIcon(); + Icon = () => ProjectIcon({ isOpen: open, toggleClosed: () => setOpen(!open) }); } else if (directoryEntry.entries) { Icon = () => FolderIcon({ isOpen: open, toggleClosed: () => setOpen(!open) }); } else { @@ -188,7 +208,12 @@ function Folder({ { // FIXME: don't hardcode 'components', get from root .name property of fileTree. directoryEntry.name !== 'components' ? ( -
  • +
  • {directoryEntry.package ? (