Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
6900c228
Commit
6900c228
authored
Feb 24, 2022
by
Kostas Ioannou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add audio blob viewer
parent
93a0a6a4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
0 deletions
+44
-0
app/assets/javascripts/repository/components/blob_viewers/audio_viewer.vue
...ripts/repository/components/blob_viewers/audio_viewer.vue
+20
-0
app/assets/javascripts/repository/components/blob_viewers/index.js
...s/javascripts/repository/components/blob_viewers/index.js
+1
-0
spec/frontend/repository/components/blob_viewers/audio_viewer_spec.js
...d/repository/components/blob_viewers/audio_viewer_spec.js
+23
-0
No files found.
app/assets/javascripts/repository/components/blob_viewers/audio_viewer.vue
0 → 100644
View file @
6900c228
<
script
>
export
default
{
props
:
{
blob
:
{
type
:
Object
,
required
:
true
,
},
},
data
()
{
return
{
src
:
this
.
blob
.
rawPath
,
};
},
};
</
script
>
<
template
>
<div
class=
"gl-text-center gl-p-7"
>
<audio
:src=
"src"
controls
data-testid=
"audio"
></audio>
</div>
</
template
>
app/assets/javascripts/repository/components/blob_viewers/index.js
View file @
6900c228
...
...
@@ -6,6 +6,7 @@ const viewers = {
text
:
()
=>
import
(
'
~/vue_shared/components/source_viewer/source_viewer.vue
'
),
pdf
:
()
=>
import
(
'
./pdf_viewer.vue
'
),
lfs
:
()
=>
import
(
'
./lfs_viewer.vue
'
),
audio
:
()
=>
import
(
'
./audio_viewer.vue
'
),
};
export
const
loadViewer
=
(
type
,
isUsingLfs
)
=>
{
...
...
spec/frontend/repository/components/blob_viewers/audio_viewer_spec.js
0 → 100644
View file @
6900c228
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
AudioViewer
from
'
~/repository/components/blob_viewers/audio_viewer.vue
'
;
describe
(
'
Audio Viewer
'
,
()
=>
{
let
wrapper
;
const
DEFAULT_BLOB_DATA
=
{
rawPath
:
'
some/audio.mid
'
,
};
const
createComponent
=
()
=>
{
wrapper
=
shallowMount
(
AudioViewer
,
{
propsData
:
{
blob
:
DEFAULT_BLOB_DATA
}
});
};
const
findImage
=
()
=>
wrapper
.
find
(
'
[data-testid="audio"]
'
);
it
(
'
renders an audio source component
'
,
()
=>
{
createComponent
();
expect
(
findImage
().
exists
()).
toBe
(
true
);
expect
(
findImage
().
attributes
(
'
src
'
)).
toBe
(
DEFAULT_BLOB_DATA
.
rawPath
);
});
});
Write
Preview
Markdown
is supported
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