Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Philipp Wolfer
funkwhale
Commits
b05bfee2
Commit
b05bfee2
authored
Oct 03, 2021
by
Marcos Peña
Committed by
Georg Krause
Oct 03, 2021
Browse files
Fix moderation interface when missing album cover
parent
31c0b91b
Pipeline
#16661
passed with stages
in 12 minutes and 19 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
changes/changelog.d/1474.bugfix
0 → 100644
View file @
b05bfee2
Fixes crash in album moderation interface when missing cover (#1474)
front/src/views/admin/library/AlbumDetail.vue
View file @
b05bfee2
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<div
class=
"ui column"
>
<div
class=
"ui column"
>
<div
class=
"segment-content"
>
<div
class=
"segment-content"
>
<h2
class=
"ui header"
>
<h2
class=
"ui header"
>
<img
alt=
""
v-if=
"object.cover.urls.original"
v-lazy=
"$store.getters['instance/absoluteUrl'](object.cover.urls.medium_square_crop)"
>
<img
alt=
""
v-if=
"object.cover
&& object.cover
.urls.original"
v-lazy=
"$store.getters['instance/absoluteUrl'](object.cover.urls.medium_square_crop)"
>
<img
alt=
""
v-else
src=
"../../../assets/audio/default-cover.png"
>
<img
alt=
""
v-else
src=
"../../../assets/audio/default-cover.png"
>
<div
class=
"content"
>
<div
class=
"content"
>
{{
object
.
title
|
truncate
(
100
)
}}
{{
object
.
title
|
truncate
(
100
)
}}
...
...
front/tests/unit/specs/views/admin/library.spec.js
0 → 100644
View file @
b05bfee2
const
sinon
=
require
(
'
sinon
'
)
import
{
expect
}
from
'
chai
'
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
import
AlbumDetail
from
'
@/views/admin/library/AlbumDetail.vue
'
import
GetTextPlugin
from
'
vue-gettext
'
import
HumanDate
from
'
@/components/common/HumanDate.vue
'
import
DangerousButton
from
'
@/components/common/DangerousButton.vue
'
describe
(
'
views/admin/library
'
,
()
=>
{
let
wrapper
let
sandbox
beforeEach
(()
=>
{
sandbox
=
sinon
.
createSandbox
()
})
afterEach
(()
=>
{
sandbox
.
restore
()
})
describe
(
'
Album details
'
,
()
=>
{
it
(
'
displays default cover
'
,
async
()
=>
{
const
album
=
{
cover
:
null
,
artist
:
{
id
:
null
},
title
:
"
dummy
"
}
const
localVue
=
createLocalVue
()
localVue
.
directive
(
'
title
'
,
(()
=>
null
))
localVue
.
directive
(
'
dropdown
'
,
(()
=>
null
))
localVue
.
use
(
GetTextPlugin
,
{
translations
:
{}
})
// overrides axios calls
sandbox
.
stub
(
AlbumDetail
.
methods
,
"
fetchData
"
).
callsFake
(()
=>
null
)
sandbox
.
stub
(
AlbumDetail
.
methods
,
"
fetchStats
"
).
callsFake
(()
=>
null
)
wrapper
=
shallowMount
(
AlbumDetail
,
{
localVue
,
data
()
{
return
{
isLoading
:
false
,
isLoadingStats
:
false
,
object
:
album
,
stats
:
[],
}
},
mocks
:
{
$store
:
{
state
:
{
auth
:
{
profile
:
null
},
ui
:
{
lastDate
:
null
}
}
}
},
stubs
:
{
'
human-date
'
:
HumanDate
,
'
dangerous-button
'
:
DangerousButton
},
computed
:
{
labels
:
()
=>
{
return
{
statsWarning
:
null
}
}
}
})
expect
(
wrapper
.
find
(
'
img
'
).
attributes
(
'
src
'
)).
to
.
include
(
"
default-cover
"
)
})
})
})
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment