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
22993786
Commit
22993786
authored
Aug 03, 2021
by
Samantha Ming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide copy and raw buttons in blob header
Issue:
https://gitlab.com/gitlab-org/gitlab/-/issues/335776
parent
858320c2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
8 deletions
+19
-8
app/assets/javascripts/repository/components/blob_content_viewer.vue
...javascripts/repository/components/blob_content_viewer.vue
+4
-1
spec/frontend/repository/components/blob_content_viewer_spec.js
...rontend/repository/components/blob_content_viewer_spec.js
+15
-7
No files found.
app/assets/javascripts/repository/components/blob_content_viewer.vue
View file @
22993786
...
@@ -116,6 +116,9 @@ export default {
...
@@ -116,6 +116,9 @@ export default {
isLoading
()
{
isLoading
()
{
return
this
.
$apollo
.
queries
.
project
.
loading
||
this
.
isLoadingLegacyViewer
;
return
this
.
$apollo
.
queries
.
project
.
loading
||
this
.
isLoadingLegacyViewer
;
},
},
isBinaryFileType
()
{
return
this
.
isBinary
||
this
.
viewer
.
fileType
===
'
download
'
;
},
blobInfo
()
{
blobInfo
()
{
const
nodes
=
this
.
project
?.
repository
?.
blobs
?.
nodes
;
const
nodes
=
this
.
project
?.
repository
?.
blobs
?.
nodes
;
...
@@ -169,7 +172,7 @@ export default {
...
@@ -169,7 +172,7 @@ export default {
<blob-header
<blob-header
:blob=
"blobInfo"
:blob=
"blobInfo"
:hide-viewer-switcher=
"!hasRichViewer || isBinary"
:hide-viewer-switcher=
"!hasRichViewer || isBinary"
:is-binary=
"isBinary"
:is-binary=
"isBinary
FileType
"
:active-viewer-type=
"viewer.type"
:active-viewer-type=
"viewer.type"
:has-render-error=
"hasRenderError"
:has-render-error=
"hasRenderError"
@
viewer-changed=
"switchViewer"
@
viewer-changed=
"switchViewer"
...
...
spec/frontend/repository/components/blob_content_viewer_spec.js
View file @
22993786
...
@@ -349,15 +349,23 @@ describe('Blob content viewer component', () => {
...
@@ -349,15 +349,23 @@ describe('Blob content viewer component', () => {
});
});
});
});
it
(
'
passes the correct isBinary value to blob header when viewing a binary file
'
,
async
()
=>
{
describe
(
'
blob header binary file
'
,
()
=>
{
it
.
each
([
richMockData
,
{
simpleViewer
:
{
fileType
:
'
download
'
}
}])(
'
passes the correct isBinary value when viewing a binary file
'
,
async
(
blobInfo
)
=>
{
fullFactory
({
fullFactory
({
mockData
:
{
blobInfo
:
richMockData
,
isBinary
:
true
},
mockData
:
{
blobInfo
,
isBinary
:
true
,
},
stubs
:
{
BlobContent
:
true
,
BlobReplace
:
true
},
stubs
:
{
BlobContent
:
true
,
BlobReplace
:
true
},
});
});
await
nextTick
();
await
nextTick
();
expect
(
findBlobHeader
().
props
(
'
isBinary
'
)).
toBe
(
true
);
expect
(
findBlobHeader
().
props
(
'
isBinary
'
)).
toBe
(
true
);
},
);
});
});
describe
(
'
BlobButtonGroup
'
,
()
=>
{
describe
(
'
BlobButtonGroup
'
,
()
=>
{
...
...
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