Use friendly name

This commit is contained in:
Adria Navarro 2025-01-21 12:48:28 +01:00
parent d1294c8d44
commit d5f34970ad
1 changed files with 11 additions and 1 deletions

View File

@ -53,9 +53,19 @@ function getInvalidDatasources(
for (const component of findComponentsBySettingsType(screen, "table")) {
const { resourceId, type, label } = component.dataSource
if (!datasources[resourceId]) {
result[component._id!] = [`The ${type} named "${label}" was removed`]
const friendlyTypeName =
friendlyNameByType[type as keyof typeof friendlyNameByType]
result[component._id!] = [
`The ${friendlyTypeName} named "${label}" was removed`,
]
}
}
return result
}
const friendlyNameByType = {
table: "table",
view: "view",
viewV2: "view",
}