fix(frontend): 京东采集撤出亚马逊工具台(2026-11-15 用户口径:不要出现在亚马逊那边)——amazon/tool-catalog.ts 移除 jd 卡片/渐变/图标/详情四处;入口收敛到首页一级「京东」工作台(pages/jd/tool-catalog.ts 自带「获取店铺数据」卡,路由 /jd-collect 与 endpoints 不动);amazon-tool-catalog.test.ts 21→20/前端组9→8并加「京东不出现在亚马逊」绊线;jd-collect-tab.test.ts AC-1 契约改为钉京东工作台卡片形状
This commit is contained in:
@@ -132,13 +132,6 @@ export const TOOL_GROUPS: ReadonlyArray<ToolGroup> = [
|
||||
href: '/convert',
|
||||
permissionKeys: ['convert'],
|
||||
},
|
||||
{
|
||||
id: 'jd',
|
||||
name: '京东采集',
|
||||
desc: '采集京东店铺商品列表与详情全部属性,同步到后台京东数据库',
|
||||
href: '/jd-collect',
|
||||
permissionKeys: ['jd-collect', 'jd_collect'],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -287,7 +280,6 @@ export const TOOL_ICON_GRADIENTS: Record<string, string> = {
|
||||
shop: 'linear-gradient(180deg, #93C5FD, #3B82F6)',
|
||||
purchase: 'linear-gradient(180deg, #C4B5FD, #8B5CF6)',
|
||||
erp: 'linear-gradient(180deg, #F9A8D4, #EC4899)',
|
||||
jd: 'linear-gradient(180deg, #FCA5A5, #DC2626)',
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -335,8 +327,6 @@ export const TOOL_ICON_SHAPES: Record<string, string> = {
|
||||
purchase: '<path d="M10 14 L34 14 L30 34 L14 34 Z"/><line x1="34" y1="14" x2="40" y2="14"/><line x1="40" y1="14" x2="38" y2="20"/><circle class="fill" cx="19" cy="39" r="3"/><circle class="fill" cx="33" cy="39" r="3"/>',
|
||||
// ERP:网格
|
||||
erp: '<rect x="8" y="8" width="32" height="32"/><line x1="24" y1="8" x2="24" y2="40"/><line x1="8" y1="24" x2="40" y2="24"/>',
|
||||
// 京东采集:商品袋
|
||||
jd: '<path d="M12 16 L36 16 L34 38 L14 38 Z"/><path d="M19 16 A 5 6 0 0 1 29 16"/><circle class="fill" cx="19" cy="26" r="2"/><circle class="fill" cx="29" cy="26" r="2"/>',
|
||||
}
|
||||
|
||||
export const TOOL_MAP: ReadonlyMap<string, ToolInfo> = new Map(
|
||||
@@ -359,7 +349,6 @@ export const TOOL_DETAILS: Readonly<Record<string, string>> = {
|
||||
qasin: '通过店小蜜导出出单 ASIN,上传后台,时不时排查是否还在店铺售卖,确保优质数据时刻在店。',
|
||||
scrape:
|
||||
'没排名、久未出单数据可优化删除;获取店铺所有数据的排名、品牌和销售情况。半个月到一个月复查一次品牌,确保数据没有被注册。',
|
||||
jd: '在本机已登录京麦的窗口里采集店铺商品(列表 + 详情全部属性 + 图片),同步到后台「京东数据库」。任务由本机客户端执行,提交后保持客户端在线。',
|
||||
}
|
||||
|
||||
export type VisibleGroup = ToolGroup & { tools: ToolInfo[] }
|
||||
|
||||
@@ -11,9 +11,9 @@ import {
|
||||
TOOL_MAP,
|
||||
} from '../src/pages/amazon/tool-catalog.ts'
|
||||
|
||||
test('工具目录:21 个工具 id 唯一且每个都有图标与渐变配色', () => {
|
||||
test('工具目录:20 个工具 id 唯一且每个都有图标与渐变配色', () => {
|
||||
const ids = TOOL_GROUPS.flatMap((g) => g.tools.map((t) => t.id))
|
||||
assert.equal(ids.length, 21, '工具总数应为 21(前端9 + 运营10 + 后勤2;v1.4 前端组加京东采集)')
|
||||
assert.equal(ids.length, 20, '工具总数应为 20(前端8 + 运营10 + 后勤2;京东采集已撤出亚马逊目录,入口收敛到首页一级「京东」)')
|
||||
assert.equal(new Set(ids).size, ids.length, '工具 id 不应重复')
|
||||
for (const id of ids) {
|
||||
assert.ok(TOOL_ICON_SHAPES[id], `图标形状缺失: ${id}`)
|
||||
@@ -38,7 +38,7 @@ test('权限过滤:组键命中整组保留,未命中按工具权限过滤
|
||||
const frontOnly = filterGroupsByPermission(TOOL_GROUPS, ['brand_front_tools'])
|
||||
assert.equal(frontOnly.length, 1)
|
||||
assert.equal(frontOnly[0].key, 'front')
|
||||
assert.equal(frontOnly[0].tools.length, 9)
|
||||
assert.equal(frontOnly[0].tools.length, 8)
|
||||
|
||||
// 无组键时按单个工具权限过滤
|
||||
const partial = filterGroupsByPermission(TOOL_GROUPS, ['collect-data', 'publish'])
|
||||
@@ -88,3 +88,14 @@ test('工具目录:页头长描述(detail)只覆盖已知工具,且不
|
||||
assert.ok(toolsWithHref?.href, `detail 只应用于有页面的工具: ${id}`)
|
||||
}
|
||||
})
|
||||
|
||||
test('工具目录:京东不出现在亚马逊这边(入口收敛到首页一级「京东」)', () => {
|
||||
const ids = TOOL_GROUPS.flatMap((g) => g.tools.map((t) => t.id))
|
||||
assert.ok(!ids.includes('jd'), '亚马逊工具目录不应再挂京东采集卡片')
|
||||
assert.ok(
|
||||
!TOOL_GROUPS.some((g) => g.tools.some((t) => t.name.includes('京东'))),
|
||||
'亚马逊工具目录不应出现任何京东命名的工具卡',
|
||||
)
|
||||
assert.ok(!('jd' in TOOL_ICON_GRADIENTS) && !('jd' in TOOL_ICON_SHAPES) && !('jd' in TOOL_DETAILS),
|
||||
'亚马逊目录的图标/渐变/详情表不应残留 jd 条目')
|
||||
})
|
||||
|
||||
@@ -5,14 +5,16 @@ import { join } from 'node:path'
|
||||
|
||||
/** v1.4 AC-1 用户端入口契约(蓝图 docs/ITERATION_PLAN.md §3.2 / §4 Phase 5)。
|
||||
*
|
||||
* 「京东采集」以工具台卡片 + 路由 + endpoints 组三件接入用户端(照工具台既有形状):
|
||||
* 工具卡必须声明非空 permissionKeys(用户端工具按后端 app 菜单 column_key 过滤显隐),
|
||||
* 「京东采集」以工具台卡片 + 路由 + endpoints 组三件接入用户端:
|
||||
* 2026-11-15 用户拍板——卡片不再挂在亚马逊工具台(pages/amazon/tool-catalog.ts,
|
||||
* 不含京东的绊线在 amazon-tool-catalog.test.ts),收敛到首页一级「京东」工作台
|
||||
* 自己的目录(pages/jd/tool-catalog.ts,显隐收口在工具台内部)。
|
||||
* 路由 /jd-collect,endpoints.ts 有 jdCollect 组。Pending 期整组 skip;
|
||||
* Phase 5 落地后去掉 skip 跑绿。
|
||||
*/
|
||||
|
||||
const ROUTER = join(process.cwd(), 'src', 'router', 'index.ts')
|
||||
const TOOL_CATALOG = join(process.cwd(), 'src', 'pages', 'amazon', 'tool-catalog.ts')
|
||||
const JD_TOOL_CATALOG = join(process.cwd(), 'src', 'pages', 'jd', 'tool-catalog.ts')
|
||||
const ENDPOINTS = join(process.cwd(), 'src', 'shared', 'api', 'endpoints.ts')
|
||||
|
||||
function readIfExists(path: string, what: string): string {
|
||||
@@ -25,12 +27,12 @@ test('路由注册京东采集页', () => {
|
||||
'router 缺 /jd-collect 路由')
|
||||
})
|
||||
|
||||
test('工具台卡片声明京东工具且带权限键', () => {
|
||||
const catalog = readIfExists(TOOL_CATALOG, 'tool-catalog.ts')
|
||||
assert.ok(catalog.includes('jd-collect') || catalog.includes('京东采集'),
|
||||
'TOOL_GROUPS 缺京东采集工具卡')
|
||||
assert.ok(/jd[\s\S]{0,400}permissionKeys/.test(catalog),
|
||||
'京东工具卡必须声明非空 permissionKeys(显隐按后端 app 菜单 key 过滤)')
|
||||
test('京东工作台卡片声明采集入口并指向采集页', () => {
|
||||
const catalog = readIfExists(JD_TOOL_CATALOG, 'jd/tool-catalog.ts')
|
||||
assert.ok(catalog.includes('获取店铺数据'),
|
||||
'京东工作台缺「获取店铺数据」卡')
|
||||
assert.ok(catalog.includes('/jd-collect'),
|
||||
'「获取店铺数据」卡必须带 href 指向 /jd-collect')
|
||||
})
|
||||
|
||||
test('endpoints 注册 jdCollect 端点组', () => {
|
||||
|
||||
Reference in New Issue
Block a user