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

Fix:Sidebar icons on minimized/closed position are not linked to rele… #264

Closed
wants to merge 3 commits into from

Conversation

arkumari2000
Copy link
Contributor

Description

Atm the Sidebar icons are now linked to the relevant pages.

Fixes #260

Type of Change:

  • Code
  • User Interface

Code/Quality Assurance Only

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

I didn't set up the BIT backend and tested it without logging in by removing hidden from the code, but the code I pushed is perfectly fine which shows the sidebar only to the logged-in person.
And as I didn't log in, the video will contain the login page when I click on links but please focus on the bottom left corner. This will direct the logged-in person to the perfect link.

123808994-da4a3d00-d90e-11eb-95d0-21f19328cfc8.mov

Checklist:

  • My PR follows the style guidelines of this project
  • I have performed a self-review of my own code or materials

Code/Quality Assurance Only

  • My changes generate no new warnings

@arkumari2000 arkumari2000 changed the title Bug:Sidebar icons on minimized/closed position are not linked to rele… Fix:Sidebar icons on minimized/closed position are not linked to rele… Jun 29, 2021
mtreacy002
mtreacy002 previously approved these changes Jul 7, 2021
Copy link
Member

@mtreacy002 mtreacy002 left a comment

Choose a reason for hiding this comment

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

Great job, @arkumari2000 for fixing the bug 👍. I've tested this on my local device and here's the test summary.

  1. Code review: Done

  2. Tested all possible outcomes.
    Expected behaviour: reasonable sizes of sidebar is shown on closed/opened positions.
    Actual behaviour: as expected
    ezgif com-gif-maker (73)

  3. Environment:
    OS: MacOS BigSur
    Browser: Microsoft Edge

Thank you again for your contribution 🎉🎉🎉.

We only need one more approving review before this can be merged. cc @Rahulm2310 , can you please help with this?

@mtreacy002 mtreacy002 added Category: Coding Changes to code base or refactored code that doesn't fix a bug. Category: User Interface Improvements or additions to design. Status: Needs Review PR needs an additional review or a maintainer's review. Type: Bug Bug or Bug fixes. labels Jul 7, 2021
@@ -15,7 +15,7 @@ export default function Sidebar(){
return (
<div className={!isAuth ? "hidden" : ""}>
Copy link
Contributor

Choose a reason for hiding this comment

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

@arkumari2000 I don't think this is the right way to do conditional rendering. Anyone can change the toggle the display:none css property from the developer tools. Ideally, if isAuth is false, then the component should return null. So please don't use this hidden class as a way of conditional rendering a component.
cc: @mtreacy002

Copy link
Member

@mtreacy002 mtreacy002 Jul 7, 2021

Choose a reason for hiding this comment

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

I agree with @Rahulm2310 , @arkumari2000 . Perhaps the reason why you used hidden is because you didn't run the backend servers in parallel as you're supposed to and use this to by pass the isAuth. For this time, we can let it slide since the manual tests shows that it works when I run the backend servers. But for it to be merged to the upstream branch, can you please remove the hidden option as per @Rahulm2310 suggested? Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes sure, I will do the conditional rendering and not hidden property.

@Rahulm2310 Rahulm2310 added Status: Changes Requested Changes are required to be done by the PR author. and removed Status: Needs Review PR needs an additional review or a maintainer's review. labels Jul 7, 2021
Copy link
Member

@mtreacy002 mtreacy002 left a comment

Choose a reason for hiding this comment

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

@arkumari2000 , thank you for accommodating the requested changes. @Rahulm2310 , I think this is Ok now since the isAuth is no longer using conditional rendering (the rest of conditional rendering only related to the user's action on the sidebar after login is successful. So, I'm happy to approve this now. Let me know what you think 😉.

onClick={() => setNotActive(!isNotActive)}
className="btn btn-custom"
>
<span className={isNotActive ? "" : "hidden"}>{barsIcon}</span>
Copy link
Contributor

@Rahulm2310 Rahulm2310 Jul 20, 2021

Choose a reason for hiding this comment

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

@arkumari2000 Can you do the conditional rendering here for the menu icon as well

);
};
);
}else{
Copy link
Contributor

Choose a reason for hiding this comment

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

You can use ternary operator instead of if-else. Like return isAuth? <component> : ""

key="bottom"
placement="bottom"
overlay={
<Tooltip id={`tooltip-$'bottom'`}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar to this, there should be tooltips for all menu links

@vj-codes
Copy link
Member

Any updates @arkumari2000 ?

@vj-codes
Copy link
Member

Closing the PR due to inactivity.
Thank you for your contribution!

@vj-codes vj-codes closed this Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Coding Changes to code base or refactored code that doesn't fix a bug. Category: User Interface Improvements or additions to design. Status: Changes Requested Changes are required to be done by the PR author. Type: Bug Bug or Bug fixes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Sidebar icons on minimized/closed position are not linked to relevant pages
4 participants