question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FEAT] Please make the PageHeader extra extensible

See original GitHub issue

Is your feature request related to a problem? Please describe. Currently the views such as Show, Edit, Create, List etc. offer default buttons in the PageHeader extra. This is good because these default buttons inherit many things such as recordItemId, dataProviderName etc from the parent view component and auto-configure themselves.

The problem is, when we need to add additional buttons before and after the default buttons. For example, in the Show view I already get a RefreshButton by default and would like to add a Download button before the built-in Refresh Button.

This requires me to rewrite everything in the PageHeader extra (including all the configuration of recordItemId, dataProviderName etc required for the built-in buttons).

There is no way to just prepend and append few buttons to the already existing built-in buttons.

Describe the solution you’d like

  • Kindly allow extra ReactNode contents to be prepended and appended to the built-in Page Header components (instead of overwriting them)

For example,

  • Should be able to add few ReactNodes before the built-in extra components and after the built-in extra components in the PageHeader

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
aliemircommented, Jul 29, 2022

Hey @KrishnaPG, thank you for the issue! I think this will be a nice feature 🚀 We’re currently working on a refactor in UI framework integrations and added couple of props to do changes in action buttons at the header and the footer of the crud elements like headerButtons and footerButtons, which are actionButtons currently. We’ll also update headerButtons and footerButtons` like the following;

Type

type headerButtons = ({ defaultButtons }: { defaultButtons: React.ReactNode }) => React.ReactNode;
type footerButtons = ({ defaultButtons }: { defaultButtons: React.ReactNode }) => React.ReactNode;

Usage

<List
    headerButtons={({defaultButtons}) => (
        <>
          <MyButton />
          {defaultButtons}
          <OtherButton />
        </>
    )}
/>

This will allow developers to prepend/append elements to the current buttons. Hope you like this approach, we’re aiming to release this as soon as possible.

1reaction
aliemircommented, Aug 3, 2022

Hey @KrishnaPG, we’re releasing the changes to next channel today including the feature mentioned here https://github.com/pankod/refine/issues/2246#issuecomment-1198974638

Currently, we don’t offer modifications on the default buttons but there’s an on-going internal discussion on how to achieve this, there are multiple ideas on implementation of those. We’ll announce the decision and place it on the roadmap as soon as possible. Thank you for your patience.

Read more comments on GitHub >

github_iconTop Results From Across the Web

prevwong/craft.js: A React Framework for building ... - GitHub
A React Framework for building extensible drag and drop page editors ... With this, you'll be able to build your own page editor...
Read more >
Featuring products by using Exclusive or Clearance search facets
Business users can work with site administrators to enable search facets for featured products. The storefront can provide customers with faceted navigation ...
Read more >
Voice Extensible Markup Language (VoiceXML) Version 2.0
This document specifies VoiceXML, the Voice Extensible Markup Language. VoiceXML is designed for creating audio dialogs that feature ...
Read more >
NetSuite Applications Suite - Extensibility API
The extensibility API is one of several APIs available from NetSuite that enables you to build new features for a SuiteCommerce website.
Read more >
parse-commit-message | Yarn - Package Manager
Extensible parser for git commit messages following Conventional Commits Specification. Please consider following this project's author, Charlike Mike ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found