diff --git a/src/core_modules/capture-core/components/Pages/MainPage/TeiWorkingLists/Setup/useDefaultColumnConfig.js b/src/core_modules/capture-core/components/Pages/MainPage/TeiWorkingLists/Setup/useDefaultColumnConfig.js index e1296eea57..a06fba1f4a 100644 --- a/src/core_modules/capture-core/components/Pages/MainPage/TeiWorkingLists/Setup/useDefaultColumnConfig.js +++ b/src/core_modules/capture-core/components/Pages/MainPage/TeiWorkingLists/Setup/useDefaultColumnConfig.js @@ -39,11 +39,11 @@ const mainConfig: Array = [{ const getMetaDataConfig = (attributes: Array): Array => attributes - .map(({ id, displayInReports, type, formName, optionSet }) => ({ + .map(({ id, displayInReports, type, name, optionSet }) => ({ id, visible: displayInReports, type, - header: formName, + header: name, options: optionSet && optionSet.options.map(({ text, value }) => ({ text, value })), multiValueFilter: !!optionSet, })); diff --git a/src/core_modules/capture-core/metaDataMemoryStoreBuilders/programs/factory/enrollment/DataElementFactory.js b/src/core_modules/capture-core/metaDataMemoryStoreBuilders/programs/factory/enrollment/DataElementFactory.js index 630b3f2387..3540779621 100644 --- a/src/core_modules/capture-core/metaDataMemoryStoreBuilders/programs/factory/enrollment/DataElementFactory.js +++ b/src/core_modules/capture-core/metaDataMemoryStoreBuilders/programs/factory/enrollment/DataElementFactory.js @@ -27,6 +27,7 @@ class DataElementFactory { NAME: 'NAME', DESCRIPTION: 'DESCRIPTION', SHORT_NAME: 'SHORT_NAME', + FORM_NAME: 'FORM_NAME', }; static errorMessages = { @@ -165,7 +166,11 @@ class DataElementFactory { cachedTrackedEntityAttribute.translations, DataElementFactory.translationPropertyNames.SHORT_NAME) || cachedTrackedEntityAttribute.displayShortName; - dataElement.formName = dataElement.name; + dataElement.formName = + this._getAttributeTranslation( + cachedTrackedEntityAttribute.translations, + DataElementFactory.translationPropertyNames.FORM_NAME) || + cachedTrackedEntityAttribute.displayFormName; dataElement.description = this._getAttributeTranslation( cachedTrackedEntityAttribute.translations, diff --git a/src/core_modules/capture-core/metaDataMemoryStoreBuilders/trackedEntityTypes/factory/TrackedEntityType/DataElementFactory.js b/src/core_modules/capture-core/metaDataMemoryStoreBuilders/trackedEntityTypes/factory/TrackedEntityType/DataElementFactory.js index 70b757117a..c3255be557 100644 --- a/src/core_modules/capture-core/metaDataMemoryStoreBuilders/trackedEntityTypes/factory/TrackedEntityType/DataElementFactory.js +++ b/src/core_modules/capture-core/metaDataMemoryStoreBuilders/trackedEntityTypes/factory/TrackedEntityType/DataElementFactory.js @@ -24,6 +24,7 @@ class DataElementFactory { NAME: 'NAME', DESCRIPTION: 'DESCRIPTION', SHORT_NAME: 'SHORT_NAME', + FORM_NAME: 'FORM_NAME', }; static errorMessages = { @@ -99,8 +100,8 @@ class DataElementFactory { cachedAttribute.displayShortName; o.formName = this._getAttributeTranslation( - cachedAttribute.translations, DataElementFactory.translationPropertyNames.NAME) || - cachedAttribute.displayName; + cachedAttribute.translations, DataElementFactory.translationPropertyNames.FORM_NAME) || + cachedAttribute.displayFormName; o.description = this._getAttributeTranslation( cachedAttribute.translations, DataElementFactory.translationPropertyNames.DESCRIPTION) || diff --git a/src/core_modules/capture-core/metaDataStoreLoaders/trackedEntityAttributes/quickStoreOperations/storeTrackedEntityAttributes.js b/src/core_modules/capture-core/metaDataStoreLoaders/trackedEntityAttributes/quickStoreOperations/storeTrackedEntityAttributes.js index a4afd0e093..0228d77945 100644 --- a/src/core_modules/capture-core/metaDataStoreLoaders/trackedEntityAttributes/quickStoreOperations/storeTrackedEntityAttributes.js +++ b/src/core_modules/capture-core/metaDataStoreLoaders/trackedEntityAttributes/quickStoreOperations/storeTrackedEntityAttributes.js @@ -6,7 +6,7 @@ export const storeTrackedEntityAttributes = (ids: Array) => { const query = { resource: 'trackedEntityAttributes', params: { - fields: 'id,displayName,displayShortName,description,valueType,optionSetValue,unique,orgunitScope,' + + fields: 'id,displayName,displayShortName,displayFormName,description,valueType,optionSetValue,unique,orgunitScope,' + 'pattern,translations[property,locale,value],optionSet[id]', filter: `id:in:[${ids.join(',')}]`, pageSize: ids.length, diff --git a/src/core_modules/capture-core/storageControllers/cache.types.js b/src/core_modules/capture-core/storageControllers/cache.types.js index a36e26a549..f2cf78bb3f 100644 --- a/src/core_modules/capture-core/storageControllers/cache.types.js +++ b/src/core_modules/capture-core/storageControllers/cache.types.js @@ -18,6 +18,7 @@ export type CachedTrackedEntityAttribute = { id: string, displayName: string, displayShortName: string, + displayFormName: string, description: string, translations: Array, valueType: string,