Skip to content

Commit 0ebbf19

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

File tree

198 files changed

+1219
-1766
lines changed

Some content is hidden

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

198 files changed

+1219
-1766
lines changed

.rubocop_todo.yml

-5
Original file line numberDiff line numberDiff line change
@@ -742,11 +742,6 @@ Style/ExplicitBlockArgument:
742742
Style/FormatString:
743743
Enabled: false
744744

745-
# Offense count: 67
746-
# Cop supports --auto-correct.
747-
Style/GlobalStdStream:
748-
Enabled: false
749-
750745
# Offense count: 897
751746
# Configuration parameters: MinBodyLength.
752747
Style/GuardClause:

GITALY_SERVER_VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8fd337f0f718f257ae72a66c464143a395af4c05
1+
df2eb006d241b399b8b6b877afab97713bb5c36a

app/assets/javascripts/behaviors/markdown/render_mermaid.js

+26-5
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,24 @@ let renderedMermaidBlocks = 0;
3030

3131
let mermaidModule = {};
3232

33+
// Whitelist pages where we won't impose any restrictions
34+
// on mermaid rendering
35+
const WHITELISTED_PAGES = [
36+
// Group wiki
37+
'groups:wikis:show',
38+
'groups:wikis:edit',
39+
'groups:wikis:create',
40+
41+
// Project wiki
42+
'projects:wikis:show',
43+
'projects:wikis:edit',
44+
'projects:wikis:create',
45+
46+
// Project files
47+
'projects:show',
48+
'projects:blob:show',
49+
];
50+
3351
export function initMermaid(mermaid) {
3452
let theme = 'neutral';
3553

@@ -120,8 +138,10 @@ function renderMermaidEl(el) {
120138
function renderMermaids($els) {
121139
if (!$els.length) return;
122140

141+
const pageName = document.querySelector('body').dataset.page;
142+
123143
// A diagram may have been truncated in search results which will cause errors, so abort the render.
124-
if (document.querySelector('body').dataset.page === 'search:show') return;
144+
if (pageName === 'search:show') return;
125145

126146
importMermaidModule()
127147
.then(() => {
@@ -140,10 +160,11 @@ function renderMermaids($els) {
140160
* up the entire thread and causing a DoS.
141161
*/
142162
if (
143-
(source && source.length > MAX_CHAR_LIMIT) ||
144-
renderedChars > MAX_CHAR_LIMIT ||
145-
renderedMermaidBlocks >= MAX_MERMAID_BLOCK_LIMIT ||
146-
shouldLazyLoadMermaidBlock(source)
163+
!WHITELISTED_PAGES.includes(pageName) &&
164+
((source && source.length > MAX_CHAR_LIMIT) ||
165+
renderedChars > MAX_CHAR_LIMIT ||
166+
renderedMermaidBlocks >= MAX_MERMAID_BLOCK_LIMIT ||
167+
shouldLazyLoadMermaidBlock(source))
147168
) {
148169
const html = `
149170
<div class="alert gl-alert gl-alert-warning alert-dismissible lazy-render-mermaid-container js-lazy-render-mermaid-container fade show" role="alert">

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

+24-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script>
22
import { GlModal, GlAlert } from '@gitlab/ui';
33
import { mapGetters, mapActions, mapState } from 'vuex';
4+
import ListLabel from '~/boards/models/label';
45
import { convertToGraphQLId } from '~/graphql_shared/utils';
56
import { getParameterByName } from '~/lib/utils/common_utils';
67
import { visitUrl } from '~/lib/utils/url_utility';
@@ -224,9 +225,6 @@ export default {
224225
},
225226
methods: {
226227
...mapActions(['setError', 'unsetError']),
227-
setIteration(iterationId) {
228-
this.board.iteration_id = iterationId;
229-
},
230228
boardCreateResponse(data) {
231229
return data.createBoard.board.webPath;
232230
},
@@ -237,6 +235,9 @@ export default {
237235
: '';
238236
return `${path}${param}`;
239237
},
238+
cancel() {
239+
this.$emit('cancel');
240+
},
240241
async createOrUpdateBoard() {
241242
const response = await this.$apollo.mutate({
242243
mutation: this.currentMutation,
@@ -280,9 +281,6 @@ export default {
280281
}
281282
}
282283
},
283-
cancel() {
284-
this.$emit('cancel');
285-
},
286284
resetFormState() {
287285
if (this.isNewForm) {
288286
// Clear the form when we open the "New board" modal
@@ -291,6 +289,25 @@ export default {
291289
this.board = { ...boardDefaults, ...this.currentBoard };
292290
}
293291
},
292+
setIteration(iterationId) {
293+
this.board.iteration_id = iterationId;
294+
},
295+
setBoardLabels(labels) {
296+
labels.forEach((label) => {
297+
if (label.set && !this.board.labels.find((l) => l.id === label.id)) {
298+
this.board.labels.push(
299+
new ListLabel({
300+
id: label.id,
301+
title: label.title,
302+
color: label.color,
303+
textColor: label.text_color,
304+
}),
305+
);
306+
} else if (!label.set) {
307+
this.board.labels = this.board.labels.filter((selected) => selected.id !== label.id);
308+
}
309+
});
310+
},
294311
},
295312
};
296313
</script>
@@ -357,6 +374,7 @@ export default {
357374
:group-id="groupId"
358375
:weights="weights"
359376
@set-iteration="setIteration"
377+
@set-board-labels="setBoardLabels"
360378
/>
361379
</form>
362380
</gl-modal>

app/assets/javascripts/emoji/awards_app/store/actions.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as Sentry from '@sentry/browser';
22
import axios from '~/lib/utils/axios_utils';
33
import { normalizeHeaders } from '~/lib/utils/common_utils';
4+
import { joinPaths } from '~/lib/utils/url_utility';
45
import { __ } from '~/locale';
56
import showToast from '~/vue_shared/plugins/global_toast';
67
import {
@@ -16,7 +17,9 @@ export const fetchAwards = async ({ commit, dispatch, state }, page = '1') => {
1617
if (!window.gon?.current_user_id) return;
1718

1819
try {
19-
const { data, headers } = await axios.get(state.path, { params: { per_page: 100, page } });
20+
const { data, headers } = await axios.get(joinPaths(gon.relative_url_root || '', state.path), {
21+
params: { per_page: 100, page },
22+
});
2023
const normalizedHeaders = normalizeHeaders(headers);
2124
const nextPage = normalizedHeaders['X-NEXT-PAGE'];
2225

@@ -35,13 +38,15 @@ export const toggleAward = async ({ commit, state }, name) => {
3538

3639
try {
3740
if (award) {
38-
await axios.delete(`${state.path}/${award.id}`);
41+
await axios.delete(joinPaths(gon.relative_url_root || '', `${state.path}/${award.id}`));
3942

4043
commit(REMOVE_AWARD, award.id);
4144

4245
showToast(__('Award removed'));
4346
} else {
44-
const { data } = await axios.post(state.path, { name });
47+
const { data } = await axios.post(joinPaths(gon.relative_url_root || '', state.path), {
48+
name,
49+
});
4550

4651
commit(ADD_NEW_AWARD, data);
4752

app/assets/javascripts/vue_shared/components/sidebar/labels_select/base.vue

-191
This file was deleted.

0 commit comments

Comments
 (0)