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
088d7978
Commit
088d7978
authored
Jul 07, 2020
by
André Luís
Committed by
Phil Hughes
Jul 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide Add to Batch button when suggestions can't be applied
parent
019592f1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
23 deletions
+13
-23
app/assets/javascripts/vue_shared/components/markdown/suggestion_diff_header.vue
...vue_shared/components/markdown/suggestion_diff_header.vue
+9
-15
locale/gitlab.pot
locale/gitlab.pot
+1
-4
spec/frontend/vue_shared/components/markdown/suggestion_diff_header_spec.js
...shared/components/markdown/suggestion_diff_header_spec.js
+3
-4
No files found.
app/assets/javascripts/vue_shared/components/markdown/suggestion_diff_header.vue
View file @
088d7978
...
...
@@ -53,14 +53,9 @@ export default {
},
tooltipMessage
()
{
return
this
.
canApply
?
__
(
'
This also resolves th
e discussion
'
)
?
__
(
'
This also resolves th
is thread
'
)
:
__
(
"
Can't apply as this line has changed or the suggestion already matches its content.
"
);
},
tooltipMessageBatch
()
{
return
!
this
.
canBeBatched
?
__
(
"
Suggestions that change line count can't be added to batches, yet.
"
)
:
this
.
tooltipMessage
;
},
isDisableButton
()
{
return
this
.
isApplying
||
!
this
.
canApply
;
},
...
...
@@ -129,15 +124,14 @@ export default {
</gl-deprecated-button>
</div>
<div
v-else
class=
"d-flex align-items-center"
>
<span
v-if=
"canBeBatched"
v-gl-tooltip.viewport=
"tooltipMessageBatch"
tabindex=
"0"
>
<gl-deprecated-button
class=
"btn-inverted js-add-to-batch-btn btn-grouped"
:disabled=
"isDisableButton"
@
click=
"addSuggestionToBatch"
>
{{
__
(
'
Add suggestion to batch
'
)
}}
</gl-deprecated-button>
</span>
<gl-deprecated-button
v-if=
"canBeBatched && !isDisableButton"
class=
"btn-inverted js-add-to-batch-btn btn-grouped"
:disabled=
"isDisableButton"
@
click=
"addSuggestionToBatch"
>
{{
__
(
'
Add suggestion to batch
'
)
}}
</gl-deprecated-button>
<span
v-gl-tooltip.viewport=
"tooltipMessage"
tabindex=
"0"
>
<gl-deprecated-button
class=
"btn-inverted js-apply-btn btn-grouped"
...
...
locale/gitlab.pot
View file @
088d7978
...
...
@@ -22379,9 +22379,6 @@ msgstr ""
msgid "Suggestions must all be on the same branch."
msgstr ""
msgid "Suggestions that change line count can't be added to batches, yet."
msgstr ""
msgid "Suggestions:"
msgstr ""
...
...
@@ -23397,7 +23394,7 @@ msgstr ""
msgid "This also resolves all related threads"
msgstr ""
msgid "This also resolves th
e discussion
"
msgid "This also resolves th
is thread
"
msgstr ""
msgid "This application was created by %{link_to_owner}."
...
...
spec/frontend/vue_shared/components/markdown/suggestion_diff_header_spec.js
View file @
088d7978
...
...
@@ -71,7 +71,7 @@ describe('Suggestion Diff component', () => {
it
(
'
renders correct tooltip message for apply button
'
,
()
=>
{
createComponent
();
expect
(
wrapper
.
vm
.
tooltipMessage
).
toBe
(
'
This also resolves th
e discussion
'
);
expect
(
wrapper
.
vm
.
tooltipMessage
).
toBe
(
'
This also resolves th
is thread
'
);
});
describe
(
'
when apply suggestion is clicked
'
,
()
=>
{
...
...
@@ -227,11 +227,10 @@ describe('Suggestion Diff component', () => {
createComponent
({
canApply
:
false
});
});
it
(
'
disables apply suggestion and
add to batch buttons
'
,
()
=>
{
it
(
'
disables apply suggestion and
hides add to batch button
'
,
()
=>
{
expect
(
findApplyButton
().
exists
()).
toBe
(
true
);
expect
(
findAddToBatchButton
().
exists
()).
toBe
(
tru
e
);
expect
(
findAddToBatchButton
().
exists
()).
toBe
(
fals
e
);
expect
(
findApplyButton
().
attributes
(
'
disabled
'
)).
toBe
(
'
true
'
);
expect
(
findAddToBatchButton
().
attributes
(
'
disabled
'
)).
toBe
(
'
true
'
);
});
it
(
'
renders correct tooltip message for apply 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