From d884e0f14ca1e43a4f116048d443abfb48824d26 Mon Sep 17 00:00:00 2001 From: Birk Johansson Date: Thu, 14 Nov 2024 12:56:50 +0100 Subject: [PATCH] fix: use displayName instead of name of lists --- .../listViews/sectionListViewsConfig.ts | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/lib/sectionList/listViews/sectionListViewsConfig.ts b/src/lib/sectionList/listViews/sectionListViewsConfig.ts index 6c78bf72..3b91c580 100644 --- a/src/lib/sectionList/listViews/sectionListViewsConfig.ts +++ b/src/lib/sectionList/listViews/sectionListViewsConfig.ts @@ -46,13 +46,17 @@ const DESCRIPTORS = { label: i18n.t('Public access'), filterKey: 'publicAccess', }, + name: { + path: 'displayName', + label: i18n.t('Name'), + }, } satisfies Record // This is the default views, and can be overriden per section in modelListViewsConfig below export const defaultModelViewConfig = { columns: { available: [ - 'name', + DESCRIPTORS.name, 'shortName', 'code', 'created', @@ -60,9 +64,10 @@ export const defaultModelViewConfig = { 'href', 'id', 'lastUpdatedBy', + 'lastUpdated', DESCRIPTORS.publicAccess, ], - default: ['name', DESCRIPTORS.publicAccess, 'lastUpdated'], + default: [DESCRIPTORS.name, DESCRIPTORS.publicAccess, 'lastUpdated'], }, filters: { available: [DESCRIPTORS.publicAccess], @@ -85,7 +90,7 @@ export const modelListViewsConfig = { columns: { available: ['zeroIsSignificant'], default: [ - 'name', + DESCRIPTORS.name, { label: i18n.t('Domain type'), path: 'domainType' }, { label: i18n.t('Value type'), path: 'valueType' }, 'categoryCombo', @@ -101,7 +106,7 @@ export const modelListViewsConfig = { organisationUnit: { columns: { available: [], - default: ['name', 'id', 'code', 'lastUpdated'], + default: [DESCRIPTORS.name, 'id', 'code', 'lastUpdated'], }, filters: { default: [], @@ -116,7 +121,7 @@ export const modelListViewsConfig = { category: { columns: { default: [ - 'name', + DESCRIPTORS.name, 'dataDimensionType', DESCRIPTORS.publicAccess, 'lastUpdated', @@ -128,7 +133,11 @@ export const modelListViewsConfig = { }, indicator: { columns: { - default: ['name', DESCRIPTORS.publicAccess, 'lastUpdated'], + default: [ + DESCRIPTORS.name, + DESCRIPTORS.publicAccess, + 'lastUpdated', + ], }, filters: { default: ['indicatorType'], @@ -137,7 +146,7 @@ export const modelListViewsConfig = { categoryOptionGroupSet: { columns: { default: [ - 'name', + DESCRIPTORS.name, 'dataDimensionType', DESCRIPTORS.publicAccess, 'lastUpdated', @@ -150,7 +159,7 @@ export const modelListViewsConfig = { categoryOptionGroup: { columns: { default: [ - 'name', + DESCRIPTORS.name, 'dataDimensionType', DESCRIPTORS.publicAccess, 'lastUpdated', @@ -163,7 +172,7 @@ export const modelListViewsConfig = { categoryCombo: { columns: { default: [ - 'name', + DESCRIPTORS.name, 'dataDimensionType', DESCRIPTORS.publicAccess, 'lastUpdated', @@ -176,7 +185,7 @@ export const modelListViewsConfig = { }, categoryOptionCombo: { columns: { - default: ['name', 'code', 'lastUpdated'], + default: [DESCRIPTORS.name, 'code', 'lastUpdated'], available: ['categoryCombo', 'ignoreApproval'], // categoryOptionCombo does not have publicAccess overrideDefaultAvailable: true,