patternfly / patternfly/react-component-groups
MissingPage: support multiple action buttons
还没有人认领这个 Issue。
- 主要语言
- TypeScript
- 星标
- 10
- 派生
- 40
- 平均合并
- 3 天 22 小时
- 30 天内合并 PR
- 4
描述
Description
MissingPage currently supports only a single link/action via the toHomePageUrl prop (rendered as a "Go to home page" link). A common 404 page pattern includes multiple actions — typically both "Go Home" and "Go Back" buttons.
Use Case
In ansible/ansible-ui, our custom PageNotFound component renders two action buttons:
-
"Go to Dashboard" (navigate to home)
-
"Return to previous page" (browser back)
We cannot adopt MissingPage because it only renders one action.
Proposed Solution
Add support for custom footer actions, either via:
-
A
customFooteroractionsprop that acceptsReactNode(most flexible) -
An
additionalActionsarray prop alongside the existingtoHomePageUrl
This would align with how other component-groups components like ErrorState support customFooter.
Current Workaround
We maintain a custom PageNotFound component that duplicates MissingPage's layout but adds a second button.
Jira Issue: PF-4547
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先阅读 MissingPage 组件,并将其 footer API 与已经支持 customFooter 的 ErrorState 进行比较。确认现有的 toHomePageUrl action 是如何渲染的,然后添加一种受支持的方式来渲染多个自定义 action,同时保留当前行为。当使用方可以同时提供主页和返回 action,而无需复制 MissingPage 布局时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- react, typescript
- 领域
- frontend
- Issue 类型
- 功能
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 68/100