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
757dd3d0
Commit
757dd3d0
authored
Jul 30, 2020
by
Christie Lenneville
Committed by
Kushal Pandya
Jul 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate Expand button
MR:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/36625
parent
93796580
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
28 deletions
+32
-28
app/assets/javascripts/vue_shared/components/expand_button.vue
...ssets/javascripts/vue_shared/components/expand_button.vue
+8
-12
spec/frontend/vue_shared/components/__snapshots__/expand_button_spec.js.snap
...hared/components/__snapshots__/expand_button_spec.js.snap
+24
-16
No files found.
app/assets/javascripts/vue_shared/components/expand_button.vue
View file @
757dd3d0
<
script
>
<
script
>
import
{
Gl
Deprecated
Button
}
from
'
@gitlab/ui
'
;
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
__
}
from
'
~/locale
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
/**
/**
* Port of detail_behavior expand button.
* Port of detail_behavior expand button.
...
@@ -16,8 +15,7 @@ import Icon from '~/vue_shared/components/icon.vue';
...
@@ -16,8 +15,7 @@ import Icon from '~/vue_shared/components/icon.vue';
export
default
{
export
default
{
name
:
'
ExpandButton
'
,
name
:
'
ExpandButton
'
,
components
:
{
components
:
{
GlDeprecatedButton
,
GlButton
,
Icon
,
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -41,25 +39,23 @@ export default {
...
@@ -41,25 +39,23 @@ export default {
</
script
>
</
script
>
<
template
>
<
template
>
<span>
<span>
<gl-
deprecated-
button
<gl-button
v-show=
"isCollapsed"
v-show=
"isCollapsed"
:aria-label=
"ariaLabel"
:aria-label=
"ariaLabel"
type=
"button"
type=
"button"
class=
"js-text-expander-prepend text-expander btn-blank"
class=
"js-text-expander-prepend text-expander btn-blank"
icon=
"ellipsis_h"
@
click=
"onClick"
@
click=
"onClick"
>
/>
<icon
:size=
"12"
name=
"ellipsis_h"
/>
</gl-deprecated-button>
<span
v-if=
"isCollapsed"
>
<slot
name=
"short"
></slot>
</span>
<span
v-if=
"isCollapsed"
>
<slot
name=
"short"
></slot>
</span>
<span
v-if=
"!isCollapsed"
>
<slot
name=
"expanded"
></slot>
</span>
<span
v-if=
"!isCollapsed"
>
<slot
name=
"expanded"
></slot>
</span>
<gl-
deprecated-
button
<gl-button
v-show=
"!isCollapsed"
v-show=
"!isCollapsed"
:aria-label=
"ariaLabel"
:aria-label=
"ariaLabel"
type=
"button"
type=
"button"
class=
"js-text-expander-append text-expander btn-blank"
class=
"js-text-expander-append text-expander btn-blank"
icon=
"ellipsis_h"
@
click=
"onClick"
@
click=
"onClick"
>
/>
<icon
:size=
"12"
name=
"ellipsis_h"
/>
</gl-deprecated-button>
</span>
</span>
</
template
>
</
template
>
spec/frontend/vue_shared/components/__snapshots__/expand_button_spec.js.snap
View file @
757dd3d0
...
@@ -4,20 +4,22 @@ exports[`Expand button on click when short text is provided renders button after
...
@@ -4,20 +4,22 @@ exports[`Expand button on click when short text is provided renders button after
<span>
<span>
<button
<button
aria-label="Click to expand text"
aria-label="Click to expand text"
class="btn js-text-expander-prepend text-expander btn-blank btn-
secondary btn-md
"
class="btn js-text-expander-prepend text-expander btn-blank btn-
default btn-md btn-icon button-ellipsis-horizontal gl-button
"
style="display: none;"
style="display: none;"
type="button"
type="button"
>
>
<!---->
<!---->
<svg
<svg
aria-hidden="true
"
class="gl-icon s16
"
class="s12 ic-ellipsis_h
"
data-testid="ellipsis_h-icon
"
>
>
<use
<use
xlink:
href="#ellipsis_h"
href="#ellipsis_h"
/>
/>
</svg>
</svg>
<!---->
</button>
</button>
<!---->
<!---->
...
@@ -30,20 +32,22 @@ exports[`Expand button on click when short text is provided renders button after
...
@@ -30,20 +32,22 @@ exports[`Expand button on click when short text is provided renders button after
<button
<button
aria-label="Click to expand text"
aria-label="Click to expand text"
class="btn js-text-expander-append text-expander btn-blank btn-
secondary btn-md
"
class="btn js-text-expander-append text-expander btn-blank btn-
default btn-md btn-icon button-ellipsis-horizontal gl-button
"
style=""
style=""
type="button"
type="button"
>
>
<!---->
<!---->
<svg
<svg
aria-hidden="true
"
class="gl-icon s16
"
class="s12 ic-ellipsis_h
"
data-testid="ellipsis_h-icon
"
>
>
<use
<use
xlink:
href="#ellipsis_h"
href="#ellipsis_h"
/>
/>
</svg>
</svg>
<!---->
</button>
</button>
</span>
</span>
`;
`;
...
@@ -52,19 +56,21 @@ exports[`Expand button when short text is provided renders button before text 1`
...
@@ -52,19 +56,21 @@ exports[`Expand button when short text is provided renders button before text 1`
<span>
<span>
<button
<button
aria-label="Click to expand text"
aria-label="Click to expand text"
class="btn js-text-expander-prepend text-expander btn-blank btn-
secondary btn-md
"
class="btn js-text-expander-prepend text-expander btn-blank btn-
default btn-md btn-icon button-ellipsis-horizontal gl-button
"
type="button"
type="button"
>
>
<!---->
<!---->
<svg
<svg
aria-hidden="true
"
class="gl-icon s16
"
class="s12 ic-ellipsis_h
"
data-testid="ellipsis_h-icon
"
>
>
<use
<use
xlink:
href="#ellipsis_h"
href="#ellipsis_h"
/>
/>
</svg>
</svg>
<!---->
</button>
</button>
<span>
<span>
...
@@ -77,20 +83,22 @@ exports[`Expand button when short text is provided renders button before text 1`
...
@@ -77,20 +83,22 @@ exports[`Expand button when short text is provided renders button before text 1`
<button
<button
aria-label="Click to expand text"
aria-label="Click to expand text"
class="btn js-text-expander-append text-expander btn-blank btn-
secondary btn-md
"
class="btn js-text-expander-append text-expander btn-blank btn-
default btn-md btn-icon button-ellipsis-horizontal gl-button
"
style="display: none;"
style="display: none;"
type="button"
type="button"
>
>
<!---->
<!---->
<svg
<svg
aria-hidden="true
"
class="gl-icon s16
"
class="s12 ic-ellipsis_h
"
data-testid="ellipsis_h-icon
"
>
>
<use
<use
xlink:
href="#ellipsis_h"
href="#ellipsis_h"
/>
/>
</svg>
</svg>
<!---->
</button>
</button>
</span>
</span>
`;
`;
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