diff --git a/assets/src/installation-status_controller.js b/assets/src/installation-status_controller.js deleted file mode 100644 index dc180d6..0000000 --- a/assets/src/installation-status_controller.js +++ /dev/null @@ -1,54 +0,0 @@ -'use strict'; - -import { Controller } from '@hotwired/stimulus'; - -/* stimulusFetch: 'lazy' */ -export default class extends Controller { - static targets = ['message', 'attribute']; - static values = { - installedMessage: { type: String, default: 'The application is installed' }, - notInstalledMessage: { type: String, default: 'The application is not installed' }, - }; - - connect = () => { - console.log(window.matchMedia('(display-mode: standalone)').matches) - this.dispatchEvent('connect', {}); - if (navigator.onLine) { - this.statusChanged({ - status: 'ONLINE', - message: this.onlineMessageValue, - }); - } else { - this.statusChanged({ - status: 'OFFLINE', - message: this.offlineMessageValue, - }); - } - - window.addEventListener('online', () => { - this.statusChanged({ - status: 'ONLINE', - message: this.onlineMessageValue, - }); - }); - window.addEventListener('offline', () => { - this.statusChanged({ - status: 'OFFLINE', - message: this.offlineMessageValue, - }); - }); - } - dispatchEvent = (name, payload) => { - this.dispatch(name, { detail: payload, prefix: 'connection-status' }); - } - - statusChanged = (data) => { - this.messageTargets.forEach((element) => { - element.innerHTML = data.message; - }); - this.attributeTargets.forEach((element) => { - element.setAttribute('data-connection-status', data.status); - }); - this.dispatchEvent('status-changed', { detail: data }); - } -} diff --git a/src/Command/ListCacheStrategiesCommand.php b/src/Command/ListCacheStrategiesCommand.php index 6f79a29..2bf853f 100644 --- a/src/Command/ListCacheStrategiesCommand.php +++ b/src/Command/ListCacheStrategiesCommand.php @@ -42,7 +42,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $strategy->urlPattern, $strategy->enabled ? 'Yes' : 'No', $strategy->requireWorkbox ? 'Yes' : 'No', - '', //Yaml::dump($strategy->options), + Yaml::dump($strategy->options), ]); } } diff --git a/tests/config.php b/tests/config.php index 8987d1f..071237f 100644 --- a/tests/config.php +++ b/tests/config.php @@ -226,8 +226,14 @@ 'scope' => '/', 'use_cache' => true, 'workbox' => [ - 'page_cache' => [ - 'urls' => ['privacy_policy', 'terms_of_service'], + 'page_caches' => [ + [ + 'regex' => '.*', + 'strategy' => 'staleWhileRevalidate', + 'cache_name' => 'page-cache', + 'broadcast' => true, + 'urls' => ['privacy_policy', 'terms_of_service'], + ], ], 'offline_fallback' => [ 'page' => '/offline.html',