diff --git a/.gitlab/CODEOWNERS b/.gitlab/CODEOWNERS index b282ccc1871..37d1b04915f 100644 --- a/.gitlab/CODEOWNERS +++ b/.gitlab/CODEOWNERS @@ -1336,12 +1336,6 @@ lib/gitlab/checks/** /app/services/projects/refresh_build_artifacts_size_statistics_service.rb /app/uploaders/job_artifact_uploader.rb /app/validators/json_schemas/build_metadata_id_tokens.json -/app/views/projects/artifacts/ -/app/views/projects/generic_commit_statuses/ -/app/views/projects/jobs/ -/app/views/projects/pipeline_schedules/ -/app/views/projects/pipelines/ -/app/views/projects/triggers/ /app/workers/build_queue_worker.rb /app/workers/ci_platform_metrics_update_cron_worker.rb /app/workers/create_pipeline_worker.rb @@ -1408,6 +1402,12 @@ lib/gitlab/checks/** /**/javascripts/admin/application_settings/runner_token_expiration/ /**/javascripts/editor/schema/ci.json /app/**/ci/*.haml +/app/views/projects/artifacts/ +/app/views/projects/generic_commit_statuses/ +/app/views/projects/jobs/ +/app/views/projects/pipeline_schedules/ +/app/views/projects/pipelines/ +/app/views/projects/triggers/ /ee/app/**/ci/*.haml /ee/app/**/merge_trains/*.haml diff --git a/app/assets/javascripts/issues/list/index.js b/app/assets/javascripts/issues/list/index.js index 60dded566c6..8bbb77d11a2 100644 --- a/app/assets/javascripts/issues/list/index.js +++ b/app/assets/javascripts/issues/list/index.js @@ -84,6 +84,7 @@ export async function mountIssuesListApp() { emailsHelpPagePath, exportCsvPath, fullPath, + groupId, groupPath, hasAnyIssues, hasAnyProjects, @@ -113,10 +114,10 @@ export async function mountIssuesListApp() { rssPath, showNewIssueLink, signInPath, - groupId = '', - reportAbusePath, - registerPath, - issuesListPath, + wiCanAdminLabel, + wiIssuesListPath, + wiLabelsManagePath, + wiReportAbusePath, } = el.dataset; return new Vue({ @@ -155,10 +156,8 @@ export async function mountIssuesListApp() { canReadCrmContact: parseBoolean(canReadCrmContact), canReadCrmOrganization: parseBoolean(canReadCrmOrganization), fullPath, - projectPath: fullPath, + groupId, groupPath, - reportAbusePath, - registerPath, hasAnyIssues: parseBoolean(hasAnyIssues), hasAnyProjects: parseBoolean(hasAnyProjects), hasBlockedIssuesFeature: parseBoolean(hasBlockedIssuesFeature), @@ -197,8 +196,11 @@ export async function mountIssuesListApp() { markdownHelpPath, quickActionsHelpPath, resetPath, - groupId, - issuesListPath, + // For work item modal + canAdminLabel: wiCanAdminLabel, + issuesListPath: wiIssuesListPath, + labelsManagePath: wiLabelsManagePath, + reportAbusePath: wiReportAbusePath, }, render: (createComponent) => createComponent(IssuesListApp), }); diff --git a/app/assets/javascripts/issues/show/components/description.vue b/app/assets/javascripts/issues/show/components/description.vue index b09c2fca443..9c31f27149a 100644 --- a/app/assets/javascripts/issues/show/components/description.vue +++ b/app/assets/javascripts/issues/show/components/description.vue @@ -34,10 +34,6 @@ import TaskListItemActions from './task_list_item_actions.vue'; Vue.use(GlToast); -const workItemTypes = { - TASK: 'task', -}; - export default { directives: { SafeHtml, @@ -146,19 +142,14 @@ export default { this.initialUpdate = false; } - this.$nextTick(() => { - this.renderGFM(); - }); + this.renderGFM(); }, }, mounted() { eventHub.$on('convert-task-list-item', this.convertTaskListItem); eventHub.$on('delete-task-list-item', this.deleteTaskListItem); - // this.renderGFM(); - this.$nextTick(() => { - this.renderGFM(); - }); + this.renderGFM(); }, beforeDestroy() { eventHub.$off('convert-task-list-item', this.convertTaskListItem); @@ -167,7 +158,9 @@ export default { this.removeAllPointerEventListeners(); }, methods: { - renderGFM() { + async renderGFM() { + await this.$nextTick(); + renderGFM(this.$refs['gfm-content']); if (this.canUpdate) { @@ -177,15 +170,13 @@ export default { fieldName: 'description', lockVersion: this.lockVersion, selector: '.detail-page-description', - onUpdate: this.taskListUpdateStarted.bind(this), - onSuccess: this.taskListUpdateSuccess.bind(this), + onUpdate: () => this.$emit('taskListUpdateStarted'), + onSuccess: () => this.$emit('taskListUpdateSucceeded'), onError: this.taskListUpdateError.bind(this), }); this.removeAllPointerEventListeners(); - this.renderSortableLists(); - this.renderTaskListItemActions(); } }, @@ -263,30 +254,18 @@ export default { this.pointerEventListeners.delete(listItem); }); }, - taskListUpdateStarted() { - this.$emit('taskListUpdateStarted'); - }, - taskListUpdateSuccess() { - this.$emit('taskListUpdateSucceeded'); - }, taskListUpdateError() { - createAlert({ - message: sprintf( - __( - 'Someone edited this %{issueType} at the same time you did. The description has been updated and you will need to make your changes again.', - ), - { - issueType: this.issuableType, - }, - ), - }); + const message = __( + 'Someone edited this %{issueType} at the same time you did. The description has been updated and you will need to make your changes again.', + ); + createAlert({ message: sprintf(message, { issueType: this.issuableType }) }); this.$emit('taskListUpdateFailed'); }, - createTaskListItemActions(provide) { + createTaskListItemActions() { const app = new Vue({ el: document.createElement('div'), - provide, + provide: { issuableType: this.issuableType }, render: (createElement) => createElement(TaskListItemActions), }); return app.$el; @@ -310,8 +289,7 @@ export default { ); taskListItems?.forEach((item) => { - const provide = { canUpdate: this.canUpdate, issuableType: this.issuableType }; - const dropdown = this.createTaskListItemActions(provide); + const dropdown = this.createTaskListItemActions(); this.insertNextToTaskListItemText(dropdown, item); this.addPointerEventListeners(item, '.task-list-item-actions'); this.hasTaskListItemActions = true; @@ -419,7 +397,7 @@ export default { }, showAlert(message, error) { createAlert({ - message: sprintfWorkItem(message, workItemTypes.TASK), + message: sprintfWorkItem(message, WORK_ITEM_TYPE_VALUE_TASK), error, captureError: true, }); diff --git a/app/assets/javascripts/issues/show/components/task_list_item_actions.vue b/app/assets/javascripts/issues/show/components/task_list_item_actions.vue index 7aee3a01408..342b93c1080 100644 --- a/app/assets/javascripts/issues/show/components/task_list_item_actions.vue +++ b/app/assets/javascripts/issues/show/components/task_list_item_actions.vue @@ -1,20 +1,14 @@ diff --git a/app/assets/javascripts/work_items/components/shared/work_item_sidebar_dropdown_widget.vue b/app/assets/javascripts/work_items/components/shared/work_item_sidebar_dropdown_widget.vue index 14250e2fa06..4926934026e 100644 --- a/app/assets/javascripts/work_items/components/shared/work_item_sidebar_dropdown_widget.vue +++ b/app/assets/javascripts/work_items/components/shared/work_item_sidebar_dropdown_widget.vue @@ -218,6 +218,7 @@ export default { - {{ __('Create project label') }} + {{ createLabelText }} - {{ __('Manage project labels') }} + {{ manageLabelText }}