dbudwin / RoboHome-Web

RoboHome-Web is the codebase that represents the frontend of the RoboHome project. The web interface provides a way to create users, add and manage devices, and an additional way to control devices. :robot: :house_with_garden:
GNU General Public License v3.0
8 stars 17 forks source link

Custom 404 error page #166

Closed kailichiang closed 5 years ago

kailichiang commented 5 years ago

Description

Create a 404 page and CSS.

Motivation and Context

Redirect 404 response to customized 404 page. #112

How Has This Been Tested?

Screenshots (if appropriate):

page-404

Types of changes

Checklist:

dbudwin commented 5 years ago

Also, please have a look at Code Climate's results from linting the CSS. I'm not a CSS expert, so I can't weight in very well as to what may or may not need to be changed: https://codeclimate.com/github/dbudwin/RoboHome-Web/pull/166

dbudwin commented 5 years ago

One more thing, you originally pushed 6 commits, I think you need to update your local master to be inline with the remote master and rebase this one commit (plus any additional commits you add) on top of the new master.

kailichiang commented 5 years ago

One more thing, you originally pushed 6 commits, I think you need to update your local master to be inline with the remote master and rebase this one commit (plus any additional commits you add) on top of the new master.

I will do the update according to your comments. Only this part. I'm not very clear. In fact, I started the branch after syncing with the original master (dbudwin/RoboHome-We). I have no idea is this because I firstly did PR #155 by master branch and got merged. If you can give a piece of guide, it would be very helpful.

dbudwin commented 5 years ago

I have no idea is this because I firstly did PR #155 by master branch and got merged

This would be my guess which is why I try to make sure I never do work on my master branch. You may need to try something like the following:

git remote add upstream https://github.com/dbudwin/RoboHome-Web
git checkout master
git pull upstream master # Hopefully now your local master matches the remote master
git checkout page404
git rebase -i master
# Do the rebase work here
git push --force-with-lease origin page404

Then, during the interactive rebase only pick the actual commit and delete the other lines (I'm assuming you can use vim here a little bit). I believe this should fix it for you. Ultimately, you want to make sure your local master is set to the same commit as the remote master which is currently https://github.com/dbudwin/RoboHome-Web/commit/875000d05832114965dd74af4fcf0f03c35fe3cd.

It may also be possible to do a cherrypick, so modify the above commands a little bit to looks like:

git checkout page404
git branch -m page404-backup
git remote add upstream https://github.com/dbudwin/RoboHome-Web
git checkout master
git pull upstream master
git checkout page404
git cherry-pick 308c49a28916cb4fe037d70c52c3ebe249b1fabb #This will hopefully take this one commit and put it on top of the remote master in a branch called page404
git push --force-with-lease origin page404
dbudwin commented 5 years ago

If it gives you too much trouble trying to remove those extra commits just let me know, I should be able to do it for you a little later. I don't want you to get frustrated with my obsessiveness for an orderly Git history. I really appreciate your contributions to my project lately and want to keep you on my good side 😄

kailichiang commented 5 years ago
git remote add upstream https://github.com/dbudwin/RoboHome-Web
git checkout master
git pull upstream master # Hopefully now your local master matches the remote master
git checkout page404
git rebase -i master
# Do the rebase work here
git push --force-with-lease origin page404
git checkout page404
git branch -m page404-backup
git remote add upstream https://github.com/dbudwin/RoboHome-Web
git checkout master
git pull upstream master
git checkout page404
git cherry-pick 308c49a28916cb4fe037d70c52c3ebe249b1fabb #This will hopefully take this one commit and put it on top of the remote master in a branch called page404
git push --force-with-lease origin page404

In fact, I did the exactly the same thing before. And I just did it again. Unfortunately, it looks worse now... Whatever I did now or before, in the git log of my master, I see one more commit after 875000d, showing b803591 - (HEAD -> master, origin/master, origin/HEAD) Merge branch 'master' of https://github.com/dbudwin/RoboHome-Web (6 days ago) <kailichiang> I have no idea if this is the problem. To make the history clean and clear, I may need to delete my fork and fork from your current master, and the create PR again. If you can do anything from your side to resolve the problem, just do it.

BTW, if I wanna keep contributing, it looks like I have to remove the commit b803591, right?

dbudwin commented 5 years ago

I'll fix the extra commits in this PR and the other one later today. Then it may be easiest for you if you re-clone your fork onto your machine and start fresh for any new work you decide to do. Git can be frustrating sometimes.

dbudwin commented 5 years ago

I cleaned up your branch a bit and made a few minor changes:

  1. I changed the include path for the CSS file to have a leading / to fix a problem of the 404 page not looking right if you went to a URL several levels deep like /a/b.
  2. I added another test to verify the "Go Back" link works as expected, but this actually has a bug in Laravel, so I'm just going to leave it for now.