Skip to content

Commit

Permalink
fix: use displayName instead of name of lists
Browse files Browse the repository at this point in the history
  • Loading branch information
Birkbjo committed Nov 14, 2024
1 parent 699560d commit d884e0f
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions src/lib/sectionList/listViews/sectionListViewsConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,28 @@ const DESCRIPTORS = {
label: i18n.t('Public access'),
filterKey: 'publicAccess',
},
name: {
path: 'displayName',
label: i18n.t('Name'),
},
} satisfies Record<string, Descriptor>

// 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',
'createdBy',
'href',
'id',
'lastUpdatedBy',
'lastUpdated',
DESCRIPTORS.publicAccess,
],
default: ['name', DESCRIPTORS.publicAccess, 'lastUpdated'],
default: [DESCRIPTORS.name, DESCRIPTORS.publicAccess, 'lastUpdated'],
},
filters: {
available: [DESCRIPTORS.publicAccess],
Expand All @@ -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',
Expand All @@ -101,7 +106,7 @@ export const modelListViewsConfig = {
organisationUnit: {
columns: {
available: [],
default: ['name', 'id', 'code', 'lastUpdated'],
default: [DESCRIPTORS.name, 'id', 'code', 'lastUpdated'],
},
filters: {
default: [],
Expand All @@ -116,7 +121,7 @@ export const modelListViewsConfig = {
category: {
columns: {
default: [
'name',
DESCRIPTORS.name,
'dataDimensionType',
DESCRIPTORS.publicAccess,
'lastUpdated',
Expand All @@ -128,7 +133,11 @@ export const modelListViewsConfig = {
},
indicator: {
columns: {
default: ['name', DESCRIPTORS.publicAccess, 'lastUpdated'],
default: [
DESCRIPTORS.name,
DESCRIPTORS.publicAccess,
'lastUpdated',
],
},
filters: {
default: ['indicatorType'],
Expand All @@ -137,7 +146,7 @@ export const modelListViewsConfig = {
categoryOptionGroupSet: {
columns: {
default: [
'name',
DESCRIPTORS.name,
'dataDimensionType',
DESCRIPTORS.publicAccess,
'lastUpdated',
Expand All @@ -150,7 +159,7 @@ export const modelListViewsConfig = {
categoryOptionGroup: {
columns: {
default: [
'name',
DESCRIPTORS.name,
'dataDimensionType',
DESCRIPTORS.publicAccess,
'lastUpdated',
Expand All @@ -163,7 +172,7 @@ export const modelListViewsConfig = {
categoryCombo: {
columns: {
default: [
'name',
DESCRIPTORS.name,
'dataDimensionType',
DESCRIPTORS.publicAccess,
'lastUpdated',
Expand All @@ -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,
Expand Down

0 comments on commit d884e0f

Please sign in to comment.