From 172733106f9406d4caf9f7265d69b59b7a05c393 Mon Sep 17 00:00:00 2001 From: Yannick Schaus Date: Wed, 26 Sep 2018 02:23:38 +0200 Subject: [PATCH] Manifest precaching, SW in dev mode, UI fixes Card deck filters: menu was not always appearing in Firefox Use a web app manifest in statics to precache (prevent asking for credentials) JSON Editor in card designer was broken Fix suggestion chip at start of chat (also it is now dynamic) Make the SW work again in dev mode Consider all colored cards dark (temp. fix for https://github.com/quasarframework/quasar/issues/2546#issuecomment-420980689, should/will add an option) Signed-off-by: Yannick Schaus --- web/quasar.conf.js | 35 ++++++++++++------------ web/src/components/HbCard.vue | 2 +- web/src/index.template.html | 5 ++-- web/src/layouts/designer/JsonEditor.vue | 4 +-- web/src/pages/CardDeck.vue | 24 +++++------------ web/src/pages/Chat.vue | 14 ++++++---- web/src/statics/manifest.json | 36 +++++++++++++++++++++++++ 7 files changed, 74 insertions(+), 46 deletions(-) create mode 100644 web/src/statics/manifest.json diff --git a/web/quasar.conf.js b/web/quasar.conf.js index 0fd3a06..fc4e29e 100644 --- a/web/quasar.conf.js +++ b/web/quasar.conf.js @@ -25,25 +25,26 @@ module.exports = function (ctx) { // extractCSS: false, // useNotifier: false, chainWebpack (chain, { isServer, isClient }) { - chain.plugin('manifest-crossorigin').use(class ManifestCrossoriginPlugin { - apply (compiler) { - compiler.hooks.compilation.tap('webpack-plugin-manifest-crossorigin', compilation => { - compilation.hooks.htmlWebpackPluginAlterAssetTags.tapAsync('webpack-plugin-manifest-crossorigin', (data, callback) => { - if (data.head) { - for (let tag of data.head) { - // console.log('adding crossorigin to ' + JSON.stringify(tag)) - if (tag.tagName === 'link' && tag.attributes.rel === 'manifest') { - tag.attributes.crossorigin = 'use-credentials' - // console.log('done!' + JSON.stringify(tag)) + if (!ctx.dev) { + chain.plugin('manifest-crossorigin').use(class ManifestCrossoriginPlugin { + apply (compiler) { + compiler.hooks.compilation.tap('webpack-plugin-manifest-crossorigin', compilation => { + compilation.hooks.htmlWebpackPluginAlterAssetTags.tapAsync('webpack-plugin-manifest-crossorigin', (data, callback) => { + if (data.head) { + for (let tag of data.head) { + if (tag.tagName === 'link' && tag.attributes.rel === 'manifest') { + tag.attributes.crossorigin = 'use-credentials' + tag.attributes.href = '/habot/statics/manifest.json' + } } } - } - // finally, inform Webpack that we're ready - callback(null, data) + // finally, inform Webpack that we're ready + callback(null, data) + }) }) - }) - } - }, []) + } + }, []) + } }, extendWebpack (cfg) { cfg.module.rules.push({ @@ -188,7 +189,7 @@ module.exports = function (ctx) { ], pwa: { workboxPluginMode: 'InjectManifest', - workboxOptions: { + workboxOptions: (ctx.dev) ? {} : { importWorkboxFrom: 'local' }, manifest: { diff --git a/web/src/components/HbCard.vue b/web/src/components/HbCard.vue index 2199e89..4b20285 100644 --- a/web/src/components/HbCard.vue +++ b/web/src/components/HbCard.vue @@ -1,5 +1,5 @@