Skip to content

Commit b1a0a71

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 0e08908 commit b1a0a71

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+16649
-15975
lines changed

CHANGELOG.md

+4-15,677
Large diffs are not rendered by default.

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ gem 'typhoeus', '~> 1.4.0' # Used with Elasticsearch to support http keep-alive
191191
# Markdown and HTML processing
192192
gem 'html-pipeline', '~> 2.14.3'
193193
gem 'deckar01-task_list', '2.3.2'
194-
gem 'gitlab-markup', '~> 1.8.0', require: 'github/markup'
194+
gem 'gitlab-markup', '~> 1.9.0', require: 'github/markup'
195195
gem 'commonmarker', '~> 0.23.6'
196196
gem 'kramdown', '~> 2.3.1'
197197
gem 'RedCloth', '~> 4.3.2'

Gemfile.checksum

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@
206206
{"name":"gitlab-labkit","version":"0.30.1","platform":"ruby","checksum":"bdedbd86014c83dfd6a50d20dbc1709697bba2bb9e3666383e5f28cbd312b113"},
207207
{"name":"gitlab-license","version":"2.2.1","platform":"ruby","checksum":"39fcf6be8b2887df8afe01b5dcbae8d08b7c5d937ff56b0fb40484a8c4f02d30"},
208208
{"name":"gitlab-mail_room","version":"0.0.9","platform":"ruby","checksum":"6700374b5c0aa9d9ad4e711aeb677f0b7d415a6d01d3baa699efab25349d851c"},
209-
{"name":"gitlab-markup","version":"1.8.1","platform":"ruby","checksum":"ab1f9fd016977497c2af25b76341dea670533014f406861834a0bd99f646707b"},
209+
{"name":"gitlab-markup","version":"1.9.0","platform":"ruby","checksum":"7eda045a08ec2d110084252fa13a8c9eac8bdac0e302035ca7db4b82bcbd7ed4"},
210210
{"name":"gitlab-net-dns","version":"0.9.1","platform":"ruby","checksum":"bcd1a08dcb31b731e8ff602d828de619d2d9f53f5812f6abacf11c720873d4cb"},
211211
{"name":"gitlab-sidekiq-fetcher","version":"0.9.0","platform":"ruby","checksum":"54041aec059f20c8e6dfce394e1b60e0c0a9c7cef32da912a58abbd333e13897"},
212212
{"name":"gitlab-styles","version":"10.0.0","platform":"ruby","checksum":"8a1b20f7b5f351605ff4ed4ec648ef37226f2774d1e1377ed99389448d6913f0"},

Gemfile.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ GEM
594594
redis (> 3.0.0, < 6.0.0)
595595
gitlab-license (2.2.1)
596596
gitlab-mail_room (0.0.9)
597-
gitlab-markup (1.8.1)
597+
gitlab-markup (1.9.0)
598598
gitlab-net-dns (0.9.1)
599599
gitlab-sidekiq-fetcher (0.9.0)
600600
json (>= 2.5)
@@ -1682,7 +1682,7 @@ DEPENDENCIES
16821682
gitlab-labkit (~> 0.30.1)
16831683
gitlab-license (~> 2.2.1)
16841684
gitlab-mail_room (~> 0.0.9)
1685-
gitlab-markup (~> 1.8.0)
1685+
gitlab-markup (~> 1.9.0)
16861686
gitlab-net-dns (~> 0.9.1)
16871687
gitlab-sidekiq-fetcher (= 0.9.0)
16881688
gitlab-styles (~> 10.0.0)

Pipfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ verify_ssl = true
66
[dev-packages]
77

88
[packages]
9-
docutils = "==0.13.1"
9+
docutils = "==0.19"
1010

1111
[requires]
12-
python_version = "3.4"
12+
python_version = "3.9.6"

Pipfile.lock

+5-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/assets/javascripts/boards/components/board_card_move_to_position.vue

+1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ export default {
117117
:toggle-text="s__('Boards|Move card')"
118118
:text-sr-only="true"
119119
no-caret
120+
data-testid="board-move-to-position"
120121
@action="selectMoveAction"
121122
/>
122123
</template>

app/assets/javascripts/boards/components/board_list.vue

+5-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
toggleFormEventPrefix,
1414
DraggableItemTypes,
1515
listIssuablesQueries,
16+
ListType,
1617
} from 'ee_else_ce/boards/constants';
1718
import eventHub from '../eventhub';
1819
import BoardCard from './board_card.vue';
@@ -196,6 +197,9 @@ export default {
196197
disableScrollingWhenMutationInProgress() {
197198
return this.hasNextPage && this.isUpdateIssueOrderInProgress;
198199
},
200+
showMoveToPosition() {
201+
return !this.disabled && this.list.listType !== ListType.closed;
202+
},
199203
},
200204
watch: {
201205
boardListItems() {
@@ -382,9 +386,8 @@ export default {
382386
:data-draggable-item-type="$options.draggableItemTypes.card"
383387
:show-work-item-type-icon="!isEpicBoard"
384388
>
385-
<!-- TODO: remove the condition when https://gitlab.com/gitlab-org/gitlab/-/issues/377862 is resolved -->
386389
<board-card-move-to-position
387-
v-if="!isEpicBoard && !disabled"
390+
v-if="showMoveToPosition"
388391
:item="item"
389392
:index="index"
390393
:list="list"

app/assets/javascripts/boards/stores/mutations.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ const updateListItemsCount = ({ state, listId, value }) => {
1515
}
1616
};
1717

18-
export const removeItemFromList = ({ state, listId, itemId }) => {
18+
export const removeItemFromList = ({ state, listId, itemId, reordering = false }) => {
1919
Vue.set(state.boardItemsByListId, listId, pull(state.boardItemsByListId[listId], itemId));
20-
updateListItemsCount({ state, listId, value: -1 });
20+
if (!reordering) {
21+
updateListItemsCount({ state, listId, value: -1 });
22+
}
2123
};
2224

2325
export const addItemToList = ({
@@ -28,6 +30,7 @@ export const addItemToList = ({
2830
moveAfterId,
2931
atIndex,
3032
positionInList,
33+
reordering = false,
3134
}) => {
3235
const listIssues = state.boardItemsByListId[listId];
3336
let newIndex = atIndex || 0;
@@ -41,7 +44,9 @@ export const addItemToList = ({
4144
}
4245
listIssues.splice(newIndex, 0, itemId);
4346
Vue.set(state.boardItemsByListId, listId, listIssues);
44-
updateListItemsCount({ state, listId, value: moveToStartOrLast ? 0 : 1 });
47+
if (!reordering) {
48+
updateListItemsCount({ state, listId, value: moveToStartOrLast ? 0 : 1 });
49+
}
4550
};
4651

4752
export default {

app/assets/javascripts/merge_requests/components/compare_dropdown.vue

+1
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ export default {
136136
'gl-align-items-flex-start! gl-justify-content-start! mr-compare-dropdown',
137137
toggleClass,
138138
]"
139+
:data-qa-selector="qaSelector"
139140
@shown="fetchData"
140141
@search="searchData"
141142
@select="selectItem"

app/assets/javascripts/work_items/components/work_item_comment_form.vue app/assets/javascripts/work_items/components/notes/work_item_add_note.vue

+24-81
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,28 @@
11
<script>
22
import { GlAvatar, GlButton } from '@gitlab/ui';
33
import * as Sentry from '@sentry/browser';
4-
import { helpPagePath } from '~/helpers/help_page_helper';
5-
import { getDraft, clearDraft, updateDraft } from '~/lib/utils/autosave';
6-
import { confirmAction } from '~/lib/utils/confirm_via_gl_modal/confirm_via_gl_modal';
7-
import { __, s__ } from '~/locale';
4+
import { clearDraft } from '~/lib/utils/autosave';
85
import Tracking from '~/tracking';
96
import { ASC } from '~/notes/constants';
107
import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
118
import { updateCommentState } from '~/work_items/graphql/cache_utils';
12-
import MarkdownEditor from '~/vue_shared/components/markdown/markdown_editor.vue';
13-
import { getWorkItemQuery } from '../utils';
14-
import createNoteMutation from '../graphql/notes/create_work_item_note.mutation.graphql';
15-
import { TRACKING_CATEGORY_SHOW, i18n } from '../constants';
9+
import { getWorkItemQuery } from '../../utils';
10+
import createNoteMutation from '../../graphql/notes/create_work_item_note.mutation.graphql';
11+
import { TRACKING_CATEGORY_SHOW, i18n } from '../../constants';
1612
import WorkItemNoteSignedOut from './work_item_note_signed_out.vue';
1713
import WorkItemCommentLocked from './work_item_comment_locked.vue';
14+
import WorkItemCommentForm from './work_item_comment_form.vue';
1815
1916
export default {
2017
constantOptions: {
21-
markdownDocsPath: helpPagePath('user/markdown'),
2218
avatarUrl: window.gon.current_user_avatar_url,
2319
},
2420
components: {
2521
GlAvatar,
2622
GlButton,
27-
MarkdownEditor,
2823
WorkItemNoteSignedOut,
2924
WorkItemCommentLocked,
25+
WorkItemCommentForm,
3026
},
3127
mixins: [glFeatureFlagMixin(), Tracking.mixin()],
3228
props: {
@@ -78,13 +74,6 @@ export default {
7874
isEditing: false,
7975
isSubmitting: false,
8076
isSubmittingWithKeydown: false,
81-
commentText: '',
82-
formFieldProps: {
83-
'aria-label': __('Add a comment'),
84-
placeholder: __('Write a comment or drag your files here…'),
85-
id: 'work-item-add-comment',
86-
name: 'work-item-add-comment',
87-
},
8877
};
8978
},
9079
apollo: {
@@ -112,7 +101,7 @@ export default {
112101
},
113102
autosaveKey() {
114103
// eslint-disable-next-line @gitlab/require-i18n-strings
115-
return `${this.workItemId}-comment`;
104+
return this.discussionId ? `${this.discussionId}-comment` : `${this.workItemId}-comment`;
116105
},
117106
tracking() {
118107
return {
@@ -150,37 +139,9 @@ export default {
150139
},
151140
},
152141
methods: {
153-
startEditing() {
154-
this.isEditing = true;
155-
this.commentText = getDraft(this.autosaveKey) || '';
156-
},
157-
async cancelEditing() {
158-
if (this.commentText) {
159-
const msg = s__('WorkItem|Are you sure you want to cancel editing?');
160-
161-
const confirmed = await confirmAction(msg, {
162-
primaryBtnText: __('Discard changes'),
163-
cancelBtnText: __('Continue editing'),
164-
});
165-
166-
if (!confirmed) {
167-
return;
168-
}
169-
}
170-
171-
this.$emit('cancelEditing');
172-
this.isEditing = false;
173-
clearDraft(this.autosaveKey);
174-
},
175-
async updateWorkItem(event = {}) {
176-
const { key } = event;
177-
178-
if (key) {
179-
this.isSubmittingWithKeydown = true;
180-
}
181-
142+
async updateWorkItem(commentText) {
182143
this.isSubmitting = true;
183-
this.$emit('replying', this.commentText);
144+
this.$emit('replying', commentText);
184145
const { queryVariables, fetchByIid } = this;
185146
186147
try {
@@ -191,7 +152,7 @@ export default {
191152
variables: {
192153
input: {
193154
noteableId: this.workItemId,
194-
body: this.commentText,
155+
body: commentText,
195156
discussionId: this.discussionId || null,
196157
},
197158
},
@@ -204,17 +165,17 @@ export default {
204165
});
205166
clearDraft(this.autosaveKey);
206167
this.$emit('replied');
207-
this.isEditing = false;
168+
this.cancelEditing();
208169
} catch (error) {
209170
this.$emit('error', error.message);
210171
Sentry.captureException(error);
211172
}
212173
213174
this.isSubmitting = false;
214175
},
215-
setCommentText(newText) {
216-
this.commentText = newText;
217-
updateDraft(this.autosaveKey, this.commentText);
176+
cancelEditing() {
177+
this.isEditing = false;
178+
this.$emit('cancelEditing');
218179
},
219180
},
220181
};
@@ -230,37 +191,19 @@ export default {
230191
/>
231192
<div v-else class="gl-relative gl-display-flex gl-align-items-flex-start gl-flex-wrap-nowrap">
232193
<gl-avatar :src="$options.constantOptions.avatarUrl" :size="32" class="gl-mr-3" />
233-
<form v-if="isEditing" class="common-note-form gfm-form js-main-target-form gl-flex-grow-1">
234-
<markdown-editor
235-
class="gl-mb-3"
236-
:value="commentText"
237-
:render-markdown-path="markdownPreviewPath"
238-
:markdown-docs-path="$options.constantOptions.markdownDocsPath"
239-
:form-field-props="formFieldProps"
240-
data-testid="work-item-add-comment"
241-
enable-autocomplete
242-
autofocus
243-
use-bottom-toolbar
244-
@input="setCommentText"
245-
@keydown.meta.enter="updateWorkItem"
246-
@keydown.ctrl.enter="updateWorkItem"
247-
@keydown.esc="cancelEditing"
248-
/>
249-
<gl-button
250-
category="primary"
251-
variant="confirm"
252-
:loading="isSubmitting"
253-
@click="updateWorkItem"
254-
>{{ __('Comment') }}
255-
</gl-button>
256-
<gl-button category="primary" class="gl-ml-3" @click="cancelEditing"
257-
>{{ __('Cancel') }}
258-
</gl-button>
259-
</form>
194+
<work-item-comment-form
195+
v-if="isEditing"
196+
:work-item-type="workItemType"
197+
:aria-label="__('Add a comment')"
198+
:is-submitting="isSubmitting"
199+
:autosave-key="autosaveKey"
200+
@submitForm="updateWorkItem"
201+
@cancelEditing="cancelEditing"
202+
/>
260203
<gl-button
261204
v-else
262205
class="gl-flex-grow-1 gl-justify-content-start! gl-text-secondary!"
263-
@click="startEditing"
206+
@click="isEditing = true"
264207
>{{ __('Add a comment') }}</gl-button
265208
>
266209
</div>

0 commit comments

Comments
 (0)