From 3f96515aad65f366447dc68d2da7b58ec18425cd Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Mon, 13 May 2024 15:13:23 -0500 Subject: [PATCH 1/8] Fix auto related images on mobile [WEB-2852] --- .../_m-listing----auto-related.blade.php | 33 +++++++++++++++++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/resources/views/components/molecules/_m-listing----auto-related.blade.php b/resources/views/components/molecules/_m-listing----auto-related.blade.php index 2e1af4cae4..7f54919376 100644 --- a/resources/views/components/molecules/_m-listing----auto-related.blade.php +++ b/resources/views/components/molecules/_m-listing----auto-related.blade.php @@ -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') From 7cd4e05384a1d4228d2722e740ac5d99284dbeb5 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Thu, 16 May 2024 14:27:30 -0500 Subject: [PATCH 2/8] Return a JSON response of component to avoid pre-rendering of scrset [WEB-2852] --- app/Http/Controllers/FrontController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/FrontController.php b/app/Http/Controllers/FrontController.php index 4d97d729f0..627f7236d2 100644 --- a/app/Http/Controllers/FrontController.php +++ b/app/Http/Controllers/FrontController.php @@ -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; } } From 72f7f98ade5457ff2e5ce862326acc14b2c905ce Mon Sep 17 00:00:00 2001 From: Zach Garwood Date: Wed, 15 May 2024 11:12:15 -0500 Subject: [PATCH 3/8] Upgrade my-museum-tour-builder to 1.14.0 [WEB-2833] --- package-lock.json | 5 +++-- package.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index be1cc538bb..f0024e63dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8575,9 +8575,10 @@ } }, "my-museum-tour-builder": { - "version": "git+https://github.com/art-institute-of-chicago/my-museum-tour.git#2dc9fdef4961d9436a63a5ba391878783302ea1b", - "from": "git+https://github.com/art-institute-of-chicago/my-museum-tour.git#semver:^1.13", + "version": "git+https://github.com/art-institute-of-chicago/my-museum-tour.git#14dc60cb1d27792468f2c83148bf5aec532eabd1", + "from": "git+https://github.com/art-institute-of-chicago/my-museum-tour.git#semver:^1.14", "requires": { + "@area17/a17-helpers": "^0.6.7", "classnames": "^2.3.2", "prop-types": "^15.8.1" }, diff --git a/package.json b/package.json index 48e4a6b7ac..4884e8c5eb 100644 --- a/package.json +++ b/package.json @@ -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.14", "prettier": "^1.7.4", "react": "^16.9.0", "react-app-polyfill": "^0.2.0", From 69ffc4ca0bea56eae09f8ec2320c6a8f7f009fae Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Thu, 16 May 2024 14:28:09 -0500 Subject: [PATCH 4/8] Update loadRelatedSidebar script to inject parsed HTML and trigger a resize [WEB-2852] --- frontend/js/behaviors/core/loadRelatedSidebar.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/js/behaviors/core/loadRelatedSidebar.js b/frontend/js/behaviors/core/loadRelatedSidebar.js index ad9b8c8998..3cba4a4105 100644 --- a/frontend/js/behaviors/core/loadRelatedSidebar.js +++ b/frontend/js/behaviors/core/loadRelatedSidebar.js @@ -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() { From 2330cc33d4d802dfa757477d43bedc02a3f9bc86 Mon Sep 17 00:00:00 2001 From: WebDevTrev <96503752+web-dev-trev@users.noreply.github.com> Date: Fri, 17 May 2024 16:11:25 -0500 Subject: [PATCH 5/8] Remove sort from selected exhibitions on feature_block [WEB-2863] --- resources/views/site/blocks/feature_block.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/site/blocks/feature_block.blade.php b/resources/views/site/blocks/feature_block.blade.php index 2b2d9b3fad..10cfe254ec 100644 --- a/resources/views/site/blocks/feature_block.blade.php +++ b/resources/views/site/blocks/feature_block.blade.php @@ -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']); } From 0b794e6a36d8f8d994ec0b09232aa16d31a5eb60 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Tue, 21 May 2024 14:20:31 -0500 Subject: [PATCH 6/8] Save formatting on My Museum Tour short descriptions [WEB-2846] --- app/Http/Controllers/API/MyMuseumTourController.php | 8 ++++---- resources/views/site/myMuseumTour.blade.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/API/MyMuseumTourController.php b/app/Http/Controllers/API/MyMuseumTourController.php index a594b75ffc..5b63c712c7 100644 --- a/app/Http/Controllers/API/MyMuseumTourController.php +++ b/app/Http/Controllers/API/MyMuseumTourController.php @@ -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; } } diff --git a/resources/views/site/myMuseumTour.blade.php b/resources/views/site/myMuseumTour.blade.php index 0bfc9baba3..56dcc95d65 100644 --- a/resources/views/site/myMuseumTour.blade.php +++ b/resources/views/site/myMuseumTour.blade.php @@ -149,7 +149,7 @@ @endisset @isset($artwork['description']) -

{{ $artwork['description'] }}

+

{!! $artwork['description'] !!}

@endisset @isset($artwork['objectNote']) @component('components.atoms._quote') From abb5d9947c79fb17378d5eafa19f0497444535e2 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Tue, 21 May 2024 18:05:18 -0500 Subject: [PATCH 7/8] Bump my-museum-tour-builder version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index f0024e63dd..fccded6f5a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8575,8 +8575,8 @@ } }, "my-museum-tour-builder": { - "version": "git+https://github.com/art-institute-of-chicago/my-museum-tour.git#14dc60cb1d27792468f2c83148bf5aec532eabd1", - "from": "git+https://github.com/art-institute-of-chicago/my-museum-tour.git#semver:^1.14", + "version": "git+https://github.com/art-institute-of-chicago/my-museum-tour.git#f7aec5d9f62b7b61b6788ba5b2d9b8be7afc6925", + "from": "git+https://github.com/art-institute-of-chicago/my-museum-tour.git#semver:^1.15", "requires": { "@area17/a17-helpers": "^0.6.7", "classnames": "^2.3.2", diff --git a/package.json b/package.json index 4884e8c5eb..d2b70c3060 100644 --- a/package.json +++ b/package.json @@ -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.14", + "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", From 6c4f9890b2ecef47f520de8d9c14f6fde7233626 Mon Sep 17 00:00:00 2001 From: nikhil trivedi Date: Wed, 22 May 2024 11:14:29 -0500 Subject: [PATCH 8/8] Bump version number --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 152caae3b7..99da1bbaba 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.47 \ No newline at end of file +6.48 \ No newline at end of file