Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions webui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions webui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"leaflet": "^1.9.4",
"leaflet-defaulticon-compatibility": "^0.1.2",
"lodash": "^4.17.21",
"lucide-react": "^0.525.0",
"p-map": "^7.0.0",
"prismjs": "^1.29.0",
"react": "^18.2.0",
Expand Down
13 changes: 10 additions & 3 deletions webui/src/lib/components/repository/treeRows.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,22 @@ import {OverlayTrigger} from "react-bootstrap";
import Tooltip from "react-bootstrap/Tooltip";
import Button from "react-bootstrap/Button";
import {TreeRowType} from "../../../constants";
import { BarChart3 } from 'lucide-react';

class RowAction {
/**
* @param {JSX.Element} icon
* @param {string} tooltip
* @param {string} text
* @param {()=>void} onClick
* @param {boolean} active
*/
constructor(icon, tooltip= "", text, onClick) {
constructor(icon, tooltip= "", text, onClick, active = false) {
this.icon = icon
this.tooltip = tooltip
this.text = text
this.onClick = onClick
this.active = active
}
}

Expand All @@ -37,6 +40,7 @@ const ChangeRowActions = ({actions}) => <>
actions.map(action => (
<OverlayTrigger key={action.text} placement="bottom" overlay={<Tooltip hidden={!action.tooltip}>{action.tooltip}</Tooltip>}>
<Button variant="link" disabled={false}
className={`row-action-btn ${action.active ? 'active' : ''}`}
onClick={(e) => {
e.preventDefault();
action.onClick()
Expand All @@ -57,7 +61,9 @@ export const ObjectTreeEntryRow = ({entry, relativeTo = "", diffExpanded, depth

const rowActions = []
if (onClickExpandDiff) {
rowActions.push(new RowAction(null, null, diffExpanded ? "Hide object changes" : "Show object changes", onClickExpandDiff))
const expandIcon = diffExpanded ? <ChevronDownIcon/> : <ChevronRightIcon/>;
const expandTooltip = diffExpanded ? "Hide object changes" : "Show object changes";
rowActions.push(new RowAction(expandIcon, expandTooltip, null, onClickExpandDiff))
}
if (onRevert) {
rowActions.push(new RowAction(<HistoryIcon/>, "Revert changes", null, () => {
Expand All @@ -81,7 +87,8 @@ export const PrefixTreeEntryRow = ({entry, relativeTo = "", dirExpanded, depth =
pathSection = <Link href={onNavigate(entry)}>{pathSection}</Link>
}
const rowActions = []
rowActions.push(new RowAction(null, null, showSummary ? "Hide change summary" : "Calculate change summary", () => setShowSummary(!showSummary)))
const summaryTooltip = showSummary ? "Hide change summary" : "Calculate change summary";
rowActions.push(new RowAction(<BarChart3/>, summaryTooltip, null, () => setShowSummary(!showSummary), showSummary))
if (onRevert) {
rowActions.push(new RowAction(<HistoryIcon/>, "Revert changes", null, () => {
setShowRevertConfirm(true)
Expand Down
10 changes: 10 additions & 0 deletions webui/src/styles/objects/tree.css
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,14 @@ tr:hover .row-hover .btn-outline-danger {
[data-bs-theme="dark"] .tree-container .dropdown-divider,
[data-bs-theme="dark"] .change-entry-row .dropdown-divider {
border-color: #374151;
}

.row-action-btn {
color: #000000;
opacity: 1;
}

.row-action-btn.active {
color: #6c757d;
opacity: 0.7;
}
Loading