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

feat: back button #1178

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

luke-mcfarlane-rocketlab
Copy link
Contributor

@luke-mcfarlane-rocketlab luke-mcfarlane-rocketlab commented Oct 14, 2024

JIRA Ticket

BSS-389

Description

Added the option to have a back button within the app as well as fixing the current breadcrumb implementation to work on all screens.

Proposed Changes

  • added navigation environment variable to switch between breadcrumbs and back button
  • created re-useable transparent button component
  • updated breadcrumbs component to correctly work on all screens rather than separate implementations per screen
  • moved fixed breadcrumbs and back button component into the layout to be available on all screens
  • removed breadcrumbs component from individual screens
  • added some string manipulation functions to handle the path to breadcrumbs conversion

How to Test

  1. Add VITE_NAVIGATION=breadcrumbs to your .env file
  2. Navigate away from home page to multiple different screens
  3. Ensure both the appearance and function of the breadcrumbs are working correctly
  4. Update .env to have VITE_NAVIGATION=back-button and repeat steps 2 and 3

Additional Information

Checklist

  • I have confirmed all commits have been signed.
  • I have added JSDoc style comments to any new functions or classes.
  • Relevant documentation such as READMEs, guides, and class comments are updated.

@stevecassidy
Copy link
Contributor

Behaviour after creating a child record is probably not intuitive. Back takes me back to the child record I just edited and closed which makes sense since that was the last place I was at but how does the user then navigate up to the notebook at that point? Back button doesn't give the same functionality as the breadcrumbs.

Copy link
Contributor

@stevecassidy stevecassidy left a comment

Choose a reason for hiding this comment

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

Maybe the answer here is to have the 'back' link be the last link in the breadcrumb chain suitably labelled. 'Back to Notebook', 'Back to Site' etc if you can work out those names at the same time as you're working out the human readable names for the breadcrumb links.

</Typography>
);
})}
<Box display="flex" flexDirection="row-reverse">
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to use human readable names rather than identifiers for the notebook/form/record eg. what we used to have: "Notebooks / Campus Survey Demo / Survey Area: Zone Beta; Some area / Element: Rubbish bin-00030"

Copy link
Contributor

Choose a reason for hiding this comment

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

Also these breadcrumb entries aren't links and you have a fixed number of them rather than being driven by the data prop - if we're in a Building then there would be four levels of breadcrumb Home > Survey > Site > Building.

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

Successfully merging this pull request may close these issues.

2 participants