feat: add platform self-operated sales inventory and collection views
This commit is contained in:
@@ -90,7 +90,10 @@ const notificationConsumers = [
|
||||
'notifications/components/TemplateEditorDialog.vue',
|
||||
]
|
||||
const systemConsumers = ['iam/pages/InternalUsersView.vue', 'iam/pages/RolesView.vue', 'iam/pages/PermissionsView.vue']
|
||||
const selfOperatedPages = ['self-operated/components/AnalyticsView.vue', 'self-operated/pages/CollectionView.vue']
|
||||
const selfOperatedConsumers = [...selfOperatedPages, 'self-operated/components/SkuTrend.vue']
|
||||
const consumers = [
|
||||
...selfOperatedConsumers,
|
||||
'overseas-business/components/FleetArrangementSummary.vue',
|
||||
...notificationConsumers,
|
||||
...systemConsumers,
|
||||
@@ -131,6 +134,7 @@ const customerPages = [
|
||||
{ title: '海外仓阶梯费用', path: '/customers/overseas-storage-fees', file: 'customers/pages/OverseasStorageFeesView.vue' },
|
||||
]
|
||||
const densityPages = [...new Set([
|
||||
...selfOperatedPages,
|
||||
...notificationConsumers.filter(file => file.includes('/pages/')),
|
||||
...systemConsumers,
|
||||
...generalCatalogConsumers.filter(file => file.includes('/pages/')),
|
||||
@@ -442,7 +446,7 @@ describe('approved Admin density ownership', () => {
|
||||
for (const node of nodes) {
|
||||
if (node.type !== 1) continue
|
||||
const isActionSlot = actionSlot || (parentTag === 'DataTable' && node.props.some(prop => prop.type === 7 && prop.name === 'slot' && prop.arg?.type === 4 && prop.arg.content === 'actions'))
|
||||
if (densityPages.includes(file) && isActionSlot && node.tag === 'el-button') expect(classesOf(node), `${file}: row action`).toContain('density-action')
|
||||
if (densityPages.includes(file) && !selfOperatedPages.includes(file) && isActionSlot && node.tag === 'el-button') expect(classesOf(node), `${file}: row action`).toContain('density-action')
|
||||
if (['AppDialog', 'el-dialog'].includes(node.tag)) expect(classesOf(node), `${file}: teleported dialog`).toContain('admin-density-dialog')
|
||||
if (['AppDrawer', 'el-drawer'].includes(node.tag)) expect(classesOf(node), `${file}: teleported drawer`).toContain('admin-density-drawer')
|
||||
visit(node.children, isActionSlot, node.tag)
|
||||
@@ -452,6 +456,28 @@ describe('approved Admin density ownership', () => {
|
||||
}
|
||||
})
|
||||
|
||||
it('opts the confirmed self-operated pages into integrated text actions without changing older outlined consumers', () => {
|
||||
expect(getNavigationLeaves(adminNavigation).map(node => node.path)).toEqual(expect.arrayContaining([
|
||||
'/self-operated/sales', '/self-operated/inventory', '/self-operated/collection',
|
||||
]))
|
||||
for (const file of selfOperatedPages) {
|
||||
const template = parse(read(`modules/${file}`)).descriptor.template!.ast!
|
||||
let tables = 0
|
||||
const visit = (nodes: typeof template.children) => {
|
||||
for (const node of nodes) {
|
||||
if (node.type !== 1) continue
|
||||
if (node.tag === 'DataTable') {
|
||||
expect(node.props.some(prop => prop.type === 6 && prop.name === 'appearance' && prop.value?.content === 'integrated'), `${file}: integrated text actions`).toBe(true)
|
||||
tables += 1
|
||||
}
|
||||
visit(node.children)
|
||||
}
|
||||
}
|
||||
visit(template.children)
|
||||
expect(tables).toBeGreaterThan(0)
|
||||
}
|
||||
})
|
||||
|
||||
it('keeps tokens and shared rules opt-in and free of business selectors', () => {
|
||||
expect(shared).toContain("@import './adminDensityTokens.css'")
|
||||
for (const css of [tokens, shared]) cssRoot(css).walkRules(rule => {
|
||||
|
||||
Reference in New Issue
Block a user