@senior-gestao-empresarial/angular-components 6.0.0 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -257,7 +257,15 @@ var ErpLookups = /** @class */ (function () {
257
257
  ErpLookups.prototype.mountFormField = function (fields, prefix) {
258
258
  var _this = this;
259
259
  return fields.map(function (field) {
260
- return new FormField(__assign(__assign({}, field), { label: _this.translate.instant(prefix + ".lookup_" + _this.toSnakeCase(_this.entity) + "_" + _this.toSnakeCase(field.name)) }));
260
+ var translationKey = prefix + ".lookup_" + _this.toSnakeCase(_this.entity) + "_" + _this.toSnakeCase(field.name);
261
+ var label = _this.translate.instant(translationKey);
262
+ if (label === translationKey) {
263
+ // Manter compatibilidade com os lookups atuais até todos ajustarem
264
+ var fieldName = field.name.split('.').join('_');
265
+ translationKey = prefix + ".lookup_" + _this.toSnakeCase(_this.entity) + "_" + _this.toSnakeCase(fieldName);
266
+ label = _this.translate.instant(translationKey);
267
+ }
268
+ return new FormField(__assign(__assign({}, field), { label: label }));
261
269
  });
262
270
  };
263
271
  ErpLookups.prototype.mountDefaultFilter = function (defaultFilter) {