Merge branch 'frontend-fixes-2' into 'develop'
Frontend fixes 2 See merge request funkwhale/funkwhale!1039
This commit is contained in:
commit
2d2813e843
|
@ -1,5 +1,5 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
presets: [
|
presets: [
|
||||||
'@vue/app'
|
'@vue/cli-plugin-babel/preset'
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^0.18.0",
|
"axios": "^0.18.0",
|
||||||
|
"core-js": "^3.6.4",
|
||||||
"diff": "^4.0.1",
|
"diff": "^4.0.1",
|
||||||
"django-channels": "^1.1.6",
|
"django-channels": "^1.1.6",
|
||||||
"fomantic-ui-css": "^2.8.3",
|
"fomantic-ui-css": "^2.8.3",
|
||||||
|
@ -40,22 +41,25 @@
|
||||||
"vuex-router-sync": "^5.0.0"
|
"vuex-router-sync": "^5.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vue/cli-plugin-babel": "^3.0.0",
|
"@vue/cli-plugin-babel": "~4.2.2",
|
||||||
"@vue/cli-plugin-eslint": "^3.0.0",
|
"@vue/cli-plugin-eslint": "~4.2.2",
|
||||||
"@vue/cli-plugin-pwa": "^4.1.2",
|
"@vue/cli-plugin-pwa": "~4.2.2",
|
||||||
"@vue/cli-plugin-unit-mocha": "^3.0.0",
|
"@vue/cli-plugin-unit-mocha": "~4.2.2",
|
||||||
"@vue/cli-service": "^3.0.0",
|
"@vue/cli-service": "~4.2.2",
|
||||||
"@vue/test-utils": "^1.0.0-beta.20",
|
"@vue/test-utils": "^1.0.0-beta.20",
|
||||||
|
"babel-eslint": "^10.0.3",
|
||||||
"chai": "^4.1.2",
|
"chai": "^4.1.2",
|
||||||
"easygettext": "^2.6.3",
|
"easygettext": "^2.6.3",
|
||||||
|
"eslint": "^5.16.0",
|
||||||
"eslint-plugin-html": "^4.0.5",
|
"eslint-plugin-html": "^4.0.5",
|
||||||
|
"eslint-plugin-vue": "^6.1.2",
|
||||||
"glob-all": "^3.1.0",
|
"glob-all": "^3.1.0",
|
||||||
"mocha": "^5.2.0",
|
"mocha": "^5.2.0",
|
||||||
"moxios": "^0.4.0",
|
"moxios": "^0.4.0",
|
||||||
"node-sass": "^4.9.3",
|
"node-sass": "^4.9.3",
|
||||||
"preload-webpack-plugin": "^3.0.0-beta.4",
|
"preload-webpack-plugin": "^3.0.0-beta.4",
|
||||||
"purgecss-webpack-plugin": "^1.6.0",
|
"purgecss-webpack-plugin": "^1.6.0",
|
||||||
"sass-loader": "^7.1.0",
|
"sass-loader": "^8.0.2",
|
||||||
"sinon": "^6.1.5",
|
"sinon": "^6.1.5",
|
||||||
"vue-template-compiler": "^2.5.17",
|
"vue-template-compiler": "^2.5.17",
|
||||||
"webpack-bundle-size-analyzer": "^3.0.0"
|
"webpack-bundle-size-analyzer": "^3.0.0"
|
||||||
|
|
|
@ -11,16 +11,7 @@
|
||||||
<template>
|
<template>
|
||||||
<sidebar></sidebar>
|
<sidebar></sidebar>
|
||||||
<set-instance-modal @update:show="showSetInstanceModal = $event" :show="showSetInstanceModal"></set-instance-modal>
|
<set-instance-modal @update:show="showSetInstanceModal = $event" :show="showSetInstanceModal"></set-instance-modal>
|
||||||
<service-messages>
|
<service-messages></service-messages>
|
||||||
<message key="refreshApp" class="large info" v-if="serviceWorker.updateAvailable">
|
|
||||||
<p>
|
|
||||||
<translate translate-context="App/Message/Paragraph">A new version of the app is available.</translate>
|
|
||||||
</p>
|
|
||||||
<button class="ui basic button" @click.stop="updateApp">
|
|
||||||
<translate translate-context="App/Message/Button">Update</translate>
|
|
||||||
</button>
|
|
||||||
</message>
|
|
||||||
</service-messages>
|
|
||||||
<transition name="queue">
|
<transition name="queue">
|
||||||
<queue @touch-progress="$refs.player.setCurrentTime($event)" v-if="$store.state.ui.queueFocused"></queue>
|
<queue @touch-progress="$refs.player.setCurrentTime($event)" v-if="$store.state.ui.queueFocused"></queue>
|
||||||
</transition>
|
</transition>
|
||||||
|
@ -263,6 +254,7 @@ export default {
|
||||||
parts.push(this.$store.state.instance.settings.instance.name.value || 'Funkwhale')
|
parts.push(this.$store.state.instance.settings.instance.name.value || 'Funkwhale')
|
||||||
document.title = parts.join(' – ')
|
document.title = parts.join(' – ')
|
||||||
},
|
},
|
||||||
|
|
||||||
updateApp () {
|
updateApp () {
|
||||||
this.$store.commit('ui/serviceWorker', {updateAvailable: false})
|
this.$store.commit('ui/serviceWorker', {updateAvailable: false})
|
||||||
if (!this.serviceWorker.registration || !this.serviceWorker.registration.waiting) { return; }
|
if (!this.serviceWorker.registration || !this.serviceWorker.registration.waiting) { return; }
|
||||||
|
@ -343,6 +335,11 @@ export default {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
handler(newValue) {
|
handler(newValue) {
|
||||||
let self = this
|
let self = this
|
||||||
|
if (newValue === 'en_US') {
|
||||||
|
self.$language.current = 'noop'
|
||||||
|
self.$language.current = newValue
|
||||||
|
return self.$store.commit('ui/momentLocale', 'en')
|
||||||
|
}
|
||||||
import(/* webpackChunkName: "locale-[request]" */ `./translations/${newValue}.json`).then((response) =>{
|
import(/* webpackChunkName: "locale-[request]" */ `./translations/${newValue}.json`).then((response) =>{
|
||||||
Vue.$translations[newValue] = response.default[newValue]
|
Vue.$translations[newValue] = response.default[newValue]
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
|
@ -351,9 +348,6 @@ export default {
|
||||||
self.$language.current = 'noop'
|
self.$language.current = 'noop'
|
||||||
self.$language.current = newValue
|
self.$language.current = newValue
|
||||||
})
|
})
|
||||||
if (newValue === 'en_US') {
|
|
||||||
return self.$store.commit('ui/momentLocale', 'en')
|
|
||||||
}
|
|
||||||
let momentLocale = newValue.replace('_', '-').toLowerCase()
|
let momentLocale = newValue.replace('_', '-').toLowerCase()
|
||||||
import(/* webpackChunkName: "moment-locale-[request]" */ `moment/locale/${momentLocale}.js`).then(() => {
|
import(/* webpackChunkName: "moment-locale-[request]" */ `moment/locale/${momentLocale}.js`).then(() => {
|
||||||
self.$store.commit('ui/momentLocale', momentLocale)
|
self.$store.commit('ui/momentLocale', momentLocale)
|
||||||
|
@ -380,6 +374,35 @@ export default {
|
||||||
this.updateDocumentTitle()
|
this.updateDocumentTitle()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
'serviceWorker.updateAvailable': {
|
||||||
|
handler (v) {
|
||||||
|
if (!v) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let self = this
|
||||||
|
this.$store.commit('ui/addMessage', {
|
||||||
|
content: this.$pgettext("App/Message/Paragraph", "A new version of the app is available."),
|
||||||
|
date: new Date(),
|
||||||
|
key: 'refreshApp',
|
||||||
|
displayTime: 0,
|
||||||
|
classActions: 'bottom attached',
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
text: this.$pgettext("App/Message/Paragraph", "Update"),
|
||||||
|
class: "primary",
|
||||||
|
click: function () {
|
||||||
|
self.updateApp()
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: this.$pgettext("App/Message/Paragraph", "Later"),
|
||||||
|
class: "basic",
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
},
|
||||||
|
immediate: true,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -71,7 +71,7 @@ export default {
|
||||||
},
|
},
|
||||||
onResponse: function (initialResponse) {
|
onResponse: function (initialResponse) {
|
||||||
let results = {}
|
let results = {}
|
||||||
let isEmptyResults = true
|
let isEmptyResults = true
|
||||||
let categories = [
|
let categories = [
|
||||||
{
|
{
|
||||||
code: 'artists',
|
code: 'artists',
|
||||||
|
@ -140,7 +140,7 @@ export default {
|
||||||
results: []
|
results: []
|
||||||
}
|
}
|
||||||
initialResponse[category.code].forEach(result => {
|
initialResponse[category.code].forEach(result => {
|
||||||
isEmptyResults = false
|
isEmptyResults = false
|
||||||
let id = category.getId(result)
|
let id = category.getId(result)
|
||||||
results[category.code].results.push({
|
results[category.code].results.push({
|
||||||
title: category.getTitle(result),
|
title: category.getTitle(result),
|
||||||
|
@ -156,8 +156,8 @@ export default {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
return {
|
return {
|
||||||
results: isEmptyResults ? {} : results
|
results: isEmptyResults ? {} : results
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
url: this.$store.getters['instance/absoluteUrl']('api/v1/search?query={query}')
|
url: this.$store.getters['instance/absoluteUrl']('api/v1/search?query={query}')
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
<div v-if="isLoading" class="ui inverted active dimmer">
|
<div v-if="isLoading" class="ui inverted active dimmer">
|
||||||
<div class="ui loader"></div>
|
<div class="ui loader"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ui hidden divider"></div>
|
|
||||||
<div v-if="playlistsExist" class="ui cards app-cards">
|
<div v-if="playlistsExist" class="ui cards app-cards">
|
||||||
<playlist-card v-for="playlist in objects" :key="playlist.id" :playlist="playlist"></playlist-card>
|
<playlist-card v-for="playlist in objects" :key="playlist.id" :playlist="playlist"></playlist-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -33,7 +33,7 @@ export default new Router({
|
||||||
path: "/front",
|
path: "/front",
|
||||||
name: "front",
|
name: "front",
|
||||||
redirect: to => {
|
redirect: to => {
|
||||||
const { hash, params, query } = to
|
const { hash, query } = to
|
||||||
return { name: 'index', hash, query }
|
return { name: 'index', hash, query }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -190,6 +190,10 @@ export default {
|
||||||
key: String(new Date()),
|
key: String(new Date()),
|
||||||
...message,
|
...message,
|
||||||
}
|
}
|
||||||
|
let key = finalMessage.key
|
||||||
|
state.messages = state.messages.filter((m) => {
|
||||||
|
return m.key != key
|
||||||
|
})
|
||||||
state.messages.push(finalMessage)
|
state.messages.push(finalMessage)
|
||||||
if (state.messages.length > state.maxMessages) {
|
if (state.messages.length > state.maxMessages) {
|
||||||
state.messages.shift()
|
state.messages.shift()
|
||||||
|
|
|
@ -504,7 +504,7 @@ input + .help {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-bottom: -1px;
|
margin-bottom: -1px;
|
||||||
.button {
|
.button {
|
||||||
position: absolute;
|
position: absolute !important;
|
||||||
bottom: 0.5em;
|
bottom: 0.5em;
|
||||||
right: 0.5em;
|
right: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,7 +159,7 @@ describe('store/auth', () => {
|
||||||
payload: {credentials: credentials, onError: spy}
|
payload: {credentials: credentials, onError: spy}
|
||||||
}, () => {
|
}, () => {
|
||||||
expect(spy.calledOnce).to.equal(true)
|
expect(spy.calledOnce).to.equal(true)
|
||||||
done()
|
done() // eslint-disable-line no-undef
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
it('fetchProfile', () => {
|
it('fetchProfile', () => {
|
||||||
|
|
|
@ -26,12 +26,12 @@ plugins.push(
|
||||||
path.join(__dirname, './src/**/*.js')
|
path.join(__dirname, './src/**/*.js')
|
||||||
]),
|
]),
|
||||||
whitelist: ['scale'],
|
whitelist: ['scale'],
|
||||||
whitelistPatterns:[/plyr/],
|
whitelistPatterns: [/plyr/, /toast/],
|
||||||
whitelistPatternsChildren:[/plyr/,/dropdown/,/upward/]
|
whitelistPatternsChildren: [/plyr/, /dropdown/, /upward/]
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
module.exports = {
|
module.exports = {
|
||||||
baseUrl: baseUrl,
|
publicPath: baseUrl,
|
||||||
productionSourceMap: false,
|
productionSourceMap: false,
|
||||||
// Add settings for manifest file
|
// Add settings for manifest file
|
||||||
pwa: {
|
pwa: {
|
||||||
|
@ -94,10 +94,15 @@ module.exports = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
chainWebpack: config => {
|
chainWebpack: config => {
|
||||||
config.plugins.delete('prefetch-embed')
|
// config.plugins.delete('prefetch-embed')
|
||||||
config.plugins.delete('preload-embed')
|
// config.plugins.delete('preload-embed')
|
||||||
config.plugins.delete('prefetch-index')
|
// config.plugins.delete('prefetch-index')
|
||||||
|
// TODO: Remove this workaround once https://github.com/vuejs/vue-cli/issues/2463 is fixed
|
||||||
|
// Remove preload plugins for multi-page build to prevent infinite recursion
|
||||||
|
['embed', 'index'].forEach(page => {
|
||||||
|
config.plugins.delete(`preload-${page}`)
|
||||||
|
config.plugins.delete(`prefetch-${page}`)
|
||||||
|
})
|
||||||
// needed to avoid having big dependedncies included in our lightweight
|
// needed to avoid having big dependedncies included in our lightweight
|
||||||
// embed.html, cf https://github.com/vuejs/vue-cli/issues/2381
|
// embed.html, cf https://github.com/vuejs/vue-cli/issues/2381
|
||||||
const options = module.exports
|
const options = module.exports
|
||||||
|
|
4076
front/yarn.lock
4076
front/yarn.lock
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue