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[#50499]: Add navigational elements (breadcrumb and back buttons) #13962

Merged
merged 13 commits into from
Nov 23, 2023

Conversation

dominic-braeunlein
Copy link
Contributor

Work package: https://community.openproject.org/wp/50499

This PR adds 'OpPrimer::BackButtonComponent' in app/components/op_primer
This button inherits from Primer::Beta::IconButton and needs only the href as parameter.

This PR also adds this BackButton and breadcrumbs in storage edit view.
The breadcrumbs are outside of the header because Primer::OpenProject::PageHeader doesn't have a slot for breadcumbs.

There is a left-margin problem that I need to clarify with @HDinger (see picture below). Or maybe @akabiru you know too where the margin-left: 2rem; for <ol> tags should be overridden.

Screenshot 2023-10-20 at 14 34 56

I will clarify this before merging

@HDinger
Copy link
Contributor

HDinger commented Oct 20, 2023

Hi @dominic-braeunlein

we have a file called primer-adjustements.sass where you can add the override for the ol tag inside the Breadcrumb. We already do something similar with lists inside the Box component.

With regards to the Breadcrumb and the BackButton being outside of the PageHeader: I am curious whether you discussed the option to add these elements directly to the PageHeader component itself, instead of writing them next to it? At first glance it would be worth the effort, as this is not the only page that will need this, and the custom backButton would then be obsolete as well. @akabiru how do you think about it?

Copy link
Member

@akabiru akabiru left a comment

Choose a reason for hiding this comment

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

Great start @dominic-braeunlein 🙌🏾 A few remarks on general convention

🔴 For any UI interactions, we generally add feature tests. See https://github.com/opf/openproject/blob/dev/modules/storages/spec/features/admin_storages_spec.rb


fyi, I'm using @mereghost 's traffic light system for code review comments 😄

#13223 (review)
🟢 Just me being weird or minor suggestions
🟡 Points that warrant clarification discussion
🔴 (which I use sparingly) Major issues that need to be addressed before a merge

@akabiru akabiru force-pushed the implementation/50212-convert-the-edit-page-to-primer-design branch 2 times, most recently from b1fec70 to f544fbe Compare October 25, 2023 14:17
Base automatically changed from implementation/50212-convert-the-edit-page-to-primer-design to dev October 27, 2023 08:48
@dominic-braeunlein dominic-braeunlein force-pushed the implementation/50499-add-navigational-elements branch from 514265f to 6278a20 Compare November 1, 2023 13:01
@dominic-braeunlein dominic-braeunlein marked this pull request as draft November 1, 2023 13:40
@dominic-braeunlein
Copy link
Contributor Author

dominic-braeunlein commented Nov 1, 2023

I redid that PR from scratch.

The BreadcrumbHelper.full_breadcrumb method is replaced with one that renders Primer::Beta::Breadcrumbs.
I renamed full_breadcrumb to full_breadcrumbs. The method is only used in app/views/layouts/base.html.erb as far as I can see.

@HDinger
The margin-left from OpenProject is overridden in _primer-adjustments.sass with following CSS. I am not sure if this selector is specific enough. What do you think?

nav
  > ol 
    margin-left: 0

@akabiru
FYI: I have the same update problem with the storage name in the Breadcrumb as in this WP-50738. I still have to work on that.
And I set show_local_breadcrumb in storages_controller.rb to true with this PR so they show again.

This PR should only be merged after opf/primer_view_components#45 is merged.

@HDinger
Copy link
Contributor

HDinger commented Nov 2, 2023

@HDinger The margin-left from OpenProject is overridden in _primer-adjustments.sass with following CSS. I am not sure if this selector is specific enough. What do you think?

nav
  > ol 
    margin-left: 0

Hi @dominic-braeunlein

I think you could limit this a bit by using:

 #breadcrumb
   ol 
      margin-left: 0

Thus we could be sure, that the effects are really limited to the breadcrumb and not other nav tags where we might not want that. 🤷‍♀️

@dominic-braeunlein dominic-braeunlein force-pushed the implementation/50499-add-navigational-elements branch from 6778af1 to 6514964 Compare November 17, 2023 10:07
@dominic-braeunlein dominic-braeunlein marked this pull request as ready for review November 17, 2023 14:26
@dominic-braeunlein dominic-braeunlein force-pushed the implementation/50499-add-navigational-elements branch from 3603a07 to ea7369b Compare November 20, 2023 15:14
Copy link
Member

@akabiru akabiru left a comment

Choose a reason for hiding this comment

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

Top work @dominic-braeunlein 👏🏾 🥇


Just a few non-blocking remarks 👍🏾

app/helpers/breadcrumb_helper.rb Outdated Show resolved Hide resolved
app/helpers/breadcrumb_helper.rb Show resolved Hide resolved
Copy link
Contributor

@HDinger HDinger left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍 🥳 Next to the things @akabiru menitoned you should probably rebase, as the primer bump has already been merged to dev.

@dominic-braeunlein dominic-braeunlein force-pushed the implementation/50499-add-navigational-elements branch from ea7369b to 4f3995f Compare November 22, 2023 16:54
@dominic-braeunlein dominic-braeunlein merged commit 43ea75f into dev Nov 23, 2023
9 checks passed
@dominic-braeunlein dominic-braeunlein deleted the implementation/50499-add-navigational-elements branch November 23, 2023 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants