diff --git a/webui/package-lock.json b/webui/package-lock.json index 796ef970ba1..41aad9cae36 100644 --- a/webui/package-lock.json +++ b/webui/package-lock.json @@ -62,7 +62,7 @@ "@types/lodash": "^4.14.202", "@types/mdast": "^3.0.10", "@types/mime-types": "^3.0.1", - "@types/node": "^20.10.4", + "@types/node": "^20.19.24", "@types/react": "^18.2.43", "@types/react-dom": "^18.2.17", "@types/react-router-dom": "^5.3.3", @@ -3657,9 +3657,9 @@ "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==" }, "node_modules/@types/node": { - "version": "20.19.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.11.tgz", - "integrity": "sha512-uug3FEEGv0r+jrecvUUpbY8lLisvIjg6AAic6a2bSP5OEOLeJsDSnvhCDov7ipFFMXS3orMpzlmi0ZcuGkBbow==", + "version": "20.19.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.24.tgz", + "integrity": "sha512-FE5u0ezmi6y9OZEzlJfg37mqqf6ZDSF2V/NLjUyGrR9uTZ7Sb9F7bLNZ03S4XVUNRWGA7Ck4c1kK+YnuWjl+DA==", "license": "MIT", "dependencies": { "undici-types": "~6.21.0" @@ -20444,9 +20444,9 @@ "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==" }, "@types/node": { - "version": "20.19.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.11.tgz", - "integrity": "sha512-uug3FEEGv0r+jrecvUUpbY8lLisvIjg6AAic6a2bSP5OEOLeJsDSnvhCDov7ipFFMXS3orMpzlmi0ZcuGkBbow==", + "version": "20.19.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.24.tgz", + "integrity": "sha512-FE5u0ezmi6y9OZEzlJfg37mqqf6ZDSF2V/NLjUyGrR9uTZ7Sb9F7bLNZ03S4XVUNRWGA7Ck4c1kK+YnuWjl+DA==", "requires": { "undici-types": "~6.21.0" } diff --git a/webui/package.json b/webui/package.json index 70c9c8dd323..b95720c8463 100644 --- a/webui/package.json +++ b/webui/package.json @@ -74,7 +74,7 @@ "@types/lodash": "^4.14.202", "@types/mdast": "^3.0.10", "@types/mime-types": "^3.0.1", - "@types/node": "^20.10.4", + "@types/node": "^20.19.24", "@types/react": "^18.2.43", "@types/react-dom": "^18.2.17", "@types/react-router-dom": "^5.3.3", diff --git a/webui/src/lib/components/controls.jsx b/webui/src/lib/components/controls.jsx index 300c05d262b..b019ae8049a 100644 --- a/webui/src/lib/components/controls.jsx +++ b/webui/src/lib/components/controls.jsx @@ -546,3 +546,31 @@ export const SearchInput = ({searchPrefix, setSearchPrefix, placeholder}) => { ); }; + +export const TruncatedText = ({ text, maxLength = 50, className = "", style = {} }) => { + const needsTruncation = text && text.length > maxLength; + + const truncatedStyle = { + display: 'inline-block', + maxWidth: '100%', + overflow: 'hidden', + textOverflow: 'ellipsis', + whiteSpace: 'nowrap', + ...style + }; + + if (!needsTruncation) { + return {text}; + } + + return ( + {text}} + > + + {text} + + + ); +}; diff --git a/webui/src/lib/components/repository/compareBranches.jsx b/webui/src/lib/components/repository/compareBranches.jsx index 90a1aca9b66..81fee0832d4 100644 --- a/webui/src/lib/components/repository/compareBranches.jsx +++ b/webui/src/lib/components/repository/compareBranches.jsx @@ -87,9 +87,25 @@ const BranchChangesList = ( if (error) return ; const changesTreeMessage = -

- Showing changes between {reference.id} {""} - and {compareReference.id} +

+ Showing changes between + {reference.id} + and + {compareReference.id}

if (compareReference.id === reference.id) { diff --git a/webui/src/lib/components/repository/compareBranchesActionBar.jsx b/webui/src/lib/components/repository/compareBranchesActionBar.jsx index eb601a84520..b2292b9b0eb 100644 --- a/webui/src/lib/components/repository/compareBranchesActionBar.jsx +++ b/webui/src/lib/components/repository/compareBranchesActionBar.jsx @@ -100,7 +100,12 @@ const MergeButton = ({repo, onDone, source, dest, disabled = false}) => { <> - Merge branch {source} into {dest} + + Merge branch + {source} + into + {dest} +
diff --git a/webui/src/lib/components/repository/tree.jsx b/webui/src/lib/components/repository/tree.jsx index e1be629245a..eb9f2e67f19 100644 --- a/webui/src/lib/components/repository/tree.jsx +++ b/webui/src/lib/components/repository/tree.jsx @@ -478,15 +478,23 @@ const EntryRow = ({ config, repo, reference, path, entry, onDelete, showActions const params = { repoId: repo.id }; const query = { ref: reference.id, path: entry.path }; + const linkStyle = { + overflow: 'hidden', + textOverflow: 'ellipsis', + whiteSpace: 'nowrap', + display: 'block', + maxWidth: '100%' + }; + let button; if (entry.path_type === "common_prefix") { button = ( - + {buttonText} ); } else if (entry.diff_type === "removed") { - button = {buttonText}; + button = {buttonText}; } else { const filePathQuery = { ref: query.ref, @@ -499,6 +507,7 @@ const EntryRow = ({ config, repo, reference, path, entry, onDelete, showActions query: filePathQuery, params: params, }} + style={linkStyle} > {buttonText} @@ -597,13 +606,19 @@ const EntryRow = ({ config, repo, reference, path, entry, onDelete, showActions <> {diffIndicator || ""} - - {entry.path_type === "common_prefix" ? ( - - ) : ( - - )}{" "} - {button} + + + + {entry.path_type === "common_prefix" ? ( + + ) : ( + + )} + + + {button} + + {size} {modified} @@ -662,37 +677,57 @@ export const URINavigator = ({
{relativeTo === "" ? ( <> - lakefs:// + lakefs:// {repo.id} - / + / {displayedReference} - / + / ) : ( <> - {relativeTo} - / + {relativeTo} + / )} @@ -705,14 +740,30 @@ export const URINavigator = ({ const query = { path, ref: reference.id }; const edgeElement = isPathToFile && i === parts.length - 1 ? ( - {part.name} + {part.name} ) : ( <> - {part.name} - {"/"} + {part.name} + {"/"} ); - return {edgeElement}; + return {edgeElement}; })}
diff --git a/webui/src/lib/components/repository/treeRows.jsx b/webui/src/lib/components/repository/treeRows.jsx index f295d194d05..c087549e49c 100644 --- a/webui/src/lib/components/repository/treeRows.jsx +++ b/webui/src/lib/components/repository/treeRows.jsx @@ -106,16 +106,30 @@ const TableRow = ({diffIndicator, depth, loading, showSummary, entry, getMore, r showRevertConfirm, setShowRevertConfirm, pathSection, onRevert, dirExpanded, onExpand, ...rest}) => { return ( {diffIndicator} - - - {pathSection} + + + + {pathSection} + {onExpand && } - {loading ? : ""} {showSummary && } - +
+ + {loading && } +
onRevert(entry)}/> diff --git a/webui/src/pages/repositories/repository/branches.jsx b/webui/src/pages/repositories/repository/branches.jsx index f1771fff1cd..1b95bdfca16 100644 --- a/webui/src/pages/repositories/repository/branches.jsx +++ b/webui/src/pages/repositories/repository/branches.jsx @@ -17,7 +17,7 @@ import { ActionGroup, ActionsBar, ClipboardButton, AlertError, LinkButton, - Loading, PrefixSearchWidget, RefreshButton + Loading, PrefixSearchWidget, RefreshButton, TruncatedText } from "../../../lib/components/controls"; import {useRefs} from "../../../lib/hooks/repo"; import {useAPIWithPagination} from "../../../lib/hooks/api"; @@ -43,7 +43,7 @@ const BranchWidget = ({ repo, branch, onDelete }) => { const isDefault = repo.default_branch === branch.id; let deleteMsg = ( <> - Are you sure you wish to delete branch {branch.id} ? + Are you sure you wish to delete branch ? ); if (branch.id === ImportBranchName) { @@ -60,16 +60,21 @@ const BranchWidget = ({ repo, branch, onDelete }) => {
- - {branch.id} - + + + {branch.id} + + {isDefault && <> diff --git a/webui/src/pages/repositories/repository/objects.jsx b/webui/src/pages/repositories/repository/objects.jsx index 9545144ea8a..94312d6320d 100644 --- a/webui/src/pages/repositories/repository/objects.jsx +++ b/webui/src/pages/repositories/repository/objects.jsx @@ -682,9 +682,16 @@ const UploadButton = ({config, repo, reference, path, onDone, onClick, onHide, s <> - - - Upload Objects to Branch '{reference.id}' + + + Upload Objects to Branch ' + {reference.id} + ' @@ -1041,7 +1048,18 @@ const TreeContainer = ({ } }} onRevert={onReset} - changesTreeMessage={

Showing {changesResults.length} change{changesResults.length !== 1 ? 's' : ''} for branch {reference.id}

} + changesTreeMessage={ +

+ Showing {changesResults.length} change{changesResults.length !== 1 ? 's' : ''} for branch + {reference.id} +

+ } noChangesText="No changes - you can modify this branch by uploading data using the UI or any of the supported SDKs" emptyStateComponent={} /> diff --git a/webui/src/pages/repositories/repository/pulls/pullDetails.jsx b/webui/src/pages/repositories/repository/pulls/pullDetails.jsx index 86078a28392..afea3434265 100644 --- a/webui/src/pages/repositories/repository/pulls/pullDetails.jsx +++ b/webui/src/pages/repositories/repository/pulls/pullDetails.jsx @@ -7,7 +7,7 @@ import {GitMergeIcon, GitPullRequestClosedIcon, GitPullRequestIcon} from "@prime import dayjs from "dayjs"; import Markdown from 'react-markdown' -import {AlertError, Loading} from "../../../../lib/components/controls"; +import {AlertError, Loading, TruncatedText} from "../../../../lib/components/controls"; import {useRefs} from "../../../../lib/hooks/repo"; import {useRouter} from "../../../../lib/hooks/router"; import {RepoError} from "../error"; @@ -110,10 +110,17 @@ const PullDetailsContent = ({repo, pull}) => { // message example: " wants to merge into ." const PullInfo = ({repo, pull}) => <> - - {pull.author} {`${getActionText(pull.status)} `} - {""} - into . + + {pull.author} + {getActionText(pull.status)} + + + + into + + + + . ; @@ -185,7 +192,7 @@ const BranchLink = ({repo, branch}) => params: {repoId: repo.id}, query: {ref: branch} }}> - {branch} + ; // this is pretty hacky, but there seem to be no other way to detect this specific error diff --git a/webui/src/pages/repositories/repository/pulls/pullsList.jsx b/webui/src/pages/repositories/repository/pulls/pullsList.jsx index 9d4e701ce8e..24e1d8d6d66 100644 --- a/webui/src/pages/repositories/repository/pulls/pullsList.jsx +++ b/webui/src/pages/repositories/repository/pulls/pullsList.jsx @@ -57,10 +57,10 @@ const PullWidget = ({repo, pull}) => {
{getDescription()}
-
-
{pull.destination_branch}
- -
{pull.source_branch}
+
+
{pull.destination_branch}
+ +
{pull.source_branch}
); diff --git a/webui/src/pages/repositories/repository/tags.jsx b/webui/src/pages/repositories/repository/tags.jsx index 89977b8a638..16ee30bdc6b 100644 --- a/webui/src/pages/repositories/repository/tags.jsx +++ b/webui/src/pages/repositories/repository/tags.jsx @@ -17,7 +17,7 @@ import { ActionGroup, ActionsBar, ClipboardButton, AlertError, LinkButton, - Loading, PrefixSearchWidget, RefreshButton + Loading, PrefixSearchWidget, RefreshButton, TruncatedText } from "../../../lib/components/controls"; import { useRefs } from "../../../lib/hooks/repo"; import { useAPIWithPagination } from "../../../lib/hooks/api"; @@ -39,14 +39,14 @@ const TagWidget = ({ repo, tag, onDelete }) => { return (
-
-
+
+
- {tag.id} +
diff --git a/webui/src/styles/objects/tree.css b/webui/src/styles/objects/tree.css index 526b5df954a..ace39fa0e3a 100644 --- a/webui/src/styles/objects/tree.css +++ b/webui/src/styles/objects/tree.css @@ -18,6 +18,11 @@ padding: 0; } +.tree-container table { + table-layout: fixed; + width: 100%; +} + .tree-entry-row, .change-entry-row { transition: background-color var(--transition-fast); @@ -30,6 +35,12 @@ .tree-path { font-size: 0.9rem; + white-space: nowrap !important; + overflow: hidden; + text-overflow: ellipsis; + max-width: 0; /* Allow table to constrain width */ + width: auto; + min-width: 0; } .tree-path .octicon { @@ -65,6 +76,29 @@ color: var(--bs-nav-link-color); } +/* Change summary and row actions alignment */ +.change-summary { + white-space: nowrap !important; + vertical-align: middle; + width: auto; + min-width: 0; +} + +/* Row actions alignment and spacing */ +.change-entry-row-actions { + white-space: nowrap !important; + vertical-align: middle; + width: auto; + min-width: 0; + display: flex; + align-items: center; + justify-content: flex-end; +} + +.change-entry-row-actions .btn { + margin-left: 0; +} + /* Gear icon visibility and alignment */ .change-entry-row-actions .dropdown-toggle, .row-hover .btn-outline-danger {