@arc-fusion/content-integrations
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -16,3 +16,3 @@ "use strict"; | ||
last_updated_date = item.last_updated_date, | ||
additional_properties = item.promo_items.basic.additional_properties, | ||
promo_items = item.promo_items, | ||
source = item.source; | ||
@@ -66,7 +66,20 @@ var generateLastModified = function generateLastModified(last_updated_date) { | ||
var generateThumbnail = function generateThumbnail(properties) { | ||
var _properties$originalU = properties.originalUrl, | ||
originalUrl = _properties$originalU === void 0 ? '' : _properties$originalU; | ||
var _promo_items$basic; | ||
// Validates if Image is present in promo_items | ||
if (promo_items && promo_items !== null && promo_items !== void 0 && promo_items.basic && promo_items !== null && promo_items !== void 0 && (_promo_items$basic = promo_items.basic) !== null && _promo_items$basic !== void 0 && _promo_items$basic.additional_properties) { | ||
var _promo_items$basic$ad = promo_items.basic.additional_properties, | ||
_promo_items$basic$ad2 = _promo_items$basic$ad.originalUrl, | ||
originalUrl = _promo_items$basic$ad2 === void 0 ? '' : _promo_items$basic$ad2, | ||
_promo_items$basic$ad3 = _promo_items$basic$ad.originalName, | ||
originalName = _promo_items$basic$ad3 === void 0 ? '' : _promo_items$basic$ad3; | ||
return /*#__PURE__*/_react.default.createElement("img", { | ||
src: originalUrl, | ||
alt: originalName, | ||
width: "234px", | ||
height: "170px" | ||
}); | ||
} | ||
return /*#__PURE__*/_react.default.createElement("img", { | ||
src: originalUrl, | ||
alt: "card", | ||
alt: "", | ||
src: "about:blank", | ||
width: "234px", | ||
@@ -84,3 +97,3 @@ height: "170px" | ||
} | ||
}, /*#__PURE__*/_react.default.createElement("div", null, generateThumbnail(additional_properties)), /*#__PURE__*/_react.default.createElement("div", { | ||
}, /*#__PURE__*/_react.default.createElement("div", null, generateThumbnail(promo_items)), /*#__PURE__*/_react.default.createElement("div", { | ||
className: "contentDisplay" | ||
@@ -87,0 +100,0 @@ }, /*#__PURE__*/_react.default.createElement("h5", { |
@@ -28,3 +28,3 @@ "use strict"; | ||
var _item$cardField, _item$cardField2; | ||
return (item === null || item === void 0 ? void 0 : (_item$cardField = item.cardField) === null || _item$cardField === void 0 ? void 0 : _item$cardField.includes('distributor')) || (item === null || item === void 0 ? void 0 : (_item$cardField2 = item.cardField) === null || _item$cardField2 === void 0 ? void 0 : _item$cardField2.includes('credits')); | ||
return (item === null || item === void 0 || (_item$cardField = item.cardField) === null || _item$cardField === void 0 ? void 0 : _item$cardField.includes('distributor')) || (item === null || item === void 0 || (_item$cardField2 = item.cardField) === null || _item$cardField2 === void 0 ? void 0 : _item$cardField2.includes('credits')); | ||
} | ||
@@ -31,0 +31,0 @@ })); |
@@ -28,3 +28,3 @@ "use strict"; | ||
var _item$cardField, _item$cardField2; | ||
return (item === null || item === void 0 ? void 0 : (_item$cardField = item.cardField) === null || _item$cardField === void 0 ? void 0 : _item$cardField.includes('distributor')) || (item === null || item === void 0 ? void 0 : (_item$cardField2 = item.cardField) === null || _item$cardField2 === void 0 ? void 0 : _item$cardField2.includes('credits')); | ||
return (item === null || item === void 0 || (_item$cardField = item.cardField) === null || _item$cardField === void 0 ? void 0 : _item$cardField.includes('distributor')) || (item === null || item === void 0 || (_item$cardField2 = item.cardField) === null || _item$cardField2 === void 0 ? void 0 : _item$cardField2.includes('credits')); | ||
} | ||
@@ -31,0 +31,0 @@ })); |
@@ -67,3 +67,3 @@ "use strict"; | ||
dataMeta: authorsDataMeta, | ||
dataArray: StoryContext === null || StoryContext === void 0 ? void 0 : (_StoryContext$Authors = StoryContext.Authors) === null || _StoryContext$Authors === void 0 ? void 0 : _StoryContext$Authors.authors, | ||
dataArray: StoryContext === null || StoryContext === void 0 || (_StoryContext$Authors = StoryContext.Authors) === null || _StoryContext$Authors === void 0 ? void 0 : _StoryContext$Authors.authors, | ||
dataObjectSetter: StoryContext === null || StoryContext === void 0 ? void 0 : StoryContext.setFilterAuthor, | ||
@@ -70,0 +70,0 @@ enableDropChoices: true |
@@ -31,3 +31,3 @@ "use strict"; | ||
var _Websites$find; | ||
var displayName = Websites === null || Websites === void 0 ? void 0 : (_Websites$find = Websites.find(function (wsItem) { | ||
var displayName = Websites === null || Websites === void 0 || (_Websites$find = Websites.find(function (wsItem) { | ||
return (wsItem === null || wsItem === void 0 ? void 0 : wsItem._id) === website; | ||
@@ -34,0 +34,0 @@ })) === null || _Websites$find === void 0 ? void 0 : _Websites$find.display_name; |
@@ -28,3 +28,3 @@ "use strict"; | ||
var _item$cardField, _item$cardField2; | ||
return (item === null || item === void 0 ? void 0 : (_item$cardField = item.cardField) === null || _item$cardField === void 0 ? void 0 : _item$cardField.includes('distributor')) || (item === null || item === void 0 ? void 0 : (_item$cardField2 = item.cardField) === null || _item$cardField2 === void 0 ? void 0 : _item$cardField2.includes('credits')); | ||
return (item === null || item === void 0 || (_item$cardField = item.cardField) === null || _item$cardField === void 0 ? void 0 : _item$cardField.includes('distributor')) || (item === null || item === void 0 || (_item$cardField2 = item.cardField) === null || _item$cardField2 === void 0 ? void 0 : _item$cardField2.includes('credits')); | ||
} | ||
@@ -31,0 +31,0 @@ })); |
{ | ||
"name": "@arc-fusion/content-integrations", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -7,11 +7,3 @@ import React from 'react' | ||
export function Card(websites, item, onSubmit, onPreview) { | ||
const { | ||
headlines, | ||
websites: galleryWebsites, | ||
last_updated_date, | ||
promo_items: { | ||
basic: { additional_properties } | ||
}, | ||
source | ||
} = item | ||
const { headlines, websites: galleryWebsites, last_updated_date, promo_items, source } = item | ||
@@ -71,4 +63,8 @@ const generateLastModified = last_updated_date => { | ||
const generateThumbnail = properties => { | ||
const { originalUrl = '' } = properties | ||
return <img src={originalUrl} alt="card" width="234px" height="170px" /> | ||
// Validates if Image is present in promo_items | ||
if (promo_items && promo_items?.basic && promo_items?.basic?.additional_properties) { | ||
const { originalUrl = '', originalName = '' } = promo_items.basic.additional_properties | ||
return <img src={originalUrl} alt={originalName} width="234px" height="170px" /> | ||
} | ||
return <img alt="" src="about:blank" width="234px" height="170px" /> | ||
} | ||
@@ -81,3 +77,3 @@ | ||
onMouseEnter={() => onPreview(item)}> | ||
<div>{generateThumbnail(additional_properties)}</div> | ||
<div>{generateThumbnail(promo_items)}</div> | ||
@@ -84,0 +80,0 @@ <div className="contentDisplay"> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
654409
12965