pim-import 6.1.1 → 6.1.4

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.
@@ -600,10 +600,7 @@ const getProductData = async (productEntry, productDetails) => {
600
600
  }
601
601
  else {
602
602
  (0, logs_1.log)(`Add thumbnail imgix wrapper with id ${wrapperImgixID} to Contentful`);
603
- const altText = (0, utils_1.getPimTranslations)(pimAssetThumb, "title");
604
- if (altText[defaultEnvironmentLocaleCode] === null) {
605
- altText[defaultEnvironmentLocaleCode] = "Thumbnail";
606
- }
603
+ const altText = (0, utils_1.getPimTranslations)(pimAssetThumb, "title", "Thumbnail");
607
604
  const wrapperImgixAttributes = (0, imgix_1.getDefaultWrapperImgixAttributesByPimUrl)(pimAssetThumb.url);
608
605
  if (wrapperImgixAttributes) {
609
606
  const wrapperImgixFields = {
package/dist/utils.js CHANGED
@@ -81,6 +81,12 @@ const getPimTranslations = (values, fieldKey = "value", defaultValue = "", limit
81
81
  }
82
82
  }
83
83
  }
84
+ if (defaultValue && Object.entries(names).length === 0) {
85
+ (0, logs_1.log)(`No translations found for fieldKey ${valueString}, setting default value (${defaultValue}) for all locales`, "WARN");
86
+ for (const locale of contentful_1.cfLocales) {
87
+ names[locale] = defaultValue;
88
+ }
89
+ }
84
90
  return names;
85
91
  };
86
92
  exports.getPimTranslations = getPimTranslations;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pim-import",
3
- "version": "6.1.1",
3
+ "version": "6.1.4",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",