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
>
import
{
Gl
Deprecated
Button
}
from
'
@gitlab/ui
'
;
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
{
__
}
from
'
~/locale
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
/**
* Port of detail_behavior expand button.
...
...
@@ -16,8 +15,7 @@ import Icon from '~/vue_shared/components/icon.vue';
export
default
{
name
:
'
ExpandButton
'
,
components
:
{
GlDeprecatedButton
,
Icon
,
GlButton
,
},
data
()
{
return
{
...
...
@@ -41,25 +39,23 @@ export default {
</
script
>
<
template
>
<span>
<gl-
deprecated-
button
<gl-button
v-show=
"isCollapsed"
:aria-label=
"ariaLabel"
type=
"button"
class=
"js-text-expander-prepend text-expander btn-blank"
icon=
"ellipsis_h"
@
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=
"expanded"
></slot>
</span>
<gl-
deprecated-
button
<gl-button
v-show=
"!isCollapsed"
:aria-label=
"ariaLabel"
type=
"button"
class=
"js-text-expander-append text-expander btn-blank"
icon=
"ellipsis_h"
@
click=
"onClick"
>
<icon
:size=
"12"
name=
"ellipsis_h"
/>
</gl-deprecated-button>
/>
</span>
</
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
<span>
<button
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;"
type="button"
>
<!---->
<svg
aria-hidden="true
"
class="s12 ic-ellipsis_h
"
class="gl-icon s16
"
data-testid="ellipsis_h-icon
"
>
<use
xlink:
href="#ellipsis_h"
href="#ellipsis_h"
/>
</svg>
<!---->
</button>
<!---->
...
...
@@ -30,20 +32,22 @@ exports[`Expand button on click when short text is provided renders button after
<button
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=""
type="button"
>
<!---->
<svg
aria-hidden="true
"
class="s12 ic-ellipsis_h
"
class="gl-icon s16
"
data-testid="ellipsis_h-icon
"
>
<use
xlink:
href="#ellipsis_h"
href="#ellipsis_h"
/>
</svg>
<!---->
</button>
</span>
`;
...
...
@@ -52,19 +56,21 @@ exports[`Expand button when short text is provided renders button before text 1`
<span>
<button
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"
>
<!---->
<svg
aria-hidden="true
"
class="s12 ic-ellipsis_h
"
class="gl-icon s16
"
data-testid="ellipsis_h-icon
"
>
<use
xlink:
href="#ellipsis_h"
href="#ellipsis_h"
/>
</svg>
<!---->
</button>
<span>
...
...
@@ -77,20 +83,22 @@ exports[`Expand button when short text is provided renders button before text 1`
<button
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;"
type="button"
>
<!---->
<svg
aria-hidden="true
"
class="s12 ic-ellipsis_h
"
class="gl-icon s16
"
data-testid="ellipsis_h-icon
"
>
<use
xlink:
href="#ellipsis_h"
href="#ellipsis_h"
/>
</svg>
<!---->
</button>
</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