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
2f5e1192
Commit
2f5e1192
authored
Mar 01, 2021
by
Enrique Alcantara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement select on focus behavior
parent
c2e9b68e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
15 deletions
+16
-15
app/assets/javascripts/projects/experiment_new_project_creation/components/new_project_push_tip_popover.vue
...ject_creation/components/new_project_push_tip_popover.vue
+8
-10
spec/frontend/projects/experiment_new_project_creation/components/new_project_push_tip_popover_spec.js
..._creation/components/new_project_push_tip_popover_spec.js
+8
-5
No files found.
app/assets/javascripts/projects/experiment_new_project_creation/components/new_project_push_tip_popover.vue
View file @
2f5e1192
<
script
>
import
{
GlPopover
,
GlFormInputGroup
,
GlFormInput
}
from
'
@gitlab/ui
'
;
import
{
GlPopover
,
GlFormInputGroup
}
from
'
@gitlab/ui
'
;
import
{
__
}
from
'
~/locale
'
;
import
ClipboardButton
from
'
~/vue_shared/components/clipboard_button.vue
'
;
...
...
@@ -8,7 +8,6 @@ export default {
GlPopover
,
GlFormInputGroup
,
ClipboardButton
,
GlFormInput
,
},
inject
:
[
'
pushToCreateProjectCommand
'
,
'
workingWithProjectsHelpPath
'
],
props
:
{
...
...
@@ -39,14 +38,13 @@ export default {
</label>
</p>
<p>
<gl-form-input-group>
<gl-form-input
id=
"push-to-create-tip"
class=
"monospace js-select-on-focus"
readonly
:value=
"pushToCreateProjectCommand"
:aria-label=
"$options.i18n.commandInputAriaLabel"
/>
<gl-form-input-group
id=
"push-to-create-tip"
:value=
"pushToCreateProjectCommand"
readonly
select-on-click
:aria-label=
"$options.i18n.commandInputAriaLabel"
>
<template
#append
>
<clipboard-button
:text=
"pushToCreateProjectCommand"
...
...
spec/frontend/projects/experiment_new_project_creation/components/new_project_push_tip_popover_spec.js
View file @
2f5e1192
import
{
GlPopover
,
GlFormInputGroup
,
GlFormInput
}
from
'
@gitlab/ui
'
;
import
{
GlPopover
,
GlFormInputGroup
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
NewProjectPushTipPopover
from
'
~/projects/experiment_new_project_creation/components/new_project_push_tip_popover.vue
'
;
import
ClipboardButton
from
'
~/vue_shared/components/clipboard_button.vue
'
;
...
...
@@ -11,7 +11,7 @@ describe('New project push tip popover', () => {
const
findPopover
=
()
=>
wrapper
.
findComponent
(
GlPopover
);
const
findClipboardButton
=
()
=>
wrapper
.
findComponent
(
ClipboardButton
);
const
findFormInput
=
()
=>
wrapper
.
findComponent
(
GlFormInput
);
const
findFormInput
=
()
=>
wrapper
.
findComponent
(
GlFormInput
Group
);
const
findHelpLink
=
()
=>
wrapper
.
find
(
'
a
'
);
const
findTarget
=
()
=>
document
.
getElementById
(
targetId
);
...
...
@@ -49,11 +49,14 @@ describe('New project push tip popover', () => {
});
it
(
'
renders a readonly form input with the push to create command
'
,
()
=>
{
expect
(
findFormInput
().
attribute
s
()).
toMatchObject
({
expect
(
findFormInput
().
prop
s
()).
toMatchObject
({
value
:
pushToCreateProjectCommand
,
readonly
:
''
,
selectOnClick
:
true
,
});
expect
(
findFormInput
().
attributes
()).
toMatchObject
({
'
aria-label
'
:
'
Push project from command line
'
,
readonly
:
'
readonly
'
,
});
expect
(
findFormInput
().
classes
()).
toContain
(
'
js-select-on-focus
'
);
});
it
(
'
allows copying the push command using the clipboard button
'
,
()
=>
{
...
...
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