Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhiltri committed May 22, 2024
2 parents 3899a59 + 6c4f989 commit ba37f12
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 16 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.47
6.48
8 changes: 4 additions & 4 deletions app/Http/Controllers/API/MyMuseumTourController.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ public function show(Request $request, $id)
* This method strips HTML and PHP tags from data and returns the sanitized data
*
*/
private function sanitizeData(array $data): array
private function sanitizeData(array $data, string $parentKey = ''): array
{
$sanitizedData = [];

foreach ($data as $key => $value) {
if (is_array($value)) {
$sanitizedData[$key] = $this->sanitizeData($value);
$sanitizedData[$key] = $this->sanitizeData($value, $key);
} else {
// Use strip_tags on strings only
$sanitizedData[$key] = is_string($value) ? strip_tags($value) : $value;
// Use strip_tags on strings only. 'description' with a parentKey that's an integer is the short_description, so don't strip that one
$sanitizedData[$key] = is_string($value) && !($key == 'description' && is_numeric($parentKey)) ? strip_tags($value) : $value;
}
}

Expand Down
6 changes: 4 additions & 2 deletions app/Http/Controllers/FrontController.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,12 @@ protected function getRelatedSidebarItemsData()
return response()->json(['error' => 'Item not found'], 404);
}

return response(view('site.shared._featuredRelated', [
$view['html'] = view('site.shared._featuredRelated', [
'item' => $item,
'autoRelated' => $this->getAutoRelated($item),
'featuredRelated' => $this->getFeatureRelated($item),
])->render(), 200, ['Content-Type' => 'text/html']);
])->render();

return $view;
}
}
8 changes: 7 additions & 1 deletion frontend/js/behaviors/core/loadRelatedSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,15 @@ const loadRelatedSidebar = function(container) {
function _inject(data)
{
if (sidebar) {
sidebar.innerHTML = data;
let parsed = JSON.parse(data);
sidebar.innerHTML = parsed.html;
heightAwareSidebar();
}

triggerCustomEvent(document, 'page:updated');
if (window.picturefill) {
window.picturefill();
}
}

function _init() {
Expand Down
5 changes: 3 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"lodash": "^4.17.15",
"minimist": "^1.2.0",
"mirador": "^3.0.0",
"my-museum-tour-builder": "git+https://github.com/art-institute-of-chicago/my-museum-tour.git#semver:^1.13",
"my-museum-tour-builder": "git+https://github.com/art-institute-of-chicago/my-museum-tour.git#semver:^1.15",
"prettier": "^1.7.4",
"react": "^16.9.0",
"react-app-polyfill": "^0.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,45 @@
@if ($isHero ?? false)
@component('components.atoms._img')
@slot('image', $image ?? ($item->imageFront('listing') ?? $item->imageFront('hero') ))
@slot('settings', $imageSettings ?? '')
@slot('settings', $imageSettings ?? array(
'srcset' => array(300,600,800,1200,1600),
'sizes' => ImageHelpers::aic_imageSizes(array(
'xsmall' => '58',
'small' => '58',
'medium' => '38',
'large' => '28',
'xlarge' => '28',
)),
))
@slot('class', 'img-hero-desktop')
@endcomponent
@component('components.atoms._img')
@slot('image', $imageMobile ?? $item->imageFront('mobile_hero') ?? $image ?? ($item->imageFront('listing') ?? $item->imageFront('hero') ))
@slot('settings', $imageSettings ?? '')
@slot('settings', $imageSettings ?? array(
'srcset' => array(300,600,800,1200,1600),
'sizes' => ImageHelpers::aic_imageSizes(array(
'xsmall' => '58',
'small' => '58',
'medium' => '38',
'large' => '28',
'xlarge' => '28',
)),
))
@slot('class', 'img-hero-mobile')
@endcomponent
@else
@component('components.atoms._img')
@slot('image', $image ?? ($item->imageFront('listing') ?? $item->imageFront('hero') ))
@slot('settings', $imageSettings ?? '')
@slot('settings', $imageSettings ?? array(
'srcset' => array(300,600,800,1200,1600),
'sizes' => ImageHelpers::aic_imageSizes(array(
'xsmall' => '58',
'small' => '58',
'medium' => '38',
'large' => '28',
'xlarge' => '28',
)),
))
@endcomponent
@endif
@component('components.molecules._m-listing-video')
Expand Down
2 changes: 1 addition & 1 deletion resources/views/site/blocks/feature_block.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
case 'exhibitions':
if ($block->input('override_exhibition')) {
$exhibitions = $block->browserIds('exhibitions');
$items = \App\Models\Api\Exhibition::query()->findMany($exhibitions)->sortBy('aic_start_at');
$items = \App\Models\Api\Exhibition::query()->findMany($exhibitions);
} else {
$items = \App\Models\Api\Exhibition::query()->current()->orderBy('aic_start_at', 'desc')->limit($columns)->get(['id', 'aic_start_at', 'aic_end_at', 'public_start_date', 'public_end_date']);
}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/site/myMuseumTour.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
</div>
@endisset
@isset($artwork['description'])
<p class="f-tertiary aic-ct-viewer__description">{{ $artwork['description'] }}</p>
<p class="f-tertiary aic-ct-viewer__description">{!! $artwork['description'] !!}</p>
@endisset
@isset($artwork['objectNote'])
@component('components.atoms._quote')
Expand Down

0 comments on commit ba37f12

Please sign in to comment.