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

Create a button visible only to admins which would allow them to jump between prod (codelab.fun) and localhost #1031

Open
kirjs opened this issue Sep 6, 2019 · 2 comments

Comments

@kirjs
Copy link
Collaborator

kirjs commented Sep 6, 2019

Add a new button to the list of buttons:

image

If the button is pressed on local environment, the user would be redirected to exactly the same page, but in prod, e.g.
http://localhost:4200/angular/forms/built-in -> https://codelab.fun/angular/forms/built-in
If the user is in prod, the user would be redirected to the local version
https://codelab.fun/angular/forms/built-in -> http://localhost:4200/angular/forms/built-in

To make the button visible only for admins:
use oldIsAdmin$ Observable from AccessService To only display the button for admins.

@duntee
Copy link

duntee commented Oct 10, 2019

Hello! I would like to try this once I have time :-)

@kirjs
Copy link
Collaborator Author

kirjs commented Oct 10, 2019

Go for it.

After some thought, sounds like this would be a bit hard to test.

As half of the data comes from FireBase, and the other half from location, I'd recommend writing a unit test mocking both and testing there.

Let me know if you get stuck at any point.

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

No branches or pull requests

3 participants