Added a condition on squash message display
- also added a caret back to GlDropdown
This commit is contained in:
parent
5a82810faf
commit
52c772f9c3
|
@ -20,7 +20,6 @@ export default {
|
|||
<div>
|
||||
<gl-dropdown
|
||||
right
|
||||
no-caret
|
||||
text="Use an existing commit message"
|
||||
variant="link"
|
||||
class="mr-commit-dropdown"
|
||||
|
|
|
@ -329,7 +329,7 @@ export default {
|
|||
>
|
||||
<ul class="border-top content-list commits-list flex-list">
|
||||
<commit-edit
|
||||
v-if="squashBeforeMerge"
|
||||
v-if="squashBeforeMerge && shouldShowSquashBeforeMerge"
|
||||
v-model="squashCommitMessage"
|
||||
:label="__('Squash commit message')"
|
||||
input-id="squash-message-edit"
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Resolve showing squash commit edit issue when only single commit is present
|
||||
merge_request: 25807
|
||||
author:
|
||||
type: fixed
|
|
@ -673,7 +673,7 @@ describe('ReadyToMerge', () => {
|
|||
.at(0)
|
||||
.props('label');
|
||||
|
||||
it('should have two edit components when squash is enabled', () => {
|
||||
it('should have two edit components when squash is enabled and there is more than 1 commit', () => {
|
||||
createLocalComponent({
|
||||
mr: {
|
||||
commitsCount: 2,
|
||||
|
@ -685,6 +685,18 @@ describe('ReadyToMerge', () => {
|
|||
expect(findCommitEditElements().length).toBe(2);
|
||||
});
|
||||
|
||||
it('should have one edit components when squash is enabled and there is 1 commit only', () => {
|
||||
createLocalComponent({
|
||||
mr: {
|
||||
commitsCount: 1,
|
||||
squash: true,
|
||||
enableSquashBeforeMerge: true,
|
||||
},
|
||||
});
|
||||
|
||||
expect(findCommitEditElements().length).toBe(1);
|
||||
});
|
||||
|
||||
it('should have correct edit merge commit label', () => {
|
||||
createLocalComponent();
|
||||
|
||||
|
@ -711,8 +723,10 @@ describe('ReadyToMerge', () => {
|
|||
expect(findCommitDropdownElement().exists()).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should be rendered if squash is enabled', () => {
|
||||
createLocalComponent({ mr: { squash: true } });
|
||||
it('should be rendered if squash is enabled and there is more than 1 commit', () => {
|
||||
createLocalComponent({
|
||||
mr: { enableSquashBeforeMerge: true, squash: true, commitsCount: 2 },
|
||||
});
|
||||
|
||||
expect(findCommitDropdownElement().exists()).toBeTruthy();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue