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
Hide 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 {
...
@@ -71,7 +71,7 @@ export default {
</
template
>
</
template
>
</blob-filepath>
</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"
/>
<viewer-switcher
v-if=
"showViewerSwitcher"
v-model=
"viewer"
/>
<slot
name=
"actions"
></slot>
<slot
name=
"actions"
></slot>
...
...
app/assets/javascripts/blob/components/blob_header_default_actions.vue
View file @
1ed3a5a8
<
script
>
<
script
>
import
{
Gl
DeprecatedButton
,
GlButtonGroup
,
GlIcon
,
GlTooltipDirective
}
from
'
@gitlab/ui
'
;
import
{
Gl
Button
,
GlButtonGroup
,
GlTooltipDirective
}
from
'
@gitlab/ui
'
;
import
{
import
{
BTN_COPY_CONTENTS_TITLE
,
BTN_COPY_CONTENTS_TITLE
,
BTN_DOWNLOAD_TITLE
,
BTN_DOWNLOAD_TITLE
,
...
@@ -10,9 +10,8 @@ import {
...
@@ -10,9 +10,8 @@ import {
export
default
{
export
default
{
components
:
{
components
:
{
GlIcon
,
GlButtonGroup
,
GlButtonGroup
,
Gl
Deprecated
Button
,
GlButton
,
},
},
directives
:
{
directives
:
{
GlTooltip
:
GlTooltipDirective
,
GlTooltip
:
GlTooltipDirective
,
...
@@ -48,7 +47,7 @@ export default {
...
@@ -48,7 +47,7 @@ export default {
</
script
>
</
script
>
<
template
>
<
template
>
<gl-button-group>
<gl-button-group>
<gl-
deprecated-
button
<gl-button
v-if=
"!hasRenderError"
v-if=
"!hasRenderError"
v-gl-tooltip
.
hover
v-gl-tooltip
.
hover
:aria-label=
"$options.BTN_COPY_CONTENTS_TITLE"
:aria-label=
"$options.BTN_COPY_CONTENTS_TITLE"
...
@@ -56,26 +55,29 @@ export default {
...
@@ -56,26 +55,29 @@ export default {
:disabled=
"copyDisabled"
:disabled=
"copyDisabled"
data-clipboard-target=
"#blob-code-content"
data-clipboard-target=
"#blob-code-content"
data-testid=
"copyContentsButton"
data-testid=
"copyContentsButton"
>
icon=
"copy-to-clipboard"
<gl-icon
name=
"copy-to-clipboard"
:size=
"14"
/>
category=
"primary"
</gl-deprecated-button>
variant=
"default"
<gl-deprecated-button
/>
<gl-button
v-gl-tooltip
.
hover
v-gl-tooltip
.
hover
:aria-label=
"$options.BTN_RAW_TITLE"
:aria-label=
"$options.BTN_RAW_TITLE"
:title=
"$options.BTN_RAW_TITLE"
:title=
"$options.BTN_RAW_TITLE"
:href=
"rawPath"
:href=
"rawPath"
target=
"_blank"
target=
"_blank"
>
icon=
"doc-code"
<gl-icon
name=
"doc-code"
:size=
"14"
/>
category=
"primary"
</gl-deprecated-button>
variant=
"default"
<gl-deprecated-button
/>
<gl-button
v-gl-tooltip
.
hover
v-gl-tooltip
.
hover
:aria-label=
"$options.BTN_DOWNLOAD_TITLE"
:aria-label=
"$options.BTN_DOWNLOAD_TITLE"
:title=
"$options.BTN_DOWNLOAD_TITLE"
:title=
"$options.BTN_DOWNLOAD_TITLE"
:href=
"downloadUrl"
:href=
"downloadUrl"
target=
"_blank"
target=
"_blank"
>
icon=
"download"
<gl-icon
name=
"download"
:size=
"14"
/>
category=
"primary"
</gl-deprecated-button>
variant=
"default"
/>
</gl-button-group>
</gl-button-group>
</
template
>
</
template
>
app/assets/javascripts/blob/components/blob_header_viewer_switcher.vue
View file @
1ed3a5a8
<
script
>
<
script
>
import
{
GlButton
,
GlButtonGroup
,
Gl
Icon
,
Gl
TooltipDirective
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlButtonGroup
,
GlTooltipDirective
}
from
'
@gitlab/ui
'
;
import
{
import
{
RICH_BLOB_VIEWER
,
RICH_BLOB_VIEWER
,
RICH_BLOB_VIEWER_TITLE
,
RICH_BLOB_VIEWER_TITLE
,
...
@@ -9,7 +9,6 @@ import {
...
@@ -9,7 +9,6 @@ import {
export
default
{
export
default
{
components
:
{
components
:
{
GlIcon
,
GlButtonGroup
,
GlButtonGroup
,
GlButton
,
GlButton
,
},
},
...
@@ -52,19 +51,21 @@ export default {
...
@@ -52,19 +51,21 @@ export default {
:title=
"$options.SIMPLE_BLOB_VIEWER_TITLE"
:title=
"$options.SIMPLE_BLOB_VIEWER_TITLE"
:selected=
"isSimpleViewer"
:selected=
"isSimpleViewer"
:class=
"
{ active: isSimpleViewer }"
:class=
"
{ active: isSimpleViewer }"
icon="code"
category="primary"
variant="default"
@click="switchToViewer($options.SIMPLE_BLOB_VIEWER)"
@click="switchToViewer($options.SIMPLE_BLOB_VIEWER)"
>
/>
<gl-icon
name=
"code"
:size=
"14"
/>
</gl-button>
<gl-button
<gl-button
v-gl-tooltip
.
hover
v-gl-tooltip
.
hover
:aria-label=
"$options.RICH_BLOB_VIEWER_TITLE"
:aria-label=
"$options.RICH_BLOB_VIEWER_TITLE"
:title=
"$options.RICH_BLOB_VIEWER_TITLE"
:title=
"$options.RICH_BLOB_VIEWER_TITLE"
:selected=
"isRichViewer"
:selected=
"isRichViewer"
:class=
"
{ active: isRichViewer }"
:class=
"
{ active: isRichViewer }"
icon="document"
category="primary"
variant="default"
@click="switchToViewer($options.RICH_BLOB_VIEWER)"
@click="switchToViewer($options.RICH_BLOB_VIEWER)"
>
/>
<gl-icon
name=
"document"
:size=
"14"
/>
</gl-button>
</gl-button-group>
</gl-button-group>
</
template
>
</
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`] = `
...
@@ -9,7 +9,7 @@ exports[`Blob Header Default Actions rendering matches the snapshot 1`] = `
/>
/>
<div
<div
class="
file-actions d-none d
-sm-flex"
class="
gl-display-none gl-display
-sm-flex"
>
>
<viewer-switcher-stub
<viewer-switcher-stub
value="simple"
value="simple"
...
...
spec/frontend/blob/components/blob_header_default_actions_spec.js
View file @
1ed3a5a8
...
@@ -6,7 +6,7 @@ import {
...
@@ -6,7 +6,7 @@ import {
BTN_RAW_TITLE
,
BTN_RAW_TITLE
,
RICH_BLOB_VIEWER
,
RICH_BLOB_VIEWER
,
}
from
'
~/blob/components/constants
'
;
}
from
'
~/blob/components/constants
'
;
import
{
GlButtonGroup
,
Gl
Deprecated
Button
}
from
'
@gitlab/ui
'
;
import
{
GlButtonGroup
,
GlButton
}
from
'
@gitlab/ui
'
;
import
{
Blob
}
from
'
./mock_data
'
;
import
{
Blob
}
from
'
./mock_data
'
;
describe
(
'
Blob Header Default Actions
'
,
()
=>
{
describe
(
'
Blob Header Default Actions
'
,
()
=>
{
...
@@ -26,7 +26,7 @@ describe('Blob Header Default Actions', () => {
...
@@ -26,7 +26,7 @@ describe('Blob Header Default Actions', () => {
beforeEach
(()
=>
{
beforeEach
(()
=>
{
createComponent
();
createComponent
();
btnGroup
=
wrapper
.
find
(
GlButtonGroup
);
btnGroup
=
wrapper
.
find
(
GlButtonGroup
);
buttons
=
wrapper
.
findAll
(
Gl
Deprecated
Button
);
buttons
=
wrapper
.
findAll
(
GlButton
);
});
});
afterEach
(()
=>
{
afterEach
(()
=>
{
...
@@ -61,7 +61,7 @@ describe('Blob Header Default Actions', () => {
...
@@ -61,7 +61,7 @@ describe('Blob Header Default Actions', () => {
createComponent
({
createComponent
({
activeViewer
:
RICH_BLOB_VIEWER
,
activeViewer
:
RICH_BLOB_VIEWER
,
});
});
buttons
=
wrapper
.
findAll
(
Gl
Deprecated
Button
);
buttons
=
wrapper
.
findAll
(
GlButton
);
expect
(
buttons
.
at
(
0
).
attributes
(
'
disabled
'
)).
toBeTruthy
();
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