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
1ed3a5a8
Commit
1ed3a5a8
authored
Jul 23, 2020
by
Valerie Karnes
Committed by
Ezekiel Kigbo
Jul 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update viewer switcher button icon
parent
9904a007
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
28 deletions
+31
-28
app/assets/javascripts/blob/components/blob_header.vue
app/assets/javascripts/blob/components/blob_header.vue
+1
-1
app/assets/javascripts/blob/components/blob_header_default_actions.vue
...vascripts/blob/components/blob_header_default_actions.vue
+17
-15
app/assets/javascripts/blob/components/blob_header_viewer_switcher.vue
...vascripts/blob/components/blob_header_viewer_switcher.vue
+9
-8
spec/frontend/blob/components/__snapshots__/blob_header_spec.js.snap
...nd/blob/components/__snapshots__/blob_header_spec.js.snap
+1
-1
spec/frontend/blob/components/blob_header_default_actions_spec.js
...ntend/blob/components/blob_header_default_actions_spec.js
+3
-3
No files found.
app/assets/javascripts/blob/components/blob_header.vue
View file @
1ed3a5a8
...
...
@@ -71,7 +71,7 @@ export default {
</
template
>
</blob-filepath>
<div
class=
"
file-actions d-none d
-sm-flex"
>
<div
class=
"
gl-display-none gl-display
-sm-flex"
>
<viewer-switcher
v-if=
"showViewerSwitcher"
v-model=
"viewer"
/>
<slot
name=
"actions"
></slot>
...
...
app/assets/javascripts/blob/components/blob_header_default_actions.vue
View file @
1ed3a5a8
<
script
>
import
{
Gl
DeprecatedButton
,
GlButtonGroup
,
GlIcon
,
GlTooltipDirective
}
from
'
@gitlab/ui
'
;
import
{
Gl
Button
,
GlButtonGroup
,
GlTooltipDirective
}
from
'
@gitlab/ui
'
;
import
{
BTN_COPY_CONTENTS_TITLE
,
BTN_DOWNLOAD_TITLE
,
...
...
@@ -10,9 +10,8 @@ import {
export
default
{
components
:
{
GlIcon
,
GlButtonGroup
,
Gl
Deprecated
Button
,
GlButton
,
},
directives
:
{
GlTooltip
:
GlTooltipDirective
,
...
...
@@ -48,7 +47,7 @@ export default {
</
script
>
<
template
>
<gl-button-group>
<gl-
deprecated-
button
<gl-button
v-if=
"!hasRenderError"
v-gl-tooltip
.
hover
:aria-label=
"$options.BTN_COPY_CONTENTS_TITLE"
...
...
@@ -56,26 +55,29 @@ export default {
:disabled=
"copyDisabled"
data-clipboard-target=
"#blob-code-content"
data-testid=
"copyContentsButton"
>
<gl-icon
name=
"copy-to-clipboard"
:size=
"14"
/>
</gl-deprecated-button>
<gl-deprecated-button
icon=
"copy-to-clipboard"
category=
"primary"
variant=
"default"
/>
<gl-button
v-gl-tooltip
.
hover
:aria-label=
"$options.BTN_RAW_TITLE"
:title=
"$options.BTN_RAW_TITLE"
:href=
"rawPath"
target=
"_blank"
>
<gl-icon
name=
"doc-code"
:size=
"14"
/>
</gl-deprecated-button>
<gl-deprecated-button
icon=
"doc-code"
category=
"primary"
variant=
"default"
/>
<gl-button
v-gl-tooltip
.
hover
:aria-label=
"$options.BTN_DOWNLOAD_TITLE"
:title=
"$options.BTN_DOWNLOAD_TITLE"
:href=
"downloadUrl"
target=
"_blank"
>
<gl-icon
name=
"download"
:size=
"14"
/>
</gl-deprecated-button>
icon=
"download"
category=
"primary"
variant=
"default"
/>
</gl-button-group>
</
template
>
app/assets/javascripts/blob/components/blob_header_viewer_switcher.vue
View file @
1ed3a5a8
<
script
>
import
{
GlButton
,
GlButtonGroup
,
Gl
Icon
,
Gl
TooltipDirective
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlButtonGroup
,
GlTooltipDirective
}
from
'
@gitlab/ui
'
;
import
{
RICH_BLOB_VIEWER
,
RICH_BLOB_VIEWER_TITLE
,
...
...
@@ -9,7 +9,6 @@ import {
export
default
{
components
:
{
GlIcon
,
GlButtonGroup
,
GlButton
,
},
...
...
@@ -52,19 +51,21 @@ export default {
:title=
"$options.SIMPLE_BLOB_VIEWER_TITLE"
:selected=
"isSimpleViewer"
:class=
"
{ active: isSimpleViewer }"
icon="code"
category="primary"
variant="default"
@click="switchToViewer($options.SIMPLE_BLOB_VIEWER)"
>
<gl-icon
name=
"code"
:size=
"14"
/>
</gl-button>
/>
<gl-button
v-gl-tooltip
.
hover
:aria-label=
"$options.RICH_BLOB_VIEWER_TITLE"
:title=
"$options.RICH_BLOB_VIEWER_TITLE"
:selected=
"isRichViewer"
:class=
"
{ active: isRichViewer }"
icon="document"
category="primary"
variant="default"
@click="switchToViewer($options.RICH_BLOB_VIEWER)"
>
<gl-icon
name=
"document"
:size=
"14"
/>
</gl-button>
/>
</gl-button-group>
</
template
>
spec/frontend/blob/components/__snapshots__/blob_header_spec.js.snap
View file @
1ed3a5a8
...
...
@@ -9,7 +9,7 @@ exports[`Blob Header Default Actions rendering matches the snapshot 1`] = `
/>
<div
class="
file-actions d-none d
-sm-flex"
class="
gl-display-none gl-display
-sm-flex"
>
<viewer-switcher-stub
value="simple"
...
...
spec/frontend/blob/components/blob_header_default_actions_spec.js
View file @
1ed3a5a8
...
...
@@ -6,7 +6,7 @@ import {
BTN_RAW_TITLE
,
RICH_BLOB_VIEWER
,
}
from
'
~/blob/components/constants
'
;
import
{
GlButtonGroup
,
Gl
Deprecated
Button
}
from
'
@gitlab/ui
'
;
import
{
GlButtonGroup
,
GlButton
}
from
'
@gitlab/ui
'
;
import
{
Blob
}
from
'
./mock_data
'
;
describe
(
'
Blob Header Default Actions
'
,
()
=>
{
...
...
@@ -26,7 +26,7 @@ describe('Blob Header Default Actions', () => {
beforeEach
(()
=>
{
createComponent
();
btnGroup
=
wrapper
.
find
(
GlButtonGroup
);
buttons
=
wrapper
.
findAll
(
Gl
Deprecated
Button
);
buttons
=
wrapper
.
findAll
(
GlButton
);
});
afterEach
(()
=>
{
...
...
@@ -61,7 +61,7 @@ describe('Blob Header Default Actions', () => {
createComponent
({
activeViewer
:
RICH_BLOB_VIEWER
,
});
buttons
=
wrapper
.
findAll
(
Gl
Deprecated
Button
);
buttons
=
wrapper
.
findAll
(
GlButton
);
expect
(
buttons
.
at
(
0
).
attributes
(
'
disabled
'
)).
toBeTruthy
();
});
...
...
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