From 4958d96e262f6b31b2850123e4949536555b2d29 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 6 Jun 2023 12:07:34 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- .../abuse_report/components/report_actions.vue | 14 +- .../abuse_report/components/report_header.vue | 1 + .../javascripts/admin/abuse_report/constants.js | 4 +- .../javascripts/diffs/components/diff_content.vue | 25 ++- .../javascripts/diffs/components/diff_file.vue | 5 +- app/assets/javascripts/diffs/store/actions.js | 5 +- app/assets/javascripts/groups/components/app.vue | 4 - .../groups/components/overview_tabs.vue | 2 +- app/assets/javascripts/groups/index.js | 5 +- .../notes/mixins/diff_line_note_form.js | 3 +- .../repository/components/fork_info.vue | 3 - .../components/work_item_description.vue | 173 +++++++++------------ app/controllers/projects/blob_controller.rb | 1 - app/controllers/projects/tree_controller.rb | 1 - app/controllers/projects_controller.rb | 1 - app/finders/template_finder.rb | 11 +- app/graphql/mutations/projects/sync_fork.rb | 3 - app/helpers/avatars_helper.rb | 19 ++- app/models/blob.rb | 1 - app/models/blob_viewer/metrics_dashboard_yml.rb | 45 ------ app/views/dashboard/groups/_groups.html.haml | 2 +- app/views/explore/groups/_groups.html.haml | 2 +- app/views/projects/network/show.json.erb | 2 +- 23 files changed, 142 insertions(+), 190 deletions(-) delete mode 100644 app/models/blob_viewer/metrics_dashboard_yml.rb (limited to 'app') diff --git a/app/assets/javascripts/admin/abuse_report/components/report_actions.vue b/app/assets/javascripts/admin/abuse_report/components/report_actions.vue index 25b22afbf84..57d5d46ceb4 100644 --- a/app/assets/javascripts/admin/abuse_report/components/report_actions.vue +++ b/app/assets/javascripts/admin/abuse_report/components/report_actions.vue @@ -13,6 +13,7 @@ import { getContentWrapperHeight } from '~/lib/utils/dom_utils'; import { DRAWER_Z_INDEX } from '~/lib/utils/constants'; import { ACTIONS_I18N, + NO_ACTION, USER_ACTION_OPTIONS, REASON_OPTIONS, STATUS_OPEN, @@ -40,6 +41,10 @@ export default { GlDrawer, }, props: { + user: { + type: Object, + required: true, + }, report: { type: Object, required: true, @@ -66,6 +71,12 @@ export default { isOpen() { return this.report.status === STATUS_OPEN; }, + isNotCurrentUser() { + return this.user.username !== gon.current_username; + }, + userActionOptions() { + return this.isNotCurrentUser ? USER_ACTION_OPTIONS : [NO_ACTION]; + }, }, methods: { toggleActionsDrawer() { @@ -111,7 +122,6 @@ export default { }, }, i18n: ACTIONS_I18N, - userActionOptions: USER_ACTION_OPTIONS, reasonOptions: REASON_OPTIONS, DRAWER_Z_INDEX, }; @@ -144,7 +154,7 @@ export default { id="action" v-model="form.user_action" data-testid="action-select" - :options="$options.userActionOptions" + :options="userActionOptions" :state="validationState.action" @change="validateAction" /> diff --git a/app/assets/javascripts/admin/abuse_report/components/report_header.vue b/app/assets/javascripts/admin/abuse_report/components/report_header.vue index 1b9a6a1df6a..624dcd47650 100644 --- a/app/assets/javascripts/admin/abuse_report/components/report_header.vue +++ b/app/assets/javascripts/admin/abuse_report/components/report_header.vue @@ -81,6 +81,7 @@ export default { {{ $options.i18n.adminProfile }} -import { GlLoadingIcon } from '@gitlab/ui'; +import { GlLoadingIcon, GlButton } from '@gitlab/ui'; import { mapActions, mapGetters, mapState } from 'vuex'; import { mapParallel } from 'ee_else_ce/diffs/components/diff_row_utils'; import DiffFileDrafts from '~/batch_comments/components/diff_file_drafts.vue'; @@ -21,6 +21,7 @@ import ImageDiffOverlay from './image_diff_overlay.vue'; export default { components: { GlLoadingIcon, + GlButton, DiffView, DiffViewer, NoteForm, @@ -59,7 +60,10 @@ export default { return this.diffFile.viewer.name; }, isTextFile() { - return this.diffViewerMode === diffViewerModes.text; + return this.diffViewerMode === diffViewerModes.text && !this.diffFile.viewer.whitespace_only; + }, + isWhitespaceOnly() { + return this.diffFile.viewer.whitespace_only; }, noPreview() { return this.diffViewerMode === diffViewerModes.no_preview; @@ -122,6 +126,23 @@ export default { /> +
+ {{ __('Contains only whitespace changes.') }} + + {{ __('Show changes') }} + +
{ idState.isLoadingCollapsedDiff = false; idState.hasLoadedCollapsedDiff = true; @@ -461,6 +461,7 @@ export default { :class="hasBodyClasses.content" :diff-file="file" :help-page-path="helpPagePath" + @load-file="requestDiff" /> diff --git a/app/assets/javascripts/diffs/store/actions.js b/app/assets/javascripts/diffs/store/actions.js index 9fd816b971b..3d27bb180e6 100644 --- a/app/assets/javascripts/diffs/store/actions.js +++ b/app/assets/javascripts/diffs/store/actions.js @@ -525,11 +525,12 @@ export const scrollToLineIfNeededParallel = (_, line) => { } }; -export const loadCollapsedDiff = ({ commit, getters, state }, file) => { +export const loadCollapsedDiff = ({ commit, getters, state }, { file, params = {} }) => { const versionPath = state.mergeRequestDiff?.version_path; const loadParams = { commit_id: getters.commitId, w: state.showWhitespace ? '0' : '1', + ...params, }; if (versionPath) { @@ -830,7 +831,7 @@ export const toggleFullDiff = ({ dispatch, commit, getters, state }, filePath) = commit(types.REQUEST_FULL_DIFF, filePath); if (file.isShowingFullFile) { - dispatch('loadCollapsedDiff', file) + dispatch('loadCollapsedDiff', { file }) .then(() => dispatch('assignDiscussionsToDiff', getters.getDiffFileDiscussions(file))) .catch(() => dispatch('receiveFullDiffError', filePath)); } else { diff --git a/app/assets/javascripts/groups/components/app.vue b/app/assets/javascripts/groups/components/app.vue index 82eddf5603f..ebfffdaaf50 100644 --- a/app/assets/javascripts/groups/components/app.vue +++ b/app/assets/javascripts/groups/components/app.vue @@ -41,10 +41,6 @@ export default { type: Object, required: true, }, - hideProjects: { - type: Boolean, - required: true, - }, }, data() { return { diff --git a/app/assets/javascripts/groups/components/overview_tabs.vue b/app/assets/javascripts/groups/components/overview_tabs.vue index 79a2e11b0bb..982dab45117 100644 --- a/app/assets/javascripts/groups/components/overview_tabs.vue +++ b/app/assets/javascripts/groups/components/overview_tabs.vue @@ -176,7 +176,7 @@ export default { :title="title" :lazy="lazy" > - + diff --git a/app/assets/javascripts/groups/index.js b/app/assets/javascripts/groups/index.js index f4981c020cd..df2a23dc0f7 100644 --- a/app/assets/javascripts/groups/index.js +++ b/app/assets/javascripts/groups/index.js @@ -73,17 +73,15 @@ export default (containerId = 'js-groups-tree', endpoint, action = '') => { }, data() { const { dataset } = dataEl || this.$options.el; - const hideProjects = parseBoolean(dataset.hideProjects); const showSchemaMarkup = parseBoolean(dataset.showSchemaMarkup); const renderEmptyState = parseBoolean(dataset.renderEmptyState); const service = new GroupsService(endpoint || dataset.endpoint); - const store = new GroupsStore({ hideProjects, showSchemaMarkup }); + const store = new GroupsStore({ hideProjects: true, showSchemaMarkup }); return { action, store, service, - hideProjects, renderEmptyState, loading: true, containerId, @@ -120,7 +118,6 @@ export default (containerId = 'js-groups-tree', endpoint, action = '') => { action: this.action, store: this.store, service: this.service, - hideProjects: this.hideProjects, renderEmptyState: this.renderEmptyState, containerId: this.containerId, }, diff --git a/app/assets/javascripts/notes/mixins/diff_line_note_form.js b/app/assets/javascripts/notes/mixins/diff_line_note_form.js index 0509ff24959..20ffcda282a 100644 --- a/app/assets/javascripts/notes/mixins/diff_line_note_form.js +++ b/app/assets/javascripts/notes/mixins/diff_line_note_form.js @@ -15,7 +15,7 @@ export default { }), ...mapGetters('diffs', ['getDiffFileByHash']), ...mapGetters('batchComments', ['shouldRenderDraftRowInDiscussion', 'draftForDiscussion']), - ...mapState('diffs', ['commit']), + ...mapState('diffs', ['commit', 'showWhitespace']), }, methods: { ...mapActions('diffs', ['cancelCommentForm']), @@ -67,6 +67,7 @@ export default { positionType, ...this.diffFileCommentForm, lineRange, + showWhitespace: this.showWhitespace, }); const diffFileHeadSha = this.commit && this?.diffFile?.diff_refs?.head_sha; diff --git a/app/assets/javascripts/repository/components/fork_info.vue b/app/assets/javascripts/repository/components/fork_info.vue index e4a10784bd5..42108e8dfba 100644 --- a/app/assets/javascripts/repository/components/fork_info.vue +++ b/app/assets/javascripts/repository/components/fork_info.vue @@ -3,7 +3,6 @@ import { GlIcon, GlLink, GlSkeletonLoader, GlLoadingIcon, GlSprintf, GlButton } import { s__, sprintf, n__ } from '~/locale'; import { createAlert, VARIANT_INFO } from '~/alert'; import syncForkMutation from '~/repository/mutations/sync_fork.mutation.graphql'; -import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import eventHub from '../event_hub'; import { POLLING_INTERVAL_DEFAULT, @@ -43,7 +42,6 @@ export default { ConflictsModal, GlLoadingIcon, }, - mixins: [glFeatureFlagMixin()], apollo: { project: { query: forkDetailsQuery, @@ -198,7 +196,6 @@ export default { }, hasUpdateButton() { return ( - this.glFeatures.synchronizeFork && this.canSyncBranch && ((this.sourceName && this.forkDetails && this.behind) || this.isUnknownDivergence) ); diff --git a/app/assets/javascripts/work_items/components/work_item_description.vue b/app/assets/javascripts/work_items/components/work_item_description.vue index 988a28704d4..61dec21cae4 100644 --- a/app/assets/javascripts/work_items/components/work_item_description.vue +++ b/app/assets/javascripts/work_items/components/work_item_description.vue @@ -1,5 +1,5 @@