-
Notifications
You must be signed in to change notification settings - Fork 381
UI: Unify uncommitted changes tab into objects #9181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
like we had long time ago ;) |
Great initiative 😄 On the product side (havne't looked at the code yet):
|
indeed.
correct! it appears if theres one or more uncommitted change on the branch
Fixed that! clicking the uncommitted changes button toggles between showing only uncommitted changes/everything (default) - the dropdown next to it opens a dropdown with commit and rollback buttons |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A great change, I like it a lot.
Some details that needs to be handled -
Mainly around code structure and some nits.
Anyway, I enjoy the result 😄
|
||
return ( | ||
<Nav variant="tabs" > | ||
<Link active={active === 'objects'} href={withRefContext(`/repositories/${repoId}/objects`)} component={NavItem}> | ||
<DatabaseIcon/> Objects | ||
</Link> | ||
<Link active={active === 'changes'} href={withBranchContext(`/repositories/${repoId}/changes`)} component={NavItem}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
@@ -586,7 +586,7 @@ const EntryRow = ({ config, repo, reference, path, entry, onDelete, showActions | |||
return ( | |||
<> | |||
<tr className={rowClass}> | |||
{diffIndicator && <td className="diff-indicator">{diffIndicator}</td>} | |||
<td className="diff-indicator">{diffIndicator || ""}</td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise, some lines (those that have changes) will have more td's than one that don't
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, missed that 👍
* @param repo Repository | ||
* @param reference commitID / branch | ||
*/ | ||
export const EmptyChangesState = ({ repo, reference }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably nit, but -
This is the first func in this file.
I think it should be further down, since it makes it harder for me to understand what's this file is all about.
<h3 className="mb-3">No Changes Yet</h3> | ||
<p className="text-muted mb-4"> | ||
No uncommitted changes on <code>{reference.id}</code>! | ||
<br />Upload or modify files to see them appear here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not advised to use
for layout (only for specific line-breaks in a text).
It gives less control on how it looks.
); | ||
}; | ||
|
||
export async function appendMoreResults(resultsState, prefix, afterUpdated, setAfterUpdated, setResultsState, getMore) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's not you who named it (well, at least not in this PR 😄),
But it's confusing - results of what?
I assume it should be something like appendMoreObjectsListResults
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree - will resist the urge to do it in this PR though :)
}) => { | ||
const [actionError, setActionError] = useState(null); | ||
const [internalRefresh, setInternalRefresh] = useState(true); | ||
const [afterUpdated, setAfterUpdated] = useState(""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's afterUpdated
? Why it's initialized to ""
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's used for pagination but terribly named. Renamed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This became a huge file.
I highly suggest splitting it into smaller components.
webui/src/styles/objects/objects.css
Outdated
} | ||
|
||
/* Override action-bar button margins for button groups */ | ||
.action-bar .btn-group .btn { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why that's needed? Can't this be done using ml-0
on the object itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not :) removed
webui/src/styles/objects/objects.css
Outdated
} | ||
|
||
.changes-action-btn { | ||
margin: 0 !important; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, and in tree.css
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, thanks for handling this!
Approved -
Can you please either create an Issue (or a PR 😄) for breaking objects.jsx
into smaller components? 🙏
@@ -586,7 +586,7 @@ const EntryRow = ({ config, repo, reference, path, entry, onDelete, showActions | |||
return ( | |||
<> | |||
<tr className={rowClass}> | |||
{diffIndicator && <td className="diff-indicator">{diffIndicator}</td>} | |||
<td className="diff-indicator">{diffIndicator || ""}</td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, missed that 👍
This is part of @itaigilo's vision which I agree with :) some tabs in the lakeFS UI are redundant. This is step #1 - show changes when exploring a branch in the same view, a dedicated tab for it is not required and increases cognitive load.
Before:
Upload in object screen:

See the diff (and commit it) in "uncommitted changes":
After:
Commit directly from objects page: