@treely/strapi-slices 3.0.0 → 3.1.0

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.
@@ -476,7 +476,7 @@ var EXTENDABLE_HEADER_SECTIONS = ['sections.hero', 'sections.map-hero', 'section
476
476
  var DARK_THEME_HEADER_SECTIONS = ['sections.hero', 'sections.small-hero'];
477
477
  var SECTIONS_WITH_BLOG_POSTS = ['sections.blog', 'sections.blog-cards'];
478
478
  var SECTIONS_WITH_CUSTOMER_STORIES = ['sections.customer-stories'];
479
- var SECTIONS_WITH_PROJECTS = ['sections.projects-map', 'sections.project-facts'];
479
+ var SECTIONS_WITH_PROJECTS = ['sections.projects-grid', 'sections.projects-map', 'sections.project-facts'];
480
480
 
481
481
  var mergeGlobalAndStrapiPageData = function mergeGlobalAndStrapiPageData(context, global, page, blogPosts, customerStories, projects) {
482
482
  var _page$attributes$meta, _page$attributes$meta2, _page$attributes$meta3, _global$attributes$me, _page$attributes$meta4, _page$attributes, _page$attributes$slic, _page$attributes$slic2, _page$attributes$meta5, _page$attributes$meta6, _page$attributes$meta7, _page$attributes$meta8, _ref, _page$attributes$meta9, _page$attributes$meta10, _global$attributes$me2;
@@ -2663,9 +2663,12 @@ var ConditionalWrapper = function ConditionalWrapper(_ref) {
2663
2663
  return condition ? wrapper(children) : children;
2664
2664
  };
2665
2665
  var ProjectsGrid = function ProjectsGrid(_ref2) {
2666
- var projects = _ref2.projects;
2667
- var filteredProjects = projects.filter(function (p) {
2668
- return p.thumbnail && p.slug && p.isPublic;
2666
+ var projects = _ref2.projects,
2667
+ slice = _ref2.slice;
2668
+ var filteredProjects = projects.filter(function (fpmProject) {
2669
+ return fpmProject.thumbnail && slice.projects.data.some(function (strapiProject) {
2670
+ return strapiProject.attributes.fpmProjectId === fpmProject.id;
2671
+ });
2669
2672
  });
2670
2673
  return React.createElement(DefaultSectionContainer, null, React.createElement(Wrapper, null, React.createElement(SimpleGrid, {
2671
2674
  columns: [1, null, null, 2, null, 3],
@@ -4788,6 +4791,7 @@ var SliceRenderer = function SliceRenderer(_ref) {
4788
4791
  case 'sections.projects-grid':
4789
4792
  return React.createElement(ProjectsGrid, {
4790
4793
  key: slice.__component + "-" + slice.id,
4794
+ slice: slice,
4791
4795
  projects: projects
4792
4796
  });
4793
4797
  case 'sections.projects-map':