Closed jamespaologarcia closed 11 months ago
The changes requested in the ticket look great. I did however notice that the non-logged in user is taken to the login page, instead of the BCROS home page (https://dev.bcregistry.gov.bc.ca/) Can that be updated?
The changes requested in the ticket look great. I did however notice that the non-logged in user is taken to the login page, instead of the BCROS home page (https://dev.bcregistry.gov.bc.ca/) Can that be updated?
@janisrogers Is it correct to tell the user in the breadcrumb that they will go to the login page? After login, they go to the BCROS dashboard (same as logged in).
There is a non logged in version of the BCROS ~dashboard~ Main page. This is where the breadcrumb should take them. I don't think we should direct the user to the login page if they haven't chosen to login.
There is a non logged in version of the BCROS ~dashboard~ Main page. This is where the breadcrumb should take them. I don't think we should direct the user to the login page if they haven't chosen to login.
That's a good point / idea. Janis, let us know whether to proceed with that.
James, when Janis has approved this requirement, the non-logged-in breadcrumb should go to registryHomeUrl
and its text should be "BC Registries and Online Services". The logged-in breadcrumb should go to ${registryHomeUrl}dashboard/${getParams()}
and its text should be "BC Registries Dashboard".
Yes, please proceed with that
James, there might be a problem with how the code determines whether or not the user is authenticated.
I tested this change in the preview build above (temp URL), and it looks fine for logged out, but after logging in, the breadcrumb is incorrect until I refresh the page again. Try it yourself. (I have an idea how to fix it.)
I have an idea how to fix it.
I think the error is that isAuthenticated
checks for the presence of the keycloak token before it's populated. Because it's a getter, its value is cached until something it depends on changes (ie, responsive), but it doesn't recognize changes to the session storage so it keeps its original False value.
Ref: https://stackoverflow.com/questions/69789213/any-way-to-make-sessionstorage-reactive-in-vue3
/gcbrun
Temporary Url for review: https://namerequest-dev--pr-725-eeac624z.web.app
This is good enough for now but I might pick away at the code a bit tomorrow to clean something up.
There was actually a bug in this PR (wrong getter), but I want to keep THIS change separate from the login detection change (*), so I fixed the bug by using isAuthenticated
(in another commit) and created a new ticket for the login detection.
(*) I want us to fix the login detection properly, which is out of scope for THIS ticket.
Issue #: /bcgov/entity#18023
Description of changes: Created a separate breadcrumb for logged in users
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the namerequest license (Apache 2.0).