diff --git a/Gemfile b/Gemfile index 768d28fa9b2..d091e51f931 100644 --- a/Gemfile +++ b/Gemfile @@ -309,7 +309,7 @@ gem 'pg_query', '~> 1.3.0' gem 'premailer-rails', '~> 1.10.3' # LabKit: Tracing and Correlation -gem 'gitlab-labkit', '0.13.5' +gem 'gitlab-labkit', '0.14.0' # I18n gem 'ruby_parser', '~> 3.15', require: false diff --git a/Gemfile.lock b/Gemfile.lock index a39a504e34b..af8c1d5b50f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -432,9 +432,9 @@ GEM fog-json (~> 1.2.0) mime-types ms_rest_azure (~> 0.12.0) - gitlab-labkit (0.13.5) - actionpack (>= 5.0.0, < 6.1.0) - activesupport (>= 5.0.0, < 6.1.0) + gitlab-labkit (0.14.0) + actionpack (>= 5.0.0, < 7.0.0) + activesupport (>= 5.0.0, < 7.0.0) gitlab-pg_query (~> 1.3) grpc (~> 1.19) jaeger-client (~> 1.1) @@ -1363,7 +1363,7 @@ DEPENDENCIES gitlab-chronic (~> 0.10.5) gitlab-experiment (~> 0.4.4) gitlab-fog-azure-rm (~> 1.0) - gitlab-labkit (= 0.13.5) + gitlab-labkit (= 0.14.0) gitlab-license (~> 1.0) gitlab-mail_room (~> 0.0.8) gitlab-markup (~> 1.7.1) diff --git a/app/assets/javascripts/blob/file_template_selector.js b/app/assets/javascripts/blob/file_template_selector.js index 2532aeea989..a5c8050b772 100644 --- a/app/assets/javascripts/blob/file_template_selector.js +++ b/app/assets/javascripts/blob/file_template_selector.js @@ -66,6 +66,8 @@ export default class FileTemplateSelector { reportSelectionName(options) { const opts = options; opts.query = options.selectedObj.name; + opts.data = options.selectedObj; + opts.data.source_template_project_id = options.selectedObj.project_id; this.reportSelection(opts); } diff --git a/app/assets/javascripts/blob/template_selectors/license_selector.js b/app/assets/javascripts/blob/template_selectors/license_selector.js index affa20997e9..7e32ede96df 100644 --- a/app/assets/javascripts/blob/template_selectors/license_selector.js +++ b/app/assets/javascripts/blob/template_selectors/license_selector.js @@ -30,6 +30,7 @@ export default class BlobLicenseSelector extends FileTemplateSelector { const data = { project: this.$dropdown.data('project'), fullname: this.$dropdown.data('fullname'), + source_template_project_id: query.project_id, }; this.reportSelection({ diff --git a/app/assets/javascripts/boards/components/board_card_layout.vue b/app/assets/javascripts/boards/components/board_card_layout.vue index 350d709abfd..8b0265237ba 100644 --- a/app/assets/javascripts/boards/components/board_card_layout.vue +++ b/app/assets/javascripts/boards/components/board_card_layout.vue @@ -4,7 +4,7 @@ import IssueCardInnerDeprecated from './issue_card_inner_deprecated.vue'; import boardsStore from '../stores/boards_store'; export default { - name: 'BoardsIssueCard', + name: 'BoardCardLayout', components: { IssueCardInner: gon.features?.graphqlBoardLists ? IssueCardInner : IssueCardInnerDeprecated, }, @@ -81,7 +81,7 @@ export default { :data-issue-iid="issue.iid" :data-issue-path="issue.referencePath" data-testid="board_card" - class="board-card p-3 rounded" + class="board-card gl-p-5 gl-rounded-base" @mousedown="mouseDown" @mousemove="mouseMove" @mouseup="showIssue($event)" diff --git a/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown.js b/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown.js index 99351231520..98858f20518 100644 --- a/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown.js +++ b/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown.js @@ -437,6 +437,7 @@ export class GitLabDropdown { groupName = el.data('group'); if (groupName) { selectedIndex = el.data('index'); + this.selectedIndex = selectedIndex; selectedObject = this.renderedData[groupName][selectedIndex]; } else { selectedIndex = el.closest('li').index(); diff --git a/app/assets/javascripts/editor/extensions/editor_ci_schema_ext.js b/app/assets/javascripts/editor/extensions/editor_ci_schema_ext.js index 05d938c57ce..eb47c20912e 100644 --- a/app/assets/javascripts/editor/extensions/editor_ci_schema_ext.js +++ b/app/assets/javascripts/editor/extensions/editor_ci_schema_ext.js @@ -17,15 +17,21 @@ export class CiSchemaExtension extends EditorLiteExtension { * @param {String?} opts.ref - Current ref. Defaults to master */ registerCiSchema({ projectNamespace, projectPath, ref = 'master' } = {}) { - const ciSchemaUri = Api.buildUrl(Api.projectFileSchemaPath) + const ciSchemaPath = Api.buildUrl(Api.projectFileSchemaPath) .replace(':namespace_path', projectNamespace) .replace(':project_path', projectPath) .replace(':ref', ref) .replace(':filename', EXTENSION_CI_SCHEMA_FILE_NAME_MATCH); + // In order for workers loaded from `data://` as the + // ones loaded by monaco editor, we use absolute URLs + // to fetch schema files, hence the `gon.gitlab_url` + // reference. This prevents error: + // "Failed to execute 'fetch' on 'WorkerGlobalScope'" + const absoluteSchemaUrl = gon.gitlab_url + ciSchemaPath; const modelFileName = this.getModel().uri.path.split('/').pop(); registerSchema({ - uri: ciSchemaUri, + uri: absoluteSchemaUrl, fileMatch: [modelFileName], }); } diff --git a/app/assets/javascripts/ide/stores/actions/file.js b/app/assets/javascripts/ide/stores/actions/file.js index 004e38b0a25..42668dec63a 100644 --- a/app/assets/javascripts/ide/stores/actions/file.js +++ b/app/assets/javascripts/ide/stores/actions/file.js @@ -17,15 +17,8 @@ export const closeFile = ({ commit, state, dispatch, getters }, file) => { const indexOfClosedFile = state.openFiles.findIndex((f) => f.key === file.key); const fileWasActive = file.active; - if (file.pending) { - commit(types.REMOVE_PENDING_TAB, file); - } else { - commit(types.TOGGLE_FILE_OPEN, path); - commit(types.SET_FILE_ACTIVE, { path, active: false }); - } - - if (state.openFiles.length > 0 && fileWasActive) { - const nextIndexToOpen = indexOfClosedFile === 0 ? 0 : indexOfClosedFile - 1; + if (state.openFiles.length > 1 && fileWasActive) { + const nextIndexToOpen = indexOfClosedFile === 0 ? 1 : indexOfClosedFile - 1; const nextFileToOpen = state.openFiles[nextIndexToOpen]; if (nextFileToOpen.pending) { @@ -35,14 +28,22 @@ export const closeFile = ({ commit, state, dispatch, getters }, file) => { keyPrefix: nextFileToOpen.staged ? 'staged' : 'unstaged', }); } else { + dispatch('setFileActive', nextFileToOpen.path); dispatch('router/push', getters.getUrlForPath(nextFileToOpen.path), { root: true }); } - } else if (!state.openFiles.length) { + } else if (state.openFiles.length === 1) { dispatch('router/push', `/project/${state.currentProjectId}/tree/${state.currentBranchId}/`, { root: true, }); } + if (file.pending) { + commit(types.REMOVE_PENDING_TAB, file); + } else { + commit(types.TOGGLE_FILE_OPEN, path); + commit(types.SET_FILE_ACTIVE, { path, active: false }); + } + eventHub.$emit(`editor.update.model.dispose.${file.key}`); }; diff --git a/app/assets/javascripts/incidents_settings/constants.js b/app/assets/javascripts/incidents_settings/constants.js index fcac9c519c2..818af4ecb90 100644 --- a/app/assets/javascripts/incidents_settings/constants.js +++ b/app/assets/javascripts/incidents_settings/constants.js @@ -51,7 +51,7 @@ export const NO_ISSUE_TEMPLATE_SELECTED = { key: '', name: __('No template selec export const TAKING_INCIDENT_ACTION_DOCS_LINK = '/help/operations/metrics/alerts#trigger-actions-from-alerts'; export const ISSUE_TEMPLATES_DOCS_LINK = - '/help/user/project/description_templates#creating-issue-templates'; + '/help/user/project/description_templates#create-an-issue-template'; /* PagerDuty integration settings constants */ diff --git a/app/assets/javascripts/issue_show/components/app.vue b/app/assets/javascripts/issue_show/components/app.vue index d569ad573a2..87dc31e6292 100644 --- a/app/assets/javascripts/issue_show/components/app.vue +++ b/app/assets/javascripts/issue_show/components/app.vue @@ -132,6 +132,10 @@ export default { type: String, required: true, }, + projectId: { + type: Number, + required: true, + }, projectNamespace: { type: String, required: true, @@ -303,7 +307,7 @@ export default { }); }, - updateAndShowForm(templates = []) { + updateAndShowForm(templates = {}) { if (!this.showForm) { this.showForm = true; this.store.setFormState({ @@ -419,6 +423,7 @@ export default { :markdown-docs-path="markdownDocsPath" :markdown-preview-path="markdownPreviewPath" :project-path="projectPath" + :project-id="projectId" :project-namespace="projectNamespace" :show-delete-button="showDeleteButton" :can-attach-file="canAttachFile" diff --git a/app/assets/javascripts/issue_show/components/fields/description_template.vue b/app/assets/javascripts/issue_show/components/fields/description_template.vue index 71299381aae..f23bb394683 100644 --- a/app/assets/javascripts/issue_show/components/fields/description_template.vue +++ b/app/assets/javascripts/issue_show/components/fields/description_template.vue @@ -13,14 +13,18 @@ export default { required: true, }, issuableTemplates: { - type: Array, + type: Object, required: false, - default: () => [], + default: () => {}, }, projectPath: { type: String, required: true, }, + projectId: { + type: Number, + required: true, + }, projectNamespace: { type: String, required: true, @@ -48,11 +52,12 @@ export default {