Skip to content
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

Container sort #244

Merged
merged 6 commits into from
Jul 7, 2023
Merged

Container sort #244

merged 6 commits into from
Jul 7, 2023

Conversation

LawrenceB5477
Copy link
Contributor

@LawrenceB5477 LawrenceB5477 commented Jul 6, 2023

Summary

  • Fixed a bug where where the container menu was displaying behind other panels by default in the container view.
    -Added a default sort option by active containers in the container view, and added the option to open up a sort menu to sort containers by status.

image

Proposed Changes

Checklist

  • I added tests
  • I updated the README if necessary
  • This PR introduces a breaking change
  • Fixed issue #
  • I added a picture of a cute animal cause it's fun

Added support for a menu that sorts container statuses on the container page.
- Added sort by container status
- Fixed a bug where the container menu was always showing behind the other container panels
# Conflicts:
#	src/screen.js
#	widgets/containers/containerList.widget.js
- Undo deletions
Removed comments
@LawrenceB5477
Copy link
Contributor Author

First time ever contributing to open source, sorry if the commit history is a bit messy. If you want me to change the key to open the sort menu / put the sort menu and the bug fix in separate PRs I can.

this.refreshList();
}

// TODO refactor this
formatList (containers) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love what I had to do to this method. It's unfortunate that the library expects an array instead of an object, because I had to push the status to use it in a calculation later, then pop it.

@@ -119,7 +119,7 @@ class myWidget extends baseWidget() {
}

getWidget () {
return this.grid.gridObj.set(...this.grid.gridLayout, this.blessed.list, {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was causing the actions menu to always be drawn behind the main container view, it was just not noticeable unless you resized the terminal window to specific screen sizes.
image
You can see in this screenshot the menu poking out to the right of the container status panel ^

@LawrenceB5477
Copy link
Contributor Author

@lirantal Is there anything you need me to do before you merge?

@lirantal
Copy link
Owner

lirantal commented Jul 7, 2023

@LawrenceB5477 thanks for the PR. Looks like nice work!

There were some lint errors that I was able to fix and push to your branch.

@lirantal lirantal merged commit 968f451 into lirantal:main Jul 7, 2023
5 of 6 checks passed
@github-actions
Copy link

🎉 This PR is included in version 3.23.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants