优化
This commit is contained in:
@@ -22,7 +22,6 @@
|
||||
.admin-density .el-table .cell, .admin-density-dialog .el-table .cell { line-height: 22px; }
|
||||
.admin-density .el-table .el-button--small, .admin-density-dialog .el-table .el-button--small { height: var(--admin-action-height, 28px); padding: var(--admin-space-1, 4px) var(--admin-space-3, 8px); }
|
||||
.admin-density .el-table__body tr.el-table__row--striped td.el-table__cell { background: var(--admin-row-stripe); }
|
||||
.admin-density .data-table .data-table__toolbar { min-height: 44px; padding: var(--admin-space-2, 6px) var(--admin-space-5, 12px); }
|
||||
.admin-density .data-table .data-table__pagination { min-height: 48px; padding: var(--admin-space-3, 8px) var(--admin-space-5, 12px); }
|
||||
.admin-density .el-empty { padding: var(--admin-space-5, 12px) 0; }
|
||||
.admin-density .el-empty__image { display: none; }
|
||||
|
||||
@@ -74,7 +74,7 @@ const notificationConsumers = [
|
||||
'notifications/pages/MessageTemplatesView.vue', 'notifications/components/MessageComposerDialog.vue',
|
||||
'notifications/components/TemplateEditorDialog.vue',
|
||||
]
|
||||
const systemConsumers = ['iam/pages/InternalUsersView.vue', 'iam/pages/RolesView.vue', 'iam/pages/PermissionsView.vue', 'dashboard/pages/DashboardView.vue']
|
||||
const systemConsumers = ['iam/pages/InternalUsersView.vue', 'iam/pages/RolesView.vue', 'iam/pages/PermissionsView.vue']
|
||||
const consumers = [
|
||||
...notificationConsumers,
|
||||
...systemConsumers,
|
||||
@@ -150,6 +150,13 @@ const cssRoot = (css: string) => {
|
||||
}
|
||||
|
||||
describe('approved Admin density ownership', () => {
|
||||
it('keeps dashboard visualizations outside detail-field table styling', () => {
|
||||
const dashboard = read('modules/dashboard/pages/DashboardView.vue')
|
||||
expect(dashboard).toContain('class="dashboard-metrics"')
|
||||
expect(dashboard).toContain('class="dashboard-metric-mark"')
|
||||
expect(dashboard).not.toContain('density-fields')
|
||||
})
|
||||
|
||||
it('opts application-shell confirmations in even before a business page loads', () => {
|
||||
const entries = ['app/layouts/AppLayout.vue', 'app/components/WorkspaceTabs.vue', 'app/router/index.ts', 'main.ts']
|
||||
let count = 0
|
||||
@@ -459,6 +466,24 @@ describe('approved Admin density ownership', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('keeps desktop table toolbar dimensions owned by DataTable without cascade overrides', () => {
|
||||
const tableCss = parse(read('shared/components/DataTable.vue')).descriptor.styles.map(style => style.content).join('\n')
|
||||
const dimensions: Record<string, string[]> = { padding: [], 'min-height': [] }
|
||||
cssRoot(tableCss).walkRules(rule => {
|
||||
if (!rule.selectors.includes('.data-table__toolbar') && !rule.selectors.includes('.data-table__toolbar.is-compact')) return
|
||||
// Preserve the existing mobile layout; the shared desktop dimensions have one owner.
|
||||
if (rule.parent?.type === 'atrule' && /max-width/.test(rule.parent.params)) return
|
||||
rule.walkDecls(decl => { if (dimensions[decl.prop]) dimensions[decl.prop].push(decl.value) })
|
||||
})
|
||||
expect(dimensions).toEqual({ padding: ['var(--admin-space-2, 6px) var(--admin-space-5, 12px)'], 'min-height': ['44px'] })
|
||||
for (const { file, css } of [{ file: 'adminDensity.css', css: shared }, ...styles]) cssRoot(css).walkRules(rule => {
|
||||
if (!/\.data-table__toolbar(?:\b|\.)/.test(rule.selector)) return
|
||||
rule.walkDecls(decl => {
|
||||
expect(decl.prop, `${file}: toolbar dimensions belong in DataTable`).not.toMatch(/^(padding(?:-.+)?|height|min-height)$/)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
it('keeps conditional shared consumers opt-in instead of enabling other menus', () => {
|
||||
expect(read('shared/components/DataTable.vue')).toContain('margin-left: var(--cc-list-action-sibling-margin, 8px)')
|
||||
expect(shared).toContain('.density-actions { --cc-list-action-sibling-margin: 0px;')
|
||||
|
||||
Reference in New Issue
Block a user