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

LF-4086: Create pure action bar component #3140

Merged
merged 11 commits into from
Feb 29, 2024

Conversation

SayakaOno
Copy link
Collaborator

@SayakaOno SayakaOno commented Feb 22, 2024

Description

  • Create PureActionMenu component with stories.
  • Add icons (I added animas icons to /animals and the rest to /images directly. Let me know if this is a bad idea)
  • Modify routes to send isCompactSideMenu to Inventory component
  • Add ActionMenu to the Inventory component (this was out of scope, but I wanted to make sure the component can be positioned as expected)
  • Add animation (it felt strange that the action menu is fixed when expanding/collapsing the side menu, so I added it.. but I will leave it to the person who is working on the actual implementation)
  • Add license to the SQL file

(Joyce, the colour class names haven't changed! That was a false alarm, sorry)

Jira link: https://lite-farm.atlassian.net/browse/LF-4086

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Passes test case
  • UI components visually reviewed on desktop view
  • UI components visually reviewed on mobile view
  • Other (please explain)

Checklist:

  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The precommit and linting ran successfully
  • I have added or updated language tags for text that's part of the UI
  • I have added "MISSING" for all new language tags to languages I don't speak
  • I have added the GNU General Public License to all new files

@SayakaOno SayakaOno added the enhancement New feature or request label Feb 22, 2024
@SayakaOno SayakaOno self-assigned this Feb 22, 2024
@SayakaOno SayakaOno changed the title [WIP] LF-4086: Create pure action bar component LF-4086: Create pure action bar component Feb 23, 2024
@SayakaOno SayakaOno marked this pull request as ready for review February 23, 2024 00:25
@SayakaOno SayakaOno requested review from a team as code owners February 23, 2024 00:25
@SayakaOno SayakaOno requested review from antsgar and kathyavini and removed request for a team February 23, 2024 00:25
}: ActionMenuProps) => {
// If the className is not yet supported, ensure to add corresponding styles for the widths
// of the component and each iconGroup to the SCSS file.
const iconCountClassName = styles[`iconCount_${iconActions.length}`];
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can make this work more generically without having to add a specific class and do the math for each number of icons, but it was kinda hard to explain in words so I branched off and tried it out in a branch of my own. I pushed it, the branch name isgeneric-styling-for-action-menu -- take a look and let me know what you think!

Copy link
Collaborator Author

@SayakaOno SayakaOno Feb 23, 2024

Choose a reason for hiding this comment

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

Thank you for reviewing! I don't see any new commits in your branch, have you pushed them??
The width of the action menu needs to be 408px for 4 icon buttons, so I added the className, but look forward to seeing your solution!

Copy link
Collaborator

Choose a reason for hiding this comment

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

I didn't push 😅 lol! Just pushed them

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you @antsgar!
I took a look at your code. I think the problems that we will have when not specifying the widths are:

  1. Without the component width, the component will get longer when label texts are long. (Also I followed Loïc's design that the component width should be 408px for four buttons.)
  2. Without the width for each button, the space between buttons differ depending on the label texts.
    Screenshot 2024-02-26 at 9 49 27 AM

What do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, I see! In that case your approach seems good since it's truer to the design spec, let's keep that 🙂

@antsgar antsgar self-requested a review February 27, 2024 12:48
antsgar
antsgar previously approved these changes Feb 27, 2024
kathyavini
kathyavini previously approved these changes Feb 28, 2024
Copy link
Collaborator

@kathyavini kathyavini left a comment

Choose a reason for hiding this comment

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

This looks beautiful -- both component and code!

I think it just has a merge conflict in Inventory since the placeholder table was merged.

@SayakaOno SayakaOno dismissed stale reviews from kathyavini and antsgar via 095327d February 28, 2024 17:41
@SayakaOno
Copy link
Collaborator Author

@antsgar @kathyavini
I have just fixed merge conflicts. Re-reviews would be appreciated, thank you!

@antsgar antsgar added this pull request to the merge queue Feb 29, 2024
Merged via the queue into integration with commit fd1378b Feb 29, 2024
5 checks passed
@antsgar antsgar deleted the LF-4086/Create_PureActionBar_component branch February 29, 2024 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants