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
b4603317
Commit
b4603317
authored
Feb 16, 2022
by
Hinam Mehra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change button variant to confirm in Web IDE modals
Changelog: changed
parent
1f1ca214
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
7 deletions
+23
-7
app/assets/javascripts/ide/components/new_dropdown/modal.vue
app/assets/javascripts/ide/components/new_dropdown/modal.vue
+20
-4
spec/frontend/ide/components/new_dropdown/modal_spec.js
spec/frontend/ide/components/new_dropdown/modal_spec.js
+2
-2
spec/frontend_integration/ide/helpers/ide_helper.js
spec/frontend_integration/ide/helpers/ide_helper.js
+1
-1
No files found.
app/assets/javascripts/ide/components/new_dropdown/modal.vue
View file @
b4603317
...
...
@@ -6,6 +6,10 @@ import { __, sprintf } from '~/locale';
import
{
modalTypes
}
from
'
../../constants
'
;
import
{
trimPathComponents
,
getPathParent
}
from
'
../../utils
'
;
const
i18n
=
{
cancelButtonText
:
__
(
'
Cancel
'
),
};
export
default
{
components
:
{
GlModal
,
...
...
@@ -43,6 +47,18 @@ export default {
return
__
(
'
Create file
'
);
},
actionPrimary
()
{
return
{
text
:
this
.
buttonLabel
,
attributes
:
[{
variant
:
'
confirm
'
}],
};
},
actionCancel
()
{
return
{
text
:
i18n
.
cancelButtonText
,
attributes
:
[{
variant
:
'
default
'
}],
};
},
isCreatingNewFile
()
{
return
this
.
modalType
===
modalTypes
.
blob
;
},
...
...
@@ -136,11 +152,11 @@ export default {
data-qa-selector=
"new_file_modal"
data-testid=
"ide-new-entry"
:title=
"modalTitle"
:ok-title=
"buttonLabel"
ok-variant=
"success"
size=
"lg"
@
ok=
"submitForm"
@
hide=
"resetData"
:action-primary=
"actionPrimary"
:action-cancel=
"actionCancel"
@
primary=
"submitForm"
@
cancel=
"resetData"
>
<div
class=
"form-group row"
>
<label
class=
"label-bold col-form-label col-sm-2"
>
{{
__
(
'
Name
'
)
}}
</label>
...
...
spec/frontend/ide/components/new_dropdown/modal_spec.js
View file @
b4603317
...
...
@@ -38,7 +38,7 @@ describe('new file modal component', () => {
});
it
(
`sets button label as
${
entryType
}
`
,
()
=>
{
expect
(
document
.
querySelector
(
'
.btn-
success
'
).
textContent
.
trim
()).
toBe
(
btnTitle
);
expect
(
document
.
querySelector
(
'
.btn-
confirm
'
).
textContent
.
trim
()).
toBe
(
btnTitle
);
});
it
(
`sets form label as
${
entryType
}
`
,
()
=>
{
...
...
@@ -77,7 +77,7 @@ describe('new file modal component', () => {
await
nextTick
();
expect
(
document
.
querySelector
(
'
.modal-title
'
).
textContent
.
trim
()).
toBe
(
modalTitle
);
expect
(
document
.
querySelector
(
'
.btn-
success
'
).
textContent
.
trim
()).
toBe
(
btnTitle
);
expect
(
document
.
querySelector
(
'
.btn-
confirm
'
).
textContent
.
trim
()).
toBe
(
btnTitle
);
},
);
...
...
spec/frontend_integration/ide/helpers/ide_helper.js
View file @
b4603317
...
...
@@ -106,7 +106,7 @@ const fillFileNameModal = async (value, submitText = 'Create file') => {
const
nameField
=
await
findByTestId
(
modal
,
'
file-name-field
'
);
fireEvent
.
input
(
nameField
,
{
target
:
{
value
}
});
const
createButton
=
getByText
(
modal
,
submitText
,
{
selector
:
'
button
'
});
const
createButton
=
getByText
(
modal
,
submitText
,
{
selector
:
'
button
> span
'
});
createButton
.
click
();
};
...
...
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