fix(admin): seed the order list search filter from the URL - #181
Closed
echoowall wants to merge 1 commit into
Closed
fix(admin): seed the order list search filter from the URL#181echoowall wants to merge 1 commit into
echoowall wants to merge 1 commit into
Conversation
`OrderLink` navigates to /dashboard/order?search=<order_no>, but the
order list only reads `user_id` out of the URL, so the search box stays
empty and the unfiltered list is shown. The filter itself is already
declared (`{ key: "search" }`) and the API supports it — only the
seeding was missing.
Every order number rendered through `OrderLink` is affected: the
balance, order-creation, subscription-reset, gift and commission logs.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
✅ Deploy Preview for ppane-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
This pull request was created with an AI agent during triage. We do not merge agent-generated pull requests in this repository, even when the proposed change is narrowly scoped. Closing without merging. A maintainer can apply the underlying one-line fix independently if desired. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
管理端的日志页把订单号渲染成链接(
OrderLink),点击后跳转到/dashboard/order?search=<order_no>。但订单列表只从 URL 里取
user_id:search没有被读入,于是跳过去之后搜索框是空的、列表是未筛选的全量,点击等于只做了一次页面跳转。筛选项本身已经声明了(同文件里的
{ key: "search" }),后端GetOrderList也支持这个参数 —— 缺的只是把 URL 参数种进初始筛选这一步。影响范围
所有经
OrderLink渲染订单号的页面:sections/log/balance/index.tsxsections/log/order/index.tsxsections/log/reset-subscribe/index.tsxsections/log/gift/index.tsxsections/log/commission/index.tsx改动
与用户列表页(
sections/user/index.tsx)的处理方式一致 —— 那边把声明过的筛选项都从 URL 种了进去。订单页另外还声明了
status和subscribe_id两个筛选项,同样没有从 URL 读取;但目前仓库里没有任何地方带着这两个参数跳转过来,所以本次未一并改动,避免扩大范围。测试
新增
apps/admin/src/sections/order/order-search-param.test.tsx,mock 掉ProTable以捕获initialFilters:searchinitialFilters.search等于该值user_idinitialFilters.user_id仍是数字42第一个用例在撤掉本次改动后会失败(
expected { user_id: undefined } to match object { search }),第二个用例改动前后都通过,用作既有行为的回归护栏。biome check对改动的两个文件无告警。