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

UI: Design a 404 page for default redirects #57

Merged
merged 6 commits into from
Feb 6, 2021
Merged

UI: Design a 404 page for default redirects #57

merged 6 commits into from
Feb 6, 2021

Conversation

Aaishpra
Copy link
Member

@Aaishpra Aaishpra commented Aug 29, 2020

Description

Solves the Following.

  • Design a 404 page

  • Change route URL to Redirect to /404 on wrong URLs

Fixes #33

Type of Change:

  • Code

  • User Interface

Code/Quality Assurance Only

  • New feature (non-breaking change which adds functionality pre-approved by mentors)

How Has This Been Tested?

ScreenShot for Reference
image

Checklist:

  • My PR follows the style guidelines of this project

  • I have performed a self-review of my own code or materials

  • I have commented my code or provided relevant documentation, particularly in hard-to-understand areas

  • I have made corresponding changes to the documentation

  • Any dependent changes have been merged

  • I have written Kotlin Docs whenever is applicable

Code/Quality Assurance Only

  • My changes generate no new warnings
  • My PR currently breaks something (fix or feature that would cause existing functionality to not work as expected)
  • 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
  • Any dependent changes have been published in downstream modules

Additional Context
I initially wanted to add a button to go back to the home page but since it doesn't Exist hence skipped that part. More suggestions and Additions are welcome for any other Feature within the page

@bismitaguha
Copy link
Contributor

You should have used AuthRoutes IMO!

@Aaishpra
Copy link
Member Author

Done @bismitaguha please review


function ErrorPage() {
return (
<> <Navbar />
Copy link
Contributor

Choose a reason for hiding this comment

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

AuthRoute already contains the Navbar, so this wasn't needed. Reusing components is always preferable. That's why I suggested AuthRoute.

)
}

export default ErrorPage
Copy link
Contributor

Choose a reason for hiding this comment

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

Throughout the application class method has been used.

Copy link
Contributor

Choose a reason for hiding this comment

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

@Aaishpra Make these changes

Copy link
Member Author

Choose a reason for hiding this comment

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

Already done @bismitaguha

Copy link
Member Author

Choose a reason for hiding this comment

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

@bismitaguha is this correct now

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes

@Aaishpra Aaishpra requested a review from bismitaguha August 30, 2020 05:33
@Aaishpra
Copy link
Member Author

Changed the files @bismitaguha

@Aaishpra
Copy link
Member Author

Aaishpra commented Sep 1, 2020

@bismitaguha please review the changes

@Aaishpra
Copy link
Member Author

Aaishpra commented Sep 2, 2020

@abha224 can u review the pull request as @bismitaguha seems not to be available

@bismitaguha
Copy link
Contributor

bismitaguha commented Sep 2, 2020

I had requested changes @Aaishpra .Please make them!

@Aaishpra
Copy link
Member Author

Aaishpra commented Sep 2, 2020

@bismitaguha can u please check my latest commits i guess i changed the file as u requested.

@bismitaguha
Copy link
Contributor

@Aaishpra I didn't ask you to remove classes. The code already written is in exporting a class component not by exporting default function methods
Just go through the src/ directory once.

@sidvenu
Copy link

sidvenu commented Sep 2, 2020

@Aaishpra is the 404 text color the same as the color of Open Source Programs header? If not, I suggest switching to that color.

@Aaishpra
Copy link
Member Author

Aaishpra commented Sep 2, 2020

@sidvenu the color is the same maybe it looks a bit different because the text 404 is much bolder than Open source programs header.

@Aaishpra
Copy link
Member Author

Aaishpra commented Sep 2, 2020

@bismitaguha is the latest commit ok now?

@Aaishpra
Copy link
Member Author

Aaishpra commented Sep 4, 2020

@bismitaguha please review the changes

@bismitaguha
Copy link
Contributor

@Aaishpra Either me or someone else will surely review your PR, from time to time. Considering my situation, I am running busy lately, and so are many other members of the community too. Please have patience and don't worry at all. Your PRs will surely be reviewed. Although, if a week or more passes surely ping/mention any of us on Github/Zulip.

bismitaguha
bismitaguha previously approved these changes Sep 5, 2020
@Aaishpra
Copy link
Member Author

Aaishpra commented Sep 5, 2020

No Problem @bismitaguha got your point.

@Aaishpra
Copy link
Member Author

Aaishpra commented Sep 9, 2020

@sidvenu can you please review this.

sidvenu
sidvenu previously approved these changes Sep 9, 2020
Copy link

@sidvenu sidvenu left a comment

Choose a reason for hiding this comment

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

LGTM!

@sidvenu sidvenu 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 Testing Work has been reviewed and needs the code tested by the quality assurance team. labels Sep 11, 2020
@sidvenu
Copy link

sidvenu commented Sep 11, 2020

@anitab-org/qa-team @anitab-org/open-source-progs-maintainers @anitab-org/open-source-progs-developers Can anyone test this PR out?

@Aaishpra
Copy link
Member Author

Hey,@bismitaguha and @sidvenu can you suggest someone that can test this PR out so that i can personally tag them here, or you people can help with it. Actually a lot of time has already passed since the last review, and no one has come to see this here.

@sidvenu
Copy link

sidvenu commented Sep 23, 2020

@rpattath @bismitaguha if possible, could you test this PR?

Copy link
Member

@devkapilbansal devkapilbansal left a comment

Choose a reason for hiding this comment

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

@Aaishpra please squash your commits into one. It's always better to have one commit per change to keep the history clean

Comment on lines 38 to 39


Copy link
Member

Choose a reason for hiding this comment

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

Why two blank lines are here? We only need one

@rpattath rpattath added Status: Changes Requested Changes are required to be done by the PR author. and removed Status: Needs Testing Work has been reviewed and needs the code tested by the quality assurance team. labels Oct 21, 2020
@INNOVATIVEGAMER
Copy link
Contributor

@Aaishpra You added custom css for all your styling. Styling is promising but this project is already using Semantic-UI as UI framework. I added some comments inside your css with some semantic-ui links which you can use in your component.
You can still use your custom one or two line css by adding style={{}} in components prop directly.
@isabelcosta I highly recommend you to add guidelines for usage of semantic-ui in designing of this repo.

@isabelcosta
Copy link
Member

@INNOVATIVEGAMER good point, could you please create a issue for us to add this to the guidelines please?
@Aaishpra could you take a look at this. How feasible it is to use this instead of custom styling? https://semantic-ui.com/

@INNOVATIVEGAMER
Copy link
Contributor

@INNOVATIVEGAMER good point, could you please create a issue for us to add this to the guidelines please?

I created the issue for this #65. You can check on that.
Also the contributing guidelines link is not working in readme with some mistakes, I created the issue for same also in #64 .

Copy link
Member

@devkapilbansal devkapilbansal left a comment

Choose a reason for hiding this comment

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

@vj-codes @isabelcosta I am not sure about coding practices and all.
But when I tested it locally, the UI changes looks good to me

The changes made in this PR is tested locally, following are the results:-

  1. Code Review - Not Done

  2. All possible responses were tested as below:

  • Test1 Description - 404 error page appears when urls are wrong
    Expected Result:- The error page should appear
    Actual Result:- Same as expected

  • Test2 Description - The UI should be responsive
    Actual Result same as expected
    Open Source Programs

@isabelcosta
Copy link
Member

@devkapilbansal that is just awesome! thank you so much!

@Aaishpra
Copy link
Member Author

@Aaishpra You added custom css for all your styling. Styling is promising but this project is already using Semantic-UI as UI framework. I added some comments inside your css with some semantic-ui links which you can use in your component.
You can still use your custom one or two line css by adding style={{}} in components prop directly.
@isabelcosta I highly recommend you to add guidelines for usage of semantic-ui in designing of this repo.

Thanks for the suggestion, I will update soon with the changes.

Merge branch 'Aaishpra-patch-1' of https://github.com/Aaishpra/open-source-programs-web into Aaishpra-patch-1
@Aaishpra Aaishpra dismissed stale reviews from isabelcosta and vj-codes via dce8022 February 5, 2021 02:40
@Aaishpra
Copy link
Member Author

Aaishpra commented Feb 5, 2021

@isabelcosta I have modified the files according to the suggestion, without any change in designs. Here, I would like to mention one thing earlier I tried using <Container Text> from semantic-UI but it was breaking the design without centering the content, so I still have used some of my custom CSS to center the content and keep the designs same.

image

Hope this is good.

@Aaishpra Aaishpra requested review from isabelcosta and vj-codes and removed request for sidvenu and bismitaguha February 5, 2021 02:53
Copy link
Member

@codesankalp codesankalp left a comment

Choose a reason for hiding this comment

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

Tested Locally @isabelcosta @Aaishpra @vj-codes

Details of the test mentioned below:
Code-Review: Not Done.
Tests:

  1. The 404 error page for invalid URL when not logged in.
    Screenshot:

image

  1. 404 Error page not showing when logged in it redirects to home page maybe this is due to AuthRoute.
    GIF:
    captured gif

  2. The scaling works perfect but for smaller width and height I observed this:
    Screenshot:
    image

Also, Please squash your commits @Aaishpra .

@isabelcosta
Copy link
Member

I can squash so no need to squash @Aaishpra :)
@devkapilbansal and @codesankalp can you please add a code review?
@Aaishpra can you try to get more reviews from the community please, when it has 2 reviews I can merge :)

}

.errorPage {
position: absolute;
Copy link
Contributor

Choose a reason for hiding this comment

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

@Aaishpra Can I ask why are you using absolute positioning when this can be achieved with relative positioning as well. This way the overlapping issue on small screens mentioned by @codesankalp will also resolve.

Copy link
Member Author

Choose a reason for hiding this comment

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

relative is not gonna work on larger screen

@Aaishpra
Copy link
Member Author

Aaishpra commented Feb 6, 2021

This is what i see on my screen when changing position from absolute to relative (also the current design is working fine for smaller heights and width as tested by @devkapilbansal and i don't know how to make it work for even smaller widths)
image
about the AuthRoute part using of AuthRoute was suggested to me by @bismitaguha during code review of this PR (and i also think that it's the correct way to do the redirect instead of using Route).

cc : @isabelcosta @codesankalp @Rahulm2310 @devkapilbansal

@Rahulm2310
Copy link
Contributor

@Aaishpra Not just doing position : relative would work. Try adding width :100% height:100vh. As you already have display flex, justify-content:center, align-items:center, I think this should work. 🙂

@Aaishpra
Copy link
Member Author

Aaishpra commented Feb 6, 2021

@Aaishpra Not just doing position : relative would work. Try adding width :100% height:100vh. As you already have display flex, justify-content:center, align-items:center, I think this should work. slightly_smiling_face

Not working

@khushishikhu
Copy link
Member

I have tested the PR. LGTM!! keep it up @Aaishpra

.errorPage_content p {
font-size: 1.4em;
color: gray;
}
Copy link
Member

Choose a reason for hiding this comment

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

Can we use className (err-num and err-text) instead of style={{}} for Header in ErrorPage.js and add the styles in ErrorPage.css as mentioned below?

Suggested change
}
}
.ui.header.err-num {
color: #2185D0;
font-size: 10vw;
font-weight: bolder;
line-height: 1em;
text-transform: uppercase;
}
.ui.header.err-text {
font-size: 2em;
margin-bottom: 20px;
text-transform: uppercase;
max-width: 600px;
color: #0d0d0d;
}

Copy link
Member

Choose a reason for hiding this comment

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

Any specific reason @codesankalp ? Is this a common convention?

Copy link
Member

@codesankalp codesankalp left a comment

Choose a reason for hiding this comment

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

Code review is done.
LGTM 👍

@isabelcosta
Copy link
Member

Thank you all for the reviews :) I will merge it, and some comments about styling can be done at a later issue.

@isabelcosta isabelcosta merged commit ab18727 into anitab-org:develop Feb 6, 2021
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: Needs Testing Work has been reviewed and needs the code tested by the quality assurance team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI: Design a 404 page for default redirects