diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-08 06:08:19 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-08 06:08:19 +0300 |
commit | bf293d47937b3332462689c3fecc868706553f3a (patch) | |
tree | 47f0f1063aa27e4529c23068537ce45d6adb4cf0 /app/assets | |
parent | 356e3c444dc8fab920d3547461b6ae721c5eb50f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets')
11 files changed, 43 insertions, 139 deletions
diff --git a/app/assets/javascripts/analytics/shared/constants.js b/app/assets/javascripts/analytics/shared/constants.js index 9463286e53e..25699c17b10 100644 --- a/app/assets/javascripts/analytics/shared/constants.js +++ b/app/assets/javascripts/analytics/shared/constants.js @@ -133,15 +133,15 @@ export const METRIC_TOOLTIPS = { }, [VULNERABILITY_METRICS.CRITICAL]: { description: s__('ValueStreamAnalytics|Critical vulnerabilities over time.'), - groupLink: '-/security/vulnerabilities', - projectLink: '-/security/vulnerability_report', - docsLink: helpPagePath('user/application_security/vulnerability_report/index'), + groupLink: '-/security/vulnerabilities?severity=CRITICAL', + projectLink: '-/security/vulnerability_report?severity=CRITICAL', + docsLink: helpPagePath('user/application_security/vulnerabilities/severities.html'), }, [VULNERABILITY_METRICS.HIGH]: { description: s__('ValueStreamAnalytics|High vulnerabilities over time.'), - groupLink: '-/security/vulnerabilities', - projectLink: '-/security/vulnerability_report', - docsLink: helpPagePath('user/application_security/vulnerability_report/index'), + groupLink: '-/security/vulnerabilities?severity=HIGH', + projectLink: '-/security/vulnerability_report?severity=HIGH', + docsLink: helpPagePath('user/application_security/vulnerabilities/severities.html'), }, [MERGE_REQUEST_METRICS.THROUGHPUT]: { description: s__('ValueStreamAnalytics|The number of merge requests merged by month.'), diff --git a/app/assets/javascripts/diffs/components/app.vue b/app/assets/javascripts/diffs/components/app.vue index f644c69f0a0..c0a9643e59e 100644 --- a/app/assets/javascripts/diffs/components/app.vue +++ b/app/assets/javascripts/diffs/components/app.vue @@ -90,22 +90,6 @@ export default { ALERT_COLLAPSED_FILES, }, props: { - endpoint: { - type: String, - required: true, - }, - endpointMetadata: { - type: String, - required: true, - }, - endpointBatch: { - type: String, - required: true, - }, - endpointDiffForPath: { - type: String, - required: true, - }, endpointCoverage: { type: String, required: false, @@ -116,15 +100,6 @@ export default { required: false, default: '', }, - endpointUpdateUser: { - type: String, - required: false, - default: '', - }, - projectPath: { - type: String, - required: true, - }, shouldShow: { type: Boolean, required: false, @@ -144,51 +119,6 @@ export default { required: false, default: '', }, - isFluidLayout: { - type: Boolean, - required: false, - default: false, - }, - dismissEndpoint: { - type: String, - required: false, - default: '', - }, - showSuggestPopover: { - type: Boolean, - required: false, - default: false, - }, - fileByFileUserPreference: { - type: Boolean, - required: false, - default: false, - }, - defaultSuggestionCommitMessage: { - type: String, - required: false, - default: '', - }, - rehydratedMrReviews: { - type: Object, - required: false, - default: () => ({}), - }, - sourceProjectDefaultUrl: { - type: String, - required: false, - default: '', - }, - sourceProjectFullPath: { - type: String, - required: false, - default: '', - }, - isForked: { - type: Boolean, - required: false, - default: false, - }, }, data() { const treeWidth = @@ -343,21 +273,6 @@ export default { renderFileTree: 'adjustView', }, mounted() { - this.setBaseConfig({ - endpoint: this.endpoint, - endpointMetadata: this.endpointMetadata, - endpointBatch: this.endpointBatch, - endpointDiffForPath: this.endpointDiffForPath, - endpointCoverage: this.endpointCoverage, - endpointUpdateUser: this.endpointUpdateUser, - projectPath: this.projectPath, - dismissEndpoint: this.dismissEndpoint, - showSuggestPopover: this.showSuggestPopover, - viewDiffsFileByFile: this.fileByFileUserPreference || false, - defaultSuggestionCommitMessage: this.defaultSuggestionCommitMessage, - mrReviews: this.rehydratedMrReviews, - }); - if (this.endpointCodequality) { this.setCodequalityEndpoint(this.endpointCodequality); } diff --git a/app/assets/javascripts/diffs/index.js b/app/assets/javascripts/diffs/index.js index 53c27632c4f..29cf90dcbe2 100644 --- a/app/assets/javascripts/diffs/index.js +++ b/app/assets/javascripts/diffs/index.js @@ -9,8 +9,6 @@ import eventHub from '../notes/event_hub'; import DiffsApp from './components/app.vue'; import { TREE_LIST_STORAGE_KEY, DIFF_WHITESPACE_COOKIE_NAME } from './constants'; -import { getReviewsForMergeRequest } from './utils/file_reviews'; -import { getDerivedMergeRequestInformation } from './utils/merge_request'; export default function initDiffsApp(store = notesStore) { const el = document.getElementById('js-diffs-app'); @@ -32,26 +30,13 @@ export default function initDiffsApp(store = notesStore) { }, data() { return { - endpoint: dataset.endpoint, - endpointMetadata: dataset.endpointMetadata || '', - endpointBatch: dataset.endpointBatch || '', - endpointDiffForPath: dataset.endpointDiffForPath || '', endpointCoverage: dataset.endpointCoverage || '', endpointCodequality: dataset.endpointCodequality || '', - endpointUpdateUser: dataset.updateCurrentUserPath, - projectPath: dataset.projectPath, helpPagePath: dataset.helpPagePath, currentUser: JSON.parse(dataset.currentUserData) || {}, changesEmptyStateIllustration: dataset.changesEmptyStateIllustration, - isFluidLayout: parseBoolean(dataset.isFluidLayout), dismissEndpoint: dataset.dismissEndpoint, - showSuggestPopover: parseBoolean(dataset.showSuggestPopover), showWhitespaceDefault: parseBoolean(dataset.showWhitespaceDefault), - viewDiffsFileByFile: parseBoolean(dataset.fileByFileDefault), - defaultSuggestionCommitMessage: dataset.defaultSuggestionCommitMessage, - sourceProjectDefaultUrl: dataset.sourceProjectDefaultUrl, - sourceProjectFullPath: dataset.sourceProjectFullPath, - isForked: parseBoolean(dataset.isForked), }; }, computed: { @@ -90,31 +75,14 @@ export default function initDiffsApp(store = notesStore) { ...mapActions('diffs', ['setRenderTreeList', 'setShowWhitespace']), }, render(createElement) { - const { mrPath } = getDerivedMergeRequestInformation({ endpoint: this.endpoint }); - return createElement('diffs-app', { props: { - endpoint: this.endpoint, - endpointMetadata: this.endpointMetadata, - endpointBatch: this.endpointBatch, - endpointDiffForPath: this.endpointDiffForPath, endpointCoverage: this.endpointCoverage, endpointCodequality: this.endpointCodequality, - endpointUpdateUser: this.endpointUpdateUser, currentUser: this.currentUser, - projectPath: this.projectPath, helpPagePath: this.helpPagePath, shouldShow: this.activeTab === 'diffs', changesEmptyStateIllustration: this.changesEmptyStateIllustration, - isFluidLayout: this.isFluidLayout, - dismissEndpoint: this.dismissEndpoint, - showSuggestPopover: this.showSuggestPopover, - fileByFileUserPreference: this.viewDiffsFileByFile, - defaultSuggestionCommitMessage: this.defaultSuggestionCommitMessage, - rehydratedMrReviews: getReviewsForMergeRequest(mrPath), - sourceProjectDefaultUrl: this.sourceProjectDefaultUrl, - sourceProjectFullPath: this.sourceProjectFullPath, - isForked: this.isForked, }, }); }, diff --git a/app/assets/javascripts/lib/utils/constants.js b/app/assets/javascripts/lib/utils/constants.js index fb69a61880a..d1e5e4eea13 100644 --- a/app/assets/javascripts/lib/utils/constants.js +++ b/app/assets/javascripts/lib/utils/constants.js @@ -27,7 +27,7 @@ export const DRAWER_Z_INDEX = 252; export const MIN_USERNAME_LENGTH = 2; -export const BYTES_FORMAT_BYTES = 'Bytes'; +export const BYTES_FORMAT_BYTES = 'B'; export const BYTES_FORMAT_KIB = 'KiB'; export const BYTES_FORMAT_MIB = 'MiB'; export const BYTES_FORMAT_GIB = 'GiB'; diff --git a/app/assets/javascripts/lib/utils/number_utils.js b/app/assets/javascripts/lib/utils/number_utils.js index d64f84d2040..0e943cdb623 100644 --- a/app/assets/javascripts/lib/utils/number_utils.js +++ b/app/assets/javascripts/lib/utils/number_utils.js @@ -106,7 +106,7 @@ export function numberToHumanSize(size, digits = 2) { switch (format) { case BYTES_FORMAT_BYTES: - return sprintf(__('%{size} bytes'), { size: humanSize }); + return sprintf(__('%{size} B'), { size: humanSize }); case BYTES_FORMAT_KIB: return sprintf(__('%{size} KiB'), { size: humanSize }); case BYTES_FORMAT_MIB: diff --git a/app/assets/javascripts/mr_notes/init.js b/app/assets/javascripts/mr_notes/init.js index 9852efea95f..e8e3376cee2 100644 --- a/app/assets/javascripts/mr_notes/init.js +++ b/app/assets/javascripts/mr_notes/init.js @@ -1,12 +1,14 @@ import { parseBoolean } from '~/lib/utils/common_utils'; -import store from '~/mr_notes/stores'; +import mrNotes from '~/mr_notes/stores'; import { getLocationHash } from '~/lib/utils/url_utility'; import eventHub from '~/notes/event_hub'; import { initReviewBar } from '~/batch_comments'; import { initDiscussionCounter } from '~/mr_notes/discussion_counter'; import { initOverviewTabCounter } from '~/mr_notes/init_count'; +import { getDerivedMergeRequestInformation } from '~/diffs/utils/merge_request'; +import { getReviewsForMergeRequest } from '~/diffs/utils/file_reviews'; -function setupMrNotesState(notesDataset) { +function setupMrNotesState(store, notesDataset, diffsDataset) { const noteableData = JSON.parse(notesDataset.noteableData); noteableData.noteableType = notesDataset.noteableType; noteableData.targetType = notesDataset.targetType; @@ -15,26 +17,43 @@ function setupMrNotesState(notesDataset) { const currentUserData = JSON.parse(notesDataset.currentUserData); const endpoints = { metadata: notesDataset.endpointMetadata }; + const { mrPath } = getDerivedMergeRequestInformation({ endpoint: diffsDataset.endpoint }); + store.dispatch('setNotesData', notesData); store.dispatch('setNoteableData', noteableData); store.dispatch('setUserData', currentUserData); store.dispatch('setTargetNoteHash', getLocationHash()); store.dispatch('setEndpoints', endpoints); + store.dispatch('diffs/setBaseConfig', { + endpoint: diffsDataset.endpoint, + endpointMetadata: diffsDataset.endpointMetadata, + endpointBatch: diffsDataset.endpointBatch, + endpointDiffForPath: diffsDataset.endpointDiffForPath, + endpointCoverage: diffsDataset.endpointCoverage, + endpointUpdateUser: diffsDataset.updateCurrentUserPath, + projectPath: diffsDataset.projectPath, + dismissEndpoint: diffsDataset.dismissEndpoint, + showSuggestPopover: parseBoolean(diffsDataset.showSuggestPopover), + viewDiffsFileByFile: parseBoolean(diffsDataset.fileByFileDefault), + defaultSuggestionCommitMessage: diffsDataset.defaultSuggestionCommitMessage, + mrReviews: getReviewsForMergeRequest(mrPath), + }); } -export function initMrStateLazyLoad({ reviewBarParams } = {}) { +export function initMrStateLazyLoad(store = mrNotes, { reviewBarParams } = {}) { store.dispatch('setActiveTab', window.mrTabs.getCurrentAction()); window.mrTabs.eventHub.$on('MergeRequestTabChange', (value) => store.dispatch('setActiveTab', value), ); const discussionsEl = document.getElementById('js-vue-mr-discussions'); - const notesDataset = discussionsEl.dataset; + const diffsEl = document.getElementById('js-diffs-app'); + let stop = () => {}; stop = store.watch( (state) => state.page.activeTab, (activeTab) => { - setupMrNotesState(notesDataset); + setupMrNotesState(store, discussionsEl.dataset, diffsEl.dataset); // prevent loading MR state on commits and pipelines pages // this is due to them having a shared controller with the Overview page diff --git a/app/assets/javascripts/mr_notes/init_mr_notes.js b/app/assets/javascripts/mr_notes/init_mr_notes.js index e0a8d1f7e7d..3fcf0958868 100644 --- a/app/assets/javascripts/mr_notes/init_mr_notes.js +++ b/app/assets/javascripts/mr_notes/init_mr_notes.js @@ -13,7 +13,7 @@ export default function initMrNotes(lazyLoadParams) { action: mrShowNode.dataset.mrAction, }); - initMrStateLazyLoad(lazyLoadParams); + initMrStateLazyLoad(undefined, lazyLoadParams); document.addEventListener('merged:UpdateActions', () => { initRevertCommitModal('i_code_review_post_merge_submit_revert_modal'); diff --git a/app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/details.js b/app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/details.js index 7ac803a8ece..3a5992d182a 100644 --- a/app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/details.js +++ b/app/assets/javascripts/packages_and_registries/container_registry/explorer/constants/details.js @@ -68,7 +68,7 @@ export const MISSING_MANIFEST_WARNING_TOOLTIP = s__( export const CREATED_AT = s__('ContainerRegistry|Created %{time}'); export const NOT_AVAILABLE_TEXT = __('Not applicable.'); -export const NOT_AVAILABLE_SIZE = __('0 bytes'); +export const NOT_AVAILABLE_SIZE = __('0 B'); export const CLEANUP_UNSCHEDULED_TEXT = s__('ContainerRegistry|Cleanup will run %{time}'); export const CLEANUP_SCHEDULED_TEXT = s__('ContainerRegistry|Cleanup pending'); diff --git a/app/assets/javascripts/packages_and_registries/harbor_registry/constants/details.js b/app/assets/javascripts/packages_and_registries/harbor_registry/constants/details.js index 5b4b85ec31e..ce98be914ae 100644 --- a/app/assets/javascripts/packages_and_registries/harbor_registry/constants/details.js +++ b/app/assets/javascripts/packages_and_registries/harbor_registry/constants/details.js @@ -16,7 +16,7 @@ export const DIGEST_LABEL = s__('HarborRegistry|Digest: %{imageId}'); export const CREATED_AT_LABEL = s__('HarborRegistry|Published %{timeInfo}'); export const NOT_AVAILABLE_TEXT = __('Not applicable.'); -export const NOT_AVAILABLE_SIZE = __('0 bytes'); +export const NOT_AVAILABLE_SIZE = __('0 B'); export const TOKEN_TYPE_TAG_NAME = 'tag_name'; diff --git a/app/assets/javascripts/super_sidebar/components/help_center.vue b/app/assets/javascripts/super_sidebar/components/help_center.vue index 1a965f21ef5..6d51063dbfb 100644 --- a/app/assets/javascripts/super_sidebar/components/help_center.vue +++ b/app/assets/javascripts/super_sidebar/components/help_center.vue @@ -216,7 +216,11 @@ export default { > <template #toggle> <gl-button category="tertiary" icon="question-o" class="btn-with-notification"> - <span v-if="showWhatsNewNotification" class="notification-dot-info"></span> + <span + v-if="showWhatsNewNotification" + data-testid="notification-dot" + class="notification-dot-info" + ></span> {{ $options.i18n.help }} </gl-button> </template> diff --git a/app/assets/stylesheets/framework/sidebar.scss b/app/assets/stylesheets/framework/sidebar.scss index 7a3db63b478..b7a674a35e7 100644 --- a/app/assets/stylesheets/framework/sidebar.scss +++ b/app/assets/stylesheets/framework/sidebar.scss @@ -489,14 +489,12 @@ padding: 0; .issuable-context-form { - $issue-sticky-header-height: 76px; - - top: calc(#{$calc-application-header-height} + #{$issue-sticky-header-height}); - height: calc(#{$calc-application-viewport-height} - #{$issue-sticky-header-height} - var(--mr-review-bar-height) - $content-wrapper-padding); + top: calc(#{$calc-application-header-height} + #{$mr-sticky-header-height}); + height: calc(#{$calc-application-viewport-height} - #{$mr-sticky-header-height} - var(--mr-review-bar-height)); position: sticky; overflow: auto; padding: 0 15px; - margin-bottom: calc((#{$header-height} + $issue-sticky-header-height) * -1); + margin-bottom: calc((#{$content-wrapper-padding} * -1) + var(--mr-review-bar-height)); } } } |