# Maintenance Tasks
# A11y Scans
- Run Axe scan in the site and save each scan
- Export found issues to cvs files
- Generate XLS file with the template
- Generate Jira task and make sure they are with the right labels
- Generate report
# App Updates
Do all the following:
# 1 - Update composer dependencies
- Run
composer outdatedto get a list of outdated dependencies - Manually update the version of each dependency in the composer.json file
- Make sure to check the project's README for any exceptions or dependencies that should not be updated
- WordPress' plugins can usually be updated to major versions without issues (with appropriate testing after installing)
- Other dependencies most likely follow SEMVER, so make sure to manually check the changelog of each dependency before updating major versions (minor and bugfixes are usually ok)
- Updating to major versions of WordPress needs to be approved/communicated in advanced
- Run
composer install - Make sure all uses of the dependency exports are updated if necessary
- Ensure the project works locally, testing all the functionality that was affected by the update (e.g. plugins, etc)
- Document any dependencies that can't be upgraded in the README. This is only for very complex dependency upgrades OR incompatibilities between libraries, if you need to update some code to upgrade, update the code.
- Create a PR with these changes ONLY
Note: Older projects might need manual update of WordPress plugins and core (non-composer based). Make sure to update and commit those changes.
# 2 - Update frontend dependencies
- Run
npx npm-check --update - Mark all minor and bugfix versions for update
- Make sure to check the project's README for any exceptions or dependencies that should not be updated
- Run
npm i && npm test && npm run prod, fix any errors - Run
npx npm-check --updateand go through each remaining major version- Check the major version's changelog or release, make sure you follow any migration steps outlined in those documents
- Make sure all uses of the dependency exports are updated if necessary
- When upgrading
@wearesideways/sw-classic-lib, make sure you replace existing code with the equivalent that was migrated to@wearesideways/sw-classic-lib, if any. For example thescroll-polyfillfile, theSwiperclass, or thetabs()function.
- Do another round of testing with all the upgrades installed
- Document any dependencies that can't be upgraded in the README. This is only for very complex dependency upgrades OR incompatibilities between libraries, if you need to update some code to upgrade, update the code.
- If
@wearesideways/classic-wp-webpackwas updated make sure to run the update scriptnpm run update-webpack- Make sure to rename
@sidewaysnyc/classic-wp-webpackto@wearesideways/classic-wp-webpack
- Make sure to rename
- Create a PR with these changes ONLY
# Upgrading Swiper to v8
Swiper v8 included in @wearesideways/sw-classic-lib needs @wearesideways/classic-wp-webpack => 3.0.4. This means you need to update Webpack as outlined above and apply the code changes required for Swiper v8 in one step to get the build to compile.
Follow this patch (taken from ParkLane)
Index: web/app/themes/parklane/assets/js/components/attraction-carousel.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/assets/js/components/attraction-carousel.js b/web/app/themes/parklane/assets/js/components/attraction-carousel.js
--- a/web/app/themes/parklane/assets/js/components/attraction-carousel.js (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ b/web/app/themes/parklane/assets/js/components/attraction-carousel.js (revision a8d7316c1b3fd28298e9df1d14a032803b2865f3)
@@ -1,7 +1,7 @@
-import Swiper from '../shared/swiper/swiper'
+import Swiper from '../shared/swiper'
export default function attractionCarousel(el) {
- const sliderContainer = el.querySelector('.swiper-container')
+ const sliderContainer = el.querySelector('.swiper')
const carouselBp = Number.parseInt(
getComputedStyle(el).getPropertyValue('--attraction-carousel-bp'),
10,
Index: web/app/themes/parklane/assets/js/components/capabilities.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/assets/js/components/capabilities.js b/web/app/themes/parklane/assets/js/components/capabilities.js
--- a/web/app/themes/parklane/assets/js/components/capabilities.js (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ b/web/app/themes/parklane/assets/js/components/capabilities.js (revision a8d7316c1b3fd28298e9df1d14a032803b2865f3)
@@ -1,7 +1,7 @@
-import Swiper from '../shared/swiper/swiper'
+import Swiper from '../shared/swiper'
export default function capabilities(el) {
- const sliderContainer = el.querySelector('.swiper-container')
+ const sliderContainer = el.querySelector('.swiper')
new Swiper(sliderContainer, {
navigation: {
Index: web/app/themes/parklane/assets/js/components/content-tabs.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/assets/js/components/content-tabs.js b/web/app/themes/parklane/assets/js/components/content-tabs.js
--- a/web/app/themes/parklane/assets/js/components/content-tabs.js (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ b/web/app/themes/parklane/assets/js/components/content-tabs.js (revision a8d7316c1b3fd28298e9df1d14a032803b2865f3)
@@ -1,8 +1,8 @@
-import Swiper from '../shared/swiper/swiper'
+import Swiper from '../shared/swiper'
import { tabs } from '../shared/tabs'
export default function contentTabs(el) {
- const sliderContainers = el.querySelectorAll('.swiper-container')
+ const sliderContainers = el.querySelectorAll('.swiper')
function initSlider(sliderContainer) {
new Swiper(sliderContainer, {
Index: web/app/themes/parklane/assets/js/components/gallery-modal.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/assets/js/components/gallery-modal.js b/web/app/themes/parklane/assets/js/components/gallery-modal.js
--- a/web/app/themes/parklane/assets/js/components/gallery-modal.js (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ b/web/app/themes/parklane/assets/js/components/gallery-modal.js (revision a8d7316c1b3fd28298e9df1d14a032803b2865f3)
@@ -1,9 +1,9 @@
import 'bootstrap/js/src/modal'
-import Swiper, { makeLoop } from '../shared/swiper/swiper'
-import { swiperModalSync } from '../shared/swiper/swiper-modal-sync'
+import Swiper from '../shared/swiper'
+import { swiperModalSync } from '@wearesideways/sw-classic-lib'
export default function galleryModal(el) {
- const sliderContainer = el.querySelector('.swiper-container')
+ const sliderContainer = el.querySelector('.swiper')
const nextBtn = sliderContainer.querySelector('.swiper-button-next')
const prevBtn = sliderContainer.querySelector('.swiper-button-prev')
@@ -30,10 +30,4 @@
const index = button.dataset.modalSlideIndex
goToSlide(index)
})
-
- el.addEventListener('shown.bs.modal', (event) => {
- const button = event.relatedTarget
- const index = button.dataset.modalSlideIndex
- makeLoop(prevBtn, nextBtn, swiper, parseInt(index))
- })
}
Index: web/app/themes/parklane/assets/js/components/hero.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/assets/js/components/hero.js b/web/app/themes/parklane/assets/js/components/hero.js
--- a/web/app/themes/parklane/assets/js/components/hero.js (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ b/web/app/themes/parklane/assets/js/components/hero.js (revision a8d7316c1b3fd28298e9df1d14a032803b2865f3)
@@ -1,7 +1,7 @@
-import Swiper from '../shared/swiper/swiper'
+import Swiper from '../shared/swiper'
export default function hero(el) {
- const sliderContainer = el.querySelector('.swiper-container')
+ const sliderContainer = el.querySelector('.swiper')
if (!sliderContainer) return
Index: web/app/themes/parklane/assets/js/components/instagram-info.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/assets/js/components/instagram-info.js b/web/app/themes/parklane/assets/js/components/instagram-info.js
--- a/web/app/themes/parklane/assets/js/components/instagram-info.js (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ b/web/app/themes/parklane/assets/js/components/instagram-info.js (revision a8d7316c1b3fd28298e9df1d14a032803b2865f3)
@@ -1,7 +1,7 @@
-import Swiper from '../shared/swiper/swiper'
+import Swiper from '../shared/swiper'
export default function instagramInfo(el) {
- const sliderContainer = el.querySelector('.swiper-container')
+ const sliderContainer = el.querySelector('.swiper')
new Swiper(sliderContainer, {
navigation: {
Index: web/app/themes/parklane/assets/js/components/media-carousel.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/assets/js/components/media-carousel.js b/web/app/themes/parklane/assets/js/components/media-carousel.js
--- a/web/app/themes/parklane/assets/js/components/media-carousel.js (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ b/web/app/themes/parklane/assets/js/components/media-carousel.js (revision a8d7316c1b3fd28298e9df1d14a032803b2865f3)
@@ -1,11 +1,11 @@
-import Swiper, { makeLoop } from '../shared/swiper/swiper'
+import Swiper from '../shared/swiper'
export default function mediaCarousel(el) {
- const sliderContainer = el.querySelector('.swiper-container')
+ const sliderContainer = el.querySelector('.swiper')
const nextBtn = sliderContainer.querySelector('.swiper-button-next')
const prevBtn = sliderContainer.querySelector('.swiper-button-prev')
- const swiper = new Swiper(sliderContainer, {
+ new Swiper(sliderContainer, {
navigation: {
nextEl: nextBtn,
prevEl: prevBtn,
@@ -15,6 +15,4 @@
type: 'fraction',
},
})
-
- makeLoop(prevBtn, nextBtn, swiper)
}
Index: web/app/themes/parklane/assets/js/components/room-card.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/assets/js/components/room-card.js b/web/app/themes/parklane/assets/js/components/room-card.js
--- a/web/app/themes/parklane/assets/js/components/room-card.js (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ b/web/app/themes/parklane/assets/js/components/room-card.js (revision a8d7316c1b3fd28298e9df1d14a032803b2865f3)
@@ -1,9 +1,9 @@
-import Swiper from '../shared/swiper/swiper'
+import Swiper from '../shared/swiper'
import equalizer from '../shared/equalizer'
import debounce from 'lodash/debounce'
export default function roomCard(el) {
- const sliderContainer = el.querySelector('.swiper-container')
+ const sliderContainer = el.querySelector('.swiper')
new Swiper(sliderContainer, {
navigation: {
Index: web/app/themes/parklane/assets/js/components/tri-columns.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/assets/js/components/tri-columns.js b/web/app/themes/parklane/assets/js/components/tri-columns.js
--- a/web/app/themes/parklane/assets/js/components/tri-columns.js (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ b/web/app/themes/parklane/assets/js/components/tri-columns.js (revision a8d7316c1b3fd28298e9df1d14a032803b2865f3)
@@ -1,10 +1,10 @@
-import Swiper from '../shared/swiper/swiper'
+import Swiper from '../shared/swiper'
import debounce from 'lodash/debounce'
export default function triColumns(el) {
const showInDesktop = 3
const carouselWrapper = el.querySelector('.carousel-wrapper')
- const sliderContainer = el.querySelector('.swiper-container')
+ const sliderContainer = el.querySelector('.swiper')
const slides = sliderContainer.querySelectorAll('.swiper-slide')
const carouselBp = Number.parseInt(getComputedStyle(el).getPropertyValue('--tri-columns-bp'), 10)
const controls = carouselWrapper.querySelector('.slider-controls')
Index: web/app/themes/parklane/assets/js/shared/swiper/swiper.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/assets/js/shared/swiper/swiper.js b/web/app/themes/parklane/assets/js/shared/swiper.js
rename from web/app/themes/parklane/assets/js/shared/swiper/swiper.js
rename to web/app/themes/parklane/assets/js/shared/swiper.js
--- a/web/app/themes/parklane/assets/js/shared/swiper/swiper.js (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ b/web/app/themes/parklane/assets/js/shared/swiper.js (revision 38bba5099e6b3f4685601762ab30266402fc900a)
@@ -1,15 +1,13 @@
-import SwiperCore, { Autoplay, EffectFade, Navigation, Pagination } from 'swiper/core'
-import EnhancedA11y from './enhanced-a11y'
-import 'swiper/swiper.min.css'
-import 'swiper/components/effect-fade/effect-fade.min.css'
+import { Swiper as SwiperCore, Autoplay, EffectFade, Navigation, Pagination } from 'swiper'
+import { SwiperEnhancedA11y } from '@wearesideways/sw-classic-lib'
+import 'swiper/css'
+import 'swiper/css/effect-fade'
// These are not really needed nor wanted, too much useless styling applied.
-// import 'swiper/components/navigation/navigation.min.css'
-// import 'swiper/components/pagination/pagination.min.css'
+// import 'swiper/css/navigation'
+// import 'swiper/css/pagination'
-SwiperCore.use([Navigation, Pagination, Autoplay, EffectFade, EnhancedA11y])
-
-export const defaultNoSwipingSelector = 'button,[role=button],input,a[href]'
+const defaultNoSwipingSelector = 'button,[role=button],input,a[href]'
export default class Swiper extends SwiperCore {
constructor(el, config) {
@@ -23,8 +21,18 @@
allowTouchMove: slideCount > 1,
speed: reducedMotion ? 0 : config.speed ?? 300,
noSwipingSelector: defaultNoSwipingSelector,
+ rewind: true,
...config,
+ modules: [
+ Navigation,
+ Pagination,
+ Autoplay,
+ EffectFade,
+ ...(config?.modules ?? []),
+ SwiperEnhancedA11y,
+ ],
+
autoplay: {
disableOnInteraction: false,
delay: 3000,
@@ -58,35 +66,3 @@
})
}
}
-
-export const makeLoop = (prevBtn, nextBtn, swiper, initIndex = 0) => {
- let isBegin = initIndex === 0
- let isEnd = false
- prevBtn.removeAttribute('aria-disabled')
-
- prevBtn.addEventListener('click', function () {
- if (isBegin) {
- isBegin = false
- swiper.slideTo(swiper.slides.length)
- isEnd = true
- }
- if (swiper.isBeginning) {
- isBegin = true
- prevBtn.removeAttribute('aria-disabled')
- }
- })
-
- nextBtn.addEventListener('click', function () {
- if (isEnd) {
- isEnd = false
- swiper.slideTo(0)
- isBegin = true
- }
- if (swiper.isEnd) {
- isEnd = true
- nextBtn.removeAttribute('aria-disabled')
- } else {
- isBegin = false
- }
- })
-}
Index: web/app/themes/parklane/assets/scss/components/attraction-carousel.scss
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/assets/scss/components/attraction-carousel.scss b/web/app/themes/parklane/assets/scss/components/attraction-carousel.scss
--- a/web/app/themes/parklane/assets/scss/components/attraction-carousel.scss (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ b/web/app/themes/parklane/assets/scss/components/attraction-carousel.scss (revision a8d7316c1b3fd28298e9df1d14a032803b2865f3)
@@ -22,7 +22,7 @@
}
}
- .swiper-container {
+ .swiper {
margin-top: 40px;
@include media-breakpoint-up(lg) {
Index: web/app/themes/parklane/assets/scss/components/content-tabs.scss
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/assets/scss/components/content-tabs.scss b/web/app/themes/parklane/assets/scss/components/content-tabs.scss
--- a/web/app/themes/parklane/assets/scss/components/content-tabs.scss (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ b/web/app/themes/parklane/assets/scss/components/content-tabs.scss (revision a8d7316c1b3fd28298e9df1d14a032803b2865f3)
@@ -106,7 +106,7 @@
}
}
- .swiper-container {
+ .swiper {
@include media-breakpoint-up(lg) {
height: 100%;
}
Index: web/app/themes/parklane/assets/scss/components/hero.scss
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/assets/scss/components/hero.scss b/web/app/themes/parklane/assets/scss/components/hero.scss
--- a/web/app/themes/parklane/assets/scss/components/hero.scss (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ b/web/app/themes/parklane/assets/scss/components/hero.scss (revision a8d7316c1b3fd28298e9df1d14a032803b2865f3)
@@ -114,7 +114,7 @@
}
}
- .swiper-container {
+ .swiper {
position: static;
}
Index: web/app/themes/parklane/assets/scss/components/instagram_info.scss
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/assets/scss/components/instagram_info.scss b/web/app/themes/parklane/assets/scss/components/instagram_info.scss
--- a/web/app/themes/parklane/assets/scss/components/instagram_info.scss (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ b/web/app/themes/parklane/assets/scss/components/instagram_info.scss (revision a8d7316c1b3fd28298e9df1d14a032803b2865f3)
@@ -35,7 +35,7 @@
width: 100%;
}
- .swiper-container {
+ .swiper {
width: 100%;
display: flex;
overflow: visible;
Index: web/app/themes/parklane/assets/scss/partials/gallery-modal.scss
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/assets/scss/partials/gallery-modal.scss b/web/app/themes/parklane/assets/scss/partials/gallery-modal.scss
--- a/web/app/themes/parklane/assets/scss/partials/gallery-modal.scss (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ b/web/app/themes/parklane/assets/scss/partials/gallery-modal.scss (revision a8d7316c1b3fd28298e9df1d14a032803b2865f3)
@@ -30,7 +30,7 @@
}
}
- .swiper-container {
+ .swiper {
display: flex;
flex-direction: column;
}
Index: web/app/themes/parklane/assets/scss/partials/room-card.scss
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/assets/scss/partials/room-card.scss b/web/app/themes/parklane/assets/scss/partials/room-card.scss
--- a/web/app/themes/parklane/assets/scss/partials/room-card.scss (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ b/web/app/themes/parklane/assets/scss/partials/room-card.scss (revision a8d7316c1b3fd28298e9df1d14a032803b2865f3)
@@ -188,7 +188,7 @@
}
}
- &-swiper-container {
+ &-swiper {
width: 100%;
flex: none;
overflow: visible;
@@ -219,7 +219,7 @@
max-width: 50%;
}
- .room_card-swiper-container {
+ .room_card-swiper {
width: 50%;
}
Index: web/app/themes/parklane/package.json
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/package.json b/web/app/themes/parklane/package.json
--- a/web/app/themes/parklane/package.json (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ b/web/app/themes/parklane/package.json (revision 584ce49094bcc43d77cca7b5315652763a8d21c2)
@@ -15,7 +15,7 @@
"@react-aria/focus": "^3.5.3",
"@react-aria/overlays": "^3.8.0",
"@react-aria/utils": "^3.11.3",
- "@wearesideways/sw-classic-lib": "^1.7.0",
+ "@wearesideways/sw-classic-lib": "^1.8.0",
"autosize": "^5.0.1",
"bootstrap": "^5.1.3",
"dateformat": "^5.0.3",
@@ -30,7 +30,7 @@
"react-dom": "^16.14.0",
"react-outside-click-handler": "^1.3.0",
"smoothscroll-polyfill": "^0.4.4",
- "swiper": "^6.8.4",
+ "swiper": "^8.0.7",
"wicg-inert": "^3.1.1"
},
"devDependencies": {
Index: web/app/themes/parklane/views/components/attraction-carousel.blade.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/views/components/attraction-carousel.blade.php b/web/app/themes/parklane/views/components/attraction-carousel.blade.php
--- a/web/app/themes/parklane/views/components/attraction-carousel.blade.php (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ b/web/app/themes/parklane/views/components/attraction-carousel.blade.php (revision a8d7316c1b3fd28298e9df1d14a032803b2865f3)
@@ -2,7 +2,7 @@
<h2 class="headline">{{ $headline }}</h2>
- <div class="swiper-container" role="group" aria-label="attraction carousel">
+ <div class="swiper" role="group" aria-label="attraction carousel">
@include('partials.slider-controls-2', ['class' => 'controls-container'])
Index: web/app/themes/parklane/views/components/capabilities.blade.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/views/components/capabilities.blade.php b/web/app/themes/parklane/views/components/capabilities.blade.php
--- a/web/app/themes/parklane/views/components/capabilities.blade.php (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ b/web/app/themes/parklane/views/components/capabilities.blade.php (revision a8d7316c1b3fd28298e9df1d14a032803b2865f3)
@@ -11,7 +11,7 @@
<div class="container">
<div class="col col-12 col-lg-10 offset-lg-1">
- <div class="swiper-container"
+ <div class="swiper"
{!! $is_carousel ? 'role="group" aria-label="' . esc_attr($carousel_description ?? '') . ' carousel"' : '' !!}
{!! $is_carousel && $auto_rotate_enabled && $start_rotating ? 'data-start-rotating' : '' !!}>
Index: web/app/themes/parklane/views/components/content-tabs.blade.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/views/components/content-tabs.blade.php b/web/app/themes/parklane/views/components/content-tabs.blade.php
--- a/web/app/themes/parklane/views/components/content-tabs.blade.php (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ b/web/app/themes/parklane/views/components/content-tabs.blade.php (revision a8d7316c1b3fd28298e9df1d14a032803b2865f3)
@@ -53,7 +53,7 @@
<div class="col col-12 col-lg-6 content_tabs-slider">
- <div class="swiper-container media-container"
+ <div class="swiper media-container"
{!! count($tab['pictures']) > 1? 'role="group" aria-label="' . $tab_name . ' images carousel"' : '' !!}>
@includeWhen(
Index: web/app/themes/parklane/views/components/hero.blade.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/views/components/hero.blade.php b/web/app/themes/parklane/views/components/hero.blade.php
--- a/web/app/themes/parklane/views/components/hero.blade.php (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ b/web/app/themes/parklane/views/components/hero.blade.php (revision a8d7316c1b3fd28298e9df1d14a032803b2865f3)
@@ -15,7 +15,7 @@
</div>
@else
- <div class="swiper-container" role="group" aria-label="{{ $carousel_description }} carousel"
+ <div class="swiper" role="group" aria-label="{{ $carousel_description }} carousel"
{!! $auto_rotate_enabled && $start_rotating? 'data-start-rotating' : '' !!} >
<div class="cartouche"></div>
Index: web/app/themes/parklane/views/components/instagram-info.blade.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/views/components/instagram-info.blade.php b/web/app/themes/parklane/views/components/instagram-info.blade.php
--- a/web/app/themes/parklane/views/components/instagram-info.blade.php (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ b/web/app/themes/parklane/views/components/instagram-info.blade.php (revision a8d7316c1b3fd28298e9df1d14a032803b2865f3)
@@ -9,7 +9,7 @@
<div class="insta-container col col-12 col-lg-6 offset-lg-1">
<div class="swiper-wrap">
- <div class="swiper-container" role="group" aria-label="Instagram images carousel">
+ <div class="swiper" role="group" aria-label="Instagram images carousel">
{{-- Start of Controls; Added here because they are no reusable --}}
<div class="slider-controls {{ $class ?? '' }} gx-0">
Index: web/app/themes/parklane/views/components/media-carousel.blade.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/views/components/media-carousel.blade.php b/web/app/themes/parklane/views/components/media-carousel.blade.php
--- a/web/app/themes/parklane/views/components/media-carousel.blade.php (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ b/web/app/themes/parklane/views/components/media-carousel.blade.php (revision a8d7316c1b3fd28298e9df1d14a032803b2865f3)
@@ -2,7 +2,7 @@
<h2 class="visually-hidden">{{ $carousel_description }}</h2>
- <div class="swiper-container"
+ <div class="swiper"
{!! count($slides) > 1? 'role="group" aria-label="' . esc_attr($carousel_description) . ' carousel"' : '' !!}>
@includeWhen(count($slides) > 1, 'partials.slider-controls-1', ['auto_rotate_enabled' => false])
Index: web/app/themes/parklane/views/components/tri-columns.blade.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/views/components/tri-columns.blade.php b/web/app/themes/parklane/views/components/tri-columns.blade.php
--- a/web/app/themes/parklane/views/components/tri-columns.blade.php (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ b/web/app/themes/parklane/views/components/tri-columns.blade.php (revision a8d7316c1b3fd28298e9df1d14a032803b2865f3)
@@ -18,7 +18,7 @@
@include('partials.slider-controls-2')
- <div class="swiper-container">
+ <div class="swiper">
<div class="swiper-wrapper" id="{{ $id }}-slider">
@foreach($columns as $card)
Index: web/app/themes/parklane/views/partials/gallery-modal.blade.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/views/partials/gallery-modal.blade.php b/web/app/themes/parklane/views/partials/gallery-modal.blade.php
--- a/web/app/themes/parklane/views/partials/gallery-modal.blade.php (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ b/web/app/themes/parklane/views/partials/gallery-modal.blade.php (revision a8d7316c1b3fd28298e9df1d14a032803b2865f3)
@@ -10,7 +10,7 @@
<div class="modal-body container">
<div class="col-12 swipper-wrapper">
- <div class="swiper-container"
+ <div class="swiper"
{!! count($slides) > 1? 'role="group" aria-label="' . esc_attr($title) . ' carousel"' : '' !!}>
@includeWhen(count($slides) > 1, 'partials.slider-controls-1', ['auto_rotate_enabled' => false])
Index: web/app/themes/parklane/views/partials/room-card.blade.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/views/partials/room-card.blade.php b/web/app/themes/parklane/views/partials/room-card.blade.php
--- a/web/app/themes/parklane/views/partials/room-card.blade.php (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ b/web/app/themes/parklane/views/partials/room-card.blade.php (revision a8d7316c1b3fd28298e9df1d14a032803b2865f3)
@@ -47,7 +47,7 @@
</div>
- <div class="swiper-container room_card-swiper-container"
+ <div class="swiper room_card-swiper"
{!! count($room['pictures']) > 1? 'role="group" aria-label="' . $room['name'] . ' images carousel"' : '' !!}>
@includeWhen(count($room['pictures']) > 1, 'partials.slider-controls-2', ['class' => 'room_card-slider-controls'])
Index: web/app/themes/parklane/assets/js/components/booking-widget/BookingForm.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/assets/js/components/booking-widget/BookingForm.js b/web/app/themes/parklane/assets/js/components/booking-widget/BookingForm.js
--- a/web/app/themes/parklane/assets/js/components/booking-widget/BookingForm.js (revision a8d7316c1b3fd28298e9df1d14a032803b2865f3)
+++ b/web/app/themes/parklane/assets/js/components/booking-widget/BookingForm.js (revision 90b647a8c40bbcdde14dbddf9df7320baad80952)
@@ -1,3 +1,4 @@
+import 'wicg-inert'
import moment from 'moment'
import React, { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { focusSafely, useFocusManager } from '@react-aria/focus'
Index: web/app/themes/parklane/assets/js/components/booking-widget/BookingModal.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/assets/js/components/booking-widget/BookingModal.js b/web/app/themes/parklane/assets/js/components/booking-widget/BookingModal.js
--- a/web/app/themes/parklane/assets/js/components/booking-widget/BookingModal.js (revision a8d7316c1b3fd28298e9df1d14a032803b2865f3)
+++ b/web/app/themes/parklane/assets/js/components/booking-widget/BookingModal.js (revision 90b647a8c40bbcdde14dbddf9df7320baad80952)
@@ -1,3 +1,4 @@
+import 'wicg-inert'
import React, { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'
import { useOverlay, usePreventScroll } from '@react-aria/overlays'
import { useDialog } from '@react-aria/dialog'
Index: web/app/themes/parklane/assets/js/shared/swiper/enhanced-a11y.js
===================================================================
diff --git a/web/app/themes/parklane/assets/js/shared/swiper/enhanced-a11y.js b/web/app/themes/parklane/assets/js/shared/swiper/enhanced-a11y.js
deleted file mode 100644
--- a/web/app/themes/parklane/assets/js/shared/swiper/enhanced-a11y.js (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ /dev/null (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
@@ -1,387 +0,0 @@
-import 'wicg-inert'
-import $ from 'swiper/esm/utils/dom'
-import { bindModuleMethods, classesToSelector } from 'swiper/esm/utils/utils'
-import { isVisible } from './is-visible'
-import debounce from 'lodash/debounce'
-
-// TODO move to shared lib at project's end
-// Based on implementation suggestions from https://w3c.github.io/aria-practices/examples/carousel/carousel-2-tablist.html
-const moduleApi = {
- init() {
- const swiper = this
-
- // Make the pagination bullets a tab widget
- if (
- swiper.pagination &&
- swiper.params.pagination.clickable &&
- swiper.pagination.bullets &&
- swiper.pagination.bullets.length
- ) {
- swiper.pagination.$el.on(
- 'keydown',
- classesToSelector(swiper.params.pagination.bulletClass),
- swiper.enhancedA11y.handlePaginationNavigation,
- )
- }
-
- // Fixes visual bug when attempting to focus stuff on inactive slides, happens even when using inert
- swiper.$el.on('scroll', swiper.enhancedA11y.scrollFix)
-
- const autoplayIndicatorEl = swiper.params.enhancedA11y.autoplayIndicatorEl
- if (autoplayIndicatorEl) {
- const $autoplayIndicatorEl =
- typeof autoplayIndicatorEl === 'string'
- ? swiper.$el.find(autoplayIndicatorEl)
- : $(autoplayIndicatorEl)
-
- $autoplayIndicatorEl.on('click', swiper.enhancedA11y.userToggleAutoplay)
-
- swiper.enhancedA11y.$autoplayIndicatorEl = $autoplayIndicatorEl
- }
-
- const interactionPauseEl = swiper.params.enhancedA11y.interactionPauseEl
- const $interactionPauseEl = interactionPauseEl
- ? typeof interactionPauseEl === 'string'
- ? swiper.$el.find(interactionPauseEl)
- : $(interactionPauseEl)
- : swiper.$el
- swiper.enhancedA11y.$interactionPauseEl = $interactionPauseEl
-
- $interactionPauseEl.on('mouseenter', swiper.enhancedA11y.handleMouseEnter)
- $interactionPauseEl.on('mouseleave', swiper.enhancedA11y.handleMouseLeave)
- $interactionPauseEl.on('focusin', swiper.enhancedA11y.handleFocusIn)
- $interactionPauseEl.on('focusout', swiper.enhancedA11y.handleFocusOut)
-
- // attempt to avoid the very first notification while swiper modifies the markup
- setTimeout(swiper.enhancedA11y.updateLiveAnnouncements, 500)
-
- swiper.enhancedA11y.updateVisibilityDebounced()
- },
-
- destroy() {
- const swiper = this
-
- if (
- swiper.pagination &&
- swiper.params.pagination.clickable &&
- swiper.pagination.bullets &&
- swiper.pagination.bullets.length
- ) {
- swiper.pagination.$el.off(
- 'keydown',
- classesToSelector(swiper.params.pagination.bulletClass),
- swiper.a11y.handlePaginationNavigation,
- )
- }
-
- swiper.$el.off('scroll', swiper.enhancedA11y.scrollFix)
-
- swiper.enhancedA11y.$interactionPauseEl.off('mouseenter', swiper.enhancedA11y.handleMouseEnter)
- swiper.enhancedA11y.$interactionPauseEl.off('mouseleave', swiper.enhancedA11y.handleMouseLeave)
- swiper.enhancedA11y.$interactionPauseEl.off('focusin', swiper.enhancedA11y.handleFocusIn)
- swiper.enhancedA11y.$interactionPauseEl.off('focusout', swiper.enhancedA11y.handleFocusOut)
-
- swiper.enhancedA11y.$autoplayIndicatorEl.off('click', swiper.enhancedA11y.userToggleAutoplay)
- },
-
- updatePagination() {
- const swiper = this
- if (
- swiper.pagination &&
- swiper.params.pagination.clickable &&
- swiper.pagination.bullets &&
- swiper.pagination.bullets.length
- ) {
- swiper.pagination.$el.attr('role', 'tablist').attr('aria-label', 'Slides')
-
- swiper.pagination.bullets.each((bulletEl, i) => {
- const $bulletEl = $(bulletEl)
- const isSelected = swiper.activeIndex === i
-
- $bulletEl
- .attr('tabindex', isSelected ? '0' : '-1')
- .attr('role', 'tab')
- .attr('aria-selected', isSelected ? 'true' : 'false')
- .attr('aria-controls', swiper.enhancedA11y.getSlideId(i))
- })
- }
-
- swiper.enhancedA11y.updateSlides()
- },
-
- updateSlides() {
- const swiper = this
-
- const hasPaginationBullets =
- swiper.pagination &&
- swiper.params.pagination.clickable &&
- swiper.pagination.bullets &&
- !!swiper.pagination.bullets.length
-
- if (hasPaginationBullets || swiper.slides.length > 1) {
- swiper.slides.each((slide, idx) => {
- slide.setAttribute('role', hasPaginationBullets ? 'tabpanel' : 'group')
- slide.setAttribute('aria-label', `${idx + 1} of ${swiper.slides.length}`)
-
- if (!slide.id) slide.setAttribute('id', swiper.enhancedA11y.getSlideId(idx))
- })
- }
-
- swiper.enhancedA11y.updateSlidesFocusTrap()
- },
-
- // Focus trap on active slide
- updateSlidesFocusTrap() {
- const swiper = this
-
- swiper.slides.each((slide, idx) => {
- const isActive = swiper.activeIndex === idx
-
- // the inert polyfill sets aria-hidden, if we ever remove it we need to add that here
- if (isActive) {
- slide.removeAttribute('inert')
- } else {
- slide.setAttribute('inert', '')
- }
- })
- },
-
- handlePaginationNavigation(ev) {
- const swiper = this
-
- let next
-
- function move() {
- ev.preventDefault()
- const bullet = swiper.pagination.bullets.eq(next)[0]
-
- bullet.focus()
- bullet.click()
- }
-
- switch (ev.key) {
- case 'ArrowRight':
- next = (swiper.activeIndex + 1) % swiper.slides.length
- move()
- break
-
- case 'ArrowLeft':
- next = (swiper.activeIndex - 1) % swiper.slides.length
- move()
- break
-
- case 'Home':
- next = 0
- move()
- break
-
- case 'End':
- next = swiper.slides.length - 1
- move()
- break
-
- default:
- break
- }
- },
-
- scrollFix() {
- const swiper = this
- swiper.el.scrollLeft = 0
- },
-
- getSlideId(idx) {
- const swiper = this
- return swiper.slides[idx].id || `${swiper.wrapperEl.id}-slide-${idx}`
- },
-
- updateVisibility() {
- const swiper = this
- swiper.enhancedA11y.visible = isVisible(swiper.wrapperEl)
- swiper.enhancedA11y.updateAutoplay()
- },
-
- handleMouseEnter() {
- const swiper = this
- swiper.enhancedA11y.mouseEntered = true
- swiper.enhancedA11y.updateAutoplay()
- },
-
- handleMouseLeave() {
- const swiper = this
- swiper.enhancedA11y.mouseEntered = false
- swiper.enhancedA11y.updateAutoplay()
- },
-
- handleFocusIn() {
- const swiper = this
- swiper.enhancedA11y.focusIn = true
- swiper.enhancedA11y.updateAutoplay()
- },
-
- handleFocusOut() {
- const swiper = this
- swiper.enhancedA11y.focusIn = false
- swiper.enhancedA11y.updateAutoplay()
- },
-
- updateAutoplay() {
- const swiper = this
-
- swiper.enhancedA11y.updateAutoplayIndicator()
-
- // console.log({
- // el: swiper.wrapperEl,
- // visible: swiper.enhancedA11y.visible,
- // userRequestedAutoplay: swiper.enhancedA11y.userRequestedAutoplay,
- // autoplay: swiper.params.autoplay?.enabled,
- // focusIn: swiper.enhancedA11y.focusIn,
- // mouseEntered: swiper.enhancedA11y.mouseEntered,
- // })
-
- // if the slider is not visible on screen, it should not play
- if (swiper.enhancedA11y.visible === false) return stop()
-
- // if the user has manually stopped or started, always comply
- if (swiper.enhancedA11y.userRequestedAutoplay === true) return start()
- if (swiper.enhancedA11y.userRequestedAutoplay === false) return stop()
-
- // dont autoplay if autoplay was off at start
- if (!swiper.params.autoplay?.enabled) return stop()
-
- // if the user is currently interacting, pause playing
- if (swiper.enhancedA11y.focusIn || swiper.enhancedA11y.mouseEntered) return stop()
-
- // swiper is set to autoplay from start and user is not interacting, autoplay
- return start()
-
- function stop() {
- swiper.autoplay.stop()
- }
-
- function start() {
- swiper.autoplay.start()
- }
- },
-
- updateAutoplayIndicator() {
- const swiper = this
- const $el = swiper.enhancedA11y.$autoplayIndicatorEl
-
- if ($el) {
- const running = swiper.enhancedA11y.autoplayUserIsPlaying()
-
- const label = running ? 'Stop automatic slide show' : 'Start automatic slide show'
-
- $el
- .removeClass('is-pause-btn')
- .removeClass('is-play-btn')
- .addClass(running ? 'is-pause-btn' : 'is-play-btn')
- .attr('aria-label', label)
- .attr('title', label)
- }
- },
-
- autoplayUserIsPlaying() {
- const swiper = this
- return swiper.enhancedA11y.userRequestedAutoplay ?? !!swiper.params.autoplay?.enabled
- },
-
- userStartAutoplay() {
- const swiper = this
- swiper.enhancedA11y.userRequestedAutoplay = true
- swiper.enhancedA11y.updateAutoplay()
- swiper.emit('userAutoplayStart')
- },
-
- userStopAutoplay() {
- const swiper = this
- swiper.enhancedA11y.userRequestedAutoplay = false
- swiper.enhancedA11y.updateAutoplay()
- swiper.emit('userAutoplayStop')
- },
-
- userToggleAutoplay() {
- const swiper = this
- if (swiper.enhancedA11y.autoplayUserIsPlaying()) swiper.enhancedA11y.userStopAutoplay()
- else swiper.enhancedA11y.userStartAutoplay()
- },
-
- updateLiveAnnouncements() {
- const swiper = this
- swiper.$wrapperEl.attr('aria-live', swiper.autoplay.running ? 'off' : 'polite')
- },
-}
-
-const EnhancedA11y = {
- name: 'enhancedA11y',
- params: {
- enhancedA11y: {
- enabled: true,
- autoplayIndicatorEl: null,
- interactionPauseEl: null,
- },
- },
- create() {
- const swiper = this
-
- bindModuleMethods(swiper, {
- enhancedA11y: {
- ...moduleApi,
- focusIn: false,
- mouseEntered: false,
- userRequestedAutoplay: null,
- updateVisibilityDebounced: debounce(
- moduleApi.updateVisibility,
- // 60 fps
- 16.666,
- ),
- },
- })
-
- // Don't add a `disabled` attributed to disabled navigation buttons, use aria-disabled instead
- if (swiper.navigation) {
- swiper.navigation.toggleEl = ($el, disabled) => {
- $el[disabled ? 'addClass' : 'removeClass'](this.params.navigation.disabledClass)
- $el.attr('aria-disabled', (!!disabled).toString())
- }
- }
- },
- on: {
- afterInit(swiper) {
- if (!swiper.params.enhancedA11y.enabled) return
- swiper.enhancedA11y.init()
- },
- destroy(swiper) {
- if (!swiper.params.enhancedA11y.enabled) return
- swiper.enhancedA11y.destroy()
- },
- update(swiper) {
- if (!swiper.params.enhancedA11y.enabled) return
- swiper.enhancedA11y.updateSlides()
- swiper.enhancedA11y.updateVisibilityDebounced()
- },
- paginationUpdate(swiper) {
- if (!swiper.params.enhancedA11y.enabled) return
- swiper.enhancedA11y.updatePagination()
- },
- slideChange(swiper) {
- if (!swiper.params.enhancedA11y.enabled) return
- swiper.enhancedA11y.updateSlidesFocusTrap()
- },
- autoplayStart(swiper) {
- if (!swiper.params.enhancedA11y.enabled) return
- swiper.enhancedA11y.updateLiveAnnouncements()
- },
- autoplayStop(swiper) {
- if (!swiper.params.enhancedA11y.enabled) return
- swiper.enhancedA11y.updateLiveAnnouncements()
- },
- resize(swiper) {
- if (!swiper.params.enhancedA11y.enabled) return
- swiper.enhancedA11y.updateVisibilityDebounced()
- },
- },
-}
-
-export default EnhancedA11y
Index: web/app/themes/parklane/assets/js/shared/swiper/is-visible.js
===================================================================
diff --git a/web/app/themes/parklane/assets/js/shared/swiper/is-visible.js b/web/app/themes/parklane/assets/js/shared/swiper/is-visible.js
deleted file mode 100644
--- a/web/app/themes/parklane/assets/js/shared/swiper/is-visible.js (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ /dev/null (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
@@ -1,96 +0,0 @@
-// Taken from https://github.com/mozilla/fathom/blob/master/fathom/utilsForFrontend.mjs#L471
-/**
- * Return whether an element is practically visible, considering things like 0
- * size or opacity, ``visibility: hidden`` and ``overflow: hidden``.
- *
- * Merely being scrolled off the page in either horizontally or vertically
- * doesn't count as invisible; the result of this function is meant to be
- * independent of viewport size.
- *
- * @throws {Error} The element (or perhaps one of its ancestors) is not in a
- * window, so we can't find the `getComputedStyle()` routine to call. That
- * routine is the source of most of the information we use, so you should
- * pick a different strategy for non-window contexts.
- */
-export function isVisible(fnodeOrElement) {
- // This could be 5x more efficient if https://github.com/w3c/csswg-drafts/issues/4122 happens.
- const element = toDomElement(fnodeOrElement)
- const elementWindow = windowForElement(element)
- const elementRect = element.getBoundingClientRect()
- const elementStyle = elementWindow.getComputedStyle(element)
- // Alternative to reading ``display: none`` due to Bug 1381071.
- if (elementRect.width === 0 && elementRect.height === 0 && elementStyle.overflow !== 'hidden') {
- return false
- }
- if (elementStyle.visibility === 'hidden') {
- return false
- }
- // SW Note: this checks being off-viewport, which we dont really care about
- // Check if the element is irrevocably off-screen:
- // if (elementRect.x + elementRect.width < 0 || elementRect.y + elementRect.height < 0) {
- // return false
- // }
- for (const ancestor of ancestors(element)) {
- const isElement = ancestor === element
- const style = isElement ? elementStyle : elementWindow.getComputedStyle(ancestor)
- if (style.opacity === '0') {
- return false
- }
- if (style.display === 'contents') {
- // ``display: contents`` elements have no box themselves, but children are
- // still rendered.
- continue
- }
- const rect = isElement ? elementRect : ancestor.getBoundingClientRect()
- if ((rect.width === 0 || rect.height === 0) && elementStyle.overflow === 'hidden') {
- // Zero-sized ancestors donβt make descendants hidden unless the descendant
- // has ``overflow: hidden``.
- return false
- }
- }
- return true
-}
-
-function* ancestors(element) {
- yield element
- let parent
- while ((parent = element.parentNode) !== null && parent.nodeType === parent.ELEMENT_NODE) {
- yield parent
- element = parent
- }
-}
-
-/**
- * Return the DOM element contained in a passed-in fnode. Return passed-in DOM
- * elements verbatim.
- *
- * @arg fnodeOrElement {Node|Fnode}
- */
-function toDomElement(fnodeOrElement) {
- return isDomElement(fnodeOrElement) ? fnodeOrElement : fnodeOrElement.element
-}
-
-/**
- * @return whether a thing appears to be a DOM element.
- */
-function isDomElement(thing) {
- return thing.nodeName !== undefined
-}
-
-/*
- * Return the window an element is in.
- *
- * @throws {Error} There isn't such a window.
- */
-function windowForElement(element) {
- let doc = element.ownerDocument
- if (doc === null) {
- // The element itself was a document.
- doc = element
- }
- const win = doc.defaultView
- if (win === null) {
- throw new Error('The element was not in a window.')
- }
- return win
-}
Index: web/app/themes/parklane/assets/js/shared/swiper/swiper-modal-sync.js
===================================================================
diff --git a/web/app/themes/parklane/assets/js/shared/swiper/swiper-modal-sync.js b/web/app/themes/parklane/assets/js/shared/swiper/swiper-modal-sync.js
deleted file mode 100644
--- a/web/app/themes/parklane/assets/js/shared/swiper/swiper-modal-sync.js (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
+++ /dev/null (revision f64e4834b5ead9b251c118f2c2f12d9fd8f45828)
@@ -1,22 +0,0 @@
-export function swiperModalSync(bsModal, swiper) {
- const updateSwiper = () => {
- swiper.update()
- }
-
- let updateLoopFrameRequest
- const updateLoop = () => {
- updateSwiper()
- updateLoopFrameRequest = requestAnimationFrame(updateLoop)
- }
-
- bsModal.addEventListener('show.bs.modal', () => {
- updateLoop()
- })
-
- bsModal.addEventListener('shown.bs.modal', () => {
- updateSwiper()
- cancelAnimationFrame(updateLoopFrameRequest)
- })
-
- bsModal.addEventListener('hidden.bs.modal', updateSwiper)
-}
# 3 - Generate report
Add to the list of changes for plugins, composer and frontend, consider to add the deps only if they were major changes, for wordpress add the version. Consider also the following:
- Removed packages, use β
- New packages, use β
- Updates, use phrase Updated
from to
# Example:
Upded Wordpress Core to v5.9.2
Updated all plugins to their latest versions
Updated frontend dependencies
β @sideawaysnyc/classic-wp-webpack
β babel-slint
β @wearesideways/classic-wp-webpack
β prettier
Updated swiper from 5.6 to 7.8
Updated other minor versions
Updated composer dependencies
# 4 - Clean unused/outdated GIT branches in GitHub (and locally)
# Infra Updates
- Check error logs in CloudWatch and fix any warnings/errors
- Ensure hosting profile is on the latest version (PHP8 and Node 16)
- The PHP version has to be upgraded by upping the hosting "version" on Classic Infra for each client
- The node version is used just to compile dependencies, follow the patch below
- Test and ensure compatibility with the newest PHP/Node versions (PHP 8.1, Node 17 at the time of this writing)
- Write down in the README if the project is compatible or any issues were detected
- For an externally hosted project:
- Check Certification Expiry is greater than 6 months in the future
# Upgrading Node & PHP versions
Use the patch below to upgrade. It will have conflicts that you will need to resolve. Don't forget to update the lockfiles of npm and composer.
You can also only update Node/PHP independently, just selectively apply the changes that make sense for each language.
Follow this patch (taken from ParkLane)
Index: .github/workflows/code-checks.yml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/.github/workflows/code-checks.yml b/.github/workflows/code-checks.yml
--- a/.github/workflows/code-checks.yml (revision 04ca5e1b92d5be7dd5ad53f87823b6015028fcfa)
+++ b/.github/workflows/code-checks.yml (revision ed4c65f28a43bdcf1d3f75673bed8ffeb3095670)
@@ -35,7 +35,7 @@
- uses: php-actions/composer@v5
with:
- php_version: 7.4
- version: 1
+ php_version: 8
+ version: 2
- run: composer test
Index: README.md
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/README.md b/README.md
--- a/README.md (revision 04ca5e1b92d5be7dd5ad53f87823b6015028fcfa)
+++ b/README.md (revision df6c33627d1525faa03094f536e7b94ac96f8806)
@@ -2,9 +2,9 @@
## Requirements
-- PHP => 7.4
-- Composer 1.x
-- Node => 14
+- PHP => 8
+- Composer 2.x
+- Node => 16
## Installation
Index: buildspec.yml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/buildspec.yml b/buildspec.yml
--- a/buildspec.yml (revision 04ca5e1b92d5be7dd5ad53f87823b6015028fcfa)
+++ b/buildspec.yml (revision 5dde0a3e1bf3532484ca685a604f5d7aeeeb07c0)
@@ -3,14 +3,14 @@
phases:
install:
runtime-versions:
- php: 7.4
+ php: 8.0
nodejs: 14
commands:
- n 16
build:
commands:
- - composer install --no-progress --no-dev
+ - composer install --no-progress --no-dev --ignore-platform-req=php # remove when PHP runtime-version is updated to >= 8.0.2
- cd web/app/themes/parklane/
- echo "//npm.pkg.github.com/:_authToken=$SW_GITHUB_TOKEN" >> .npmrc
- npm ci
Index: .idea/parklane.iml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/.idea/parklane.iml b/.idea/parklane.iml
--- a/.idea/parklane.iml (revision 9be870cd91e9e27c2b6da0a8b3ef354dfd0b1d3b)
+++ b/.idea/parklane.iml (revision 0f8f4cf5e93af76a51b0822ec2a94c04cc8002fb)
@@ -25,10 +25,18 @@
<excludeFolder url="file://$MODULE_DIR$/web/app/settings" />
<excludeFolder url="file://$MODULE_DIR$/web/app/uploads" />
<excludeFolder url="file://$MODULE_DIR$/vendor/eftec/bladeone" />
- <excludeFolder url="file://$MODULE_DIR$/vendor/facebook/graph-sdk" />
<excludeFolder url="file://$MODULE_DIR$/vendor/aws/aws-crt-php" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/deprecation-contracts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-factory" />
+ <excludeFolder url="file://$MODULE_DIR$/vendor/clue/stream-filter" />
+ <excludeFolder url="file://$MODULE_DIR$/vendor/php-http/message" />
+ <excludeFolder url="file://$MODULE_DIR$/vendor/php-http/message-factory" />
+ <excludeFolder url="file://$MODULE_DIR$/vendor/php-http/promise" />
+ <excludeFolder url="file://$MODULE_DIR$/vendor/php-http/httplug" />
+ <excludeFolder url="file://$MODULE_DIR$/vendor/janu-software/facebook-php-sdk" />
+ <excludeFolder url="file://$MODULE_DIR$/vendor/php-http/discovery" />
+ <excludeFolder url="file://$MODULE_DIR$/vendor/thecodingmachine/safe" />
+ <excludeFolder url="file://$MODULE_DIR$/vendor/php-http/guzzle7-adapter" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
Index: .idea/php.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/.idea/php.xml b/.idea/php.xml
--- a/.idea/php.xml (revision 9be870cd91e9e27c2b6da0a8b3ef354dfd0b1d3b)
+++ b/.idea/php.xml (revision 0f8f4cf5e93af76a51b0822ec2a94c04cc8002fb)
@@ -31,7 +31,6 @@
<path value="$PROJECT_DIR$/vendor/eftec/bladeone" />
<path value="$PROJECT_DIR$/vendor/doctrine/inflector" />
<path value="$PROJECT_DIR$/vendor/symfony/yaml" />
- <path value="$PROJECT_DIR$/vendor/psr/container" />
<path value="$PROJECT_DIR$/vendor/psr/simple-cache" />
<path value="$PROJECT_DIR$/vendor/nesbot/carbon" />
<path value="$PROJECT_DIR$/vendor/symfony/finder" />
@@ -44,16 +43,23 @@
<path value="$PROJECT_DIR$/vendor/illuminate/contracts" />
<path value="$PROJECT_DIR$/vendor/illuminate/support" />
<path value="$PROJECT_DIR$/vendor/illuminate/events" />
- <path value="$PROJECT_DIR$/vendor/psr/log" />
<path value="$PROJECT_DIR$/vendor/symfony/debug" />
<path value="$PROJECT_DIR$/vendor/illuminate/config" />
- <path value="$PROJECT_DIR$/vendor/facebook/graph-sdk" />
<path value="$PROJECT_DIR$/vendor/aws/aws-crt-php" />
<path value="$PROJECT_DIR$/vendor/symfony/deprecation-contracts" />
<path value="$PROJECT_DIR$/vendor/psr/http-factory" />
+ <path value="$PROJECT_DIR$/vendor/clue/stream-filter" />
+ <path value="$PROJECT_DIR$/vendor/php-http/message" />
+ <path value="$PROJECT_DIR$/vendor/php-http/message-factory" />
+ <path value="$PROJECT_DIR$/vendor/php-http/promise" />
+ <path value="$PROJECT_DIR$/vendor/php-http/httplug" />
+ <path value="$PROJECT_DIR$/vendor/janu-software/facebook-php-sdk" />
+ <path value="$PROJECT_DIR$/vendor/php-http/discovery" />
+ <path value="$PROJECT_DIR$/vendor/thecodingmachine/safe" />
+ <path value="$PROJECT_DIR$/vendor/php-http/guzzle7-adapter" />
</include_path>
</component>
- <component name="PhpProjectSharedConfiguration" php_language_level="7.4">
+ <component name="PhpProjectSharedConfiguration" php_language_level="8.0">
<option name="suggestChangeDefaultLanguageLevel" value="false" />
</component>
<component name="PhpUnit">
Index: .platform/nginx/conf.d/elasticbeanstalk/00-wordpress.conf
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/.platform/nginx/conf.d/elasticbeanstalk/00-wordpress.conf b/.platform/nginx/conf.d/elasticbeanstalk/00-wordpress.conf
--- a/.platform/nginx/conf.d/elasticbeanstalk/00-wordpress.conf (revision 9be870cd91e9e27c2b6da0a8b3ef354dfd0b1d3b)
+++ b/.platform/nginx/conf.d/elasticbeanstalk/00-wordpress.conf (revision ed4c65f28a43bdcf1d3f75673bed8ffeb3095670)
@@ -1,3 +1,6 @@
+proxy_buffers 16 16k;
+proxy_buffer_size 16k;
+
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
Index: composer.json
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/composer.json b/composer.json
--- a/composer.json (revision 9be870cd91e9e27c2b6da0a8b3ef354dfd0b1d3b)
+++ b/composer.json (revision ed4c65f28a43bdcf1d3f75673bed8ffeb3095670)
@@ -22,15 +22,15 @@
"url": "https://connect.advancedcustomfields.com/index.php?p=pro&a=download&k=NjM2NjI2MjMyYTM1MWExM2I0MDk3NDUxYzZjNmM5MDIxMmYzYTU1NzdlMTU0MTYwMzc5YTM0"
},
"require": {
- "composer/installers": "^1.8"
+ "composer/installers": "^v2.0.1"
}
}
}
],
"require": {
- "php": ">=7.4",
+ "php": ">=8.0",
"ext-json": "*",
- "composer/installers": "^1.8",
+ "composer/installers": "^v2.0.1",
"vlucas/phpdotenv": "^5.2",
"oscarotero/env": "^2.1",
"roots/bedrock-autoloader": "^1.0",
@@ -48,9 +48,9 @@
"aws/aws-sdk-php": "^3.173",
"sidewaysnyc/sw-classic": "dev-master",
"wpackagist-plugin/safe-svg": "^1.9",
- "eftec/bladeone": "^3.51",
- "sidewaysnyc/sw-classic-ig": "^2.0.1",
- "wpackagist-plugin/taxonomy-terms-order": "1.5.7.6",
+ "eftec/bladeone": "^4.4.2",
+ "sidewaysnyc/sw-classic-ig": "^3.0.0",
+ "wpackagist-plugin/taxonomy-terms-order": "^1.6",
"wpackagist-plugin/regenerate-thumbnails": "^3.1"
},
"require-dev": {
Index: web/app/themes/parklane/.babelrc
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/.babelrc b/web/app/themes/parklane/.babelrc
--- a/web/app/themes/parklane/.babelrc (revision ca5c9cfbd3fd066f4a5dbd8065e0ccc48ebffbee)
+++ b/web/app/themes/parklane/.babelrc (revision 1a3f6d6c4e16e516a2bcb24821cdd246710a0a12)
@@ -1,15 +1,3 @@
{
- "presets": [
- [
- "@babel/preset-env"
- ],
- "@babel/preset-react"
- ],
- "env": {
- "production": {
- "plugins": [
- "transform-react-remove-prop-types"
- ]
- }
- }
+ "presets": ["@babel/preset-react"]
}
Index: web/app/themes/parklane/.eslintrc
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/.eslintrc b/web/app/themes/parklane/.eslintrc
--- a/web/app/themes/parklane/.eslintrc (revision ca5c9cfbd3fd066f4a5dbd8065e0ccc48ebffbee)
+++ b/web/app/themes/parklane/.eslintrc (revision 1a3f6d6c4e16e516a2bcb24821cdd246710a0a12)
@@ -3,10 +3,11 @@
"eslint:recommended",
"react-app",
"plugin:jsx-a11y/recommended",
- "plugin:prettier/recommended",
- "prettier"
+ "plugin:prettier/recommended"
],
- "plugins": ["jsx-a11y"],
+ "plugins": [
+ "jsx-a11y"
+ ],
"env": {
"es6": true,
"node": true,
Index: web/app/themes/parklane/package.json
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/web/app/themes/parklane/package.json b/web/app/themes/parklane/package.json
--- a/web/app/themes/parklane/package.json (revision ca5c9cfbd3fd066f4a5dbd8065e0ccc48ebffbee)
+++ b/web/app/themes/parklane/package.json (revision 1a3f6d6c4e16e516a2bcb24821cdd246710a0a12)
@@ -33,25 +33,16 @@
"react-dates": "^21.8.0",
"react-dom": "^16.14.0",
"react-outside-click-handler": "^1.3.0",
- "smoothscroll-polyfill": "^0.4.4",
"swiper": "^8.0.7",
"wicg-inert": "^3.1.1"
},
"devDependencies": {
- "@babel/eslint-parser": "^7.17.0",
- "@babel/preset-react": "^7.16.7",
- "@sidewaysnyc/classic-wp-webpack": "^3.0.1",
+ "@wearesideways/classic-wp-webpack": "^3.0.4",
"@wemake-services/stylelint-config-scss": "^1.0.0",
- "babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"eslint": "^8.10.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-react-app": "^7.0.0",
- "eslint-plugin-import": "^2.25.4",
- "eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^4.0.0",
- "eslint-plugin-react": "^7.29.3",
- "eslint-plugin-react-hooks": "^4.3.0",
- "postcss": "^8.4.8",
"prettier": "^2.5.1",
"stylelint": "^14.5.3",
"stylelint-config-prettier": "^9.0.3"
Make sure to remove all the unused dependencies like ESLint plugins, babel transformers. These are already included and managed with packages like preset-react-app among others.